'use strict';

require('../generic/typed-enum.cjs');
var types_generic_typedBytes = require('../generic/typed-bytes.cjs');
require('../generic/typed-string.cjs');
var types_generic_typedArray = require('../generic/typed-array.cjs');
require('../generic/typed-tuple.cjs');
require('../generic/typed-null.cjs');
var types_generic_option = require('../generic/option.cjs');
require('../../utils/types/array.cjs');
require('crypto');
require('bs58');
require('multiformats/bases/base58');
require('varint');
require('../../utils/encoding/ss-58.cjs');
var types_generic_typedNumber = require('../generic/typed-number.cjs');
require('../generic/typed-set.cjs');
require('../generic/typed-map.cjs');
var types_generic_typedStruct = require('../generic/typed-struct.cjs');
var types_generic_typedUuid = require('../generic/typed-uuid.cjs');
var types_generic_anyOf = require('../generic/any-of.cjs');
var types_generic_withProp = require('../generic/with-prop.cjs');
var types_generic_utils = require('../generic/utils.cjs');
var types_accumulator_keys = require('./keys.cjs');
var types_accumulator_variants = require('./variants.cjs');
require('../../utils/types/iterable.cjs');
require('../../utils/types/object.cjs');
require('../../utils/interfaces.cjs');
require('../../utils/assert.cjs');
require('../../utils/error.cjs');
require('../../utils/inheritance.cjs');
require('../../utils/types/set.cjs');
require('../generic/with-base.cjs');
require('../../utils/types/bytes.cjs');
require('../../utils/types/string.cjs');
require('../generic/with-catch-null.cjs');
require('../generic/with-eq.cjs');
require('blake2b');
require('../generic/with-from.cjs');
require('../generic/with-from-json-bytes.cjs');
require('../generic/create-placeholder.cjs');
require('uuid');
require('js-sha256');
require('../generic/with-props.cjs');
require('../generic/typed-bytes-array.cjs');
require('../generic/with-from-dock-id.cjs');
require('../did/onchain/typed-did/index.cjs');
require('../did/onchain/typed-did/did-method-key/did-method-key-public-key.cjs');
require('../../utils/encoding/base-58-btc.cjs');
require('../generic/sized.cjs');
require('../../utils/types/number.cjs');
require('../generic/with-qualifier.cjs');
require('../public-keys/public-key.cjs');
require('../public-keys/public-key-x25519-value.cjs');
require('../public-keys/public-key-ed25519-value.cjs');
require('../../vc/crypto/constants.cjs');
require('../public-keys/public-key-secp256k1-value.cjs');
require('../public-keys/public-key-sr25519-value.cjs');
require('../did/onchain/constants.cjs');
require('../did/onchain/typed-did/signature.cjs');
require('../did/onchain/typed-did/did-method-key/did-method-key-signature.cjs');
require('../signatures/signature-value.cjs');
require('../signatures/signature-ed25519-value.cjs');
require('../signatures/signature-secp256k1-value.cjs');
require('../signatures/signature.cjs');
require('../signatures/signature-sr25519-value.cjs');
require('../did/onchain/typed-did/dock-did-value.cjs');
require('../did/onchain/typed-did/cheqd-did.cjs');
require('../did/index.cjs');
require('../did/offchain/index.cjs');
require('../did/offchain/doc-ref.cjs');
require('../did/onchain/index.cjs');
require('../did/onchain/controllers.cjs');
require('../did/onchain/verification-relationship.cjs');
require('../did/onchain/did-key.cjs');
require('../offchain-signatures/params/index.cjs');
require('../offchain-signatures/params/value.cjs');
require('../offchain-signatures/curve-type.cjs');
require('../offchain-signatures/params/id.cjs');
require('../offchain-signatures/public-keys/index.cjs');
require('../../vc/crypto/Bls12381BBDT16KeyPairDock2024.cjs');
require('@docknetwork/crypto-wasm-ts');
require('../../vc/crypto/common/DockCryptoKeyPair.cjs');
require('../../vc/crypto/Bls12381BBDT16MACDock2024.cjs');
require('@docknetwork/crypto-wasm-ts/lib/index.js');
require('../../vc/crypto/common/DockCryptoSignature.cjs');
require('jsonld-signatures');
require('json-stringify-deterministic');
require('semver/preload.js');
require('../../vc/crypto/common/CustomLinkedDataSignature.cjs');
require('base64url');
require('jsonld');
require('../did/document/verification-method-ref.cjs');
require('../../vc/jws.cjs');
require('../../vc/crypto/Bls12381BBDT16MACProofDock2024.cjs');
require('../../vc/crypto/common/DockCryptoSignatureProof.cjs');
require('../../vc/crypto/Bls12381BBSKeyPairDock2023.cjs');
require('../../vc/crypto/Bls12381BBSSignatureDock2022.cjs');
require('../../vc/crypto/Bls12381G2KeyPairDock2022.cjs');
require('../../vc/crypto/Bls12381BBSSignatureDock2023.cjs');
require('../../vc/crypto/Bls12381BBSSignatureProofDock2022.cjs');
require('../../vc/crypto/Bls12381BBSSignatureProofDock2023.cjs');
require('../../vc/crypto/Bls12381BDDT16KeyPairDock2024.cjs');
require('../../vc/crypto/Bls12381BDDT16MACDock2024.cjs');
require('../../vc/crypto/Bls12381BDDT16MACProofDock2024.cjs');
require('../../vc/crypto/Bls12381PSKeyPairDock2023.cjs');
require('../../vc/crypto/Bls12381PSSignatureDock2023.cjs');
require('../../vc/crypto/Bls12381PSSignatureProofDock2023.cjs');
require('@juanelas/base64');
require('../../keypairs/keypair-secp256k1.cjs');
require('elliptic');
require('../../keypairs/dock-keypair.cjs');
require('@stablelib/ed25519');
require('@transmute/json-web-signature');
require('../offchain-signatures/public-keys/value.cjs');
require('../offchain-signatures/public-keys/ref.cjs');
require('../offchain-signatures/public-keys/id.cjs');
require('../did/onchain/verification-method-signature.cjs');
require('../../keypairs/did-keypair.cjs');
require('../did/document/verification-method-ref-or-ident-ref.cjs');
require('../did/document/ident-ref.cjs');
require('../did/document/index.cjs');
require('../did/document/service-endpoint.cjs');
require('../did/document/verification-method.cjs');
require('../../utils/encoding/base-58.cjs');
require('../generic/with-base58.cjs');
require('../generic/with-base58btc.cjs');
require('../generic/with-multibase.cjs');
require('../../utils/encoding/multibase.cjs');
require('../did/document/verification-method-type.cjs');
require('../did/document/verification-method-ref-or-cheqd-verification-method.cjs');
require('../did/document/const.cjs');
require('./params.cjs');

