2-104': 0xb32d,\n 'skein512-112': 0xb32e,\n 'skein512-120': 0xb32f,\n 'skein512-128': 0xb330,\n 'skein512-136': 0xb331,\n 'skein512-144': 0xb332,\n 'skein512-152': 0xb333,\n 'skein512-160': 0xb334,\n 'skein512-168': 0xb335,\n 'skein512-176': 0xb336,\n 'skein512-184': 0xb337,\n 'skein512-192': 0xb338,\n 'skein512-200': 0xb339,\n 'skein512-208': 0xb33a,\n 'skein512-216': 0xb33b,\n 'skein512-224': 0xb33c,\n 'skein512-232': 0xb33d,\n 'skein512-240': 0xb33e,\n 'skein512-248': 0xb33f,\n 'skein512-256': 0xb340,\n 'skein512-264': 0xb341,\n 'skein512-272': 0xb342,\n 'skein512-280': 0xb343,\n 'skein512-288': 0xb344,\n 'skein512-296': 0xb345,\n 'skein512-304': 0xb346,\n 'skein512-312': 0xb347,\n 'skein512-320': 0xb348,\n 'skein512-328': 0xb349,\n 'skein512-336': 0xb34a,\n 'skein512-344': 0xb34b,\n 'skein512-352': 0xb34c,\n 'skein512-360': 0xb34d,\n 'skein512-368': 0xb34e,\n 'skein512-376': 0xb34f,\n 'skein512-384': 0xb350,\n 'skein512-392': 0xb351,\n 'skein512-400': 0xb352,\n 'skein512-408': 0xb353,\n 'skein512-416': 0xb354,\n 'skein512-424': 0xb355,\n 'skein512-432': 0xb356,\n 'skein512-440': 0xb357,\n 'skein512-448': 0xb358,\n 'skein512-456': 0xb359,\n 'skein512-464': 0xb35a,\n 'skein512-472': 0xb35b,\n 'skein512-480': 0xb35c,\n 'skein512-488': 0xb35d,\n 'skein512-496': 0xb35e,\n 'skein512-504': 0xb35f,\n 'skein512-512': 0xb360,\n 'skein1024-8': 0xb361,\n 'skein1024-16': 0xb362,\n 'skein1024-24': 0xb363,\n 'skein1024-32': 0xb364,\n 'skein1024-40': 0xb365,\n 'skein1024-48': 0xb366,\n 'skein1024-56': 0xb367,\n 'skein1024-64': 0xb368,\n 'skein1024-72': 0xb369,\n 'skein1024-80': 0xb36a,\n 'skein1024-88': 0xb36b,\n 'skein1024-96': 0xb36c,\n 'skein1024-104': 0xb36d,\n 'skein1024-112': 0xb36e,\n 'skein1024-120': 0xb36f,\n 'skein1024-128': 0xb370,\n 'skein1024-136': 0xb371,\n 'skein1024-144': 0xb372,\n 'skein1024-152': 0xb373,\n 'skein1024-160': 0xb374,\n 'skein1024-168': 0xb375,\n 'skein1024-176': 0xb376,\n 'skein1024-184': 0xb377,\n 'skein1024-192': 0xb378,\n 'skein1024-200': 0xb379,\n 'skein1024-208': 0xb37a,\n 'skein1024-216': 0xb37b,\n 'skein1024-224': 0xb37c,\n 'skein1024-232': 0xb37d,\n 'skein1024-240': 0xb37e,\n 'skein1024-248': 0xb37f,\n 'skein1024-256': 0xb380,\n 'skein1024-264': 0xb381,\n 'skein1024-272': 0xb382,\n 'skein1024-280': 0xb383,\n 'skein1024-288': 0xb384,\n 'skein1024-296': 0xb385,\n 'skein1024-304': 0xb386,\n 'skein1024-312': 0xb387,\n 'skein1024-320': 0xb388,\n 'skein1024-328': 0xb389,\n 'skein1024-336': 0xb38a,\n 'skein1024-344': 0xb38b,\n 'skein1024-352': 0xb38c,\n 'skein1024-360': 0xb38d,\n 'skein1024-368': 0xb38e,\n 'skein1024-376': 0xb38f,\n 'skein1024-384': 0xb390,\n 'skein1024-392': 0xb391,\n 'skein1024-400': 0xb392,\n 'skein1024-408': 0xb393,\n 'skein1024-416': 0xb394,\n 'skein1024-424': 0xb395,\n 'skein1024-432': 0xb396,\n 'skein1024-440': 0xb397,\n 'skein1024-448': 0xb398,\n 'skein1024-456': 0xb399,\n 'skein1024-464': 0xb39a,\n 'skein1024-472': 0xb39b,\n 'skein1024-480': 0xb39c,\n 'skein1024-488': 0xb39d,\n 'skein1024-496': 0xb39e,\n 'skein1024-504': 0xb39f,\n 'skein1024-512': 0xb3a0,\n 'skein1024-520': 0xb3a1,\n 'skein1024-528': 0xb3a2,\n 'skein1024-536': 0xb3a3,\n 'skein1024-544': 0xb3a4,\n 'skein1024-552': 0xb3a5,\n 'skein1024-560': 0xb3a6,\n 'skein1024-568': 0xb3a7,\n 'skein1024-576': 0xb3a8,\n 'skein1024-584': 0xb3a9,\n 'skein1024-592': 0xb3aa,\n 'skein1024-600': 0xb3ab,\n 'skein1024-608': 0xb3ac,\n 'skein1024-616': 0xb3ad,\n 'skein1024-624': 0xb3ae,\n 'skein1024-632': 0xb3af,\n 'skein1024-640': 0xb3b0,\n 'skein1024-648': 0xb3b1,\n 'skein1024-656': 0xb3b2,\n 'skein1024-664': 0xb3b3,\n 'skein1024-672': 0xb3b4,\n 'skein1024-680': 0xb3b5,\n 'skein1024-688': 0xb3b6,\n 'skein1024-696': 0xb3b7,\n 'skein1024-704': 0xb3b8,\n 'skein1024-712': 0xb3b9,\n 'skein1024-720': 0xb3ba,\n 'skein1024-728': 0xb3bb,\n 'skein1024-736': 0xb3bc,\n 'skein1024-744': 0xb3bd,\n 'skein1024-752': 0xb3be,\n 'skein1024-760': 0xb3bf,\n 'skein1024-768': 0xb3c0,\n 'skein1024-776': 0xb3c1,\n 'skein1024-784': 0xb3c2,\n 'skein1024-792': 0xb3c3,\n 'skein1024-800': 0xb3c4,\n 'skein1024-808': 0xb3c5,\n 'skein1024-816': 0xb3c6,\n 'skein1024-824': 0xb3c7,\n 'skein1024-832': 0xb3c8,\n 'skein1024-840': 0xb3c9,\n 'skein1024-848': 0xb3ca,\n 'skein1024-856': 0xb3cb,\n 'skein1024-864': 0xb3cc,\n 'skein1024-872': 0xb3cd,\n 'skein1024-880': 0xb3ce,\n 'skein1024-888': 0xb3cf,\n 'skein1024-896': 0xb3d0,\n 'skein1024-904': 0xb3d1,\n 'skein1024-912': 0xb3d2,\n 'skein1024-920': 0xb3d3,\n 'skein1024-928': 0xb3d4,\n 'skein1024-936': 0xb3d5,\n 'skein1024-944': 0xb3d6,\n 'skein1024-952': 0xb3d7,\n 'skein1024-960': 0xb3d8,\n 'skein1024-968': 0xb3d9,\n 'skein1024-976': 0xb3da,\n 'skein1024-984': 0xb3db,\n 'skein1024-992': 0xb3dc,\n 'skein1024-1000': 0xb3dd,\n 'skein1024-1008': 0xb3de,\n 'skein1024-1016': 0xb3df,\n 'skein1024-1024': 0xb3e0,\n 'poseidon-bls12_381-a2-fc1': 0xb401,\n 'poseidon-bls12_381-a2-fc1-sc': 0xb402,\n 'zeroxcert-imprint-256': 0xce11,\n 'fil-commitment-unsealed': 0xf101,\n 'fil-commitment-sealed': 0xf102,\n 'holochain-adr-v0': 0x807124,\n 'holochain-adr-v1': 0x817124,\n 'holochain-key-v0': 0x947124,\n 'holochain-key-v1': 0x957124,\n 'holochain-sig-v0': 0xa27124,\n 'holochain-sig-v1': 0xa37124,\n 'skynet-ns': 0xb19910\n})\n\nmodule.exports = { baseTable }\n","'use strict'\n\nconst errcode = require('err-code')\nconst multihash = require('multihashes')\nconst crypto = require('./crypto')\nconst equals = require('uint8arrays/equals')\n\n/**\n * @typedef {import(\"./types\").Digest} Digest\n * @typedef {import(\"multihashes\").HashName} HashName\n */\n\n/**\n * Hash the given `bytes` using the algorithm specified by `alg`.\n *\n * @param {Uint8Array} bytes - The value to hash.\n * @param {HashName} alg - The algorithm to use eg 'sha1'\n * @param {number} [length] - Optionally trim the result to this length.\n * @returns {Promise}\n */\nasync function Multihashing (bytes, alg, length) {\n const digest = await Multihashing.digest(bytes, alg, length)\n return multihash.encode(digest, alg, length)\n}\n\n/**\n * Expose multihash itself, to avoid silly double requires.\n */\nMultihashing.multihash = multihash\n\n/**\n * @param {Uint8Array} bytes - The value to hash.\n * @param {HashName} alg - The algorithm to use eg 'sha1'\n * @param {number} [length] - Optionally trim the result to this length.\n * @returns {Promise}\n */\nMultihashing.digest = async (bytes, alg, length) => {\n const hash = Multihashing.createHash(alg)\n const digest = await hash(bytes)\n return length ? digest.slice(0, length) : digest\n}\n\n/**\n * Creates a function that hashes with the given algorithm\n *\n * @param {HashName} alg - The algorithm to use eg 'sha1'\n * @returns {Digest} - The hash function corresponding to `alg`\n */\nMultihashing.createHash = function (alg) {\n if (!alg) {\n const e = errcode(new Error('hash algorithm must be specified'), 'ERR_HASH_ALGORITHM_NOT_SPECIFIED')\n throw e\n }\n\n const code = multihash.coerceCode(alg)\n if (!Multihashing.functions[code]) {\n throw errcode(new Error(`multihash function '${alg}' not yet supported`), 'ERR_HASH_ALGORITHM_NOT_SUPPORTED')\n }\n\n return Multihashing.functions[code]\n}\n\n/**\n * Mapping of multihash codes to their hashing functions.\n *\n * @type {Record}\n */\n// @ts-ignore - most of those functions aren't typed\nMultihashing.functions = {\n // identity\n 0x00: crypto.identity,\n // sha1\n 0x11: crypto.sha1,\n // sha2-256\n 0x12: crypto.sha2256,\n // sha2-512\n 0x13: crypto.sha2512,\n // sha3-512\n 0x14: crypto.sha3512,\n // sha3-384\n 0x15: crypto.sha3384,\n // sha3-256\n 0x16: crypto.sha3256,\n // sha3-224\n 0x17: crypto.sha3224,\n // shake-128\n 0x18: crypto.shake128,\n // shake-256\n 0x19: crypto.shake256,\n // keccak-224\n 0x1A: crypto.keccak224,\n // keccak-256\n 0x1B: crypto.keccak256,\n // keccak-384\n 0x1C: crypto.keccak384,\n // keccak-512\n 0x1D: crypto.keccak512,\n // murmur3-128\n 0x22: crypto.murmur3128,\n // murmur3-32\n 0x23: crypto.murmur332,\n // dbl-sha2-256\n 0x56: crypto.dblSha2256\n}\n\n// add blake functions\ncrypto.addBlake(Multihashing.functions)\n\n/**\n * @param {Uint8Array} bytes\n * @param {Uint8Array} hash\n * @returns {Promise}\n */\nMultihashing.validate = async (bytes, hash) => {\n const newHash = await Multihashing(bytes, multihash.decode(hash).name)\n\n return equals(hash, newHash)\n}\n\nmodule.exports = Multihashing\n","'use strict';\n\n/**\n * @typedef {{ [key: string]: any }} Extensions\n * @typedef {Error} Err\n * @property {string} message\n */\n\n/**\n *\n * @param {Error} obj\n * @param {Extensions} props\n * @returns {Error & Extensions}\n */\nfunction assign(obj, props) {\n for (const key in props) {\n Object.defineProperty(obj, key, {\n value: props[key],\n enumerable: true,\n configurable: true,\n });\n }\n\n return obj;\n}\n\n/**\n *\n * @param {any} err - An Error\n * @param {string|Extensions} code - A string code or props to set on the error\n * @param {Extensions} [props] - Props to set on the error\n * @returns {Error & Extensions}\n */\nfunction createError(err, code, props) {\n if (!err || typeof err === 'string') {\n throw new TypeError('Please pass an Error to err-code');\n }\n\n if (!props) {\n props = {};\n }\n\n if (typeof code === 'object') {\n props = code;\n code = '';\n }\n\n if (code) {\n props.code = code;\n }\n\n try {\n return assign(err, props);\n } catch (_) {\n props.message = err.message;\n props.stack = err.stack;\n\n const ErrClass = function () {};\n\n ErrClass.prototype = Object.create(Object.getPrototypeOf(err));\n\n // @ts-ignore\n const output = assign(new ErrClass(), props);\n\n return output;\n }\n}\n\nmodule.exports = createError;\n","/* eslint quote-props: off */\n'use strict'\n\n/**\n * Names for all available hashes\n *\n * @typedef { \"identity\" | \"sha1\" | \"sha2-256\" | \"sha2-512\" | \"sha3-512\" | \"sha3-384\" | \"sha3-256\" | \"sha3-224\" | \"shake-128\" | \"shake-256\" | \"keccak-224\" | \"keccak-256\" | \"keccak-384\" | \"keccak-512\" | \"blake3\" | \"murmur3-128\" | \"murmur3-32\" | \"dbl-sha2-256\" | \"md4\" | \"md5\" | \"bmt\" | \"sha2-256-trunc254-padded\" | \"ripemd-128\" | \"ripemd-160\" | \"ripemd-256\" | \"ripemd-320\" | \"x11\" | \"kangarootwelve\" | \"sm3-256\" | \"blake2b-8\" | \"blake2b-16\" | \"blake2b-24\" | \"blake2b-32\" | \"blake2b-40\" | \"blake2b-48\" | \"blake2b-56\" | \"blake2b-64\" | \"blake2b-72\" | \"blake2b-80\" | \"blake2b-88\" | \"blake2b-96\" | \"blake2b-104\" | \"blake2b-112\" | \"blake2b-120\" | \"blake2b-128\" | \"blake2b-136\" | \"blake2b-144\" | \"blake2b-152\" | \"blake2b-160\" | \"blake2b-168\" | \"blake2b-176\" | \"blake2b-184\" | \"blake2b-192\" | \"blake2b-200\" | \"blake2b-208\" | \"blake2b-216\" | \"blake2b-224\" | \"blake2b-232\" | \"blake2b-240\" | \"blake2b-248\" | \"blake2b-256\" | \"blake2b-264\" | \"blake2b-272\" | \"blake2b-280\" | \"blake2b-288\" | \"blake2b-296\" | \"blake2b-304\" | \"blake2b-312\" | \"blake2b-320\" | \"blake2b-328\" | \"blake2b-336\" | \"blake2b-344\" | \"blake2b-352\" | \"blake2b-360\" | \"blake2b-368\" | \"blake2b-376\" | \"blake2b-384\" | \"blake2b-392\" | \"blake2b-400\" | \"blake2b-408\" | \"blake2b-416\" | \"blake2b-424\" | \"blake2b-432\" | \"blake2b-440\" | \"blake2b-448\" | \"blake2b-456\" | \"blake2b-464\" | \"blake2b-472\" | \"blake2b-480\" | \"blake2b-488\" | \"blake2b-496\" | \"blake2b-504\" | \"blake2b-512\" | \"blake2s-8\" | \"blake2s-16\" | \"blake2s-24\" | \"blake2s-32\" | \"blake2s-40\" | \"blake2s-48\" | \"blake2s-56\" | \"blake2s-64\" | \"blake2s-72\" | \"blake2s-80\" | \"blake2s-88\" | \"blake2s-96\" | \"blake2s-104\" | \"blake2s-112\" | \"blake2s-120\" | \"blake2s-128\" | \"blake2s-136\" | \"blake2s-144\" | \"blake2s-152\" | \"blake2s-160\" | \"blake2s-168\" | \"blake2s-176\" | \"blake2s-184\" | \"blake2s-192\" | \"blake2s-200\" | \"blake2s-208\" | \"blake2s-216\" | \"blake2s-224\" | \"blake2s-232\" | \"blake2s-240\" | \"blake2s-248\" | \"blake2s-256\" | \"skein256-8\" | \"skein256-16\" | \"skein256-24\" | \"skein256-32\" | \"skein256-40\" | \"skein256-48\" | \"skein256-56\" | \"skein256-64\" | \"skein256-72\" | \"skein256-80\" | \"skein256-88\" | \"skein256-96\" | \"skein256-104\" | \"skein256-112\" | \"skein256-120\" | \"skein256-128\" | \"skein256-136\" | \"skein256-144\" | \"skein256-152\" | \"skein256-160\" | \"skein256-168\" | \"skein256-176\" | \"skein256-184\" | \"skein256-192\" | \"skein256-200\" | \"skein256-208\" | \"skein256-216\" | \"skein256-224\" | \"skein256-232\" | \"skein256-240\" | \"skein256-248\" | \"skein256-256\" | \"skein512-8\" | \"skein512-16\" | \"skein512-24\" | \"skein512-32\" | \"skein512-40\" | \"skein512-48\" | \"skein512-56\" | \"skein512-64\" | \"skein512-72\" | \"skein512-80\" | \"skein512-88\" | \"skein512-96\" | \"skein512-104\" | \"skein512-112\" | \"skein512-120\" | \"skein512-128\" | \"skein512-136\" | \"skein512-144\" | \"skein512-152\" | \"skein512-160\" | \"skein512-168\" | \"skein512-176\" | \"skein512-184\" | \"skein512-192\" | \"skein512-200\" | \"skein512-208\" | \"skein512-216\" | \"skein512-224\" | \"skein512-232\" | \"skein512-240\" | \"skein512-248\" | \"skein512-256\" | \"skein512-264\" | \"skein512-272\" | \"skein512-280\" | \"skein512-288\" | \"skein512-296\" | \"skein512-304\" | \"skein512-312\" | \"skein512-320\" | \"skein512-328\" | \"skein512-336\" | \"skein512-344\" | \"skein512-352\" | \"skein512-360\" | \"skein512-368\" | \"skein512-376\" | \"skein512-384\" | \"skein512-392\" | \"skein512-400\" | \"skein512-408\" | \"skein512-416\" | \"skein512-424\" | \"skein512-432\" | \"skein512-440\" | \"skein512-448\" | \"skein512-456\" | \"skein512-464\" | \"skein512-472\" | \"skein512-480\" | \"skein512-488\" | \"skein512-496\" | \"skein512-504\" | \"skein512-512\" | \"skein1024-8\" | \"skein1024-16\" | \"skein1024-24\" | \"skein1024-32\" | \"skein1024-40\" | \"skein1024-48\" | \"skein1024-56\" | \"skein1024-64\" | \"skein1024-72\" | \"skein1024-80\" | \"skein1024-88\" | \"skein1024-96\" | \"skein1024-104\" | \"skein1024-112\" | \"skein1024-120\" | \"skein1024-128\" | \"skein1024-136\" | \"skein1024-144\" | \"skein1024-152\" | \"skein1024-160\" | \"skein1024-168\" | \"skein1024-176\" | \"skein1024-184\" | \"skein1024-192\" | \"skein1024-200\" | \"skein1024-208\" | \"skein1024-216\" | \"skein1024-224\" | \"skein1024-232\" | \"skein1024-240\" | \"skein1024-248\" | \"skein1024-256\" | \"skein1024-264\" | \"skein1024-272\" | \"skein1024-280\" | \"skein1024-288\" | \"skein1024-296\" | \"skein1024-304\" | \"skein1024-312\" | \"skein1024-320\" | \"skein1024-328\" | \"skein1024-336\" | \"skein1024-344\" | \"skein1024-352\" | \"skein1024-360\" | \"skein1024-368\" | \"skein1024-376\" | \"skein1024-384\" | \"skein1024-392\" | \"skein1024-400\" | \"skein1024-408\" | \"skein1024-416\" | \"skein1024-424\" | \"skein1024-432\" | \"skein1024-440\" | \"skein1024-448\" | \"skein1024-456\" | \"skein1024-464\" | \"skein1024-472\" | \"skein1024-480\" | \"skein1024-488\" | \"skein1024-496\" | \"skein1024-504\" | \"skein1024-512\" | \"skein1024-520\" | \"skein1024-528\" | \"skein1024-536\" | \"skein1024-544\" | \"skein1024-552\" | \"skein1024-560\" | \"skein1024-568\" | \"skein1024-576\" | \"skein1024-584\" | \"skein1024-592\" | \"skein1024-600\" | \"skein1024-608\" | \"skein1024-616\" | \"skein1024-624\" | \"skein1024-632\" | \"skein1024-640\" | \"skein1024-648\" | \"skein1024-656\" | \"skein1024-664\" | \"skein1024-672\" | \"skein1024-680\" | \"skein1024-688\" | \"skein1024-696\" | \"skein1024-704\" | \"skein1024-712\" | \"skein1024-720\" | \"skein1024-728\" | \"skein1024-736\" | \"skein1024-744\" | \"skein1024-752\" | \"skein1024-760\" | \"skein1024-768\" | \"skein1024-776\" | \"skein1024-784\" | \"skein1024-792\" | \"skein1024-800\" | \"skein1024-808\" | \"skein1024-816\" | \"skein1024-824\" | \"skein1024-832\" | \"skein1024-840\" | \"skein1024-848\" | \"skein1024-856\" | \"skein1024-864\" | \"skein1024-872\" | \"skein1024-880\" | \"skein1024-888\" | \"skein1024-896\" | \"skein1024-904\" | \"skein1024-912\" | \"skein1024-920\" | \"skein1024-928\" | \"skein1024-936\" | \"skein1024-944\" | \"skein1024-952\" | \"skein1024-960\" | \"skein1024-968\" | \"skein1024-976\" | \"skein1024-984\" | \"skein1024-992\" | \"skein1024-1000\" | \"skein1024-1008\" | \"skein1024-1016\" | \"skein1024-1024\" | \"poseidon-bls12_381-a2-fc1\" | \"poseidon-bls12_381-a2-fc1-sc\" } HashName\n */\n/**\n * Codes for all available hashes\n *\n * @typedef { 0x00 | 0x11 | 0x12 | 0x13 | 0x14 | 0x15 | 0x16 | 0x17 | 0x18 | 0x19 | 0x1a | 0x1b | 0x1c | 0x1d | 0x1e | 0x22 | 0x23 | 0x56 | 0xd4 | 0xd5 | 0xd6 | 0x1012 | 0x1052 | 0x1053 | 0x1054 | 0x1055 | 0x1100 | 0x1d01 | 0x534d | 0xb201 | 0xb202 | 0xb203 | 0xb204 | 0xb205 | 0xb206 | 0xb207 | 0xb208 | 0xb209 | 0xb20a | 0xb20b | 0xb20c | 0xb20d | 0xb20e | 0xb20f | 0xb210 | 0xb211 | 0xb212 | 0xb213 | 0xb214 | 0xb215 | 0xb216 | 0xb217 | 0xb218 | 0xb219 | 0xb21a | 0xb21b | 0xb21c | 0xb21d | 0xb21e | 0xb21f | 0xb220 | 0xb221 | 0xb222 | 0xb223 | 0xb224 | 0xb225 | 0xb226 | 0xb227 | 0xb228 | 0xb229 | 0xb22a | 0xb22b | 0xb22c | 0xb22d | 0xb22e | 0xb22f | 0xb230 | 0xb231 | 0xb232 | 0xb233 | 0xb234 | 0xb235 | 0xb236 | 0xb237 | 0xb238 | 0xb239 | 0xb23a | 0xb23b | 0xb23c | 0xb23d | 0xb23e | 0xb23f | 0xb240 | 0xb241 | 0xb242 | 0xb243 | 0xb244 | 0xb245 | 0xb246 | 0xb247 | 0xb248 | 0xb249 | 0xb24a | 0xb24b | 0xb24c | 0xb24d | 0xb24e | 0xb24f | 0xb250 | 0xb251 | 0xb252 | 0xb253 | 0xb254 | 0xb255 | 0xb256 | 0xb257 | 0xb258 | 0xb259 | 0xb25a | 0xb25b | 0xb25c | 0xb25d | 0xb25e | 0xb25f | 0xb260 | 0xb301 | 0xb302 | 0xb303 | 0xb304 | 0xb305 | 0xb306 | 0xb307 | 0xb308 | 0xb309 | 0xb30a | 0xb30b | 0xb30c | 0xb30d | 0xb30e | 0xb30f | 0xb310 | 0xb311 | 0xb312 | 0xb313 | 0xb314 | 0xb315 | 0xb316 | 0xb317 | 0xb318 | 0xb319 | 0xb31a | 0xb31b | 0xb31c | 0xb31d | 0xb31e | 0xb31f | 0xb320 | 0xb321 | 0xb322 | 0xb323 | 0xb324 | 0xb325 | 0xb326 | 0xb327 | 0xb328 | 0xb329 | 0xb32a | 0xb32b | 0xb32c | 0xb32d | 0xb32e | 0xb32f | 0xb330 | 0xb331 | 0xb332 | 0xb333 | 0xb334 | 0xb335 | 0xb336 | 0xb337 | 0xb338 | 0xb339 | 0xb33a | 0xb33b | 0xb33c | 0xb33d | 0xb33e | 0xb33f | 0xb340 | 0xb341 | 0xb342 | 0xb343 | 0xb344 | 0xb345 | 0xb346 | 0xb347 | 0xb348 | 0xb349 | 0xb34a | 0xb34b | 0xb34c | 0xb34d | 0xb34e | 0xb34f | 0xb350 | 0xb351 | 0xb352 | 0xb353 | 0xb354 | 0xb355 | 0xb356 | 0xb357 | 0xb358 | 0xb359 | 0xb35a | 0xb35b | 0xb35c | 0xb35d | 0xb35e | 0xb35f | 0xb360 | 0xb361 | 0xb362 | 0xb363 | 0xb364 | 0xb365 | 0xb366 | 0xb367 | 0xb368 | 0xb369 | 0xb36a | 0xb36b | 0xb36c | 0xb36d | 0xb36e | 0xb36f | 0xb370 | 0xb371 | 0xb372 | 0xb373 | 0xb374 | 0xb375 | 0xb376 | 0xb377 | 0xb378 | 0xb379 | 0xb37a | 0xb37b | 0xb37c | 0xb37d | 0xb37e | 0xb37f | 0xb380 | 0xb381 | 0xb382 | 0xb383 | 0xb384 | 0xb385 | 0xb386 | 0xb387 | 0xb388 | 0xb389 | 0xb38a | 0xb38b | 0xb38c | 0xb38d | 0xb38e | 0xb38f | 0xb390 | 0xb391 | 0xb392 | 0xb393 | 0xb394 | 0xb395 | 0xb396 | 0xb397 | 0xb398 | 0xb399 | 0xb39a | 0xb39b | 0xb39c | 0xb39d | 0xb39e | 0xb39f | 0xb3a0 | 0xb3a1 | 0xb3a2 | 0xb3a3 | 0xb3a4 | 0xb3a5 | 0xb3a6 | 0xb3a7 | 0xb3a8 | 0xb3a9 | 0xb3aa | 0xb3ab | 0xb3ac | 0xb3ad | 0xb3ae | 0xb3af | 0xb3b0 | 0xb3b1 | 0xb3b2 | 0xb3b3 | 0xb3b4 | 0xb3b5 | 0xb3b6 | 0xb3b7 | 0xb3b8 | 0xb3b9 | 0xb3ba | 0xb3bb | 0xb3bc | 0xb3bd | 0xb3be | 0xb3bf | 0xb3c0 | 0xb3c1 | 0xb3c2 | 0xb3c3 | 0xb3c4 | 0xb3c5 | 0xb3c6 | 0xb3c7 | 0xb3c8 | 0xb3c9 | 0xb3ca | 0xb3cb | 0xb3cc | 0xb3cd | 0xb3ce | 0xb3cf | 0xb3d0 | 0xb3d1 | 0xb3d2 | 0xb3d3 | 0xb3d4 | 0xb3d5 | 0xb3d6 | 0xb3d7 | 0xb3d8 | 0xb3d9 | 0xb3da | 0xb3db | 0xb3dc | 0xb3dd | 0xb3de | 0xb3df | 0xb3e0 | 0xb401 | 0xb402 } HashCode\n */\n\n/**\n * @type { Record }\n */\nconst names = Object.freeze({\n 'identity': 0x00,\n 'sha1': 0x11,\n 'sha2-256': 0x12,\n 'sha2-512': 0x13,\n 'sha3-512': 0x14,\n 'sha3-384': 0x15,\n 'sha3-256': 0x16,\n 'sha3-224': 0x17,\n 'shake-128': 0x18,\n 'shake-256': 0x19,\n 'keccak-224': 0x1a,\n 'keccak-256': 0x1b,\n 'keccak-384': 0x1c,\n 'keccak-512': 0x1d,\n 'blake3': 0x1e,\n 'murmur3-128': 0x22,\n 'murmur3-32': 0x23,\n 'dbl-sha2-256': 0x56,\n 'md4': 0xd4,\n 'md5': 0xd5,\n 'bmt': 0xd6,\n 'sha2-256-trunc254-padded': 0x1012,\n 'ripemd-128': 0x1052,\n 'ripemd-160': 0x1053,\n 'ripemd-256': 0x1054,\n 'ripemd-320': 0x1055,\n 'x11': 0x1100,\n 'kangarootwelve': 0x1d01,\n 'sm3-256': 0x534d,\n 'blake2b-8': 0xb201,\n 'blake2b-16': 0xb202,\n 'blake2b-24': 0xb203,\n 'blake2b-32': 0xb204,\n 'blake2b-40': 0xb205,\n 'blake2b-48': 0xb206,\n 'blake2b-56': 0xb207,\n 'blake2b-64': 0xb208,\n 'blake2b-72': 0xb209,\n 'blake2b-80': 0xb20a,\n 'blake2b-88': 0xb20b,\n 'blake2b-96': 0xb20c,\n 'blake2b-104': 0xb20d,\n 'blake2b-112': 0xb20e,\n 'blake2b-120': 0xb20f,\n 'blake2b-128': 0xb210,\n 'blake2b-136': 0xb211,\n 'blake2b-144': 0xb212,\n 'blake2b-152': 0xb213,\n 'blake2b-160': 0xb214,\n 'blake2b-168': 0xb215,\n 'blake2b-176': 0xb216,\n 'blake2b-184': 0xb217,\n 'blake2b-192': 0xb218,\n 'blake2b-200': 0xb219,\n 'blake2b-208': 0xb21a,\n 'blake2b-216': 0xb21b,\n 'blake2b-224': 0xb21c,\n 'blake2b-232': 0xb21d,\n 'blake2b-240': 0xb21e,\n 'blake2b-248': 0xb21f,\n 'blake2b-256': 0xb220,\n 'blake2b-264': 0xb221,\n 'blake2b-272': 0xb222,\n 'blake2b-280': 0xb223,\n 'blake2b-288': 0xb224,\n 'blake2b-296': 0xb225,\n 'blake2b-304': 0xb226,\n 'blake2b-312': 0xb227,\n 'blake2b-320': 0xb228,\n 'blake2b-328': 0xb229,\n 'blake2b-336': 0xb22a,\n 'blake2b-344': 0xb22b,\n 'blake2b-352': 0xb22c,\n 'blake2b-360': 0xb22d,\n 'blake2b-368': 0xb22e,\n 'blake2b-376': 0xb22f,\n 'blake2b-384': 0xb230,\n 'blake2b-392': 0xb231,\n 'blake2b-400': 0xb232,\n 'blake2b-408': 0xb233,\n 'blake2b-416': 0xb234,\n 'blake2b-424': 0xb235,\n 'blake2b-432': 0xb236,\n 'blake2b-440': 0xb237,\n 'blake2b-448': 0xb238,\n 'blake2b-456': 0xb239,\n 'blake2b-464': 0xb23a,\n 'blake2b-472': 0xb23b,\n 'blake2b-480': 0xb23c,\n 'blake2b-488': 0xb23d,\n 'blake2b-496': 0xb23e,\n 'blake2b-504': 0xb23f,\n 'blake2b-512': 0xb240,\n 'blake2s-8': 0xb241,\n 'blake2s-16': 0xb242,\n 'blake2s-24': 0xb243,\n 'blake2s-32': 0xb244,\n 'blake2s-40': 0xb245,\n 'blake2s-48': 0xb246,\n 'blake2s-56': 0xb247,\n 'blake2s-64': 0xb248,\n 'blake2s-72': 0xb249,\n 'blake2s-80': 0xb24a,\n 'blake2s-88': 0xb24b,\n 'blake2s-96': 0xb24c,\n 'blake2s-104': 0xb24d,\n 'blake2s-112': 0xb24e,\n 'blake2s-120': 0xb24f,\n 'blake2s-128': 0xb250,\n 'blake2s-136': 0xb251,\n 'blake2s-144': 0xb252,\n 'blake2s-152': 0xb253,\n 'blake2s-160': 0xb254,\n 'blake2s-168': 0xb255,\n 'blake2s-176': 0xb256,\n 'blake2s-184': 0xb257,\n 'blake2s-192': 0xb258,\n 'blake2s-200': 0xb259,\n 'blake2s-208': 0xb25a,\n 'blake2s-216': 0xb25b,\n 'blake2s-224': 0xb25c,\n 'blake2s-232': 0xb25d,\n 'blake2s-240': 0xb25e,\n 'blake2s-248': 0xb25f,\n 'blake2s-256': 0xb260,\n 'skein256-8': 0xb301,\n 'skein256-16': 0xb302,\n 'skein256-24': 0xb303,\n 'skein256-32': 0xb304,\n 'skein256-40': 0xb305,\n 'skein256-48': 0xb306,\n 'skein256-56': 0xb307,\n 'skein256-64': 0xb308,\n 'skein256-72': 0xb309,\n 'skein256-80': 0xb30a,\n 'skein256-88': 0xb30b,\n 'skein256-96': 0xb30c,\n 'skein256-104': 0xb30d,\n 'skein256-112': 0xb30e,\n 'skein256-120': 0xb30f,\n 'skein256-128': 0xb310,\n 'skein256-136': 0xb311,\n 'skein256-144': 0xb312,\n 'skein256-152': 0xb313,\n 'skein256-160': 0xb314,\n 'skein256-168': 0xb315,\n 'skein256-176': 0xb316,\n 'skein256-184': 0xb317,\n 'skein256-192': 0xb318,\n 'skein256-200': 0xb319,\n 'skein256-208': 0xb31a,\n 'skein256-216': 0xb31b,\n 'skein256-224': 0xb31c,\n 'skein256-232': 0xb31d,\n 'skein256-240': 0xb31e,\n 'skein256-248': 0xb31f,\n 'skein256-256': 0xb320,\n 'skein512-8': 0xb321,\n 'skein512-16': 0xb322,\n 'skein512-24': 0xb323,\n 'skein512-32': 0xb324,\n 'skein512-40': 0xb325,\n 'skein512-48': 0xb326,\n 'skein512-56': 0xb327,\n 'skein512-64': 0xb328,\n 'skein512-72': 0xb329,\n 'skein512-80': 0xb32a,\n 'skein512-88': 0xb32b,\n 'skein512-96': 0xb32c,\n 'skein512-104': 0xb32d,\n 'skein512-112': 0xb32e,\n 'skein512-120': 0xb32f,\n 'skein512-128': 0xb330,\n 'skein512-136': 0xb331,\n 'skein512-144': 0xb332,\n 'skein512-152': 0xb333,\n 'skein512-160': 0xb334,\n 'skein512-168': 0xb335,\n 'skein512-176': 0xb336,\n 'skein512-184': 0xb337,\n 'skein512-192': 0xb338,\n 'skein512-200': 0xb339,\n 'skein512-208': 0xb33a,\n 'skein512-216': 0xb33b,\n 'skein512-224': 0xb33c,\n 'skein512-232': 0xb33d,\n 'skein512-240': 0xb33e,\n 'skein512-248': 0xb33f,\n 'skein512-256': 0xb340,\n 'skein512-264': 0xb341,\n 'skein512-272': 0xb342,\n 'skein512-280': 0xb343,\n 'skein512-288': 0xb344,\n 'skein512-296': 0xb345,\n 'skein512-304': 0xb346,\n 'skein512-312': 0xb347,\n 'skein512-320': 0xb348,\n 'skein512-328': 0xb349,\n 'skein512-336': 0xb34a,\n 'skein512-344': 0xb34b,\n 'skein512-352': 0xb34c,\n 'skein512-360': 0xb34d,\n 'skein512-368': 0xb34e,\n 'skein512-376': 0xb34f,\n 'skein512-384': 0xb350,\n 'skein512-392': 0xb351,\n 'skein512-400': 0xb352,\n 'skein512-408': 0xb353,\n 'skein512-416': 0xb354,\n 'skein512-424': 0xb355,\n 'skein512-432': 0xb356,\n 'skein512-440': 0xb357,\n 'skein512-448': 0xb358,\n 'skein512-456': 0xb359,\n 'skein512-464': 0xb35a,\n 'skein512-472': 0xb35b,\n 'skein512-480': 0xb35c,\n 'skein512-488': 0xb35d,\n 'skein512-496': 0xb35e,\n 'skein512-504': 0xb35f,\n 'skein512-512': 0xb360,\n 'skein1024-8': 0xb361,\n 'skein1024-16': 0xb362,\n 'skein1024-24': 0xb363,\n 'skein1024-32': 0xb364,\n 'skein1024-40': 0xb365,\n 'skein1024-48': 0xb366,\n 'skein1024-56': 0xb367,\n 'skein1024-64': 0xb368,\n 'skein1024-72': 0xb369,\n 'skein1024-80': 0xb36a,\n 'skein1024-88': 0xb36b,\n 'skein1024-96': 0xb36c,\n 'skein1024-104': 0xb36d,\n 'skein1024-112': 0xb36e,\n 'skein1024-120': 0xb36f,\n 'skein1024-128': 0xb370,\n 'skein1024-136': 0xb371,\n 'skein1024-144': 0xb372,\n 'skein1024-152': 0xb373,\n 'skein1024-160': 0xb374,\n 'skein1024-168': 0xb375,\n 'skein1024-176': 0xb376,\n 'skein1024-184': 0xb377,\n 'skein1024-192': 0xb378,\n 'skein1024-200': 0xb379,\n 'skein1024-208': 0xb37a,\n 'skein1024-216': 0xb37b,\n 'skein1024-224': 0xb37c,\n 'skein1024-232': 0xb37d,\n 'skein1024-240': 0xb37e,\n 'skein1024-248': 0xb37f,\n 'skein1024-256': 0xb380,\n 'skein1024-264': 0xb381,\n 'skein1024-272': 0xb382,\n 'skein1024-280': 0xb383,\n 'skein1024-288': 0xb384,\n 'skein1024-296': 0xb385,\n 'skein1024-304': 0xb386,\n 'skein1024-312': 0xb387,\n 'skein1024-320': 0xb388,\n 'skein1024-328': 0xb389,\n 'skein1024-336': 0xb38a,\n 'skein1024-344': 0xb38b,\n 'skein1024-352': 0xb38c,\n 'skein1024-360': 0xb38d,\n 'skein1024-368': 0xb38e,\n 'skein1024-376': 0xb38f,\n 'skein1024-384': 0xb390,\n 'skein1024-392': 0xb391,\n 'skein1024-400': 0xb392,\n 'skein1024-408': 0xb393,\n 'skein1024-416': 0xb394,\n 'skein1024-424': 0xb395,\n 'skein1024-432': 0xb396,\n 'skein1024-440': 0xb397,\n 'skein1024-448': 0xb398,\n 'skein1024-456': 0xb399,\n 'skein1024-464': 0xb39a,\n 'skein1024-472': 0xb39b,\n 'skein1024-480': 0xb39c,\n 'skein1024-488': 0xb39d,\n 'skein1024-496': 0xb39e,\n 'skein1024-504': 0xb39f,\n 'skein1024-512': 0xb3a0,\n 'skein1024-520': 0xb3a1,\n 'skein1024-528': 0xb3a2,\n 'skein1024-536': 0xb3a3,\n 'skein1024-544': 0xb3a4,\n 'skein1024-552': 0xb3a5,\n 'skein1024-560': 0xb3a6,\n 'skein1024-568': 0xb3a7,\n 'skein1024-576': 0xb3a8,\n 'skein1024-584': 0xb3a9,\n 'skein1024-592': 0xb3aa,\n 'skein1024-600': 0xb3ab,\n 'skein1024-608': 0xb3ac,\n 'skein1024-616': 0xb3ad,\n 'skein1024-624': 0xb3ae,\n 'skein1024-632': 0xb3af,\n 'skein1024-640': 0xb3b0,\n 'skein1024-648': 0xb3b1,\n 'skein1024-656': 0xb3b2,\n 'skein1024-664': 0xb3b3,\n 'skein1024-672': 0xb3b4,\n 'skein1024-680': 0xb3b5,\n 'skein1024-688': 0xb3b6,\n 'skein1024-696': 0xb3b7,\n 'skein1024-704': 0xb3b8,\n 'skein1024-712': 0xb3b9,\n 'skein1024-720': 0xb3ba,\n 'skein1024-728': 0xb3bb,\n 'skein1024-736': 0xb3bc,\n 'skein1024-744': 0xb3bd,\n 'skein1024-752': 0xb3be,\n 'skein1024-760': 0xb3bf,\n 'skein1024-768': 0xb3c0,\n 'skein1024-776': 0xb3c1,\n 'skein1024-784': 0xb3c2,\n 'skein1024-792': 0xb3c3,\n 'skein1024-800': 0xb3c4,\n 'skein1024-808': 0xb3c5,\n 'skein1024-816': 0xb3c6,\n 'skein1024-824': 0xb3c7,\n 'skein1024-832': 0xb3c8,\n 'skein1024-840': 0xb3c9,\n 'skein1024-848': 0xb3ca,\n 'skein1024-856': 0xb3cb,\n 'skein1024-864': 0xb3cc,\n 'skein1024-872': 0xb3cd,\n 'skein1024-880': 0xb3ce,\n 'skein1024-888': 0xb3cf,\n 'skein1024-896': 0xb3d0,\n 'skein1024-904': 0xb3d1,\n 'skein1024-912': 0xb3d2,\n 'skein1024-920': 0xb3d3,\n 'skein1024-928': 0xb3d4,\n 'skein1024-936': 0xb3d5,\n 'skein1024-944': 0xb3d6,\n 'skein1024-952': 0xb3d7,\n 'skein1024-960': 0xb3d8,\n 'skein1024-968': 0xb3d9,\n 'skein1024-976': 0xb3da,\n 'skein1024-984': 0xb3db,\n 'skein1024-992': 0xb3dc,\n 'skein1024-1000': 0xb3dd,\n 'skein1024-1008': 0xb3de,\n 'skein1024-1016': 0xb3df,\n 'skein1024-1024': 0xb3e0,\n 'poseidon-bls12_381-a2-fc1': 0xb401,\n 'poseidon-bls12_381-a2-fc1-sc': 0xb402\n})\n\nmodule.exports = { names }\n","'use strict'\n\nconst sha3 = require('js-sha3')\n// @ts-ignore - no types available\nconst mur = require('murmurhash3js-revisited')\nconst { factory: sha } = require('./sha')\nconst { fromNumberTo32BitBuf } = require('./utils')\nconst uint8ArrayFromString = require('uint8arrays/from-string')\n\n// Note that although this function doesn't do any asynchronous work, we mark\n// the function as async because it must return a Promise to match the API\n// for other functions that do perform asynchronous work (see sha.browser.js)\n// eslint-disable-next-line\n/**\n * @param {string} algorithm\n * @returns {import('./types').Digest}\n */\nconst hash = (algorithm) => async (data) => {\n switch (algorithm) {\n case 'sha3-224':\n return new Uint8Array(sha3.sha3_224.arrayBuffer(data))\n case 'sha3-256':\n return new Uint8Array(sha3.sha3_256.arrayBuffer(data))\n case 'sha3-384':\n return new Uint8Array(sha3.sha3_384.arrayBuffer(data))\n case 'sha3-512':\n return new Uint8Array(sha3.sha3_512.arrayBuffer(data))\n case 'shake-128':\n return new Uint8Array(sha3.shake128.create(128).update(data).arrayBuffer())\n case 'shake-256':\n return new Uint8Array(sha3.shake256.create(256).update(data).arrayBuffer())\n case 'keccak-224':\n return new Uint8Array(sha3.keccak224.arrayBuffer(data))\n case 'keccak-256':\n return new Uint8Array(sha3.keccak256.arrayBuffer(data))\n case 'keccak-384':\n return new Uint8Array(sha3.keccak384.arrayBuffer(data))\n case 'keccak-512':\n return new Uint8Array(sha3.keccak512.arrayBuffer(data))\n case 'murmur3-128':\n return uint8ArrayFromString(mur.x64.hash128(data), 'base16')\n case 'murmur3-32':\n return fromNumberTo32BitBuf(mur.x86.hash32(data))\n\n default:\n throw new TypeError(`${algorithm} is not a supported algorithm`)\n }\n}\n\n/** @type {import('./types').Digest} */\nconst identity = data => data\n\nmodule.exports = {\n identity,\n sha1: sha('sha1'),\n sha2256: sha('sha2-256'),\n sha2512: sha('sha2-512'),\n dblSha2256: sha('dbl-sha2-256'),\n sha3224: hash('sha3-224'),\n sha3256: hash('sha3-256'),\n sha3384: hash('sha3-384'),\n sha3512: hash('sha3-512'),\n shake128: hash('shake-128'),\n shake256: hash('shake-256'),\n keccak224: hash('keccak-224'),\n keccak256: hash('keccak-256'),\n keccak384: hash('keccak-384'),\n keccak512: hash('keccak-512'),\n murmur3128: hash('murmur3-128'),\n murmur332: hash('murmur3-32'),\n addBlake: require('./blake')\n}\n","/* eslint-disable require-await */\n'use strict'\n\nconst multihash = require('multihashes')\n/**\n * @typedef {import('multihashes').HashName} HashName\n * @typedef {import('./types').Digest} Digest\n */\n\n/**\n * @type {Crypto}\n */\nconst crypto =\n self.crypto ||\n /** @type {typeof window.crypto} */\n // @ts-ignore - unknown property\n (self.msCrypto)\n\n/**\n *\n * @param {Uint8Array} data\n * @param {HashName} alg\n * @returns {Promise}\n */\nconst digest = async (data, alg) => {\n if (typeof self === 'undefined' || !crypto) {\n throw new Error(\n 'Please use a browser with webcrypto support and ensure the code has been delivered securely via HTTPS/TLS and run within a Secure Context'\n )\n }\n switch (alg) {\n case 'sha1':\n return new Uint8Array(await crypto.subtle.digest({ name: 'SHA-1' }, data))\n case 'sha2-256':\n return new Uint8Array(await crypto.subtle.digest({ name: 'SHA-256' }, data))\n case 'sha2-512':\n return new Uint8Array(await crypto.subtle.digest({ name: 'SHA-512' }, data))\n case 'dbl-sha2-256': {\n const d = await crypto.subtle.digest({ name: 'SHA-256' }, data)\n return new Uint8Array(await crypto.subtle.digest({ name: 'SHA-256' }, d))\n }\n default:\n throw new Error(`${alg} is not a supported algorithm`)\n }\n}\n\nmodule.exports = {\n /**\n * @param {HashName} alg\n * @returns {Digest}\n */\n factory: (alg) => async (data) => {\n return digest(data, alg)\n },\n digest,\n /**\n * @param {Uint8Array} buf\n * @param {HashName} alg\n * @param {number} [length]\n */\n multihashing: async (buf, alg, length) => {\n const h = await digest(buf, alg)\n return multihash.encode(h, alg, length)\n }\n}\n","'use strict'\n\n/**\n * @param {number} number\n * @returns {Uint8Array}\n */\nconst fromNumberTo32BitBuf = (number) => {\n const bytes = new Uint8Array(4)\n\n for (let i = 0; i < 4; i++) {\n bytes[i] = number & 0xff\n number = number >> 8\n }\n\n return bytes\n}\n\nmodule.exports = {\n fromNumberTo32BitBuf\n}\n","'use strict'\n\n// @ts-ignore - no types available\nconst blake = require('blakejs')\n\nconst minB = 0xb201\nconst minS = 0xb241\n\nconst blake2b = {\n init: blake.blake2bInit,\n update: blake.blake2bUpdate,\n digest: blake.blake2bFinal\n}\n\nconst blake2s = {\n init: blake.blake2sInit,\n update: blake.blake2sUpdate,\n digest: blake.blake2sFinal\n}\n\n// Note that although this function doesn't do any asynchronous work, we mark\n// the function as async because it must return a Promise to match the API\n// for other functions that do perform asynchronous work (see sha.browser.js)\n// eslint-disable-next-line\n\n/**\n * @param {number} size\n * @param {any} hf\n * @returns {import('./types').Digest}\n */\nconst makeB2Hash = (size, hf) => async (data) => {\n const ctx = hf.init(size, null)\n hf.update(ctx, data)\n return hf.digest(ctx)\n}\n\n/**\n * @param {Record} table\n */\nmodule.exports = (table) => {\n for (let i = 0; i < 64; i++) {\n table[minB + i] = makeB2Hash(i + 1, blake2b)\n }\n for (let i = 0; i < 32; i++) {\n table[minS + i] = makeB2Hash(i + 1, blake2s)\n }\n}\n","'use strict'\n\n/**\n * Returns true if the two passed Uint8Arrays have the same content\n *\n * @param {Uint8Array} a\n * @param {Uint8Array} b\n */\nfunction equals (a, b) {\n if (a === b) {\n return true\n }\n\n if (a.byteLength !== b.byteLength) {\n return false\n }\n\n for (let i = 0; i < a.byteLength; i++) {\n if (a[i] !== b[i]) {\n return false\n }\n }\n\n return true\n}\n\nmodule.exports = equals\n","module.exports = Node\n\n/**\n * a linked-list node\n * @class\n * @param {any} value - node's value\n * @param {Node} next - next node\n */\nfunction Node (value, next) {\n this.value = value\n this.next = next\n}\n\n/**\n * checks if this node or any of its children has the value\n * @param {any} value - value to check if linked-list contains\n * @return {boolean} true if the list contains the value; false if not\n */\nNode.prototype.contains = function (value) {\n var cursor = this\n\n while (cursor) {\n if (cursor.value === value) return true\n cursor = cursor.next\n }\n\n return false\n}\n","'use strict'\n\nconst CID = require('cids')\nconst util = require('./util')\n\n/**\n * Resolves a path within a CBOR block.\n *\n * Returns the value or a link and the partial mising path. This way the\n * IPLD Resolver can fetch the link and continue to resolve.\n *\n * @param {Uint8Array} binaryBlob - Binary representation of a CBOR block\n * @param {string} [path='/'] - Path that should be resolved\n */\nexports.resolve = (binaryBlob, path) => {\n let node = util.deserialize(binaryBlob)\n\n const parts = path.split('/').filter(Boolean)\n while (parts.length) {\n const key = parts.shift()\n if (node[key] === undefined) {\n throw new Error(`Object has no property '${key}'`)\n }\n\n node = node[key]\n if (CID.isCID(node)) {\n return {\n value: node,\n remainderPath: parts.join('/')\n }\n }\n }\n\n return {\n value: node,\n remainderPath: ''\n }\n}\n\nconst traverse = function * (node, path) {\n // Traverse only objects and arrays\n if (node instanceof Uint8Array || CID.isCID(node) || typeof node === 'string' ||\n node === null) {\n return\n }\n for (const item of Object.keys(node)) {\n const nextpath = path === undefined ? item : path + '/' + item\n yield nextpath\n yield * traverse(node[item], nextpath)\n }\n}\n\n/**\n * Return all available paths of a block.\n *\n * @generator\n * @param {Uint8Array} binaryBlob - Binary representation of a CBOR block\n * @yields {string} - A single path\n */\nexports.tree = function * (binaryBlob) {\n const node = util.deserialize(binaryBlob)\n\n yield * traverse(node)\n}\n","'use strict'\nconst CID = require('cids')\nconst multihashing = require('multihashing-async')\nconst multicodec = require('multicodec')\n\n// binary resolver\nmodule.exports = {\n codec: multicodec.RAW,\n defaultHashAlg: multicodec.SHA2_256,\n resolver: {\n /**\n * Resolves a path within a Raw block.\n *\n * Always returns the raw data as value without any remainderPath.\n *\n * @param {Buffer} binaryBlob - Binary representation of a PB block\n * @param {string} [path='/'] - Path that should be resolved. Must be '/' or an exception is thrown\n * @returns {Object} result - Result of the path it it was resolved successfully\n * @returns {*} result.value - The raw data\n * @returns {string} result.remainderPath - An empty string\n */\n resolve: (binaryBlob, path) => {\n if (path !== '/') {\n throw new Error('Only the root path / may be resolved')\n }\n\n return {\n value: binaryBlob,\n remainderPath: ''\n }\n },\n /**\n * Return all available paths of a block.\n *\n * @generator\n * @param {Buffer} binaryBlob - The raw data\n * @returns {Object} - Finished generator with `done: true`\n */\n tree: (binaryBlob) => {\n return {\n done: true\n }\n }\n },\n util: {\n deserialize: (data) => {\n return data\n },\n serialize: (data) => {\n return data\n },\n /**\n * Calculate the CID of the binary blob.\n *\n * @param {Object} binaryBlob - Encoded IPLD Node\n * @param {Object} [userOptions] - Options to create the CID\n * @param {number} [userOptions.cidVersion=1] - CID version number\n * @param {string} [UserOptions.hashAlg] - Defaults to the defaultHashAlg of the format\n * @returns {Promise.}\n */\n cid: async (binaryBlob, userOptions) => {\n const defaultOptions = { cidVersion: 1, hashAlg: module.exports.defaultHashAlg }\n const options = Object.assign(defaultOptions, userOptions)\n\n const multihash = await multihashing(binaryBlob, options.hashAlg)\n const codecName = multicodec.print[module.exports.codec]\n const cid = new CID(options.cidVersion, codecName, multihash)\n\n return cid\n }\n }\n}\n","'use strict'\n\nconst errcode = require('err-code')\nconst multihash = require('multihashes')\nconst crypto = require('./crypto')\nconst equals = require('uint8arrays/equals')\n\n/**\n * @typedef {import(\"./types\").Digest} Digest\n * @typedef {import(\"multihashes\").HashName} HashName\n */\n\n/**\n * Hash the given `bytes` using the algorithm specified by `alg`.\n *\n * @param {Uint8Array} bytes - The value to hash.\n * @param {HashName} alg - The algorithm to use eg 'sha1'\n * @param {number} [length] - Optionally trim the result to this length.\n * @returns {Promise}\n */\nasync function Multihashing (bytes, alg, length) {\n const digest = await Multihashing.digest(bytes, alg, length)\n return multihash.encode(digest, alg, length)\n}\n\n/**\n * Expose multihash itself, to avoid silly double requires.\n */\nMultihashing.multihash = multihash\n\n/**\n * @param {Uint8Array} bytes - The value to hash.\n * @param {HashName} alg - The algorithm to use eg 'sha1'\n * @param {number} [length] - Optionally trim the result to this length.\n * @returns {Promise}\n */\nMultihashing.digest = async (bytes, alg, length) => {\n const hash = Multihashing.createHash(alg)\n const digest = await hash(bytes)\n return length ? digest.slice(0, length) : digest\n}\n\n/**\n * Creates a function that hashes with the given algorithm\n *\n * @param {HashName} alg - The algorithm to use eg 'sha1'\n * @returns {Digest} - The hash function corresponding to `alg`\n */\nMultihashing.createHash = function (alg) {\n if (!alg) {\n const e = errcode(new Error('hash algorithm must be specified'), 'ERR_HASH_ALGORITHM_NOT_SPECIFIED')\n throw e\n }\n\n const code = multihash.coerceCode(alg)\n if (!Multihashing.functions[code]) {\n throw errcode(new Error(`multihash function '${alg}' not yet supported`), 'ERR_HASH_ALGORITHM_NOT_SUPPORTED')\n }\n\n return Multihashing.functions[code]\n}\n\n/**\n * Mapping of multihash codes to their hashing functions.\n *\n * @type {Record}\n */\n// @ts-ignore - most of those functions aren't typed\nMultihashing.functions = {\n // identity\n 0x00: crypto.identity,\n // sha1\n 0x11: crypto.sha1,\n // sha2-256\n 0x12: crypto.sha2256,\n // sha2-512\n 0x13: crypto.sha2512,\n // sha3-512\n 0x14: crypto.sha3512,\n // sha3-384\n 0x15: crypto.sha3384,\n // sha3-256\n 0x16: crypto.sha3256,\n // sha3-224\n 0x17: crypto.sha3224,\n // shake-128\n 0x18: crypto.shake128,\n // shake-256\n 0x19: crypto.shake256,\n // keccak-224\n 0x1A: crypto.keccak224,\n // keccak-256\n 0x1B: crypto.keccak256,\n // keccak-384\n 0x1C: crypto.keccak384,\n // keccak-512\n 0x1D: crypto.keccak512,\n // murmur3-128\n 0x22: crypto.murmur3128,\n // murmur3-32\n 0x23: crypto.murmur332,\n // dbl-sha2-256\n 0x56: crypto.dblSha2256\n}\n\n// add blake functions\ncrypto.addBlake(Multihashing.functions)\n\n/**\n * @param {Uint8Array} bytes\n * @param {Uint8Array} hash\n * @returns {Promise}\n */\nMultihashing.validate = async (bytes, hash) => {\n const newHash = await Multihashing(bytes, multihash.decode(hash).name)\n\n return equals(hash, newHash)\n}\n\nmodule.exports = Multihashing\n","'use strict';\n\n/**\n * @typedef {{ [key: string]: any }} Extensions\n * @typedef {Error} Err\n * @property {string} message\n */\n\n/**\n *\n * @param {Error} obj\n * @param {Extensions} props\n * @returns {Error & Extensions}\n */\nfunction assign(obj, props) {\n for (const key in props) {\n Object.defineProperty(obj, key, {\n value: props[key],\n enumerable: true,\n configurable: true,\n });\n }\n\n return obj;\n}\n\n/**\n *\n * @param {any} err - An Error\n * @param {string|Extensions} code - A string code or props to set on the error\n * @param {Extensions} [props] - Props to set on the error\n * @returns {Error & Extensions}\n */\nfunction createError(err, code, props) {\n if (!err || typeof err === 'string') {\n throw new TypeError('Please pass an Error to err-code');\n }\n\n if (!props) {\n props = {};\n }\n\n if (typeof code === 'object') {\n props = code;\n code = '';\n }\n\n if (code) {\n props.code = code;\n }\n\n try {\n return assign(err, props);\n } catch (_) {\n props.message = err.message;\n props.stack = err.stack;\n\n const ErrClass = function () {};\n\n ErrClass.prototype = Object.create(Object.getPrototypeOf(err));\n\n // @ts-ignore\n const output = assign(new ErrClass(), props);\n\n return output;\n }\n}\n\nmodule.exports = createError;\n","'use strict'\n\nconst baseX = require('@multiformats/base-x')\nconst Base = require('./base.js')\nconst { rfc4648 } = require('./rfc4648')\nconst { decodeText, encodeText } = require('./util')\n\n/** @typedef {import('./types').CodecFactory} CodecFactory */\n/** @typedef {import('./types').Codec} Codec */\n/** @typedef {import('./types').BaseName} BaseName */\n/** @typedef {import('./types').BaseCode} BaseCode */\n\n/** @type {CodecFactory} */\nconst identity = () => {\n return {\n encode: decodeText,\n decode: encodeText\n }\n}\n\n/**\n *\n * name, code, implementation, alphabet\n *\n * @type {Array<[BaseName, BaseCode, CodecFactory, string]>}\n */\nconst constants = [\n ['identity', '\\x00', identity, ''],\n ['base2', '0', rfc4648(1), '01'],\n ['base8', '7', rfc4648(3), '01234567'],\n ['base10', '9', baseX, '0123456789'],\n ['base16', 'f', rfc4648(4), '0123456789abcdef'],\n ['base16upper', 'F', rfc4648(4), '0123456789ABCDEF'],\n ['base32hex', 'v', rfc4648(5), '0123456789abcdefghijklmnopqrstuv'],\n ['base32hexupper', 'V', rfc4648(5), '0123456789ABCDEFGHIJKLMNOPQRSTUV'],\n ['base32hexpad', 't', rfc4648(5), '0123456789abcdefghijklmnopqrstuv='],\n ['base32hexpadupper', 'T', rfc4648(5), '0123456789ABCDEFGHIJKLMNOPQRSTUV='],\n ['base32', 'b', rfc4648(5), 'abcdefghijklmnopqrstuvwxyz234567'],\n ['base32upper', 'B', rfc4648(5), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'],\n ['base32pad', 'c', rfc4648(5), 'abcdefghijklmnopqrstuvwxyz234567='],\n ['base32padupper', 'C', rfc4648(5), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567='],\n ['base32z', 'h', rfc4648(5), 'ybndrfg8ejkmcpqxot1uwisza345h769'],\n ['base36', 'k', baseX, '0123456789abcdefghijklmnopqrstuvwxyz'],\n ['base36upper', 'K', baseX, '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'],\n ['base58btc', 'z', baseX, '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'],\n ['base58flickr', 'Z', baseX, '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'],\n ['base64', 'm', rfc4648(6), 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'],\n ['base64pad', 'M', rfc4648(6), 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='],\n ['base64url', 'u', rfc4648(6), 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'],\n ['base64urlpad', 'U', rfc4648(6), 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=']\n]\n\n/** @type {Record} */\nconst names = constants.reduce((prev, tupple) => {\n prev[tupple[0]] = new Base(tupple[0], tupple[1], tupple[2], tupple[3])\n return prev\n}, /** @type {Record} */({}))\n\n/** @type {Record} */\nconst codes = constants.reduce((prev, tupple) => {\n prev[tupple[1]] = names[tupple[0]]\n return prev\n}, /** @type {Record} */({}))\n\nmodule.exports = {\n names,\n codes\n}\n","'use strict'\n\nconst { encodeText } = require('./util')\n\n/** @typedef {import('./types').CodecFactory} CodecFactory */\n/** @typedef {import(\"./types\").BaseName} BaseName */\n/** @typedef {import(\"./types\").BaseCode} BaseCode */\n\n/**\n * Class to encode/decode in the supported Bases\n *\n */\nclass Base {\n /**\n * @param {BaseName} name\n * @param {BaseCode} code\n * @param {CodecFactory} factory\n * @param {string} alphabet\n */\n constructor (name, code, factory, alphabet) {\n this.name = name\n this.code = code\n this.codeBuf = encodeText(this.code)\n this.alphabet = alphabet\n this.codec = factory(alphabet)\n }\n\n /**\n * @param {Uint8Array} buf\n * @returns {string}\n */\n encode (buf) {\n return this.codec.encode(buf)\n }\n\n /**\n * @param {string} string\n * @returns {Uint8Array}\n */\n decode (string) {\n for (const char of string) {\n if (this.alphabet && this.alphabet.indexOf(char) < 0) {\n throw new Error(`invalid character '${char}' in '${string}'`)\n }\n }\n return this.codec.decode(string)\n }\n}\n\nmodule.exports = Base\n","'use strict'\n\n/** @typedef {import('./types').CodecFactory} CodecFactory */\n\n/**\n * @param {string} string\n * @param {string} alphabet\n * @param {number} bitsPerChar\n * @returns {Uint8Array}\n */\nconst decode = (string, alphabet, bitsPerChar) => {\n // Build the character lookup table:\n /** @type {Record} */\n const codes = {}\n for (let i = 0; i < alphabet.length; ++i) {\n codes[alphabet[i]] = i\n }\n\n // Count the padding bytes:\n let end = string.length\n while (string[end - 1] === '=') {\n --end\n }\n\n // Allocate the output:\n const out = new Uint8Array((end * bitsPerChar / 8) | 0)\n\n // Parse the data:\n let bits = 0 // Number of bits currently in the buffer\n let buffer = 0 // Bits waiting to be written out, MSB first\n let written = 0 // Next byte to write\n for (let i = 0; i < end; ++i) {\n // Read one character from the string:\n const value = codes[string[i]]\n if (value === undefined) {\n throw new SyntaxError('Invalid character ' + string[i])\n }\n\n // Append the bits to the buffer:\n buffer = (buffer << bitsPerChar) | value\n bits += bitsPerChar\n\n // Write out some bits if the buffer has a byte's worth:\n if (bits >= 8) {\n bits -= 8\n out[written++] = 0xff & (buffer >> bits)\n }\n }\n\n // Verify that we have received just enough bits:\n if (bits >= bitsPerChar || 0xff & (buffer << (8 - bits))) {\n throw new SyntaxError('Unexpected end of data')\n }\n\n return out\n}\n\n/**\n * @param {Uint8Array} data\n * @param {string} alphabet\n * @param {number} bitsPerChar\n * @returns {string}\n */\nconst encode = (data, alphabet, bitsPerChar) => {\n const pad = alphabet[alphabet.length - 1] === '='\n const mask = (1 << bitsPerChar) - 1\n let out = ''\n\n let bits = 0 // Number of bits currently in the buffer\n let buffer = 0 // Bits waiting to be written out, MSB first\n for (let i = 0; i < data.length; ++i) {\n // Slurp data into the buffer:\n buffer = (buffer << 8) | data[i]\n bits += 8\n\n // Write out as much as we can:\n while (bits > bitsPerChar) {\n bits -= bitsPerChar\n out += alphabet[mask & (buffer >> bits)]\n }\n }\n\n // Partial character:\n if (bits) {\n out += alphabet[mask & (buffer << (bitsPerChar - bits))]\n }\n\n // Add padding characters until we hit a byte boundary:\n if (pad) {\n while ((out.length * bitsPerChar) & 7) {\n out += '='\n }\n }\n\n return out\n}\n\n/**\n * RFC4648 Factory\n *\n * @param {number} bitsPerChar\n * @returns {CodecFactory}\n */\nconst rfc4648 = (bitsPerChar) => (alphabet) => {\n return {\n /**\n * @param {Uint8Array} input\n * @returns {string}\n */\n encode (input) {\n return encode(input, alphabet, bitsPerChar)\n },\n /**\n * @param {string} input\n * @returns {Uint8Array}\n */\n decode (input) {\n return decode(input, alphabet, bitsPerChar)\n }\n }\n}\n\nmodule.exports = { rfc4648 }\n","module.exports = {\n encode: require('./encode.js')\n , decode: require('./decode.js')\n , encodingLength: require('./length.js')\n}\n","module.exports = encode\n\nvar MSB = 0x80\n , REST = 0x7F\n , MSBALL = ~REST\n , INT = Math.pow(2, 31)\n\nfunction encode(num, out, offset) {\n out = out || []\n offset = offset || 0\n var oldOffset = offset\n\n while(num >= INT) {\n out[offset++] = (num & 0xFF) | MSB\n num /= 128\n }\n while(num & MSBALL) {\n out[offset++] = (num & 0xFF) | MSB\n num >>>= 7\n }\n out[offset] = num | 0\n \n encode.bytes = offset - oldOffset + 1\n \n return out\n}\n","module.exports = read\n\nvar MSB = 0x80\n , REST = 0x7F\n\nfunction read(buf, offset) {\n var res = 0\n , offset = offset || 0\n , shift = 0\n , counter = offset\n , b\n , l = buf.length\n\n do {\n if (counter >= l) {\n read.bytes = 0\n throw new RangeError('Could not decode varint')\n }\n b = buf[counter++]\n res += shift < 28\n ? (b & REST) << shift\n : (b & REST) * Math.pow(2, shift)\n shift += 7\n } while (b >= MSB)\n\n read.bytes = counter - offset\n\n return res\n}\n","\nvar N1 = Math.pow(2, 7)\nvar N2 = Math.pow(2, 14)\nvar N3 = Math.pow(2, 21)\nvar N4 = Math.pow(2, 28)\nvar N5 = Math.pow(2, 35)\nvar N6 = Math.pow(2, 42)\nvar N7 = Math.pow(2, 49)\nvar N8 = Math.pow(2, 56)\nvar N9 = Math.pow(2, 63)\n\nmodule.exports = function (value) {\n return (\n value < N1 ? 1\n : value < N2 ? 2\n : value < N3 ? 3\n : value < N4 ? 4\n : value < N5 ? 5\n : value < N6 ? 6\n : value < N7 ? 7\n : value < N8 ? 8\n : value < N9 ? 9\n : 10\n )\n}\n","/* eslint quote-props: off */\n'use strict'\n\n/**\n * Names for all available hashes\n *\n * @typedef { \"identity\" | \"sha1\" | \"sha2-256\" | \"sha2-512\" | \"sha3-512\" | \"sha3-384\" | \"sha3-256\" | \"sha3-224\" | \"shake-128\" | \"shake-256\" | \"keccak-224\" | \"keccak-256\" | \"keccak-384\" | \"keccak-512\" | \"blake3\" | \"murmur3-128\" | \"murmur3-32\" | \"dbl-sha2-256\" | \"md4\" | \"md5\" | \"bmt\" | \"sha2-256-trunc254-padded\" | \"ripemd-128\" | \"ripemd-160\" | \"ripemd-256\" | \"ripemd-320\" | \"x11\" | \"kangarootwelve\" | \"sm3-256\" | \"blake2b-8\" | \"blake2b-16\" | \"blake2b-24\" | \"blake2b-32\" | \"blake2b-40\" | \"blake2b-48\" | \"blake2b-56\" | \"blake2b-64\" | \"blake2b-72\" | \"blake2b-80\" | \"blake2b-88\" | \"blake2b-96\" | \"blake2b-104\" | \"blake2b-112\" | \"blake2b-120\" | \"blake2b-128\" | \"blake2b-136\" | \"blake2b-144\" | \"blake2b-152\" | \"blake2b-160\" | \"blake2b-168\" | \"blake2b-176\" | \"blake2b-184\" | \"blake2b-192\" | \"blake2b-200\" | \"blake2b-208\" | \"blake2b-216\" | \"blake2b-224\" | \"blake2b-232\" | \"blake2b-240\" | \"blake2b-248\" | \"blake2b-256\" | \"blake2b-264\" | \"blake2b-272\" | \"blake2b-280\" | \"blake2b-288\" | \"blake2b-296\" | \"blake2b-304\" | \"blake2b-312\" | \"blake2b-320\" | \"blake2b-328\" | \"blake2b-336\" | \"blake2b-344\" | \"blake2b-352\" | \"blake2b-360\" | \"blake2b-368\" | \"blake2b-376\" | \"blake2b-384\" | \"blake2b-392\" | \"blake2b-400\" | \"blake2b-408\" | \"blake2b-416\" | \"blake2b-424\" | \"blake2b-432\" | \"blake2b-440\" | \"blake2b-448\" | \"blake2b-456\" | \"blake2b-464\" | \"blake2b-472\" | \"blake2b-480\" | \"blake2b-488\" | \"blake2b-496\" | \"blake2b-504\" | \"blake2b-512\" | \"blake2s-8\" | \"blake2s-16\" | \"blake2s-24\" | \"blake2s-32\" | \"blake2s-40\" | \"blake2s-48\" | \"blake2s-56\" | \"blake2s-64\" | \"blake2s-72\" | \"blake2s-80\" | \"blake2s-88\" | \"blake2s-96\" | \"blake2s-104\" | \"blake2s-112\" | \"blake2s-120\" | \"blake2s-128\" | \"blake2s-136\" | \"blake2s-144\" | \"blake2s-152\" | \"blake2s-160\" | \"blake2s-168\" | \"blake2s-176\" | \"blake2s-184\" | \"blake2s-192\" | \"blake2s-200\" | \"blake2s-208\" | \"blake2s-216\" | \"blake2s-224\" | \"blake2s-232\" | \"blake2s-240\" | \"blake2s-248\" | \"blake2s-256\" | \"skein256-8\" | \"skein256-16\" | \"skein256-24\" | \"skein256-32\" | \"skein256-40\" | \"skein256-48\" | \"skein256-56\" | \"skein256-64\" | \"skein256-72\" | \"skein256-80\" | \"skein256-88\" | \"skein256-96\" | \"skein256-104\" | \"skein256-112\" | \"skein256-120\" | \"skein256-128\" | \"skein256-136\" | \"skein256-144\" | \"skein256-152\" | \"skein256-160\" | \"skein256-168\" | \"skein256-176\" | \"skein256-184\" | \"skein256-192\" | \"skein256-200\" | \"skein256-208\" | \"skein256-216\" | \"skein256-224\" | \"skein256-232\" | \"skein256-240\" | \"skein256-248\" | \"skein256-256\" | \"skein512-8\" | \"skein512-16\" | \"skein512-24\" | \"skein512-32\" | \"skein512-40\" | \"skein512-48\" | \"skein512-56\" | \"skein512-64\" | \"skein512-72\" | \"skein512-80\" | \"skein512-88\" | \"skein512-96\" | \"skein512-104\" | \"skein512-112\" | \"skein512-120\" | \"skein512-128\" | \"skein512-136\" | \"skein512-144\" | \"skein512-152\" | \"skein512-160\" | \"skein512-168\" | \"skein512-176\" | \"skein512-184\" | \"skein512-192\" | \"skein512-200\" | \"skein512-208\" | \"skein512-216\" | \"skein512-224\" | \"skein512-232\" | \"skein512-240\" | \"skein512-248\" | \"skein512-256\" | \"skein512-264\" | \"skein512-272\" | \"skein512-280\" | \"skein512-288\" | \"skein512-296\" | \"skein512-304\" | \"skein512-312\" | \"skein512-320\" | \"skein512-328\" | \"skein512-336\" | \"skein512-344\" | \"skein512-352\" | \"skein512-360\" | \"skein512-368\" | \"skein512-376\" | \"skein512-384\" | \"skein512-392\" | \"skein512-400\" | \"skein512-408\" | \"skein512-416\" | \"skein512-424\" | \"skein512-432\" | \"skein512-440\" | \"skein512-448\" | \"skein512-456\" | \"skein512-464\" | \"skein512-472\" | \"skein512-480\" | \"skein512-488\" | \"skein512-496\" | \"skein512-504\" | \"skein512-512\" | \"skein1024-8\" | \"skein1024-16\" | \"skein1024-24\" | \"skein1024-32\" | \"skein1024-40\" | \"skein1024-48\" | \"skein1024-56\" | \"skein1024-64\" | \"skein1024-72\" | \"skein1024-80\" | \"skein1024-88\" | \"skein1024-96\" | \"skein1024-104\" | \"skein1024-112\" | \"skein1024-120\" | \"skein1024-128\" | \"skein1024-136\" | \"skein1024-144\" | \"skein1024-152\" | \"skein1024-160\" | \"skein1024-168\" | \"skein1024-176\" | \"skein1024-184\" | \"skein1024-192\" | \"skein1024-200\" | \"skein1024-208\" | \"skein1024-216\" | \"skein1024-224\" | \"skein1024-232\" | \"skein1024-240\" | \"skein1024-248\" | \"skein1024-256\" | \"skein1024-264\" | \"skein1024-272\" | \"skein1024-280\" | \"skein1024-288\" | \"skein1024-296\" | \"skein1024-304\" | \"skein1024-312\" | \"skein1024-320\" | \"skein1024-328\" | \"skein1024-336\" | \"skein1024-344\" | \"skein1024-352\" | \"skein1024-360\" | \"skein1024-368\" | \"skein1024-376\" | \"skein1024-384\" | \"skein1024-392\" | \"skein1024-400\" | \"skein1024-408\" | \"skein1024-416\" | \"skein1024-424\" | \"skein1024-432\" | \"skein1024-440\" | \"skein1024-448\" | \"skein1024-456\" | \"skein1024-464\" | \"skein1024-472\" | \"skein1024-480\" | \"skein1024-488\" | \"skein1024-496\" | \"skein1024-504\" | \"skein1024-512\" | \"skein1024-520\" | \"skein1024-528\" | \"skein1024-536\" | \"skein1024-544\" | \"skein1024-552\" | \"skein1024-560\" | \"skein1024-568\" | \"skein1024-576\" | \"skein1024-584\" | \"skein1024-592\" | \"skein1024-600\" | \"skein1024-608\" | \"skein1024-616\" | \"skein1024-624\" | \"skein1024-632\" | \"skein1024-640\" | \"skein1024-648\" | \"skein1024-656\" | \"skein1024-664\" | \"skein1024-672\" | \"skein1024-680\" | \"skein1024-688\" | \"skein1024-696\" | \"skein1024-704\" | \"skein1024-712\" | \"skein1024-720\" | \"skein1024-728\" | \"skein1024-736\" | \"skein1024-744\" | \"skein1024-752\" | \"skein1024-760\" | \"skein1024-768\" | \"skein1024-776\" | \"skein1024-784\" | \"skein1024-792\" | \"skein1024-800\" | \"skein1024-808\" | \"skein1024-816\" | \"skein1024-824\" | \"skein1024-832\" | \"skein1024-840\" | \"skein1024-848\" | \"skein1024-856\" | \"skein1024-864\" | \"skein1024-872\" | \"skein1024-880\" | \"skein1024-888\" | \"skein1024-896\" | \"skein1024-904\" | \"skein1024-912\" | \"skein1024-920\" | \"skein1024-928\" | \"skein1024-936\" | \"skein1024-944\" | \"skein1024-952\" | \"skein1024-960\" | \"skein1024-968\" | \"skein1024-976\" | \"skein1024-984\" | \"skein1024-992\" | \"skein1024-1000\" | \"skein1024-1008\" | \"skein1024-1016\" | \"skein1024-1024\" | \"poseidon-bls12_381-a2-fc1\" | \"poseidon-bls12_381-a2-fc1-sc\" } HashName\n */\n/**\n * Codes for all available hashes\n *\n * @typedef { 0x00 | 0x11 | 0x12 | 0x13 | 0x14 | 0x15 | 0x16 | 0x17 | 0x18 | 0x19 | 0x1a | 0x1b | 0x1c | 0x1d | 0x1e | 0x22 | 0x23 | 0x56 | 0xd4 | 0xd5 | 0xd6 | 0x1012 | 0x1052 | 0x1053 | 0x1054 | 0x1055 | 0x1100 | 0x1d01 | 0x534d | 0xb201 | 0xb202 | 0xb203 | 0xb204 | 0xb205 | 0xb206 | 0xb207 | 0xb208 | 0xb209 | 0xb20a | 0xb20b | 0xb20c | 0xb20d | 0xb20e | 0xb20f | 0xb210 | 0xb211 | 0xb212 | 0xb213 | 0xb214 | 0xb215 | 0xb216 | 0xb217 | 0xb218 | 0xb219 | 0xb21a | 0xb21b | 0xb21c | 0xb21d | 0xb21e | 0xb21f | 0xb220 | 0xb221 | 0xb222 | 0xb223 | 0xb224 | 0xb225 | 0xb226 | 0xb227 | 0xb228 | 0xb229 | 0xb22a | 0xb22b | 0xb22c | 0xb22d | 0xb22e | 0xb22f | 0xb230 | 0xb231 | 0xb232 | 0xb233 | 0xb234 | 0xb235 | 0xb236 | 0xb237 | 0xb238 | 0xb239 | 0xb23a | 0xb23b | 0xb23c | 0xb23d | 0xb23e | 0xb23f | 0xb240 | 0xb241 | 0xb242 | 0xb243 | 0xb244 | 0xb245 | 0xb246 | 0xb247 | 0xb248 | 0xb249 | 0xb24a | 0xb24b | 0xb24c | 0xb24d | 0xb24e | 0xb24f | 0xb250 | 0xb251 | 0xb252 | 0xb253 | 0xb254 | 0xb255 | 0xb256 | 0xb257 | 0xb258 | 0xb259 | 0xb25a | 0xb25b | 0xb25c | 0xb25d | 0xb25e | 0xb25f | 0xb260 | 0xb301 | 0xb302 | 0xb303 | 0xb304 | 0xb305 | 0xb306 | 0xb307 | 0xb308 | 0xb309 | 0xb30a | 0xb30b | 0xb30c | 0xb30d | 0xb30e | 0xb30f | 0xb310 | 0xb311 | 0xb312 | 0xb313 | 0xb314 | 0xb315 | 0xb316 | 0xb317 | 0xb318 | 0xb319 | 0xb31a | 0xb31b | 0xb31c | 0xb31d | 0xb31e | 0xb31f | 0xb320 | 0xb321 | 0xb322 | 0xb323 | 0xb324 | 0xb325 | 0xb326 | 0xb327 | 0xb328 | 0xb329 | 0xb32a | 0xb32b | 0xb32c | 0xb32d | 0xb32e | 0xb32f | 0xb330 | 0xb331 | 0xb332 | 0xb333 | 0xb334 | 0xb335 | 0xb336 | 0xb337 | 0xb338 | 0xb339 | 0xb33a | 0xb33b | 0xb33c | 0xb33d | 0xb33e | 0xb33f | 0xb340 | 0xb341 | 0xb342 | 0xb343 | 0xb344 | 0xb345 | 0xb346 | 0xb347 | 0xb348 | 0xb349 | 0xb34a | 0xb34b | 0xb34c | 0xb34d | 0xb34e | 0xb34f | 0xb350 | 0xb351 | 0xb352 | 0xb353 | 0xb354 | 0xb355 | 0xb356 | 0xb357 | 0xb358 | 0xb359 | 0xb35a | 0xb35b | 0xb35c | 0xb35d | 0xb35e | 0xb35f | 0xb360 | 0xb361 | 0xb362 | 0xb363 | 0xb364 | 0xb365 | 0xb366 | 0xb367 | 0xb368 | 0xb369 | 0xb36a | 0xb36b | 0xb36c | 0xb36d | 0xb36e | 0xb36f | 0xb370 | 0xb371 | 0xb372 | 0xb373 | 0xb374 | 0xb375 | 0xb376 | 0xb377 | 0xb378 | 0xb379 | 0xb37a | 0xb37b | 0xb37c | 0xb37d | 0xb37e | 0xb37f | 0xb380 | 0xb381 | 0xb382 | 0xb383 | 0xb384 | 0xb385 | 0xb386 | 0xb387 | 0xb388 | 0xb389 | 0xb38a | 0xb38b | 0xb38c | 0xb38d | 0xb38e | 0xb38f | 0xb390 | 0xb391 | 0xb392 | 0xb393 | 0xb394 | 0xb395 | 0xb396 | 0xb397 | 0xb398 | 0xb399 | 0xb39a | 0xb39b | 0xb39c | 0xb39d | 0xb39e | 0xb39f | 0xb3a0 | 0xb3a1 | 0xb3a2 | 0xb3a3 | 0xb3a4 | 0xb3a5 | 0xb3a6 | 0xb3a7 | 0xb3a8 | 0xb3a9 | 0xb3aa | 0xb3ab | 0xb3ac | 0xb3ad | 0xb3ae | 0xb3af | 0xb3b0 | 0xb3b1 | 0xb3b2 | 0xb3b3 | 0xb3b4 | 0xb3b5 | 0xb3b6 | 0xb3b7 | 0xb3b8 | 0xb3b9 | 0xb3ba | 0xb3bb | 0xb3bc | 0xb3bd | 0xb3be | 0xb3bf | 0xb3c0 | 0xb3c1 | 0xb3c2 | 0xb3c3 | 0xb3c4 | 0xb3c5 | 0xb3c6 | 0xb3c7 | 0xb3c8 | 0xb3c9 | 0xb3ca | 0xb3cb | 0xb3cc | 0xb3cd | 0xb3ce | 0xb3cf | 0xb3d0 | 0xb3d1 | 0xb3d2 | 0xb3d3 | 0xb3d4 | 0xb3d5 | 0xb3d6 | 0xb3d7 | 0xb3d8 | 0xb3d9 | 0xb3da | 0xb3db | 0xb3dc | 0xb3dd | 0xb3de | 0xb3df | 0xb3e0 | 0xb401 | 0xb402 } HashCode\n */\n\n/**\n * @type { Record }\n */\nconst names = Object.freeze({\n 'identity': 0x00,\n 'sha1': 0x11,\n 'sha2-256': 0x12,\n 'sha2-512': 0x13,\n 'sha3-512': 0x14,\n 'sha3-384': 0x15,\n 'sha3-256': 0x16,\n 'sha3-224': 0x17,\n 'shake-128': 0x18,\n 'shake-256': 0x19,\n 'keccak-224': 0x1a,\n 'keccak-256': 0x1b,\n 'keccak-384': 0x1c,\n 'keccak-512': 0x1d,\n 'blake3': 0x1e,\n 'murmur3-128': 0x22,\n 'murmur3-32': 0x23,\n 'dbl-sha2-256': 0x56,\n 'md4': 0xd4,\n 'md5': 0xd5,\n 'bmt': 0xd6,\n 'sha2-256-trunc254-padded': 0x1012,\n 'ripemd-128': 0x1052,\n 'ripemd-160': 0x1053,\n 'ripemd-256': 0x1054,\n 'ripemd-320': 0x1055,\n 'x11': 0x1100,\n 'kangarootwelve': 0x1d01,\n 'sm3-256': 0x534d,\n 'blake2b-8': 0xb201,\n 'blake2b-16': 0xb202,\n 'blake2b-24': 0xb203,\n 'blake2b-32': 0xb204,\n 'blake2b-40': 0xb205,\n 'blake2b-48': 0xb206,\n 'blake2b-56': 0xb207,\n 'blake2b-64': 0xb208,\n 'blake2b-72': 0xb209,\n 'blake2b-80': 0xb20a,\n 'blake2b-88': 0xb20b,\n 'blake2b-96': 0xb20c,\n 'blake2b-104': 0xb20d,\n 'blake2b-112': 0xb20e,\n 'blake2b-120': 0xb20f,\n 'blake2b-128': 0xb210,\n 'blake2b-136': 0xb211,\n 'blake2b-144': 0xb212,\n 'blake2b-152': 0xb213,\n 'blake2b-160': 0xb214,\n 'blake2b-168': 0xb215,\n 'blake2b-176': 0xb216,\n 'blake2b-184': 0xb217,\n 'blake2b-192': 0xb218,\n 'blake2b-200': 0xb219,\n 'blake2b-208': 0xb21a,\n 'blake2b-216': 0xb21b,\n 'blake2b-224': 0xb21c,\n 'blake2b-232': 0xb21d,\n 'blake2b-240': 0xb21e,\n 'blake2b-248': 0xb21f,\n 'blake2b-256': 0xb220,\n 'blake2b-264': 0xb221,\n 'blake2b-272': 0xb222,\n 'blake2b-280': 0xb223,\n 'blake2b-288': 0xb224,\n 'blake2b-296': 0xb225,\n 'blake2b-304': 0xb226,\n 'blake2b-312': 0xb227,\n 'blake2b-320': 0xb228,\n 'blake2b-328': 0xb229,\n 'blake2b-336': 0xb22a,\n 'blake2b-344': 0xb22b,\n 'blake2b-352': 0xb22c,\n 'blake2b-360': 0xb22d,\n 'blake2b-368': 0xb22e,\n 'blake2b-376': 0xb22f,\n 'blake2b-384': 0xb230,\n 'blake2b-392': 0xb231,\n 'blake2b-400': 0xb232,\n 'blake2b-408': 0xb233,\n 'blake2b-416': 0xb234,\n 'blake2b-424': 0xb235,\n 'blake2b-432': 0xb236,\n 'blake2b-440': 0xb237,\n 'blake2b-448': 0xb238,\n 'blake2b-456': 0xb239,\n 'blake2b-464': 0xb23a,\n 'blake2b-472': 0xb23b,\n 'blake2b-480': 0xb23c,\n 'blake2b-488': 0xb23d,\n 'blake2b-496': 0xb23e,\n 'blake2b-504': 0xb23f,\n 'blake2b-512': 0xb240,\n 'blake2s-8': 0xb241,\n 'blake2s-16': 0xb242,\n 'blake2s-24': 0xb243,\n 'blake2s-32': 0xb244,\n 'blake2s-40': 0xb245,\n 'blake2s-48': 0xb246,\n 'blake2s-56': 0xb247,\n 'blake2s-64': 0xb248,\n 'blake2s-72': 0xb249,\n 'blake2s-80': 0xb24a,\n 'blake2s-88': 0xb24b,\n 'blake2s-96': 0xb24c,\n 'blake2s-104': 0xb24d,\n 'blake2s-112': 0xb24e,\n 'blake2s-120': 0xb24f,\n 'blake2s-128': 0xb250,\n 'blake2s-136': 0xb251,\n 'blake2s-144': 0xb252,\n 'blake2s-152': 0xb253,\n 'blake2s-160': 0xb254,\n 'blake2s-168': 0xb255,\n 'blake2s-176': 0xb256,\n 'blake2s-184': 0xb257,\n 'blake2s-192': 0xb258,\n 'blake2s-200': 0xb259,\n 'blake2s-208': 0xb25a,\n 'blake2s-216': 0xb25b,\n 'blake2s-224': 0xb25c,\n 'blake2s-232': 0xb25d,\n 'blake2s-240': 0xb25e,\n 'blake2s-248': 0xb25f,\n 'blake2s-256': 0xb260,\n 'skein256-8': 0xb301,\n 'skein256-16': 0xb302,\n 'skein256-24': 0xb303,\n 'skein256-32': 0xb304,\n 'skein256-40': 0xb305,\n 'skein256-48': 0xb306,\n 'skein256-56': 0xb307,\n 'skein256-64': 0xb308,\n 'skein256-72': 0xb309,\n 'skein256-80': 0xb30a,\n 'skein256-88': 0xb30b,\n 'skein256-96': 0xb30c,\n 'skein256-104': 0xb30d,\n 'skein256-112': 0xb30e,\n 'skein256-120': 0xb30f,\n 'skein256-128': 0xb310,\n 'skein256-136': 0xb311,\n 'skein256-144': 0xb312,\n 'skein256-152': 0xb313,\n 'skein256-160': 0xb314,\n 'skein256-168': 0xb315,\n 'skein256-176': 0xb316,\n 'skein256-184': 0xb317,\n 'skein256-192': 0xb318,\n 'skein256-200': 0xb319,\n 'skein256-208': 0xb31a,\n 'skein256-216': 0xb31b,\n 'skein256-224': 0xb31c,\n 'skein256-232': 0xb31d,\n 'skein256-240': 0xb31e,\n 'skein256-248': 0xb31f,\n 'skein256-256': 0xb320,\n 'skein512-8': 0xb321,\n 'skein512-16': 0xb322,\n 'skein512-24': 0xb323,\n 'skein512-32': 0xb324,\n 'skein512-40': 0xb325,\n 'skein512-48': 0xb326,\n 'skein512-56': 0xb327,\n 'skein512-64': 0xb328,\n 'skein512-72': 0xb329,\n 'skein512-80': 0xb32a,\n 'skein512-88': 0xb32b,\n 'skein512-96': 0xb32c,\n 'skein512-104': 0xb32d,\n 'skein512-112': 0xb32e,\n 'skein512-120': 0xb32f,\n 'skein512-128': 0xb330,\n 'skein512-136': 0xb331,\n 'skein512-144': 0xb332,\n 'skein512-152': 0xb333,\n 'skein512-160': 0xb334,\n 'skein512-168': 0xb335,\n 'skein512-176': 0xb336,\n 'skein512-184': 0xb337,\n 'skein512-192': 0xb338,\n 'skein512-200': 0xb339,\n 'skein512-208': 0xb33a,\n 'skein512-216': 0xb33b,\n 'skein512-224': 0xb33c,\n 'skein512-232': 0xb33d,\n 'skein512-240': 0xb33e,\n 'skein512-248': 0xb33f,\n 'skein512-256': 0xb340,\n 'skein512-264': 0xb341,\n 'skein512-272': 0xb342,\n 'skein512-280': 0xb343,\n 'skein512-288': 0xb344,\n 'skein512-296': 0xb345,\n 'skein512-304': 0xb346,\n 'skein512-312': 0xb347,\n 'skein512-320': 0xb348,\n 'skein512-328': 0xb349,\n 'skein512-336': 0xb34a,\n 'skein512-344': 0xb34b,\n 'skein512-352': 0xb34c,\n 'skein512-360': 0xb34d,\n 'skein512-368': 0xb34e,\n 'skein512-376': 0xb34f,\n 'skein512-384': 0xb350,\n 'skein512-392': 0xb351,\n 'skein512-400': 0xb352,\n 'skein512-408': 0xb353,\n 'skein512-416': 0xb354,\n 'skein512-424': 0xb355,\n 'skein512-432': 0xb356,\n 'skein512-440': 0xb357,\n 'skein512-448': 0xb358,\n 'skein512-456': 0xb359,\n 'skein512-464': 0xb35a,\n 'skein512-472': 0xb35b,\n 'skein512-480': 0xb35c,\n 'skein512-488': 0xb35d,\n 'skein512-496': 0xb35e,\n 'skein512-504': 0xb35f,\n 'skein512-512': 0xb360,\n 'skein1024-8': 0xb361,\n 'skein1024-16': 0xb362,\n 'skein1024-24': 0xb363,\n 'skein1024-32': 0xb364,\n 'skein1024-40': 0xb365,\n 'skein1024-48': 0xb366,\n 'skein1024-56': 0xb367,\n 'skein1024-64': 0xb368,\n 'skein1024-72': 0xb369,\n 'skein1024-80': 0xb36a,\n 'skein1024-88': 0xb36b,\n 'skein1024-96': 0xb36c,\n 'skein1024-104': 0xb36d,\n 'skein1024-112': 0xb36e,\n 'skein1024-120': 0xb36f,\n 'skein1024-128': 0xb370,\n 'skein1024-136': 0xb371,\n 'skein1024-144': 0xb372,\n 'skein1024-152': 0xb373,\n 'skein1024-160': 0xb374,\n 'skein1024-168': 0xb375,\n 'skein1024-176': 0xb376,\n 'skein1024-184': 0xb377,\n 'skein1024-192': 0xb378,\n 'skein1024-200': 0xb379,\n 'skein1024-208': 0xb37a,\n 'skein1024-216': 0xb37b,\n 'skein1024-224': 0xb37c,\n 'skein1024-232': 0xb37d,\n 'skein1024-240': 0xb37e,\n 'skein1024-248': 0xb37f,\n 'skein1024-256': 0xb380,\n 'skein1024-264': 0xb381,\n 'skein1024-272': 0xb382,\n 'skein1024-280': 0xb383,\n 'skein1024-288': 0xb384,\n 'skein1024-296': 0xb385,\n 'skein1024-304': 0xb386,\n 'skein1024-312': 0xb387,\n 'skein1024-320': 0xb388,\n 'skein1024-328': 0xb389,\n 'skein1024-336': 0xb38a,\n 'skein1024-344': 0xb38b,\n 'skein1024-352': 0xb38c,\n 'skein1024-360': 0xb38d,\n 'skein1024-368': 0xb38e,\n 'skein1024-376': 0xb38f,\n 'skein1024-384': 0xb390,\n 'skein1024-392': 0xb391,\n 'skein1024-400': 0xb392,\n 'skein1024-408': 0xb393,\n 'skein1024-416': 0xb394,\n 'skein1024-424': 0xb395,\n 'skein1024-432': 0xb396,\n 'skein1024-440': 0xb397,\n 'skein1024-448': 0xb398,\n 'skein1024-456': 0xb399,\n 'skein1024-464': 0xb39a,\n 'skein1024-472': 0xb39b,\n 'skein1024-480': 0xb39c,\n 'skein1024-488': 0xb39d,\n 'skein1024-496': 0xb39e,\n 'skein1024-504': 0xb39f,\n 'skein1024-512': 0xb3a0,\n 'skein1024-520': 0xb3a1,\n 'skein1024-528': 0xb3a2,\n 'skein1024-536': 0xb3a3,\n 'skein1024-544': 0xb3a4,\n 'skein1024-552': 0xb3a5,\n 'skein1024-560': 0xb3a6,\n 'skein1024-568': 0xb3a7,\n 'skein1024-576': 0xb3a8,\n 'skein1024-584': 0xb3a9,\n 'skein1024-592': 0xb3aa,\n 'skein1024-600': 0xb3ab,\n 'skein1024-608': 0xb3ac,\n 'skein1024-616': 0xb3ad,\n 'skein1024-624': 0xb3ae,\n 'skein1024-632': 0xb3af,\n 'skein1024-640': 0xb3b0,\n 'skein1024-648': 0xb3b1,\n 'skein1024-656': 0xb3b2,\n 'skein1024-664': 0xb3b3,\n 'skein1024-672': 0xb3b4,\n 'skein1024-680': 0xb3b5,\n 'skein1024-688': 0xb3b6,\n 'skein1024-696': 0xb3b7,\n 'skein1024-704': 0xb3b8,\n 'skein1024-712': 0xb3b9,\n 'skein1024-720': 0xb3ba,\n 'skein1024-728': 0xb3bb,\n 'skein1024-736': 0xb3bc,\n 'skein1024-744': 0xb3bd,\n 'skein1024-752': 0xb3be,\n 'skein1024-760': 0xb3bf,\n 'skein1024-768': 0xb3c0,\n 'skein1024-776': 0xb3c1,\n 'skein1024-784': 0xb3c2,\n 'skein1024-792': 0xb3c3,\n 'skein1024-800': 0xb3c4,\n 'skein1024-808': 0xb3c5,\n 'skein1024-816': 0xb3c6,\n 'skein1024-824': 0xb3c7,\n 'skein1024-832': 0xb3c8,\n 'skein1024-840': 0xb3c9,\n 'skein1024-848': 0xb3ca,\n 'skein1024-856': 0xb3cb,\n 'skein1024-864': 0xb3cc,\n 'skein1024-872': 0xb3cd,\n 'skein1024-880': 0xb3ce,\n 'skein1024-888': 0xb3cf,\n 'skein1024-896': 0xb3d0,\n 'skein1024-904': 0xb3d1,\n 'skein1024-912': 0xb3d2,\n 'skein1024-920': 0xb3d3,\n 'skein1024-928': 0xb3d4,\n 'skein1024-936': 0xb3d5,\n 'skein1024-944': 0xb3d6,\n 'skein1024-952': 0xb3d7,\n 'skein1024-960': 0xb3d8,\n 'skein1024-968': 0xb3d9,\n 'skein1024-976': 0xb3da,\n 'skein1024-984': 0xb3db,\n 'skein1024-992': 0xb3dc,\n 'skein1024-1000': 0xb3dd,\n 'skein1024-1008': 0xb3de,\n 'skein1024-1016': 0xb3df,\n 'skein1024-1024': 0xb3e0,\n 'poseidon-bls12_381-a2-fc1': 0xb401,\n 'poseidon-bls12_381-a2-fc1-sc': 0xb402\n})\n\nmodule.exports = { names }\n","'use strict'\n\nconst { encoding: getCodec } = require('multibase')\nconst { TextDecoder } = require('web-encoding')\nconst utf8Decoder = new TextDecoder('utf8')\n\n/**\n * @typedef {import('multibase/src/types').BaseName} BaseName\n */\n\n/**\n * Turns a Uint8Array of bytes into a string with each\n * character being the char code of the corresponding byte\n *\n * @param {Uint8Array} array - The array to turn into a string\n */\nfunction uint8ArrayToAsciiString (array) {\n let string = ''\n\n for (let i = 0; i < array.length; i++) {\n string += String.fromCharCode(array[i])\n }\n return string\n}\n\n/**\n * Turns a `Uint8Array` into a string.\n *\n * Supports `utf8`, `utf-8` and any encoding supported by the multibase module.\n *\n * Also `ascii` which is similar to node's 'binary' encoding.\n *\n * @param {Uint8Array} array - The array to turn into a string\n * @param {BaseName | 'utf8' | 'utf-8' | 'ascii'} [encoding=utf8] - The encoding to use\n * @returns {string}\n */\nfunction toString (array, encoding = 'utf8') {\n if (encoding === 'utf8' || encoding === 'utf-8') {\n return utf8Decoder.decode(array)\n }\n\n if (encoding === 'ascii') {\n return uint8ArrayToAsciiString(array)\n }\n\n return getCodec(encoding).encode(array)\n}\n\nmodule.exports = toString\n","'use strict'\n\n/**\n * Returns a new Uint8Array created by concatenating the passed ArrayLikes\n *\n * @param {Array>} arrays\n * @param {number} [length]\n */\nfunction concat (arrays, length) {\n if (!length) {\n length = arrays.reduce((acc, curr) => acc + curr.length, 0)\n }\n\n const output = new Uint8Array(length)\n let offset = 0\n\n for (const arr of arrays) {\n output.set(arr, offset)\n offset += arr.length\n }\n\n return output\n}\n\nmodule.exports = concat\n","'use strict'\n\nconst sha3 = require('js-sha3')\n// @ts-ignore - no types available\nconst mur = require('murmurhash3js-revisited')\nconst { factory: sha } = require('./sha')\nconst { fromNumberTo32BitBuf } = require('./utils')\nconst uint8ArrayFromString = require('uint8arrays/from-string')\n\n// Note that although this function doesn't do any asynchronous work, we mark\n// the function as async because it must return a Promise to match the API\n// for other functions that do perform asynchronous work (see sha.browser.js)\n// eslint-disable-next-line\n/**\n * @param {string} algorithm\n * @returns {import('./types').Digest}\n */\nconst hash = (algorithm) => async (data) => {\n switch (algorithm) {\n case 'sha3-224':\n return new Uint8Array(sha3.sha3_224.arrayBuffer(data))\n case 'sha3-256':\n return new Uint8Array(sha3.sha3_256.arrayBuffer(data))\n case 'sha3-384':\n return new Uint8Array(sha3.sha3_384.arrayBuffer(data))\n case 'sha3-512':\n return new Uint8Array(sha3.sha3_512.arrayBuffer(data))\n case 'shake-128':\n return new Uint8Array(sha3.shake128.create(128).update(data).arrayBuffer())\n case 'shake-256':\n return new Uint8Array(sha3.shake256.create(256).update(data).arrayBuffer())\n case 'keccak-224':\n return new Uint8Array(sha3.keccak224.arrayBuffer(data))\n case 'keccak-256':\n return new Uint8Array(sha3.keccak256.arrayBuffer(data))\n case 'keccak-384':\n return new Uint8Array(sha3.keccak384.arrayBuffer(data))\n case 'keccak-512':\n return new Uint8Array(sha3.keccak512.arrayBuffer(data))\n case 'murmur3-128':\n return uint8ArrayFromString(mur.x64.hash128(data), 'base16')\n case 'murmur3-32':\n return fromNumberTo32BitBuf(mur.x86.hash32(data))\n\n default:\n throw new TypeError(`${algorithm} is not a supported algorithm`)\n }\n}\n\n/** @type {import('./types').Digest} */\nconst identity = data => data\n\nmodule.exports = {\n identity,\n sha1: sha('sha1'),\n sha2256: sha('sha2-256'),\n sha2512: sha('sha2-512'),\n dblSha2256: sha('dbl-sha2-256'),\n sha3224: hash('sha3-224'),\n sha3256: hash('sha3-256'),\n sha3384: hash('sha3-384'),\n sha3512: hash('sha3-512'),\n shake128: hash('shake-128'),\n shake256: hash('shake-256'),\n keccak224: hash('keccak-224'),\n keccak256: hash('keccak-256'),\n keccak384: hash('keccak-384'),\n keccak512: hash('keccak-512'),\n murmur3128: hash('murmur3-128'),\n murmur332: hash('murmur3-32'),\n addBlake: require('./blake')\n}\n","/* eslint-disable require-await */\n'use strict'\n\nconst multihash = require('multihashes')\n/**\n * @typedef {import('multihashes').HashName} HashName\n * @typedef {import('./types').Digest} Digest\n */\n\n/**\n * @type {Crypto}\n */\nconst crypto =\n self.crypto ||\n /** @type {typeof window.crypto} */\n // @ts-ignore - unknown property\n (self.msCrypto)\n\n/**\n *\n * @param {Uint8Array} data\n * @param {HashName} alg\n * @returns {Promise}\n */\nconst digest = async (data, alg) => {\n if (typeof self === 'undefined' || !crypto) {\n throw new Error(\n 'Please use a browser with webcrypto support and ensure the code has been delivered securely via HTTPS/TLS and run within a Secure Context'\n )\n }\n switch (alg) {\n case 'sha1':\n return new Uint8Array(await crypto.subtle.digest({ name: 'SHA-1' }, data))\n case 'sha2-256':\n return new Uint8Array(await crypto.subtle.digest({ name: 'SHA-256' }, data))\n case 'sha2-512':\n return new Uint8Array(await crypto.subtle.digest({ name: 'SHA-512' }, data))\n case 'dbl-sha2-256': {\n const d = await crypto.subtle.digest({ name: 'SHA-256' }, data)\n return new Uint8Array(await crypto.subtle.digest({ name: 'SHA-256' }, d))\n }\n default:\n throw new Error(`${alg} is not a supported algorithm`)\n }\n}\n\nmodule.exports = {\n /**\n * @param {HashName} alg\n * @returns {Digest}\n */\n factory: (alg) => async (data) => {\n return digest(data, alg)\n },\n digest,\n /**\n * @param {Uint8Array} buf\n * @param {HashName} alg\n * @param {number} [length]\n */\n multihashing: async (buf, alg, length) => {\n const h = await digest(buf, alg)\n return multihash.encode(h, alg, length)\n }\n}\n","'use strict'\n\n/**\n * @param {number} number\n * @returns {Uint8Array}\n */\nconst fromNumberTo32BitBuf = (number) => {\n const bytes = new Uint8Array(4)\n\n for (let i = 0; i < 4; i++) {\n bytes[i] = number & 0xff\n number = number >> 8\n }\n\n return bytes\n}\n\nmodule.exports = {\n fromNumberTo32BitBuf\n}\n","'use strict'\n\n// @ts-ignore - no types available\nconst blake = require('blakejs')\n\nconst minB = 0xb201\nconst minS = 0xb241\n\nconst blake2b = {\n init: blake.blake2bInit,\n update: blake.blake2bUpdate,\n digest: blake.blake2bFinal\n}\n\nconst blake2s = {\n init: blake.blake2sInit,\n update: blake.blake2sUpdate,\n digest: blake.blake2sFinal\n}\n\n// Note that although this function doesn't do any asynchronous work, we mark\n// the function as async because it must return a Promise to match the API\n// for other functions that do perform asynchronous work (see sha.browser.js)\n// eslint-disable-next-line\n\n/**\n * @param {number} size\n * @param {any} hf\n * @returns {import('./types').Digest}\n */\nconst makeB2Hash = (size, hf) => async (data) => {\n const ctx = hf.init(size, null)\n hf.update(ctx, data)\n return hf.digest(ctx)\n}\n\n/**\n * @param {Record} table\n */\nmodule.exports = (table) => {\n for (let i = 0; i < 64; i++) {\n table[minB + i] = makeB2Hash(i + 1, blake2b)\n }\n for (let i = 0; i < 32; i++) {\n table[minS + i] = makeB2Hash(i + 1, blake2s)\n }\n}\n","'use strict'\n\n/**\n * Returns true if the two passed Uint8Arrays have the same content\n *\n * @param {Uint8Array} a\n * @param {Uint8Array} b\n */\nfunction equals (a, b) {\n if (a === b) {\n return true\n }\n\n if (a.byteLength !== b.byteLength) {\n return false\n }\n\n for (let i = 0; i < a.byteLength; i++) {\n if (a[i] !== b[i]) {\n return false\n }\n }\n\n return true\n}\n\nmodule.exports = equals\n","'use strict'\n\nconst CID = require('cids')\nconst multihash = require('multihashes')\nconst configure = require('../lib/configure')\nconst multipartRequest = require('../lib/multipart-request')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\nconst abortSignal = require('../lib/abort-signal')\nconst { AbortController } = require('native-abort-controller')\nconst multicodec = require('multicodec')\nconst loadFormat = require('../lib/ipld-formats')\n\nmodule.exports = configure((api, opts) => {\n const load = loadFormat(opts.ipld)\n\n /**\n * @type {import('..').Implements}\n */\n const put = async (dagNode, options = {}) => {\n if (options.cid && (options.format || options.hashAlg)) {\n throw new Error('Failed to put DAG node. Provide either `cid` OR `format` and `hashAlg` options')\n } else if ((options.format && !options.hashAlg) || (!options.format && options.hashAlg)) {\n throw new Error('Failed to put DAG node. Provide `format` AND `hashAlg` options')\n }\n\n let encodingOptions\n if (options.cid) {\n const cid = new CID(options.cid)\n encodingOptions = {\n ...options,\n format: multicodec.getName(cid.code),\n hashAlg: multihash.decode(cid.multihash).name\n }\n delete options.cid\n } else {\n encodingOptions = options\n }\n\n const settings = {\n format: 'dag-cbor',\n hashAlg: 'sha2-256',\n inputEnc: 'raw',\n ...encodingOptions\n }\n\n const format = await load(settings.format)\n const serialized = format.util.serialize(dagNode)\n\n // allow aborting requests on body errors\n const controller = new AbortController()\n const signal = abortSignal(controller.signal, settings.signal)\n\n // @ts-ignore https://github.com/ipfs/js-ipfs-utils/issues/90\n const res = await api.post('dag/put', {\n timeout: settings.timeout,\n signal,\n searchParams: toUrlSearchParams(settings),\n ...(\n await multipartRequest(serialized, controller, settings.headers)\n )\n })\n const data = await res.json()\n\n return new CID(data.Cid['/'])\n }\n\n return put\n})\n","'use strict'\n\nmodule.exports = config => ({\n get: require('./get')(config),\n put: require('./put')(config),\n findProvs: require('./find-provs')(config),\n findPeer: require('./find-peer')(config),\n provide: require('./provide')(config),\n // find closest peerId to given peerId\n query: require('./query')(config)\n})\n","'use strict'\n\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\nconst { Value } = require('./response-types')\nconst uint8ArrayToString = require('uint8arrays/to-string')\nconst uint8ArrayFromString = require('uint8arrays/from-string')\n\nmodule.exports = configure(api => {\n /**\n * @type {import('..').ImplementsMethod<'get', import('ipfs-core/src/components/dht')>}\n */\n async function get (key, options = {}) {\n const res = await api.post('dht/get', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: key instanceof Uint8Array ? uint8ArrayToString(key) : key,\n ...options\n }),\n headers: options.headers\n })\n\n for await (const message of res.ndjson()) {\n if (message.Type === Value) {\n return uint8ArrayFromString(message.Extra, 'base64pad')\n }\n }\n\n throw new Error('not found')\n }\n\n return get\n})\n","'use strict'\n\nconst CID = require('cids')\nconst multiaddr = require('multiaddr')\nconst toCamel = require('../lib/object-to-camel')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\nconst multipartRequest = require('../lib/multipart-request')\nconst abortSignal = require('../lib/abort-signal')\nconst { AbortController } = require('native-abort-controller')\nmodule.exports = configure(api => {\n /**\n * @type {import('..').ImplementsMethod<'put', import('ipfs-core/src/components/dht')>}\n */\n async function * put (key, value, options = {}) {\n // allow aborting requests on body errors\n const controller = new AbortController()\n const signal = abortSignal(controller.signal, options.signal)\n\n // @ts-ignore https://github.com/ipfs/js-ipfs-utils/issues/90\n const res = await api.post('dht/put', {\n timeout: options.timeout,\n signal,\n searchParams: toUrlSearchParams({\n arg: key,\n ...options\n }),\n ...(\n await multipartRequest(value, controller, options.headers)\n )\n })\n\n for await (let message of res.ndjson()) {\n message = toCamel(message)\n message.id = new CID(message.id)\n if (message.responses) {\n message.responses = message.responses.map(({ ID, Addrs }) => ({\n id: ID,\n addrs: (Addrs || []).map(a => multiaddr(a))\n }))\n }\n yield message\n }\n }\n\n return put\n})\n","'use strict'\n\nconst CID = require('cids')\nconst multiaddr = require('multiaddr')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\nconst { Provider } = require('./response-types')\n\nmodule.exports = configure(api => {\n /**\n * @type {import('..').ImplementsMethod<'findProvs', import('ipfs-core/src/components/dht')>}\n */\n async function * findProvs (cid, options = {}) {\n const res = await api.post('dht/findprovs', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: `${new CID(cid)}`,\n ...options\n }),\n headers: options.headers\n })\n\n for await (const message of res.ndjson()) {\n if (message.Type === Provider && message.Responses) {\n for (const { ID, Addrs } of message.Responses) {\n yield {\n id: ID,\n addrs: (Addrs || []).map(a => multiaddr(a))\n }\n }\n }\n }\n }\n\n return findProvs\n})\n","'use strict'\n\nconst CID = require('cids')\nconst multiaddr = require('multiaddr')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\nconst { FinalPeer } = require('./response-types')\n\nmodule.exports = configure(api => {\n /**\n * @type {import('..').ImplementsMethod<'findPeer', import('ipfs-core/src/components/dht')>}\n */\n async function findPeer (peerId, options = {}) {\n const res = await api.post('dht/findpeer', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: `${peerId instanceof Uint8Array ? new CID(peerId) : peerId}`,\n ...options\n }),\n headers: options.headers\n })\n\n for await (const data of res.ndjson()) {\n if (data.Type === FinalPeer && data.Responses) {\n const { ID, Addrs } = data.Responses[0]\n return {\n id: ID,\n addrs: (Addrs || []).map(a => multiaddr(a))\n }\n }\n }\n\n throw new Error('not found')\n }\n\n return findPeer\n})\n","'use strict'\n\nconst CID = require('cids')\nconst multiaddr = require('multiaddr')\nconst toCamel = require('../lib/object-to-camel')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n /**\n * @type {import('..').ImplementsMethod<'provide', import('ipfs-core/src/components/dht')>}\n */\n async function * provide (cids, options = {}) {\n cids = Array.isArray(cids) ? cids : [cids]\n\n const res = await api.post('dht/provide', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: cids.map(cid => new CID(cid).toString()),\n ...options\n }),\n headers: options.headers\n })\n\n for await (let message of res.ndjson()) {\n message = toCamel(message)\n message.id = new CID(message.id)\n if (message.responses) {\n message.responses = message.responses.map(({ ID, Addrs }) => ({\n id: ID,\n addrs: (Addrs || []).map(a => multiaddr(a))\n }))\n } else {\n message.responses = []\n }\n yield message\n }\n }\n\n return provide\n})\n","'use strict'\n\nconst CID = require('cids')\nconst multiaddr = require('multiaddr')\nconst toCamel = require('../lib/object-to-camel')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n /**\n * @type {import('..').ImplementsMethod<'query', import('ipfs-core/src/components/dht')>}\n */\n async function * query (peerId, options = {}) {\n const res = await api.post('dht/query', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: new CID(`${peerId}`),\n ...options\n }),\n headers: options.headers\n })\n\n for await (let message of res.ndjson()) {\n message = toCamel(message)\n message.id = new CID(message.id)\n message.responses = (message.responses || []).map(({ ID, Addrs }) => ({\n id: ID,\n addrs: (Addrs || []).map(a => multiaddr(a))\n }))\n yield message\n }\n }\n\n return query\n})\n","'use strict'\n\nmodule.exports = config => ({\n net: require('./net')(config),\n sys: require('./sys')(config),\n cmds: require('./cmds')(config)\n})\n","'use strict'\n\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (options = {}) => {\n const res = await api.post('diag/net', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams(options),\n headers: options.headers\n })\n return res.json()\n }\n})\n","'use strict'\n\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (options = {}) => {\n const res = await api.post('diag/sys', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams(options),\n headers: options.headers\n })\n\n return res.json()\n }\n})\n","'use strict'\n\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (options = {}) => {\n const res = await api.post('diag/cmds', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams(options),\n headers: options.headers\n })\n\n return res.json()\n }\n})\n","'use strict'\n\nconst configure = require('./lib/configure')\nconst toUrlSearchParams = require('./lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n /**\n * @type {import('.').Implements}\n */\n const dns = async (domain, options = {}) => {\n const res = await api.post('dns', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: domain,\n ...options\n }),\n headers: options.headers\n })\n const data = await res.json()\n\n return data.Path\n }\n\n return dns\n})\n","'use strict'\n\nmodule.exports = config => ({\n chmod: require('./chmod')(config),\n cp: require('./cp')(config),\n flush: require('./flush')(config),\n ls: require('./ls')(config),\n mkdir: require('./mkdir')(config),\n mv: require('./mv')(config),\n read: require('./read')(config),\n rm: require('./rm')(config),\n stat: require('./stat')(config),\n touch: require('./touch')(config),\n write: require('./write')(config)\n})\n","'use strict'\n\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n /**\n * @type {import('..').Implements}\n */\n async function chmod (path, mode, options = {}) {\n const res = await api.post('files/chmod', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: path,\n mode,\n ...options\n }),\n headers: options.headers\n })\n\n await res.text()\n }\n\n return chmod\n})\n","'use strict'\n\nconst CID = require('cids')\nconst { findSources } = require('./utils')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n /**\n * @type {import('..').Implements}\n */\n async function cp (...args) {\n const { sources, options } = findSources(args)\n\n const res = await api.post('files/cp', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: sources.map(src => CID.isCID(src) ? `/ipfs/${src}` : src),\n ...options\n }),\n headers: options.headers\n })\n\n await res.text()\n }\n\n return cp\n})\n","'use strict'\n\nconst CID = require('cids')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n /**\n * @type {import('..').Implements}\n */\n async function flush (path, options = {}) {\n if (!path || typeof path !== 'string') {\n throw new Error('ipfs.files.flush requires a path')\n }\n\n const res = await api.post('files/flush', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: path,\n ...options\n }),\n headers: options.headers\n })\n const data = await res.json()\n\n return new CID(data.Cid)\n }\n\n return flush\n})\n","'use strict'\n\nconst CID = require('cids')\nconst toCamelWithMetadata = require('../lib/object-to-camel-with-metadata')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n /**\n * @type {import('..').Implements}\n */\n async function * ls (path, options = {}) {\n if (!path || typeof path !== 'string') {\n throw new Error('ipfs.files.ls requires a path')\n }\n\n const res = await api.post('files/ls', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: CID.isCID(path) ? `/ipfs/${path}` : path,\n // default long to true, diverges from go-ipfs where its false by default\n long: true,\n ...options,\n stream: true\n }),\n headers: options.headers\n })\n\n for await (const result of res.ndjson()) {\n // go-ipfs does not yet support the \"stream\" option\n if ('Entries' in result) {\n for (const entry of result.Entries || []) {\n yield toCoreInterface(toCamelWithMetadata(entry))\n }\n } else {\n yield toCoreInterface(toCamelWithMetadata(result))\n }\n }\n }\n\n return ls\n})\n\nfunction toCoreInterface (entry) {\n if (entry.hash) {\n entry.cid = new CID(entry.hash)\n }\n\n delete entry.hash\n\n entry.type = entry.type === 1 ? 'directory' : 'file'\n\n return entry\n}\n","'use strict'\n\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n /**\n * @type {import('..').Implements}\n */\n async function mkdir (path, options = {}) {\n const res = await api.post('files/mkdir', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: path,\n ...options\n }),\n headers: options.headers\n })\n\n await res.text()\n }\n\n return mkdir\n})\n","'use strict'\n\nconst CID = require('cids')\nconst { findSources } = require('./utils')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n /**\n * @type {import('..').Implements}\n */\n async function mv (...args) {\n const { sources, options } = findSources(args)\n\n const res = await api.post('files/mv', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: sources.map(src => CID.isCID(src) ? `/ipfs/${src}` : src),\n ...options\n }),\n headers: options.headers\n })\n\n await res.text()\n }\n\n return mv\n})\n","'use strict'\n\nconst toIterable = require('stream-to-it/source')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n /**\n * @type {import('..').Implements}\n */\n async function * read (path, options = {}) {\n const res = await api.post('files/read', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: path,\n count: options.length,\n ...options\n }),\n headers: options.headers\n })\n\n yield * toIterable(res.body)\n }\n\n return read\n})\n","module.exports = readable => {\n // Node.js stream\n if (readable[Symbol.asyncIterator]) return readable\n\n // Browser ReadableStream\n if (readable.getReader) {\n return (async function * () {\n const reader = readable.getReader()\n\n try {\n while (true) {\n const { done, value } = await reader.read()\n if (done) return\n yield value\n }\n } finally {\n reader.releaseLock()\n }\n })()\n }\n\n throw new Error('unknown stream')\n}\n","'use strict'\n\nconst configure = require('../lib/configure')\nconst { findSources } = require('./utils')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n /**\n * @type {import('..').Implements}\n */\n async function rm (...args) {\n const { sources, options } = findSources(args)\n\n const res = await api.post('files/rm', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: sources,\n ...options\n }),\n headers: options.headers\n })\n\n await res.text()\n }\n\n return rm\n})\n","'use strict'\n\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n /**\n * @type {import('..').Implements}\n */\n async function touch (path, options = {}) {\n const res = await api.post('files/touch', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: path,\n ...options\n }),\n headers: options.headers\n })\n\n await res.text()\n }\n\n return touch\n})\n","'use strict'\n\nconst modeToString = require('../lib/mode-to-string')\nconst { mtimeToObject } = require('ipfs-core-utils/src/files/normalise-input/utils')\nconst configure = require('../lib/configure')\nconst multipartRequest = require('../lib/multipart-request')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\nconst abortSignal = require('../lib/abort-signal')\nconst { AbortController } = require('native-abort-controller')\n\nmodule.exports = configure(api => {\n /**\n * @type {import('..').Implements}\n */\n async function write (path, input, options = {}) {\n // allow aborting requests on body errors\n const controller = new AbortController()\n const signal = abortSignal(controller.signal, options.signal)\n\n // @ts-ignore https://github.com/ipfs/js-ipfs-utils/issues/90\n const res = await api.post('files/write', {\n timeout: options.timeout,\n signal,\n searchParams: toUrlSearchParams({\n arg: path,\n streamChannels: true,\n count: options.length,\n ...options\n }),\n ...(\n await multipartRequest({\n content: input,\n path: 'arg',\n mode: modeToString(options.mode),\n mtime: mtimeToObject(options.mtime)\n }, controller, options.headers)\n )\n })\n\n await res.text()\n }\n\n return write\n})\n","'use strict'\n\nconst Tar = require('it-tar')\nconst CID = require('cids')\nconst configure = require('./lib/configure')\nconst toUrlSearchParams = require('./lib/to-url-search-params')\nconst map = require('it-map')\n\nmodule.exports = configure(api => {\n /**\n * @type {import('.').Implements}\n */\n async function * get (path, options = {}) {\n const res = await api.post('get', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: `${path instanceof Uint8Array ? new CID(path) : path}`,\n ...options\n }),\n headers: options.headers\n })\n\n const extractor = Tar.extract()\n\n for await (const { header, body } of extractor(res.iterator())) {\n if (header.type === 'directory') {\n // @ts-ignore - Missing the following properties from type 'Directory':\n // cid, name, size, depthts\n yield {\n type: 'dir',\n path: header.name\n }\n } else {\n // @ts-ignore - Missing the following properties from type 'File':\n // cid, name, size, depthts\n yield {\n type: 'file',\n path: header.name,\n content: map(body, (chunk) => chunk.slice()) // convert bl to Buffer/Uint8Array\n }\n }\n }\n }\n\n return get\n})\n","exports.extract = require('./extract')\nexports.pack = require('./pack')\n","const defer = require('p-defer')\nconst Headers = require('./extract-headers')\nconst LteReader = require('./lte-reader')\n\nfunction getPadding (size) {\n size &= 511\n return size && 512 - size\n}\n\nasync function discardPadding (reader, size) {\n const overflow = getPadding(size)\n if (overflow) await reader.next(overflow)\n}\n\nmodule.exports = options => {\n options = options || {}\n options.highWaterMark = options.highWaterMark || 1024 * 16\n\n return source => (async function * () {\n const reader = LteReader(source)\n let gnuLongPath, gnuLongLinkPath, paxGlobal, pax\n\n try {\n while (true) {\n let headerBytes\n try {\n const { done, value } = await reader.next(512)\n if (done) return\n headerBytes = value\n } catch (err) {\n // Is ok, this is the end of the stream!\n if (err.code === 'ERR_UNDER_READ') return\n throw err\n }\n\n const header = Headers.decode(headerBytes, options.filenameEncoding)\n if (!header) continue\n\n if (header.type === 'gnu-long-path') {\n const { done, value: gnuLongPathBytes } = await reader.next(header.size)\n if (done) return\n gnuLongPath = Headers.decodeLongPath(gnuLongPathBytes, options.filenameEncoding)\n await discardPadding(reader, header.size)\n continue\n }\n\n if (header.type === 'gnu-long-link-path') {\n const { done, value: gnuLongLinkPathBytes } = await reader.next(header.size)\n if (done) return\n gnuLongLinkPath = Headers.decodeLongPath(gnuLongLinkPathBytes, options.filenameEncoding)\n await discardPadding(reader, header.size)\n continue\n }\n\n if (header.type === 'pax-global-header') {\n const { done, value: paxGlobalBytes } = await reader.next(header.size)\n if (done) return\n paxGlobal = Headers.decodePax(paxGlobalBytes, options.filenameEncoding)\n await discardPadding(reader, header.size)\n continue\n }\n\n if (header.type === 'pax-header') {\n const { done, value: paxBytes } = await reader.next(header.size)\n if (done) return\n pax = Headers.decodePax(paxBytes, options.filenameEncoding)\n if (paxGlobal) pax = { ...paxGlobal, ...pax }\n await discardPadding(reader, header.size)\n continue\n }\n\n if (gnuLongPath) {\n header.name = gnuLongPath\n gnuLongPath = null\n }\n\n if (gnuLongLinkPath) {\n header.linkname = gnuLongLinkPath\n gnuLongLinkPath = null\n }\n\n if (pax) {\n if (pax.path) header.name = pax.path\n if (pax.linkpath) header.linkname = pax.linkpath\n if (pax.size) header.size = parseInt(pax.size, 10)\n header.pax = pax\n pax = null\n }\n\n if (!header.size || header.type === 'directory') {\n yield { header, body: (async function * () {})() }\n continue\n }\n\n let bytesRemaining = header.size\n const bodyConsumed = defer()\n\n // Prefetch the first chunk.\n // This allows us to stream entries for small files from the tar without\n // explicitly streaming the body of each.\n const firstChunk = await reader.nextLte(Math.min(bytesRemaining, options.highWaterMark))\n bytesRemaining -= firstChunk.value.length\n\n if (!bytesRemaining) bodyConsumed.resolve()\n\n const body = (async function * () {\n try {\n yield firstChunk.value\n\n while (bytesRemaining) {\n const { done, value } = await reader.nextLte(bytesRemaining)\n if (done) {\n bytesRemaining = 0\n return\n }\n bytesRemaining -= value.length\n yield value\n }\n } finally {\n bodyConsumed.resolve()\n }\n })()\n\n yield { header, body }\n\n // Wait for the body to be consumed\n await bodyConsumed.promise\n\n // Incase the body was not consumed entirely...\n if (bytesRemaining) {\n for await (const _ of body) {} // eslint-disable-line no-unused-vars\n }\n\n await discardPadding(reader, header.size)\n }\n } finally {\n await reader.return()\n }\n })()\n}\n","'use strict';\n\nconst pDefer = () => {\n\tconst deferred = {};\n\n\tdeferred.promise = new Promise((resolve, reject) => {\n\t\tdeferred.resolve = resolve;\n\t\tdeferred.reject = reject;\n\t});\n\n\treturn deferred;\n};\n\nmodule.exports = pDefer;\n","const { Buffer } = require('buffer')\nconst BufferList = require('bl/BufferList')\n\nvar ZERO_OFFSET = '0'.charCodeAt(0)\nvar USTAR_MAGIC = Buffer.from('ustar\\x00', 'binary')\nvar GNU_MAGIC = Buffer.from('ustar\\x20', 'binary')\nvar GNU_VER = Buffer.from('\\x20\\x00', 'binary')\nvar MAGIC_OFFSET = 257\nvar VERSION_OFFSET = 263\n\nvar clamp = function (index, len, defaultValue) {\n if (typeof index !== 'number') return defaultValue\n index = ~~index // Coerce to integer.\n if (index >= len) return len\n if (index >= 0) return index\n index += len\n if (index >= 0) return index\n return 0\n}\n\nvar toType = function (flag) {\n switch (flag) {\n case 0:\n return 'file'\n case 1:\n return 'link'\n case 2:\n return 'symlink'\n case 3:\n return 'character-device'\n case 4:\n return 'block-device'\n case 5:\n return 'directory'\n case 6:\n return 'fifo'\n case 7:\n return 'contiguous-file'\n case 72:\n return 'pax-header'\n case 55:\n return 'pax-global-header'\n case 27:\n return 'gnu-long-link-path'\n case 28:\n case 30:\n return 'gnu-long-path'\n }\n\n return null\n}\n\nvar indexOf = function (block, num, offset, end) {\n for (; offset < end; offset++) {\n if (block.get(offset) === num) return offset\n }\n return end\n}\n\nvar cksum = function (block) {\n var sum = 8 * 32\n for (var i = 0; i < 148; i++) sum += block.get(i)\n for (var j = 156; j < 512; j++) sum += block.get(j)\n return sum\n}\n\n/* Copied from the node-tar repo and modified to meet\n * tar-stream coding standard.\n *\n * Source: https://github.com/npm/node-tar/blob/51b6627a1f357d2eb433e7378e5f05e83b7aa6cd/lib/header.js#L349\n */\nfunction parse256 (buf) {\n // first byte MUST be either 80 or FF\n // 80 for positive, FF for 2's comp\n var positive\n if (buf.get(0) === 0x80) positive = true\n else if (buf.get(0) === 0xFF) positive = false\n else return null\n\n // build up a base-256 tuple from the least sig to the highest\n var zero = false\n var tuple = []\n for (var i = buf.length - 1; i > 0; i--) {\n var byte = buf.get(i)\n if (positive) tuple.push(byte)\n else if (zero && byte === 0) tuple.push(0)\n else if (zero) {\n zero = false\n tuple.push(0x100 - byte)\n } else tuple.push(0xFF - byte)\n }\n\n var sum = 0\n var l = tuple.length\n for (i = 0; i < l; i++) {\n sum += tuple[i] * Math.pow(256, i)\n }\n\n return positive ? sum : -1 * sum\n}\n\nvar decodeOct = function (val, offset, length) {\n val = val.shallowSlice(offset, offset + length)\n offset = 0\n\n // If prefixed with 0x80 then parse as a base-256 integer\n if (val.get(offset) & 0x80) {\n return parse256(val)\n } else {\n // Older versions of tar can prefix with spaces\n while (offset < val.length && val.get(offset) === 32) offset++\n var end = clamp(indexOf(val, 32, offset, val.length), val.length, val.length)\n while (offset < end && val.get(offset) === 0) offset++\n if (end === offset) return 0\n return parseInt(val.shallowSlice(offset, end).toString(), 8)\n }\n}\n\nvar decodeStr = function (val, offset, length, encoding) {\n return val.shallowSlice(offset, indexOf(val, 0, offset, offset + length)).toString(encoding)\n}\n\nexports.decodeLongPath = function (buf, encoding) {\n buf = BufferList.isBufferList(buf) ? buf : new BufferList(buf)\n return decodeStr(buf, 0, buf.length, encoding)\n}\n\nexports.decodePax = function (buf) {\n buf = BufferList.isBufferList(buf) ? buf : new BufferList(buf)\n var result = {}\n\n while (buf.length) {\n var i = 0\n while (i < buf.length && buf.get(i) !== 32) i++\n var len = parseInt(buf.shallowSlice(0, i).toString(), 10)\n if (!len) return result\n\n var b = buf.shallowSlice(i + 1, len - 1).toString()\n var keyIndex = b.indexOf('=')\n if (keyIndex === -1) return result\n result[b.slice(0, keyIndex)] = b.slice(keyIndex + 1)\n\n buf = buf.shallowSlice(len)\n }\n\n return result\n}\n\nexports.decode = function (buf, filenameEncoding) {\n buf = BufferList.isBufferList(buf) ? buf : new BufferList(buf)\n var typeflag = buf.get(156) === 0 ? 0 : buf.get(156) - ZERO_OFFSET\n\n var name = decodeStr(buf, 0, 100, filenameEncoding)\n var mode = decodeOct(buf, 100, 8)\n var uid = decodeOct(buf, 108, 8)\n var gid = decodeOct(buf, 116, 8)\n var size = decodeOct(buf, 124, 12)\n var mtime = decodeOct(buf, 136, 12)\n var type = toType(typeflag)\n var linkname = buf.get(157) === 0 ? null : decodeStr(buf, 157, 100, filenameEncoding)\n var uname = decodeStr(buf, 265, 32)\n var gname = decodeStr(buf, 297, 32)\n var devmajor = decodeOct(buf, 329, 8)\n var devminor = decodeOct(buf, 337, 8)\n\n var c = cksum(buf)\n\n // checksum is still initial value if header was null.\n if (c === 8 * 32) return null\n\n // valid checksum\n if (c !== decodeOct(buf, 148, 8)) throw new Error('Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?')\n\n if (USTAR_MAGIC.compare(buf.slice(MAGIC_OFFSET, MAGIC_OFFSET + 6)) === 0) {\n // ustar (posix) format.\n // prepend prefix, if present.\n if (buf.get(345)) name = decodeStr(buf, 345, 155, filenameEncoding) + '/' + name\n } else if (GNU_MAGIC.compare(buf.slice(MAGIC_OFFSET, MAGIC_OFFSET + 6)) === 0 &&\n GNU_VER.compare(buf.slice(VERSION_OFFSET, VERSION_OFFSET + 2)) === 0) {\n // 'gnu'/'oldgnu' format. Similar to ustar, but has support for incremental and\n // multi-volume tarballs.\n } else {\n throw new Error('Invalid tar header: unknown format.')\n }\n\n // to support old tar versions that use trailing / to indicate dirs\n if (typeflag === 0 && name && name[name.length - 1] === '/') typeflag = 5\n\n return {\n name: name,\n mode: mode,\n uid: uid,\n gid: gid,\n size: size,\n mtime: new Date(1000 * mtime),\n type: type,\n linkname: linkname,\n uname: uname,\n gname: gname,\n devmajor: devmajor,\n devminor: devminor\n }\n}\n","const BufferList = require('bl/BufferList')\nconst Reader = require('it-reader')\n\nmodule.exports = function LteReader (source) {\n const reader = Reader(source)\n let overflow\n const lteReader = {\n [Symbol.asyncIterator]: () => lteReader,\n async next (bytes) {\n if (overflow) {\n let value\n if (bytes == null || overflow.length === bytes) {\n value = overflow\n overflow = null\n } else if (overflow.length > bytes) {\n value = overflow.shallowSlice(0, bytes)\n overflow = overflow.shallowSlice(bytes)\n } else if (overflow.length < bytes) {\n const { value: nextValue, done } = await reader.next(bytes - overflow.length)\n if (done) {\n throw Object.assign(\n new Error(`stream ended before ${bytes - overflow.length} bytes became available`),\n { code: 'ERR_UNDER_READ' }\n )\n }\n value = new BufferList([overflow, nextValue])\n overflow = null\n }\n return { value }\n }\n return reader.next(bytes)\n },\n async nextLte (bytes) {\n let { done, value } = await lteReader.next()\n if (done) return { done }\n if (value.length <= bytes) return { value }\n value = BufferList.isBufferList(value) ? value : new BufferList(value)\n if (overflow) {\n overflow.append(value.shallowSlice(bytes))\n } else {\n overflow = value.shallowSlice(bytes)\n }\n return { value: value.shallowSlice(0, bytes) }\n },\n return () {\n return reader.return()\n }\n }\n return lteReader\n}\n","const BufferList = require('bl/BufferList')\n\nmodule.exports = source => {\n const reader = (async function * () {\n let bytes = yield // Allows us to receive 8 when reader.next(8) is called\n let bl = new BufferList()\n\n for await (const chunk of source) {\n if (!bytes) {\n bytes = yield bl.append(chunk)\n bl = new BufferList()\n continue\n }\n\n bl.append(chunk)\n\n while (bl.length >= bytes) {\n const data = bl.shallowSlice(0, bytes)\n bl.consume(bytes)\n bytes = yield data\n\n // If we no longer want a specific byte length, we yield the rest now\n if (!bytes) {\n if (bl.length) {\n bytes = yield bl\n bl = new BufferList()\n }\n break // bytes is null and/or no more buffer to yield\n }\n }\n }\n\n // Consumer wants more bytes but the source has ended and our buffer\n // is not big enough to satisfy.\n if (bytes) {\n throw Object.assign(\n new Error(`stream ended before ${bytes} bytes became available`),\n { code: 'ERR_UNDER_READ', buffer: bl }\n )\n }\n })()\n\n reader.next()\n return reader\n}\n","const { Buffer } = require('buffer')\nconst BufferList = require('bl/BufferList')\nconst { S_IFMT, S_IFBLK, S_IFCHR, S_IFDIR, S_IFIFO, S_IFLNK } = require('iso-constants')\nconst concat = require('it-concat')\nconst Headers = require('./pack-headers')\n\nconst DMODE = parseInt('755', 8)\nconst FMODE = parseInt('644', 8)\n\nconst END_OF_TAR = Buffer.alloc(1024)\n\nfunction modeToType (mode) {\n switch (mode & S_IFMT) {\n case S_IFBLK: return 'block-device'\n case S_IFCHR: return 'character-device'\n case S_IFDIR: return 'directory'\n case S_IFIFO: return 'fifo'\n case S_IFLNK: return 'symlink'\n }\n return 'file'\n}\n\nfunction getPadding (size) {\n size &= 511\n if (size) return new BufferList(END_OF_TAR.slice(0, 512 - size))\n}\n\nfunction encode (header) {\n if (!header.pax) {\n const encoded = Headers.encode(header)\n if (encoded) return encoded\n }\n return encodePax(header)\n}\n\nfunction encodePax (header) {\n const paxHeader = Headers.encodePax({\n name: header.name,\n linkname: header.linkname,\n pax: header.pax\n })\n\n const newHeader = {\n name: 'PaxHeader',\n mode: header.mode,\n uid: header.uid,\n gid: header.gid,\n size: paxHeader.length,\n mtime: header.mtime,\n type: 'pax-header',\n linkname: header.linkname && 'PaxHeader',\n uname: header.uname,\n gname: header.gname,\n devmajor: header.devmajor,\n devminor: header.devminor\n }\n\n return new BufferList([\n Headers.encode(newHeader),\n paxHeader,\n getPadding(paxHeader.length),\n Headers.encode({ ...newHeader, size: header.size, type: header.type })\n ])\n}\n\nmodule.exports = () => async function * (source) {\n for await (let { header, body } of source) {\n if (!header.size || header.type === 'symlink') header.size = 0\n if (!header.type) header.type = modeToType(header.mode)\n if (!header.mode) header.mode = header.type === 'directory' ? DMODE : FMODE\n if (!header.uid) header.uid = 0\n if (!header.gid) header.gid = 0\n if (!header.mtime) header.mtime = new Date()\n\n if (typeof body === 'string') body = Buffer.from(body)\n\n if (Buffer.isBuffer(body) || BufferList.isBufferList(body)) {\n header.size = body.length\n yield new BufferList([encode(header), body, getPadding(header.size)])\n continue\n }\n\n if (header.type === 'symlink' && !header.linkname) {\n header.linkname = (await concat(body)).toString()\n yield encode(header)\n continue\n }\n\n yield encode(header)\n\n if (header.type !== 'file' && header.type !== 'contiguous-file') {\n continue\n }\n\n let written = 0\n for await (const chunk of body) {\n written += chunk.length\n yield BufferList.isBufferList(chunk) ? chunk : new BufferList(chunk)\n }\n\n if (written !== header.size) { // corrupting tar\n throw new Error('size mismatch')\n }\n\n const overflow = getPadding(header.size)\n if (overflow) yield overflow\n }\n\n yield new BufferList(END_OF_TAR)\n}\n","\n'use strict';\n\nmodule.exports = {\n 'RTLD_LAZY': 1,\n 'RTLD_NOW': 2,\n 'RTLD_GLOBAL': 256,\n 'RTLD_LOCAL': 0,\n 'RTLD_DEEPBIND': 8,\n 'E2BIG': 7,\n 'EACCES': 13,\n 'EADDRINUSE': 98,\n 'EADDRNOTAVAIL': 99,\n 'EAFNOSUPPORT': 97,\n 'EAGAIN': 11,\n 'EALREADY': 114,\n 'EBADF': 9,\n 'EBADMSG': 74,\n 'EBUSY': 16,\n 'ECANCELED': 125,\n 'ECHILD': 10,\n 'ECONNABORTED': 103,\n 'ECONNREFUSED': 111,\n 'ECONNRESET': 104,\n 'EDEADLK': 35,\n 'EDESTADDRREQ': 89,\n 'EDOM': 33,\n 'EDQUOT': 122,\n 'EEXIST': 17,\n 'EFAULT': 14,\n 'EFBIG': 27,\n 'EHOSTUNREACH': 113,\n 'EIDRM': 43,\n 'EILSEQ': 84,\n 'EINPROGRESS': 115,\n 'EINTR': 4,\n 'EINVAL': 22,\n 'EIO': 5,\n 'EISCONN': 106,\n 'EISDIR': 21,\n 'ELOOP': 40,\n 'EMFILE': 24,\n 'EMLINK': 31,\n 'EMSGSIZE': 90,\n 'EMULTIHOP': 72,\n 'ENAMETOOLONG': 36,\n 'ENETDOWN': 100,\n 'ENETRESET': 102,\n 'ENETUNREACH': 101,\n 'ENFILE': 23,\n 'ENOBUFS': 105,\n 'ENODATA': 61,\n 'ENODEV': 19,\n 'ENOENT': 2,\n 'ENOEXEC': 8,\n 'ENOLCK': 37,\n 'ENOLINK': 67,\n 'ENOMEM': 12,\n 'ENOMSG': 42,\n 'ENOPROTOOPT': 92,\n 'ENOSPC': 28,\n 'ENOSR': 63,\n 'ENOSTR': 60,\n 'ENOSYS': 38,\n 'ENOTCONN': 107,\n 'ENOTDIR': 20,\n 'ENOTEMPTY': 39,\n 'ENOTSOCK': 88,\n 'ENOTSUP': 95,\n 'ENOTTY': 25,\n 'ENXIO': 6,\n 'EOPNOTSUPP': 95,\n 'EOVERFLOW': 75,\n 'EPERM': 1,\n 'EPIPE': 32,\n 'EPROTO': 71,\n 'EPROTONOSUPPORT': 93,\n 'EPROTOTYPE': 91,\n 'ERANGE': 34,\n 'EROFS': 30,\n 'ESPIPE': 29,\n 'ESRCH': 3,\n 'ESTALE': 116,\n 'ETIME': 62,\n 'ETIMEDOUT': 110,\n 'ETXTBSY': 26,\n 'EWOULDBLOCK': 11,\n 'EXDEV': 18,\n 'PRIORITY_LOW': 19,\n 'PRIORITY_BELOW_NORMAL': 10,\n 'PRIORITY_NORMAL': 0,\n 'PRIORITY_ABOVE_NORMAL': -7,\n 'PRIORITY_HIGH': -14,\n 'PRIORITY_HIGHEST': -20,\n 'SIGHUP': 1,\n 'SIGINT': 2,\n 'SIGQUIT': 3,\n 'SIGILL': 4,\n 'SIGTRAP': 5,\n 'SIGABRT': 6,\n 'SIGIOT': 6,\n 'SIGBUS': 7,\n 'SIGFPE': 8,\n 'SIGKILL': 9,\n 'SIGUSR1': 10,\n 'SIGSEGV': 11,\n 'SIGUSR2': 12,\n 'SIGPIPE': 13,\n 'SIGALRM': 14,\n 'SIGTERM': 15,\n 'SIGCHLD': 17,\n 'SIGSTKFLT': 16,\n 'SIGCONT': 18,\n 'SIGSTOP': 19,\n 'SIGTSTP': 20,\n 'SIGTTIN': 21,\n 'SIGTTOU': 22,\n 'SIGURG': 23,\n 'SIGXCPU': 24,\n 'SIGXFSZ': 25,\n 'SIGVTALRM': 26,\n 'SIGPROF': 27,\n 'SIGWINCH': 28,\n 'SIGIO': 29,\n 'SIGPOLL': 29,\n 'SIGPWR': 30,\n 'SIGSYS': 31,\n 'SIGUNUSED': 31,\n 'UV_FS_SYMLINK_DIR': 1,\n 'UV_FS_SYMLINK_JUNCTION': 2,\n 'O_RDONLY': 0,\n 'O_WRONLY': 1,\n 'O_RDWR': 2,\n 'UV_DIRENT_UNKNOWN': 0,\n 'UV_DIRENT_FILE': 1,\n 'UV_DIRENT_DIR': 2,\n 'UV_DIRENT_LINK': 3,\n 'UV_DIRENT_FIFO': 4,\n 'UV_DIRENT_SOCKET': 5,\n 'UV_DIRENT_CHAR': 6,\n 'UV_DIRENT_BLOCK': 7,\n 'S_IFMT': 61440,\n 'S_IFREG': 32768,\n 'S_IFDIR': 16384,\n 'S_IFCHR': 8192,\n 'S_IFBLK': 24576,\n 'S_IFIFO': 4096,\n 'S_IFLNK': 40960,\n 'S_IFSOCK': 49152,\n 'O_CREAT': 64,\n 'O_EXCL': 128,\n 'UV_FS_O_FILEMAP': 0,\n 'O_NOCTTY': 256,\n 'O_TRUNC': 512,\n 'O_APPEND': 1024,\n 'O_DIRECTORY': 65536,\n 'O_NOATIME': 262144,\n 'O_NOFOLLOW': 131072,\n 'O_SYNC': 1052672,\n 'O_DSYNC': 4096,\n 'O_DIRECT': 16384,\n 'O_NONBLOCK': 2048,\n 'S_IRWXU': 448,\n 'S_IRUSR': 256,\n 'S_IWUSR': 128,\n 'S_IXUSR': 64,\n 'S_IRWXG': 56,\n 'S_IRGRP': 32,\n 'S_IWGRP': 16,\n 'S_IXGRP': 8,\n 'S_IRWXO': 7,\n 'S_IROTH': 4,\n 'S_IWOTH': 2,\n 'S_IXOTH': 1,\n 'F_OK': 0,\n 'R_OK': 4,\n 'W_OK': 2,\n 'X_OK': 1,\n 'UV_FS_COPYFILE_EXCL': 1,\n 'COPYFILE_EXCL': 1,\n 'UV_FS_COPYFILE_FICLONE': 2,\n 'COPYFILE_FICLONE': 2,\n 'UV_FS_COPYFILE_FICLONE_FORCE': 4,\n 'COPYFILE_FICLONE_FORCE': 4,\n 'OPENSSL_VERSION_NUMBER': 269488319,\n 'SSL_OP_ALL': 2147485780,\n 'SSL_OP_ALLOW_NO_DHE_KEX': 1024,\n 'SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION': 262144,\n 'SSL_OP_CIPHER_SERVER_PREFERENCE': 4194304,\n 'SSL_OP_CISCO_ANYCONNECT': 32768,\n 'SSL_OP_COOKIE_EXCHANGE': 8192,\n 'SSL_OP_CRYPTOPRO_TLSEXT_BUG': 2147483648,\n 'SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS': 2048,\n 'SSL_OP_EPHEMERAL_RSA': 0,\n 'SSL_OP_LEGACY_SERVER_CONNECT': 4,\n 'SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER': 0,\n 'SSL_OP_MICROSOFT_SESS_ID_BUG': 0,\n 'SSL_OP_MSIE_SSLV2_RSA_PADDING': 0,\n 'SSL_OP_NETSCAPE_CA_DN_BUG': 0,\n 'SSL_OP_NETSCAPE_CHALLENGE_BUG': 0,\n 'SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG': 0,\n 'SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG': 0,\n 'SSL_OP_NO_COMPRESSION': 131072,\n 'SSL_OP_NO_ENCRYPT_THEN_MAC': 524288,\n 'SSL_OP_NO_QUERY_MTU': 4096,\n 'SSL_OP_NO_RENEGOTIATION': 1073741824,\n 'SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION': 65536,\n 'SSL_OP_NO_SSLv2': 0,\n 'SSL_OP_NO_SSLv3': 33554432,\n 'SSL_OP_NO_TICKET': 16384,\n 'SSL_OP_NO_TLSv1': 67108864,\n 'SSL_OP_NO_TLSv1_1': 268435456,\n 'SSL_OP_NO_TLSv1_2': 134217728,\n 'SSL_OP_NO_TLSv1_3': 536870912,\n 'SSL_OP_PKCS1_CHECK_1': 0,\n 'SSL_OP_PKCS1_CHECK_2': 0,\n 'SSL_OP_PRIORITIZE_CHACHA': 2097152,\n 'SSL_OP_SINGLE_DH_USE': 0,\n 'SSL_OP_SINGLE_ECDH_USE': 0,\n 'SSL_OP_SSLEAY_080_CLIENT_DH_BUG': 0,\n 'SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG': 0,\n 'SSL_OP_TLS_BLOCK_PADDING_BUG': 0,\n 'SSL_OP_TLS_D5_BUG': 0,\n 'SSL_OP_TLS_ROLLBACK_BUG': 8388608,\n 'ENGINE_METHOD_RSA': 1,\n 'ENGINE_METHOD_DSA': 2,\n 'ENGINE_METHOD_DH': 4,\n 'ENGINE_METHOD_RAND': 8,\n 'ENGINE_METHOD_EC': 2048,\n 'ENGINE_METHOD_CIPHERS': 64,\n 'ENGINE_METHOD_DIGESTS': 128,\n 'ENGINE_METHOD_PKEY_METHS': 512,\n 'ENGINE_METHOD_PKEY_ASN1_METHS': 1024,\n 'ENGINE_METHOD_ALL': 65535,\n 'ENGINE_METHOD_NONE': 0,\n 'DH_CHECK_P_NOT_SAFE_PRIME': 2,\n 'DH_CHECK_P_NOT_PRIME': 1,\n 'DH_UNABLE_TO_CHECK_GENERATOR': 4,\n 'DH_NOT_SUITABLE_GENERATOR': 8,\n 'ALPN_ENABLED': 1,\n 'RSA_PKCS1_PADDING': 1,\n 'RSA_SSLV23_PADDING': 2,\n 'RSA_NO_PADDING': 3,\n 'RSA_PKCS1_OAEP_PADDING': 4,\n 'RSA_X931_PADDING': 5,\n 'RSA_PKCS1_PSS_PADDING': 6,\n 'RSA_PSS_SALTLEN_DIGEST': -1,\n 'RSA_PSS_SALTLEN_MAX_SIGN': -2,\n 'RSA_PSS_SALTLEN_AUTO': -2,\n 'defaultCoreCipherList': 'TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA256:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA',\n 'TLS1_VERSION': 769,\n 'TLS1_1_VERSION': 770,\n 'TLS1_2_VERSION': 771,\n 'TLS1_3_VERSION': 772,\n 'POINT_CONVERSION_COMPRESSED': 2,\n 'POINT_CONVERSION_UNCOMPRESSED': 4,\n 'POINT_CONVERSION_HYBRID': 6\n};\n\n","const BufferList = require('bl/BufferList')\n\nconst TypeDefault = {\n string: () => '',\n buffer: () => BufferList()\n}\n\nmodule.exports = async (source, options) => {\n options = options || {}\n\n if (options.type && !TypeDefault[options.type]) {\n throw new Error(`invalid type \"${options.type}\"`)\n }\n\n let res, type\n for await (const chunk of source) {\n if (!res) {\n type = options.type || typeof chunk === 'string' ? 'string' : 'buffer'\n res = TypeDefault[type]()\n }\n\n if (type === 'string') {\n res += chunk\n } else {\n res.append(chunk)\n }\n }\n\n return res || TypeDefault[options.type || 'buffer']()\n}\n","const { Buffer } = require('buffer')\n\nvar alloc = Buffer.alloc\n\nvar ZEROS = '0000000000000000000'\nvar SEVENS = '7777777777777777777'\nvar ZERO_OFFSET = '0'.charCodeAt(0)\nvar USTAR_MAGIC = Buffer.from('ustar\\x00', 'binary')\nvar USTAR_VER = Buffer.from('00', 'binary')\nvar MASK = parseInt('7777', 8)\nvar MAGIC_OFFSET = 257\nvar VERSION_OFFSET = 263\n\nvar toTypeflag = function (flag) {\n switch (flag) {\n case 'file':\n return 0\n case 'link':\n return 1\n case 'symlink':\n return 2\n case 'character-device':\n return 3\n case 'block-device':\n return 4\n case 'directory':\n return 5\n case 'fifo':\n return 6\n case 'contiguous-file':\n return 7\n case 'pax-header':\n return 72\n }\n\n return 0\n}\n\nvar cksum = function (block) {\n var sum = 8 * 32\n for (var i = 0; i < 148; i++) sum += block[i]\n for (var j = 156; j < 512; j++) sum += block[j]\n return sum\n}\n\nvar encodeOct = function (val, n) {\n val = val.toString(8)\n if (val.length > n) return SEVENS.slice(0, n) + ' '\n else return ZEROS.slice(0, n - val.length) + val + ' '\n}\n\nvar addLength = function (str) {\n var len = Buffer.byteLength(str)\n var digits = Math.floor(Math.log(len) / Math.log(10)) + 1\n if (len + digits >= Math.pow(10, digits)) digits++\n\n return (len + digits) + str\n}\n\nexports.encodePax = function (opts) { // TODO: encode more stuff in pax\n var result = ''\n if (opts.name) result += addLength(' path=' + opts.name + '\\n')\n if (opts.linkname) result += addLength(' linkpath=' + opts.linkname + '\\n')\n var pax = opts.pax\n if (pax) {\n for (var key in pax) {\n result += addLength(' ' + key + '=' + pax[key] + '\\n')\n }\n }\n return Buffer.from(result)\n}\n\nexports.encode = function (opts) {\n var buf = alloc(512)\n var name = opts.name\n var prefix = ''\n\n if (opts.typeflag === 5 && name[name.length - 1] !== '/') name += '/'\n if (Buffer.byteLength(name) !== name.length) return null // utf-8\n\n while (Buffer.byteLength(name) > 100) {\n var i = name.indexOf('/')\n if (i === -1) return null\n prefix += prefix ? '/' + name.slice(0, i) : name.slice(0, i)\n name = name.slice(i + 1)\n }\n\n if (Buffer.byteLength(name) > 100 || Buffer.byteLength(prefix) > 155) return null\n if (opts.linkname && Buffer.byteLength(opts.linkname) > 100) return null\n\n buf.write(name)\n buf.write(encodeOct(opts.mode & MASK, 6), 100)\n buf.write(encodeOct(opts.uid, 6), 108)\n buf.write(encodeOct(opts.gid, 6), 116)\n buf.write(encodeOct(opts.size, 11), 124)\n buf.write(encodeOct((opts.mtime.getTime() / 1000) | 0, 11), 136)\n\n buf[156] = ZERO_OFFSET + toTypeflag(opts.type)\n\n if (opts.linkname) buf.write(opts.linkname, 157)\n\n USTAR_MAGIC.copy(buf, MAGIC_OFFSET)\n USTAR_VER.copy(buf, VERSION_OFFSET)\n if (opts.uname) buf.write(opts.uname, 265)\n if (opts.gname) buf.write(opts.gname, 297)\n buf.write(encodeOct(opts.devmajor || 0, 6), 329)\n buf.write(encodeOct(opts.devminor || 0, 6), 337)\n\n if (prefix) buf.write(prefix, 345)\n\n buf.write(encodeOct(cksum(buf), 6), 148)\n\n return buf\n}\n","'use strict'\n\nconst configure = require('./lib/configure')\n\nmodule.exports = configure(api => {\n return () => {\n const url = new URL(api.opts.base || '')\n return {\n host: url.hostname,\n port: url.port,\n protocol: url.protocol,\n pathname: url.pathname,\n 'api-path': url.pathname\n }\n }\n})\n","'use strict'\n\nconst toCamel = require('./lib/object-to-camel')\nconst multiaddr = require('multiaddr')\nconst configure = require('./lib/configure')\nconst toUrlSearchParams = require('./lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n /**\n * @type {import('.').Implements}\n */\n async function id (options = {}) {\n const res = await api.post('id', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams(options),\n headers: options.headers\n })\n const data = await res.json()\n\n const output = toCamel(data)\n\n if (output.addresses) {\n output.addresses = output.addresses.map(ma => multiaddr(ma))\n }\n\n return output\n }\n return id\n})\n","'use strict'\n\nmodule.exports = config => ({\n gen: require('./gen')(config),\n list: require('./list')(config),\n rename: require('./rename')(config),\n rm: require('./rm')(config),\n import: require('./import')(config)\n})\n","'use strict'\n\nconst toCamel = require('../lib/object-to-camel')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (name, options = {}) => {\n const res = await api.post('key/gen', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: name,\n ...options\n }),\n headers: options.headers\n })\n const data = await res.json()\n\n return toCamel(data)\n }\n})\n","'use strict'\n\nconst toCamel = require('../lib/object-to-camel')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (options = {}) => {\n const res = await api.post('key/list', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams(options),\n headers: options.headers\n })\n const data = await res.json()\n\n return (data.Keys || []).map(k => toCamel(k))\n }\n})\n","'use strict'\n\nconst toCamel = require('../lib/object-to-camel')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (oldName, newName, options = {}) => {\n const res = await api.post('key/rename', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: [\n oldName,\n newName\n ],\n ...options\n }),\n headers: options.headers\n })\n\n return toCamel(await res.json())\n }\n})\n","'use strict'\n\nconst toCamel = require('../lib/object-to-camel')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (name, options = {}) => {\n const res = await api.post('key/rm', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: name,\n ...options\n }),\n headers: options.headers\n })\n const data = await res.json()\n\n return toCamel(data.Keys[0])\n }\n})\n","'use strict'\n\nconst toCamel = require('../lib/object-to-camel')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (name, pem, password, options = {}) => {\n if (typeof password !== 'string') {\n options = password || {}\n password = null\n }\n\n const res = await api.post('key/import', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: name,\n pem,\n password,\n ...options\n }),\n headers: options.headers\n })\n const data = await res.json()\n\n return toCamel(data)\n }\n})\n","'use strict'\n\nmodule.exports = config => ({\n tail: require('./tail')(config),\n ls: require('./ls')(config),\n level: require('./level')(config)\n})\n","'use strict'\n\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async function * tail (options = {}) {\n const res = await api.post('log/tail', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams(options),\n headers: options.headers\n })\n\n yield * res.ndjson()\n }\n})\n","'use strict'\n\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (options = {}) => {\n const res = await api.post('log/ls', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams(options),\n headers: options.headers\n })\n\n const data = await res.json()\n return data.Strings\n }\n})\n","'use strict'\n\nconst toCamel = require('../lib/object-to-camel')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (subsystem, level, options = {}) => {\n const res = await api.post('log/level', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: [\n subsystem,\n level\n ],\n ...options\n }),\n headers: options.headers\n })\n\n return toCamel(await res.json())\n }\n})\n","'use strict'\n\nconst CID = require('cids')\nconst configure = require('./lib/configure')\nconst toUrlSearchParams = require('./lib/to-url-search-params')\nconst stat = require('./files/stat')\n\nmodule.exports = configure((api, opts) => {\n return async function * ls (path, options = {}) {\n const pathStr = `${path instanceof Uint8Array ? new CID(path) : path}`\n\n async function mapLink (link) {\n let hash = link.Hash\n\n if (hash.includes('/')) {\n // the hash is a path, but we need the CID\n const ipfsPath = hash.startsWith('/ipfs/') ? hash : `/ipfs/${hash}`\n const stats = await stat(opts)(ipfsPath)\n\n hash = stats.cid\n }\n\n const entry = {\n name: link.Name,\n path: pathStr + (link.Name ? `/${link.Name}` : ''),\n size: link.Size,\n cid: new CID(hash),\n type: typeOf(link),\n depth: link.Depth || 1\n }\n\n if (link.Mode) {\n entry.mode = parseInt(link.Mode, 8)\n }\n\n if (link.Mtime !== undefined && link.Mtime !== null) {\n entry.mtime = {\n secs: link.Mtime\n }\n\n if (link.MtimeNsecs !== undefined && link.MtimeNsecs !== null) {\n entry.mtime.nsecs = link.MtimeNsecs\n }\n }\n\n return entry\n }\n\n const res = await api.post('ls', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: pathStr,\n ...options\n }),\n headers: options.headers\n })\n\n for await (let result of res.ndjson()) {\n result = result.Objects\n\n if (!result) {\n throw new Error('expected .Objects in results')\n }\n\n result = result[0]\n if (!result) {\n throw new Error('expected one array in results.Objects')\n }\n\n const links = result.Links\n if (!Array.isArray(links)) {\n throw new Error('expected one array in results.Objects[0].Links')\n }\n\n if (!links.length) {\n // no links, this is a file, yield a single result\n yield mapLink(result)\n\n return\n }\n\n yield * links.map(mapLink)\n }\n }\n})\n\nfunction typeOf (link) {\n switch (link.Type) {\n case 1:\n case 5:\n return 'dir'\n case 2:\n return 'file'\n default:\n return 'unknown'\n }\n}\n","'use strict'\n\nconst toCamel = require('./lib/object-to-camel')\nconst configure = require('./lib/configure')\nconst toUrlSearchParams = require('./lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (options = {}) => {\n const res = await api.post('dns', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams(options),\n headers: options.headers\n })\n\n return toCamel(await res.json())\n }\n})\n","'use strict'\n\nmodule.exports = config => ({\n publish: require('./publish')(config),\n resolve: require('./resolve')(config),\n pubsub: require('./pubsub')(config)\n})\n","'use strict'\n\nconst toCamel = require('../lib/object-to-camel')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (path, options = {}) => {\n const res = await api.post('name/publish', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: path,\n ...options\n }),\n headers: options.headers\n })\n\n return toCamel(await res.json())\n }\n})\n","'use strict'\n\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async function * (path, options = {}) {\n const res = await api.post('name/resolve', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: path,\n stream: true,\n ...options\n }),\n headers: options.headers\n })\n\n for await (const result of res.ndjson()) {\n yield result.Path\n }\n }\n})\n","'use strict'\n\nmodule.exports = config => ({\n cancel: require('./cancel')(config),\n state: require('./state')(config),\n subs: require('./subs')(config)\n})\n","'use strict'\n\nconst toCamel = require('../../lib/object-to-camel')\nconst configure = require('../../lib/configure')\nconst toUrlSearchParams = require('../../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (name, options = {}) => {\n const res = await api.post('name/pubsub/cancel', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: name,\n ...options\n }),\n headers: options.headers\n })\n\n return toCamel(await res.json())\n }\n})\n","'use strict'\n\nconst toCamel = require('../../lib/object-to-camel')\nconst configure = require('../../lib/configure')\nconst toUrlSearchParams = require('../../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (options = {}) => {\n const res = await api.post('name/pubsub/state', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams(options),\n headers: options.headers\n })\n\n return toCamel(await res.json())\n }\n})\n","'use strict'\n\nconst configure = require('../../lib/configure')\nconst toUrlSearchParams = require('../../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (options = {}) => {\n const res = await api.post('name/pubsub/subs', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams(options),\n headers: options.headers\n })\n const data = await res.json()\n\n return data.Strings || []\n }\n})\n","'use strict'\n\nmodule.exports = config => ({\n data: require('./data')(config),\n get: require('./get')(config),\n links: require('./links')(config),\n new: require('./new')(config),\n patch: require('./patch')(config),\n put: require('./put')(config),\n stat: require('./stat')(config)\n})\n","'use strict'\n\nconst CID = require('cids')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async function data (cid, options = {}) {\n const res = await api.post('object/data', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: `${cid instanceof Uint8Array ? new CID(cid) : cid}`,\n ...options\n }),\n headers: options.headers\n })\n const data = await res.arrayBuffer()\n\n return new Uint8Array(data, 0, data.byteLength)\n }\n})\n","'use strict'\n\nconst CID = require('cids')\nconst { DAGNode, DAGLink } = require('ipld-dag-pb')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\nconst uint8ArrayFromString = require('uint8arrays/from-string')\n\nmodule.exports = configure(api => {\n return async (cid, options = {}) => {\n const res = await api.post('object/get', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: `${cid instanceof Uint8Array ? new CID(cid) : cid}`,\n dataEncoding: 'base64',\n ...options\n }),\n headers: options.headers\n })\n const data = await res.json()\n\n return new DAGNode(\n uint8ArrayFromString(data.Data, 'base64pad'),\n (data.Links || []).map(l => new DAGLink(l.Name, l.Size, l.Hash))\n )\n }\n})\n","'use strict'\n\nconst CID = require('cids')\nconst { DAGLink } = require('ipld-dag-pb')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (cid, options = {}) => {\n const res = await api.post('object/links', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: `${cid instanceof Uint8Array ? new CID(cid) : cid}`,\n ...options\n }),\n headers: options.headers\n })\n const data = await res.json()\n\n return (data.Links || []).map(l => new DAGLink(l.Name, l.Size, l.Hash))\n }\n})\n","'use strict'\n\nconst CID = require('cids')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (options = {}) => {\n const res = await api.post('object/new', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: options.template,\n ...options\n }),\n headers: options.headers\n })\n\n const { Hash } = await res.json()\n\n return new CID(Hash)\n }\n})\n","'use strict'\n\nmodule.exports = config => ({\n addLink: require('./add-link')(config),\n appendData: require('./append-data')(config),\n rmLink: require('./rm-link')(config),\n setData: require('./set-data')(config)\n})\n","'use strict'\n\nconst CID = require('cids')\nconst configure = require('../../lib/configure')\nconst toUrlSearchParams = require('../../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (cid, dLink, options = {}) => {\n const res = await api.post('object/patch/add-link', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: [\n `${cid instanceof Uint8Array ? new CID(cid) : cid}`,\n dLink.Name || dLink.name || '',\n (dLink.Hash || dLink.cid || '').toString() || null\n ],\n ...options\n }),\n headers: options.headers\n })\n\n const { Hash } = await res.json()\n\n return new CID(Hash)\n }\n})\n","'use strict'\n\nconst CID = require('cids')\nconst multipartRequest = require('../../lib/multipart-request')\nconst configure = require('../../lib/configure')\nconst toUrlSearchParams = require('../../lib/to-url-search-params')\nconst abortSignal = require('../../lib/abort-signal')\nconst { AbortController } = require('native-abort-controller')\n\nmodule.exports = configure(api => {\n return async (cid, data, options = {}) => {\n // allow aborting requests on body errors\n const controller = new AbortController()\n const signal = abortSignal(controller.signal, options.signal)\n\n // @ts-ignore https://github.com/ipfs/js-ipfs-utils/issues/90\n const res = await api.post('object/patch/append-data', {\n timeout: options.timeout,\n signal,\n searchParams: toUrlSearchParams({\n arg: `${cid instanceof Uint8Array ? new CID(cid) : cid}`,\n ...options\n }),\n ...(\n await multipartRequest(data, controller, options.headers)\n )\n })\n\n const { Hash } = await res.json()\n\n return new CID(Hash)\n }\n})\n","'use strict'\n\nconst CID = require('cids')\nconst configure = require('../../lib/configure')\nconst toUrlSearchParams = require('../../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (cid, dLink, options = {}) => {\n const res = await api.post('object/patch/rm-link', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: [\n `${cid instanceof Uint8Array ? new CID(cid) : cid}`,\n dLink.Name || dLink.name || null\n ],\n ...options\n }),\n headers: options.headers\n })\n\n const { Hash } = await res.json()\n\n return new CID(Hash)\n }\n})\n","'use strict'\n\nconst CID = require('cids')\nconst multipartRequest = require('../../lib/multipart-request')\nconst configure = require('../../lib/configure')\nconst toUrlSearchParams = require('../../lib/to-url-search-params')\nconst abortSignal = require('../../lib/abort-signal')\nconst { AbortController } = require('native-abort-controller')\n\nmodule.exports = configure(api => {\n return async (cid, data, options = {}) => {\n // allow aborting requests on body errors\n const controller = new AbortController()\n const signal = abortSignal(controller.signal, options.signal)\n\n // @ts-ignore https://github.com/ipfs/js-ipfs-utils/issues/90\n const { Hash } = await (await api.post('object/patch/set-data', {\n timeout: options.timeout,\n signal,\n searchParams: toUrlSearchParams({\n arg: [\n `${cid instanceof Uint8Array ? new CID(cid) : cid}`\n ],\n ...options\n }),\n ...(\n await multipartRequest(data, controller, options.headers)\n )\n })).json()\n\n return new CID(Hash)\n }\n})\n","'use strict'\n\nconst CID = require('cids')\nconst { DAGNode } = require('ipld-dag-pb')\nconst multipartRequest = require('../lib/multipart-request')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\nconst abortSignal = require('../lib/abort-signal')\nconst { AbortController } = require('native-abort-controller')\nconst unit8ArrayToString = require('uint8arrays/to-string')\nconst uint8ArrayFromString = require('uint8arrays/from-string')\n\nmodule.exports = configure(api => {\n return async (obj, options = {}) => {\n let tmpObj = {\n Links: []\n }\n\n if (obj instanceof Uint8Array) {\n if (!options.enc) {\n tmpObj = {\n Data: unit8ArrayToString(obj),\n Links: []\n }\n }\n } else if (DAGNode.isDAGNode(obj)) {\n tmpObj = {\n Data: unit8ArrayToString(obj.Data),\n Links: obj.Links.map(l => ({\n Name: l.Name,\n Hash: l.Hash.toString(),\n Size: l.Tsize\n }))\n }\n } else if (typeof obj === 'object') {\n tmpObj.Data = unit8ArrayToString(obj.Data)\n tmpObj.Links = obj.Links\n } else {\n throw new Error('obj not recognized')\n }\n\n let buf\n if (obj instanceof Uint8Array && options.enc) {\n buf = obj\n } else {\n options.enc = 'json'\n buf = uint8ArrayFromString(JSON.stringify(tmpObj))\n }\n\n // allow aborting requests on body errors\n const controller = new AbortController()\n const signal = abortSignal(controller.signal, options.signal)\n\n // @ts-ignore https://github.com/ipfs/js-ipfs-utils/issues/90\n const res = await api.post('object/put', {\n timeout: options.timeout,\n signal,\n searchParams: toUrlSearchParams(options),\n ...(\n await multipartRequest(buf, controller, options.headers)\n )\n })\n\n const { Hash } = await res.json()\n\n return new CID(Hash)\n }\n})\n","'use strict'\n\nconst CID = require('cids')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (cid, options = {}) => {\n const res = await api.post('object/stat', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: `${cid instanceof Uint8Array ? new CID(cid) : cid}`,\n ...options\n }),\n headers: options.headers\n })\n\n return res.json()\n }\n})\n","'use strict'\n\nconst Remote = require('./remote')\n\nmodule.exports = config => ({\n add: require('./add')(config),\n addAll: require('./add-all')(config),\n ls: require('./ls')(config),\n rm: require('./rm')(config),\n rmAll: require('./rm-all')(config),\n remote: new Remote(config)\n})\n","'use strict'\n\nconst CID = require('cids')\nconst Client = require('../../lib/core')\nconst Service = require('./service')\nconst toUrlSearchParams = require('../../lib/to-url-search-params')\n\n/**\n * @typedef {import('../..').HttpOptions} HttpOptions\n * @typedef {import('../../lib/core').ClientOptions} ClientOptions\n * @typedef {import('ipfs-core-types/src/basic').AbortOptions} AbortOptions\n * @typedef {import('ipfs-core-types/src/pin/remote').API} API\n * @typedef {import('ipfs-core-types/src/pin/remote').Pin} Pin\n * @typedef {import('ipfs-core-types/src/pin/remote').AddOptions} AddOptions\n * @typedef {import('ipfs-core-types/src/pin/remote').Query} Query\n * @typedef {import('ipfs-core-types/src/pin/remote').Status} Status\n *\n * @implements {API}\n */\nclass Remote {\n /**\n * @param {ClientOptions} options\n */\n constructor (options) {\n /** @private */\n this.client = new Client(options)\n /** @readonly */\n this.service = new Service(options)\n }\n\n /**\n * Stores an IPFS object(s) from a given path to a remote pinning service.\n *\n * @param {CID} cid\n * @param {AddOptions & AbortOptions & HttpOptions} options\n * @returns {Promise}\n */\n add (cid, options) {\n return Remote.add(this.client, cid, options)\n }\n\n /**\n * @param {Client} client\n * @param {CID} cid\n * @param {AddOptions & AbortOptions & HttpOptions} options\n */\n static async add (client, cid, { timeout, signal, headers, ...options }) {\n const response = await client.post('pin/remote/add', {\n timeout,\n signal,\n headers,\n searchParams: encodeAddParams({ cid, ...options })\n })\n\n return Remote.decodePin(await response.json())\n }\n\n /**\n * @param {Object} json\n * @param {string} json.Name\n * @param {string} json.Cid\n * @param {Status} json.Status\n * @returns {Pin}\n */\n static decodePin ({ Name: name, Status: status, Cid: cid }) {\n return {\n cid: new CID(cid),\n name,\n status\n }\n }\n\n /**\n * Returns a list of matching pins on the remote pinning service.\n *\n * @param {Query & AbortOptions & HttpOptions} query\n */\n ls (query) {\n return Remote.ls(this.client, query)\n }\n\n /**\n *\n * @param {Client} client\n * @param {Query & AbortOptions & HttpOptions} options\n * @returns {AsyncIterable}\n */\n static async * ls (client, { timeout, signal, headers, ...query }) {\n const response = await client.post('pin/remote/ls', {\n signal,\n timeout,\n headers,\n searchParams: encodeQuery(query)\n })\n\n for await (const pin of response.ndjson()) {\n yield Remote.decodePin(pin)\n }\n }\n\n /**\n * Removes a single pin object matching query allowing it to be garbage\n * collected (if needed). Will error if multiple pins mtach provided\n * query. To remove all matches use `rmAll` instead.\n *\n * @param {Query & AbortOptions & HttpOptions} query\n */\n rm (query) {\n return Remote.rm(this.client, { ...query, all: false })\n }\n\n /**\n * Removes all pin object that match given query allowing them to be garbage\n * collected if needed.\n *\n * @param {Query & AbortOptions & HttpOptions} query\n */\n rmAll (query) {\n return Remote.rm(this.client, { ...query, all: true })\n }\n\n /**\n *\n * @param {Client} client\n * @param {{all: boolean} & Query & AbortOptions & HttpOptions} options\n */\n static async rm (client, { timeout, signal, headers, ...query }) {\n await client.post('pin/remote/rm', {\n timeout,\n signal,\n headers,\n searchParams: encodeQuery(query)\n })\n }\n}\n\n/**\n * @param {any} service\n * @returns {string}\n */\nconst encodeService = (service) => {\n if (typeof service === 'string' && service !== '') {\n return service\n } else {\n throw new TypeError('service name must be passed')\n }\n}\n\n/**\n * @param {any} cid\n * @returns {string}\n */\nconst encodeCID = (cid) => {\n if (CID.isCID(cid)) {\n return cid.toString()\n } else {\n throw new TypeError(`CID instance expected instead of ${cid}`)\n }\n}\n\n/**\n * @param {Query & { all?: boolean }} query\n * @returns {URLSearchParams}\n */\nconst encodeQuery = ({ service, cid, name, status, all }) => {\n const query = toUrlSearchParams({\n service: encodeService(service),\n name,\n force: all ? true : undefined\n })\n\n if (cid) {\n for (const value of cid) {\n query.append('cid', encodeCID(value))\n }\n }\n\n if (status) {\n for (const value of status) {\n query.append('status', value)\n }\n }\n\n return query\n}\n\n/**\n * @param {AddOptions & {cid:CID}} options\n * @returns {URLSearchParams}\n */\nconst encodeAddParams = ({ cid, service, background, name, origins }) => {\n const params = toUrlSearchParams({\n arg: encodeCID(cid),\n service: encodeService(service),\n name,\n background: background ? true : undefined\n })\n\n if (origins) {\n for (const origin of origins) {\n params.append('origin', origin.toString())\n }\n }\n\n return params\n}\n\nmodule.exports = Remote\n","'use strict'\n\nconst Client = require('../../lib/core')\nconst toUrlSearchParams = require('../../lib/to-url-search-params')\n\n/**\n * @typedef {import('../../lib/core').ClientOptions} ClientOptions\n * @typedef {import('../..').HttpOptions} HttpOptions\n * @typedef {import('ipfs-core-types/src/basic').AbortOptions} AbortOptions\n * @typedef {import('ipfs-core-types/src/pin/remote/service').API} API\n * @typedef {import('ipfs-core-types/src/pin/remote/service').Credentials} Credentials\n * @typedef {import('ipfs-core-types/src/pin/remote/service').RemotePinService} RemotePinService\n * @typedef {import('ipfs-core-types/src/pin/remote/service').RemotePinServiceWithStat} RemotePinServiceWithStat\n * @implements {API}\n */\nclass Service {\n /**\n * @param {ClientOptions} options\n */\n constructor (options) {\n /** @private */\n this.client = new Client(options)\n }\n\n /**\n * @param {Client} client\n * @param {string} name\n * @param {Credentials & AbortOptions & HttpOptions} options\n */\n static async add (client, name, options) {\n const { endpoint, key, headers, timeout, signal } = options\n await client.post('pin/remote/service/add', {\n timeout,\n signal,\n searchParams: toUrlSearchParams({\n arg: [name, Service.encodeEndpoint(endpoint), key]\n }),\n headers\n })\n }\n\n /**\n * @param {URL} url\n */\n static encodeEndpoint (url) {\n const href = String(url)\n if (href === 'undefined') {\n throw Error('endpoint is required')\n }\n // Workaround trailing `/` issue in go-ipfs\n // @see https://github.com/ipfs/go-ipfs/issues/7826\n return href[href.length - 1] === '/' ? href.slice(0, -1) : href\n }\n\n /**\n * @param {Client} client\n * @param {string} name\n * @param {AbortOptions & HttpOptions} [options]\n */\n static async rm (client, name, { timeout, signal, headers } = {}) {\n await client.post('pin/remote/service/rm', {\n timeout,\n signal,\n headers,\n searchParams: toUrlSearchParams({\n arg: name\n })\n })\n }\n\n /**\n * @template {true} Stat\n * @param {Client} client\n * @param {{ stat?: Stat } & AbortOptions & HttpOptions} [options]\n */\n static async ls (client, { stat, timeout, signal, headers } = {}) {\n const response = await client.post('pin/remote/service/ls', {\n searchParams: stat === true ? toUrlSearchParams({ stat }) : undefined,\n timeout,\n signal,\n headers\n })\n\n /** @type {{RemoteServices: Object[]}} */\n const { RemoteServices } = await response.json()\n\n /** @type {Stat extends true ? RemotePinServiceWithStat[] : RemotePinService []} */\n return (RemoteServices.map(Service.decodeRemoteService))\n }\n\n /**\n * @param {Object} json\n * @returns {RemotePinServiceWithStat}\n */\n static decodeRemoteService (json) {\n return {\n service: json.Service,\n endpoint: new URL(json.ApiEndpoint),\n ...(json.Stat && { stat: Service.decodeStat(json.Stat) })\n }\n }\n\n /**\n * @param {Object} json\n * @returns {import('ipfs-core-types/src/pin/remote/service').Stat}\n */\n static decodeStat (json) {\n switch (json.Status) {\n case 'valid': {\n const { Pinning, Pinned, Queued, Failed } = json.PinCount\n return {\n status: 'valid',\n pinCount: {\n queued: Queued,\n pinning: Pinning,\n pinned: Pinned,\n failed: Failed\n }\n }\n }\n case 'invalid': {\n return { status: 'invalid' }\n }\n default: {\n return { status: json.Status }\n }\n }\n }\n\n /**\n * Registers remote pinning service with a given name. Errors if service\n * with the given name is already registered.\n *\n * @param {string} name\n * @param {Credentials & AbortOptions & HttpOptions} options\n */\n add (name, options) {\n return Service.add(this.client, name, options)\n }\n\n /**\n * Unregisteres remote pinning service with a given name. If service with such\n * name isn't registerede this is a noop.\n *\n * @param {string} name\n * @param {AbortOptions & HttpOptions} [options]\n */\n rm (name, options) {\n return Service.rm(this.client, name, options)\n }\n\n /**\n * List registered remote pinning services.\n *\n * @param {{ stat?: true } & AbortOptions & HttpOptions} [options]\n */\n ls (options) {\n return Service.ls(this.client, options)\n }\n}\n\nmodule.exports = Service\n","'use strict'\n\nconst addAll = require('./add-all')\nconst last = require('it-last')\nconst configure = require('../lib/configure')\n\nmodule.exports = (options) => {\n const all = addAll(options)\n\n return configure(() => {\n return async function add (path, options = {}) { // eslint-disable-line require-await\n return last(all({\n path,\n ...options\n }, options))\n }\n })(options)\n}\n","'use strict'\n\nconst CID = require('cids')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nfunction toPin (type, cid, metadata) {\n const pin = {\n type,\n cid: new CID(cid)\n }\n\n if (metadata) {\n pin.metadata = metadata\n }\n\n return pin\n}\n\nmodule.exports = configure(api => {\n return async function * ls (options = {}) {\n if (options.paths) {\n options.paths = Array.isArray(options.paths) ? options.paths : [options.paths]\n }\n\n const res = await api.post('pin/ls', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n ...options,\n arg: (options.paths || []).map(path => `${path}`),\n stream: true\n }),\n headers: options.headers\n })\n\n for await (const pin of res.ndjson()) {\n if (pin.Keys) { // non-streaming response\n for (const cid of Object.keys(pin.Keys)) {\n yield toPin(pin.Keys[cid].Type, cid, pin.Keys[cid].Metadata)\n }\n return\n }\n\n yield toPin(pin.Type, pin.Cid, pin.Metadata)\n }\n }\n})\n","'use strict'\n\nconst rmAll = require('./rm-all')\nconst last = require('it-last')\nconst configure = require('../lib/configure')\n\nmodule.exports = (options) => {\n const all = rmAll(options)\n\n return configure(() => {\n return async function rm (path, options = {}) { // eslint-disable-line require-await\n return last(all({\n path,\n ...options\n }, options))\n }\n })(options)\n}\n","'use strict'\n\nconst toCamel = require('./lib/object-to-camel')\nconst configure = require('./lib/configure')\nconst toUrlSearchParams = require('./lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async function * ping (peerId, options = {}) {\n const res = await api.post('ping', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: `${peerId}`,\n ...options\n }),\n headers: options.headers,\n transform: toCamel\n })\n\n yield * res.ndjson()\n }\n})\n","'use strict'\n\nmodule.exports = config => ({\n ls: require('./ls')(config),\n peers: require('./peers')(config),\n publish: require('./publish')(config),\n subscribe: require('./subscribe')(config),\n unsubscribe: require('./unsubscribe')(config)\n})\n","'use strict'\n\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (options = {}) => {\n const { Strings } = await (await api.post('pubsub/ls', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams(options),\n headers: options.headers\n })).json()\n\n return Strings || []\n }\n})\n","'use strict'\n\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (topic, options = {}) => {\n if (!options && typeof topic === 'object') {\n options = topic || {}\n topic = null\n }\n\n const res = await api.post('pubsub/peers', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: topic,\n ...options\n }),\n headers: options.headers\n })\n\n const { Strings } = await res.json()\n\n return Strings || []\n }\n})\n","'use strict'\n\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\nconst multipartRequest = require('../lib/multipart-request')\nconst abortSignal = require('../lib/abort-signal')\nconst { AbortController } = require('native-abort-controller')\n\nmodule.exports = configure(api => {\n return async (topic, data, options = {}) => {\n const searchParams = toUrlSearchParams({\n arg: topic,\n ...options\n })\n\n // allow aborting requests on body errors\n const controller = new AbortController()\n const signal = abortSignal(controller.signal, options.signal)\n\n // @ts-ignore https://github.com/ipfs/js-ipfs-utils/issues/90\n const res = await api.post('pubsub/pub', {\n timeout: options.timeout,\n signal,\n searchParams,\n ...(\n await multipartRequest(data, controller, options.headers)\n )\n })\n\n await res.text()\n }\n})\n","'use strict'\n\nconst uint8ArrayFromString = require('uint8arrays/from-string')\nconst uint8ArrayToString = require('uint8arrays/to-string')\nconst log = require('debug')('ipfs-http-client:pubsub:subscribe')\nconst SubscriptionTracker = require('./subscription-tracker')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure((api, options) => {\n const subsTracker = SubscriptionTracker.singleton()\n\n return async (topic, handler, options = {}) => { // eslint-disable-line require-await\n options.signal = subsTracker.subscribe(topic, handler, options.signal)\n\n let done\n let fail\n\n const result = new Promise((resolve, reject) => {\n done = resolve\n fail = reject\n })\n\n // In Firefox, the initial call to fetch does not resolve until some data\n // is received. If this doesn't happen within 1 second assume success\n const ffWorkaround = setTimeout(() => done(), 1000)\n\n // Do this async to not block Firefox\n setTimeout(() => {\n api.post('pubsub/sub', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: topic,\n ...options\n }),\n headers: options.headers\n })\n .catch((err) => {\n // Initial subscribe fail, ensure we clean up\n subsTracker.unsubscribe(topic, handler)\n\n fail(err)\n })\n .then((response) => {\n clearTimeout(ffWorkaround)\n\n if (!response) {\n // if there was no response, the subscribe failed\n return\n }\n\n readMessages(response.ndjson(), {\n onMessage: handler,\n onEnd: () => subsTracker.unsubscribe(topic, handler),\n onError: options.onError\n })\n\n done()\n })\n }, 0)\n\n return result\n }\n})\n\nasync function readMessages (msgStream, { onMessage, onEnd, onError }) {\n onError = onError || log\n\n try {\n for await (const msg of msgStream) {\n try {\n if (!msg.from) {\n continue\n }\n\n onMessage({\n from: uint8ArrayToString(uint8ArrayFromString(msg.from, 'base64pad'), 'base58btc'),\n data: uint8ArrayFromString(msg.data, 'base64pad'),\n seqno: uint8ArrayFromString(msg.seqno, 'base64pad'),\n topicIDs: msg.topicIDs\n })\n } catch (err) {\n err.message = `Failed to parse pubsub message: ${err.message}`\n onError(err, false, msg) // Not fatal\n }\n }\n } catch (err) {\n // FIXME: In testing with Chrome, err.type is undefined (should not be!)\n // Temporarily use the name property instead.\n if (err.type !== 'aborted' && err.name !== 'AbortError') {\n onError(err, true) // Fatal\n }\n } finally {\n onEnd()\n }\n}\n","'use strict'\n\nconst SubscriptionTracker = require('./subscription-tracker')\n\nmodule.exports = api => {\n const subsTracker = SubscriptionTracker.singleton()\n // eslint-disable-next-line require-await\n return async (topic, handler) => subsTracker.unsubscribe(topic, handler)\n}\n","'use strict'\n\nconst CID = require('cids')\nconst toCamel = require('../lib/object-to-camel')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure((api, options) => {\n const refs = async function * (args, options = {}) {\n if (!Array.isArray(args)) {\n args = [args]\n }\n\n const res = await api.post('refs', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: args.map(arg => `${arg instanceof Uint8Array ? new CID(arg) : arg}`),\n ...options\n }),\n headers: options.headers,\n transform: toCamel\n })\n\n yield * res.ndjson()\n }\n refs.local = require('./local')(options)\n\n return refs\n})\n","'use strict'\n\nconst toCamel = require('../lib/object-to-camel')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async function * refsLocal (options = {}) {\n const res = await api.post('refs/local', {\n timeout: options.timeout,\n signal: options.signal,\n transform: toCamel,\n searchParams: toUrlSearchParams(options),\n headers: options.headers\n })\n\n yield * res.ndjson()\n }\n})\n","'use strict'\n\nmodule.exports = config => ({\n gc: require('./gc')(config),\n stat: require('./stat')(config),\n version: require('./version')(config)\n})\n","'use strict'\n\nconst CID = require('cids')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async function * gc (options = {}) {\n const res = await api.post('repo/gc', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams(options),\n headers: options.headers,\n transform: (res) => {\n return {\n err: res.Error ? new Error(res.Error) : null,\n cid: (res.Key || {})['/'] ? new CID(res.Key['/']) : null\n }\n }\n })\n\n yield * res.ndjson()\n }\n})\n","'use strict'\n\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (options = {}) => {\n const res = await (await api.post('repo/version', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams(options),\n headers: options.headers\n })).json()\n\n return res.Version\n }\n})\n","'use strict'\n\nconst configure = require('./lib/configure')\nconst toUrlSearchParams = require('./lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n /**\n * @type {import('.').Implements}\n */\n async function resolve (path, options = {}) {\n const res = await api.post('resolve', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: path,\n ...options\n }),\n headers: options.headers\n })\n const { Path } = await res.json()\n return Path\n }\n return resolve\n})\n","'use strict'\n\nmodule.exports = config => ({\n bitswap: require('../bitswap/stat')(config),\n bw: require('./bw')(config),\n repo: require('../repo/stat')(config)\n})\n","'use strict'\n\nconst { BigNumber } = require('bignumber.js')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async function * bw (options = {}) {\n const res = await api.post('stats/bw', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams(options),\n headers: options.headers,\n transform: (stats) => ({\n totalIn: new BigNumber(stats.TotalIn),\n totalOut: new BigNumber(stats.TotalOut),\n rateIn: new BigNumber(stats.RateIn),\n rateOut: new BigNumber(stats.RateOut)\n })\n })\n\n yield * res.ndjson()\n }\n})\n","'use strict'\n\nmodule.exports = config => ({\n addrs: require('./addrs')(config),\n connect: require('./connect')(config),\n disconnect: require('./disconnect')(config),\n localAddrs: require('./localAddrs')(config),\n peers: require('./peers')(config)\n})\n","'use strict'\n\nconst multiaddr = require('multiaddr')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (options = {}) => {\n const res = await api.post('swarm/addrs', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams(options),\n headers: options.headers\n })\n const { Addrs } = await res.json()\n\n return Object.keys(Addrs).map(id => ({\n id,\n addrs: (Addrs[id] || []).map(a => multiaddr(a))\n }))\n }\n})\n","'use strict'\n\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (addrs, options = {}) => {\n addrs = Array.isArray(addrs) ? addrs : [addrs]\n\n const res = await api.post('swarm/connect', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: addrs.map(addr => `${addr}`),\n ...options\n }),\n headers: options.headers\n })\n const { Strings } = await res.json()\n\n return Strings || []\n }\n})\n","'use strict'\n\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (addrs, options = {}) => {\n addrs = Array.isArray(addrs) ? addrs : [addrs]\n\n const res = await api.post('swarm/disconnect', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams({\n arg: addrs.map(addr => `${addr}`),\n ...options\n }),\n headers: options.headers\n })\n const { Strings } = await res.json()\n\n return Strings || []\n }\n})\n","'use strict'\n\nconst multiaddr = require('multiaddr')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (options = {}) => {\n const res = await api.post('swarm/addrs/local', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams(options),\n headers: options.headers\n })\n const { Strings } = await res.json()\n\n return (Strings || []).map(a => multiaddr(a))\n }\n})\n","'use strict'\n\nconst multiaddr = require('multiaddr')\nconst configure = require('../lib/configure')\nconst toUrlSearchParams = require('../lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n return async (options = {}) => {\n const res = await (await api.post('swarm/peers', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams(options),\n headers: options.headers\n })).json()\n\n return (res.Peers || []).map(peer => {\n const info = {}\n try {\n info.addr = multiaddr(peer.Addr)\n info.peer = peer.Peer\n } catch (error) {\n info.error = error\n info.rawPeerInfo = peer\n }\n if (peer.Muxer) {\n info.muxer = peer.Muxer\n }\n if (peer.Latency) {\n info.latency = peer.Latency\n }\n if (peer.Streams) {\n info.streams = peer.Streams\n }\n if (peer.Direction != null) {\n info.direction = peer.Direction\n }\n return info\n })\n }\n})\n","'use strict'\n\nconst toCamel = require('./lib/object-to-camel')\nconst configure = require('./lib/configure')\nconst toUrlSearchParams = require('./lib/to-url-search-params')\n\nmodule.exports = configure(api => {\n /**\n * @type {import('.').Implements}\n */\n async function version (options = {}) {\n const res = await api.post('version', {\n timeout: options.timeout,\n signal: options.signal,\n searchParams: toUrlSearchParams(options),\n headers: options.headers\n })\n\n return toCamel(await res.json())\n }\n\n return version\n})\n","'use strict'\n/* global self */\n\n// Establish the root object, `window` in the browser, `self` in Service Worker. or `global` on the server.\n// Credit: https://github.com/megawac/underscore/commit/365311c9a440438531ca1c6bfd49e3c7c5f46079\nmodule.exports = (typeof self === 'object' && self.self === self && self) ||\n (typeof global === 'object' && global.global === global && global) ||\n this\n","'use strict'\n\nconst PROVIDERS = require('../constants/providers')\n\nasync function tryWebExt ({ root, connectionTest }) {\n // Opportunistic optimizations when running inside of web extension (eg. ipfs-companion)\n if (typeof root.chrome === 'object' && root.chrome.extension && root.chrome.extension.getBackgroundPage) {\n // Note: under some vendors getBackgroundPage() will return null if window is in incognito mode\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1329304\n let bg = null\n try {\n bg = root.chrome.extension.getBackgroundPage()\n } catch (err) {\n // not in browser extension\n return null\n }\n // If extension is exposing IPFS API as `ipfs` on the background page\n // it can be used directly for the best performance\n if (bg && bg.ipfs) {\n const { ipfs } = bg\n await connectionTest(ipfs)\n return { ipfs, provider: PROVIDERS.webExt }\n }\n /* Other endpoints can be added here in the future.\n For example, Companion could provide API for other browser extensions:\n https://github.com/ipfs-shipyard/ipfs-companion/issues/307 */\n }\n}\n\nmodule.exports = tryWebExt\n","'use strict'\n\nconst PROVIDERS = require('../constants/providers')\n\nasync function tryWindow ({ root, permissions, connectionTest }) {\n if (root.ipfs) {\n // files.get is required for testing if API works, ensure we request it\n if (!(permissions && permissions.commands && permissions.commands.includes('files.get'))) {\n permissions = permissions || {}\n permissions = JSON.parse(JSON.stringify(permissions)) // deep copy to work with freezed objects\n permissions.commands = permissions.commands || []\n permissions.commands.push('files.get')\n }\n // try window.ipfs.enable first: https://github.com/ipfs-shipyard/ipfs-companion/issues/589\n const ipfs = typeof root.ipfs.enable === 'function'\n ? await root.ipfs.enable(permissions)\n : root.ipfs\n await connectionTest(ipfs)\n return { ipfs, provider: PROVIDERS.windowIpfs }\n }\n}\n\nmodule.exports = tryWindow\n","'use strict'\n\nconst { URL } = require('iso-url')\nconst PROVIDERS = require('../constants/providers')\nconst { DEFAULT_HTTP_API } = require('../constants/defaults')\n\n/*\n * This provider lazy-loads https://github.com/ipfs/js-ipfs/tree/master/packages/ipfs-http-client\n * so it is not included as a dependency if not used.\n *\n * HTTP Client init fallback:\n * 1. Use constructor returned by loadHttpClientModule function\n * 2. Fallback to window.IpfsHttpClient\n *\n * API URL fallback order:\n * 1. Try user specified API address\n * 2. Try current origin\n * 3. Try DEFAULT_HTTP_API\n*/\nasync function tryHttpClient ({ loadHttpClientModule, apiAddress, root, connectionTest, ...options }) {\n // Find HTTP client\n let httpClient\n if (loadHttpClientModule) httpClient = await loadHttpClientModule()\n\n // Final fallback to window.IpfsHttpClient or error\n if (!httpClient) {\n if (root.IpfsHttpClient) {\n httpClient = root.IpfsHttpClient\n } else {\n throw new Error('ipfs-provider could not initialize js-ipfs-http-client: make sure its constructor is returned by loadHttpClientModule function or exposed at window.IpfsHttpClient')\n }\n }\n\n // Allow the use of `import` or `require` on `loadHttpClientModule` fn\n httpClient = httpClient.default || httpClient // TODO: create 'import' demo in examples/\n\n // If explicit custom apiAddress provided, only try that.\n if (apiAddress || options.url || options.host) {\n return maybeApi({ apiAddress, connectionTest, httpClient, ...options })\n }\n\n // Current origin is not localhost:5001 so try with current origin info\n const { location } = root\n if (location && !(location.port === '5001' && location.hostname.match(/^127.0.0.1$|^localhost$/))) {\n const origin = new URL(location.origin)\n origin.pathname = '/'\n const res = await maybeApi({\n apiAddress: origin.toString(),\n connectionTest,\n httpClient,\n ...options\n })\n if (res) return res\n }\n\n // ...otherwise try /ip4/127.0.0.1/tcp/5001\n return maybeApi({ apiAddress: DEFAULT_HTTP_API, connectionTest, httpClient, ...options })\n}\n\n// Init and test an api client against provided API address.\n// Returns js-ipfs-http-client instance or null\nasync function maybeApi ({ apiAddress, connectionTest, httpClient, ...options }) {\n try {\n let ipfs\n try {\n ipfs = httpClient.create({ ...options, ...clientOptions(apiAddress) })\n } catch (_) {\n ipfs = httpClient({ ...options, ...clientOptions(apiAddress) })\n }\n await connectionTest(ipfs)\n return { ipfs, provider: PROVIDERS.httpClient, apiAddress }\n } catch (error) {\n // Failed to connect to ipfs-api in `apiAddress`\n // console.error('[ipfs-provider:httpClient]', error)\n return null\n }\n}\n\n// Convert string with URL or Multiaddr to explicit configuration object\n// https://www.npmjs.com/package/ipfs-http-client#usage\nconst clientOptions = (apiAddress) => {\n switch (typeof apiAddress) {\n case 'string':\n return { url: apiAddress }\n case 'object':\n return JSON.parse(JSON.stringify(apiAddress)) // ensure deep copy\n case 'undefined':\n return {}\n default:\n throw new Error('invalid apiAddress passed to httpClient')\n }\n}\n\nmodule.exports = tryHttpClient\n","'use strict'\n\nconst {\n URLWithLegacySupport,\n format,\n URLSearchParams,\n defaultBase\n} = require('./src/url')\nconst relative = require('./src/relative')\n\nmodule.exports = {\n URL: URLWithLegacySupport,\n URLSearchParams,\n format,\n relative,\n defaultBase\n}\n","'use strict'\n\nconst { URLWithLegacySupport, format } = require('./url')\n\n/**\n * @param {string | undefined} url\n * @param {any} [location]\n * @param {any} [protocolMap]\n * @param {any} [defaultProtocol]\n */\nmodule.exports = (url, location = {}, protocolMap = {}, defaultProtocol) => {\n let protocol = location.protocol\n ? location.protocol.replace(':', '')\n : 'http'\n\n // Check protocol map\n protocol = (protocolMap[protocol] || defaultProtocol || protocol) + ':'\n let urlParsed\n\n try {\n urlParsed = new URLWithLegacySupport(url)\n } catch (err) {\n urlParsed = {}\n }\n\n const base = Object.assign({}, location, {\n protocol: protocol || urlParsed.protocol,\n host: location.host || urlParsed.host\n })\n\n return new URLWithLegacySupport(url, format(base)).toString()\n}\n","'use strict'\n\nmodule.exports = {\n DEFAULT_HTTP_API: '/ip4/127.0.0.1/tcp/5001'\n}\n","'use strict'\n\nconst PROVIDERS = require('../constants/providers')\n\nasync function createIpfs (ipfsModule, opts) {\n // Allow the use of `import` or `require` on `getJsIpfs` fn\n ipfsModule = ipfsModule.default || ipfsModule\n return ipfsModule.create(opts)\n}\n\nasync function tryJsIpfs ({ connectionTest, loadJsIpfsModule, options, init = createIpfs }) {\n const ipfsModule = await loadJsIpfsModule()\n const ipfs = await init(ipfsModule, options)\n await connectionTest(ipfs)\n return { ipfs, provider: PROVIDERS.jsIpfs }\n}\n\nmodule.exports = tryJsIpfs\n","'use strict';\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar React = require('react');\nvar React__default = _interopDefault(React);\nvar shallowEqual = _interopDefault(require('shallowequal'));\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nvar canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\nfunction withSideEffect(reducePropsToState, handleStateChangeOnClient, mapStateOnServer) {\n if (typeof reducePropsToState !== 'function') {\n throw new Error('Expected reducePropsToState to be a function.');\n }\n\n if (typeof handleStateChangeOnClient !== 'function') {\n throw new Error('Expected handleStateChangeOnClient to be a function.');\n }\n\n if (typeof mapStateOnServer !== 'undefined' && typeof mapStateOnServer !== 'function') {\n throw new Error('Expected mapStateOnServer to either be undefined or a function.');\n }\n\n function getDisplayName(WrappedComponent) {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\n }\n\n return function wrap(WrappedComponent) {\n if (typeof WrappedComponent !== 'function') {\n throw new Error('Expected WrappedComponent to be a React component.');\n }\n\n var mountedInstances = [];\n var state;\n\n function emitChange() {\n state = reducePropsToState(mountedInstances.map(function (instance) {\n return instance.props;\n }));\n\n if (SideEffect.canUseDOM) {\n handleStateChangeOnClient(state);\n } else if (mapStateOnServer) {\n state = mapStateOnServer(state);\n }\n }\n\n var SideEffect =\n /*#__PURE__*/\n function (_Component) {\n _inheritsLoose(SideEffect, _Component);\n\n function SideEffect() {\n return _Component.apply(this, arguments) || this;\n }\n\n // Try to use displayName of wrapped component\n // Expose canUseDOM so tests can monkeypatch it\n SideEffect.peek = function peek() {\n return state;\n };\n\n SideEffect.rewind = function rewind() {\n if (SideEffect.canUseDOM) {\n throw new Error('You may only call rewind() on the server. Call peek() to read the current state.');\n }\n\n var recordedState = state;\n state = undefined;\n mountedInstances = [];\n return recordedState;\n };\n\n var _proto = SideEffect.prototype;\n\n _proto.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {\n return !shallowEqual(nextProps, this.props);\n };\n\n _proto.componentWillMount = function componentWillMount() {\n mountedInstances.push(this);\n emitChange();\n };\n\n _proto.componentDidUpdate = function componentDidUpdate() {\n emitChange();\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n var index = mountedInstances.indexOf(this);\n mountedInstances.splice(index, 1);\n emitChange();\n };\n\n _proto.render = function render() {\n return React__default.createElement(WrappedComponent, this.props);\n };\n\n return SideEffect;\n }(React.Component);\n\n _defineProperty(SideEffect, \"displayName\", \"SideEffect(\" + getDisplayName(WrappedComponent) + \")\");\n\n _defineProperty(SideEffect, \"canUseDOM\", canUseDOM);\n\n return SideEffect;\n };\n}\n\nmodule.exports = withSideEffect;\n","//\n\nmodule.exports = function shallowEqual(objA, objB, compare, compareContext) {\n var ret = compare ? compare.call(compareContext, objA, objB) : void 0;\n\n if (ret !== void 0) {\n return !!ret;\n }\n\n if (objA === objB) {\n return true;\n }\n\n if (typeof objA !== \"object\" || !objA || typeof objB !== \"object\" || !objB) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);\n\n // Test for A's keys different from B.\n for (var idx = 0; idx < keysA.length; idx++) {\n var key = keysA[idx];\n\n if (!bHasOwnProperty(key)) {\n return false;\n }\n\n var valueA = objA[key];\n var valueB = objB[key];\n\n ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;\n\n if (ret === false || (ret === void 0 && valueA !== valueB)) {\n return false;\n }\n }\n\n return true;\n};\n","'use strict';\n\nvar isArray = Array.isArray;\nvar keyList = Object.keys;\nvar hasProp = Object.prototype.hasOwnProperty;\nvar hasElementType = typeof Element !== 'undefined';\n\nfunction equal(a, b) {\n // fast-deep-equal index.js 2.0.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n var arrA = isArray(a)\n , arrB = isArray(b)\n , i\n , length\n , key;\n\n if (arrA && arrB) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n if (arrA != arrB) return false;\n\n var dateA = a instanceof Date\n , dateB = b instanceof Date;\n if (dateA != dateB) return false;\n if (dateA && dateB) return a.getTime() == b.getTime();\n\n var regexpA = a instanceof RegExp\n , regexpB = b instanceof RegExp;\n if (regexpA != regexpB) return false;\n if (regexpA && regexpB) return a.toString() == b.toString();\n\n var keys = keyList(a);\n length = keys.length;\n\n if (length !== keyList(b).length)\n return false;\n\n for (i = length; i-- !== 0;)\n if (!hasProp.call(b, keys[i])) return false;\n // end fast-deep-equal\n\n // start react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element && b instanceof Element)\n return a === b;\n\n // custom handling for React\n for (i = length; i-- !== 0;) {\n key = keys[i];\n if (key === '_owner' && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner.\n // _owner contains circular references\n // and is not needed when comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of a react element\n continue;\n } else {\n // all other properties should be traversed as usual\n if (!equal(a[key], b[key])) return false;\n }\n }\n // end react-fast-compare\n\n // fast-deep-equal index.js 2.0.1\n return true;\n }\n\n return a !== a && b !== b;\n}\n// end fast-deep-equal\n\nmodule.exports = function exportedEqual(a, b) {\n try {\n return equal(a, b);\n } catch (error) {\n if ((error.message && error.message.match(/stack|recursion/i)) || (error.number === -2146828260)) {\n // warn on circular references, don't crash\n // browsers give this different errors name and messages:\n // chrome/safari: \"RangeError\", \"Maximum call stack size exceeded\"\n // firefox: \"InternalError\", too much recursion\"\n // edge: \"Error\", \"Out of stack space\"\n console.warn('Warning: react-fast-compare does not handle circular references.', error.name, error.message);\n return false;\n }\n // some other error. we should definitely know about these\n throw error;\n }\n};\n","exports.__esModule = true;\nexports.warn = exports.requestAnimationFrame = exports.reducePropsToState = exports.mapStateOnServer = exports.handleClientStateChange = exports.convertReactPropstoHtmlAttributes = undefined;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = require(\"react\");\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _objectAssign = require(\"object-assign\");\n\nvar _objectAssign2 = _interopRequireDefault(_objectAssign);\n\nvar _HelmetConstants = require(\"./HelmetConstants.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar encodeSpecialCharacters = function encodeSpecialCharacters(str) {\n var encode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n if (encode === false) {\n return String(str);\n }\n\n return String(str).replace(/&/g, \"&\").replace(//g, \">\").replace(/\"/g, \""\").replace(/'/g, \"'\");\n};\n\nvar getTitleFromPropsList = function getTitleFromPropsList(propsList) {\n var innermostTitle = getInnermostProperty(propsList, _HelmetConstants.TAG_NAMES.TITLE);\n var innermostTemplate = getInnermostProperty(propsList, _HelmetConstants.HELMET_PROPS.TITLE_TEMPLATE);\n\n if (innermostTemplate && innermostTitle) {\n // use function arg to avoid need to escape $ characters\n return innermostTemplate.replace(/%s/g, function () {\n return innermostTitle;\n });\n }\n\n var innermostDefaultTitle = getInnermostProperty(propsList, _HelmetConstants.HELMET_PROPS.DEFAULT_TITLE);\n\n return innermostTitle || innermostDefaultTitle || undefined;\n};\n\nvar getOnChangeClientState = function getOnChangeClientState(propsList) {\n return getInnermostProperty(propsList, _HelmetConstants.HELMET_PROPS.ON_CHANGE_CLIENT_STATE) || function () {};\n};\n\nvar getAttributesFromPropsList = function getAttributesFromPropsList(tagType, propsList) {\n return propsList.filter(function (props) {\n return typeof props[tagType] !== \"undefined\";\n }).map(function (props) {\n return props[tagType];\n }).reduce(function (tagAttrs, current) {\n return _extends({}, tagAttrs, current);\n }, {});\n};\n\nvar getBaseTagFromPropsList = function getBaseTagFromPropsList(primaryAttributes, propsList) {\n return propsList.filter(function (props) {\n return typeof props[_HelmetConstants.TAG_NAMES.BASE] !== \"undefined\";\n }).map(function (props) {\n return props[_HelmetConstants.TAG_NAMES.BASE];\n }).reverse().reduce(function (innermostBaseTag, tag) {\n if (!innermostBaseTag.length) {\n var keys = Object.keys(tag);\n\n for (var i = 0; i < keys.length; i++) {\n var attributeKey = keys[i];\n var lowerCaseAttributeKey = attributeKey.toLowerCase();\n\n if (primaryAttributes.indexOf(lowerCaseAttributeKey) !== -1 && tag[lowerCaseAttributeKey]) {\n return innermostBaseTag.concat(tag);\n }\n }\n }\n\n return innermostBaseTag;\n }, []);\n};\n\nvar getTagsFromPropsList = function getTagsFromPropsList(tagName, primaryAttributes, propsList) {\n // Calculate list of tags, giving priority innermost component (end of the propslist)\n var approvedSeenTags = {};\n\n return propsList.filter(function (props) {\n if (Array.isArray(props[tagName])) {\n return true;\n }\n if (typeof props[tagName] !== \"undefined\") {\n warn(\"Helmet: \" + tagName + \" should be of type \\\"Array\\\". Instead found type \\\"\" + _typeof(props[tagName]) + \"\\\"\");\n }\n return false;\n }).map(function (props) {\n return props[tagName];\n }).reverse().reduce(function (approvedTags, instanceTags) {\n var instanceSeenTags = {};\n\n instanceTags.filter(function (tag) {\n var primaryAttributeKey = void 0;\n var keys = Object.keys(tag);\n for (var i = 0; i < keys.length; i++) {\n var attributeKey = keys[i];\n var lowerCaseAttributeKey = attributeKey.toLowerCase();\n\n // Special rule with link tags, since rel and href are both primary tags, rel takes priority\n if (primaryAttributes.indexOf(lowerCaseAttributeKey) !== -1 && !(primaryAttributeKey === _HelmetConstants.TAG_PROPERTIES.REL && tag[primaryAttributeKey].toLowerCase() === \"canonical\") && !(lowerCaseAttributeKey === _HelmetConstants.TAG_PROPERTIES.REL && tag[lowerCaseAttributeKey].toLowerCase() === \"stylesheet\")) {\n primaryAttributeKey = lowerCaseAttributeKey;\n }\n // Special case for innerHTML which doesn't work lowercased\n if (primaryAttributes.indexOf(attributeKey) !== -1 && (attributeKey === _HelmetConstants.TAG_PROPERTIES.INNER_HTML || attributeKey === _HelmetConstants.TAG_PROPERTIES.CSS_TEXT || attributeKey === _HelmetConstants.TAG_PROPERTIES.ITEM_PROP)) {\n primaryAttributeKey = attributeKey;\n }\n }\n\n if (!primaryAttributeKey || !tag[primaryAttributeKey]) {\n return false;\n }\n\n var value = tag[primaryAttributeKey].toLowerCase();\n\n if (!approvedSeenTags[primaryAttributeKey]) {\n approvedSeenTags[primaryAttributeKey] = {};\n }\n\n if (!instanceSeenTags[primaryAttributeKey]) {\n instanceSeenTags[primaryAttributeKey] = {};\n }\n\n if (!approvedSeenTags[primaryAttributeKey][value]) {\n instanceSeenTags[primaryAttributeKey][value] = true;\n return true;\n }\n\n return false;\n }).reverse().forEach(function (tag) {\n return approvedTags.push(tag);\n });\n\n // Update seen tags with tags from this instance\n var keys = Object.keys(instanceSeenTags);\n for (var i = 0; i < keys.length; i++) {\n var attributeKey = keys[i];\n var tagUnion = (0, _objectAssign2.default)({}, approvedSeenTags[attributeKey], instanceSeenTags[attributeKey]);\n\n approvedSeenTags[attributeKey] = tagUnion;\n }\n\n return approvedTags;\n }, []).reverse();\n};\n\nvar getInnermostProperty = function getInnermostProperty(propsList, property) {\n for (var i = propsList.length - 1; i >= 0; i--) {\n var props = propsList[i];\n\n if (props.hasOwnProperty(property)) {\n return props[property];\n }\n }\n\n return null;\n};\n\nvar reducePropsToState = function reducePropsToState(propsList) {\n return {\n baseTag: getBaseTagFromPropsList([_HelmetConstants.TAG_PROPERTIES.HREF], propsList),\n bodyAttributes: getAttributesFromPropsList(_HelmetConstants.ATTRIBUTE_NAMES.BODY, propsList),\n defer: getInnermostProperty(propsList, _HelmetConstants.HELMET_PROPS.DEFER),\n encode: getInnermostProperty(propsList, _HelmetConstants.HELMET_PROPS.ENCODE_SPECIAL_CHARACTERS),\n htmlAttributes: getAttributesFromPropsList(_HelmetConstants.ATTRIBUTE_NAMES.HTML, propsList),\n linkTags: getTagsFromPropsList(_HelmetConstants.TAG_NAMES.LINK, [_HelmetConstants.TAG_PROPERTIES.REL, _HelmetConstants.TAG_PROPERTIES.HREF], propsList),\n metaTags: getTagsFromPropsList(_HelmetConstants.TAG_NAMES.META, [_HelmetConstants.TAG_PROPERTIES.NAME, _HelmetConstants.TAG_PROPERTIES.CHARSET, _HelmetConstants.TAG_PROPERTIES.HTTPEQUIV, _HelmetConstants.TAG_PROPERTIES.PROPERTY, _HelmetConstants.TAG_PROPERTIES.ITEM_PROP], propsList),\n noscriptTags: getTagsFromPropsList(_HelmetConstants.TAG_NAMES.NOSCRIPT, [_HelmetConstants.TAG_PROPERTIES.INNER_HTML], propsList),\n onChangeClientState: getOnChangeClientState(propsList),\n scriptTags: getTagsFromPropsList(_HelmetConstants.TAG_NAMES.SCRIPT, [_HelmetConstants.TAG_PROPERTIES.SRC, _HelmetConstants.TAG_PROPERTIES.INNER_HTML], propsList),\n styleTags: getTagsFromPropsList(_HelmetConstants.TAG_NAMES.STYLE, [_HelmetConstants.TAG_PROPERTIES.CSS_TEXT], propsList),\n title: getTitleFromPropsList(propsList),\n titleAttributes: getAttributesFromPropsList(_HelmetConstants.ATTRIBUTE_NAMES.TITLE, propsList)\n };\n};\n\nvar rafPolyfill = function () {\n var clock = Date.now();\n\n return function (callback) {\n var currentTime = Date.now();\n\n if (currentTime - clock > 16) {\n clock = currentTime;\n callback(currentTime);\n } else {\n setTimeout(function () {\n rafPolyfill(callback);\n }, 0);\n }\n };\n}();\n\nvar cafPolyfill = function cafPolyfill(id) {\n return clearTimeout(id);\n};\n\nvar requestAnimationFrame = typeof window !== \"undefined\" ? window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || rafPolyfill : global.requestAnimationFrame || rafPolyfill;\n\nvar cancelAnimationFrame = typeof window !== \"undefined\" ? window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || cafPolyfill : global.cancelAnimationFrame || cafPolyfill;\n\nvar warn = function warn(msg) {\n return console && typeof console.warn === \"function\" && console.warn(msg);\n};\n\nvar _helmetCallback = null;\n\nvar handleClientStateChange = function handleClientStateChange(newState) {\n if (_helmetCallback) {\n cancelAnimationFrame(_helmetCallback);\n }\n\n if (newState.defer) {\n _helmetCallback = requestAnimationFrame(function () {\n commitTagChanges(newState, function () {\n _helmetCallback = null;\n });\n });\n } else {\n commitTagChanges(newState);\n _helmetCallback = null;\n }\n};\n\nvar commitTagChanges = function commitTagChanges(newState, cb) {\n var baseTag = newState.baseTag,\n bodyAttributes = newState.bodyAttributes,\n htmlAttributes = newState.htmlAttributes,\n linkTags = newState.linkTags,\n metaTags = newState.metaTags,\n noscriptTags = newState.noscriptTags,\n onChangeClientState = newState.onChangeClientState,\n scriptTags = newState.scriptTags,\n styleTags = newState.styleTags,\n title = newState.title,\n titleAttributes = newState.titleAttributes;\n\n updateAttributes(_HelmetConstants.TAG_NAMES.BODY, bodyAttributes);\n updateAttributes(_HelmetConstants.TAG_NAMES.HTML, htmlAttributes);\n\n updateTitle(title, titleAttributes);\n\n var tagUpdates = {\n baseTag: updateTags(_HelmetConstants.TAG_NAMES.BASE, baseTag),\n linkTags: updateTags(_HelmetConstants.TAG_NAMES.LINK, linkTags),\n metaTags: updateTags(_HelmetConstants.TAG_NAMES.META, metaTags),\n noscriptTags: updateTags(_HelmetConstants.TAG_NAMES.NOSCRIPT, noscriptTags),\n scriptTags: updateTags(_HelmetConstants.TAG_NAMES.SCRIPT, scriptTags),\n styleTags: updateTags(_HelmetConstants.TAG_NAMES.STYLE, styleTags)\n };\n\n var addedTags = {};\n var removedTags = {};\n\n Object.keys(tagUpdates).forEach(function (tagType) {\n var _tagUpdates$tagType = tagUpdates[tagType],\n newTags = _tagUpdates$tagType.newTags,\n oldTags = _tagUpdates$tagType.oldTags;\n\n\n if (newTags.length) {\n addedTags[tagType] = newTags;\n }\n if (oldTags.length) {\n removedTags[tagType] = tagUpdates[tagType].oldTags;\n }\n });\n\n cb && cb();\n\n onChangeClientState(newState, addedTags, removedTags);\n};\n\nvar flattenArray = function flattenArray(possibleArray) {\n return Array.isArray(possibleArray) ? possibleArray.join(\"\") : possibleArray;\n};\n\nvar updateTitle = function updateTitle(title, attributes) {\n if (typeof title !== \"undefined\" && document.title !== title) {\n document.title = flattenArray(title);\n }\n\n updateAttributes(_HelmetConstants.TAG_NAMES.TITLE, attributes);\n};\n\nvar updateAttributes = function updateAttributes(tagName, attributes) {\n var elementTag = document.getElementsByTagName(tagName)[0];\n\n if (!elementTag) {\n return;\n }\n\n var helmetAttributeString = elementTag.getAttribute(_HelmetConstants.HELMET_ATTRIBUTE);\n var helmetAttributes = helmetAttributeString ? helmetAttributeString.split(\",\") : [];\n var attributesToRemove = [].concat(helmetAttributes);\n var attributeKeys = Object.keys(attributes);\n\n for (var i = 0; i < attributeKeys.length; i++) {\n var attribute = attributeKeys[i];\n var value = attributes[attribute] || \"\";\n\n if (elementTag.getAttribute(attribute) !== value) {\n elementTag.setAttribute(attribute, value);\n }\n\n if (helmetAttributes.indexOf(attribute) === -1) {\n helmetAttributes.push(attribute);\n }\n\n var indexToSave = attributesToRemove.indexOf(attribute);\n if (indexToSave !== -1) {\n attributesToRemove.splice(indexToSave, 1);\n }\n }\n\n for (var _i = attributesToRemove.length - 1; _i >= 0; _i--) {\n elementTag.removeAttribute(attributesToRemove[_i]);\n }\n\n if (helmetAttributes.length === attributesToRemove.length) {\n elementTag.removeAttribute(_HelmetConstants.HELMET_ATTRIBUTE);\n } else if (elementTag.getAttribute(_HelmetConstants.HELMET_ATTRIBUTE) !== attributeKeys.join(\",\")) {\n elementTag.setAttribute(_HelmetConstants.HELMET_ATTRIBUTE, attributeKeys.join(\",\"));\n }\n};\n\nvar updateTags = function updateTags(type, tags) {\n var headElement = document.head || document.querySelector(_HelmetConstants.TAG_NAMES.HEAD);\n var tagNodes = headElement.querySelectorAll(type + \"[\" + _HelmetConstants.HELMET_ATTRIBUTE + \"]\");\n var oldTags = Array.prototype.slice.call(tagNodes);\n var newTags = [];\n var indexToDelete = void 0;\n\n if (tags && tags.length) {\n tags.forEach(function (tag) {\n var newElement = document.createElement(type);\n\n for (var attribute in tag) {\n if (tag.hasOwnProperty(attribute)) {\n if (attribute === _HelmetConstants.TAG_PROPERTIES.INNER_HTML) {\n newElement.innerHTML = tag.innerHTML;\n } else if (attribute === _HelmetConstants.TAG_PROPERTIES.CSS_TEXT) {\n if (newElement.styleSheet) {\n newElement.styleSheet.cssText = tag.cssText;\n } else {\n newElement.appendChild(document.createTextNode(tag.cssText));\n }\n } else {\n var value = typeof tag[attribute] === \"undefined\" ? \"\" : tag[attribute];\n newElement.setAttribute(attribute, value);\n }\n }\n }\n\n newElement.setAttribute(_HelmetConstants.HELMET_ATTRIBUTE, \"true\");\n\n // Remove a duplicate tag from domTagstoRemove, so it isn't cleared.\n if (oldTags.some(function (existingTag, index) {\n indexToDelete = index;\n return newElement.isEqualNode(existingTag);\n })) {\n oldTags.splice(indexToDelete, 1);\n } else {\n newTags.push(newElement);\n }\n });\n }\n\n oldTags.forEach(function (tag) {\n return tag.parentNode.removeChild(tag);\n });\n newTags.forEach(function (tag) {\n return headElement.appendChild(tag);\n });\n\n return {\n oldTags: oldTags,\n newTags: newTags\n };\n};\n\nvar generateElementAttributesAsString = function generateElementAttributesAsString(attributes) {\n return Object.keys(attributes).reduce(function (str, key) {\n var attr = typeof attributes[key] !== \"undefined\" ? key + \"=\\\"\" + attributes[key] + \"\\\"\" : \"\" + key;\n return str ? str + \" \" + attr : attr;\n }, \"\");\n};\n\nvar generateTitleAsString = function generateTitleAsString(type, title, attributes, encode) {\n var attributeString = generateElementAttributesAsString(attributes);\n var flattenedTitle = flattenArray(title);\n return attributeString ? \"<\" + type + \" \" + _HelmetConstants.HELMET_ATTRIBUTE + \"=\\\"true\\\" \" + attributeString + \">\" + encodeSpecialCharacters(flattenedTitle, encode) + \"\" : \"<\" + type + \" \" + _HelmetConstants.HELMET_ATTRIBUTE + \"=\\\"true\\\">\" + encodeSpecialCharacters(flattenedTitle, encode) + \"\";\n};\n\nvar generateTagsAsString = function generateTagsAsString(type, tags, encode) {\n return tags.reduce(function (str, tag) {\n var attributeHtml = Object.keys(tag).filter(function (attribute) {\n return !(attribute === _HelmetConstants.TAG_PROPERTIES.INNER_HTML || attribute === _HelmetConstants.TAG_PROPERTIES.CSS_TEXT);\n }).reduce(function (string, attribute) {\n var attr = typeof tag[attribute] === \"undefined\" ? attribute : attribute + \"=\\\"\" + encodeSpecialCharacters(tag[attribute], encode) + \"\\\"\";\n return string ? string + \" \" + attr : attr;\n }, \"\");\n\n var tagContent = tag.innerHTML || tag.cssText || \"\";\n\n var isSelfClosing = _HelmetConstants.SELF_CLOSING_TAGS.indexOf(type) === -1;\n\n return str + \"<\" + type + \" \" + _HelmetConstants.HELMET_ATTRIBUTE + \"=\\\"true\\\" \" + attributeHtml + (isSelfClosing ? \"/>\" : \">\" + tagContent + \"\");\n }, \"\");\n};\n\nvar convertElementAttributestoReactProps = function convertElementAttributestoReactProps(attributes) {\n var initProps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n return Object.keys(attributes).reduce(function (obj, key) {\n obj[_HelmetConstants.REACT_TAG_MAP[key] || key] = attributes[key];\n return obj;\n }, initProps);\n};\n\nvar convertReactPropstoHtmlAttributes = function convertReactPropstoHtmlAttributes(props) {\n var initAttributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n return Object.keys(props).reduce(function (obj, key) {\n obj[_HelmetConstants.HTML_TAG_MAP[key] || key] = props[key];\n return obj;\n }, initAttributes);\n};\n\nvar generateTitleAsReactComponent = function generateTitleAsReactComponent(type, title, attributes) {\n var _initProps;\n\n // assigning into an array to define toString function on it\n var initProps = (_initProps = {\n key: title\n }, _initProps[_HelmetConstants.HELMET_ATTRIBUTE] = true, _initProps);\n var props = convertElementAttributestoReactProps(attributes, initProps);\n\n return [_react2.default.createElement(_HelmetConstants.TAG_NAMES.TITLE, props, title)];\n};\n\nvar generateTagsAsReactComponent = function generateTagsAsReactComponent(type, tags) {\n return tags.map(function (tag, i) {\n var _mappedTag;\n\n var mappedTag = (_mappedTag = {\n key: i\n }, _mappedTag[_HelmetConstants.HELMET_ATTRIBUTE] = true, _mappedTag);\n\n Object.keys(tag).forEach(function (attribute) {\n var mappedAttribute = _HelmetConstants.REACT_TAG_MAP[attribute] || attribute;\n\n if (mappedAttribute === _HelmetConstants.TAG_PROPERTIES.INNER_HTML || mappedAttribute === _HelmetConstants.TAG_PROPERTIES.CSS_TEXT) {\n var content = tag.innerHTML || tag.cssText;\n mappedTag.dangerouslySetInnerHTML = { __html: content };\n } else {\n mappedTag[mappedAttribute] = tag[attribute];\n }\n });\n\n return _react2.default.createElement(type, mappedTag);\n });\n};\n\nvar getMethodsForTag = function getMethodsForTag(type, tags, encode) {\n switch (type) {\n case _HelmetConstants.TAG_NAMES.TITLE:\n return {\n toComponent: function toComponent() {\n return generateTitleAsReactComponent(type, tags.title, tags.titleAttributes, encode);\n },\n toString: function toString() {\n return generateTitleAsString(type, tags.title, tags.titleAttributes, encode);\n }\n };\n case _HelmetConstants.ATTRIBUTE_NAMES.BODY:\n case _HelmetConstants.ATTRIBUTE_NAMES.HTML:\n return {\n toComponent: function toComponent() {\n return convertElementAttributestoReactProps(tags);\n },\n toString: function toString() {\n return generateElementAttributesAsString(tags);\n }\n };\n default:\n return {\n toComponent: function toComponent() {\n return generateTagsAsReactComponent(type, tags);\n },\n toString: function toString() {\n return generateTagsAsString(type, tags, encode);\n }\n };\n }\n};\n\nvar mapStateOnServer = function mapStateOnServer(_ref) {\n var baseTag = _ref.baseTag,\n bodyAttributes = _ref.bodyAttributes,\n encode = _ref.encode,\n htmlAttributes = _ref.htmlAttributes,\n linkTags = _ref.linkTags,\n metaTags = _ref.metaTags,\n noscriptTags = _ref.noscriptTags,\n scriptTags = _ref.scriptTags,\n styleTags = _ref.styleTags,\n _ref$title = _ref.title,\n title = _ref$title === undefined ? \"\" : _ref$title,\n titleAttributes = _ref.titleAttributes;\n return {\n base: getMethodsForTag(_HelmetConstants.TAG_NAMES.BASE, baseTag, encode),\n bodyAttributes: getMethodsForTag(_HelmetConstants.ATTRIBUTE_NAMES.BODY, bodyAttributes, encode),\n htmlAttributes: getMethodsForTag(_HelmetConstants.ATTRIBUTE_NAMES.HTML, htmlAttributes, encode),\n link: getMethodsForTag(_HelmetConstants.TAG_NAMES.LINK, linkTags, encode),\n meta: getMethodsForTag(_HelmetConstants.TAG_NAMES.META, metaTags, encode),\n noscript: getMethodsForTag(_HelmetConstants.TAG_NAMES.NOSCRIPT, noscriptTags, encode),\n script: getMethodsForTag(_HelmetConstants.TAG_NAMES.SCRIPT, scriptTags, encode),\n style: getMethodsForTag(_HelmetConstants.TAG_NAMES.STYLE, styleTags, encode),\n title: getMethodsForTag(_HelmetConstants.TAG_NAMES.TITLE, { title: title, titleAttributes: titleAttributes }, encode)\n };\n};\n\nexports.convertReactPropstoHtmlAttributes = convertReactPropstoHtmlAttributes;\nexports.handleClientStateChange = handleClientStateChange;\nexports.mapStateOnServer = mapStateOnServer;\nexports.reducePropsToState = reducePropsToState;\nexports.requestAnimationFrame = requestAnimationFrame;\nexports.warn = warn;","module.exports = { \"default\": require(\"core-js/library/fn/object/assign\"), __esModule: true };","require('../../modules/es6.object.assign');\nmodule.exports = require('../../modules/_core').Object.assign;\n","// 19.1.3.1 Object.assign(target, source)\nvar $export = require('./_export');\n\n$export($export.S + $export.F, 'Object', { assign: require('./_object-assign') });\n","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n","'use strict';\n// 19.1.2.1 Object.assign(target, source, ...)\nvar DESCRIPTORS = require('./_descriptors');\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nvar toObject = require('./_to-object');\nvar IObject = require('./_iobject');\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || require('./_fails')(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var S = Symbol();\n var K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function (k) { B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var aLen = arguments.length;\n var index = 1;\n var getSymbols = gOPS.f;\n var isEnum = pIE.f;\n while (aLen > index) {\n var S = IObject(arguments[index++]);\n var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) {\n key = keys[j++];\n if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];\n }\n } return T;\n} : $assign;\n","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject');\nvar toLength = require('./_to-length');\nvar toAbsoluteIndex = require('./_to-absolute-index');\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n","var toInteger = require('./_to-integer');\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar theme = {\n BASE_FONT_FAMILY: 'Menlo, monospace',\n BASE_FONT_SIZE: '11px',\n BASE_LINE_HEIGHT: '14px',\n\n BASE_BACKGROUND_COLOR: 'rgb(36, 36, 36)',\n BASE_COLOR: 'rgb(213, 213, 213)',\n\n OBJECT_NAME_COLOR: 'rgb(227, 110, 236)',\n OBJECT_VALUE_NULL_COLOR: 'rgb(127, 127, 127)',\n OBJECT_VALUE_UNDEFINED_COLOR: 'rgb(127, 127, 127)',\n OBJECT_VALUE_REGEXP_COLOR: 'rgb(233, 63, 59)',\n OBJECT_VALUE_STRING_COLOR: 'rgb(233, 63, 59)',\n OBJECT_VALUE_SYMBOL_COLOR: 'rgb(233, 63, 59)',\n OBJECT_VALUE_NUMBER_COLOR: 'hsl(252, 100%, 75%)',\n OBJECT_VALUE_BOOLEAN_COLOR: 'hsl(252, 100%, 75%)',\n OBJECT_VALUE_FUNCTION_KEYWORD_COLOR: 'rgb(242, 85, 217)',\n\n HTML_TAG_COLOR: 'rgb(93, 176, 215)',\n HTML_TAGNAME_COLOR: 'rgb(93, 176, 215)',\n HTML_TAGNAME_TEXT_TRANSFORM: 'lowercase',\n HTML_ATTRIBUTE_NAME_COLOR: 'rgb(155, 187, 220)',\n HTML_ATTRIBUTE_VALUE_COLOR: 'rgb(242, 151, 102)',\n HTML_COMMENT_COLOR: 'rgb(137, 137, 137)',\n HTML_DOCTYPE_COLOR: 'rgb(192, 192, 192)',\n\n ARROW_COLOR: 'rgb(145, 145, 145)',\n ARROW_MARGIN_RIGHT: 3,\n ARROW_FONT_SIZE: 12,\n\n TREENODE_FONT_FAMILY: 'Menlo, monospace',\n TREENODE_FONT_SIZE: '11px',\n TREENODE_LINE_HEIGHT: '14px',\n TREENODE_PADDING_LEFT: 12,\n\n TABLE_BORDER_COLOR: 'rgb(85, 85, 85)',\n TABLE_TH_BACKGROUND_COLOR: 'rgb(44, 44, 44)',\n TABLE_TH_HOVER_COLOR: 'rgb(48, 48, 48)',\n TABLE_SORT_ICON_COLOR: 'black', //'rgb(48, 57, 66)',\n TABLE_DATA_BACKGROUND_IMAGE: 'linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0) 50%, rgba(51, 139, 255, 0.0980392) 50%, rgba(51, 139, 255, 0.0980392))',\n TABLE_DATA_BACKGROUND_SIZE: '128px 32px'\n};\n\nexports.default = theme;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar theme = {\n BASE_FONT_FAMILY: 'Menlo, monospace',\n BASE_FONT_SIZE: '11px',\n BASE_LINE_HEIGHT: '14px',\n\n BASE_BACKGROUND_COLOR: 'white',\n BASE_COLOR: 'black',\n\n OBJECT_NAME_COLOR: 'rgb(136, 19, 145)',\n OBJECT_VALUE_NULL_COLOR: 'rgb(128, 128, 128)',\n OBJECT_VALUE_UNDEFINED_COLOR: 'rgb(128, 128, 128)',\n OBJECT_VALUE_REGEXP_COLOR: 'rgb(196, 26, 22)',\n OBJECT_VALUE_STRING_COLOR: 'rgb(196, 26, 22)',\n OBJECT_VALUE_SYMBOL_COLOR: 'rgb(196, 26, 22)',\n OBJECT_VALUE_NUMBER_COLOR: 'rgb(28, 0, 207)',\n OBJECT_VALUE_BOOLEAN_COLOR: 'rgb(28, 0, 207)',\n OBJECT_VALUE_FUNCTION_KEYWORD_COLOR: 'rgb(170, 13, 145)',\n\n HTML_TAG_COLOR: 'rgb(168, 148, 166)',\n HTML_TAGNAME_COLOR: 'rgb(136, 18, 128)',\n HTML_TAGNAME_TEXT_TRANSFORM: 'lowercase',\n HTML_ATTRIBUTE_NAME_COLOR: 'rgb(153, 69, 0)',\n HTML_ATTRIBUTE_VALUE_COLOR: 'rgb(26, 26, 166)',\n HTML_COMMENT_COLOR: 'rgb(35, 110, 37)',\n HTML_DOCTYPE_COLOR: 'rgb(192, 192, 192)',\n\n ARROW_COLOR: '#6e6e6e',\n ARROW_MARGIN_RIGHT: 3,\n ARROW_FONT_SIZE: 12,\n\n TREENODE_FONT_FAMILY: 'Menlo, monospace',\n TREENODE_FONT_SIZE: '11px',\n TREENODE_LINE_HEIGHT: '14px',\n TREENODE_PADDING_LEFT: 12,\n\n TABLE_BORDER_COLOR: '#aaa',\n TABLE_TH_BACKGROUND_COLOR: '#eee',\n TABLE_TH_HOVER_COLOR: 'hsla(0, 0%, 90%, 1)',\n TABLE_SORT_ICON_COLOR: '#6e6e6e',\n TABLE_DATA_BACKGROUND_IMAGE: 'linear-gradient(to bottom, white, white 50%, rgb(234, 243, 255) 50%, rgb(234, 243, 255))',\n TABLE_DATA_BACKGROUND_SIZE: '128px 32px'\n};\n\nexports.default = theme;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends2 = require('babel-runtime/helpers/extends');\n\nvar _extends3 = _interopRequireDefault(_extends2);\n\nvar _objectWithoutProperties2 = require('babel-runtime/helpers/objectWithoutProperties');\n\nvar _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);\n\nvar _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = require('babel-runtime/helpers/createClass');\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = require('babel-runtime/helpers/inherits');\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _regenerator = require('babel-runtime/regenerator');\n\nvar _regenerator2 = _interopRequireDefault(_regenerator);\n\nvar _slicedToArray2 = require('babel-runtime/helpers/slicedToArray');\n\nvar _slicedToArray3 = _interopRequireDefault(_slicedToArray2);\n\nvar _typeof2 = require('babel-runtime/helpers/typeof');\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _TreeView = require('../tree-view/TreeView');\n\nvar _TreeView2 = _interopRequireDefault(_TreeView);\n\nvar _ObjectRootLabel = require('./ObjectRootLabel');\n\nvar _ObjectRootLabel2 = _interopRequireDefault(_ObjectRootLabel);\n\nvar _ObjectLabel = require('./ObjectLabel');\n\nvar _ObjectLabel2 = _interopRequireDefault(_ObjectLabel);\n\nvar _ThemeProvider = require('../styles/ThemeProvider');\n\nvar _ThemeProvider2 = _interopRequireDefault(_ThemeProvider);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar moreKeysHere = function moreKeysHere(val, pos) {\n var remain = val.length ? val.length - pos : null;\n return {\n name: remain ? '(...' + remain + ' more)' : '...(and more)',\n isMeta: true\n };\n};\n\nvar createIterator = function createIterator(showNonenumerable, sortObjectKeys, showMaxKeys) {\n var objectIterator = /*#__PURE__*/_regenerator2.default.mark(function objectIterator(data) {\n var shouldIterate, i, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, entry, _entry, k, v, keys, _i, _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, propertyName, propertyValue, _propertyValue;\n\n return _regenerator2.default.wrap(function objectIterator$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n shouldIterate = (typeof data === 'undefined' ? 'undefined' : (0, _typeof3.default)(data)) === 'object' && data !== null || typeof data === 'function';\n\n if (shouldIterate) {\n _context.next = 3;\n break;\n }\n\n return _context.abrupt('return');\n\n case 3:\n if (!(!Array.isArray(data) && data[Symbol.iterator])) {\n _context.next = 44;\n break;\n }\n\n i = 0;\n _iteratorNormalCompletion = true;\n _didIteratorError = false;\n _iteratorError = undefined;\n _context.prev = 8;\n _iterator = data[Symbol.iterator]();\n\n case 10:\n if (_iteratorNormalCompletion = (_step = _iterator.next()).done) {\n _context.next = 28;\n break;\n }\n\n entry = _step.value;\n\n if (!(i === showMaxKeys)) {\n _context.next = 16;\n break;\n }\n\n _context.next = 15;\n return moreKeysHere(data, i);\n\n case 15:\n return _context.abrupt('break', 28);\n\n case 16:\n if (!(Array.isArray(entry) && entry.length === 2)) {\n _context.next = 22;\n break;\n }\n\n _entry = (0, _slicedToArray3.default)(entry, 2), k = _entry[0], v = _entry[1];\n _context.next = 20;\n return {\n name: k,\n data: v\n };\n\n case 20:\n _context.next = 24;\n break;\n\n case 22:\n _context.next = 24;\n return {\n name: i.toString(),\n data: entry\n };\n\n case 24:\n i++;\n\n case 25:\n _iteratorNormalCompletion = true;\n _context.next = 10;\n break;\n\n case 28:\n _context.next = 34;\n break;\n\n case 30:\n _context.prev = 30;\n _context.t0 = _context['catch'](8);\n _didIteratorError = true;\n _iteratorError = _context.t0;\n\n case 34:\n _context.prev = 34;\n _context.prev = 35;\n\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n\n case 37:\n _context.prev = 37;\n\n if (!_didIteratorError) {\n _context.next = 40;\n break;\n }\n\n throw _iteratorError;\n\n case 40:\n return _context.finish(37);\n\n case 41:\n return _context.finish(34);\n\n case 42:\n _context.next = 91;\n break;\n\n case 44:\n keys = Object.getOwnPropertyNames(data);\n\n if (sortObjectKeys === true) {\n keys.sort();\n } else if (typeof sortObjectKeys === 'function') {\n keys.sort(sortObjectKeys);\n }\n _i = 0;\n _iteratorNormalCompletion2 = true;\n _didIteratorError2 = false;\n _iteratorError2 = undefined;\n _context.prev = 50;\n _iterator2 = keys[Symbol.iterator]();\n\n case 52:\n if (_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done) {\n _context.next = 74;\n break;\n }\n\n propertyName = _step2.value;\n\n if (!(_i === showMaxKeys)) {\n _context.next = 58;\n break;\n }\n\n _context.next = 57;\n return moreKeysHere(data, _i);\n\n case 57:\n return _context.abrupt('break', 74);\n\n case 58:\n if (!data.propertyIsEnumerable(propertyName)) {\n _context.next = 64;\n break;\n }\n\n propertyValue = data[propertyName];\n _context.next = 62;\n return {\n name: propertyName || '\"\"',\n data: propertyValue\n };\n\n case 62:\n _context.next = 70;\n break;\n\n case 64:\n if (!showNonenumerable) {\n _context.next = 70;\n break;\n }\n\n // To work around the error (happens some time when propertyName === 'caller' || propertyName === 'arguments')\n // 'caller' and 'arguments' are restricted function properties and cannot be accessed in this context\n // http://stackoverflow.com/questions/31921189/caller-and-arguments-are-restricted-function-properties-and-cannot-be-access\n _propertyValue = void 0;\n\n try {\n _propertyValue = data[propertyName];\n } catch (e) {\n // console.warn(e)\n }\n\n if (!(_propertyValue !== undefined)) {\n _context.next = 70;\n break;\n }\n\n _context.next = 70;\n return {\n name: propertyName,\n data: _propertyValue,\n isNonenumerable: true\n };\n\n case 70:\n _i++;\n\n case 71:\n _iteratorNormalCompletion2 = true;\n _context.next = 52;\n break;\n\n case 74:\n _context.next = 80;\n break;\n\n case 76:\n _context.prev = 76;\n _context.t1 = _context['catch'](50);\n _didIteratorError2 = true;\n _iteratorError2 = _context.t1;\n\n case 80:\n _context.prev = 80;\n _context.prev = 81;\n\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n\n case 83:\n _context.prev = 83;\n\n if (!_didIteratorError2) {\n _context.next = 86;\n break;\n }\n\n throw _iteratorError2;\n\n case 86:\n return _context.finish(83);\n\n case 87:\n return _context.finish(80);\n\n case 88:\n if (!(showNonenumerable && data !== Object.prototype /* already added */)) {\n _context.next = 91;\n break;\n }\n\n _context.next = 91;\n return {\n name: '__proto__',\n data: Object.getPrototypeOf(data),\n isNonenumerable: true\n };\n\n case 91:\n case 'end':\n return _context.stop();\n }\n }\n }, objectIterator, this, [[8, 30, 34, 42], [35,, 37, 41], [50, 76, 80, 88], [81,, 83, 87]]);\n });\n\n return objectIterator;\n};\n\nvar defaultNodeRenderer = function defaultNodeRenderer(_ref) {\n var depth = _ref.depth,\n name = _ref.name,\n data = _ref.data,\n isNonenumerable = _ref.isNonenumerable,\n isMeta = _ref.isMeta;\n return depth === 0 ? _react2.default.createElement(_ObjectRootLabel2.default, { name: name, data: data }) : _react2.default.createElement(_ObjectLabel2.default, { name: name, data: data, isNonenumerable: isNonenumerable, isMeta: isMeta });\n};\n\n/**\n * Tree-view for objects\n */\n\nvar ObjectInspector = function (_Component) {\n (0, _inherits3.default)(ObjectInspector, _Component);\n\n function ObjectInspector() {\n (0, _classCallCheck3.default)(this, ObjectInspector);\n return (0, _possibleConstructorReturn3.default)(this, (ObjectInspector.__proto__ || Object.getPrototypeOf(ObjectInspector)).apply(this, arguments));\n }\n\n (0, _createClass3.default)(ObjectInspector, [{\n key: 'render',\n value: function render() {\n var _props = this.props,\n showNonenumerable = _props.showNonenumerable,\n sortObjectKeys = _props.sortObjectKeys,\n showMaxKeys = _props.showMaxKeys,\n nodeRenderer = _props.nodeRenderer,\n rest = (0, _objectWithoutProperties3.default)(_props, ['showNonenumerable', 'sortObjectKeys', 'showMaxKeys', 'nodeRenderer']);\n\n var dataIterator = createIterator(showNonenumerable, sortObjectKeys, showMaxKeys);\n\n var renderer = nodeRenderer ? nodeRenderer : defaultNodeRenderer;\n\n return _react2.default.createElement(\n _ThemeProvider2.default,\n { theme: this.props.theme },\n _react2.default.createElement(_TreeView2.default, (0, _extends3.default)({ nodeRenderer: renderer, dataIterator: dataIterator }, rest))\n );\n }\n }]);\n return ObjectInspector;\n}(_react.Component);\n\nObjectInspector.defaultProps = {\n showNonenumerable: false,\n\n showMaxKeys: Infinity,\n\n theme: 'chromeLight'\n};\nObjectInspector.propTypes = {\n /** An integer specifying to which level the tree should be initially expanded. */\n expandLevel: _propTypes2.default.number,\n /** An array containing all the paths that should be expanded when the component is initialized, or a string of just one path */\n expandPaths: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.array]),\n\n name: _propTypes2.default.string,\n /** Not required prop because we also allow undefined value */\n data: _propTypes2.default.any,\n\n /** A known theme or theme object */\n theme: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),\n\n /** Show non-enumerable properties */\n showNonenumerable: _propTypes2.default.bool,\n /** Sort object keys with optional compare function. */\n sortObjectKeys: _propTypes2.default.oneOfType([_propTypes2.default.bool, _propTypes2.default.func]),\n /** Truncate long arrays and iterables */\n showMaxKeys: _propTypes2.default.number,\n\n /** Provide a custom nodeRenderer */\n nodeRenderer: _propTypes2.default.func\n};\nexports.default = ObjectInspector;","require('../../modules/es6.object.define-property');\nvar $Object = require('../../modules/_core').Object;\nmodule.exports = function defineProperty(it, key, desc) {\n return $Object.defineProperty(it, key, desc);\n};\n","var $export = require('./_export');\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !require('./_descriptors'), 'Object', { defineProperty: require('./_object-dp').f });\n","module.exports = { \"default\": require(\"core-js/library/fn/symbol/iterator\"), __esModule: true };","require('../../modules/es6.string.iterator');\nrequire('../../modules/web.dom.iterable');\nmodule.exports = require('../../modules/_wks-ext').f('iterator');\n","var toInteger = require('./_to-integer');\nvar defined = require('./_defined');\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n","'use strict';\nvar create = require('./_object-create');\nvar descriptor = require('./_property-desc');\nvar setToStringTag = require('./_set-to-string-tag');\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\nrequire('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n","var dP = require('./_object-dp');\nvar anObject = require('./_an-object');\nvar getKeys = require('./_object-keys');\n\nmodule.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n","var document = require('./_global').document;\nmodule.exports = document && document.documentElement;\n","// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = require('./_has');\nvar toObject = require('./_to-object');\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n","'use strict';\nvar addToUnscopables = require('./_add-to-unscopables');\nvar step = require('./_iter-step');\nvar Iterators = require('./_iterators');\nvar toIObject = require('./_to-iobject');\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = require('./_iter-define')(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n","module.exports = function () { /* empty */ };\n","module.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n","module.exports = { \"default\": require(\"core-js/library/fn/symbol\"), __esModule: true };","require('../../modules/es6.symbol');\nrequire('../../modules/es6.object.to-string');\nrequire('../../modules/es7.symbol.async-iterator');\nrequire('../../modules/es7.symbol.observable');\nmodule.exports = require('../../modules/_core').Symbol;\n","'use strict';\n// ECMAScript 6 symbols shim\nvar global = require('./_global');\nvar has = require('./_has');\nvar DESCRIPTORS = require('./_descriptors');\nvar $export = require('./_export');\nvar redefine = require('./_redefine');\nvar META = require('./_meta').KEY;\nvar $fails = require('./_fails');\nvar shared = require('./_shared');\nvar setToStringTag = require('./_set-to-string-tag');\nvar uid = require('./_uid');\nvar wks = require('./_wks');\nvar wksExt = require('./_wks-ext');\nvar wksDefine = require('./_wks-define');\nvar enumKeys = require('./_enum-keys');\nvar isArray = require('./_is-array');\nvar anObject = require('./_an-object');\nvar isObject = require('./_is-object');\nvar toObject = require('./_to-object');\nvar toIObject = require('./_to-iobject');\nvar toPrimitive = require('./_to-primitive');\nvar createDesc = require('./_property-desc');\nvar _create = require('./_object-create');\nvar gOPNExt = require('./_object-gopn-ext');\nvar $GOPD = require('./_object-gopd');\nvar $GOPS = require('./_object-gops');\nvar $DP = require('./_object-dp');\nvar $keys = require('./_object-keys');\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f;\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n require('./_object-gopn').f = gOPNExt.f = $getOwnPropertyNames;\n require('./_object-pie').f = $propertyIsEnumerable;\n $GOPS.f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !require('./_library')) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives\n// https://bugs.chromium.org/p/v8/issues/detail?id=3443\nvar FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); });\n\n$export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', {\n getOwnPropertySymbols: function getOwnPropertySymbols(it) {\n return $GOPS.f(toObject(it));\n }\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n $replacer = replacer = args[1];\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || require('./_hide')($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n","var META = require('./_uid')('meta');\nvar isObject = require('./_is-object');\nvar has = require('./_has');\nvar setDesc = require('./_object-dp').f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !require('./_fails')(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n","// all enumerable object keys, includes symbols\nvar getKeys = require('./_object-keys');\nvar gOPS = require('./_object-gops');\nvar pIE = require('./_object-pie');\nmodule.exports = function (it) {\n var result = getKeys(it);\n var getSymbols = gOPS.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = pIE.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return result;\n};\n","// 7.2.2 IsArray(argument)\nvar cof = require('./_cof');\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n","// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = require('./_to-iobject');\nvar gOPN = require('./_object-gopn').f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n","require('./_wks-define')('asyncIterator');\n","require('./_wks-define')('observable');\n","module.exports = { \"default\": require(\"core-js/library/fn/object/set-prototype-of\"), __esModule: true };","require('../../modules/es6.object.set-prototype-of');\nmodule.exports = require('../../modules/_core').Object.setPrototypeOf;\n","// 19.1.3.19 Object.setPrototypeOf(O, proto)\nvar $export = require('./_export');\n$export($export.S, 'Object', { setPrototypeOf: require('./_set-proto').set });\n","// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = require('./_is-object');\nvar anObject = require('./_an-object');\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = require('./_ctx')(Function.call, require('./_object-gopd').f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n","module.exports = { \"default\": require(\"core-js/library/fn/object/create\"), __esModule: true };","require('../../modules/es6.object.create');\nvar $Object = require('../../modules/_core').Object;\nmodule.exports = function create(P, D) {\n return $Object.create(P, D);\n};\n","var $export = require('./_export');\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\n$export($export.S, 'Object', { create: require('./_object-create') });\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n// This method of obtaining a reference to the global object needs to be\n// kept identical to the way it is obtained in runtime.js\nvar g = (function() { return this })() || Function(\"return this\")();\n\n// Use `getOwnPropertyNames` because not all browsers support calling\n// `hasOwnProperty` on the global `self` object in a worker. See #183.\nvar hadRuntime = g.regeneratorRuntime &&\n Object.getOwnPropertyNames(g).indexOf(\"regeneratorRuntime\") >= 0;\n\n// Save the old regeneratorRuntime in case it needs to be restored later.\nvar oldRuntime = hadRuntime && g.regeneratorRuntime;\n\n// Force reevalutation of runtime.js.\ng.regeneratorRuntime = undefined;\n\nmodule.exports = require(\"./runtime\");\n\nif (hadRuntime) {\n // Restore the original runtime.\n g.regeneratorRuntime = oldRuntime;\n} else {\n // Remove the global property added by runtime.js.\n try {\n delete g.regeneratorRuntime;\n } catch(e) {\n g.regeneratorRuntime = undefined;\n }\n}\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n!(function(global) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n var inModule = typeof module === \"object\";\n var runtime = global.regeneratorRuntime;\n if (runtime) {\n if (inModule) {\n // If regeneratorRuntime is defined globally and we're in a module,\n // make the exports object identical to regeneratorRuntime.\n module.exports = runtime;\n }\n // Don't bother evaluating the rest of this file if the runtime was\n // already defined globally.\n return;\n }\n\n // Define the runtime globally (as expected by generated code) as either\n // module.exports (if we're in a module) or a new, empty object.\n runtime = global.regeneratorRuntime = inModule ? module.exports : {};\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n runtime.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionProtot