(function (_, kotlin_kotlin) {
  'use strict';
  //region block: imports
  var Unit = kotlin_kotlin.$_$.ri;
  var getKClass = kotlin_kotlin.$_$.e;
  var PrimitiveClasses_getInstance = kotlin_kotlin.$_$.c5;
  var protoOf = kotlin_kotlin.$_$.uc;
  var objectMeta = kotlin_kotlin.$_$.tc;
  var setMetadataFor = kotlin_kotlin.$_$.vc;
  var interfaceMeta = kotlin_kotlin.$_$.vb;
  var equals = kotlin_kotlin.$_$.mb;
  var Collection = kotlin_kotlin.$_$.p5;
  var isInterface = kotlin_kotlin.$_$.ec;
  var getKClassFromExpression = kotlin_kotlin.$_$.d;
  var classMeta = kotlin_kotlin.$_$.jb;
  var VOID = kotlin_kotlin.$_$.f;
  var toString = kotlin_kotlin.$_$.zc;
  var THROW_CCE = kotlin_kotlin.$_$.fi;
  var KClass = kotlin_kotlin.$_$.qd;
  var collectionSizeOrDefault = kotlin_kotlin.$_$.n6;
  var ArrayList_init_$Create$ = kotlin_kotlin.$_$.l;
  var Unit_instance = kotlin_kotlin.$_$.m5;
  var copyToArray = kotlin_kotlin.$_$.e7;
  var Companion_getInstance = kotlin_kotlin.$_$.d5;
  var emptyList = kotlin_kotlin.$_$.i7;
  var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.u1;
  var hashCode = kotlin_kotlin.$_$.ub;
  //endregion
  //region block: pre-declaration
  setMetadataFor(Companion, 'Companion', objectMeta);
  setMetadataFor(TypeToken, 'TypeToken', interfaceMeta);
  setMetadataFor(Companion_0, 'Companion', objectMeta);
  setMetadataFor(AbstractTypeToken, 'AbstractTypeToken', classMeta, VOID, [TypeToken]);
  setMetadataFor(AbstractKClassTypeToken, 'AbstractKClassTypeToken', classMeta, AbstractTypeToken);
  setMetadataFor(JSKClassTypeToken, 'JSKClassTypeToken', classMeta, AbstractKClassTypeToken);
  setMetadataFor(JSKTypeTypeToken, 'JSKTypeTypeToken', classMeta, AbstractTypeToken);
  //endregion
  function Companion() {
    Companion_instance = this;
    var tmp = this;
    // Inline function 'org.kodein.type.erased' call
    tmp.v5a_1 = erased(getKClass(Unit));
    var tmp_0 = this;
    // Inline function 'org.kodein.type.erased' call
    tmp_0.w5a_1 = erased(PrimitiveClasses_getInstance().w7());
  }
  var Companion_instance;
  function Companion_getInstance_0() {
    if (Companion_instance == null)
      new Companion();
    return Companion_instance;
  }
  function TypeToken() {
  }
  function Companion_0() {
    Companion_instance_0 = this;
    var tmp = this;
    // Inline function 'org.kodein.type.erased' call
    tmp.g5b_1 = erased(getKClass(Unit));
    var tmp_0 = this;
    // Inline function 'org.kodein.type.erased' call
    tmp_0.h5b_1 = erased(PrimitiveClasses_getInstance().w7());
  }
  var Companion_instance_0;
  function Companion_getInstance_1() {
    if (Companion_instance_0 == null)
      new Companion_0();
    return Companion_instance_0;
  }
  function AbstractTypeToken() {
    Companion_getInstance_1();
  }
  protoOf(AbstractTypeToken).f5b = function (typeToken) {
    if (this.equals(typeToken) ? true : this.equals(Companion_getInstance_1().h5b_1))
      return true;
    var raw = this.b5b();
    if (equals(raw, typeToken.b5b())) {
      var thisParams = this.c5b();
      // Inline function 'kotlin.collections.isEmpty' call
      if (thisParams.length === 0)
        return true;
      var tokenParams = typeToken.c5b();
      // Inline function 'kotlin.collections.forEachIndexed' call
      var index = 0;
      var inductionVariable = 0;
      var last = thisParams.length;
      while (inductionVariable < last) {
        var item = thisParams[inductionVariable];
        inductionVariable = inductionVariable + 1 | 0;
        // Inline function 'org.kodein.type.AbstractTypeToken.isAssignableFrom.<anonymous>' call
        var tmp1 = index;
        index = tmp1 + 1 | 0;
        var tokenParam = tokenParams[tmp1];
        if (!item.f5b(tokenParam))
          return false;
      }
      return true;
    }
    var tmp$ret$1;
    $l$block_0: {
      // Inline function 'kotlin.collections.any' call
      var this_0 = typeToken.e5b();
      var tmp;
      if (isInterface(this_0, Collection)) {
        tmp = this_0.c1();
      } else {
        tmp = false;
      }
      if (tmp) {
        tmp$ret$1 = false;
        break $l$block_0;
      }
      var tmp0_iterator = this_0.w();
      while (tmp0_iterator.f()) {
        var element = tmp0_iterator.e();
        // Inline function 'org.kodein.type.AbstractTypeToken.isAssignableFrom.<anonymous>' call
        if (this.f5b(element)) {
          tmp$ret$1 = true;
          break $l$block_0;
        }
      }
      tmp$ret$1 = false;
    }
    return tmp$ret$1;
  };
  protoOf(AbstractTypeToken).toString = function () {
    return this.z5a();
  };
  protoOf(AbstractTypeToken).equals = function (other) {
    if (this === other)
      return true;
    if (!(!(other == null) ? isInterface(other, TypeToken) : false))
      return false;
    if (getKClassFromExpression(this).equals(getKClassFromExpression(other)))
      return this.i5b(other);
    if (!equals(this.b5b(), other.b5b()))
      return false;
    if (!this.d5b() ? true : !other.d5b()) {
      var tParams = this.c5b();
      var oParams = other.c5b();
      if (!(tParams.length === oParams.length))
        return false;
      var inductionVariable = 0;
      var last = tParams.length - 1 | 0;
      if (inductionVariable <= last)
        do {
          var i = inductionVariable;
          inductionVariable = inductionVariable + 1 | 0;
          if (!equals(tParams[i], oParams[i]))
            return false;
        }
         while (inductionVariable <= last);
    }
    return true;
  };
  protoOf(AbstractTypeToken).hashCode = function () {
    return this.j5b();
  };
  function JSKClassTypeToken(type) {
    AbstractKClassTypeToken.call(this, type);
  }
  protoOf(JSKClassTypeToken).y5a = function () {
    var tmp0_elvis_lhs = this.l5b_1.f7();
    return tmp0_elvis_lhs == null ? '(non-denotable type)' : tmp0_elvis_lhs;
  };
  protoOf(JSKClassTypeToken).a5b = function () {
    var tmp0_elvis_lhs = this.l5b_1.f7();
    return tmp0_elvis_lhs == null ? '(non-denotable type)' : tmp0_elvis_lhs;
  };
  function JSKTypeTypeToken(type) {
    AbstractTypeToken.call(this);
    this.m5b_1 = type;
  }
  protoOf(JSKTypeTypeToken).x5a = function () {
    return toString(this.m5b_1);
  };
  protoOf(JSKTypeTypeToken).z5a = function () {
    return toString(this.m5b_1);
  };
  protoOf(JSKTypeTypeToken).b5b = function () {
    var tmp = this.m5b_1.t7();
    return new JSKClassTypeToken((!(tmp == null) ? isInterface(tmp, KClass) : false) ? tmp : THROW_CCE());
  };
  protoOf(JSKTypeTypeToken).c5b = function () {
    // Inline function 'kotlin.collections.toTypedArray' call
    // Inline function 'kotlin.collections.map' call
    var this_0 = this.m5b_1.u7();
    // Inline function 'kotlin.collections.mapTo' call
    var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
    var tmp0_iterator = this_0.w();
    while (tmp0_iterator.f()) {
      var item = tmp0_iterator.e();
      // Inline function 'org.kodein.type.JSKTypeTypeToken.getGenericParameters.<anonymous>' call
      var tmp0_safe_receiver = item.el_1;
      var tmp;
      if (tmp0_safe_receiver == null) {
        tmp = null;
      } else {
        // Inline function 'kotlin.let' call
        // Inline function 'kotlin.contracts.contract' call
        // Inline function 'org.kodein.type.JSKTypeTypeToken.getGenericParameters.<anonymous>.<anonymous>' call
        tmp = typeToken(tmp0_safe_receiver);
      }
      var tmp1_elvis_lhs = tmp;
      var tmp$ret$2 = tmp1_elvis_lhs == null ? Companion_getInstance_1().h5b_1 : tmp1_elvis_lhs;
      destination.i1(tmp$ret$2);
    }
    return copyToArray(destination);
  };
  protoOf(JSKTypeTypeToken).d5b = function () {
    var tmp$ret$0;
    $l$block_0: {
      // Inline function 'kotlin.collections.all' call
      var this_0 = this.m5b_1.u7();
      var tmp;
      if (isInterface(this_0, Collection)) {
        tmp = this_0.c1();
      } else {
        tmp = false;
      }
      if (tmp) {
        tmp$ret$0 = true;
        break $l$block_0;
      }
      var tmp0_iterator = this_0.w();
      while (tmp0_iterator.f()) {
        var element = tmp0_iterator.e();
        // Inline function 'org.kodein.type.JSKTypeTypeToken.isWildcard.<anonymous>' call
        if (!element.equals(Companion_getInstance().cl())) {
          tmp$ret$0 = false;
          break $l$block_0;
        }
      }
      tmp$ret$0 = true;
    }
    return tmp$ret$0;
  };
  protoOf(JSKTypeTypeToken).e5b = function () {
    return emptyList();
  };
  protoOf(JSKTypeTypeToken).i5b = function (other) {
    // Inline function 'kotlin.require' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'kotlin.require' call
    // Inline function 'kotlin.contracts.contract' call
    if (!(other instanceof JSKTypeTypeToken)) {
      // Inline function 'kotlin.require.<anonymous>' call
      var message = 'Failed requirement.';
      throw IllegalArgumentException_init_$Create$(toString(message));
    }
    return equals(this.m5b_1, other.m5b_1);
  };
  protoOf(JSKTypeTypeToken).j5b = function () {
    return hashCode(this.m5b_1);
  };
  function erasedOf(obj) {
    return new JSKClassTypeToken(getKClassFromExpression(obj));
  }
  function typeToken(type) {
    var tmp;
    if (type.u7().c1()) {
      var tmp_0 = type.t7();
      tmp = new JSKClassTypeToken((!(tmp_0 == null) ? isInterface(tmp_0, KClass) : false) ? tmp_0 : THROW_CCE());
    } else {
      tmp = new JSKTypeTypeToken(type);
    }
    return tmp;
  }
  function erased(cls) {
    return new JSKClassTypeToken(cls);
  }
  function AbstractKClassTypeToken(type) {
    AbstractTypeToken.call(this);
    this.l5b_1 = type;
  }
  protoOf(AbstractKClassTypeToken).x5a = function () {
    return this.y5a();
  };
  protoOf(AbstractKClassTypeToken).z5a = function () {
    return this.a5b();
  };
  protoOf(AbstractKClassTypeToken).b5b = function () {
    return this;
  };
  protoOf(AbstractKClassTypeToken).d5b = function () {
    return true;
  };
  protoOf(AbstractKClassTypeToken).e5b = function () {
    return emptyList();
  };
  protoOf(AbstractKClassTypeToken).c5b = function () {
    // Inline function 'kotlin.emptyArray' call
    return [];
  };
  protoOf(AbstractKClassTypeToken).f5b = function (typeToken) {
    if (this.equals(typeToken))
      return true;
    if (this.l5b_1.equals(PrimitiveClasses_getInstance().w7()))
      return true;
    return false;
  };
  protoOf(AbstractKClassTypeToken).i5b = function (other) {
    // Inline function 'kotlin.require' call
    // Inline function 'kotlin.contracts.contract' call
    // Inline function 'kotlin.require' call
    // Inline function 'kotlin.contracts.contract' call
    if (!(other instanceof AbstractKClassTypeToken)) {
      // Inline function 'kotlin.require.<anonymous>' call
      var message = 'Failed requirement.';
      throw IllegalArgumentException_init_$Create$(toString(message));
    }
    if (!this.l5b_1.equals(other.l5b_1))
      return false;
    return true;
  };
  protoOf(AbstractKClassTypeToken).j5b = function () {
    return this.l5b_1.hashCode();
  };
  //region block: exports
  _.$_$ = _.$_$ || {};
  _.$_$.a = Companion_getInstance_0;
  _.$_$.b = TypeToken;
  _.$_$.c = erasedOf;
  _.$_$.d = typeToken;
  //endregion
  return _;
}(module.exports, require('./kotlin-kotlin-stdlib.js')));

//# sourceMappingURL=Kosi-Kaverit-kaverit.js.map
