(function (_, kotlin_kotlin) {
  'use strict';
  //region block: imports
  var Unit = kotlin_kotlin.$_$.oi;
  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.$_$.ci;
  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.d54_1 = erased(getKClass(Unit));
    var tmp_0 = this;
    // Inline function 'org.kodein.type.erased' call
    tmp_0.e54_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.o54_1 = erased(getKClass(Unit));
    var tmp_0 = this;
    // Inline function 'org.kodein.type.erased' call
    tmp_0.p54_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).n54 = function (typeToken) {
    if (this.equals(typeToken) ? true : this.equals(Companion_getInstance_1().p54_1))
      return true;
    var raw = this.j54();
    if (equals(raw, typeToken.j54())) {
      var thisParams = this.k54();
      // Inline function 'kotlin.collections.isEmpty' call
      if (thisParams.length === 0)
        return true;
      var tokenParams = typeToken.k54();
      // 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.n54(tokenParam))
          return false;
      }
      return true;
    }
    var tmp$ret$1;
    $l$block_0: {
      // Inline function 'kotlin.collections.any' call
      var this_0 = typeToken.m54();
      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.n54(element)) {
          tmp$ret$1 = true;
          break $l$block_0;
        }
      }
      tmp$ret$1 = false;
    }
    return tmp$ret$1;
  };
  protoOf(AbstractTypeToken).toString = function () {
    return this.h54();
  };
  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.q54(other);
    if (!equals(this.j54(), other.j54()))
      return false;
    if (!this.l54() ? true : !other.l54()) {
      var tParams = this.k54();
      var oParams = other.k54();
      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.r54();
  };
  function JSKClassTypeToken(type) {
    AbstractKClassTypeToken.call(this, type);
  }
  protoOf(JSKClassTypeToken).g54 = function () {
    var tmp0_elvis_lhs = this.t54_1.f7();
    return tmp0_elvis_lhs == null ? '(non-denotable type)' : tmp0_elvis_lhs;
  };
  protoOf(JSKClassTypeToken).i54 = function () {
    var tmp0_elvis_lhs = this.t54_1.f7();
    return tmp0_elvis_lhs == null ? '(non-denotable type)' : tmp0_elvis_lhs;
  };
  function JSKTypeTypeToken(type) {
    AbstractTypeToken.call(this);
    this.u54_1 = type;
  }
  protoOf(JSKTypeTypeToken).f54 = function () {
    return toString(this.u54_1);
  };
  protoOf(JSKTypeTypeToken).h54 = function () {
    return toString(this.u54_1);
  };
  protoOf(JSKTypeTypeToken).j54 = function () {
    var tmp = this.u54_1.t7();
    return new JSKClassTypeToken((!(tmp == null) ? isInterface(tmp, KClass) : false) ? tmp : THROW_CCE());
  };
  protoOf(JSKTypeTypeToken).k54 = function () {
    // Inline function 'kotlin.collections.toTypedArray' call
    // Inline function 'kotlin.collections.map' call
    var this_0 = this.u54_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().p54_1 : tmp1_elvis_lhs;
      destination.i1(tmp$ret$2);
    }
    return copyToArray(destination);
  };
  protoOf(JSKTypeTypeToken).l54 = function () {
    var tmp$ret$0;
    $l$block_0: {
      // Inline function 'kotlin.collections.all' call
      var this_0 = this.u54_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).m54 = function () {
    return emptyList();
  };
  protoOf(JSKTypeTypeToken).q54 = 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.u54_1, other.u54_1);
  };
  protoOf(JSKTypeTypeToken).r54 = function () {
    return hashCode(this.u54_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.t54_1 = type;
  }
  protoOf(AbstractKClassTypeToken).f54 = function () {
    return this.g54();
  };
  protoOf(AbstractKClassTypeToken).h54 = function () {
    return this.i54();
  };
  protoOf(AbstractKClassTypeToken).j54 = function () {
    return this;
  };
  protoOf(AbstractKClassTypeToken).l54 = function () {
    return true;
  };
  protoOf(AbstractKClassTypeToken).m54 = function () {
    return emptyList();
  };
  protoOf(AbstractKClassTypeToken).k54 = function () {
    // Inline function 'kotlin.emptyArray' call
    return [];
  };
  protoOf(AbstractKClassTypeToken).n54 = function (typeToken) {
    if (this.equals(typeToken))
      return true;
    if (this.t54_1.equals(PrimitiveClasses_getInstance().w7()))
      return true;
    return false;
  };
  protoOf(AbstractKClassTypeToken).q54 = 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.t54_1.equals(other.t54_1))
      return false;
    return true;
  };
  protoOf(AbstractKClassTypeToken).r54 = function () {
    return this.t54_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
