(function (_, kotlin_kotlin, kotlin_org_jetbrains_compose_runtime_runtime, kotlin_org_jetbrains_compose_runtime_runtime_saveable, kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core) {
  'use strict';
  //region block: imports
  var THROW_IAE = kotlin_kotlin.$_$.hm;
  var enumEntries = kotlin_kotlin.$_$.ud;
  var Unit_getInstance = kotlin_kotlin.$_$.h6;
  var Enum = kotlin_kotlin.$_$.tl;
  var protoOf = kotlin_kotlin.$_$.wf;
  var classMeta = kotlin_kotlin.$_$.he;
  var setMetadataFor = kotlin_kotlin.$_$.xf;
  var interfaceMeta = kotlin_kotlin.$_$.xe;
  var toString = kotlin_kotlin.$_$.bg;
  var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.l2;
  var VOID = kotlin_kotlin.$_$.g;
  var compositionLocalOf = kotlin_org_jetbrains_compose_runtime_runtime.$_$.s;
  var Map = kotlin_kotlin.$_$.c7;
  var isInterface = kotlin_kotlin.$_$.gf;
  var SaveableStateRegistry = kotlin_org_jetbrains_compose_runtime_runtime_saveable.$_$.a;
  var SaveableStateRegistry_0 = kotlin_org_jetbrains_compose_runtime_runtime_saveable.$_$.b;
  var AutoCloseable = kotlin_kotlin.$_$.ll;
  var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.a1;
  var THROW_CCE = kotlin_kotlin.$_$.gm;
  var CoroutineImpl = kotlin_kotlin.$_$.od;
  var Collection = kotlin_kotlin.$_$.q6;
  var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.zc;
  var FlowCollector = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.j1;
  var Flow = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.k1;
  var ArrayList_init_$Create$ = kotlin_kotlin.$_$.q;
  var MutableStateFlow = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.m1;
  var SuspendFunction1 = kotlin_kotlin.$_$.qd;
  //endregion
  //region block: pre-declaration
  setMetadataFor(State, 'State', classMeta, Enum);
  setMetadataFor(Lifecycle, 'Lifecycle', interfaceMeta);
  setMetadataFor(LifecycleObserver, 'LifecycleObserver', interfaceMeta);
  setMetadataFor(LifecycleOwner, 'LifecycleOwner', interfaceMeta);
  setMetadataFor(SavedStateHolder, 'SavedStateHolder', classMeta, VOID, [SaveableStateRegistry_0, AutoCloseable]);
  setMetadataFor(StateHolder, 'StateHolder', classMeta, VOID, [AutoCloseable], StateHolder);
  setMetadataFor(BackDispatcherOwner, 'BackDispatcherOwner', interfaceMeta);
  setMetadataFor(BackDispatcher$canHandleBackPress$o$collect$slambda, 'BackDispatcher$canHandleBackPress$o$collect$slambda', classMeta, CoroutineImpl, [CoroutineImpl], VOID, VOID, VOID, [1]);
  setMetadataFor($collectCOROUTINE$0, '$collectCOROUTINE$0', classMeta, CoroutineImpl);
  setMetadataFor(sam$kotlinx_coroutines_flow_FlowCollector$0, 'sam$kotlinx_coroutines_flow_FlowCollector$0', classMeta, VOID, [FlowCollector], VOID, VOID, VOID, [1]);
  setMetadataFor(_no_name_provided__qut3iv, VOID, classMeta, VOID, [Flow], VOID, VOID, VOID, [1]);
  setMetadataFor(BackDispatcher, 'BackDispatcher', classMeta, VOID, VOID, BackDispatcher);
  setMetadataFor(BackHandler, 'BackHandler', interfaceMeta);
  //endregion
  var State_Initialized_instance;
  var State_Active_instance;
  var State_InActive_instance;
  var State_Destroyed_instance;
  function values() {
    return [State_Initialized_getInstance(), State_Active_getInstance(), State_InActive_getInstance(), State_Destroyed_getInstance()];
  }
  function valueOf(value) {
    switch (value) {
      case 'Initialized':
        return State_Initialized_getInstance();
      case 'Active':
        return State_Active_getInstance();
      case 'InActive':
        return State_InActive_getInstance();
      case 'Destroyed':
        return State_Destroyed_getInstance();
      default:
        State_initEntries();
        THROW_IAE('No enum constant value.');
        break;
    }
  }
  function get_entries() {
    if ($ENTRIES == null)
      $ENTRIES = enumEntries(values());
    return $ENTRIES;
  }
  var State_entriesInitialized;
  function State_initEntries() {
    if (State_entriesInitialized)
      return Unit_getInstance();
    State_entriesInitialized = true;
    State_Initialized_instance = new State('Initialized', 0);
    State_Active_instance = new State('Active', 1);
    State_InActive_instance = new State('InActive', 2);
    State_Destroyed_instance = new State('Destroyed', 3);
  }
  var $ENTRIES;
  function State(name, ordinal) {
    Enum.call(this, name, ordinal);
  }
  function State_Initialized_getInstance() {
    State_initEntries();
    return State_Initialized_instance;
  }
  function State_Active_getInstance() {
    State_initEntries();
    return State_Active_instance;
  }
  function State_InActive_getInstance() {
    State_initEntries();
    return State_InActive_instance;
  }
  function State_Destroyed_getInstance() {
    State_initEntries();
    return State_Destroyed_instance;
  }
  function Lifecycle() {
  }
  function LifecycleObserver() {
  }
  function get_LocalLifecycleOwner() {
    _init_properties_LifecycleOwner_kt__1y3brd();
    return LocalLifecycleOwner;
  }
  var LocalLifecycleOwner;
  function LifecycleOwner() {
  }
  function noLocalProvidedFor(name) {
    _init_properties_LifecycleOwner_kt__1y3brd();
    // Inline function 'kotlin.error' call
    var message = 'CompositionLocal ' + name + ' not present';
    throw IllegalStateException_init_$Create$(toString(message));
  }
  function LocalLifecycleOwner$lambda() {
    _init_properties_LifecycleOwner_kt__1y3brd();
    noLocalProvidedFor('LocalLifecycleOwner');
  }
  var properties_initialized_LifecycleOwner_kt_pngakr;
  function _init_properties_LifecycleOwner_kt__1y3brd() {
    if (!properties_initialized_LifecycleOwner_kt_pngakr) {
      properties_initialized_LifecycleOwner_kt_pngakr = true;
      LocalLifecycleOwner = compositionLocalOf(VOID, LocalLifecycleOwner$lambda);
    }
  }
  function get_LocalSavedStateHolder() {
    _init_properties_SavedStateHolder_kt__8ezr92();
    return LocalSavedStateHolder;
  }
  var LocalSavedStateHolder;
  function _get_key__e6bh8y($this) {
    return $this.key_1;
  }
  function _get_saveableStateRegistry__ea793u($this) {
    return $this.saveableStateRegistry_1;
  }
  function _get_registryEntry__prfjd0($this) {
    return $this.registryEntry_1;
  }
  function get_$stableprop() {
    return 0;
  }
  function SavedStateHolder$$$delegate_0$lambda($saveableStateRegistry) {
    return function (it) {
      var tmp0_safe_receiver = $saveableStateRegistry;
      var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.canBeSaved_nnajrq_k$(it);
      return tmp1_elvis_lhs == null ? true : tmp1_elvis_lhs;
    };
  }
  function SavedStateHolder$registryEntry$lambda(this$0) {
    return function () {
      return this$0.performSave_ohn24i_k$();
    };
  }
  function SavedStateHolder(key, saveableStateRegistry) {
    this.key_1 = key;
    this.saveableStateRegistry_1 = saveableStateRegistry;
    var tmp = this;
    var tmp_0 = saveableStateRegistry == null ? null : saveableStateRegistry.consumeRestored_yfjzaw_k$(key);
    var tmp_1 = (!(tmp_0 == null) ? isInterface(tmp_0, Map) : false) ? tmp_0 : null;
    tmp.$$delegate_0__1 = SaveableStateRegistry(tmp_1, SavedStateHolder$$$delegate_0$lambda(saveableStateRegistry));
    var tmp_2 = this;
    var tmp0_safe_receiver = this.saveableStateRegistry_1;
    var tmp_3;
    if (tmp0_safe_receiver == null) {
      tmp_3 = null;
    } else {
      tmp_3 = tmp0_safe_receiver.registerProvider_22k33k_k$(this.key_1, SavedStateHolder$registryEntry$lambda(this));
    }
    tmp_2.registryEntry_1 = tmp_3;
    this.$stable_1 = 0;
  }
  protoOf(SavedStateHolder).canBeSaved_nnajrq_k$ = function (value) {
    return this.$$delegate_0__1.canBeSaved_nnajrq_k$(value);
  };
  protoOf(SavedStateHolder).consumeRestored_yfjzaw_k$ = function (key) {
    return this.$$delegate_0__1.consumeRestored_yfjzaw_k$(key);
  };
  protoOf(SavedStateHolder).performSave_ohn24i_k$ = function () {
    return this.$$delegate_0__1.performSave_ohn24i_k$();
  };
  protoOf(SavedStateHolder).registerProvider_22k33k_k$ = function (key, valueProvider) {
    return this.$$delegate_0__1.registerProvider_22k33k_k$(key, valueProvider);
  };
  protoOf(SavedStateHolder).child_23d9su_k$ = function (key) {
    return new SavedStateHolder(key, this);
  };
  protoOf(SavedStateHolder).close_yn9xrc_k$ = function () {
    var tmp0_safe_receiver = this.registryEntry_1;
    if (tmp0_safe_receiver == null)
      null;
    else {
      tmp0_safe_receiver.unregister_ib976c_k$();
    }
  };
  function LocalSavedStateHolder$lambda() {
    _init_properties_SavedStateHolder_kt__8ezr92();
    return new SavedStateHolder('root', null);
  }
  var properties_initialized_SavedStateHolder_kt_5bnzoo;
  function _init_properties_SavedStateHolder_kt__8ezr92() {
    if (!properties_initialized_SavedStateHolder_kt_5bnzoo) {
      properties_initialized_SavedStateHolder_kt_5bnzoo = true;
      LocalSavedStateHolder = compositionLocalOf(VOID, LocalSavedStateHolder$lambda);
    }
  }
  function get_LocalStateHolder() {
    _init_properties_StateHolder_kt__o7rded();
    return LocalStateHolder;
  }
  var LocalStateHolder;
  function _get__states__s8tlv4($this) {
    return $this._states_1;
  }
  function get_$stableprop_0() {
    return 8;
  }
  function StateHolder() {
    var tmp = this;
    // Inline function 'kotlin.collections.mutableMapOf' call
    tmp._states_1 = LinkedHashMap_init_$Create$();
    this.$stable_1 = 8;
  }
  protoOf(StateHolder).set_to7k83_k$ = function (key, value) {
    // Inline function 'kotlin.collections.set' call
    this._states_1.put_4fpzoq_k$(key, value);
  };
  protoOf(StateHolder).getOrPut_foedh6_k$ = function (key, defaultValue) {
    // Inline function 'kotlin.collections.getOrPut' call
    var this_0 = this._states_1;
    var value = this_0.get_wei43m_k$(key);
    var tmp;
    if (value == null) {
      // Inline function 'moe.tlaster.precompose.stateholder.StateHolder.getOrPut.<anonymous>' call
      var tmp_0 = defaultValue();
      var answer = !(tmp_0 == null) ? tmp_0 : THROW_CCE();
      this_0.put_4fpzoq_k$(key, answer);
      tmp = answer;
    } else {
      tmp = value;
    }
    var tmp_1 = tmp;
    return (tmp_1 == null ? true : !(tmp_1 == null)) ? tmp_1 : THROW_CCE();
  };
  protoOf(StateHolder).remove_6241ba_k$ = function (key) {
    this._states_1.remove_gppy8k_k$(key);
  };
  protoOf(StateHolder).get_1z5p00_k$ = function (key) {
    var tmp = this._states_1.get_wei43m_k$(key);
    return (tmp == null ? true : !(tmp == null)) ? tmp : THROW_CCE();
  };
  protoOf(StateHolder).close_yn9xrc_k$ = function () {
    var tmp0_iterator = this._states_1.get_values_ksazhn_k$().iterator_jk1svi_k$();
    while (tmp0_iterator.hasNext_bitz1p_k$()) {
      var value = tmp0_iterator.next_20eer_k$();
      if (!(value == null) ? isInterface(value, AutoCloseable) : false) {
        value.close_yn9xrc_k$();
      }
    }
    this._states_1.clear_j9egeb_k$();
  };
  protoOf(StateHolder).contains_zh0gsb_k$ = function (key) {
    return this._states_1.containsKey_aw81wo_k$(key);
  };
  function LocalStateHolder$lambda() {
    _init_properties_StateHolder_kt__o7rded();
    var message = 'No StateHolder provided';
    throw IllegalStateException_init_$Create$(toString(message));
  }
  var properties_initialized_StateHolder_kt_rci5yl;
  function _init_properties_StateHolder_kt__o7rded() {
    if (!properties_initialized_StateHolder_kt_rci5yl) {
      properties_initialized_StateHolder_kt_rci5yl = true;
      LocalStateHolder = compositionLocalOf(VOID, LocalStateHolder$lambda);
    }
  }
  function get_LocalBackDispatcherOwner() {
    _init_properties_BackPressAdapter_kt__spl31v();
    return LocalBackDispatcherOwner;
  }
  var LocalBackDispatcherOwner;
  function BackDispatcherOwner() {
  }
  function BackDispatcher$canHandleBackPress$o$collect$slambda($$this$unsafeFlow, this$0, resultContinuation) {
    this.$$this$unsafeFlow_1 = $$this$unsafeFlow;
    this.this$0__1 = this$0;
    CoroutineImpl.call(this, resultContinuation);
  }
  protoOf(BackDispatcher$canHandleBackPress$o$collect$slambda).invoke_upy66h_k$ = function (value, $completion) {
    var tmp = this.create_t6fi7n_k$(value, $completion);
    tmp.set_result_xj64lm_k$(Unit_getInstance());
    tmp.set_exception_px07aa_k$(null);
    return tmp.doResume_5yljmg_k$();
  };
  protoOf(BackDispatcher$canHandleBackPress$o$collect$slambda).invoke_qns8j1_k$ = function (p1, $completion) {
    return this.invoke_upy66h_k$((!(p1 == null) ? typeof p1 === 'number' : false) ? p1 : THROW_CCE(), $completion);
  };
  protoOf(BackDispatcher$canHandleBackPress$o$collect$slambda).doResume_5yljmg_k$ = function () {
    var suspendResult = this.get_result_iyg5d2_k$();
    $sm: do
      try {
        var tmp = this.get_state_iypx7s_k$();
        switch (tmp) {
          case 0:
            this.set_exceptionState_fex74n_k$(2);
            var tmp_0 = this;
            tmp_0.$this$unsafeTransform0__1 = this.$$this$unsafeFlow_1;
            var tmp_1 = this;
            tmp_1.value1__1 = this.value_1;
            this.set_state_rjd8d0_k$(1);
            this.value1__1;
            var tmp$ret$0;
            l$ret$1: do {
              var this_0 = this.this$0__1.handlers_1;
              var tmp_2;
              if (isInterface(this_0, Collection)) {
                tmp_2 = this_0.isEmpty_y1axqb_k$();
              } else {
                tmp_2 = false;
              }
              if (tmp_2) {
                tmp$ret$0 = false;
                break l$ret$1;
              }
              var tmp0_iterator = this_0.iterator_jk1svi_k$();
              while (tmp0_iterator.hasNext_bitz1p_k$()) {
                var element = tmp0_iterator.next_20eer_k$();
                if (element.get_isEnabled_roz1ma_k$()) {
                  tmp$ret$0 = true;
                  break l$ret$1;
                }
              }
              tmp$ret$0 = false;
            }
             while (false);
            suspendResult = this.$this$unsafeTransform0__1.emit_t92u1f_k$(tmp$ret$0, this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 1:
            return Unit_getInstance();
          case 2:
            throw this.get_exception_x0n6w6_k$();
        }
      } catch ($p) {
        var e = $p;
        if (this.get_exceptionState_wflpxn_k$() === 2) {
          throw e;
        } else {
          this.set_state_rjd8d0_k$(this.get_exceptionState_wflpxn_k$());
          this.set_exception_px07aa_k$(e);
        }
      }
     while (true);
  };
  protoOf(BackDispatcher$canHandleBackPress$o$collect$slambda).create_t6fi7n_k$ = function (value, completion) {
    var i = new BackDispatcher$canHandleBackPress$o$collect$slambda(this.$$this$unsafeFlow_1, this.this$0__1, completion);
    i.value_1 = value;
    return i;
  };
  protoOf(BackDispatcher$canHandleBackPress$o$collect$slambda).create_wyq9v6_k$ = function (value, completion) {
    return this.create_t6fi7n_k$((!(value == null) ? typeof value === 'number' : false) ? value : THROW_CCE(), completion);
  };
  function BackDispatcher$canHandleBackPress$o$collect$slambda_0($$this$unsafeFlow, this$0, resultContinuation) {
    var i = new BackDispatcher$canHandleBackPress$o$collect$slambda($$this$unsafeFlow, this$0, resultContinuation);
    var l = function (value, $completion) {
      return i.invoke_upy66h_k$(value, $completion);
    };
    l.$arity = 1;
    return l;
  }
  function $collectCOROUTINE$0(_this__u8e3s4, collector, resultContinuation) {
    CoroutineImpl.call(this, resultContinuation);
    this._this__u8e3s4__1 = _this__u8e3s4;
    this.collector_1 = collector;
  }
  protoOf($collectCOROUTINE$0).doResume_5yljmg_k$ = function () {
    var suspendResult = this.get_result_iyg5d2_k$();
    $sm: do
      try {
        var tmp = this.get_state_iypx7s_k$();
        switch (tmp) {
          case 0:
            this.set_exceptionState_fex74n_k$(2);
            var tmp_0 = this;
            tmp_0.$this$unsafeFlow0__1 = this.collector_1;
            this.set_state_rjd8d0_k$(1);
            var tmp_1 = BackDispatcher$canHandleBackPress$o$collect$slambda_0(this.$this$unsafeFlow0__1, this._this__u8e3s4__1.this$0__1, null);
            suspendResult = this._this__u8e3s4__1.$this_1.collect_aksokr_k$(new sam$kotlinx_coroutines_flow_FlowCollector$0(tmp_1), this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 1:
            return Unit_getInstance();
          case 2:
            throw this.get_exception_x0n6w6_k$();
        }
      } catch ($p) {
        var e = $p;
        if (this.get_exceptionState_wflpxn_k$() === 2) {
          throw e;
        } else {
          this.set_state_rjd8d0_k$(this.get_exceptionState_wflpxn_k$());
          this.set_exception_px07aa_k$(e);
        }
      }
     while (true);
  };
  function _get_canHandleBackPressFlow__91og2v($this) {
    return $this.canHandleBackPressFlow_1;
  }
  function get_$stableprop_1() {
    return 0;
  }
  function sam$kotlinx_coroutines_flow_FlowCollector$0(function_0) {
    this.function_1 = function_0;
  }
  protoOf(sam$kotlinx_coroutines_flow_FlowCollector$0).emit_t92u1f_k$ = function (value, $completion) {
    return this.function_1(value, $completion);
  };
  function _no_name_provided__qut3iv($this, this$0) {
    this.$this_1 = $this;
    this.this$0__1 = this$0;
  }
  protoOf(_no_name_provided__qut3iv).collect_aebrhc_k$ = function (collector, $completion) {
    var tmp = new $collectCOROUTINE$0(this, collector, $completion);
    tmp.set_result_xj64lm_k$(Unit_getInstance());
    tmp.set_exception_px07aa_k$(null);
    return tmp.doResume_5yljmg_k$();
  };
  protoOf(_no_name_provided__qut3iv).collect_aksokr_k$ = function (collector, $completion) {
    return this.collect_aebrhc_k$(collector, $completion);
  };
  function BackDispatcher() {
    var tmp = this;
    // Inline function 'kotlin.collections.arrayListOf' call
    tmp.handlers_1 = ArrayList_init_$Create$();
    this.canHandleBackPressFlow_1 = MutableStateFlow(0);
    var tmp_0 = this;
    // Inline function 'kotlinx.coroutines.flow.map' call
    // Inline function 'kotlinx.coroutines.flow.unsafeTransform' call
    var this_0 = this.canHandleBackPressFlow_1;
    // Inline function 'kotlinx.coroutines.flow.internal.unsafeFlow' call
    tmp_0.canHandleBackPress_1 = new _no_name_provided__qut3iv(this_0, this);
    this.$stable_1 = 0;
  }
  protoOf(BackDispatcher).get_handlers_vrpe4u_k$ = function () {
    return this.handlers_1;
  };
  protoOf(BackDispatcher).onBackPress_yuib3h_k$ = function () {
    var tmp$ret$1;
    $l$block: {
      // Inline function 'kotlin.collections.lastOrNull' call
      var this_0 = this.handlers_1;
      var iterator = this_0.listIterator_70e65o_k$(this_0.get_size_woubt6_k$());
      while (iterator.hasPrevious_qh0629_k$()) {
        var element = iterator.previous_l2dfd5_k$();
        // Inline function 'moe.tlaster.precompose.ui.BackDispatcher.onBackPress.<anonymous>' call
        if (element.get_isEnabled_roz1ma_k$()) {
          tmp$ret$1 = element;
          break $l$block;
        }
      }
      tmp$ret$1 = null;
    }
    var tmp0_safe_receiver = tmp$ret$1;
    if (tmp0_safe_receiver == null)
      null;
    else {
      tmp0_safe_receiver.handleBackPress_n0tvus_k$();
    }
  };
  protoOf(BackDispatcher).get_canHandleBackPress_do39pp_k$ = function () {
    return this.canHandleBackPress_1;
  };
  protoOf(BackDispatcher).onBackStackChanged_7z34qq_k$ = function () {
    var tmp0_this = this.canHandleBackPressFlow_1;
    var tmp1 = tmp0_this.get_value_j01efc_k$();
    tmp0_this.set_value_v1vabv_k$(tmp1 + 1 | 0);
  };
  protoOf(BackDispatcher).register_vzbmuj_k$ = function (handler) {
    this.handlers_1.add_utx5q5_k$(handler);
    this.onBackStackChanged_7z34qq_k$();
  };
  protoOf(BackDispatcher).unregister_umt1wy_k$ = function (handler) {
    this.handlers_1.remove_cedx0m_k$(handler);
    this.onBackStackChanged_7z34qq_k$();
  };
  function BackHandler() {
  }
  function LocalBackDispatcherOwner$lambda() {
    _init_properties_BackPressAdapter_kt__spl31v();
    return null;
  }
  var properties_initialized_BackPressAdapter_kt_ak7irv;
  function _init_properties_BackPressAdapter_kt__spl31v() {
    if (!properties_initialized_BackPressAdapter_kt_ak7irv) {
      properties_initialized_BackPressAdapter_kt_ak7irv = true;
      LocalBackDispatcherOwner = compositionLocalOf(VOID, LocalBackDispatcherOwner$lambda);
    }
  }
  return _;
}(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./compose-multiplatform-core-runtime.js'), require('./compose-multiplatform-core-runtime-saveable.js'), require('./kotlinx-coroutines-core.js')));

//# sourceMappingURL=precompose-precompose.js.map