class TypedUUIDOrTypedNumber extends types_generic_anyOf(types_generic_typedUuid, types_generic_typedNumber) {}

class AccumulatorUpdate extends types_generic_typedStruct {
  static Classes = {
    id: TypedUUIDOrTypedNumber,
    accumulated: types_generic_typedBytes,
    additions: types_generic_option(types_generic_utils.TypedArrayOfTypedBytes),
    removals: types_generic_option(types_generic_utils.TypedArrayOfTypedBytes),
    witnessUpdateInfo: types_generic_option(types_generic_typedBytes),
  };
}

const [
  DockAccumulatorCommon,
  DockAccumulator,
  DockUniversalAccumulator,
  DockKBUniversalAccumulator,
  DockPositiveAccumulator,
] = types_accumulator_variants.createAccumulatorVariants(types_accumulator_keys.DockAccumulatorPublicKeyRef);

class DockAccumulatorWithUpdateInfo extends types_generic_typedStruct {
  static Classes = {
    createdAt: types_generic_typedNumber,
    lastUpdatedAt: types_generic_typedNumber,
    accumulator: DockAccumulator,
  };

  get created() {
    return this.createdAt;
  }

  get lastModified() {
    return this.lastUpdatedAt;
  }

  get type() {
    return this.accumulator.type;
  }

  get accumulated() {
    return this.accumulator.value.accumulated;
  }

  set accumulated(newAccumulated) {
    this.accumulator.accumulated = newAccumulated;
  }

  get keyRef() {
    return this.accumulator.value.keyRef;
  }
}

class DockAccumulatorHistory extends types_generic_typedStruct {
  static Classes = {
    created: DockAccumulatorWithUpdateInfo,
    updates: class AccumulatorUpdates extends types_generic_typedArray {
      static Class = AccumulatorUpdate;
    },
  };
}

const [
  CheqdAccumulatorCommon,
  CheqdAccumulator,
  CheqdUniversalAccumulator,
  CheqdKBUniversalAccumulator,
  CheqdPositiveAccumulator,
] = types_accumulator_variants.createAccumulatorVariants(types_accumulator_keys.CheqdAccumulatorPublicKeyRef);

class CheqdAccumulatorWithUpdateInfo extends types_generic_typedStruct {
  static Classes = {
    createdAt: types_generic_typedUuid,
    lastUpdatedAt: types_generic_typedUuid,
    accumulator: CheqdAccumulator,
  };

  get created() {
    return this.createdAt;
  }

  get lastModified() {
    return this.lastUpdatedAt;
  }

  get type() {
    return this.accumulator.type;
  }

  get accumulated() {
    return this.accumulator.value.accumulated;
  }

  set accumulated(newAccumulated) {
    this.accumulator.value.accumulated = newAccumulated;
  }

  get keyRef() {
    return this.accumulator.value.keyRef;
  }
}

