'use strict';

var types_generic_typedEnum = require('../generic/typed-enum.cjs');
var types_generic_typedBytes = require('../generic/typed-bytes.cjs');
require('../generic/typed-string.cjs');
require('../generic/typed-array.cjs');
require('../generic/typed-tuple.cjs');
require('../generic/typed-null.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');
require('uuid');
require('js-sha256');
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('../generic/any-of.cjs');
require('../generic/with-from.cjs');
require('blake2b');
require('../generic/with-from-json-bytes.cjs');
require('../generic/create-placeholder.cjs');

const createAccumulatorVariants = (keyRef) => {
  class AccumulatorCommon extends types_generic_typedStruct {
    static Classes = {
      accumulated: class Accumulated extends types_generic_typedBytes {},
      keyRef,
    };
  }

  class UniversalAccumulatorValue extends types_generic_typedStruct {
    static Type = 'universal';

    static Classes = {
      common: AccumulatorCommon,
      maxSize: types_generic_typedNumber,
    };

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

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

    get keyRef() {
      return this.common.keyRef;
    }
  }

  class Accumulator extends types_generic_typedEnum {
    get keyRef() {
      return this.value.keyRef;
    }

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

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

  class UniversalAccumulator extends Accumulator {
    static Type = 'universal';

    static Class = UniversalAccumulatorValue;
  }
  class KBUniversalAccumulator extends Accumulator {
    static Type = 'kbUniversal';

    static Class = AccumulatorCommon;
  }
  class PositiveAccumulator extends Accumulator {
    static Type = 'positive';

    static Class = AccumulatorCommon;
  }

  Accumulator.bindVariants(
    UniversalAccumulator,
    KBUniversalAccumulator,
    PositiveAccumulator,
  );

  return [
    AccumulatorCommon,
    Accumulator,
    UniversalAccumulator,
    KBUniversalAccumulator,
    PositiveAccumulator,
  ];
};

exports.createAccumulatorVariants = createAccumulatorVariants;
//# sourceMappingURL=variants.cjs.map
