@fireproof/database
Version:
Live database for the web
1 lines • 2.87 MB
Source Map (JSON)
{"version":3,"file":"fireproof.cjs","sources":["../../tsc/write-queue.js","../../../../../node_modules/.pnpm/multiformats@11.0.2/node_modules/multiformats/vendor/varint.js","../../../../../node_modules/.pnpm/multiformats@11.0.2/node_modules/multiformats/src/varint.js","../../../../../node_modules/.pnpm/multiformats@11.0.2/node_modules/multiformats/src/bytes.js","../../../../../node_modules/.pnpm/multiformats@11.0.2/node_modules/multiformats/src/hashes/digest.js","../../../../../node_modules/.pnpm/multiformats@11.0.2/node_modules/multiformats/vendor/base-x.js","../../../../../node_modules/.pnpm/multiformats@11.0.2/node_modules/multiformats/src/bases/base.js","../../../../../node_modules/.pnpm/multiformats@11.0.2/node_modules/multiformats/src/bases/base58.js","../../../../../node_modules/.pnpm/multiformats@11.0.2/node_modules/multiformats/src/bases/base32.js","../../../../../node_modules/.pnpm/multiformats@11.0.2/node_modules/multiformats/src/cid.js","../../../../../node_modules/.pnpm/multiformats@11.0.2/node_modules/multiformats/src/link.js","../../../../../node_modules/.pnpm/@alanshaw+pail@0.3.3/node_modules/@alanshaw/pail/src/block.js","../../../../../node_modules/.pnpm/cborg@2.0.4/node_modules/cborg/esm/lib/is.js","../../../../../node_modules/.pnpm/cborg@2.0.4/node_modules/cborg/esm/lib/token.js","../../../../../node_modules/.pnpm/cborg@2.0.4/node_modules/cborg/esm/lib/byte-utils.js","../../../../../node_modules/.pnpm/cborg@2.0.4/node_modules/cborg/esm/lib/bl.js","../../../../../node_modules/.pnpm/cborg@2.0.4/node_modules/cborg/esm/lib/common.js","../../../../../node_modules/.pnpm/cborg@2.0.4/node_modules/cborg/esm/lib/0uint.js","../../../../../node_modules/.pnpm/cborg@2.0.4/node_modules/cborg/esm/lib/1negint.js","../../../../../node_modules/.pnpm/cborg@2.0.4/node_modules/cborg/esm/lib/2bytes.js","../../../../../node_modules/.pnpm/cborg@2.0.4/node_modules/cborg/esm/lib/3string.js","../../../../../node_modules/.pnpm/cborg@2.0.4/node_modules/cborg/esm/lib/4array.js","../../../../../node_modules/.pnpm/cborg@2.0.4/node_modules/cborg/esm/lib/5map.js","../../../../../node_modules/.pnpm/cborg@2.0.4/node_modules/cborg/esm/lib/6tag.js","../../../../../node_modules/.pnpm/cborg@2.0.4/node_modules/cborg/esm/lib/7float.js","../../../../../node_modules/.pnpm/cborg@2.0.4/node_modules/cborg/esm/lib/jump.js","../../../../../node_modules/.pnpm/cborg@2.0.4/node_modules/cborg/esm/lib/encode.js","../../../../../node_modules/.pnpm/cborg@2.0.4/node_modules/cborg/esm/lib/decode.js","../../../../../node_modules/.pnpm/multiformats@12.0.1/node_modules/multiformats/vendor/varint.js","../../../../../node_modules/.pnpm/multiformats@12.0.1/node_modules/multiformats/src/varint.js","../../../../../node_modules/.pnpm/multiformats@12.0.1/node_modules/multiformats/src/bytes.js","../../../../../node_modules/.pnpm/multiformats@12.0.1/node_modules/multiformats/src/hashes/digest.js","../../../../../node_modules/.pnpm/multiformats@12.0.1/node_modules/multiformats/vendor/base-x.js","../../../../../node_modules/.pnpm/multiformats@12.0.1/node_modules/multiformats/src/bases/base.js","../../../../../node_modules/.pnpm/multiformats@12.0.1/node_modules/multiformats/src/bases/base58.js","../../../../../node_modules/.pnpm/multiformats@12.0.1/node_modules/multiformats/src/bases/base32.js","../../../../../node_modules/.pnpm/multiformats@12.0.1/node_modules/multiformats/src/cid.js","../../../../../node_modules/.pnpm/@ipld+dag-cbor@9.0.4/node_modules/@ipld/dag-cbor/src/index.js","../../../../../node_modules/.pnpm/@ipld+car@5.2.0/node_modules/@ipld/car/src/header-validator.js","../../../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/encode.js","../../../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/decode.js","../../../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/length.js","../../../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/index.js","../../../../../node_modules/.pnpm/@ipld+car@5.2.0/node_modules/@ipld/car/src/decoder-common.js","../../../../../node_modules/.pnpm/@ipld+car@5.2.0/node_modules/@ipld/car/src/decoder.js","../../../../../node_modules/.pnpm/@ipld+car@5.2.0/node_modules/@ipld/car/src/reader-browser.js","../../../../../node_modules/.pnpm/cborg@1.10.0/node_modules/cborg/esm/lib/is.js","../../../../../node_modules/.pnpm/cborg@1.10.0/node_modules/cborg/esm/lib/token.js","../../../../../node_modules/.pnpm/cborg@1.10.0/node_modules/cborg/esm/lib/byte-utils.js","../../../../../node_modules/.pnpm/cborg@1.10.0/node_modules/cborg/esm/lib/common.js","../../../../../node_modules/.pnpm/cborg@1.10.0/node_modules/cborg/esm/lib/0uint.js","../../../../../node_modules/.pnpm/cborg@1.10.0/node_modules/cborg/esm/lib/1negint.js","../../../../../node_modules/.pnpm/cborg@1.10.0/node_modules/cborg/esm/lib/2bytes.js","../../../../../node_modules/.pnpm/cborg@1.10.0/node_modules/cborg/esm/lib/3string.js","../../../../../node_modules/.pnpm/cborg@1.10.0/node_modules/cborg/esm/lib/4array.js","../../../../../node_modules/.pnpm/cborg@1.10.0/node_modules/cborg/esm/lib/5map.js","../../../../../node_modules/.pnpm/cborg@1.10.0/node_modules/cborg/esm/lib/6tag.js","../../../../../node_modules/.pnpm/cborg@1.10.0/node_modules/cborg/esm/lib/7float.js","../../../../../node_modules/.pnpm/cborg@1.10.0/node_modules/cborg/esm/lib/jump.js","../../../../../node_modules/.pnpm/cborg@1.10.0/node_modules/cborg/esm/lib/encode.js","../../../../../node_modules/.pnpm/cborg@1.10.0/node_modules/cborg/esm/lib/length.js","../../../../../node_modules/.pnpm/@ipld+car@5.2.0/node_modules/@ipld/car/src/buffer-writer.js","../../../../../node_modules/.pnpm/multiformats@12.0.1/node_modules/multiformats/src/hashes/hasher.js","../../../../../node_modules/.pnpm/multiformats@12.0.1/node_modules/multiformats/src/block.js","../../../../../node_modules/.pnpm/multiformats@12.0.1/node_modules/multiformats/src/hashes/sha2-browser.js","../../../../../node_modules/.pnpm/multiformats@12.0.1/node_modules/multiformats/src/codecs/raw.js","../../tsc/loader-helpers.js","../../../../../node_modules/.pnpm/pvtsutils@1.3.3/node_modules/pvtsutils/build/index.js","../../../../../node_modules/.pnpm/pvutils@1.1.3/node_modules/pvutils/build/utils.es.js","../../../../../node_modules/.pnpm/asn1js@3.0.5/node_modules/asn1js/build/index.es.js","../../../../../node_modules/.pnpm/@peculiar+asn1-schema@2.3.6/node_modules/@peculiar/asn1-schema/build/es2015/enums.js","../../../../../node_modules/.pnpm/@peculiar+asn1-schema@2.3.6/node_modules/@peculiar/asn1-schema/build/es2015/converters.js","../../../../../node_modules/.pnpm/@peculiar+asn1-schema@2.3.6/node_modules/@peculiar/asn1-schema/build/es2015/helper.js","../../../../../node_modules/.pnpm/@peculiar+asn1-schema@2.3.6/node_modules/@peculiar/asn1-schema/build/es2015/schema.js","../../../../../node_modules/.pnpm/@peculiar+asn1-schema@2.3.6/node_modules/@peculiar/asn1-schema/build/es2015/storage.js","../../../../../node_modules/.pnpm/@peculiar+asn1-schema@2.3.6/node_modules/@peculiar/asn1-schema/build/es2015/decorators.js","../../../../../node_modules/.pnpm/@peculiar+asn1-schema@2.3.6/node_modules/@peculiar/asn1-schema/build/es2015/errors/schema_validation.js","../../../../../node_modules/.pnpm/@peculiar+asn1-schema@2.3.6/node_modules/@peculiar/asn1-schema/build/es2015/parser.js","../../../../../node_modules/.pnpm/@peculiar+asn1-schema@2.3.6/node_modules/@peculiar/asn1-schema/build/es2015/serializer.js","../../../../../node_modules/.pnpm/@peculiar+asn1-schema@2.3.6/node_modules/@peculiar/asn1-schema/build/es2015/convert.js","../../../../../node_modules/.pnpm/tslib@2.6.1/node_modules/tslib/tslib.es6.mjs","../../../../../node_modules/.pnpm/@peculiar+json-schema@1.1.12/node_modules/@peculiar/json-schema/build/index.es.js","../../../../../node_modules/.pnpm/webcrypto-core@1.7.7/node_modules/webcrypto-core/build/webcrypto-core.es.js","../../../../../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js","../../../../../node_modules/.pnpm/randombytes@2.1.0/node_modules/randombytes/browser.js","../../../../../node_modules/.pnpm/readable-stream@3.6.1/node_modules/readable-stream/lib/internal/streams/stream-browser.js","../../../../../node_modules/.pnpm/readable-stream@3.6.1/node_modules/readable-stream/lib/internal/streams/buffer_list.js","../../../../../node_modules/.pnpm/readable-stream@3.6.1/node_modules/readable-stream/lib/internal/streams/destroy.js","../../../../../node_modules/.pnpm/readable-stream@3.6.1/node_modules/readable-stream/errors-browser.js","../../../../../node_modules/.pnpm/readable-stream@3.6.1/node_modules/readable-stream/lib/internal/streams/state.js","../../../../../node_modules/.pnpm/util-deprecate@1.0.2/node_modules/util-deprecate/browser.js","../../../../../node_modules/.pnpm/readable-stream@3.6.1/node_modules/readable-stream/lib/_stream_writable.js","../../../../../node_modules/.pnpm/readable-stream@3.6.1/node_modules/readable-stream/lib/_stream_duplex.js","../../../../../node_modules/.pnpm/readable-stream@3.6.1/node_modules/readable-stream/lib/internal/streams/end-of-stream.js","../../../../../node_modules/.pnpm/readable-stream@3.6.1/node_modules/readable-stream/lib/internal/streams/async_iterator.js","../../../../../node_modules/.pnpm/readable-stream@3.6.1/node_modules/readable-stream/lib/internal/streams/from-browser.js","../../../../../node_modules/.pnpm/readable-stream@3.6.1/node_modules/readable-stream/lib/_stream_readable.js","../../../../../node_modules/.pnpm/readable-stream@3.6.1/node_modules/readable-stream/lib/_stream_transform.js","../../../../../node_modules/.pnpm/readable-stream@3.6.1/node_modules/readable-stream/lib/_stream_passthrough.js","../../../../../node_modules/.pnpm/readable-stream@3.6.1/node_modules/readable-stream/lib/internal/streams/pipeline.js","../../../../../node_modules/.pnpm/readable-stream@3.6.1/node_modules/readable-stream/readable-browser.js","../../../../../node_modules/.pnpm/hash-base@3.1.0/node_modules/hash-base/index.js","../../../../../node_modules/.pnpm/md5.js@1.3.5/node_modules/md5.js/index.js","../../../../../node_modules/.pnpm/ripemd160@2.0.2/node_modules/ripemd160/index.js","../../../../../node_modules/.pnpm/sha.js@2.4.11/node_modules/sha.js/hash.js","../../../../../node_modules/.pnpm/sha.js@2.4.11/node_modules/sha.js/sha.js","../../../../../node_modules/.pnpm/sha.js@2.4.11/node_modules/sha.js/sha1.js","../../../../../node_modules/.pnpm/sha.js@2.4.11/node_modules/sha.js/sha256.js","../../../../../node_modules/.pnpm/sha.js@2.4.11/node_modules/sha.js/sha224.js","../../../../../node_modules/.pnpm/sha.js@2.4.11/node_modules/sha.js/sha512.js","../../../../../node_modules/.pnpm/sha.js@2.4.11/node_modules/sha.js/sha384.js","../../../../../node_modules/.pnpm/sha.js@2.4.11/node_modules/sha.js/index.js","../../../../../node_modules/.pnpm/cipher-base@1.0.4/node_modules/cipher-base/index.js","../../../../../node_modules/.pnpm/create-hash@1.2.0/node_modules/create-hash/browser.js","../../../../../node_modules/.pnpm/create-hmac@1.1.7/node_modules/create-hmac/legacy.js","../../../../../node_modules/.pnpm/create-hash@1.2.0/node_modules/create-hash/md5.js","../../../../../node_modules/.pnpm/create-hmac@1.1.7/node_modules/create-hmac/browser.js","../../../../../node_modules/.pnpm/browserify-sign@4.2.1/node_modules/browserify-sign/algos.js","../../../../../node_modules/.pnpm/pbkdf2@3.1.2/node_modules/pbkdf2/lib/precondition.js","../../../../../node_modules/.pnpm/pbkdf2@3.1.2/node_modules/pbkdf2/lib/default-encoding.js","../../../../../node_modules/.pnpm/pbkdf2@3.1.2/node_modules/pbkdf2/lib/to-buffer.js","../../../../../node_modules/.pnpm/pbkdf2@3.1.2/node_modules/pbkdf2/lib/sync-browser.js","../../../../../node_modules/.pnpm/pbkdf2@3.1.2/node_modules/pbkdf2/lib/async.js","../../../../../node_modules/.pnpm/pbkdf2@3.1.2/node_modules/pbkdf2/browser.js","../../../../../node_modules/.pnpm/des.js@1.0.1/node_modules/des.js/lib/des/utils.js","../../../../../node_modules/.pnpm/minimalistic-assert@1.0.1/node_modules/minimalistic-assert/index.js","../../../../../node_modules/.pnpm/des.js@1.0.1/node_modules/des.js/lib/des/cipher.js","../../../../../node_modules/.pnpm/des.js@1.0.1/node_modules/des.js/lib/des/des.js","../../../../../node_modules/.pnpm/des.js@1.0.1/node_modules/des.js/lib/des/cbc.js","../../../../../node_modules/.pnpm/des.js@1.0.1/node_modules/des.js/lib/des/ede.js","../../../../../node_modules/.pnpm/des.js@1.0.1/node_modules/des.js/lib/des.js","../../../../../node_modules/.pnpm/browserify-des@1.0.2/node_modules/browserify-des/index.js","../../../../../node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/modes/ecb.js","../../../../../node_modules/.pnpm/buffer-xor@1.0.3/node_modules/buffer-xor/index.js","../../../../../node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/modes/cbc.js","../../../../../node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/modes/cfb.js","../../../../../node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/modes/cfb8.js","../../../../../node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/modes/cfb1.js","../../../../../node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/modes/ofb.js","../../../../../node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/incr32.js","../../../../../node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/modes/ctr.js","../../../../../node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/modes/index.js","../../../../../node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/aes.js","../../../../../node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/ghash.js","../../../../../node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/authCipher.js","../../../../../node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/streamCipher.js","../../../../../node_modules/.pnpm/evp_bytestokey@1.0.3/node_modules/evp_bytestokey/index.js","../../../../../node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/encrypter.js","../../../../../node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/decrypter.js","../../../../../node_modules/.pnpm/browserify-aes@1.2.0/node_modules/browserify-aes/browser.js","../../../../../node_modules/.pnpm/browserify-des@1.0.2/node_modules/browserify-des/modes.js","../../../../../node_modules/.pnpm/browserify-cipher@1.0.1/node_modules/browserify-cipher/browser.js","../../../../../node_modules/.pnpm/bn.js@4.12.0/node_modules/bn.js/lib/bn.js","../../../../../node_modules/.pnpm/brorand@1.1.0/node_modules/brorand/index.js","../../../../../node_modules/.pnpm/miller-rabin@4.0.1/node_modules/miller-rabin/lib/mr.js","../../../../../node_modules/.pnpm/diffie-hellman@5.0.3/node_modules/diffie-hellman/lib/generatePrime.js","../../../../../node_modules/.pnpm/diffie-hellman@5.0.3/node_modules/diffie-hellman/lib/dh.js","../../../../../node_modules/.pnpm/diffie-hellman@5.0.3/node_modules/diffie-hellman/browser.js","../../../../../node_modules/.pnpm/bn.js@5.2.1/node_modules/bn.js/lib/bn.js","../../../../../node_modules/.pnpm/browserify-rsa@4.1.0/node_modules/browserify-rsa/index.js","../../../../../node_modules/.pnpm/minimalistic-crypto-utils@1.0.1/node_modules/minimalistic-crypto-utils/lib/utils.js","../../../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/utils.js","../../../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/curve/base.js","../../../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/curve/short.js","../../../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/curve/mont.js","../../../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/curve/edwards.js","../../../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/curve/index.js","../../../../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/utils.js","../../../../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/common.js","../../../../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/common.js","../../../../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/1.js","../../../../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/256.js","../../../../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/224.js","../../../../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/512.js","../../../../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/384.js","../../../../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha.js","../../../../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/ripemd.js","../../../../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/hmac.js","../../../../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash.js","../../../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js","../../../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/curves.js","../../../../../node_modules/.pnpm/hmac-drbg@1.0.1/node_modules/hmac-drbg/lib/hmac-drbg.js","../../../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/ec/key.js","../../../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/ec/signature.js","../../../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/ec/index.js","../../../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/eddsa/key.js","../../../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/eddsa/signature.js","../../../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/eddsa/index.js","../../../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic.js","../../../../../node_modules/.pnpm/safer-buffer@2.1.2/node_modules/safer-buffer/safer.js","../../../../../node_modules/.pnpm/asn1.js@5.4.1/node_modules/asn1.js/lib/asn1/base/reporter.js","../../../../../node_modules/.pnpm/asn1.js@5.4.1/node_modules/asn1.js/lib/asn1/base/buffer.js","../../../../../node_modules/.pnpm/asn1.js@5.4.1/node_modules/asn1.js/lib/asn1/base/node.js","../../../../../node_modules/.pnpm/asn1.js@5.4.1/node_modules/asn1.js/lib/asn1/constants/der.js","../../../../../node_modules/.pnpm/asn1.js@5.4.1/node_modules/asn1.js/lib/asn1/encoders/der.js","../../../../../node_modules/.pnpm/asn1.js@5.4.1/node_modules/asn1.js/lib/asn1/encoders/pem.js","../../../../../node_modules/.pnpm/asn1.js@5.4.1/node_modules/asn1.js/lib/asn1/encoders/index.js","../../../../../node_modules/.pnpm/asn1.js@5.4.1/node_modules/asn1.js/lib/asn1/decoders/der.js","../../../../../node_modules/.pnpm/asn1.js@5.4.1/node_modules/asn1.js/lib/asn1/decoders/pem.js","../../../../../node_modules/.pnpm/asn1.js@5.4.1/node_modules/asn1.js/lib/asn1/decoders/index.js","../../../../../node_modules/.pnpm/asn1.js@5.4.1/node_modules/asn1.js/lib/asn1/api.js","../../../../../node_modules/.pnpm/asn1.js@5.4.1/node_modules/asn1.js/lib/asn1/base/index.js","../../../../../node_modules/.pnpm/asn1.js@5.4.1/node_modules/asn1.js/lib/asn1/constants/index.js","../../../../../node_modules/.pnpm/asn1.js@5.4.1/node_modules/asn1.js/lib/asn1.js","../../../../../node_modules/.pnpm/parse-asn1@5.1.6/node_modules/parse-asn1/certificate.js","../../../../../node_modules/.pnpm/parse-asn1@5.1.6/node_modules/parse-asn1/asn1.js","../../../../../node_modules/.pnpm/parse-asn1@5.1.6/node_modules/parse-asn1/fixProc.js","../../../../../node_modules/.pnpm/parse-asn1@5.1.6/node_modules/parse-asn1/index.js","../../../../../node_modules/.pnpm/browserify-sign@4.2.1/node_modules/browserify-sign/browser/sign.js","../../../../../node_modules/.pnpm/browserify-sign@4.2.1/node_modules/browserify-sign/browser/verify.js","../../../../../node_modules/.pnpm/browserify-sign@4.2.1/node_modules/browserify-sign/browser/index.js","../../../../../node_modules/.pnpm/create-ecdh@4.0.4/node_modules/create-ecdh/browser.js","../../../../../node_modules/.pnpm/public-encrypt@4.0.3/node_modules/public-encrypt/mgf.js","../../../../../node_modules/.pnpm/public-encrypt@4.0.3/node_modules/public-encrypt/xor.js","../../../../../node_modules/.pnpm/public-encrypt@4.0.3/node_modules/public-encrypt/withPublic.js","../../../../../node_modules/.pnpm/public-encrypt@4.0.3/node_modules/public-encrypt/publicEncrypt.js","../../../../../node_modules/.pnpm/public-encrypt@4.0.3/node_modules/public-encrypt/privateDecrypt.js","../../../../../node_modules/.pnpm/public-encrypt@4.0.3/node_modules/public-encrypt/browser.js","../../../../../node_modules/.pnpm/randomfill@1.0.4/node_modules/randomfill/browser.js","../../../../../node_modules/.pnpm/crypto-browserify@3.12.0/node_modules/crypto-browserify/index.js","../../../../../node_modules/.pnpm/@peculiar+webcrypto@1.4.3/node_modules/@peculiar/webcrypto/build/webcrypto.es.js","../../tsc/encrypted-block.js","../../../../../node_modules/.pnpm/prolly-trees@1.0.4/node_modules/prolly-trees/esm/src/utils.js","../../../../../node_modules/.pnpm/prolly-trees@1.0.4/node_modules/prolly-trees/esm/src/base.js","../../../../../node_modules/.pnpm/prolly-trees@1.0.4/node_modules/prolly-trees/esm/src/cid-set.js","../../tsc/crypto.js","../../../../../node_modules/.pnpm/prolly-trees@1.0.4/node_modules/prolly-trees/esm/src/cache.js","../../tsc/encrypt-helpers.js","../../tsc/loader.js","../../tsc/transaction.js","../../../../../node_modules/.pnpm/multiformats@11.0.2/node_modules/multiformats/src/hashes/hasher.js","../../../../../node_modules/.pnpm/multiformats@11.0.2/node_modules/multiformats/src/block.js","../../../../../node_modules/.pnpm/multiformats@11.0.2/node_modules/multiformats/src/hashes/sha2-browser.js","../../../../../node_modules/.pnpm/@alanshaw+pail@0.3.3/node_modules/@alanshaw/pail/src/clock.js","../../../../../node_modules/.pnpm/@alanshaw+pail@0.3.3/node_modules/@alanshaw/pail/src/shard.js","../../../../../node_modules/.pnpm/@alanshaw+pail@0.3.3/node_modules/@alanshaw/pail/src/index.js","../../../../../node_modules/.pnpm/@alanshaw+pail@0.3.3/node_modules/@alanshaw/pail/src/crdt.js","../../tsc/crdt-helpers.js","../../tsc/crdt.js","../../tsc/database.js","../../../../../node_modules/.pnpm/charwise@3.0.1/node_modules/charwise/codec/number.js","../../../../../node_modules/.pnpm/charwise@3.0.1/node_modules/charwise/codec/object.js","../../../../../node_modules/.pnpm/charwise@3.0.1/node_modules/charwise/index.js","../../../../../node_modules/.pnpm/prolly-trees@1.0.4/node_modules/prolly-trees/esm/src/map.js","../../../../../node_modules/.pnpm/prolly-trees@1.0.4/node_modules/prolly-trees/esm/src/db-index.js","../../tsc/indexer-helpers.js","../../tsc/index.js"],"sourcesContent":["export function writeQueue(worker, payload = Infinity) {\n const queue = [];\n let isProcessing = false;\n async function process() {\n if (isProcessing || queue.length === 0)\n return;\n isProcessing = true;\n const tasksToProcess = queue.splice(0, payload);\n const updates = tasksToProcess.map(item => item.task);\n const result = await worker(updates);\n tasksToProcess.forEach(task => task.resolve(result));\n isProcessing = false;\n void process();\n }\n return {\n push(task) {\n return new Promise((resolve) => {\n queue.push({ task, resolve });\n void process();\n });\n }\n };\n}\n","var encode_1 = 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\nvar decode = read;\n\nvar MSB$1 = 0x80\n , REST$1 = 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$1) << shift\n : (b & REST$1) * Math.pow(2, shift);\n shift += 7;\n } while (b >= MSB$1)\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\nvar length = 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\nvar varint = {\n encode: encode_1\n , decode: decode\n , encodingLength: length\n};\n\nvar _brrp_varint = varint;\n\nexport default _brrp_varint;\n","import varint from '../vendor/varint.js'\n\n/**\n * @param {Uint8Array} data\n * @param {number} [offset=0]\n * @returns {[number, number]}\n */\nexport const decode = (data, offset = 0) => {\n const code = varint.decode(data, offset)\n return [code, varint.decode.bytes]\n}\n\n/**\n * @param {number} int\n * @param {Uint8Array} target\n * @param {number} [offset=0]\n */\nexport const encodeTo = (int, target, offset = 0) => {\n varint.encode(int, target, offset)\n return target\n}\n\n/**\n * @param {number} int\n * @returns {number}\n */\nexport const encodingLength = (int) => {\n return varint.encodingLength(int)\n}\n","const empty = new Uint8Array(0)\n\n/**\n * @param {Uint8Array} d\n */\nconst toHex = d => d.reduce((hex, byte) => hex + byte.toString(16).padStart(2, '0'), '')\n\n/**\n * @param {string} hex\n */\nconst fromHex = hex => {\n const hexes = hex.match(/../g)\n return hexes ? new Uint8Array(hexes.map(b => parseInt(b, 16))) : empty\n}\n\n/**\n * @param {Uint8Array} aa\n * @param {Uint8Array} bb\n */\nconst equals = (aa, bb) => {\n if (aa === bb) return true\n if (aa.byteLength !== bb.byteLength) {\n return false\n }\n\n for (let ii = 0; ii < aa.byteLength; ii++) {\n if (aa[ii] !== bb[ii]) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * @param {ArrayBufferView|ArrayBuffer|Uint8Array} o\n * @returns {Uint8Array}\n */\nconst coerce = o => {\n if (o instanceof Uint8Array && o.constructor.name === 'Uint8Array') return o\n if (o instanceof ArrayBuffer) return new Uint8Array(o)\n if (ArrayBuffer.isView(o)) {\n return new Uint8Array(o.buffer, o.byteOffset, o.byteLength)\n }\n throw new Error('Unknown type, must be binary type')\n}\n\n/**\n * @param {any} o\n * @returns {o is ArrayBuffer|ArrayBufferView}\n */\nconst isBinary = o =>\n o instanceof ArrayBuffer || ArrayBuffer.isView(o)\n\n/**\n * @param {string} str\n * @returns {Uint8Array}\n */\nconst fromString = str => (new TextEncoder()).encode(str)\n\n/**\n * @param {Uint8Array} b\n * @returns {string}\n */\nconst toString = b => (new TextDecoder()).decode(b)\n\nexport { equals, coerce, isBinary, fromHex, toHex, fromString, toString, empty }\n","import { coerce, equals as equalBytes } from '../bytes.js'\nimport * as varint from '../varint.js'\n\n/**\n * Creates a multihash digest.\n *\n * @template {number} Code\n * @param {Code} code\n * @param {Uint8Array} digest\n */\nexport const create = (code, digest) => {\n const size = digest.byteLength\n const sizeOffset = varint.encodingLength(code)\n const digestOffset = sizeOffset + varint.encodingLength(size)\n\n const bytes = new Uint8Array(digestOffset + size)\n varint.encodeTo(code, bytes, 0)\n varint.encodeTo(size, bytes, sizeOffset)\n bytes.set(digest, digestOffset)\n\n return new Digest(code, size, digest, bytes)\n}\n\n/**\n * Turns bytes representation of multihash digest into an instance.\n *\n * @param {Uint8Array} multihash\n * @returns {MultihashDigest}\n */\nexport const decode = (multihash) => {\n const bytes = coerce(multihash)\n const [code, sizeOffset] = varint.decode(bytes)\n const [size, digestOffset] = varint.decode(bytes.subarray(sizeOffset))\n const digest = bytes.subarray(sizeOffset + digestOffset)\n\n if (digest.byteLength !== size) {\n throw new Error('Incorrect length')\n }\n\n return new Digest(code, size, digest, bytes)\n}\n\n/**\n * @param {MultihashDigest} a\n * @param {unknown} b\n * @returns {b is MultihashDigest}\n */\nexport const equals = (a, b) => {\n if (a === b) {\n return true\n } else {\n const data = /** @type {{code?:unknown, size?:unknown, bytes?:unknown}} */(b)\n\n return (\n a.code === data.code &&\n a.size === data.size &&\n data.bytes instanceof Uint8Array &&\n equalBytes(a.bytes, data.bytes)\n )\n }\n}\n\n/**\n * @typedef {import('./interface.js').MultihashDigest} MultihashDigest\n */\n\n/**\n * Represents a multihash digest which carries information about the\n * hashing algorithm and an actual hash digest.\n *\n * @template {number} Code\n * @template {number} Size\n * @class\n * @implements {MultihashDigest}\n */\nexport class Digest {\n /**\n * Creates a multihash digest.\n *\n * @param {Code} code\n * @param {Size} size\n * @param {Uint8Array} digest\n * @param {Uint8Array} bytes\n */\n constructor (code, size, digest, bytes) {\n this.code = code\n this.size = size\n this.digest = digest\n this.bytes = bytes\n }\n}\n","// base-x encoding / decoding\n// Copyright (c) 2018 base-x contributors\n// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)\n// Distributed under the MIT software license, see the accompanying\n// file LICENSE or http://www.opensource.org/licenses/mit-license.php.\nfunction base (ALPHABET, name) {\n if (ALPHABET.length >= 255) { throw new TypeError('Alphabet too long') }\n var BASE_MAP = new Uint8Array(256);\n for (var j = 0; j < BASE_MAP.length; j++) {\n BASE_MAP[j] = 255;\n }\n for (var i = 0; i < ALPHABET.length; i++) {\n var x = ALPHABET.charAt(i);\n var xc = x.charCodeAt(0);\n if (BASE_MAP[xc] !== 255) { throw new TypeError(x + ' is ambiguous') }\n BASE_MAP[xc] = i;\n }\n var BASE = ALPHABET.length;\n var LEADER = ALPHABET.charAt(0);\n var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up\n var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up\n function encode (source) {\n if (source instanceof Uint8Array) ; else if (ArrayBuffer.isView(source)) {\n source = new Uint8Array(source.buffer, source.byteOffset, source.byteLength);\n } else if (Array.isArray(source)) {\n source = Uint8Array.from(source);\n }\n if (!(source instanceof Uint8Array)) { throw new TypeError('Expected Uint8Array') }\n if (source.length === 0) { return '' }\n // Skip & count leading zeroes.\n var zeroes = 0;\n var length = 0;\n var pbegin = 0;\n var pend = source.length;\n while (pbegin !== pend && source[pbegin] === 0) {\n pbegin++;\n zeroes++;\n }\n // Allocate enough space in big-endian base58 representation.\n var size = ((pend - pbegin) * iFACTOR + 1) >>> 0;\n var b58 = new Uint8Array(size);\n // Process the bytes.\n while (pbegin !== pend) {\n var carry = source[pbegin];\n // Apply \"b58 = b58 * 256 + ch\".\n var i = 0;\n for (var it1 = size - 1; (carry !== 0 || i < length) && (it1 !== -1); it1--, i++) {\n carry += (256 * b58[it1]) >>> 0;\n b58[it1] = (carry % BASE) >>> 0;\n carry = (carry / BASE) >>> 0;\n }\n if (carry !== 0) { throw new Error('Non-zero carry') }\n length = i;\n pbegin++;\n }\n // Skip leading zeroes in base58 result.\n var it2 = size - length;\n while (it2 !== size && b58[it2] === 0) {\n it2++;\n }\n // Translate the result into a string.\n var str = LEADER.repeat(zeroes);\n for (; it2 < size; ++it2) { str += ALPHABET.charAt(b58[it2]); }\n return str\n }\n function decodeUnsafe (source) {\n if (typeof source !== 'string') { throw new TypeError('Expected String') }\n if (source.length === 0) { return new Uint8Array() }\n var psz = 0;\n // Skip leading spaces.\n if (source[psz] === ' ') { return }\n // Skip and count leading '1's.\n var zeroes = 0;\n var length = 0;\n while (source[psz] === LEADER) {\n zeroes++;\n psz++;\n }\n // Allocate enough space in big-endian base256 representation.\n var size = (((source.length - psz) * FACTOR) + 1) >>> 0; // log(58) / log(256), rounded up.\n var b256 = new Uint8Array(size);\n // Process the characters.\n while (source[psz]) {\n // Decode character\n var carry = BASE_MAP[source.charCodeAt(psz)];\n // Invalid character\n if (carry === 255) { return }\n var i = 0;\n for (var it3 = size - 1; (carry !== 0 || i < length) && (it3 !== -1); it3--, i++) {\n carry += (BASE * b256[it3]) >>> 0;\n b256[it3] = (carry % 256) >>> 0;\n carry = (carry / 256) >>> 0;\n }\n if (carry !== 0) { throw new Error('Non-zero carry') }\n length = i;\n psz++;\n }\n // Skip trailing spaces.\n if (source[psz] === ' ') { return }\n // Skip leading zeroes in b256.\n var it4 = size - length;\n while (it4 !== size && b256[it4] === 0) {\n it4++;\n }\n var vch = new Uint8Array(zeroes + (size - it4));\n var j = zeroes;\n while (it4 !== size) {\n vch[j++] = b256[it4++];\n }\n return vch\n }\n function decode (string) {\n var buffer = decodeUnsafe(string);\n if (buffer) { return buffer }\n throw new Error(`Non-${name} character`)\n }\n return {\n encode: encode,\n decodeUnsafe: decodeUnsafe,\n decode: decode\n }\n}\nvar src = base;\n\nvar _brrp__multiformats_scope_baseX = src;\n\nexport default _brrp__multiformats_scope_baseX;\n","import basex from '../../vendor/base-x.js'\nimport { coerce } from '../bytes.js'\n// Linter can't see that API is used in types.\n// eslint-disable-next-line\nimport * as API from './interface.js'\n\n/**\n * Class represents both BaseEncoder and MultibaseEncoder meaning it\n * can be used to encode to multibase or base encode without multibase\n * prefix.\n *\n * @class\n * @template {string} Base\n * @template {string} Prefix\n * @implements {API.MultibaseEncoder<Prefix>}\n * @implements {API.BaseEncoder}\n */\nclass Encoder {\n /**\n * @param {Base} name\n * @param {Prefix} prefix\n * @param {(bytes:Uint8Array) => string} baseEncode\n */\n constructor (name, prefix, baseEncode) {\n this.name = name\n this.prefix = prefix\n this.baseEncode = baseEncode\n }\n\n /**\n * @param {Uint8Array} bytes\n * @returns {API.Multibase<Prefix>}\n */\n encode (bytes) {\n if (bytes instanceof Uint8Array) {\n return `${this.prefix}${this.baseEncode(bytes)}`\n } else {\n throw Error('Unknown type, must be binary type')\n }\n }\n}\n\n/**\n * @template {string} Prefix\n */\n/**\n * Class represents both BaseDecoder and MultibaseDecoder so it could be used\n * to decode multibases (with matching prefix) or just base decode strings\n * with corresponding base encoding.\n *\n * @class\n * @template {string} Base\n * @template {string} Prefix\n * @implements {API.MultibaseDecoder<Prefix>}\n * @implements {API.UnibaseDecoder<Prefix>}\n * @implements {API.BaseDecoder}\n */\nclass Decoder {\n /**\n * @param {Base} name\n * @param {Prefix} prefix\n * @param {(text:string) => Uint8Array} baseDecode\n */\n constructor (name, prefix, baseDecode) {\n this.name = name\n this.prefix = prefix\n /* c8 ignore next 3 */\n if (prefix.codePointAt(0) === undefined) {\n throw new Error('Invalid prefix character')\n }\n /** @private */\n this.prefixCodePoint = /** @type {number} */ (prefix.codePointAt(0))\n this.baseDecode = baseDecode\n }\n\n /**\n * @param {string} text\n */\n decode (text) {\n if (typeof text === 'string') {\n if (text.codePointAt(0) !== this.prefixCodePoint) {\n throw Error(`Unable to decode multibase string ${JSON.stringify(text)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`)\n }\n return this.baseDecode(text.slice(this.prefix.length))\n } else {\n throw Error('Can only multibase decode strings')\n }\n }\n\n /**\n * @template {string} OtherPrefix\n * @param {API.UnibaseDecoder<OtherPrefix>|ComposedDecoder<OtherPrefix>} decoder\n * @returns {ComposedDecoder<Prefix|OtherPrefix>}\n */\n or (decoder) {\n return or(this, decoder)\n }\n}\n\n/**\n * @template {string} Prefix\n * @typedef {Record<Prefix, API.UnibaseDecoder<Prefix>>} Decoders\n */\n\n/**\n * @template {string} Prefix\n * @implements {API.MultibaseDecoder<Prefix>}\n * @implements {API.CombobaseDecoder<Prefix>}\n */\nclass ComposedDecoder {\n /**\n * @param {Decoders<Prefix>} decoders\n */\n constructor (decoders) {\n this.decoders = decoders\n }\n\n /**\n * @template {string} OtherPrefix\n * @param {API.UnibaseDecoder<OtherPrefix>|ComposedDecoder<OtherPrefix>} decoder\n * @returns {ComposedDecoder<Prefix|OtherPrefix>}\n */\n or (decoder) {\n return or(this, decoder)\n }\n\n /**\n * @param {string} input\n * @returns {Uint8Array}\n */\n decode (input) {\n const prefix = /** @type {Prefix} */ (input[0])\n const decoder = this.decoders[prefix]\n if (decoder) {\n return decoder.decode(input)\n } else {\n throw RangeError(`Unable to decode multibase string ${JSON.stringify(input)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)\n }\n }\n}\n\n/**\n * @template {string} L\n * @template {string} R\n * @param {API.UnibaseDecoder<L>|API.CombobaseDecoder<L>} left\n * @param {API.UnibaseDecoder<R>|API.CombobaseDecoder<R>} right\n * @returns {ComposedDecoder<L|R>}\n */\nexport const or = (left, right) => new ComposedDecoder(/** @type {Decoders<L|R>} */({\n ...(left.decoders || { [/** @type API.UnibaseDecoder<L> */(left).prefix]: left }),\n ...(right.decoders || { [/** @type API.UnibaseDecoder<R> */(right).prefix]: right })\n}))\n\n/**\n * @class\n * @template {string} Base\n * @template {string} Prefix\n * @implements {API.MultibaseCodec<Prefix>}\n * @implements {API.MultibaseEncoder<Prefix>}\n * @implements {API.MultibaseDecoder<Prefix>}\n * @implements {API.BaseCodec}\n * @implements {API.BaseEncoder}\n * @implements {API.BaseDecoder}\n */\nexport class Codec {\n /**\n * @param {Base} name\n * @param {Prefix} prefix\n * @param {(bytes:Uint8Array) => string} baseEncode\n * @param {(text:string) => Uint8Array} baseDecode\n */\n constructor (name, prefix, baseEncode, baseDecode) {\n this.name = name\n this.prefix = prefix\n this.baseEncode = baseEncode\n this.baseDecode = baseDecode\n this.encoder = new Encoder(name, prefix, baseEncode)\n this.decoder = new Decoder(name, prefix, baseDecode)\n }\n\n /**\n * @param {Uint8Array} input\n */\n encode (input) {\n return this.encoder.encode(input)\n }\n\n /**\n * @param {string} input\n */\n decode (input) {\n return this.decoder.decode(input)\n }\n}\n\n/**\n * @template {string} Base\n * @template {string} Prefix\n * @param {object} options\n * @param {Base} options.name\n * @param {Prefix} options.prefix\n * @param {(bytes:Uint8Array) => string} options.encode\n * @param {(input:string) => Uint8Array} options.decode\n * @returns {Codec<Base, Prefix>}\n */\nexport const from = ({ name, prefix, encode, decode }) =>\n new Codec(name, prefix, encode, decode)\n\n/**\n * @template {string} Base\n * @template {string} Prefix\n * @param {object} options\n * @param {Base} options.name\n * @param {Prefix} options.prefix\n * @param {string} options.alphabet\n * @returns {Codec<Base, Prefix>}\n */\nexport const baseX = ({ prefix, name, alphabet }) => {\n const { encode, decode } = basex(alphabet, name)\n return from({\n prefix,\n name,\n encode,\n /**\n * @param {string} text\n */\n decode: text => coerce(decode(text))\n })\n}\n\n/**\n * @param {string} string\n * @param {string} alphabet\n * @param {number} bitsPerChar\n * @param {string} name\n * @returns {Uint8Array}\n */\nconst decode = (string, alphabet, bitsPerChar, name) => {\n // Build the character lookup table:\n /** @type {Record<string, number>} */\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(`Non-${name} character`)\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 * @template {string} Base\n * @template {string} Prefix\n * @param {object} options\n * @param {Base} options.name\n * @param {Prefix} options.prefix\n * @param {string} options.alphabet\n * @param {number} options.bitsPerChar\n */\nexport const rfc4648 = ({ name, prefix, bitsPerChar, alphabet }) => {\n return from({\n prefix,\n name,\n encode (input) {\n return encode(input, alphabet, bitsPerChar)\n },\n decode (input) {\n return decode(input, alphabet, bitsPerChar, name)\n }\n })\n}\n","import { baseX } from './base.js'\n\nexport const base58btc = baseX({\n name: 'base58btc',\n prefix: 'z',\n alphabet: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\n})\n\nexport const base58flickr = baseX({\n name: 'base58flickr',\n prefix: 'Z',\n alphabet: '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'\n})\n","import { rfc4648 } from './base.js'\n\nexport const base32 = rfc4648({\n prefix: 'b',\n name: 'base32',\n alphabet: 'abcdefghijklmnopqrstuvwxyz234567',\n bitsPerChar: 5\n})\n\nexport const base32upper = rfc4648({\n prefix: 'B',\n name: 'base32upper',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567',\n bitsPerChar: 5\n})\n\nexport const base32pad = rfc4648({\n prefix: 'c',\n name: 'base32pad',\n alphabet: 'abcdefghijklmnopqrstuvwxyz234567=',\n bitsPerChar: 5\n})\n\nexport const base32padupper = rfc4648({\n prefix: 'C',\n name: 'base32padupper',\n alphabet: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=',\n bitsPerChar: 5\n})\n\nexport const base32hex = rfc4648({\n prefix: 'v',\n name: 'base32hex',\n alphabet: '0123456789abcdefghijklmnopqrstuv',\n bitsPerChar: 5\n})\n\nexport const base32hexupper = rfc4648({\n prefix: 'V',\n name: 'base32hexupper',\n alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV',\n bitsPerChar: 5\n})\n\nexport const base32hexpad = rfc4648({\n prefix: 't',\n name: 'base32hexpad',\n alphabet: '0123456789abcdefghijklmnopqrstuv=',\n bitsPerChar: 5\n})\n\nexport const base32hexpadupper = rfc4648({\n prefix: 'T',\n name: 'base32hexpadupper',\n alphabet: '0123456789ABCDEFGHIJKLMNOPQRSTUV=',\n bitsPerChar: 5\n})\n\nexport const base32z = rfc4648({\n prefix: 'h',\n name: 'base32z',\n alphabet: 'ybndrfg8ejkmcpqxot1uwisza345h769',\n bitsPerChar: 5\n})\n","import * as varint from './varint.js'\nimport * as Digest from './hashes/digest.js'\nimport { base58btc } from './bases/base58.js'\nimport { base32 } from './bases/base32.js'\nimport { coerce } from './bytes.js'\n// Linter can see that API is used in types.\n// eslint-disable-next-line\nimport * as API from \"./link/interface.js\"\n\n// This way TS will also expose all the types from module\nexport * from './link/interface.js'\n\n/**\n * @template {API.Link<unknown, number, number, API.Version>} T\n * @template {string} Prefix\n * @param {T} link\n * @param {API.MultibaseEncoder<Prefix>} [base]\n * @returns {API.ToString<T, Prefix>}\n */\nexport const format = (link, base) => {\n const { bytes, version } = link\n switch (version) {\n case 0:\n return toStringV0(\n bytes,\n baseCache(link),\n /** @type {API.MultibaseEncoder<\"z\">} */ (base) || base58btc.encoder\n )\n default:\n return toStringV1(\n bytes,\n baseCache(link),\n /** @type {API.MultibaseEncoder<Prefix>} */ (base || base32.encoder)\n )\n }\n}\n\n/**\n * @template {API.UnknownLink} Link\n * @param {Link} link\n * @returns {API.LinkJSON<Link>}\n */\nexport const toJSON = (link) => ({\n '/': format(link)\n})\n\n/**\n * @template {API.UnknownLink} Link\n * @param {API.LinkJSON<Link>} json\n */\nexport const fromJSON = (json) =>\n CID.parse(json['/'])\n\n/** @type {WeakMap<API.UnknownLink, Map<string, string>>} */\nconst cache = new WeakMap()\n\n/**\n * @param {API.UnknownLink} cid\n * @returns {Map<string, string>}\n */\nconst baseCache = cid => {\n const baseCache = cache.get(cid)\n if (baseCache == null) {\n const baseCache = new Map()\n cache.set(cid, baseCache)\n return baseCache\n }\n return baseCache\n}\n\n/**\n * @template {unknown} [Data=unknown]\n * @template {number} [Format=number]\n * @template {number} [Alg=number]\n * @template {API.Version} [Version=API.Version]\n * @implements {API.Link<Data, Format, Alg, Version>}\n */\n\nexport class CID {\n /**\n * @param {Version} version - Version of the CID\n * @param {Format} code - Code of the codec content is encoded in, see https://github.com/multiformats/multicodec/blob/master/table.csv\n * @param {API.MultihashDigest<Alg>} multihash - (Multi)hash of the of the content.\n * @param {Uint8Array} bytes\n *\n */\n constructor (version, code, multihash, bytes) {\n /** @readonly */\n this.code = code\n /** @readonly */\n this.version = version\n /** @readonly */\n this.multihash = multihash\n /** @readonly */\n this.bytes = bytes\n\n // flag to serializers that this is a CID and\n // should be treated specially\n /** @readonly */\n this['/'] = bytes\n }\n\n /**\n * Signalling `cid.asCID === cid` has been replaced with `cid['/'] === cid.bytes`\n * please either use `CID.asCID(cid)` or switch to new signalling mechanism\n *\n * @deprecated\n */\n get asCID () {\n return this\n }\n\n // ArrayBufferView\n get byteOffset () {\n return this.bytes.byteOffset\n }\n\n // ArrayBufferView\n get byteLength () {\n return this.bytes.byteLength\n }\n\n /**\n * @returns {CID<Data, API.DAG_PB, API.SHA_256, 0>}\n */\n toV0 () {\n switch (this.version) {\n case 0: {\n return /** @type {CID<Data, API.DAG_PB, API.SHA_256, 0>} */ (this)\n }\n case 1: {\n const { code, multihash } = this\n\n if (code !== DAG_PB_CODE) {\n throw new Error('Cannot convert a non dag-pb CID to CIDv0')\n }\n\n // sha2-256\n if (multihash.code !== SHA_256_CODE) {\n throw new Error('Cannot convert non sha2-256 multihash CID to CIDv0')\n }\n\n return /** @type {CID<Data, API.DAG_PB, API.SHA_256, 0>} */ (\n CID.createV0(\n /** @type {API.MultihashDigest<API.SHA_256>} */ (multihash)\n )\n )\n }\n default: {\n throw Error(\n `Can not convert CID version ${this.version} to version 0. This is a bug please report`\n )\n }\n }\n }\n\n /**\n * @returns {CID<Data, Format, Alg, 1>}\n */\n toV1 () {\n switch (this.version) {\n case 0: {\n const { code, digest } = this.multihash\n const multihash = Digest.create(code, digest)\n return /** @type {CID<Data, Format, Alg, 1>} */ (\n CID.createV1(this.code, multihash)\n )\n }\n case 1: {\n return /** @type {CID<Data, Format, Alg, 1>} */ (this)\n }\n default: {\n throw Error(\n `Can not convert CID version ${this.version} to version 1. This is a bug please report`\n )\n }\n }\n }\n\n /**\n * @param {unknown} other\n * @returns {other is