const [
  CheqdTestnetAccumulatorCommon,
  CheqdTestnetAccumulator,
  CheqdTestnetUniversalAccumulator,
  CheqdTestnetKBUniversalAccumulator,
  CheqdTestnetPositiveAccumulator,
] = types_accumulator_variants.createAccumulatorVariants(types_accumulator_keys.CheqdTestnetAccumulatorPublicKeyRef);

const [
  CheqdMainnetAccumulatorCommon,
  CheqdMainnetAccumulator,
  CheqdMainnetUniversalAccumulator,
  CheqdMainnetKBUniversalAccumulator,
  CheqdMainnetPositiveAccumulator,
] = types_accumulator_variants.createAccumulatorVariants(types_accumulator_keys.CheqdMainnetAccumulatorPublicKeyRef);

class CheqdStoredAccumulator extends types_generic_typedStruct {
  static Classes = {
    accumulator: CheqdAccumulator,
    additions: types_generic_option(types_generic_utils.TypedArrayOfTypedBytes),
    removals: types_generic_option(types_generic_utils.TypedArrayOfTypedBytes),
    witnessUpdateInfo: types_generic_option(types_generic_typedBytes),
  };

  set accumulated(newAccumulated) {
    this.accumulator.accumulated = newAccumulated;
  }

  get accumulated() {
    return this.accumulator.accumulated;
  }
}

class CheqdTestnetStoredAccumulator extends types_generic_withProp(
  CheqdStoredAccumulator,
  'accumulator',
  CheqdTestnetAccumulator,
) {}

class CheqdMainnetStoredAccumulator extends types_generic_withProp(
  CheqdStoredAccumulator,
  'accumulator',
  CheqdMainnetAccumulator,
) {}

class CheqdAccumulatorHistory extends types_generic_typedStruct {
  static Classes = {
    created: CheqdAccumulatorWithUpdateInfo,
    updates: class AccumulatorUpdates extends types_generic_typedArray {
      static Class = AccumulatorUpdate;
    },
  };
}

const [
  AccumulatorCommon,
  Accumulator,
  UniversalAccumulator,
  KBUniversalAccumulator,
  PositiveAccumulator,
] = types_accumulator_variants.createAccumulatorVariants(types_accumulator_keys.DockOrCheqdAccumulatorPublicKeyRef);

exports.Accumulator = Accumulator;
exports.AccumulatorCommon = AccumulatorCommon;
exports.AccumulatorUpdate = AccumulatorUpdate;
exports.CheqdAccumulator = CheqdAccumulator;
exports.CheqdAccumulatorCommon = CheqdAccumulatorCommon;
exports.CheqdAccumulatorHistory = CheqdAccumulatorHistory;
exports.CheqdAccumulatorWithUpdateInfo = CheqdAccumulatorWithUpdateInfo;
exports.CheqdKBUniversalAccumulator = CheqdKBUniversalAccumulator;
exports.CheqdMainnetAccumulator = CheqdMainnetAccumulator;
exports.CheqdMainnetAccumulatorCommon = CheqdMainnetAccumulatorCommon;
exports.CheqdMainnetKBUniversalAccumulator = CheqdMainnetKBUniversalAccumulator;
exports.CheqdMainnetPositiveAccumulator = CheqdMainnetPositiveAccumulator;
exports.CheqdMainnetStoredAccumulator = CheqdMainnetStoredAccumulator;
exports.CheqdMainnetUniversalAccumulator = CheqdMainnetUniversalAccumulator;
exports.CheqdPositiveAccumulator = CheqdPositiveAccumulator;
exports.CheqdStoredAccumulator = CheqdStoredAccumulator;
exports.CheqdTestnetAccumulator = CheqdTestnetAccumulator;
exports.CheqdTestnetAccumulatorCommon = CheqdTestnetAccumulatorCommon;
exports.CheqdTestnetKBUniversalAccumulator = CheqdTestnetKBUniversalAccumulator;
exports.CheqdTestnetPositiveAccumulator = CheqdTestnetPositiveAccumulator;
exports.CheqdTestnetStoredAccumulator = CheqdTestnetStoredAccumulator;
exports.CheqdTestnetUniversalAccumulator = CheqdTestnetUniversalAccumulator;
exports.CheqdUniversalAccumulator = CheqdUniversalAccumulator;
exports.DockAccumulator = DockAccumulator;
exports.DockAccumulatorCommon = DockAccumulatorCommon;
exports.DockAccumulatorHistory = DockAccumulatorHistory;
exports.DockAccumulatorWithUpdateInfo = DockAccumulatorWithUpdateInfo;
exports.DockKBUniversalAccumulator = DockKBUniversalAccumulator;
exports.DockPositiveAccumulator = DockPositiveAccumulator;
exports.DockUniversalAccumulator = DockUniversalAccumulator;
exports.KBUniversalAccumulator = KBUniversalAccumulator;
exports.PositiveAccumulator = PositiveAccumulator;
exports.UniversalAccumulator = UniversalAccumulator;
//# sourceMappingURL=accumulator.cjs.map
