(function (_, dev_icerock_moko_resources_internal_messageFormat_MessageFormat_rhgpjd, $module$bcp_47_7qe1cl, kotlin_kotlin, kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core) { 'use strict'; //region block: imports var imul = Math.imul; var parse = $module$bcp_47_7qe1cl.parse; var asList = kotlin_kotlin.$_$.g6; var protoOf = kotlin_kotlin.$_$.xc; var classMeta = kotlin_kotlin.$_$.mb; var setMetadataFor = kotlin_kotlin.$_$.yc; var getStringHashCode = kotlin_kotlin.$_$.wb; var copyToArray = kotlin_kotlin.$_$.e7; var hashCode = kotlin_kotlin.$_$.xb; var THROW_CCE = kotlin_kotlin.$_$.ji; var equals = kotlin_kotlin.$_$.pb; var VOID = kotlin_kotlin.$_$.f; var objectMeta = kotlin_kotlin.$_$.wc; var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.u1; var isArray = kotlin_kotlin.$_$.zb; var toList = kotlin_kotlin.$_$.u9; var emptyList = kotlin_kotlin.$_$.i7; var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.v; var ArrayList_init_$Create$ = kotlin_kotlin.$_$.m; var Unit_instance = kotlin_kotlin.$_$.m5; var collectionSizeOrDefault = kotlin_kotlin.$_$.n6; var mapCapacity = kotlin_kotlin.$_$.m8; var coerceAtLeast = kotlin_kotlin.$_$.kd; var LinkedHashMap_init_$Create$_0 = kotlin_kotlin.$_$.u; var List = kotlin_kotlin.$_$.w5; var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.l; var to = kotlin_kotlin.$_$.pj; var json = kotlin_kotlin.$_$.mc; var plus = kotlin_kotlin.$_$.s8; var CoroutineImpl = kotlin_kotlin.$_$.va; var CoroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.z1; var isInterface = kotlin_kotlin.$_$.hc; var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.ha; var async = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.f2; var plus_0 = kotlin_kotlin.$_$.a9; var awaitAll = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.h; var toString = kotlin_kotlin.$_$.cd; var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.a2; var await_0 = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.i; var coroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.j; var UnsupportedOperationException_init_$Create$ = kotlin_kotlin.$_$.r2; var listOf = kotlin_kotlin.$_$.l8; var interfaceMeta = kotlin_kotlin.$_$.yb; var Companion_instance = kotlin_kotlin.$_$.h5; var _Result___init__impl__xyqfz8 = kotlin_kotlin.$_$.d3; var createFailure = kotlin_kotlin.$_$.aj; var Result__exceptionOrNull_impl_p6xea9 = kotlin_kotlin.$_$.e3; var throwOnFailure = kotlin_kotlin.$_$.mj; var _Result___get_value__impl__bjfvqg = kotlin_kotlin.$_$.g3; //endregion //region block: pre-declaration setMetadataFor(PluralsResource, 'PluralsResource', classMeta); setMetadataFor(StringResource, 'StringResource', classMeta); setMetadataFor(PluralFormattedStringDesc, 'PluralFormattedStringDesc', classMeta, VOID, VOID, VOID, VOID, VOID, [0]); setMetadataFor(LocaleType, 'LocaleType', classMeta); setMetadataFor(System, 'System', objectMeta, LocaleType); setMetadataFor(Companion, 'Companion', objectMeta); setMetadataFor(ParsedLocale, 'ParsedLocale', classMeta); setMetadataFor(SupportedLocale, 'SupportedLocale', classMeta); setMetadataFor(SupportedLocales, 'SupportedLocales', classMeta, VOID, [List]); setMetadataFor(RemoteJsStringLoader$Impl$getOrLoad$slambda$slambda, 'RemoteJsStringLoader$Impl$getOrLoad$slambda$slambda', classMeta, CoroutineImpl, VOID, VOID, VOID, VOID, [1]); setMetadataFor(RemoteJsStringLoader$Impl$getOrLoad$slambda$slambda_1, 'RemoteJsStringLoader$Impl$getOrLoad$slambda$slambda', classMeta, CoroutineImpl, VOID, VOID, VOID, VOID, [1]); function plus_1(other) { var tmp = JsStringProvider$plus$lambda(this, other); return new sam$dev_icerock_moko_resources_provider_JsStringProvider$0_0(tmp); } setMetadataFor(JsStringProvider, 'JsStringProvider', interfaceMeta); setMetadataFor(sam$dev_icerock_moko_resources_provider_JsStringProvider$0, 'sam$dev_icerock_moko_resources_provider_JsStringProvider$0', classMeta, VOID, [JsStringProvider]); setMetadataFor(RemoteJsStringLoader$Impl$getOrLoad$slambda, 'RemoteJsStringLoader$Impl$getOrLoad$slambda', classMeta, CoroutineImpl, VOID, VOID, VOID, VOID, [1]); setMetadataFor($loadLocalizationFileCOROUTINE$3, '$loadLocalizationFileCOROUTINE$3', classMeta, CoroutineImpl); setMetadataFor($getOrLoadCOROUTINE$4, '$getOrLoadCOROUTINE$4', classMeta, CoroutineImpl); setMetadataFor($downloadLocaleFileCOROUTINE$5, '$downloadLocaleFileCOROUTINE$5', classMeta, CoroutineImpl); setMetadataFor($downloadFallbackFileCOROUTINE$6, '$downloadFallbackFileCOROUTINE$6', classMeta, CoroutineImpl); setMetadataFor(RemoteJsStringLoader$Composition$getOrLoad$slambda$slambda, 'RemoteJsStringLoader$Composition$getOrLoad$slambda$slambda', classMeta, CoroutineImpl, VOID, VOID, VOID, VOID, [1]); setMetadataFor(RemoteJsStringLoader$Composition$getOrLoad$slambda, 'RemoteJsStringLoader$Composition$getOrLoad$slambda', classMeta, CoroutineImpl, VOID, VOID, VOID, VOID, [1]); setMetadataFor($getOrLoadCOROUTINE$7, '$getOrLoadCOROUTINE$7', classMeta, CoroutineImpl); function plus_2(other) { return new Composition(listOf([this, other])); } setMetadataFor(RemoteJsStringLoader, 'RemoteJsStringLoader', interfaceMeta, VOID, VOID, VOID, VOID, VOID, [0]); setMetadataFor(Impl, 'Impl', classMeta, VOID, [RemoteJsStringLoader], VOID, VOID, VOID, [1, 0]); setMetadataFor(Composition, 'Composition', classMeta, VOID, [RemoteJsStringLoader], VOID, VOID, VOID, [0]); setMetadataFor(sam$dev_icerock_moko_resources_provider_JsStringProvider$0_0, 'sam$dev_icerock_moko_resources_provider_JsStringProvider$0', classMeta, VOID, [JsStringProvider]); //endregion function format(_this__u8e3s4, number, args) { return PluralFormatted(Companion_getInstance(), _this__u8e3s4, number, asList(args)); } function PluralFormatted(_this__u8e3s4, pluralsRes, number, args) { return new PluralFormattedStringDesc(pluralsRes, number, args); } function PluralsResource(key, loader) { this.wm3_1 = key; this.xm3_1 = loader; } protoOf(PluralsResource).ym3 = function (provider, locale, quantity, args) { var pluralString = provider.zm3(this.wm3_1, locale); var pluralLocale = locale == null ? currentLocale() : locale; // Inline function 'kotlin.arrayOf' call // Inline function 'kotlin.js.unsafeCast' call // Inline function 'kotlin.js.asDynamic' call var tmp$ret$2 = [pluralLocale]; var compiledPlural = _CompiledPlural___init__impl__m1vc38((new dev_icerock_moko_resources_internal_messageFormat_MessageFormat_rhgpjd(tmp$ret$2)).compile(pluralString)); return CompiledPlural__evaluate_impl_gca2wx(compiledPlural, quantity, args.slice()); }; function StringResource(key, loader) { this.am4_1 = key; this.bm4_1 = loader; } protoOf(StringResource).cm4 = function (provider, locale) { return provider.zm3(this.am4_1, locale); }; protoOf(StringResource).dm4 = function (provider, locale, args) { var rawString = provider.zm3(this.am4_1, locale); // Inline function 'kotlin.arrayOf' call // Inline function 'kotlin.js.unsafeCast' call // Inline function 'kotlin.js.asDynamic' call var tmp$ret$2 = [locale == null ? currentLocale() : locale]; var compiled = _CompiledVariableString___init__impl__gl5jz1((new dev_icerock_moko_resources_internal_messageFormat_MessageFormat_rhgpjd(tmp$ret$2)).compile(rawString)); return CompiledVariableString__evaluate_impl_iy6o3u(compiled, args.slice()); }; protoOf(StringResource).equals = function (other) { if (!(other instanceof StringResource)) return false; if (!(this.am4_1 === other.am4_1)) return false; return true; }; protoOf(StringResource).hashCode = function () { return getStringHashCode(this.am4_1); }; function PluralFormattedStringDesc(pluralsRes, number, args) { this.em4_1 = pluralsRes; this.fm4_1 = number; this.gm4_1 = args; } protoOf(PluralFormattedStringDesc).hm4 = function (provider) { var tmp = Companion_getInstance().im4_1.jm4(); // Inline function 'kotlin.collections.toTypedArray' call var this_0 = this.gm4_1; var tmp$ret$0 = copyToArray(this_0); return this.em4_1.ym3(provider, tmp, this.fm4_1, tmp$ret$0.slice()); }; protoOf(PluralFormattedStringDesc).toString = function () { return 'PluralFormattedStringDesc(pluralsRes=' + this.em4_1 + ', number=' + this.fm4_1 + ', args=' + this.gm4_1 + ')'; }; protoOf(PluralFormattedStringDesc).hashCode = function () { var result = hashCode(this.em4_1); result = imul(result, 31) + this.fm4_1 | 0; result = imul(result, 31) + hashCode(this.gm4_1) | 0; return result; }; protoOf(PluralFormattedStringDesc).equals = function (other) { if (this === other) return true; if (!(other instanceof PluralFormattedStringDesc)) return false; var tmp0_other_with_cast = other instanceof PluralFormattedStringDesc ? other : THROW_CCE(); if (!equals(this.em4_1, tmp0_other_with_cast.em4_1)) return false; if (!(this.fm4_1 === tmp0_other_with_cast.fm4_1)) return false; if (!equals(this.gm4_1, tmp0_other_with_cast.gm4_1)) return false; return true; }; function System() { System_instance = this; LocaleType.call(this); } protoOf(System).jm4 = function () { return currentLocale(); }; var System_instance; function System_getInstance() { if (System_instance == null) new System(); return System_instance; } function LocaleType() { } function Companion() { Companion_instance_0 = this; this.im4_1 = System_getInstance(); } var Companion_instance_0; function Companion_getInstance() { if (Companion_instance_0 == null) new Companion(); return Companion_instance_0; } function currentLocale() { return window.navigator.language; } var cachedLocale; function ParsedLocale(parseResult) { var tmp = this; var tmp_0 = parseResult['language']; var tmp0_elvis_lhs = (!(tmp_0 == null) ? typeof tmp_0 === 'string' : false) ? tmp_0 : null; var tmp_1; if (tmp0_elvis_lhs == null) { throw IllegalArgumentException_init_$Create$('Primary language tags must not be empty'); } else { tmp_1 = tmp0_elvis_lhs; } tmp.km4_1 = tmp_1; var tmp_2 = this; // Inline function 'kotlin.collections.orEmpty' call var tmp_3 = parseResult['extendedLanguageSubtags']; var tmp0_safe_receiver = (!(tmp_3 == null) ? isArray(tmp_3) : false) ? tmp_3 : null; var tmp0_elvis_lhs_0 = tmp0_safe_receiver == null ? null : toList(tmp0_safe_receiver); tmp_2.lm4_1 = tmp0_elvis_lhs_0 == null ? emptyList() : tmp0_elvis_lhs_0; var tmp_4 = this; // Inline function 'kotlin.text.orEmpty' call var tmp_5 = parseResult['script']; var tmp0_elvis_lhs_1 = (!(tmp_5 == null) ? typeof tmp_5 === 'string' : false) ? tmp_5 : null; tmp_4.mm4_1 = tmp0_elvis_lhs_1 == null ? '' : tmp0_elvis_lhs_1; var tmp_6 = this; // Inline function 'kotlin.text.orEmpty' call var tmp_7 = parseResult['region']; var tmp0_elvis_lhs_2 = (!(tmp_7 == null) ? typeof tmp_7 === 'string' : false) ? tmp_7 : null; tmp_6.nm4_1 = tmp0_elvis_lhs_2 == null ? '' : tmp0_elvis_lhs_2; var tmp_8 = this; // Inline function 'kotlin.collections.orEmpty' call var tmp_9 = parseResult['variants']; var tmp0_safe_receiver_0 = (!(tmp_9 == null) ? isArray(tmp_9) : false) ? tmp_9 : null; var tmp0_elvis_lhs_3 = tmp0_safe_receiver_0 == null ? null : toList(tmp0_safe_receiver_0); tmp_8.om4_1 = tmp0_elvis_lhs_3 == null ? emptyList() : tmp0_elvis_lhs_3; var tmp_10 = this; // Inline function 'kotlin.collections.orEmpty' call var tmp_11 = parseResult['extensions']; var tmp0_safe_receiver_1 = (!(tmp_11 == null) ? isArray(tmp_11) : false) ? tmp_11 : null; var tmp0_elvis_lhs_4 = tmp0_safe_receiver_1 == null ? null : toList(tmp0_safe_receiver_1); tmp_10.pm4_1 = tmp0_elvis_lhs_4 == null ? emptyList() : tmp0_elvis_lhs_4; var tmp_12 = this; // Inline function 'kotlin.collections.orEmpty' call var tmp_13 = parseResult['privateuse']; var tmp0_safe_receiver_2 = (!(tmp_13 == null) ? isArray(tmp_13) : false) ? tmp_13 : null; var tmp0_elvis_lhs_5 = tmp0_safe_receiver_2 == null ? null : toList(tmp0_safe_receiver_2); tmp_12.qm4_1 = tmp0_elvis_lhs_5 == null ? emptyList() : tmp0_elvis_lhs_5; } function parseBcpLocale(tag) { return new ParsedLocale(parse(tag)); } function SupportedLocale(locale, fileUrl) { this.rm4_1 = locale; this.sm4_1 = fileUrl; this.tm4_1 = parseBcpLocale(this.rm4_1); } protoOf(SupportedLocale).toString = function () { return 'SupportedLocale(locale=' + this.rm4_1 + ', fileUrl=' + this.sm4_1 + ')'; }; protoOf(SupportedLocale).hashCode = function () { var result = getStringHashCode(this.rm4_1); result = imul(result, 31) + getStringHashCode(this.sm4_1) | 0; return result; }; protoOf(SupportedLocale).equals = function (other) { if (this === other) return true; if (!(other instanceof SupportedLocale)) return false; var tmp0_other_with_cast = other instanceof SupportedLocale ? other : THROW_CCE(); if (!(this.rm4_1 === tmp0_other_with_cast.rm4_1)) return false; if (!(this.sm4_1 === tmp0_other_with_cast.sm4_1)) return false; return true; }; function SupportedLocales(locales) { this.um4_1 = locales; var tmp = this; // Inline function 'kotlin.collections.groupBy' call // Inline function 'kotlin.collections.groupByTo' call var this_0 = this.um4_1; var destination = LinkedHashMap_init_$Create$(); var tmp0_iterator = this_0.w(); while (tmp0_iterator.f()) { var element = tmp0_iterator.e(); // Inline function 'dev.icerock.moko.resources.internal.SupportedLocales.languageMap.' call var key = element.tm4_1.km4_1; // Inline function 'kotlin.collections.getOrPut' call var value = destination.q(key); var tmp_0; if (value == null) { // Inline function 'kotlin.collections.groupByTo.' call var answer = ArrayList_init_$Create$(); destination.s(key, answer); tmp_0 = answer; } else { tmp_0 = value; } var list = tmp_0; list.i1(element); } tmp.vm4_1 = destination; var tmp_1 = this; // Inline function 'kotlin.collections.associateBy' call var this_1 = this.um4_1; var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_1, 10)), 16); // Inline function 'kotlin.collections.associateByTo' call var destination_0 = LinkedHashMap_init_$Create$_0(capacity); var tmp0_iterator_0 = this_1.w(); while (tmp0_iterator_0.f()) { var element_0 = tmp0_iterator_0.e(); // Inline function 'dev.icerock.moko.resources.internal.SupportedLocales.localeMap.' call var tmp$ret$5 = element_0.rm4_1; destination_0.s(tmp$ret$5, element_0); } tmp_1.wm4_1 = destination_0; } protoOf(SupportedLocales).u = function () { return this.um4_1.u(); }; protoOf(SupportedLocales).xm4 = function (element) { return this.um4_1.a1(element); }; protoOf(SupportedLocales).a1 = function (element) { if (!(element instanceof SupportedLocale)) return false; return this.xm4(element instanceof SupportedLocale ? element : THROW_CCE()); }; protoOf(SupportedLocales).ym4 = function (elements) { return this.um4_1.b1(elements); }; protoOf(SupportedLocales).b1 = function (elements) { return this.ym4(elements); }; protoOf(SupportedLocales).v = function (index) { return this.um4_1.v(index); }; protoOf(SupportedLocales).zm4 = function (element) { return this.um4_1.x(element); }; protoOf(SupportedLocales).x = function (element) { if (!(element instanceof SupportedLocale)) return -1; return this.zm4(element instanceof SupportedLocale ? element : THROW_CCE()); }; protoOf(SupportedLocales).c1 = function () { return this.um4_1.c1(); }; protoOf(SupportedLocales).w = function () { return this.um4_1.w(); }; protoOf(SupportedLocales).y = function () { return this.um4_1.y(); }; protoOf(SupportedLocales).z = function (fromIndex, toIndex) { return this.um4_1.z(fromIndex, toIndex); }; function _CompiledVariableString___init__impl__gl5jz1(function_0) { return function_0; } function _get_function__m6jw1f($this) { return $this; } function CompiledVariableString__evaluate_impl_iy6o3u($this, args) { // Inline function 'kotlin.collections.mapIndexed' call // Inline function 'kotlin.collections.mapIndexedTo' call var destination = ArrayList_init_$Create$_0(args.length); var index = 0; var inductionVariable = 0; var last = args.length; while (inductionVariable < last) { var item = args[inductionVariable]; inductionVariable = inductionVariable + 1 | 0; // Inline function 'dev.icerock.moko.resources.internal.messageFormat.CompiledVariableString.evaluate.' call var tmp1 = index; index = tmp1 + 1 | 0; var tmp$ret$0 = to('' + tmp1, item); destination.i1(tmp$ret$0); } var keyValues = destination; // Inline function 'kotlin.collections.toTypedArray' call var tmp$ret$3 = copyToArray(keyValues); var json_0 = json(tmp$ret$3.slice()); return _get_function__m6jw1f($this)(json_0); } function _CompiledPlural___init__impl__m1vc38(function_0) { return function_0; } function _get_function__m6jw1f_0($this) { return $this; } function CompiledPlural__evaluate_impl_gca2wx($this, quantity, args) { // Inline function 'kotlin.arrayOf' call // Inline function 'kotlin.js.unsafeCast' call // Inline function 'kotlin.js.asDynamic' call var tmp = [to('PLURAL', quantity)]; // Inline function 'kotlin.collections.mapIndexed' call // Inline function 'kotlin.collections.mapIndexedTo' call var destination = ArrayList_init_$Create$_0(args.length); var index = 0; var inductionVariable = 0; var last = args.length; while (inductionVariable < last) { var item = args[inductionVariable]; inductionVariable = inductionVariable + 1 | 0; // Inline function 'dev.icerock.moko.resources.internal.messageFormat.CompiledPlural.evaluate.' call var tmp1 = index; index = tmp1 + 1 | 0; var tmp$ret$3 = to('' + tmp1, item); destination.i1(tmp$ret$3); } var keyValues = plus(tmp, destination); var json_0 = json(keyValues.slice()); return _get_function__m6jw1f_0($this)(json_0); } function RemoteJsStringLoader$Impl$getOrLoad$slambda$slambda(this$0, $it, resultContinuation) { this.im5_1 = this$0; this.jm5_1 = $it; CoroutineImpl.call(this, resultContinuation); } protoOf(RemoteJsStringLoader$Impl$getOrLoad$slambda$slambda).u1m = function ($this$async, $completion) { var tmp = this.v1m($this$async, $completion); tmp.jd_1 = Unit_instance; tmp.kd_1 = null; return tmp.ud(); }; protoOf(RemoteJsStringLoader$Impl$getOrLoad$slambda$slambda).he = function (p1, $completion) { return this.u1m((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion); }; protoOf(RemoteJsStringLoader$Impl$getOrLoad$slambda$slambda).ud = function () { var suspendResult = this.jd_1; $sm: do try { var tmp = this.hd_1; switch (tmp) { case 0: this.id_1 = 2; this.hd_1 = 1; suspendResult = downloadLocaleFile(this.im5_1, this.jm5_1, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; case 1: return Unit_instance; case 2: throw this.kd_1; } } catch ($p) { var e = $p; if (this.id_1 === 2) { throw e; } else { this.hd_1 = this.id_1; this.kd_1 = e; } } while (true); }; protoOf(RemoteJsStringLoader$Impl$getOrLoad$slambda$slambda).v1m = function ($this$async, completion) { var i = new RemoteJsStringLoader$Impl$getOrLoad$slambda$slambda(this.im5_1, this.jm5_1, completion); i.km5_1 = $this$async; return i; }; function RemoteJsStringLoader$Impl$getOrLoad$slambda$slambda_0(this$0, $it, resultContinuation) { var i = new RemoteJsStringLoader$Impl$getOrLoad$slambda$slambda(this$0, $it, resultContinuation); var l = function ($this$async, $completion) { return i.u1m($this$async, $completion); }; l.$arity = 1; return l; } function RemoteJsStringLoader$Impl$getOrLoad$slambda$slambda_1(this$0, resultContinuation) { this.tm5_1 = this$0; CoroutineImpl.call(this, resultContinuation); } protoOf(RemoteJsStringLoader$Impl$getOrLoad$slambda$slambda_1).u1m = function ($this$async, $completion) { var tmp = this.v1m($this$async, $completion); tmp.jd_1 = Unit_instance; tmp.kd_1 = null; return tmp.ud(); }; protoOf(RemoteJsStringLoader$Impl$getOrLoad$slambda$slambda_1).he = function (p1, $completion) { return this.u1m((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion); }; protoOf(RemoteJsStringLoader$Impl$getOrLoad$slambda$slambda_1).ud = function () { var suspendResult = this.jd_1; $sm: do try { var tmp = this.hd_1; switch (tmp) { case 0: this.id_1 = 2; this.hd_1 = 1; suspendResult = downloadFallbackFile(this.tm5_1, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; case 1: return Unit_instance; case 2: throw this.kd_1; } } catch ($p) { var e = $p; if (this.id_1 === 2) { throw e; } else { this.hd_1 = this.id_1; this.kd_1 = e; } } while (true); }; protoOf(RemoteJsStringLoader$Impl$getOrLoad$slambda$slambda_1).v1m = function ($this$async, completion) { var i = new RemoteJsStringLoader$Impl$getOrLoad$slambda$slambda_1(this.tm5_1, completion); i.um5_1 = $this$async; return i; }; function RemoteJsStringLoader$Impl$getOrLoad$slambda$slambda_2(this$0, resultContinuation) { var i = new RemoteJsStringLoader$Impl$getOrLoad$slambda$slambda_1(this$0, resultContinuation); var l = function ($this$async, $completion) { return i.u1m($this$async, $completion); }; l.$arity = 1; return l; } function loadLocalizationFile($this, fileUri, $completion) { var tmp = new $loadLocalizationFileCOROUTINE$3($this, fileUri, $completion); tmp.jd_1 = Unit_instance; tmp.kd_1 = null; return tmp.ud(); } function downloadLocaleFile($this, locale, $completion) { var tmp = new $downloadLocaleFileCOROUTINE$5($this, locale, $completion); tmp.jd_1 = Unit_instance; tmp.kd_1 = null; return tmp.ud(); } function downloadFallbackFile($this, $completion) { var tmp = new $downloadFallbackFileCOROUTINE$6($this, $completion); tmp.jd_1 = Unit_instance; tmp.kd_1 = null; return tmp.ud(); } function sam$dev_icerock_moko_resources_provider_JsStringProvider$0(function_0) { this.bm7_1 = function_0; } protoOf(sam$dev_icerock_moko_resources_provider_JsStringProvider$0).zm3 = function (id, locale) { return this.bm7_1(id, locale); }; function RemoteJsStringLoader$Impl$getOrLoad$slambda(this$0, resultContinuation) { this.lm7_1 = this$0; CoroutineImpl.call(this, resultContinuation); } protoOf(RemoteJsStringLoader$Impl$getOrLoad$slambda).nm7 = function ($this$coroutineScope, $completion) { var tmp = this.v1m($this$coroutineScope, $completion); tmp.jd_1 = Unit_instance; tmp.kd_1 = null; return tmp.ud(); }; protoOf(RemoteJsStringLoader$Impl$getOrLoad$slambda).he = function (p1, $completion) { return this.nm7((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion); }; protoOf(RemoteJsStringLoader$Impl$getOrLoad$slambda).ud = function () { var suspendResult = this.jd_1; $sm: do try { var tmp = this.hd_1; switch (tmp) { case 0: this.id_1 = 2; this.hd_1 = 1; var this_0 = this.lm7_1.om7_1; var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10)); var tmp0_iterator = this_0.w(); while (tmp0_iterator.f()) { var item = tmp0_iterator.e(); destination.i1(async(this.mm7_1, VOID, VOID, RemoteJsStringLoader$Impl$getOrLoad$slambda$slambda_0(this.lm7_1, item, null))); } suspendResult = awaitAll(plus_0(destination, async(this.mm7_1, VOID, VOID, RemoteJsStringLoader$Impl$getOrLoad$slambda$slambda_2(this.lm7_1, null))), this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; case 1: return suspendResult; case 2: throw this.kd_1; } } catch ($p) { var e = $p; if (this.id_1 === 2) { throw e; } else { this.hd_1 = this.id_1; this.kd_1 = e; } } while (true); }; protoOf(RemoteJsStringLoader$Impl$getOrLoad$slambda).v1m = function ($this$coroutineScope, completion) { var i = new RemoteJsStringLoader$Impl$getOrLoad$slambda(this.lm7_1, completion); i.mm7_1 = $this$coroutineScope; return i; }; function RemoteJsStringLoader$Impl$getOrLoad$slambda_0(this$0, resultContinuation) { var i = new RemoteJsStringLoader$Impl$getOrLoad$slambda(this$0, resultContinuation); var l = function ($this$coroutineScope, $completion) { return i.nm7($this$coroutineScope, $completion); }; l.$arity = 1; return l; } function RemoteJsStringLoader$Impl$getOrLoad$lambda(this$0) { return function (id, locale) { var tmp; if (locale == null) { tmp = null; } else { // Inline function 'kotlin.let' call // Inline function 'kotlin.contracts.contract' call // Inline function 'dev.icerock.moko.resources.provider.Impl.getOrLoad..' call tmp = this$0.qm7_1.q(locale); } var tmp1_elvis_lhs = tmp; var tmp2_elvis_lhs = tmp1_elvis_lhs == null ? this$0.rm7_1 : tmp1_elvis_lhs; var tmp_0; if (tmp2_elvis_lhs == null) { var message = 'Invalid state after download'; throw IllegalStateException_init_$Create$(toString(message)); } else { tmp_0 = tmp2_elvis_lhs; } var localeFile = tmp_0; var tmp3_safe_receiver = localeFile[id]; var tmp6_elvis_lhs = tmp3_safe_receiver == null ? null : toString(tmp3_safe_receiver); var tmp_1; if (tmp6_elvis_lhs == null) { var tmp4_safe_receiver = this$0.rm7_1; var tmp5_safe_receiver = tmp4_safe_receiver == null ? null : tmp4_safe_receiver[id]; tmp_1 = tmp5_safe_receiver == null ? null : toString(tmp5_safe_receiver); } else { tmp_1 = tmp6_elvis_lhs; } var tmp7_elvis_lhs = tmp_1; var tmp_2; if (tmp7_elvis_lhs == null) { var message_0 = id + ' string resource not found'; throw IllegalStateException_init_$Create$(toString(message_0)); } else { tmp_2 = tmp7_elvis_lhs; } return tmp_2; }; } function $loadLocalizationFileCOROUTINE$3(_this__u8e3s4, fileUri, resultContinuation) { CoroutineImpl.call(this, resultContinuation); this.dm6_1 = _this__u8e3s4; this.em6_1 = fileUri; } protoOf($loadLocalizationFileCOROUTINE$3).ud = function () { var suspendResult = this.jd_1; $sm: do try { var tmp = this.hd_1; switch (tmp) { case 0: this.id_1 = 3; this.hd_1 = 1; suspendResult = await_0(window.fetch(this.em6_1), this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; case 1: this.fm6_1 = suspendResult; if (!this.fm6_1.ok) { var message = 'response not ok for ' + this.em6_1 + ' - ' + this.fm6_1.statusText + ' ' + this.fm6_1.body; throw IllegalStateException_init_$Create$(toString(message)); } this.hd_1 = 2; suspendResult = await_0(this.fm6_1.json(), this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; case 2: var json = (suspendResult == null ? true : !(suspendResult == null)) ? suspendResult : THROW_CCE(); var tmp_0; if (json == null) { var message_0 = 'Could not read json at ' + this.em6_1; throw IllegalStateException_init_$Create$(toString(message_0)); } else { tmp_0 = json; } return tmp_0; case 3: throw this.kd_1; } } catch ($p) { var e = $p; if (this.id_1 === 3) { throw e; } else { this.hd_1 = this.id_1; this.kd_1 = e; } } while (true); }; function $getOrLoadCOROUTINE$4(_this__u8e3s4, resultContinuation) { CoroutineImpl.call(this, resultContinuation); this.am8_1 = _this__u8e3s4; } protoOf($getOrLoadCOROUTINE$4).ud = function () { var suspendResult = this.jd_1; $sm: do try { var tmp = this.hd_1; switch (tmp) { case 0: this.id_1 = 2; this.hd_1 = 1; suspendResult = coroutineScope(RemoteJsStringLoader$Impl$getOrLoad$slambda_0(this.am8_1, null), this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; case 1: var tmp_0 = RemoteJsStringLoader$Impl$getOrLoad$lambda(this.am8_1); return new sam$dev_icerock_moko_resources_provider_JsStringProvider$0(tmp_0); case 2: throw this.kd_1; } } catch ($p) { var e = $p; if (this.id_1 === 2) { throw e; } else { this.hd_1 = this.id_1; this.kd_1 = e; } } while (true); }; function $downloadLocaleFileCOROUTINE$5(_this__u8e3s4, locale, resultContinuation) { CoroutineImpl.call(this, resultContinuation); this.om6_1 = _this__u8e3s4; this.pm6_1 = locale; } protoOf($downloadLocaleFileCOROUTINE$5).ud = function () { var suspendResult = this.jd_1; $sm: do try { var tmp = this.hd_1; switch (tmp) { case 0: this.id_1 = 2; if (!(this.om6_1.qm7_1.q(this.pm6_1.rm4_1) == null)) return Unit_instance; var tmp_0 = this; tmp_0.qm6_1 = this.om6_1.qm7_1; var tmp_1 = this; tmp_1.rm6_1 = this.pm6_1.rm4_1; this.hd_1 = 1; suspendResult = loadLocalizationFile(this.om6_1, this.pm6_1.sm4_1, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; case 1: var value = suspendResult; this.qm6_1.s(this.rm6_1, value); return Unit_instance; case 2: throw this.kd_1; } } catch ($p) { var e = $p; if (this.id_1 === 2) { throw e; } else { this.hd_1 = this.id_1; this.kd_1 = e; } } while (true); }; function $downloadFallbackFileCOROUTINE$6(_this__u8e3s4, resultContinuation) { CoroutineImpl.call(this, resultContinuation); this.am7_1 = _this__u8e3s4; } protoOf($downloadFallbackFileCOROUTINE$6).ud = function () { var suspendResult = this.jd_1; $sm: do try { var tmp = this.hd_1; switch (tmp) { case 0: this.id_1 = 2; if (!(this.am7_1.rm7_1 == null)) return Unit_instance; this.hd_1 = 1; suspendResult = loadLocalizationFile(this.am7_1, this.am7_1.pm7_1, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; case 1: var ARGUMENT = suspendResult; this.am7_1.rm7_1 = ARGUMENT; return Unit_instance; case 2: throw this.kd_1; } } catch ($p) { var e = $p; if (this.id_1 === 2) { throw e; } else { this.hd_1 = this.id_1; this.kd_1 = e; } } while (true); }; function RemoteJsStringLoader$Composition$getOrLoad$slambda$slambda($it, resultContinuation) { this.jm8_1 = $it; CoroutineImpl.call(this, resultContinuation); } protoOf(RemoteJsStringLoader$Composition$getOrLoad$slambda$slambda).lm8 = function ($this$async, $completion) { var tmp = this.v1m($this$async, $completion); tmp.jd_1 = Unit_instance; tmp.kd_1 = null; return tmp.ud(); }; protoOf(RemoteJsStringLoader$Composition$getOrLoad$slambda$slambda).he = function (p1, $completion) { return this.lm8((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion); }; protoOf(RemoteJsStringLoader$Composition$getOrLoad$slambda$slambda).ud = function () { var suspendResult = this.jd_1; $sm: do try { var tmp = this.hd_1; switch (tmp) { case 0: this.id_1 = 2; this.hd_1 = 1; suspendResult = this.jm8_1.mm8(this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; case 1: return suspendResult; case 2: throw this.kd_1; } } catch ($p) { var e = $p; if (this.id_1 === 2) { throw e; } else { this.hd_1 = this.id_1; this.kd_1 = e; } } while (true); }; protoOf(RemoteJsStringLoader$Composition$getOrLoad$slambda$slambda).v1m = function ($this$async, completion) { var i = new RemoteJsStringLoader$Composition$getOrLoad$slambda$slambda(this.jm8_1, completion); i.km8_1 = $this$async; return i; }; function RemoteJsStringLoader$Composition$getOrLoad$slambda$slambda_0($it, resultContinuation) { var i = new RemoteJsStringLoader$Composition$getOrLoad$slambda$slambda($it, resultContinuation); var l = function ($this$async, $completion) { return i.lm8($this$async, $completion); }; l.$arity = 1; return l; } function RemoteJsStringLoader$Composition$getOrLoad$slambda(this$0, resultContinuation) { this.vm8_1 = this$0; CoroutineImpl.call(this, resultContinuation); } protoOf(RemoteJsStringLoader$Composition$getOrLoad$slambda).xm8 = function ($this$coroutineScope, $completion) { var tmp = this.v1m($this$coroutineScope, $completion); tmp.jd_1 = Unit_instance; tmp.kd_1 = null; return tmp.ud(); }; protoOf(RemoteJsStringLoader$Composition$getOrLoad$slambda).he = function (p1, $completion) { return this.xm8((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion); }; protoOf(RemoteJsStringLoader$Composition$getOrLoad$slambda).ud = function () { var suspendResult = this.jd_1; $sm: do try { var tmp = this.hd_1; switch (tmp) { case 0: this.id_1 = 2; this.hd_1 = 1; var this_0 = this.vm8_1.ym8_1; var destination = ArrayList_init_$Create$_0(collectionSizeOrDefault(this_0, 10)); var tmp0_iterator = this_0.w(); while (tmp0_iterator.f()) { var item = tmp0_iterator.e(); destination.i1(async(this.wm8_1, VOID, VOID, RemoteJsStringLoader$Composition$getOrLoad$slambda$slambda_0(item, null))); } suspendResult = awaitAll(destination, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; case 1: return suspendResult; case 2: throw this.kd_1; } } catch ($p) { var e = $p; if (this.id_1 === 2) { throw e; } else { this.hd_1 = this.id_1; this.kd_1 = e; } } while (true); }; protoOf(RemoteJsStringLoader$Composition$getOrLoad$slambda).v1m = function ($this$coroutineScope, completion) { var i = new RemoteJsStringLoader$Composition$getOrLoad$slambda(this.vm8_1, completion); i.wm8_1 = $this$coroutineScope; return i; }; function RemoteJsStringLoader$Composition$getOrLoad$slambda_0(this$0, resultContinuation) { var i = new RemoteJsStringLoader$Composition$getOrLoad$slambda(this$0, resultContinuation); var l = function ($this$coroutineScope, $completion) { return i.xm8($this$coroutineScope, $completion); }; l.$arity = 1; return l; } function $getOrLoadCOROUTINE$7(_this__u8e3s4, resultContinuation) { CoroutineImpl.call(this, resultContinuation); this.hm9_1 = _this__u8e3s4; } protoOf($getOrLoadCOROUTINE$7).ud = function () { var suspendResult = this.jd_1; $sm: do try { var tmp = this.hd_1; switch (tmp) { case 0: this.id_1 = 2; this.hd_1 = 1; suspendResult = coroutineScope(RemoteJsStringLoader$Composition$getOrLoad$slambda_0(this.hm9_1, null), this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; case 1: var providers = suspendResult; var iterator = providers.w(); if (!iterator.f()) throw UnsupportedOperationException_init_$Create$("Empty collection can't be reduced."); var accumulator = iterator.e(); while (iterator.f()) { var acc = accumulator; var jsStringProvider = iterator.e(); accumulator = acc.cm7(jsStringProvider); } return accumulator; case 2: throw this.kd_1; } } catch ($p) { var e = $p; if (this.id_1 === 2) { throw e; } else { this.hd_1 = this.id_1; this.kd_1 = e; } } while (true); }; function Impl(supportedLocales, fallbackFileUri) { this.om7_1 = supportedLocales; this.pm7_1 = fallbackFileUri; var tmp = this; // Inline function 'kotlin.collections.mutableMapOf' call tmp.qm7_1 = LinkedHashMap_init_$Create$(); this.rm7_1 = null; } protoOf(Impl).mm8 = function ($completion) { var tmp = new $getOrLoadCOROUTINE$4(this, $completion); tmp.jd_1 = Unit_instance; tmp.kd_1 = null; return tmp.ud(); }; function Composition(loaders) { this.ym8_1 = loaders; } protoOf(Composition).mm8 = function ($completion) { var tmp = new $getOrLoadCOROUTINE$7(this, $completion); tmp.jd_1 = Unit_instance; tmp.kd_1 = null; return tmp.ud(); }; function RemoteJsStringLoader() { } function sam$dev_icerock_moko_resources_provider_JsStringProvider$0_0(function_0) { this.jm9_1 = function_0; } protoOf(sam$dev_icerock_moko_resources_provider_JsStringProvider$0_0).zm3 = function (id, locale) { return this.jm9_1(id, locale); }; function JsStringProvider$plus$lambda(this$0, $other) { return function (id, locale) { // Inline function 'kotlin.getOrThrow' call // Inline function 'kotlin.recover' call // Inline function 'kotlin.runCatching' call var this_0 = this$0; var tmp; try { // Inline function 'kotlin.Companion.success' call // Inline function 'dev.icerock.moko.resources.provider.JsStringProvider.plus..' call var value = this_0.zm3(id, locale); tmp = _Result___init__impl__xyqfz8(value); } catch ($p) { var tmp_0; if ($p instanceof Error) { var e = $p; // Inline function 'kotlin.Companion.failure' call tmp_0 = _Result___init__impl__xyqfz8(createFailure(e)); } else { throw $p; } tmp = tmp_0; } var this_1 = tmp; // Inline function 'kotlin.contracts.contract' call var exception = Result__exceptionOrNull_impl_p6xea9(this_1); var tmp_1; if (exception == null) { tmp_1 = this_1; } else { // Inline function 'kotlin.Companion.success' call // Inline function 'dev.icerock.moko.resources.provider.JsStringProvider.plus..' call var value_0 = $other.zm3(id, locale); tmp_1 = _Result___init__impl__xyqfz8(value_0); } var this_2 = tmp_1; throwOnFailure(this_2); var tmp_2 = _Result___get_value__impl__bjfvqg(this_2); return (tmp_2 == null ? true : !(tmp_2 == null)) ? tmp_2 : THROW_CCE(); }; } function JsStringProvider() { } //region block: post-declaration protoOf(sam$dev_icerock_moko_resources_provider_JsStringProvider$0).cm7 = plus_1; protoOf(Impl).im9 = plus_2; protoOf(Composition).im9 = plus_2; protoOf(sam$dev_icerock_moko_resources_provider_JsStringProvider$0_0).cm7 = plus_1; //endregion //region block: init cachedLocale = null; //endregion //region block: exports _.$_$ = _.$_$ || {}; _.$_$.a = SupportedLocales; _.$_$.b = SupportedLocale; _.$_$.c = JsStringProvider; _.$_$.d = Impl; _.$_$.e = PluralsResource; _.$_$.f = StringResource; _.$_$.g = format; //endregion return _; }(module.exports, require('@messageformat/core'), require('bcp-47'), require('./kotlin-kotlin-stdlib.js'), require('./kotlinx-coroutines-core.js'))); //# sourceMappingURL=moko-resources-resources.js.map