@solibo/solibo-sdk 1.55.0 → 1.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoAesCbc.mjs +1 -1
  2. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoAesCtr.mjs +1 -1
  3. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoAesGcm.mjs +1 -1
  4. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoEcdh.mjs +3 -3
  5. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoEcdsa.mjs +3 -3
  6. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoEdDsa.mjs +2 -2
  7. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoHmac.mjs +1 -1
  8. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoRsaOaep.mjs +3 -3
  9. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoRsaPkcs1.mjs +3 -3
  10. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoRsaPss.mjs +3 -3
  11. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoXdh.mjs +2 -2
  12. package/ktor-ktor-client-auth/io/ktor/client/plugins/auth/Auth.mjs +1 -1
  13. package/ktor-ktor-client-encoding/io/ktor/client/plugins/compression/ContentEncoding.mjs +1 -1
  14. package/package.json +1 -1
  15. package/solibo-cycles/cryptography-kotlin-cryptography-serialization-asn1-modules-3.mjs +3 -3
  16. package/solibo-cycles/kotlinx-coroutines-core-16.mjs +13 -13
  17. package/solibo-cycles/solibo-sdk-sdk-api-document-39.mjs +1 -1
  18. package/solibo-cycles/solibo-sdk-sdk-core-52.mjs +1 -1
  19. package/solibo-cycles/solibo-sdk-sdk-core-53.mjs +1305 -775
  20. package/solibo-sdk-sdk/no/solibo/oss/sdk/SoliboSDK.mjs +1 -1
  21. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/infrastructure/ApiClient.mjs +1 -1
  22. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/infrastructure/HttpResponse.mjs +2 -2
  23. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/telemetry/SoliboOpenTelemetry.mjs +1 -1
@@ -106,7 +106,8 @@ import {
106
106
  import {
107
107
  initMetadataForClassbxx6q50dy2s7 as initMetadataForClass2,
108
108
  initMetadataForLambda3af3he42mmnh as initMetadataForLambda,
109
- initMetadataForCoroutine1i7lbatuf5bnt as initMetadataForCoroutine
109
+ initMetadataForCoroutine1i7lbatuf5bnt as initMetadataForCoroutine,
110
+ initMetadataForObject1cxne3s9w65el as initMetadataForObject
110
111
  } from "../kotlin-kotlin-stdlib/kotlin/js/metadataUtils.mjs";
111
112
  import { VOID3gxj6tk5isa35 as VOID2 } from "../kotlin-kotlin-stdlib/kotlin/js/void.mjs";
112
113
  import {
@@ -130,12 +131,37 @@ import {
130
131
  getPropertyCallableRef3hckxc0xueiaj as getPropertyCallableRef,
131
132
  constructCallableReference23y65rf941mch as constructCallableReference
132
133
  } from "../kotlin-kotlin-stdlib/kotlin/js/reflectRuntime.mjs";
134
+ import { get_ContentNegotiationcp59ye9rorjc as get_ContentNegotiation } from "../ktor-ktor-client-content-negotiation/io/ktor/client/plugins/contentnegotiation/ContentNegotiation.mjs";
135
+ import {
136
+ Companion_getInstance1bfe8d81dxwpf as Companion_getInstance,
137
+ InvalidCacheStateException1l4ckerh5nyw0 as InvalidCacheStateException
138
+ } from "../ktor-ktor-client-core/io/ktor/client/plugins/cache/HttpCache.mjs";
139
+ import { get_ContentEncoding3ntb7mwovz4dd as get_ContentEncoding } from "../ktor-ktor-client-encoding/io/ktor/client/plugins/compression/ContentEncoding.mjs";
140
+ import { createClientPlugin16sdkdabbewya as createClientPlugin } from "../ktor-ktor-client-core/io/ktor/client/plugins/api/CreatePluginUtils.mjs";
141
+ import { get_HttpRequestRetry3m7x7jck45t4l as get_HttpRequestRetry } from "../ktor-ktor-client-core/io/ktor/client/plugins/HttpRequestRetry.mjs";
142
+ import { get_HttpTimeout3mcrbvfnvmyx2 as get_HttpTimeout } from "../ktor-ktor-client-core/io/ktor/client/plugins/HttpTimeout.mjs";
143
+ import { get_Logging1ff3305q4akdl as get_Logging } from "../ktor-ktor-client-logging/io/ktor/client/plugins/logging/Logging.mjs";
144
+ import { HttpResponseValidator2d6ie1tmzg8fi as HttpResponseValidator } from "../ktor-ktor-client-core/io/ktor/client/plugins/HttpCallValidator.mjs";
145
+ import { Companion_getInstance3sv9we9u8xpgw as Companion_getInstance_0 } from "../ktor-ktor-client-core/io/ktor/client/plugins/cookies/HttpCookies.mjs";
146
+ import {
147
+ get_Auth3auwb1dqcwarr as get_Auth,
148
+ get_authProviders394nbziurer3k as get_authProviders
149
+ } from "../ktor-ktor-client-auth/io/ktor/client/plugins/auth/Auth.mjs";
150
+ import { defaultRequest2ux1d5xxixv6z as defaultRequest } from "../ktor-ktor-client-core/io/ktor/client/plugins/DefaultRequest.mjs";
151
+ import {
152
+ applyPlatformSpecificHttpClientConfig1gb1eu2dk30og as applyPlatformSpecificHttpClientConfig,
153
+ isSkippableNetworkIssue1zt4c3u1b3vwf as isSkippableNetworkIssue
154
+ } from "../solibo-sdk-sdk-core/no/solibo/oss/sdk/HttpClientConfig.js.mjs";
133
155
  import {
134
156
  CancellationException_init_$Create$1flhbcsrur0zx as CancellationException_init_$Create$,
135
157
  CancellationException3b36o9qz53rgr as CancellationException,
136
158
  CancellationException_init_$Create$6nn2czcftw2s as CancellationException_init_$Create$_0
137
159
  } from "../kotlin-kotlin-stdlib/kotlin/coroutines/cancellation/CancellationException.mjs";
138
- import { cancel36mj9lv3a0whl as cancel } from "../kotlinx-coroutines-core/kotlinx/coroutines/CoroutineScope.mjs";
160
+ import {
161
+ cancel36mj9lv3a0whl as cancel,
162
+ CoroutineScopefcb5f5dwqcas as CoroutineScope,
163
+ CoroutineScopelux7s7zphw7e as CoroutineScope_0
164
+ } from "../kotlinx-coroutines-core/kotlinx/coroutines/CoroutineScope.mjs";
139
165
  import {
140
166
  get_request3dwcif5y0fvf1 as get_request,
141
167
  HttpResponse1532ob1hsse1y as HttpResponse,
@@ -157,10 +183,6 @@ import {
157
183
  SoliboOpenTelemetry_instance311c62vmt8t4e as SoliboOpenTelemetry_instance,
158
184
  httpSpanName1r9iw3ou0ys47 as httpSpanName
159
185
  } from "../solibo-sdk-sdk-core/no/solibo/oss/sdk/telemetry/SoliboOpenTelemetry.mjs";
160
- import {
161
- get_Auth3auwb1dqcwarr as get_Auth,
162
- get_authProviders394nbziurer3k as get_authProviders
163
- } from "../ktor-ktor-client-auth/io/ktor/client/plugins/auth/Auth.mjs";
164
186
  import { plugin3vxt624hnu3pv as plugin } from "../ktor-ktor-client-core/io/ktor/client/plugins/HttpClientPlugin.mjs";
165
187
  import {
166
188
  ArrayList_init_$Create$2xrifdqz5xirg as ArrayList_init_$Create$,
@@ -190,8 +212,38 @@ import {
190
212
  split3d3yeauc4rm2n as split_0,
191
213
  removePrefix279df90bhrqqg as removePrefix
192
214
  } from "../kotlin-kotlin-stdlib/kotlin/text/Strings.mjs";
215
+ import { JsonObjectBuilder2nl6rv6vdayuk as JsonObjectBuilder } from "../kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/JsonElementBuilders.mjs";
216
+ import {
217
+ JsonPrimitiveolttw629wj53 as JsonPrimitive,
218
+ JsonObjectee06ihoeeiqj as JsonObject,
219
+ JsonElementf07o4p6p57al as JsonElement,
220
+ get_jsonObject2u4z2ch1uuca9 as get_jsonObject,
221
+ get_jsonPrimitivez17tyd5rw1ql as get_jsonPrimitive,
222
+ JsonArray2urf8ey7u44sd as JsonArray,
223
+ JsonPrimitive3ttzjh2ft5dnx as JsonPrimitive_0,
224
+ get_contentOrNull35s97cgi8z9eo as get_contentOrNull,
225
+ JsonNull_getInstance1i1hv1sbjynto as JsonNull_getInstance,
226
+ JsonNull2liwjj96vm0w2 as JsonNull
227
+ } from "../kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/JsonElement.mjs";
228
+ import { Default_getInstance3483fw4bkmewo as Default_getInstance2 } from "../kotlin-kotlin-stdlib/kotlin/io/encoding/Base64.mjs";
229
+ import { Default_getInstancevb13yk0g3h3e as Default_getInstance_0 } from "../kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/Json.mjs";
230
+ import {
231
+ getKClass3t8tygqu4lcxf as getKClass,
232
+ getKClassFromExpression348iqjl4fnx2f as getKClassFromExpression
233
+ } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/reflection.mjs";
234
+ import {
235
+ arrayOf1akklvh2at202 as arrayOf,
236
+ toString30pk9tzaqopn as toString_0
237
+ } from "../kotlin-kotlin-stdlib/kotlin/Library.mjs";
238
+ import { createKType31ecntyyaay3k as createKType } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/KTypeHelpers.mjs";
239
+ import { serializer1i4e9ym37oxmo as serializer } from "../kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/Serializers.mjs";
240
+ import { KSerializerzf77vz1967fq as KSerializer } from "../kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/KSerializer.mjs";
241
+ import {
242
+ isInterface3d6p8outrmvmk as isInterface,
243
+ isCharSequence1ju9jr1w86plq as isCharSequence
244
+ } from "../kotlin-kotlin-stdlib/kotlin/js/typeCheckUtils.mjs";
245
+ import { toByteArray1i3ns5jnoqlv6 as toByteArray } from "../ktor-ktor-io/io/ktor/utils/io/core/Strings.mjs";
193
246
  import { CoroutineImpl2sn3kjnwmfr10 as CoroutineImpl } from "../kotlin-kotlin-stdlib/kotlin/coroutines/CoroutineImpl.mjs";
194
- import { get_ContentNegotiationcp59ye9rorjc as get_ContentNegotiation } from "../ktor-ktor-client-content-negotiation/io/ktor/client/plugins/contentnegotiation/ContentNegotiation.mjs";
195
247
  import { get_sdkJsonn3cnvlthwtjo as get_sdkJson } from "../solibo-sdk-sdk-core/no/solibo/oss/sdk/api/SdkJson.mjs";
196
248
  import { streamingJson1bcvc4ysdxzdg as streamingJson } from "../solibo-sdk-sdk-core/no/solibo/oss/sdk/api/StreamingJsonConverter.mjs";
197
249
  import { HttpClient3584jcajl7sef as HttpClient } from "../ktor-ktor-client-core/io/ktor/client/HttpClient.web.mjs";
@@ -216,48 +268,12 @@ import {
216
268
  Ok_getInstance2tnrifcx0546k as Ok_getInstance,
217
269
  Error2ro0zi7eg1yp3 as Error_0
218
270
  } from "../opentelemetry-kotlin-api/io/opentelemetry/kotlin/tracing/StatusData.mjs";
219
- import {
220
- getKClassFromExpression348iqjl4fnx2f as getKClassFromExpression,
221
- getKClass3t8tygqu4lcxf as getKClass
222
- } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/reflection.mjs";
223
271
  import { ClientEngineClosedException1qtw9cl0kd5fk as ClientEngineClosedException } from "../ktor-ktor-client-core/io/ktor/client/engine/HttpClientEngineBase.mjs";
224
- import {
225
- InvalidCacheStateException1l4ckerh5nyw0 as InvalidCacheStateException,
226
- Companion_getInstance1bfe8d81dxwpf as Companion_getInstance
227
- } from "../ktor-ktor-client-core/io/ktor/client/plugins/cache/HttpCache.mjs";
228
- import {
229
- isSkippableNetworkIssue1zt4c3u1b3vwf as isSkippableNetworkIssue,
230
- applyPlatformSpecificHttpClientConfig1gb1eu2dk30og as applyPlatformSpecificHttpClientConfig
231
- } from "../solibo-sdk-sdk-core/no/solibo/oss/sdk/HttpClientConfig.js.mjs";
232
272
  import { ConnectTimeoutException35w4gpuoa1015 as ConnectTimeoutException } from "../ktor-ktor-client-core/io/ktor/client/network/sockets/TimeoutExceptions.nonJvm.mjs";
233
273
  import { isCacheIssue1gjd9j9vgkhdx as isCacheIssue } from "../solibo-sdk-sdk-core/no/solibo/oss/sdk/HttpClientConfig.mjs";
234
- import { Companion_getInstanceu2wrlss616lb as Companion_getInstance_0 } from "../ktor-ktor-http/io/ktor/http/HttpStatusCode.mjs";
274
+ import { Companion_getInstanceu2wrlss616lb as Companion_getInstance_1 } from "../ktor-ktor-http/io/ktor/http/HttpStatusCode.mjs";
235
275
  import { Application_getInstance3vhi2qmce4cj0 as Application_getInstance } from "../ktor-ktor-http/io/ktor/http/ContentTypes.mjs";
236
276
  import { TextContent1rb6ftlpvl1d2 as TextContent } from "../ktor-ktor-http/io/ktor/http/content/TextContent.mjs";
237
- import { Default_getInstancevb13yk0g3h3e as Default_getInstance2 } from "../kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/Json.mjs";
238
- import {
239
- JsonElementf07o4p6p57al as JsonElement,
240
- get_jsonObject2u4z2ch1uuca9 as get_jsonObject,
241
- get_jsonPrimitivez17tyd5rw1ql as get_jsonPrimitive,
242
- JsonPrimitiveolttw629wj53 as JsonPrimitive,
243
- JsonObjectee06ihoeeiqj as JsonObject,
244
- JsonArray2urf8ey7u44sd as JsonArray,
245
- JsonPrimitive3ttzjh2ft5dnx as JsonPrimitive_0,
246
- get_contentOrNull35s97cgi8z9eo as get_contentOrNull,
247
- JsonNull_getInstance1i1hv1sbjynto as JsonNull_getInstance,
248
- JsonNull2liwjj96vm0w2 as JsonNull
249
- } from "../kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/JsonElement.mjs";
250
- import {
251
- arrayOf1akklvh2at202 as arrayOf,
252
- toString30pk9tzaqopn as toString_0
253
- } from "../kotlin-kotlin-stdlib/kotlin/Library.mjs";
254
- import { createKType31ecntyyaay3k as createKType } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/KTypeHelpers.mjs";
255
- import { serializer1i4e9ym37oxmo as serializer } from "../kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/Serializers.mjs";
256
- import { KSerializerzf77vz1967fq as KSerializer } from "../kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/KSerializer.mjs";
257
- import {
258
- isInterface3d6p8outrmvmk as isInterface,
259
- isCharSequence1ju9jr1w86plq as isCharSequence
260
- } from "../kotlin-kotlin-stdlib/kotlin/js/typeCheckUtils.mjs";
261
277
  import { TypeInfo2nbxsuf4v8os2 as TypeInfo } from "../ktor-ktor-utils/io/ktor/util/reflect/Type.mjs";
262
278
  import {
263
279
  OutgoingContent3t2ohmyam9o76 as OutgoingContent,
@@ -274,24 +290,17 @@ import {
274
290
  toIntOrNull3w2d066r9pvwm as toIntOrNull
275
291
  } from "../kotlin-kotlin-stdlib/kotlin/text/StringNumberConversions.mjs";
276
292
  import {
277
- Companion_getInstance2jahap30xtp3t as Companion_getInstance_1,
293
+ Companion_getInstance2jahap30xtp3t as Companion_getInstance_2,
278
294
  toDurationba1nlt78o6vu as toDuration
279
295
  } from "../kotlin-kotlin-stdlib/kotlin/time/Duration.mjs";
280
296
  import { coerceAtMostmgknbongtqt as coerceAtMost } from "../kotlin-kotlin-stdlib/kotlin/ranges/_Ranges.mjs";
281
297
  import { DurationUnit_MILLISECONDS_getInstancedq9xrzm1t8sm as DurationUnit_MILLISECONDS_getInstance } from "../kotlin-kotlin-stdlib/kotlin/time/DurationUnitJs.mjs";
282
298
  import { delay2kng7ucb3aj62 as delay } from "../kotlinx-coroutines-core/kotlinx/coroutines/Delay.mjs";
299
+ import { OnRequestContext1tmu5b6bhlblg as OnRequestContext } from "../ktor-ktor-client-core/io/ktor/client/plugins/api/KtorCallContexts.mjs";
283
300
  import {
284
301
  contentType2zzm38yxo3syt as contentType,
285
302
  contentType1lwcfjsjo0z8g as contentType_0
286
303
  } from "../ktor-ktor-http/io/ktor/http/HttpMessageProperties.mjs";
287
- import { get_ContentEncoding3ntb7mwovz4dd as get_ContentEncoding } from "../ktor-ktor-client-encoding/io/ktor/client/plugins/compression/ContentEncoding.mjs";
288
- import { createClientPlugin16sdkdabbewya as createClientPlugin } from "../ktor-ktor-client-core/io/ktor/client/plugins/api/CreatePluginUtils.mjs";
289
- import { get_HttpRequestRetry3m7x7jck45t4l as get_HttpRequestRetry } from "../ktor-ktor-client-core/io/ktor/client/plugins/HttpRequestRetry.mjs";
290
- import { get_HttpTimeout3mcrbvfnvmyx2 as get_HttpTimeout } from "../ktor-ktor-client-core/io/ktor/client/plugins/HttpTimeout.mjs";
291
- import { get_Logging1ff3305q4akdl as get_Logging } from "../ktor-ktor-client-logging/io/ktor/client/plugins/logging/Logging.mjs";
292
- import { HttpResponseValidator2d6ie1tmzg8fi as HttpResponseValidator } from "../ktor-ktor-client-core/io/ktor/client/plugins/HttpCallValidator.mjs";
293
- import { Companion_getInstance3sv9we9u8xpgw as Companion_getInstance_2 } from "../ktor-ktor-client-core/io/ktor/client/plugins/cookies/HttpCookies.mjs";
294
- import { defaultRequest2ux1d5xxixv6z as defaultRequest } from "../ktor-ktor-client-core/io/ktor/client/plugins/DefaultRequest.mjs";
295
304
  import { create4nmnqph2mac5 as create_0 } from "../solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/client/apis/LanguageApi.mjs";
296
305
  import { DeviceClientr535roaxziw3 as DeviceClient } from "../solibo-sdk-sdk-core/no/solibo/oss/sdk/api/DeviceClient.mjs";
297
306
  import { to2cs3ny02qtbcb as to } from "../kotlin-kotlin-stdlib/kotlin/Tuples.mjs";
@@ -315,17 +324,18 @@ import {
315
324
  promisify1z0ncraq1ipzh as promisify
316
325
  } from "../kotlin-kotlin-stdlib/kotlin/coroutines/intrinsics/IntrinsicsJs.mjs";
317
326
  import { RefreshTokensCommandztwx87d5xein as RefreshTokensCommand } from "../solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/RefreshTokensCommand.mjs";
327
+ import { asyncz02dsa2nb2zt as async } from "../kotlinx-coroutines-core/kotlinx/coroutines/Builders.common.mjs";
328
+ import { ensureActive2yo7199srjlgl as ensureActive } from "../kotlinx-coroutines-core/kotlinx/coroutines/Job.mjs";
318
329
  import { System_instance34rnn1q53nv02 as System_instance } from "../kotlin-kotlin-stdlib/kotlin/time/Clock.mjs";
330
+ import { CreateM2MTokensCommand1xk42u28kt1rf as CreateM2MTokensCommand } from "../solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/CreateM2MTokensCommand.mjs";
319
331
  import { logging1pv029acsuob8 as logging } from "../KmLogging-logging/com/diamondedge/logging/KmLog.mjs";
320
332
  import { KmLogging_getInstancejhqg1dgk26qj as KmLogging_getInstance } from "../KmLogging-logging/com/diamondedge/logging/KmLogging.mjs";
321
- import { JsonObjectBuilder2nl6rv6vdayuk as JsonObjectBuilder } from "../kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/JsonElementBuilders.mjs";
322
- import { Default_getInstance3483fw4bkmewo as Default_getInstance_0 } from "../kotlin-kotlin-stdlib/kotlin/io/encoding/Base64.mjs";
323
- import { toByteArray1i3ns5jnoqlv6 as toByteArray } from "../ktor-ktor-io/io/ktor/utils/io/core/Strings.mjs";
324
- import { CreateM2MTokensCommand1xk42u28kt1rf as CreateM2MTokensCommand } from "../solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/CreateM2MTokensCommand.mjs";
325
333
  import { RevokeTokensCommandjzkwsn1evbj4 as RevokeTokensCommand } from "../solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/RevokeTokensCommand.mjs";
326
334
  import { AtomicReferencef8ccdw84nrc3 as AtomicReference } from "../kotlin-kotlin-stdlib/kotlin/concurrent/atomics/Atomics.js.mjs";
327
335
  import { lazy2hsh8ze7j6ikd as lazy } from "../kotlin-kotlin-stdlib/kotlin/kotlin.mjs";
328
336
  import { Mutex16li1l0asjv17 as Mutex } from "../kotlinx-coroutines-core/kotlinx/coroutines/sync/Mutex.mjs";
337
+ import { SupervisorJobythnfxkr3jxc as SupervisorJob } from "../kotlinx-coroutines-core/kotlinx/coroutines/Supervisor.mjs";
338
+ import { Dispatchers_getInstance128lm494a5r5s as Dispatchers_getInstance } from "../kotlinx-coroutines-core/kotlinx/coroutines/Dispatchers.mjs";
329
339
  import { Companion_getInstance1ud9wab8nnxdr as Companion_getInstance_3 } from "../ktor-ktor-client-core/io/ktor/client/plugins/cache/storage/HttpCacheStorage.mjs";
330
340
  import { InvalidatingCacheStorage26tkv6xulzygd as InvalidatingCacheStorage } from "../solibo-sdk-sdk-core/no/solibo/oss/sdk/api/InvalidatingCacheStorage.mjs";
331
341
  import { PrimitiveClasses_getInstance13wbaztpz3e2d as PrimitiveClasses_getInstance } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/primitives.mjs";
@@ -341,6 +351,7 @@ import { EventBusConnection1jwjvps2rpjnm as EventBusConnection } from "../solibo
341
351
  import { collectionSizeOrDefault36dulx8yinfqm as collectionSizeOrDefault } from "../kotlin-kotlin-stdlib/kotlin/collections/Iterables.mjs";
342
352
  import { Companion_getInstance29j9s2wnmk34z as Companion_getInstance_4 } from "../ktor-ktor-http/io/ktor/http/HttpMethod.mjs";
343
353
  import { Collection1k04j3hzsbod0 as Collection } from "../kotlin-kotlin-stdlib/kotlin/collections/Collections.mjs";
354
+ import { AbstractCoroutineContextElement2rpehg0hv5szw as AbstractCoroutineContextElement } from "../kotlin-kotlin-stdlib/kotlin/coroutines/CoroutineContextImpl.mjs";
344
355
  import { setOf45ia9pnfhe90 as setOf } from "../kotlin-kotlin-stdlib/kotlin/collections/Sets.mjs";
345
356
  import { __soliboBoundaryState, __soliboRegisterLookup, __soliboRegisterOwnFields, __soliboToJs, __soliboToKt, __soliboWrapAccessor, __soliboWrapFunction, __soliboWrapMethod } from "../solibo-boundary.mjs";
346
357
  import { FailureKindfp4d0zgfem0j as __soliboType_FailureKind } from "../solibo-sdk-sdk-core/no/solibo/oss/sdk/telemetry/FailureClassification.mjs";
@@ -665,7 +676,7 @@ function static_init_0() {
665
676
  var OriginRevoke_REVOKED_instance;
666
677
  var OriginRevoke_TRANSIENT_instance;
667
678
  var OriginRevoke_REFUSED_instance;
668
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda$lambda($request, $route, $path) {
679
+ function HomeApiBase$configureClient$lambda$slambda$lambda($request, $route, $path) {
669
680
  return function($this$startSpan) {
670
681
  $this$startSpan.setStringAttribute_3st4vt_k$("http.request.method", $request.method_1.value_1);
671
682
  $this$startSpan.setStringAttribute_3st4vt_k$("url.template", $route);
@@ -685,6 +696,39 @@ function _get_authM2M__c6rkbz($this) {
685
696
  getPropertyCallableRef("authM2M", 1, tmp, HomeApiBase$_get_authM2M_$ref_69s5d4(), null);
686
697
  return tmp0.get_value_j01efc_k$();
687
698
  }
699
+ function configureClient($this, $receiver, renewsSession) {
700
+ var tmp = get_ContentNegotiation();
701
+ $receiver.install_6m4asv_k$(tmp, HomeApiBase$configureClient$lambda);
702
+ var tmp_0 = Companion_getInstance();
703
+ $receiver.install_6m4asv_k$(tmp_0, HomeApiBase$configureClient$lambda_0($this));
704
+ var tmp_1 = get_ContentEncoding();
705
+ $receiver.install_6m4asv_k$(tmp_1, HomeApiBase$configureClient$lambda_1);
706
+ $receiver.install$default_lc5jjj_k$(createClientPlugin("SoliboTracing", HomeApiBase$configureClient$lambda_2));
707
+ var tmp_2 = get_HttpRequestRetry();
708
+ $receiver.install_6m4asv_k$(tmp_2, HomeApiBase$configureClient$lambda_3($this));
709
+ $receiver.install$default_lc5jjj_k$(createClientPlugin("EndFailedAttempts", HomeApiBase$configureClient$lambda_4));
710
+ var tmp_3 = get_HttpTimeout();
711
+ $receiver.install_6m4asv_k$(tmp_3, HomeApiBase$configureClient$lambda_5);
712
+ $receiver.install$default_lc5jjj_k$(createClientPlugin("RemoveEmptyFields", HomeApiBase$configureClient$lambda_6));
713
+ var tmp_4 = get_Logging();
714
+ $receiver.install_6m4asv_k$(tmp_4, HomeApiBase$configureClient$lambda_7);
715
+ HttpResponseValidator($receiver, HomeApiBase$configureClient$lambda_8($this));
716
+ $receiver.install$default_lc5jjj_k$(createClientPlugin("M2MAuth", HomeApiBase$configureClient$lambda_9($this)));
717
+ $receiver.install$default_lc5jjj_k$(createClientPlugin("RateLimitRetry", HomeApiBase$configureClient$lambda_10($this)));
718
+ if ($this.authMode.equals(AuthMode_TOKEN_getInstance()) && renewsSession) {
719
+ var tmp_5 = get_Auth();
720
+ $receiver.install_6m4asv_k$(tmp_5, HomeApiBase$configureClient$lambda_11($this));
721
+ } else if ($this.authMode.equals(AuthMode_TOKEN_getInstance())) {
722
+ $receiver.install$default_lc5jjj_k$(createClientPlugin("RefreshBearer", HomeApiBase$configureClient$lambda_12($this)));
723
+ } else if (!$this.authMode.equals(AuthMode_M2M_getInstance())) {
724
+ $receiver.install$default_lc5jjj_k$(Companion_getInstance_0());
725
+ $receiver.install$default_lc5jjj_k$(createClientPlugin("CookieSessionRefresh", HomeApiBase$configureClient$lambda_13($this)));
726
+ }
727
+ var platformName = new (Platform())().name_1;
728
+ defaultRequest($receiver, HomeApiBase$configureClient$lambda_14($this, platformName));
729
+ applyPlatformSpecificHttpClientConfig($receiver);
730
+ $this.configurator_1($receiver);
731
+ }
688
732
  function release($this, $receiver) {
689
733
  cancel($receiver.get_response_xlk07e_k$(), CancellationException_init_$Create$("The request is sent again"));
690
734
  }
@@ -817,10 +861,58 @@ function refreshSession($this, oldTokens, $completion) {
817
861
  tmp.exception_1 = null;
818
862
  return tmp.doResume_5yljmg_k$();
819
863
  }
864
+ function sharedRefresh($this, renew, $completion) {
865
+ var tmp = new ($sharedRefreshCOROUTINE$())($this, renew, $completion);
866
+ tmp.result_1 = Unit_instance2;
867
+ tmp.exception_1 = null;
868
+ return tmp.doResume_5yljmg_k$();
869
+ }
870
+ function machineTokens($this, $completion) {
871
+ var tmp = new ($machineTokensCOROUTINE$())($this, $completion);
872
+ tmp.result_1 = Unit_instance2;
873
+ tmp.exception_1 = null;
874
+ return tmp.doResume_5yljmg_k$();
875
+ }
876
+ function bearerEnvelope($this, tokens) {
877
+ var builder = new (JsonObjectBuilder())();
878
+ builder.put_mrde5n_k$("accessToken", JsonPrimitive(tokens.accessToken));
879
+ builder.put_mrde5n_k$("identity", JsonPrimitive(tokens.identity));
880
+ builder.put_mrde5n_k$("data", JsonPrimitive(tokens.data));
881
+ var envelope = builder.build_bkh6qh_k$();
882
+ var tmp = Default_getInstance2().UrlSafe_1;
883
+ var this_0 = Default_getInstance_0();
884
+ var this_1 = this_0.get_serializersModule_piitvg_k$();
885
+ var this_2 = serializer(this_1, createKType(getKClass(JsonObject()), arrayOf([]), false));
886
+ var tmp$ret$3 = isInterface(this_2, KSerializer()) ? this_2 : THROW_CCE2();
887
+ var tmp$ret$2 = this_0.encodeToString_k0apqx_k$(tmp$ret$3, envelope);
888
+ return tmp.encode$default_h4nonq_k$(toByteArray(tmp$ret$2));
889
+ }
890
+ function renewTokenSession($this, oldTokens, $completion) {
891
+ var tmp = new ($renewTokenSessionCOROUTINE$())($this, oldTokens, $completion);
892
+ tmp.result_1 = Unit_instance2;
893
+ tmp.exception_1 = null;
894
+ return tmp.doResume_5yljmg_k$();
895
+ }
896
+ function storeRenewedSession($this, accessToken, renewedRefreshToken, identity) {
897
+ if (renewedRefreshToken == null)
898
+ null;
899
+ else {
900
+ $this.setRefreshToken(renewedRefreshToken);
901
+ }
902
+ $this.setToken(accessToken);
903
+ $this.set_userId_wekl5g_k$(identity);
904
+ }
820
905
  function endSession($this, $completion) {
821
- $this.settings_1.remove_6241ba_k$("activeLogin");
822
- $this.clearTokens();
823
- return $this.refreshFailure_1($completion);
906
+ var tmp = new ($endSessionCOROUTINE$())($this, $completion);
907
+ tmp.result_1 = Unit_instance2;
908
+ tmp.exception_1 = null;
909
+ return tmp.doResume_5yljmg_k$();
910
+ }
911
+ function _get_refreshAuth__q4vj66($this) {
912
+ var tmp0 = $this.refreshAuth$delegate_1;
913
+ var tmp = KProperty1();
914
+ getPropertyCallableRef("refreshAuth", 1, tmp, HomeApiBase$_get_refreshAuth_$ref_x2cel7(), null);
915
+ return tmp0.get_value_j01efc_k$();
824
916
  }
825
917
  function _get_sessionAuth__fjt4oj($this) {
826
918
  var tmp0 = $this.sessionAuth$delegate_1;
@@ -954,31 +1046,43 @@ function HomeApiBase$_get_authM2M_$ref_69s5d4() {
954
1046
  return _get_authM2M__c6rkbz(p0);
955
1047
  }, 1, 0, 107);
956
1048
  }
957
- function HomeApiBase$clientConfigurator$lambda$lambda($this$install) {
1049
+ function HomeApiBase$clientConfigurator$lambda(this$0) {
1050
+ return function(_this__u8e3s4) {
1051
+ configureClient(this$0, _this__u8e3s4, true);
1052
+ return Unit_instance2;
1053
+ };
1054
+ }
1055
+ function HomeApiBase$refreshClientConfigurator$lambda(this$0) {
1056
+ return function(_this__u8e3s4) {
1057
+ configureClient(this$0, _this__u8e3s4, false);
1058
+ return Unit_instance2;
1059
+ };
1060
+ }
1061
+ function HomeApiBase$configureClient$lambda($this$install) {
958
1062
  streamingJson($this$install, get_sdkJson());
959
1063
  return Unit_instance2;
960
1064
  }
961
- function HomeApiBase$clientConfigurator$lambda$lambda_0(this$0) {
1065
+ function HomeApiBase$configureClient$lambda_0(this$0) {
962
1066
  return function($this$install) {
963
1067
  $this$install.publicStorage_gtmqh9_k$(this$0.publicCacheStorage_1);
964
1068
  $this$install.privateStorage_dcznfd_k$(this$0.privateCacheStorage_1);
965
1069
  return Unit_instance2;
966
1070
  };
967
1071
  }
968
- function HomeApiBase$clientConfigurator$lambda$lambda_1($this$install) {
1072
+ function HomeApiBase$configureClient$lambda_1($this$install) {
969
1073
  $this$install.gzip$default_2n8zsi_k$();
970
1074
  $this$install.deflate$default_llu6kj_k$();
971
1075
  $this$install.identity$default_3sck2e_k$();
972
1076
  return Unit_instance2;
973
1077
  }
974
- function HomeApiBase$clientConfigurator$lambda$lambda_2($this$createClientPlugin) {
1078
+ function HomeApiBase$configureClient$lambda_2($this$createClientPlugin) {
975
1079
  var tmp = Send_instance;
976
- $this$createClientPlugin.on_z1oiz_k$(tmp, HomeApiBase$clientConfigurator$lambda$lambda$slambda_0(null));
1080
+ $this$createClientPlugin.on_z1oiz_k$(tmp, HomeApiBase$configureClient$lambda$slambda_0(null));
977
1081
  return Unit_instance2;
978
1082
  }
979
- var HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass;
980
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda() {
981
- if (HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass === VOID2) {
1083
+ var HomeApiBase$configureClient$lambda$slambdaClass;
1084
+ function HomeApiBase$configureClient$lambda$slambda() {
1085
+ if (HomeApiBase$configureClient$lambda$slambdaClass === VOID2) {
982
1086
  let $ = function(resultContinuation) {
983
1087
  CoroutineImpl().call(this, resultContinuation);
984
1088
  };
@@ -1019,7 +1123,7 @@ function HomeApiBase$clientConfigurator$lambda$lambda$slambda() {
1019
1123
  var tmp_0 = this;
1020
1124
  var tmp_1 = httpSpanName(this.request_1.method_1.value_1, route);
1021
1125
  var tmp_2 = SpanKind_CLIENT_getInstance();
1022
- tmp_0.span0__1 = this.tracer2__1.startSpan$default_8x1s39_k$(tmp_1, VOID2, tmp_2, VOID2, HomeApiBase$clientConfigurator$lambda$lambda$slambda$lambda(this.request_1, route, path));
1126
+ tmp_0.span0__1 = this.tracer2__1.startSpan$default_8x1s39_k$(tmp_1, VOID2, tmp_2, VOID2, HomeApiBase$configureClient$lambda$slambda$lambda(this.request_1, route, path));
1023
1127
  this.request_1.attributes_1.put_gkntno_k$(get_SoliboSpanKey(), this.span0__1);
1024
1128
  this.state_1 = 2;
1025
1129
  continue $sm;
@@ -1081,22 +1185,22 @@ function HomeApiBase$clientConfigurator$lambda$lambda$slambda() {
1081
1185
  while (true);
1082
1186
  };
1083
1187
  protoOf2($).create_v0j3o4_k$ = function($this$on, request, completion) {
1084
- var i = new (HomeApiBase$clientConfigurator$lambda$lambda$slambda())(completion);
1188
+ var i = new (HomeApiBase$configureClient$lambda$slambda())(completion);
1085
1189
  i.$this$on_1 = $this$on;
1086
1190
  i.request_1 = request;
1087
1191
  return i;
1088
1192
  };
1089
- HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass = $;
1193
+ HomeApiBase$configureClient$lambda$slambdaClass = $;
1090
1194
  }
1091
- return HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass;
1195
+ return HomeApiBase$configureClient$lambda$slambdaClass;
1092
1196
  }
1093
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_0(resultContinuation) {
1094
- var i = new (HomeApiBase$clientConfigurator$lambda$lambda$slambda())(resultContinuation);
1197
+ function HomeApiBase$configureClient$lambda$slambda_0(resultContinuation) {
1198
+ var i = new (HomeApiBase$configureClient$lambda$slambda())(resultContinuation);
1095
1199
  return constructCallableReference(function($this$on, request, $completion) {
1096
1200
  return i.invoke_nc6r0k_k$($this$on, request, $completion);
1097
1201
  }, 2);
1098
1202
  }
1099
- function HomeApiBase$clientConfigurator$lambda$lambda$lambda($this$retryOnExceptionIf, request, cause) {
1203
+ function HomeApiBase$configureClient$lambda$lambda($this$retryOnExceptionIf, request, cause) {
1100
1204
  var tmp;
1101
1205
  var tmp_0;
1102
1206
  var tmp_1;
@@ -1156,7 +1260,7 @@ function HomeApiBase$clientConfigurator$lambda$lambda$lambda($this$retryOnExcept
1156
1260
  }
1157
1261
  return tmp;
1158
1262
  }
1159
- function HomeApiBase$clientConfigurator$lambda$lambda$lambda_0(this$0) {
1263
+ function HomeApiBase$configureClient$lambda$lambda_0(this$0) {
1160
1264
  return function($this$modifyRequest, request) {
1161
1265
  var tmp;
1162
1266
  var tmp_0;
@@ -1187,12 +1291,12 @@ function HomeApiBase$clientConfigurator$lambda$lambda$lambda_0(this$0) {
1187
1291
  return Unit_instance2;
1188
1292
  };
1189
1293
  }
1190
- function HomeApiBase$clientConfigurator$lambda$lambda$lambda_1($this$retryIf, request, response) {
1294
+ function HomeApiBase$configureClient$lambda$lambda_1($this$retryIf, request, response) {
1191
1295
  var tmp;
1192
1296
  var tmp_0;
1193
1297
  var containsArg = response.get_status_jnf6d7_k$().value_1;
1194
1298
  if (500 <= containsArg ? containsArg <= 599 : false) {
1195
- tmp_0 = !response.get_status_jnf6d7_k$().equals(Companion_getInstance_0().GatewayTimeout_1);
1299
+ tmp_0 = !response.get_status_jnf6d7_k$().equals(Companion_getInstance_1().GatewayTimeout_1);
1196
1300
  } else {
1197
1301
  tmp_0 = false;
1198
1302
  }
@@ -1203,24 +1307,24 @@ function HomeApiBase$clientConfigurator$lambda$lambda$lambda_1($this$retryIf, re
1203
1307
  }
1204
1308
  return tmp;
1205
1309
  }
1206
- function HomeApiBase$clientConfigurator$lambda$lambda_3(this$0) {
1310
+ function HomeApiBase$configureClient$lambda_3(this$0) {
1207
1311
  return function($this$install) {
1208
1312
  $this$install.maxRetries_1 = 5;
1209
- $this$install.retryOnExceptionIf$default_s26x3m_k$(VOID2, HomeApiBase$clientConfigurator$lambda$lambda$lambda);
1210
- $this$install.modifyRequest_6qlpaw_k$(HomeApiBase$clientConfigurator$lambda$lambda$lambda_0(this$0));
1211
- $this$install.retryIf_sig7v0_k$(5, HomeApiBase$clientConfigurator$lambda$lambda$lambda_1);
1313
+ $this$install.retryOnExceptionIf$default_s26x3m_k$(VOID2, HomeApiBase$configureClient$lambda$lambda);
1314
+ $this$install.modifyRequest_6qlpaw_k$(HomeApiBase$configureClient$lambda$lambda_0(this$0));
1315
+ $this$install.retryIf_sig7v0_k$(5, HomeApiBase$configureClient$lambda$lambda_1);
1212
1316
  $this$install.exponentialDelay$default_gkwfsg_k$();
1213
1317
  return Unit_instance2;
1214
1318
  };
1215
1319
  }
1216
- function HomeApiBase$clientConfigurator$lambda$lambda_4($this$createClientPlugin) {
1320
+ function HomeApiBase$configureClient$lambda_4($this$createClientPlugin) {
1217
1321
  var tmp = Send_instance;
1218
- $this$createClientPlugin.on_z1oiz_k$(tmp, HomeApiBase$clientConfigurator$lambda$lambda$slambda_2(null));
1322
+ $this$createClientPlugin.on_z1oiz_k$(tmp, HomeApiBase$configureClient$lambda$slambda_2(null));
1219
1323
  return Unit_instance2;
1220
1324
  }
1221
- var HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass_0;
1222
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_1() {
1223
- if (HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass_0 === VOID2) {
1325
+ var HomeApiBase$configureClient$lambda$slambdaClass_0;
1326
+ function HomeApiBase$configureClient$lambda$slambda_1() {
1327
+ if (HomeApiBase$configureClient$lambda$slambdaClass_0 === VOID2) {
1224
1328
  let $ = function(resultContinuation) {
1225
1329
  CoroutineImpl().call(this, resultContinuation);
1226
1330
  };
@@ -1284,35 +1388,35 @@ function HomeApiBase$clientConfigurator$lambda$lambda$slambda_1() {
1284
1388
  while (true);
1285
1389
  };
1286
1390
  protoOf2($).create_v0j3o4_k$ = function($this$on, attempt, completion) {
1287
- var i = new (HomeApiBase$clientConfigurator$lambda$lambda$slambda_1())(completion);
1391
+ var i = new (HomeApiBase$configureClient$lambda$slambda_1())(completion);
1288
1392
  i.$this$on_1 = $this$on;
1289
1393
  i.attempt_1 = attempt;
1290
1394
  return i;
1291
1395
  };
1292
- HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass_0 = $;
1396
+ HomeApiBase$configureClient$lambda$slambdaClass_0 = $;
1293
1397
  }
1294
- return HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass_0;
1398
+ return HomeApiBase$configureClient$lambda$slambdaClass_0;
1295
1399
  }
1296
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_2(resultContinuation) {
1297
- var i = new (HomeApiBase$clientConfigurator$lambda$lambda$slambda_1())(resultContinuation);
1400
+ function HomeApiBase$configureClient$lambda$slambda_2(resultContinuation) {
1401
+ var i = new (HomeApiBase$configureClient$lambda$slambda_1())(resultContinuation);
1298
1402
  return constructCallableReference(function($this$on, attempt, $completion) {
1299
1403
  return i.invoke_nc6r0k_k$($this$on, attempt, $completion);
1300
1404
  }, 2);
1301
1405
  }
1302
- function HomeApiBase$clientConfigurator$lambda$lambda_5($this$install) {
1406
+ function HomeApiBase$configureClient$lambda_5($this$install) {
1303
1407
  $this$install.set_requestTimeoutMillis_9cb75s_k$(500000n);
1304
1408
  $this$install.set_connectTimeoutMillis_48d5dx_k$(5000n);
1305
1409
  $this$install.set_socketTimeoutMillis_faj43m_k$(500000n);
1306
1410
  return Unit_instance2;
1307
1411
  }
1308
- function HomeApiBase$clientConfigurator$lambda$lambda_6($this$createClientPlugin) {
1412
+ function HomeApiBase$configureClient$lambda_6($this$createClientPlugin) {
1309
1413
  var tmp = Send_instance;
1310
- $this$createClientPlugin.on_z1oiz_k$(tmp, HomeApiBase$clientConfigurator$lambda$lambda$slambda_4(null));
1414
+ $this$createClientPlugin.on_z1oiz_k$(tmp, HomeApiBase$configureClient$lambda$slambda_4(null));
1311
1415
  return Unit_instance2;
1312
1416
  }
1313
- var HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass_1;
1314
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_3() {
1315
- if (HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass_1 === VOID2) {
1417
+ var HomeApiBase$configureClient$lambda$slambdaClass_1;
1418
+ function HomeApiBase$configureClient$lambda$slambda_3() {
1419
+ if (HomeApiBase$configureClient$lambda$slambdaClass_1 === VOID2) {
1316
1420
  let $ = function(resultContinuation) {
1317
1421
  CoroutineImpl().call(this, resultContinuation);
1318
1422
  };
@@ -1343,11 +1447,11 @@ function HomeApiBase$clientConfigurator$lambda$lambda$slambda_3() {
1343
1447
  tmp_0 = false;
1344
1448
  }
1345
1449
  if (tmp_0) {
1346
- var jsonElement = Default_getInstance2().parseToJsonElement_rqvr2k_k$(body.text_1);
1450
+ var jsonElement = Default_getInstance_0().parseToJsonElement_rqvr2k_k$(body.text_1);
1347
1451
  var cleaned = removeEmptyStringsAndNulls(jsonElement);
1348
1452
  if (!equals(cleaned, jsonElement)) {
1349
1453
  var tmp0 = this.request_1;
1350
- var this_0 = Default_getInstance2();
1454
+ var this_0 = Default_getInstance_0();
1351
1455
  var this_1 = this_0.get_serializersModule_piitvg_k$();
1352
1456
  var this_2 = serializer(this_1, createKType(getKClass(JsonElement()), arrayOf([]), false));
1353
1457
  var body_0 = new (TextContent())(this_0.encodeToString_k0apqx_k$(isInterface(this_2, KSerializer()) ? this_2 : THROW_CCE2(), cleaned), body.contentType_1);
@@ -1418,32 +1522,32 @@ function HomeApiBase$clientConfigurator$lambda$lambda$slambda_3() {
1418
1522
  while (true);
1419
1523
  };
1420
1524
  protoOf2($).create_v0j3o4_k$ = function($this$on, request, completion) {
1421
- var i = new (HomeApiBase$clientConfigurator$lambda$lambda$slambda_3())(completion);
1525
+ var i = new (HomeApiBase$configureClient$lambda$slambda_3())(completion);
1422
1526
  i.$this$on_1 = $this$on;
1423
1527
  i.request_1 = request;
1424
1528
  return i;
1425
1529
  };
1426
- HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass_1 = $;
1530
+ HomeApiBase$configureClient$lambda$slambdaClass_1 = $;
1427
1531
  }
1428
- return HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass_1;
1532
+ return HomeApiBase$configureClient$lambda$slambdaClass_1;
1429
1533
  }
1430
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_4(resultContinuation) {
1431
- var i = new (HomeApiBase$clientConfigurator$lambda$lambda$slambda_3())(resultContinuation);
1534
+ function HomeApiBase$configureClient$lambda$slambda_4(resultContinuation) {
1535
+ var i = new (HomeApiBase$configureClient$lambda$slambda_3())(resultContinuation);
1432
1536
  return constructCallableReference(function($this$on, request, $completion) {
1433
1537
  return i.invoke_nc6r0k_k$($this$on, request, $completion);
1434
1538
  }, 2);
1435
1539
  }
1436
- function HomeApiBase$clientConfigurator$lambda$lambda_7($this$install) {
1540
+ function HomeApiBase$configureClient$lambda_7($this$install) {
1437
1541
  $this$install.level_1 = LogLevel_NONE_getInstance();
1438
- $this$install.sanitizeHeader$default_8x7pzj_k$(VOID2, HomeApiBase$clientConfigurator$lambda$lambda$lambda_2);
1542
+ $this$install.sanitizeHeader$default_8x7pzj_k$(VOID2, HomeApiBase$configureClient$lambda$lambda_2);
1439
1543
  return Unit_instance2;
1440
1544
  }
1441
- function HomeApiBase$clientConfigurator$lambda$lambda$lambda_2(header2) {
1545
+ function HomeApiBase$configureClient$lambda$lambda_2(header2) {
1442
1546
  return header2 === "Authorization";
1443
1547
  }
1444
- var HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass_2;
1445
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_5() {
1446
- if (HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass_2 === VOID2) {
1548
+ var HomeApiBase$configureClient$lambda$slambdaClass_2;
1549
+ function HomeApiBase$configureClient$lambda$slambda_5() {
1550
+ if (HomeApiBase$configureClient$lambda$slambdaClass_2 === VOID2) {
1447
1551
  let $ = function($this_HttpResponseValidator, this$0, resultContinuation) {
1448
1552
  this.$this_HttpResponseValidator_1 = $this_HttpResponseValidator;
1449
1553
  this.this$0__1 = this$0;
@@ -1468,7 +1572,7 @@ function HomeApiBase$clientConfigurator$lambda$lambda$slambda_5() {
1468
1572
  case 0:
1469
1573
  this.exceptionState_1 = 7;
1470
1574
  var url = get_request(this.response_1).get_url_18iuii_k$().get_encodedPath_p9zwnq_k$();
1471
- if (this.response_1.get_status_jnf6d7_k$().equals(Companion_getInstance_0().Found_1) && contains(url, "/auth")) {
1575
+ if (this.response_1.get_status_jnf6d7_k$().equals(Companion_getInstance_1().Found_1) && contains(url, "/auth")) {
1472
1576
  this.state_1 = 1;
1473
1577
  suspendResult = bodyAsText(this.response_1, VOID2, this);
1474
1578
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
@@ -1484,7 +1588,7 @@ function HomeApiBase$clientConfigurator$lambda$lambda$slambda_5() {
1484
1588
  this.$this_HttpResponseValidator_1;
1485
1589
  var tmp_0;
1486
1590
  try {
1487
- var tmp0_safe_receiver = get_jsonObject(Default_getInstance2().parseToJsonElement_rqvr2k_k$(body)).get_6bo4tg_k$("url");
1591
+ var tmp0_safe_receiver = get_jsonObject(Default_getInstance_0().parseToJsonElement_rqvr2k_k$(body)).get_6bo4tg_k$("url");
1488
1592
  var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : get_jsonPrimitive(tmp0_safe_receiver);
1489
1593
  var value = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.get_content_h02jrk_k$();
1490
1594
  tmp_0 = _Result___init__impl__xyqfz82(value);
@@ -1507,13 +1611,13 @@ function HomeApiBase$clientConfigurator$lambda$lambda$slambda_5() {
1507
1611
  this.state_1 = 2;
1508
1612
  continue $sm;
1509
1613
  case 2:
1510
- if (this.response_1.get_status_jnf6d7_k$().equals(Companion_getInstance_0().TooManyRequests_1)) {
1614
+ if (this.response_1.get_status_jnf6d7_k$().equals(Companion_getInstance_1().TooManyRequests_1)) {
1511
1615
  var failure = new (RateLimitException())(retryAfterSeconds(this.response_1.get_headers_ef25jx_k$().get_6bo4tg_k$("Retry-After")));
1512
1616
  recordFailureOnSpan(this.this$0__1, this.response_1, failure);
1513
1617
  throw failure;
1514
1618
  } else {
1515
1619
  if (this.response_1.get_status_jnf6d7_k$().value_1 >= 400) {
1516
- if (this.response_1.get_status_jnf6d7_k$().equals(Companion_getInstance_0().Unauthorized_1)) {
1620
+ if (this.response_1.get_status_jnf6d7_k$().equals(Companion_getInstance_1().Unauthorized_1)) {
1517
1621
  recordFailureOnSpan(this.this$0__1, this.response_1, null);
1518
1622
  this.state_1 = 4;
1519
1623
  continue $sm;
@@ -1577,29 +1681,29 @@ function HomeApiBase$clientConfigurator$lambda$lambda$slambda_5() {
1577
1681
  while (true);
1578
1682
  };
1579
1683
  protoOf2($).create_e75tx1_k$ = function(response, completion) {
1580
- var i = new (HomeApiBase$clientConfigurator$lambda$lambda$slambda_5())(this.$this_HttpResponseValidator_1, this.this$0__1, completion);
1684
+ var i = new (HomeApiBase$configureClient$lambda$slambda_5())(this.$this_HttpResponseValidator_1, this.this$0__1, completion);
1581
1685
  i.response_1 = response;
1582
1686
  return i;
1583
1687
  };
1584
- HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass_2 = $;
1688
+ HomeApiBase$configureClient$lambda$slambdaClass_2 = $;
1585
1689
  }
1586
- return HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass_2;
1690
+ return HomeApiBase$configureClient$lambda$slambdaClass_2;
1587
1691
  }
1588
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_6($this_HttpResponseValidator, this$0, resultContinuation) {
1589
- var i = new (HomeApiBase$clientConfigurator$lambda$lambda$slambda_5())($this_HttpResponseValidator, this$0, resultContinuation);
1692
+ function HomeApiBase$configureClient$lambda$slambda_6($this_HttpResponseValidator, this$0, resultContinuation) {
1693
+ var i = new (HomeApiBase$configureClient$lambda$slambda_5())($this_HttpResponseValidator, this$0, resultContinuation);
1590
1694
  return constructCallableReference(function(response, $completion) {
1591
1695
  return i.invoke_g2i713_k$(response, $completion);
1592
1696
  }, 1);
1593
1697
  }
1594
- function HomeApiBase$clientConfigurator$lambda$lambda_8(this$0) {
1698
+ function HomeApiBase$configureClient$lambda_8(this$0) {
1595
1699
  return function($this$HttpResponseValidator) {
1596
- $this$HttpResponseValidator.validateResponse_cfyktb_k$(HomeApiBase$clientConfigurator$lambda$lambda$slambda_6($this$HttpResponseValidator, this$0, null));
1700
+ $this$HttpResponseValidator.validateResponse_cfyktb_k$(HomeApiBase$configureClient$lambda$slambda_6($this$HttpResponseValidator, this$0, null));
1597
1701
  return Unit_instance2;
1598
1702
  };
1599
1703
  }
1600
- var HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass_3;
1601
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_7() {
1602
- if (HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass_3 === VOID2) {
1704
+ var HomeApiBase$configureClient$lambda$slambdaClass_3;
1705
+ function HomeApiBase$configureClient$lambda$slambda_7() {
1706
+ if (HomeApiBase$configureClient$lambda$slambdaClass_3 === VOID2) {
1603
1707
  let $ = function(this$0, resultContinuation) {
1604
1708
  this.this$0__1 = this$0;
1605
1709
  CoroutineImpl().call(this, resultContinuation);
@@ -1665,31 +1769,31 @@ function HomeApiBase$clientConfigurator$lambda$lambda$slambda_7() {
1665
1769
  while (true);
1666
1770
  };
1667
1771
  protoOf2($).create_v0j3o4_k$ = function($this$on, request, completion) {
1668
- var i = new (HomeApiBase$clientConfigurator$lambda$lambda$slambda_7())(this.this$0__1, completion);
1772
+ var i = new (HomeApiBase$configureClient$lambda$slambda_7())(this.this$0__1, completion);
1669
1773
  i.$this$on_1 = $this$on;
1670
1774
  i.request_1 = request;
1671
1775
  return i;
1672
1776
  };
1673
- HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass_3 = $;
1777
+ HomeApiBase$configureClient$lambda$slambdaClass_3 = $;
1674
1778
  }
1675
- return HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass_3;
1779
+ return HomeApiBase$configureClient$lambda$slambdaClass_3;
1676
1780
  }
1677
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_8(this$0, resultContinuation) {
1678
- var i = new (HomeApiBase$clientConfigurator$lambda$lambda$slambda_7())(this$0, resultContinuation);
1781
+ function HomeApiBase$configureClient$lambda$slambda_8(this$0, resultContinuation) {
1782
+ var i = new (HomeApiBase$configureClient$lambda$slambda_7())(this$0, resultContinuation);
1679
1783
  return constructCallableReference(function($this$on, request, $completion) {
1680
1784
  return i.invoke_nc6r0k_k$($this$on, request, $completion);
1681
1785
  }, 2);
1682
1786
  }
1683
- function HomeApiBase$clientConfigurator$lambda$lambda_9(this$0) {
1787
+ function HomeApiBase$configureClient$lambda_9(this$0) {
1684
1788
  return function($this$createClientPlugin) {
1685
1789
  var tmp = Send_instance;
1686
- $this$createClientPlugin.on_z1oiz_k$(tmp, HomeApiBase$clientConfigurator$lambda$lambda$slambda_8(this$0, null));
1790
+ $this$createClientPlugin.on_z1oiz_k$(tmp, HomeApiBase$configureClient$lambda$slambda_8(this$0, null));
1687
1791
  return Unit_instance2;
1688
1792
  };
1689
1793
  }
1690
- var HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass_4;
1691
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_9() {
1692
- if (HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass_4 === VOID2) {
1794
+ var HomeApiBase$configureClient$lambda$slambdaClass_4;
1795
+ function HomeApiBase$configureClient$lambda$slambda_9() {
1796
+ if (HomeApiBase$configureClient$lambda$slambdaClass_4 === VOID2) {
1693
1797
  let $ = function(this$0, resultContinuation) {
1694
1798
  this.this$0__1 = this$0;
1695
1799
  CoroutineImpl().call(this, resultContinuation);
@@ -1726,7 +1830,7 @@ function HomeApiBase$clientConfigurator$lambda$lambda$slambda_9() {
1726
1830
  this.state_1 = 2;
1727
1831
  continue $sm;
1728
1832
  case 2:
1729
- if (!(this.retryable2__1 && this.call0__1.get_response_xlk07e_k$().get_status_jnf6d7_k$().equals(Companion_getInstance_0().TooManyRequests_1) && this.retries1__1 < 5)) {
1833
+ if (!(this.retryable2__1 && this.call0__1.get_response_xlk07e_k$().get_status_jnf6d7_k$().equals(Companion_getInstance_1().TooManyRequests_1) && this.retries1__1 < 5)) {
1730
1834
  this.state_1 = 5;
1731
1835
  continue $sm;
1732
1836
  }
@@ -1735,7 +1839,7 @@ function HomeApiBase$clientConfigurator$lambda$lambda$slambda_9() {
1735
1839
  var delaySeconds = tmp1_elvis_lhs == null ? 1n : tmp1_elvis_lhs;
1736
1840
  release(this.this$0__1, this.call0__1);
1737
1841
  this.state_1 = 3;
1738
- Companion_getInstance_1();
1842
+ Companion_getInstance_2();
1739
1843
  var this_0 = multiply(coerceAtMost(delaySeconds, 60n), 1000n);
1740
1844
  suspendResult = delay(toDuration(this_0, DurationUnit_MILLISECONDS_getInstance()), this);
1741
1845
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
@@ -1771,31 +1875,31 @@ function HomeApiBase$clientConfigurator$lambda$lambda$slambda_9() {
1771
1875
  while (true);
1772
1876
  };
1773
1877
  protoOf2($).create_v0j3o4_k$ = function($this$on, request, completion) {
1774
- var i = new (HomeApiBase$clientConfigurator$lambda$lambda$slambda_9())(this.this$0__1, completion);
1878
+ var i = new (HomeApiBase$configureClient$lambda$slambda_9())(this.this$0__1, completion);
1775
1879
  i.$this$on_1 = $this$on;
1776
1880
  i.request_1 = request;
1777
1881
  return i;
1778
1882
  };
1779
- HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass_4 = $;
1883
+ HomeApiBase$configureClient$lambda$slambdaClass_4 = $;
1780
1884
  }
1781
- return HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass_4;
1885
+ return HomeApiBase$configureClient$lambda$slambdaClass_4;
1782
1886
  }
1783
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_10(this$0, resultContinuation) {
1784
- var i = new (HomeApiBase$clientConfigurator$lambda$lambda$slambda_9())(this$0, resultContinuation);
1887
+ function HomeApiBase$configureClient$lambda$slambda_10(this$0, resultContinuation) {
1888
+ var i = new (HomeApiBase$configureClient$lambda$slambda_9())(this$0, resultContinuation);
1785
1889
  return constructCallableReference(function($this$on, request, $completion) {
1786
1890
  return i.invoke_nc6r0k_k$($this$on, request, $completion);
1787
1891
  }, 2);
1788
1892
  }
1789
- function HomeApiBase$clientConfigurator$lambda$lambda_10(this$0) {
1893
+ function HomeApiBase$configureClient$lambda_10(this$0) {
1790
1894
  return function($this$createClientPlugin) {
1791
1895
  var tmp = Send_instance;
1792
- $this$createClientPlugin.on_z1oiz_k$(tmp, HomeApiBase$clientConfigurator$lambda$lambda$slambda_10(this$0, null));
1896
+ $this$createClientPlugin.on_z1oiz_k$(tmp, HomeApiBase$configureClient$lambda$slambda_10(this$0, null));
1793
1897
  return Unit_instance2;
1794
1898
  };
1795
1899
  }
1796
- var HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambdaClass;
1797
- function HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda() {
1798
- if (HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambdaClass === VOID2) {
1900
+ var HomeApiBase$configureClient$lambda$lambda$slambdaClass;
1901
+ function HomeApiBase$configureClient$lambda$lambda$slambda() {
1902
+ if (HomeApiBase$configureClient$lambda$lambda$slambdaClass === VOID2) {
1799
1903
  let $ = function(this$0, resultContinuation) {
1800
1904
  this.this$0__1 = this$0;
1801
1905
  CoroutineImpl().call(this, resultContinuation);
@@ -1832,21 +1936,21 @@ function HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda() {
1832
1936
  while (true);
1833
1937
  };
1834
1938
  protoOf2($).create_d196fn_k$ = function(completion) {
1835
- return new (HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda())(this.this$0__1, completion);
1939
+ return new (HomeApiBase$configureClient$lambda$lambda$slambda())(this.this$0__1, completion);
1836
1940
  };
1837
- HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambdaClass = $;
1941
+ HomeApiBase$configureClient$lambda$lambda$slambdaClass = $;
1838
1942
  }
1839
- return HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambdaClass;
1943
+ return HomeApiBase$configureClient$lambda$lambda$slambdaClass;
1840
1944
  }
1841
- function HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda_0(this$0, resultContinuation) {
1842
- var i = new (HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda())(this$0, resultContinuation);
1945
+ function HomeApiBase$configureClient$lambda$lambda$slambda_0(this$0, resultContinuation) {
1946
+ var i = new (HomeApiBase$configureClient$lambda$lambda$slambda())(this$0, resultContinuation);
1843
1947
  return constructCallableReference(function($completion) {
1844
1948
  return i.invoke_llb9nu_k$($completion);
1845
1949
  }, 0);
1846
1950
  }
1847
- var HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambdaClass_0;
1848
- function HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda_1() {
1849
- if (HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambdaClass_0 === VOID2) {
1951
+ var HomeApiBase$configureClient$lambda$lambda$slambdaClass_0;
1952
+ function HomeApiBase$configureClient$lambda$lambda$slambda_1() {
1953
+ if (HomeApiBase$configureClient$lambda$lambda$slambdaClass_0 === VOID2) {
1850
1954
  let $ = function(this$0, resultContinuation) {
1851
1955
  this.this$0__1 = this$0;
1852
1956
  CoroutineImpl().call(this, resultContinuation);
@@ -1906,36 +2010,114 @@ function HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda_1() {
1906
2010
  while (true);
1907
2011
  };
1908
2012
  protoOf2($).create_ig4e4p_k$ = function($this$refreshTokens, completion) {
1909
- var i = new (HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda_1())(this.this$0__1, completion);
2013
+ var i = new (HomeApiBase$configureClient$lambda$lambda$slambda_1())(this.this$0__1, completion);
1910
2014
  i.$this$refreshTokens_1 = $this$refreshTokens;
1911
2015
  return i;
1912
2016
  };
1913
- HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambdaClass_0 = $;
2017
+ HomeApiBase$configureClient$lambda$lambda$slambdaClass_0 = $;
1914
2018
  }
1915
- return HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambdaClass_0;
2019
+ return HomeApiBase$configureClient$lambda$lambda$slambdaClass_0;
1916
2020
  }
1917
- function HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda_2(this$0, resultContinuation) {
1918
- var i = new (HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda_1())(this$0, resultContinuation);
2021
+ function HomeApiBase$configureClient$lambda$lambda$slambda_2(this$0, resultContinuation) {
2022
+ var i = new (HomeApiBase$configureClient$lambda$lambda$slambda_1())(this$0, resultContinuation);
1919
2023
  return constructCallableReference(function($this$refreshTokens, $completion) {
1920
2024
  return i.invoke_5ffmyk_k$($this$refreshTokens, $completion);
1921
2025
  }, 1);
1922
2026
  }
1923
- function HomeApiBase$clientConfigurator$lambda$lambda$lambda_3(this$0) {
2027
+ function HomeApiBase$configureClient$lambda$lambda_3(this$0) {
1924
2028
  return function($this$bearer) {
1925
- $this$bearer.loadTokens_z0xglj_k$(HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda_0(this$0, null));
1926
- $this$bearer.refreshTokens_l9342v_k$(HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda_2(this$0, null));
2029
+ $this$bearer.loadTokens_z0xglj_k$(HomeApiBase$configureClient$lambda$lambda$slambda_0(this$0, null));
2030
+ $this$bearer.refreshTokens_l9342v_k$(HomeApiBase$configureClient$lambda$lambda$slambda_2(this$0, null));
1927
2031
  return Unit_instance2;
1928
2032
  };
1929
2033
  }
1930
- function HomeApiBase$clientConfigurator$lambda$lambda_11(this$0) {
2034
+ function HomeApiBase$configureClient$lambda_11(this$0) {
1931
2035
  return function($this$install) {
1932
- bearer($this$install, HomeApiBase$clientConfigurator$lambda$lambda$lambda_3(this$0));
2036
+ bearer($this$install, HomeApiBase$configureClient$lambda$lambda_3(this$0));
2037
+ return Unit_instance2;
2038
+ };
2039
+ }
2040
+ var HomeApiBase$configureClient$lambda$slambdaClass_5;
2041
+ function HomeApiBase$configureClient$lambda$slambda_11() {
2042
+ if (HomeApiBase$configureClient$lambda$slambdaClass_5 === VOID2) {
2043
+ let $ = function(this$0, resultContinuation) {
2044
+ this.this$0__1 = this$0;
2045
+ CoroutineImpl().call(this, resultContinuation);
2046
+ };
2047
+ initMetadataForLambda($, CoroutineImpl(), VOID2, [3]);
2048
+ protoOf2($).invoke_572pd7_k$ = function($this$onRequest, request, _unused_var__etf5q3, $completion) {
2049
+ var tmp = this.create_2brvp3_k$($this$onRequest, request, _unused_var__etf5q3, $completion);
2050
+ tmp.result_1 = Unit_instance2;
2051
+ tmp.exception_1 = null;
2052
+ return tmp.doResume_5yljmg_k$();
2053
+ };
2054
+ protoOf2($).invoke_ihdh7y_k$ = function(p1, p2, p3, $completion) {
2055
+ var tmp = p1 instanceof OnRequestContext() ? p1 : THROW_CCE2();
2056
+ var tmp_0 = p2 instanceof HttpRequestBuilder() ? p2 : THROW_CCE2();
2057
+ return this.invoke_572pd7_k$(tmp, tmp_0, !(p3 == null) ? p3 : THROW_CCE2(), $completion);
2058
+ };
2059
+ protoOf2($).doResume_5yljmg_k$ = function() {
2060
+ var suspendResult = this.result_1;
2061
+ $sm: do
2062
+ try {
2063
+ var tmp = this.state_1;
2064
+ if (tmp === 0) {
2065
+ this.exceptionState_1 = 1;
2066
+ var tmp0_safe_receiver = this.this$0__1.bearerToken_1;
2067
+ var tmp_0;
2068
+ if (tmp0_safe_receiver == null) {
2069
+ tmp_0 = null;
2070
+ } else {
2071
+ var tmp_1;
2072
+ if (!isBlank(tmp0_safe_receiver)) {
2073
+ tmp_1 = tmp0_safe_receiver;
2074
+ } else {
2075
+ tmp_1 = null;
2076
+ }
2077
+ tmp_0 = tmp_1;
2078
+ }
2079
+ var tmp1_safe_receiver = tmp_0;
2080
+ if (tmp1_safe_receiver == null)
2081
+ null;
2082
+ else {
2083
+ header(this.request_1, "Authorization", "Bearer " + tmp1_safe_receiver);
2084
+ }
2085
+ return Unit_instance2;
2086
+ } else if (tmp === 1) {
2087
+ throw this.exception_1;
2088
+ }
2089
+ } catch ($p) {
2090
+ var e = $p;
2091
+ throw e;
2092
+ }
2093
+ while (true);
2094
+ };
2095
+ protoOf2($).create_2brvp3_k$ = function($this$onRequest, request, _unused_var__etf5q3, completion) {
2096
+ var i = new (HomeApiBase$configureClient$lambda$slambda_11())(this.this$0__1, completion);
2097
+ i.$this$onRequest_1 = $this$onRequest;
2098
+ i.request_1 = request;
2099
+ i._unused_var__etf5q3__1 = _unused_var__etf5q3;
2100
+ return i;
2101
+ };
2102
+ HomeApiBase$configureClient$lambda$slambdaClass_5 = $;
2103
+ }
2104
+ return HomeApiBase$configureClient$lambda$slambdaClass_5;
2105
+ }
2106
+ function HomeApiBase$configureClient$lambda$slambda_12(this$0, resultContinuation) {
2107
+ var i = new (HomeApiBase$configureClient$lambda$slambda_11())(this$0, resultContinuation);
2108
+ return constructCallableReference(function($this$onRequest, request, _unused_var__etf5q3, $completion) {
2109
+ return i.invoke_572pd7_k$($this$onRequest, request, _unused_var__etf5q3, $completion);
2110
+ }, 3);
2111
+ }
2112
+ function HomeApiBase$configureClient$lambda_12(this$0) {
2113
+ return function($this$createClientPlugin) {
2114
+ $this$createClientPlugin.onRequest_fk8bil_k$(HomeApiBase$configureClient$lambda$slambda_12(this$0, null));
1933
2115
  return Unit_instance2;
1934
2116
  };
1935
2117
  }
1936
- var HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass_5;
1937
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_11() {
1938
- if (HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass_5 === VOID2) {
2118
+ var HomeApiBase$configureClient$lambda$slambdaClass_6;
2119
+ function HomeApiBase$configureClient$lambda$slambda_13() {
2120
+ if (HomeApiBase$configureClient$lambda$slambdaClass_6 === VOID2) {
1939
2121
  let $ = function(this$0, resultContinuation) {
1940
2122
  this.this$0__1 = this$0;
1941
2123
  CoroutineImpl().call(this, resultContinuation);
@@ -1968,7 +2150,7 @@ function HomeApiBase$clientConfigurator$lambda$lambda$slambda_11() {
1968
2150
  continue $sm;
1969
2151
  case 1:
1970
2152
  this.call0__1 = suspendResult;
1971
- if (!this.call0__1.get_response_xlk07e_k$().get_status_jnf6d7_k$().equals(Companion_getInstance_0().Unauthorized_1) || isSignInStep(this.request_1.url_1.build_1k0s4u_k$().get_encodedPath_p9zwnq_k$())) {
2153
+ if (!this.call0__1.get_response_xlk07e_k$().get_status_jnf6d7_k$().equals(Companion_getInstance_1().Unauthorized_1) || isSignInStep(this.request_1.url_1.build_1k0s4u_k$().get_encodedPath_p9zwnq_k$())) {
1972
2154
  this.WHEN_RESULT1__1 = true;
1973
2155
  this.state_1 = 3;
1974
2156
  continue $sm;
@@ -2016,80 +2198,37 @@ function HomeApiBase$clientConfigurator$lambda$lambda$slambda_11() {
2016
2198
  while (true);
2017
2199
  };
2018
2200
  protoOf2($).create_v0j3o4_k$ = function($this$on, request, completion) {
2019
- var i = new (HomeApiBase$clientConfigurator$lambda$lambda$slambda_11())(this.this$0__1, completion);
2201
+ var i = new (HomeApiBase$configureClient$lambda$slambda_13())(this.this$0__1, completion);
2020
2202
  i.$this$on_1 = $this$on;
2021
2203
  i.request_1 = request;
2022
2204
  return i;
2023
2205
  };
2024
- HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass_5 = $;
2206
+ HomeApiBase$configureClient$lambda$slambdaClass_6 = $;
2025
2207
  }
2026
- return HomeApiBase$clientConfigurator$lambda$lambda$slambdaClass_5;
2208
+ return HomeApiBase$configureClient$lambda$slambdaClass_6;
2027
2209
  }
2028
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_12(this$0, resultContinuation) {
2029
- var i = new (HomeApiBase$clientConfigurator$lambda$lambda$slambda_11())(this$0, resultContinuation);
2210
+ function HomeApiBase$configureClient$lambda$slambda_14(this$0, resultContinuation) {
2211
+ var i = new (HomeApiBase$configureClient$lambda$slambda_13())(this$0, resultContinuation);
2030
2212
  return constructCallableReference(function($this$on, request, $completion) {
2031
2213
  return i.invoke_nc6r0k_k$($this$on, request, $completion);
2032
2214
  }, 2);
2033
2215
  }
2034
- function HomeApiBase$clientConfigurator$lambda$lambda_12(this$0) {
2216
+ function HomeApiBase$configureClient$lambda_13(this$0) {
2035
2217
  return function($this$createClientPlugin) {
2036
2218
  var tmp = Send_instance;
2037
- $this$createClientPlugin.on_z1oiz_k$(tmp, HomeApiBase$clientConfigurator$lambda$lambda$slambda_12(this$0, null));
2219
+ $this$createClientPlugin.on_z1oiz_k$(tmp, HomeApiBase$configureClient$lambda$slambda_14(this$0, null));
2038
2220
  return Unit_instance2;
2039
2221
  };
2040
2222
  }
2041
- function HomeApiBase$clientConfigurator$lambda$lambda_13(this$0, $platformName) {
2223
+ function HomeApiBase$configureClient$lambda_14(this$0, $platformName) {
2042
2224
  return function($this$defaultRequest) {
2043
2225
  if (contentType($this$defaultRequest) == null) {
2044
2226
  contentType_0($this$defaultRequest, Application_getInstance().Json_1);
2045
2227
  }
2046
2228
  accept($this$defaultRequest, Application_getInstance().Json_1);
2047
2229
  header($this$defaultRequest, "Accept-Language", buildAcceptLanguage(this$0.userLanguage));
2048
- header($this$defaultRequest, "User-Agent", "SoliboSDK/1.55.0 (" + $platformName + ")");
2049
- header($this$defaultRequest, "X-Solibo-SDK-Version", "1.55.0");
2050
- return Unit_instance2;
2051
- };
2052
- }
2053
- function HomeApiBase$clientConfigurator$lambda(this$0) {
2054
- return function(_this__u8e3s4) {
2055
- var tmp = get_ContentNegotiation();
2056
- _this__u8e3s4.install_6m4asv_k$(tmp, HomeApiBase$clientConfigurator$lambda$lambda);
2057
- var tmp_0 = Companion_getInstance();
2058
- _this__u8e3s4.install_6m4asv_k$(tmp_0, HomeApiBase$clientConfigurator$lambda$lambda_0(this$0));
2059
- var tmp_1 = get_ContentEncoding();
2060
- _this__u8e3s4.install_6m4asv_k$(tmp_1, HomeApiBase$clientConfigurator$lambda$lambda_1);
2061
- _this__u8e3s4.install$default_lc5jjj_k$(createClientPlugin("SoliboTracing", HomeApiBase$clientConfigurator$lambda$lambda_2));
2062
- var tmp_2 = get_HttpRequestRetry();
2063
- _this__u8e3s4.install_6m4asv_k$(tmp_2, HomeApiBase$clientConfigurator$lambda$lambda_3(this$0));
2064
- _this__u8e3s4.install$default_lc5jjj_k$(createClientPlugin("EndFailedAttempts", HomeApiBase$clientConfigurator$lambda$lambda_4));
2065
- var tmp_3 = get_HttpTimeout();
2066
- _this__u8e3s4.install_6m4asv_k$(tmp_3, HomeApiBase$clientConfigurator$lambda$lambda_5);
2067
- _this__u8e3s4.install$default_lc5jjj_k$(createClientPlugin("RemoveEmptyFields", HomeApiBase$clientConfigurator$lambda$lambda_6));
2068
- var tmp_4 = get_Logging();
2069
- _this__u8e3s4.install_6m4asv_k$(tmp_4, HomeApiBase$clientConfigurator$lambda$lambda_7);
2070
- HttpResponseValidator(_this__u8e3s4, HomeApiBase$clientConfigurator$lambda$lambda_8(this$0));
2071
- _this__u8e3s4.install$default_lc5jjj_k$(createClientPlugin("M2MAuth", HomeApiBase$clientConfigurator$lambda$lambda_9(this$0)));
2072
- _this__u8e3s4.install$default_lc5jjj_k$(createClientPlugin("RateLimitRetry", HomeApiBase$clientConfigurator$lambda$lambda_10(this$0)));
2073
- var tmp_5;
2074
- switch (this$0.authMode.ordinal_1) {
2075
- case 0:
2076
- var tmp_6 = get_Auth();
2077
- _this__u8e3s4.install_6m4asv_k$(tmp_6, HomeApiBase$clientConfigurator$lambda$lambda_11(this$0));
2078
- tmp_5 = Unit_instance2;
2079
- break;
2080
- case 2:
2081
- tmp_5 = Unit_instance2;
2082
- break;
2083
- default:
2084
- _this__u8e3s4.install$default_lc5jjj_k$(Companion_getInstance_2());
2085
- _this__u8e3s4.install$default_lc5jjj_k$(createClientPlugin("CookieSessionRefresh", HomeApiBase$clientConfigurator$lambda$lambda_12(this$0)));
2086
- tmp_5 = Unit_instance2;
2087
- break;
2088
- }
2089
- var platformName = new (Platform())().name_1;
2090
- defaultRequest(_this__u8e3s4, HomeApiBase$clientConfigurator$lambda$lambda_13(this$0, platformName));
2091
- applyPlatformSpecificHttpClientConfig(_this__u8e3s4);
2092
- this$0.configurator_1(_this__u8e3s4);
2230
+ header($this$defaultRequest, "User-Agent", "SoliboSDK/1.56.0 (" + $platformName + ")");
2231
+ header($this$defaultRequest, "X-Solibo-SDK-Version", "1.56.0");
2093
2232
  return Unit_instance2;
2094
2233
  };
2095
2234
  }
@@ -2106,106 +2245,375 @@ function HomeApiBase$recordFailureOnSpan$lambda($it) {
2106
2245
  return Unit_instance2;
2107
2246
  };
2108
2247
  }
2109
- function HomeApiBase$auth$delegate$lambda(this$0) {
2110
- return function() {
2111
- var tmp0_elvis_lhs = this$0.baseUrl_1;
2112
- var tmp;
2113
- if (tmp0_elvis_lhs == null) {
2114
- throw IllegalStateException_init_$Create$2("No Baseurl set!");
2115
- } else {
2116
- tmp = tmp0_elvis_lhs;
2117
- }
2118
- return create(tmp, this$0.httpClientEngine_1, this$0.clientConfigurator);
2119
- };
2120
- }
2121
- function HomeApiBase$_get_auth_$ref_94oz3e() {
2122
- return constructCallableReference(function(p0) {
2123
- return p0.auth;
2124
- }, 1, 0, 108);
2125
- }
2126
- function HomeApiBase$sessionAuth$delegate$lambda(this$0) {
2127
- return function() {
2128
- var tmp0_elvis_lhs = this$0.baseUrl_1;
2129
- var tmp;
2130
- if (tmp0_elvis_lhs == null) {
2131
- throw IllegalStateException_init_$Create$2("No Baseurl set!");
2132
- } else {
2133
- tmp = tmp0_elvis_lhs;
2134
- }
2135
- return create(removeSuffix(tmp, "/api"), this$0.httpClientEngine_1, this$0.clientConfigurator);
2136
- };
2137
- }
2138
- function HomeApiBase$_get_sessionAuth_$ref_nw0oga() {
2139
- return constructCallableReference(function(p0) {
2140
- return _get_sessionAuth__fjt4oj(p0);
2141
- }, 1, 0, 109);
2142
- }
2143
- function HomeApiBase$language$delegate$lambda(this$0) {
2144
- return function() {
2145
- var tmp0_elvis_lhs = this$0.baseUrl_1;
2146
- var tmp;
2147
- if (tmp0_elvis_lhs == null) {
2148
- throw IllegalStateException_init_$Create$2("No Baseurl set!");
2149
- } else {
2150
- tmp = tmp0_elvis_lhs;
2151
- }
2152
- return create_0(tmp, this$0.httpClientEngine_1, this$0.clientConfigurator);
2153
- };
2154
- }
2155
- function HomeApiBase$_get_language_$ref_d0oebq() {
2156
- return constructCallableReference(function(p0) {
2157
- return p0.language;
2158
- }, 1, 0, 110);
2159
- }
2160
- function HomeApiBase$devices$delegate$lambda(this$0) {
2161
- return function() {
2162
- var tmp0_elvis_lhs = this$0.baseUrl_1;
2163
- var tmp;
2164
- if (tmp0_elvis_lhs == null) {
2165
- throw IllegalStateException_init_$Create$2("No Baseurl set!");
2166
- } else {
2167
- tmp = tmp0_elvis_lhs;
2168
- }
2169
- return new (DeviceClient())(tmp, this$0.httpClientEngine_1, this$0.clientConfigurator);
2170
- };
2171
- }
2172
- function HomeApiBase$_get_devices_$ref_5mpuln() {
2173
- return constructCallableReference(function(p0) {
2174
- return p0.devices;
2175
- }, 1, 0, 111);
2176
- }
2177
- var HomeApiBase$eventBusConnection$slambdaClass;
2178
- function HomeApiBase$eventBusConnection$slambda() {
2179
- if (HomeApiBase$eventBusConnection$slambdaClass === VOID2) {
2180
- let $ = function(this$0, resultContinuation) {
2248
+ var HomeApiBase$renewCookieSessionAfter$slambdaClass;
2249
+ function HomeApiBase$renewCookieSessionAfter$slambda() {
2250
+ if (HomeApiBase$renewCookieSessionAfter$slambdaClass === VOID2) {
2251
+ let $ = function(this$0, $generation, resultContinuation) {
2181
2252
  this.this$0__1 = this$0;
2253
+ this.$generation_1 = $generation;
2182
2254
  CoroutineImpl().call(this, resultContinuation);
2183
2255
  };
2184
2256
  initMetadataForLambda($, CoroutineImpl(), VOID2, [0]);
2185
- protoOf2($).invoke_se6999_k$ = function($completion) {
2257
+ protoOf2($).invoke_llb9nu_k$ = function($completion) {
2186
2258
  var tmp = this.create_d196fn_k$($completion);
2187
2259
  tmp.result_1 = Unit_instance2;
2188
2260
  tmp.exception_1 = null;
2189
2261
  return tmp.doResume_5yljmg_k$();
2190
2262
  };
2191
2263
  protoOf2($).invoke_ib42db_k$ = function($completion) {
2192
- return this.invoke_se6999_k$($completion);
2264
+ return this.invoke_llb9nu_k$($completion);
2193
2265
  };
2194
2266
  protoOf2($).doResume_5yljmg_k$ = function() {
2195
2267
  var suspendResult = this.result_1;
2196
2268
  $sm: do
2197
2269
  try {
2198
2270
  var tmp = this.state_1;
2199
- if (tmp === 0) {
2200
- this.exceptionState_1 = 1;
2201
- var tmp_0;
2202
- switch (this.this$0__1.authMode.ordinal_1) {
2203
- case 2:
2204
- case 0:
2205
- var tmp1_safe_receiver = this.this$0__1.bearerToken_1;
2206
- var tmp_1;
2207
- if (tmp1_safe_receiver == null) {
2208
- tmp_1 = null;
2271
+ switch (tmp) {
2272
+ case 0:
2273
+ this.exceptionState_1 = 3;
2274
+ if (this.this$0__1.cookieSessionGeneration_1 === this.$generation_1) {
2275
+ this.state_1 = 1;
2276
+ suspendResult = renewCookieSession(this.this$0__1, this);
2277
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
2278
+ return suspendResult;
2279
+ }
2280
+ continue $sm;
2281
+ } else {
2282
+ this.state_1 = 2;
2283
+ continue $sm;
2284
+ }
2285
+ case 1:
2286
+ this.state_1 = 2;
2287
+ continue $sm;
2288
+ case 2:
2289
+ return null;
2290
+ case 3:
2291
+ throw this.exception_1;
2292
+ }
2293
+ } catch ($p) {
2294
+ var e = $p;
2295
+ if (this.exceptionState_1 === 3) {
2296
+ throw e;
2297
+ } else {
2298
+ this.state_1 = this.exceptionState_1;
2299
+ this.exception_1 = e;
2300
+ }
2301
+ }
2302
+ while (true);
2303
+ };
2304
+ protoOf2($).create_d196fn_k$ = function(completion) {
2305
+ return new (HomeApiBase$renewCookieSessionAfter$slambda())(this.this$0__1, this.$generation_1, completion);
2306
+ };
2307
+ HomeApiBase$renewCookieSessionAfter$slambdaClass = $;
2308
+ }
2309
+ return HomeApiBase$renewCookieSessionAfter$slambdaClass;
2310
+ }
2311
+ function HomeApiBase$renewCookieSessionAfter$slambda_0(this$0, $generation, resultContinuation) {
2312
+ var i = new (HomeApiBase$renewCookieSessionAfter$slambda())(this$0, $generation, resultContinuation);
2313
+ return constructCallableReference(function($completion) {
2314
+ return i.invoke_llb9nu_k$($completion);
2315
+ }, 0);
2316
+ }
2317
+ var HomeApiBase$refreshSession$slambdaClass;
2318
+ function HomeApiBase$refreshSession$slambda() {
2319
+ if (HomeApiBase$refreshSession$slambdaClass === VOID2) {
2320
+ let $ = function(this$0, resultContinuation) {
2321
+ this.this$0__1 = this$0;
2322
+ CoroutineImpl().call(this, resultContinuation);
2323
+ };
2324
+ initMetadataForLambda($, CoroutineImpl(), VOID2, [0]);
2325
+ protoOf2($).invoke_llb9nu_k$ = function($completion) {
2326
+ var tmp = this.create_d196fn_k$($completion);
2327
+ tmp.result_1 = Unit_instance2;
2328
+ tmp.exception_1 = null;
2329
+ return tmp.doResume_5yljmg_k$();
2330
+ };
2331
+ protoOf2($).invoke_ib42db_k$ = function($completion) {
2332
+ return this.invoke_llb9nu_k$($completion);
2333
+ };
2334
+ protoOf2($).doResume_5yljmg_k$ = function() {
2335
+ var suspendResult = this.result_1;
2336
+ $sm: do
2337
+ try {
2338
+ var tmp = this.state_1;
2339
+ switch (tmp) {
2340
+ case 0:
2341
+ this.exceptionState_1 = 2;
2342
+ this.state_1 = 1;
2343
+ suspendResult = renewCookieSession(this.this$0__1, this);
2344
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
2345
+ return suspendResult;
2346
+ }
2347
+ continue $sm;
2348
+ case 1:
2349
+ return null;
2350
+ case 2:
2351
+ throw this.exception_1;
2352
+ }
2353
+ } catch ($p) {
2354
+ var e = $p;
2355
+ if (this.exceptionState_1 === 2) {
2356
+ throw e;
2357
+ } else {
2358
+ this.state_1 = this.exceptionState_1;
2359
+ this.exception_1 = e;
2360
+ }
2361
+ }
2362
+ while (true);
2363
+ };
2364
+ protoOf2($).create_d196fn_k$ = function(completion) {
2365
+ return new (HomeApiBase$refreshSession$slambda())(this.this$0__1, completion);
2366
+ };
2367
+ HomeApiBase$refreshSession$slambdaClass = $;
2368
+ }
2369
+ return HomeApiBase$refreshSession$slambdaClass;
2370
+ }
2371
+ function HomeApiBase$refreshSession$slambda_0(this$0, resultContinuation) {
2372
+ var i = new (HomeApiBase$refreshSession$slambda())(this$0, resultContinuation);
2373
+ return constructCallableReference(function($completion) {
2374
+ return i.invoke_llb9nu_k$($completion);
2375
+ }, 0);
2376
+ }
2377
+ var HomeApiBase$refreshSession$slambdaClass_0;
2378
+ function HomeApiBase$refreshSession$slambda_1() {
2379
+ if (HomeApiBase$refreshSession$slambdaClass_0 === VOID2) {
2380
+ let $ = function(this$0, $oldTokens, resultContinuation) {
2381
+ this.this$0__1 = this$0;
2382
+ this.$oldTokens_1 = $oldTokens;
2383
+ CoroutineImpl().call(this, resultContinuation);
2384
+ };
2385
+ initMetadataForLambda($, CoroutineImpl(), VOID2, [0]);
2386
+ protoOf2($).invoke_llb9nu_k$ = function($completion) {
2387
+ var tmp = this.create_d196fn_k$($completion);
2388
+ tmp.result_1 = Unit_instance2;
2389
+ tmp.exception_1 = null;
2390
+ return tmp.doResume_5yljmg_k$();
2391
+ };
2392
+ protoOf2($).invoke_ib42db_k$ = function($completion) {
2393
+ return this.invoke_llb9nu_k$($completion);
2394
+ };
2395
+ protoOf2($).doResume_5yljmg_k$ = function() {
2396
+ var suspendResult = this.result_1;
2397
+ $sm: do
2398
+ try {
2399
+ var tmp = this.state_1;
2400
+ switch (tmp) {
2401
+ case 0:
2402
+ this.exceptionState_1 = 2;
2403
+ this.state_1 = 1;
2404
+ suspendResult = renewTokenSession(this.this$0__1, this.$oldTokens_1, this);
2405
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
2406
+ return suspendResult;
2407
+ }
2408
+ continue $sm;
2409
+ case 1:
2410
+ return suspendResult;
2411
+ case 2:
2412
+ throw this.exception_1;
2413
+ }
2414
+ } catch ($p) {
2415
+ var e = $p;
2416
+ if (this.exceptionState_1 === 2) {
2417
+ throw e;
2418
+ } else {
2419
+ this.state_1 = this.exceptionState_1;
2420
+ this.exception_1 = e;
2421
+ }
2422
+ }
2423
+ while (true);
2424
+ };
2425
+ protoOf2($).create_d196fn_k$ = function(completion) {
2426
+ return new (HomeApiBase$refreshSession$slambda_1())(this.this$0__1, this.$oldTokens_1, completion);
2427
+ };
2428
+ HomeApiBase$refreshSession$slambdaClass_0 = $;
2429
+ }
2430
+ return HomeApiBase$refreshSession$slambdaClass_0;
2431
+ }
2432
+ function HomeApiBase$refreshSession$slambda_2(this$0, $oldTokens, resultContinuation) {
2433
+ var i = new (HomeApiBase$refreshSession$slambda_1())(this$0, $oldTokens, resultContinuation);
2434
+ return constructCallableReference(function($completion) {
2435
+ return i.invoke_llb9nu_k$($completion);
2436
+ }, 0);
2437
+ }
2438
+ var HomeApiBase$sharedRefresh$slambdaClass;
2439
+ function HomeApiBase$sharedRefresh$slambda() {
2440
+ if (HomeApiBase$sharedRefresh$slambdaClass === VOID2) {
2441
+ let $ = function($renew, resultContinuation) {
2442
+ this.$renew_1 = $renew;
2443
+ CoroutineImpl().call(this, resultContinuation);
2444
+ };
2445
+ initMetadataForLambda($, CoroutineImpl(), VOID2, [1]);
2446
+ protoOf2($).invoke_o46nj0_k$ = function($this$async, $completion) {
2447
+ var tmp = this.create_rcuf4x_k$($this$async, $completion);
2448
+ tmp.result_1 = Unit_instance2;
2449
+ tmp.exception_1 = null;
2450
+ return tmp.doResume_5yljmg_k$();
2451
+ };
2452
+ protoOf2($).invoke_qns8j1_k$ = function(p1, $completion) {
2453
+ return this.invoke_o46nj0_k$((!(p1 == null) ? isInterface(p1, CoroutineScope()) : false) ? p1 : THROW_CCE2(), $completion);
2454
+ };
2455
+ protoOf2($).doResume_5yljmg_k$ = function() {
2456
+ var suspendResult = this.result_1;
2457
+ $sm: do
2458
+ try {
2459
+ var tmp = this.state_1;
2460
+ switch (tmp) {
2461
+ case 0:
2462
+ this.exceptionState_1 = 2;
2463
+ this.state_1 = 1;
2464
+ suspendResult = this.$renew_1(this);
2465
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
2466
+ return suspendResult;
2467
+ }
2468
+ continue $sm;
2469
+ case 1:
2470
+ return suspendResult;
2471
+ case 2:
2472
+ throw this.exception_1;
2473
+ }
2474
+ } catch ($p) {
2475
+ var e = $p;
2476
+ if (this.exceptionState_1 === 2) {
2477
+ throw e;
2478
+ } else {
2479
+ this.state_1 = this.exceptionState_1;
2480
+ this.exception_1 = e;
2481
+ }
2482
+ }
2483
+ while (true);
2484
+ };
2485
+ protoOf2($).create_rcuf4x_k$ = function($this$async, completion) {
2486
+ var i = new (HomeApiBase$sharedRefresh$slambda())(this.$renew_1, completion);
2487
+ i.$this$async_1 = $this$async;
2488
+ return i;
2489
+ };
2490
+ HomeApiBase$sharedRefresh$slambdaClass = $;
2491
+ }
2492
+ return HomeApiBase$sharedRefresh$slambdaClass;
2493
+ }
2494
+ function HomeApiBase$sharedRefresh$slambda_0($renew, resultContinuation) {
2495
+ var i = new (HomeApiBase$sharedRefresh$slambda())($renew, resultContinuation);
2496
+ return constructCallableReference(function($this$async, $completion) {
2497
+ return i.invoke_o46nj0_k$($this$async, $completion);
2498
+ }, 1);
2499
+ }
2500
+ function HomeApiBase$auth$delegate$lambda(this$0) {
2501
+ return function() {
2502
+ var tmp0_elvis_lhs = this$0.baseUrl_1;
2503
+ var tmp;
2504
+ if (tmp0_elvis_lhs == null) {
2505
+ throw IllegalStateException_init_$Create$2("No Baseurl set!");
2506
+ } else {
2507
+ tmp = tmp0_elvis_lhs;
2508
+ }
2509
+ return create(tmp, this$0.httpClientEngine_1, this$0.clientConfigurator);
2510
+ };
2511
+ }
2512
+ function HomeApiBase$_get_auth_$ref_94oz3e() {
2513
+ return constructCallableReference(function(p0) {
2514
+ return p0.auth;
2515
+ }, 1, 0, 108);
2516
+ }
2517
+ function HomeApiBase$refreshAuth$delegate$lambda(this$0) {
2518
+ return function() {
2519
+ var tmp0_elvis_lhs = this$0.baseUrl_1;
2520
+ var tmp;
2521
+ if (tmp0_elvis_lhs == null) {
2522
+ throw IllegalStateException_init_$Create$2("No Baseurl set!");
2523
+ } else {
2524
+ tmp = tmp0_elvis_lhs;
2525
+ }
2526
+ return create(tmp, this$0.httpClientEngine_1, this$0.refreshClientConfigurator_1);
2527
+ };
2528
+ }
2529
+ function HomeApiBase$_get_refreshAuth_$ref_x2cel7() {
2530
+ return constructCallableReference(function(p0) {
2531
+ return _get_refreshAuth__q4vj66(p0);
2532
+ }, 1, 0, 109);
2533
+ }
2534
+ function HomeApiBase$sessionAuth$delegate$lambda(this$0) {
2535
+ return function() {
2536
+ var tmp0_elvis_lhs = this$0.baseUrl_1;
2537
+ var tmp;
2538
+ if (tmp0_elvis_lhs == null) {
2539
+ throw IllegalStateException_init_$Create$2("No Baseurl set!");
2540
+ } else {
2541
+ tmp = tmp0_elvis_lhs;
2542
+ }
2543
+ return create(removeSuffix(tmp, "/api"), this$0.httpClientEngine_1, this$0.clientConfigurator);
2544
+ };
2545
+ }
2546
+ function HomeApiBase$_get_sessionAuth_$ref_nw0oga() {
2547
+ return constructCallableReference(function(p0) {
2548
+ return _get_sessionAuth__fjt4oj(p0);
2549
+ }, 1, 0, 110);
2550
+ }
2551
+ function HomeApiBase$language$delegate$lambda(this$0) {
2552
+ return function() {
2553
+ var tmp0_elvis_lhs = this$0.baseUrl_1;
2554
+ var tmp;
2555
+ if (tmp0_elvis_lhs == null) {
2556
+ throw IllegalStateException_init_$Create$2("No Baseurl set!");
2557
+ } else {
2558
+ tmp = tmp0_elvis_lhs;
2559
+ }
2560
+ return create_0(tmp, this$0.httpClientEngine_1, this$0.clientConfigurator);
2561
+ };
2562
+ }
2563
+ function HomeApiBase$_get_language_$ref_d0oebq() {
2564
+ return constructCallableReference(function(p0) {
2565
+ return p0.language;
2566
+ }, 1, 0, 111);
2567
+ }
2568
+ function HomeApiBase$devices$delegate$lambda(this$0) {
2569
+ return function() {
2570
+ var tmp0_elvis_lhs = this$0.baseUrl_1;
2571
+ var tmp;
2572
+ if (tmp0_elvis_lhs == null) {
2573
+ throw IllegalStateException_init_$Create$2("No Baseurl set!");
2574
+ } else {
2575
+ tmp = tmp0_elvis_lhs;
2576
+ }
2577
+ return new (DeviceClient())(tmp, this$0.httpClientEngine_1, this$0.clientConfigurator);
2578
+ };
2579
+ }
2580
+ function HomeApiBase$_get_devices_$ref_5mpuln() {
2581
+ return constructCallableReference(function(p0) {
2582
+ return p0.devices;
2583
+ }, 1, 0, 112);
2584
+ }
2585
+ var HomeApiBase$eventBusConnection$slambdaClass;
2586
+ function HomeApiBase$eventBusConnection$slambda() {
2587
+ if (HomeApiBase$eventBusConnection$slambdaClass === VOID2) {
2588
+ let $ = function(this$0, resultContinuation) {
2589
+ this.this$0__1 = this$0;
2590
+ CoroutineImpl().call(this, resultContinuation);
2591
+ };
2592
+ initMetadataForLambda($, CoroutineImpl(), VOID2, [0]);
2593
+ protoOf2($).invoke_se6999_k$ = function($completion) {
2594
+ var tmp = this.create_d196fn_k$($completion);
2595
+ tmp.result_1 = Unit_instance2;
2596
+ tmp.exception_1 = null;
2597
+ return tmp.doResume_5yljmg_k$();
2598
+ };
2599
+ protoOf2($).invoke_ib42db_k$ = function($completion) {
2600
+ return this.invoke_se6999_k$($completion);
2601
+ };
2602
+ protoOf2($).doResume_5yljmg_k$ = function() {
2603
+ var suspendResult = this.result_1;
2604
+ $sm: do
2605
+ try {
2606
+ var tmp = this.state_1;
2607
+ if (tmp === 0) {
2608
+ this.exceptionState_1 = 1;
2609
+ var tmp_0;
2610
+ switch (this.this$0__1.authMode.ordinal_1) {
2611
+ case 2:
2612
+ case 0:
2613
+ var tmp1_safe_receiver = this.this$0__1.bearerToken_1;
2614
+ var tmp_1;
2615
+ if (tmp1_safe_receiver == null) {
2616
+ tmp_1 = null;
2209
2617
  } else {
2210
2618
  tmp_1 = mapOf(to("Authorization", "Bearer " + tmp1_safe_receiver));
2211
2619
  }
@@ -2257,7 +2665,7 @@ function HomeApiBase$appStores$delegate$lambda(this$0) {
2257
2665
  function HomeApiBase$_get_appStores_$ref_k22az() {
2258
2666
  return constructCallableReference(function(p0) {
2259
2667
  return p0.appStores;
2260
- }, 1, 0, 112);
2668
+ }, 1, 0, 113);
2261
2669
  }
2262
2670
  function HomeApiBase$unsubscribe$delegate$lambda(this$0) {
2263
2671
  return function() {
@@ -2274,7 +2682,7 @@ function HomeApiBase$unsubscribe$delegate$lambda(this$0) {
2274
2682
  function HomeApiBase$_get_unsubscribe_$ref_yqv4cp() {
2275
2683
  return constructCallableReference(function(p0) {
2276
2684
  return p0.unsubscribe;
2277
- }, 1, 0, 113);
2685
+ }, 1, 0, 114);
2278
2686
  }
2279
2687
  function HomeApiBase$apiPathAuth$delegate$lambda(this$0) {
2280
2688
  return function() {
@@ -2298,7 +2706,7 @@ function HomeApiBase$apiPathAuth$delegate$lambda(this$0) {
2298
2706
  function HomeApiBase$_get_apiPathAuth_$ref_auoli7() {
2299
2707
  return constructCallableReference(function(p0) {
2300
2708
  return _get_apiPathAuth__nqn62(p0);
2301
- }, 1, 0, 114);
2709
+ }, 1, 0, 115);
2302
2710
  }
2303
2711
  function OriginRevoke_REVOKED_getInstance() {
2304
2712
  static_init_0();
@@ -2509,48 +2917,21 @@ function $renewCookieSessionAfterCOROUTINE$() {
2509
2917
  var tmp = this.state_1;
2510
2918
  switch (tmp) {
2511
2919
  case 0:
2512
- this.exceptionState_1 = 11;
2513
- this.this1__1 = this._this__u8e3s4__1.refreshLock_1;
2514
- this.owner0__1 = null;
2920
+ this.exceptionState_1 = 3;
2921
+ this.exceptionState_1 = 2;
2515
2922
  this.state_1 = 1;
2516
- suspendResult = this.this1__1.lock_ugrcvf_k$(this.owner0__1, this);
2923
+ suspendResult = sharedRefresh(this._this__u8e3s4__1, HomeApiBase$renewCookieSessionAfter$slambda_0(this._this__u8e3s4__1, this.generation_1, null), this);
2517
2924
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
2518
2925
  return suspendResult;
2519
2926
  }
2520
2927
  continue $sm;
2521
2928
  case 1:
2522
- this.tmp$ret$22__1 = Unit_instance2;
2523
- this.state_1 = 2;
2929
+ this.TRY_RESULT0__1 = true;
2930
+ this.exceptionState_1 = 3;
2931
+ this.state_1 = 4;
2524
2932
  continue $sm;
2525
2933
  case 2:
2526
- this.exceptionState_1 = 10;
2527
- this.tmp$ret$03__1 = Unit_instance2;
2528
- this.state_1 = 3;
2529
- continue $sm;
2530
- case 3:
2531
- if (!(this._this__u8e3s4__1.cookieSessionGeneration_1 === this.generation_1)) {
2532
- this.tmp$ret$03__1 = true;
2533
- this.state_1 = 8;
2534
- continue $sm;
2535
- } else {
2536
- this.state_1 = 4;
2537
- continue $sm;
2538
- }
2539
- case 4:
2540
- this.exceptionState_1 = 6;
2541
- this.state_1 = 5;
2542
- suspendResult = renewCookieSession(this._this__u8e3s4__1, this);
2543
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
2544
- return suspendResult;
2545
- }
2546
- continue $sm;
2547
- case 5:
2548
- this.TRY_RESULT4__1 = true;
2549
- this.exceptionState_1 = 10;
2550
- this.state_1 = 7;
2551
- continue $sm;
2552
- case 6:
2553
- this.exceptionState_1 = 10;
2934
+ this.exceptionState_1 = 3;
2554
2935
  var tmp_0 = this.exception_1;
2555
2936
  if (tmp_0 instanceof CancellationException()) {
2556
2937
  var cancelled = this.exception_1;
@@ -2561,43 +2942,22 @@ function $renewCookieSessionAfterCOROUTINE$() {
2561
2942
  if (tmp_2 instanceof Exception()) {
2562
2943
  var failure = this.exception_1;
2563
2944
  var tmp_3 = this;
2564
- tmp_3.TRY_RESULT4__1 = false;
2565
- this.state_1 = 7;
2945
+ tmp_3.TRY_RESULT0__1 = false;
2946
+ this.state_1 = 4;
2566
2947
  continue $sm;
2567
2948
  } else {
2568
2949
  throw this.exception_1;
2569
2950
  }
2570
2951
  }
2571
- case 7:
2572
- this.exceptionState_1 = 10;
2573
- this.tmp$ret$03__1 = this.TRY_RESULT4__1;
2574
- if (false) {
2575
- this.state_1 = 3;
2576
- continue $sm;
2577
- }
2578
- this.state_1 = 8;
2579
- continue $sm;
2580
- case 8:
2581
- this.tmp$ret$22__1 = this.tmp$ret$03__1;
2582
- this.exceptionState_1 = 11;
2583
- this.state_1 = 9;
2584
- continue $sm;
2585
- case 9:
2586
- var tmp_4 = this.tmp$ret$22__1;
2587
- this.exceptionState_1 = 11;
2588
- this.this1__1.unlock_ulcrcl_k$(this.owner0__1);
2589
- return tmp_4;
2590
- case 10:
2591
- this.exceptionState_1 = 11;
2592
- var t = this.exception_1;
2593
- this.this1__1.unlock_ulcrcl_k$(this.owner0__1);
2594
- throw t;
2595
- case 11:
2952
+ case 3:
2596
2953
  throw this.exception_1;
2954
+ case 4:
2955
+ this.exceptionState_1 = 3;
2956
+ return this.TRY_RESULT0__1;
2597
2957
  }
2598
2958
  } catch ($p) {
2599
2959
  var e = $p;
2600
- if (this.exceptionState_1 === 11) {
2960
+ if (this.exceptionState_1 === 3) {
2601
2961
  throw e;
2602
2962
  } else {
2603
2963
  this.state_1 = this.exceptionState_1;
@@ -2681,7 +3041,7 @@ function $renewCookieSessionCOROUTINE$() {
2681
3041
  }
2682
3042
  continue $sm;
2683
3043
  } else {
2684
- if (tmp3_subject === Companion_getInstance_0().Unauthorized_1.value_1) {
3044
+ if (tmp3_subject === Companion_getInstance_1().Unauthorized_1.value_1) {
2685
3045
  this._this__u8e3s4__1.settings_1.remove_6241ba_k$("userLogin");
2686
3046
  this.state_1 = 5;
2687
3047
  suspendResult = endSession(this._this__u8e3s4__1, this);
@@ -2695,7 +3055,7 @@ function $renewCookieSessionCOROUTINE$() {
2695
3055
  }
2696
3056
  }
2697
3057
  case 5:
2698
- this.ARGUMENT1__1 = Companion_getInstance_0().Unauthorized_1.value_1;
3058
+ this.ARGUMENT1__1 = Companion_getInstance_1().Unauthorized_1.value_1;
2699
3059
  this.state_1 = 6;
2700
3060
  suspendResult = bodyAsText(this.response2__1.response, VOID2, this);
2701
3061
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
@@ -2753,164 +3113,419 @@ function $refreshSessionCOROUTINE$() {
2753
3113
  var tmp = this.state_1;
2754
3114
  switch (tmp) {
2755
3115
  case 0:
2756
- this.exceptionState_1 = 26;
2757
- this.this1__1 = this._this__u8e3s4__1.refreshLock_1;
2758
- this.owner0__1 = null;
3116
+ this.exceptionState_1 = 9;
3117
+ var tmp0 = this._this__u8e3s4__1.authMode.ordinal_1;
3118
+ if (tmp0 === 2) {
3119
+ this.this1__1 = this._this__u8e3s4__1.refreshLock_1;
3120
+ this.owner0__1 = null;
3121
+ this.state_1 = 3;
3122
+ suspendResult = this.this1__1.lock_ugrcvf_k$(this.owner0__1, this);
3123
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
3124
+ return suspendResult;
3125
+ }
3126
+ continue $sm;
3127
+ } else {
3128
+ if (tmp0 === 1) {
3129
+ this.state_1 = 2;
3130
+ suspendResult = sharedRefresh(this._this__u8e3s4__1, HomeApiBase$refreshSession$slambda_0(this._this__u8e3s4__1, null), this);
3131
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
3132
+ return suspendResult;
3133
+ }
3134
+ continue $sm;
3135
+ } else {
3136
+ if (tmp0 === 0) {
3137
+ this.state_1 = 1;
3138
+ suspendResult = sharedRefresh(this._this__u8e3s4__1, HomeApiBase$refreshSession$slambda_2(this._this__u8e3s4__1, this.oldTokens_1, null), this);
3139
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
3140
+ return suspendResult;
3141
+ }
3142
+ continue $sm;
3143
+ } else {
3144
+ var tmp_0 = this;
3145
+ noWhenBranchMatchedException2();
3146
+ }
3147
+ }
3148
+ }
3149
+ break;
3150
+ case 1:
3151
+ this.WHEN_RESULT2__1 = suspendResult;
3152
+ this.state_1 = 7;
3153
+ continue $sm;
3154
+ case 2:
3155
+ this.WHEN_RESULT2__1 = suspendResult;
3156
+ this.state_1 = 7;
3157
+ continue $sm;
3158
+ case 3:
3159
+ this.tmp$ret$03__1 = Unit_instance2;
3160
+ this.state_1 = 4;
3161
+ continue $sm;
3162
+ case 4:
3163
+ this.exceptionState_1 = 8;
3164
+ this.state_1 = 5;
3165
+ suspendResult = machineTokens(this._this__u8e3s4__1, this);
3166
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
3167
+ return suspendResult;
3168
+ }
3169
+ continue $sm;
3170
+ case 5:
3171
+ this.tmp$ret$03__1 = suspendResult;
3172
+ this.exceptionState_1 = 9;
3173
+ this.state_1 = 6;
3174
+ continue $sm;
3175
+ case 6:
3176
+ var tmp_1 = this.tmp$ret$03__1;
3177
+ this.exceptionState_1 = 9;
3178
+ this.this1__1.unlock_ulcrcl_k$(this.owner0__1);
3179
+ this.WHEN_RESULT2__1 = tmp_1;
3180
+ this.state_1 = 7;
3181
+ continue $sm;
3182
+ case 7:
3183
+ return this.WHEN_RESULT2__1;
3184
+ case 8:
3185
+ this.exceptionState_1 = 9;
3186
+ var t = this.exception_1;
3187
+ this.this1__1.unlock_ulcrcl_k$(this.owner0__1);
3188
+ throw t;
3189
+ case 9:
3190
+ throw this.exception_1;
3191
+ }
3192
+ } catch ($p) {
3193
+ var e = $p;
3194
+ if (this.exceptionState_1 === 9) {
3195
+ throw e;
3196
+ } else {
3197
+ this.state_1 = this.exceptionState_1;
3198
+ this.exception_1 = e;
3199
+ }
3200
+ }
3201
+ while (true);
3202
+ };
3203
+ $refreshSessionCOROUTINE$Class = $;
3204
+ }
3205
+ return $refreshSessionCOROUTINE$Class;
3206
+ }
3207
+ var $sharedRefreshCOROUTINE$Class;
3208
+ function $sharedRefreshCOROUTINE$() {
3209
+ if ($sharedRefreshCOROUTINE$Class === VOID2) {
3210
+ let $ = function(_this__u8e3s4, renew, resultContinuation) {
3211
+ CoroutineImpl().call(this, resultContinuation);
3212
+ this._this__u8e3s4__1 = _this__u8e3s4;
3213
+ this.renew_1 = renew;
3214
+ };
3215
+ initMetadataForCoroutine($, CoroutineImpl());
3216
+ protoOf2($).doResume_5yljmg_k$ = function() {
3217
+ var suspendResult = this.result_1;
3218
+ $sm: do
3219
+ try {
3220
+ var tmp = this.state_1;
3221
+ switch (tmp) {
3222
+ case 0:
3223
+ this.exceptionState_1 = 5;
3224
+ if (!(this.get_context_h02k06_k$().get_y2st91_k$(Key_instance) == null))
3225
+ return null;
3226
+ this.this2__1 = this._this__u8e3s4__1.refreshGate_1;
3227
+ this.owner1__1 = null;
2759
3228
  this.state_1 = 1;
2760
- suspendResult = this.this1__1.lock_ugrcvf_k$(this.owner0__1, this);
3229
+ suspendResult = this.this2__1.lock_ugrcvf_k$(this.owner1__1, this);
2761
3230
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
2762
3231
  return suspendResult;
2763
3232
  }
2764
3233
  continue $sm;
2765
3234
  case 1:
2766
- this.tmp$ret$22__1 = Unit_instance2;
3235
+ var tmp$ret$0 = Unit_instance2;
3236
+ l$ret$1: do {
3237
+ var tmp_0;
3238
+ try {
3239
+ var tmp0_safe_receiver = this._this__u8e3s4__1.refreshInFlight_1;
3240
+ var tmp_1;
3241
+ if (tmp0_safe_receiver == null) {
3242
+ tmp_1 = null;
3243
+ } else {
3244
+ var tmp_2;
3245
+ if (tmp0_safe_receiver.get_isActive_quafmh_k$()) {
3246
+ tmp_2 = tmp0_safe_receiver;
3247
+ } else {
3248
+ tmp_2 = null;
3249
+ }
3250
+ tmp_1 = tmp_2;
3251
+ }
3252
+ var tmp1_elvis_lhs = tmp_1;
3253
+ var tmp_3;
3254
+ if (tmp1_elvis_lhs == null) {
3255
+ var tmp_4 = RefreshInProgress_getInstance();
3256
+ var this_0 = async(this._this__u8e3s4__1.sessionScope_1, tmp_4, VOID2, HomeApiBase$sharedRefresh$slambda_0(this.renew_1, null));
3257
+ this._this__u8e3s4__1.refreshInFlight_1 = this_0;
3258
+ tmp_3 = this_0;
3259
+ } else {
3260
+ tmp_3 = tmp1_elvis_lhs;
3261
+ }
3262
+ tmp$ret$0 = tmp_3;
3263
+ break l$ret$1;
3264
+ } catch ($p) {
3265
+ var tmp_5;
3266
+ var t = $p;
3267
+ this.this2__1.unlock_ulcrcl_k$(this.owner1__1);
3268
+ throw t;
3269
+ }
3270
+ } while (false);
3271
+ var tmp_6 = tmp$ret$0;
3272
+ this.this2__1.unlock_ulcrcl_k$(this.owner1__1);
3273
+ var refresh = tmp_6;
3274
+ this.exceptionState_1 = 3;
2767
3275
  this.state_1 = 2;
3276
+ suspendResult = refresh.await_4rdzbx_k$(this);
3277
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
3278
+ return suspendResult;
3279
+ }
2768
3280
  continue $sm;
2769
3281
  case 2:
2770
- this.exceptionState_1 = 25;
2771
- this.tmp$ret$03__1 = Unit_instance2;
2772
- this.state_1 = 3;
3282
+ this.TRY_RESULT0__1 = suspendResult;
3283
+ this.exceptionState_1 = 5;
3284
+ this.state_1 = 4;
2773
3285
  continue $sm;
2774
3286
  case 3:
2775
- if (this._this__u8e3s4__1.authMode.equals(AuthMode_M2M_getInstance())) {
2776
- var now = System_instance.now_2cba_k$().toEpochMilliseconds_82cfls_k$();
2777
- var tokenAge = subtract(now, this._this__u8e3s4__1.tokenTimestamp);
2778
- if (!(this._this__u8e3s4__1.bearerToken_1 == null) && tokenAge < 900000n) {
2779
- this.tmp$ret$03__1 = new (BearerTokens())(ensureNotNull(this._this__u8e3s4__1.bearerToken_1), "");
2780
- this.state_1 = 23;
2781
- continue $sm;
2782
- } else {
2783
- this.state_1 = 20;
2784
- continue $sm;
2785
- }
3287
+ this.exceptionState_1 = 5;
3288
+ var tmp_7 = this.exception_1;
3289
+ if (tmp_7 instanceof CancellationException()) {
3290
+ var cancelled = this.exception_1;
3291
+ var tmp_8 = this;
3292
+ ensureActive(this.get_context_h02k06_k$());
3293
+ throw new (UnknownRefreshErrorException())("The refresh was interrupted");
2786
3294
  } else {
2787
- this.state_1 = 4;
2788
- continue $sm;
3295
+ throw this.exception_1;
2789
3296
  }
2790
3297
  case 4:
2791
- if (this._this__u8e3s4__1.authMode.equals(AuthMode_COOKIE_getInstance())) {
2792
- this.state_1 = 19;
2793
- suspendResult = renewCookieSession(this._this__u8e3s4__1, this);
2794
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
2795
- return suspendResult;
2796
- }
2797
- continue $sm;
2798
- } else {
2799
- this.state_1 = 5;
2800
- continue $sm;
2801
- }
3298
+ this.exceptionState_1 = 5;
3299
+ return this.TRY_RESULT0__1;
2802
3300
  case 5:
2803
- var tmp_0 = this;
2804
- var tmp4_elvis_lhs = this.oldTokens_1;
3301
+ throw this.exception_1;
3302
+ }
3303
+ } catch ($p_0) {
3304
+ var e = $p_0;
3305
+ if (this.exceptionState_1 === 5) {
3306
+ throw e;
3307
+ } else {
3308
+ this.state_1 = this.exceptionState_1;
3309
+ this.exception_1 = e;
3310
+ }
3311
+ }
3312
+ while (true);
3313
+ };
3314
+ $sharedRefreshCOROUTINE$Class = $;
3315
+ }
3316
+ return $sharedRefreshCOROUTINE$Class;
3317
+ }
3318
+ var $machineTokensCOROUTINE$Class;
3319
+ function $machineTokensCOROUTINE$() {
3320
+ if ($machineTokensCOROUTINE$Class === VOID2) {
3321
+ let $ = function(_this__u8e3s4, resultContinuation) {
3322
+ CoroutineImpl().call(this, resultContinuation);
3323
+ this._this__u8e3s4__1 = _this__u8e3s4;
3324
+ };
3325
+ initMetadataForCoroutine($, CoroutineImpl());
3326
+ protoOf2($).doResume_5yljmg_k$ = function() {
3327
+ var suspendResult = this.result_1;
3328
+ $sm: do
3329
+ try {
3330
+ var tmp = this.state_1;
3331
+ switch (tmp) {
3332
+ case 0:
3333
+ this.exceptionState_1 = 3;
3334
+ var now = System_instance.now_2cba_k$().toEpochMilliseconds_82cfls_k$();
3335
+ var tokenAge = subtract(now, this._this__u8e3s4__1.tokenTimestamp);
3336
+ if (!(this._this__u8e3s4__1.bearerToken_1 == null) && tokenAge < 900000n) {
3337
+ return new (BearerTokens())(ensureNotNull(this._this__u8e3s4__1.bearerToken_1), "");
3338
+ }
3339
+ this.state_1 = 1;
3340
+ var tmp_0 = _get_authM2M__c6rkbz(this._this__u8e3s4__1);
3341
+ var tmp0_elvis_lhs = this._this__u8e3s4__1.clientId;
2805
3342
  var tmp_1;
2806
- if (tmp4_elvis_lhs == null) {
2807
- var tmp5_elvis_lhs = this._this__u8e3s4__1.bearerToken_1;
2808
- tmp_1 = new (BearerTokens())(tmp5_elvis_lhs == null ? "" : tmp5_elvis_lhs, this._this__u8e3s4__1.refreshToken_1);
3343
+ if (tmp0_elvis_lhs == null) {
3344
+ throw Exception_init_$Create$("M2M Client ID not set");
3345
+ } else {
3346
+ tmp_1 = tmp0_elvis_lhs;
3347
+ }
3348
+ var tmp_2 = tmp_1;
3349
+ var tmp1_elvis_lhs = this._this__u8e3s4__1.clientSecret;
3350
+ var tmp_3;
3351
+ if (tmp1_elvis_lhs == null) {
3352
+ throw Exception_init_$Create$("M2M Client Secret not set");
3353
+ } else {
3354
+ tmp_3 = tmp1_elvis_lhs;
3355
+ }
3356
+ suspendResult = tmp_0.createM2MTokens$suspendBridge_5mlkf0_k$(new (CreateM2MTokensCommand())(tmp_2, tmp_3, normalizedM2MScopes(this._this__u8e3s4__1.scopes)), this);
3357
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
3358
+ return suspendResult;
3359
+ }
3360
+ continue $sm;
3361
+ case 1:
3362
+ var response = suspendResult;
3363
+ if (!(response.status === Companion_getInstance_1().Created_1.value_1)) {
3364
+ throw Exception_init_$Create$("M2M Token acquisition failed with status " + response.status);
3365
+ }
3366
+ this.state_1 = 2;
3367
+ suspendResult = response.body$suspendBridge_a6dedm_k$(this);
3368
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
3369
+ return suspendResult;
3370
+ }
3371
+ continue $sm;
3372
+ case 2:
3373
+ var authResult = suspendResult;
3374
+ var tmp2_elvis_lhs = authResult.tokens;
3375
+ var tmp_4;
3376
+ if (tmp2_elvis_lhs == null) {
3377
+ throw Exception_init_$Create$("M2M Token acquisition returned no tokens");
3378
+ } else {
3379
+ tmp_4 = tmp2_elvis_lhs;
3380
+ }
3381
+ var tokens = tmp_4;
3382
+ this._this__u8e3s4__1.setToken(bearerEnvelope(this._this__u8e3s4__1, tokens));
3383
+ this._this__u8e3s4__1.set_userId_wekl5g_k$(tokens.identity);
3384
+ this._this__u8e3s4__1.tokenTimestamp = System_instance.now_2cba_k$().toEpochMilliseconds_82cfls_k$();
3385
+ var tmp3_safe_receiver = this._this__u8e3s4__1.bearerToken_1;
3386
+ var tmp_5;
3387
+ if (tmp3_safe_receiver == null) {
3388
+ tmp_5 = null;
3389
+ } else {
3390
+ tmp_5 = new (BearerTokens())(tmp3_safe_receiver, "");
3391
+ }
3392
+ return tmp_5;
3393
+ case 3:
3394
+ throw this.exception_1;
3395
+ }
3396
+ } catch ($p) {
3397
+ var e = $p;
3398
+ if (this.exceptionState_1 === 3) {
3399
+ throw e;
3400
+ } else {
3401
+ this.state_1 = this.exceptionState_1;
3402
+ this.exception_1 = e;
3403
+ }
3404
+ }
3405
+ while (true);
3406
+ };
3407
+ $machineTokensCOROUTINE$Class = $;
3408
+ }
3409
+ return $machineTokensCOROUTINE$Class;
3410
+ }
3411
+ var $renewTokenSessionCOROUTINE$Class;
3412
+ function $renewTokenSessionCOROUTINE$() {
3413
+ if ($renewTokenSessionCOROUTINE$Class === VOID2) {
3414
+ let $ = function(_this__u8e3s4, oldTokens, resultContinuation) {
3415
+ CoroutineImpl().call(this, resultContinuation);
3416
+ this._this__u8e3s4__1 = _this__u8e3s4;
3417
+ this.oldTokens_1 = oldTokens;
3418
+ };
3419
+ initMetadataForCoroutine($, CoroutineImpl());
3420
+ protoOf2($).doResume_5yljmg_k$ = function() {
3421
+ var suspendResult = this.result_1;
3422
+ $sm: do
3423
+ try {
3424
+ var tmp = this.state_1;
3425
+ switch (tmp) {
3426
+ case 0:
3427
+ this.exceptionState_1 = 10;
3428
+ var tmp0_elvis_lhs = this.oldTokens_1;
3429
+ var tmp_0;
3430
+ if (tmp0_elvis_lhs == null) {
3431
+ var tmp1_elvis_lhs = this._this__u8e3s4__1.bearerToken_1;
3432
+ tmp_0 = new (BearerTokens())(tmp1_elvis_lhs == null ? "" : tmp1_elvis_lhs, this._this__u8e3s4__1.refreshToken_1);
2809
3433
  } else {
2810
- tmp_1 = tmp4_elvis_lhs;
3434
+ tmp_0 = tmp0_elvis_lhs;
2811
3435
  }
2812
- tmp_0.tokensToUse5__1 = tmp_1;
3436
+ var tokensToUse = tmp_0;
2813
3437
  var persisted = this._this__u8e3s4__1.settings_1.getStringOrNull_w9a5ex_k$("refreshToken");
2814
3438
  var current = this._this__u8e3s4__1.refreshToken_1;
2815
- var old = this.tokensToUse5__1.refreshToken_1;
3439
+ this.old0__1 = tokensToUse.refreshToken_1;
3440
+ var tmp_1;
2816
3441
  var tmp_2;
2817
- var tmp_3;
2818
- if (old == null || isBlank(old)) {
2819
- tmp_3 = true;
2820
- } else {
2821
- tmp_3 = !(old == persisted);
2822
- }
2823
- if (tmp_3) {
3442
+ var this_0 = this.old0__1;
3443
+ if (this_0 == null || isBlank(this_0)) {
2824
3444
  tmp_2 = true;
2825
3445
  } else {
2826
- tmp_2 = !(old == current);
3446
+ tmp_2 = !(this.old0__1 == persisted);
2827
3447
  }
2828
3448
  if (tmp_2) {
2829
- var tmp_4 = this;
2830
- var tmp0_elvis_lhs = this._this__u8e3s4__1.bearerToken_1;
2831
- var tmp_5 = tmp0_elvis_lhs == null ? "" : tmp0_elvis_lhs;
2832
- tmp_4.tmp$ret$03__1 = new (BearerTokens())(tmp_5, current == null ? "" : current);
2833
- this.state_1 = 23;
2834
- continue $sm;
3449
+ tmp_1 = true;
2835
3450
  } else {
2836
- this.state_1 = 6;
2837
- continue $sm;
3451
+ tmp_1 = !(this.old0__1 == current);
2838
3452
  }
2839
- case 6:
2840
- if (!(this._this__u8e3s4__1.refreshToken_1 == this.tokensToUse5__1.refreshToken_1)) {
2841
- var tmp_6 = this;
2842
- var tmp6_elvis_lhs = this._this__u8e3s4__1.bearerToken_1;
2843
- var tmp_7 = tmp6_elvis_lhs == null ? "" : tmp6_elvis_lhs;
2844
- var tmp7_elvis_lhs = this._this__u8e3s4__1.refreshToken_1;
2845
- tmp_6.tmp$ret$03__1 = new (BearerTokens())(tmp_7, tmp7_elvis_lhs == null ? "" : tmp7_elvis_lhs);
2846
- this.state_1 = 23;
2847
- continue $sm;
3453
+ if (tmp_1) {
3454
+ var tmp0_elvis_lhs_0 = this._this__u8e3s4__1.bearerToken_1;
3455
+ var tmp_3 = tmp0_elvis_lhs_0 == null ? "" : tmp0_elvis_lhs_0;
3456
+ return new (BearerTokens())(tmp_3, current == null ? "" : current);
3457
+ }
3458
+ var tmp2_safe_receiver = this._this__u8e3s4__1.userId;
3459
+ var tmp_4;
3460
+ if (tmp2_safe_receiver == null) {
3461
+ tmp_4 = null;
2848
3462
  } else {
2849
- this.state_1 = 7;
2850
- continue $sm;
3463
+ var tmp_5;
3464
+ if (!isBlank(tmp2_safe_receiver)) {
3465
+ tmp_5 = tmp2_safe_receiver;
3466
+ } else {
3467
+ tmp_5 = null;
3468
+ }
3469
+ tmp_4 = tmp_5;
2851
3470
  }
2852
- case 7:
2853
- var this_0 = this.tokensToUse5__1.refreshToken_1;
2854
- if (this_0 == null || isBlank(this_0)) {
2855
- var tmp_8 = this;
2856
- tmp_8.WHEN_RESULT4__1 = null;
2857
- this.state_1 = 18;
2858
- continue $sm;
3471
+ var tmp3_elvis_lhs = tmp_4;
3472
+ var tmp_6;
3473
+ if (tmp3_elvis_lhs == null) {
3474
+ return null;
2859
3475
  } else {
2860
- var this_1 = this._this__u8e3s4__1.userId;
2861
- if (this_1 == null || isBlank(this_1)) {
2862
- var tmp_9 = this;
2863
- tmp_9.WHEN_RESULT4__1 = null;
2864
- this.state_1 = 18;
2865
- continue $sm;
3476
+ tmp_6 = tmp3_elvis_lhs;
3477
+ }
3478
+ var user = tmp_6;
3479
+ var tmp4_safe_receiver = this._this__u8e3s4__1.clientId;
3480
+ var tmp_7;
3481
+ if (tmp4_safe_receiver == null) {
3482
+ tmp_7 = null;
3483
+ } else {
3484
+ var tmp_8;
3485
+ if (!isBlank(tmp4_safe_receiver)) {
3486
+ tmp_8 = tmp4_safe_receiver;
2866
3487
  } else {
2867
- var this_2 = this._this__u8e3s4__1.clientId;
2868
- if (this_2 == null || isBlank(this_2)) {
2869
- var tmp_10 = this;
2870
- tmp_10.WHEN_RESULT4__1 = null;
2871
- this.state_1 = 18;
2872
- continue $sm;
2873
- } else {
2874
- var this_3 = this._this__u8e3s4__1;
2875
- this.exceptionState_1 = 16;
2876
- this.tmp07__1 = Companion_instance2;
2877
- this.$this$runCatching11__1 = this_3;
2878
- var deviceKey = this.$this$runCatching11__1.device_1.key(ensureNotNull(this.$this$runCatching11__1.userId));
2879
- var this_4 = logging();
2880
- if (KmLogging_getInstance().isLoggingDebug_1) {
2881
- this_4.debugApi_8ssb7n_k$(this_4.tagName_1, toString_0("Device key for refresh: " + deviceKey));
2882
- }
2883
- this.exceptionState_1 = 9;
2884
- this.state_1 = 8;
2885
- var tmp_11 = this.$this$runCatching11__1.auth;
2886
- var tmp1_clientId = ensureNotNull(this.$this$runCatching11__1.clientId);
2887
- var tmp2_fingerprint = this.$this$runCatching11__1.fingerprinter_1.print(ensureNotNull(this.$this$runCatching11__1.userId));
2888
- var tmp0_elvis_lhs_0 = this.$this$runCatching11__1.refreshToken_1;
2889
- var tmp3_refreshToken = tmp0_elvis_lhs_0 == null ? ensureNotNull(this.tokensToUse5__1.refreshToken_1) : tmp0_elvis_lhs_0;
2890
- var tmp4_userId = ensureNotNull(this.$this$runCatching11__1.userId);
2891
- var tmp5_deviceKey = this.$this$runCatching11__1.device_1.key(ensureNotNull(this.$this$runCatching11__1.userId));
2892
- suspendResult = tmp_11.refreshTokens$suspendBridge_qhelbw_k$(new (RefreshTokensCommand())(tmp1_clientId, tmp5_deviceKey, tmp2_fingerprint, tmp3_refreshToken, tmp4_userId), this);
2893
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
2894
- return suspendResult;
2895
- }
2896
- continue $sm;
2897
- }
3488
+ tmp_8 = null;
2898
3489
  }
3490
+ tmp_7 = tmp_8;
3491
+ }
3492
+ var tmp5_elvis_lhs = tmp_7;
3493
+ var tmp_9;
3494
+ if (tmp5_elvis_lhs == null) {
3495
+ return null;
3496
+ } else {
3497
+ tmp_9 = tmp5_elvis_lhs;
3498
+ }
3499
+ var client = tmp_9;
3500
+ var this_1 = this._this__u8e3s4__1;
3501
+ this.exceptionState_1 = 9;
3502
+ this.tmp02__1 = Companion_instance2;
3503
+ this.$this$runCatching6__1 = this_1;
3504
+ this.exceptionState_1 = 2;
3505
+ this.state_1 = 1;
3506
+ var tmp_10 = _get_refreshAuth__q4vj66(this.$this$runCatching6__1);
3507
+ var tmp0_fingerprint = this.$this$runCatching6__1.fingerprinter_1.print(user);
3508
+ var tmp1_refreshToken = this.old0__1;
3509
+ var tmp2_deviceKey = this.$this$runCatching6__1.device_1.key(user);
3510
+ suspendResult = tmp_10.refreshTokens$suspendBridge_qhelbw_k$(new (RefreshTokensCommand())(client, tmp2_deviceKey, tmp0_fingerprint, tmp1_refreshToken, user), this);
3511
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
3512
+ return suspendResult;
2899
3513
  }
2900
- case 8:
2901
- this.TRY_RESULT12__1 = suspendResult;
2902
- this.exceptionState_1 = 16;
2903
- this.state_1 = 11;
2904
3514
  continue $sm;
2905
- case 9:
2906
- this.exceptionState_1 = 16;
2907
- var tmp_12 = this.exception_1;
2908
- if (tmp_12 instanceof SoliboSDKError()) {
2909
- this.failure13__1 = this.exception_1;
2910
- if (!rejectsRefreshToken(this.failure13__1))
2911
- throw this.failure13__1;
2912
- this.state_1 = 10;
2913
- suspendResult = endSession(this.$this$runCatching11__1, this);
3515
+ case 1:
3516
+ this.TRY_RESULT7__1 = suspendResult;
3517
+ this.exceptionState_1 = 9;
3518
+ this.state_1 = 4;
3519
+ continue $sm;
3520
+ case 2:
3521
+ this.exceptionState_1 = 9;
3522
+ var tmp_11 = this.exception_1;
3523
+ if (tmp_11 instanceof SoliboSDKError()) {
3524
+ this.failure8__1 = this.exception_1;
3525
+ if (!rejectsRefreshToken(this.failure8__1))
3526
+ throw this.failure8__1;
3527
+ this.state_1 = 3;
3528
+ suspendResult = endSession(this.$this$runCatching6__1, this);
2914
3529
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
2915
3530
  return suspendResult;
2916
3531
  }
@@ -2918,269 +3533,204 @@ function $refreshSessionCOROUTINE$() {
2918
3533
  } else {
2919
3534
  throw this.exception_1;
2920
3535
  }
2921
- case 10:
2922
- var tmp_13 = this;
2923
- throw new (RefreshRefused())(this.failure13__1);
2924
- case 11:
2925
- this.exceptionState_1 = 16;
2926
- this.response10__1 = this.TRY_RESULT12__1;
2927
- var tmp6_subject = this.response10__1.status;
2928
- if (tmp6_subject === Companion_getInstance_0().Accepted_1.value_1) {
2929
- this.state_1 = 14;
2930
- suspendResult = this.response10__1.body$suspendBridge_a6dedm_k$(this);
3536
+ case 3:
3537
+ var tmp_12 = this;
3538
+ throw new (RefreshRefused())(this.failure8__1);
3539
+ case 4:
3540
+ this.exceptionState_1 = 9;
3541
+ this.response5__1 = this.TRY_RESULT7__1;
3542
+ var tmp3_subject = this.response5__1.status;
3543
+ if (tmp3_subject === Companion_getInstance_1().Accepted_1.value_1) {
3544
+ this.state_1 = 7;
3545
+ suspendResult = this.response5__1.body$suspendBridge_a6dedm_k$(this);
2931
3546
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
2932
3547
  return suspendResult;
2933
3548
  }
2934
3549
  continue $sm;
2935
3550
  } else {
2936
- if (tmp6_subject === Companion_getInstance_0().Unauthorized_1.value_1) {
2937
- this.state_1 = 12;
2938
- suspendResult = endSession(this.$this$runCatching11__1, this);
3551
+ if (tmp3_subject === Companion_getInstance_1().Unauthorized_1.value_1) {
3552
+ this.state_1 = 5;
3553
+ suspendResult = endSession(this.$this$runCatching6__1, this);
2939
3554
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
2940
3555
  return suspendResult;
2941
3556
  }
2942
3557
  continue $sm;
2943
3558
  } else {
2944
- var tmp_14 = this;
2945
- throw new (UnknownRefreshErrorException())("Refresh failed with status " + this.response10__1.status);
3559
+ var tmp_13 = this;
3560
+ throw new (UnknownRefreshErrorException())("Refresh failed with status " + this.response5__1.status);
2946
3561
  }
2947
3562
  }
2948
- case 12:
2949
- this.ARGUMENT9__1 = Companion_getInstance_0().Unauthorized_1.value_1;
2950
- this.state_1 = 13;
2951
- suspendResult = bodyAsText(this.response10__1.response, VOID2, this);
3563
+ case 5:
3564
+ this.ARGUMENT4__1 = Companion_getInstance_1().Unauthorized_1.value_1;
3565
+ this.state_1 = 6;
3566
+ suspendResult = bodyAsText(this.response5__1.response, VOID2, this);
2952
3567
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
2953
3568
  return suspendResult;
2954
3569
  }
2955
3570
  continue $sm;
2956
- case 13:
3571
+ case 6:
2957
3572
  var ARGUMENT = suspendResult;
2958
3573
  var ARGUMENT_0 = parseApiErrors(ARGUMENT);
2959
- var ARGUMENT_1 = new (SoliboSDKError())(this.ARGUMENT9__1, ARGUMENT_0, FailureKind_EXPECTED_AUTH_getInstance());
2960
- var tmp_15 = this;
3574
+ var ARGUMENT_1 = new (SoliboSDKError())(this.ARGUMENT4__1, ARGUMENT_0, FailureKind_EXPECTED_AUTH_getInstance());
3575
+ var tmp_14 = this;
2961
3576
  throw new (RefreshRefused())(ARGUMENT_1);
2962
- case 14:
2963
- this.WHEN_RESULT8__1 = suspendResult;
2964
- this.state_1 = 15;
3577
+ case 7:
3578
+ this.WHEN_RESULT3__1 = suspendResult;
3579
+ this.state_1 = 8;
2965
3580
  continue $sm;
2966
- case 15:
2967
- var tmp2 = this.WHEN_RESULT8__1;
2968
- var tmp_16 = this;
2969
- this.tmp07__1;
2970
- tmp_16.TRY_RESULT6__1 = _Result___init__impl__xyqfz82(tmp2);
2971
- this.exceptionState_1 = 25;
2972
- this.state_1 = 17;
3581
+ case 8:
3582
+ var tmp2 = this.WHEN_RESULT3__1;
3583
+ var tmp_15 = this;
3584
+ this.tmp02__1;
3585
+ tmp_15.TRY_RESULT1__1 = _Result___init__impl__xyqfz82(tmp2);
3586
+ this.exceptionState_1 = 10;
3587
+ this.state_1 = 11;
2973
3588
  continue $sm;
2974
- case 16:
2975
- this.exceptionState_1 = 25;
2976
- var tmp_17 = this.exception_1;
2977
- if (tmp_17 instanceof Error) {
3589
+ case 9:
3590
+ this.exceptionState_1 = 10;
3591
+ var tmp_16 = this.exception_1;
3592
+ if (tmp_16 instanceof Error) {
2978
3593
  var e = this.exception_1;
2979
- var tmp_18 = this;
2980
- tmp_18.TRY_RESULT6__1 = _Result___init__impl__xyqfz82(createFailure2(e));
2981
- this.state_1 = 17;
3594
+ var tmp_17 = this;
3595
+ tmp_17.TRY_RESULT1__1 = _Result___init__impl__xyqfz82(createFailure2(e));
3596
+ this.state_1 = 11;
2982
3597
  continue $sm;
2983
3598
  } else {
2984
3599
  throw this.exception_1;
2985
3600
  }
2986
- case 17:
2987
- this.exceptionState_1 = 25;
2988
- var this_5 = this.TRY_RESULT6__1;
2989
- var tmp_19;
2990
- if (_Result___get_isSuccess__impl__sndoy8(this_5)) {
2991
- var this_6 = new (Result())(this_5);
2992
- var tmp_20;
3601
+ case 10:
3602
+ throw this.exception_1;
3603
+ case 11:
3604
+ this.exceptionState_1 = 10;
3605
+ var this_2 = this.TRY_RESULT1__1;
3606
+ var tmp_18;
3607
+ if (_Result___get_isSuccess__impl__sndoy8(this_2)) {
3608
+ var this_3 = new (Result())(this_2);
3609
+ var tmp_19;
2993
3610
  try {
2994
- var $this$runCatching = this_6.value_1;
3611
+ var $this$runCatching = this_3.value_1;
2995
3612
  var authResult = _Result___get_value__impl__bjfvqg2($this$runCatching);
2996
3613
  var tmp0_elvis_lhs_1 = authResult.tokens;
2997
- var tmp_21;
3614
+ var tmp_20;
2998
3615
  if (tmp0_elvis_lhs_1 == null) {
2999
3616
  throw Exception_init_$Create$("Refresh succeeded but tokens were missing");
3000
3617
  } else {
3001
- tmp_21 = tmp0_elvis_lhs_1;
3002
- }
3003
- var tokens = tmp_21;
3004
- var builder = new (JsonObjectBuilder())();
3005
- builder.put_mrde5n_k$("accessToken", JsonPrimitive(tokens.accessToken));
3006
- builder.put_mrde5n_k$("identity", JsonPrimitive(tokens.identity));
3007
- builder.put_mrde5n_k$("data", JsonPrimitive(tokens.data));
3008
- var jsonObject = builder.build_bkh6qh_k$();
3009
- var this_7 = Default_getInstance2();
3010
- var this_8 = this_7.get_serializersModule_piitvg_k$();
3011
- var this_9 = serializer(this_8, createKType(getKClass(JsonObject()), arrayOf([]), false));
3012
- var jsonString = this_7.encodeToString_k0apqx_k$(isInterface(this_9, KSerializer()) ? this_9 : THROW_CCE2(), jsonObject);
3013
- var encoded = Default_getInstance_0().UrlSafe_1.encode$default_h4nonq_k$(toByteArray(jsonString));
3014
- this._this__u8e3s4__1.setToken(encoded);
3015
- var tmp1_elvis_lhs = authResult.refreshToken;
3016
- var tmp_22;
3017
- if (tmp1_elvis_lhs == null) {
3018
- var tmp2_safe_receiver = authResult.tokens;
3019
- tmp_22 = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.refreshToken;
3020
- } else {
3021
- tmp_22 = tmp1_elvis_lhs;
3022
- }
3023
- var tmp3_safe_receiver = tmp_22;
3024
- if (tmp3_safe_receiver == null)
3025
- null;
3026
- else {
3027
- this._this__u8e3s4__1.setRefreshToken(tmp3_safe_receiver);
3028
- }
3029
- this._this__u8e3s4__1.set_userId_wekl5g_k$(tokens.identity);
3030
- var tmp4_elvis_lhs_0 = authResult.refreshToken;
3031
- var tmp_23;
3032
- if (tmp4_elvis_lhs_0 == null) {
3033
- var tmp5_safe_receiver = authResult.tokens;
3034
- tmp_23 = tmp5_safe_receiver == null ? null : tmp5_safe_receiver.refreshToken;
3035
- } else {
3036
- tmp_23 = tmp4_elvis_lhs_0;
3618
+ tmp_20 = tmp0_elvis_lhs_1;
3037
3619
  }
3038
- var tmp6_elvis_lhs_0 = tmp_23;
3039
- var value = new (BearerTokens())(encoded, tmp6_elvis_lhs_0 == null ? this.tokensToUse5__1.refreshToken_1 : tmp6_elvis_lhs_0);
3040
- tmp_20 = _Result___init__impl__xyqfz82(value);
3620
+ var tokens = tmp_20;
3621
+ var accessToken = bearerEnvelope(this._this__u8e3s4__1, tokens);
3622
+ var tmp1_elvis_lhs_0 = authResult.refreshToken;
3623
+ var renewedRefreshToken = tmp1_elvis_lhs_0 == null ? tokens.refreshToken : tmp1_elvis_lhs_0;
3624
+ storeRenewedSession(this._this__u8e3s4__1, accessToken, renewedRefreshToken, tokens.identity);
3625
+ var value = new (BearerTokens())(accessToken, renewedRefreshToken == null ? this.old0__1 : renewedRefreshToken);
3626
+ tmp_19 = _Result___init__impl__xyqfz82(value);
3041
3627
  } catch ($p) {
3042
- var tmp_24;
3628
+ var tmp_21;
3043
3629
  if ($p instanceof Error) {
3044
3630
  var e_0 = $p;
3045
- tmp_24 = _Result___init__impl__xyqfz82(createFailure2(e_0));
3631
+ tmp_21 = _Result___init__impl__xyqfz82(createFailure2(e_0));
3046
3632
  } else {
3047
3633
  throw $p;
3048
3634
  }
3049
- tmp_20 = tmp_24;
3635
+ tmp_19 = tmp_21;
3050
3636
  }
3051
- tmp_19 = tmp_20;
3637
+ tmp_18 = tmp_19;
3052
3638
  } else {
3053
- tmp_19 = _Result___init__impl__xyqfz82(_Result___get_value__impl__bjfvqg2(this_5));
3639
+ tmp_18 = _Result___init__impl__xyqfz82(_Result___get_value__impl__bjfvqg2(this_2));
3054
3640
  }
3055
- var this_10 = tmp_19;
3056
- var tmp0_safe_receiver = Result__exceptionOrNull_impl_p6xea92(this_10);
3641
+ var this_4 = tmp_18;
3642
+ var tmp0_safe_receiver = Result__exceptionOrNull_impl_p6xea92(this_4);
3057
3643
  if (tmp0_safe_receiver == null)
3058
3644
  null;
3059
3645
  else {
3060
3646
  if (tmp0_safe_receiver instanceof CancellationException())
3061
3647
  throw tmp0_safe_receiver;
3062
- var this_11 = logging();
3648
+ var this_5 = logging();
3063
3649
  if (KmLogging_getInstance().isLoggingInfo_1) {
3064
- this_11.infoApi_6vw3du_k$(this_11.tagName_1, toString_0("Refresh successfully failed!"));
3650
+ this_5.infoApi_6vw3du_k$(this_5.tagName_1, toString_0("Refresh successfully failed!"));
3065
3651
  }
3066
3652
  }
3067
- var tmp_25 = this;
3068
- throwOnFailure(this_10);
3069
- tmp_25.WHEN_RESULT4__1 = _Result___get_value__impl__bjfvqg2(this_10);
3070
- this.state_1 = 18;
3071
- continue $sm;
3072
- case 18:
3073
- this.tmp$ret$03__1 = this.WHEN_RESULT4__1;
3074
- if (false) {
3075
- this.state_1 = 3;
3076
- continue $sm;
3077
- }
3078
- this.state_1 = 23;
3653
+ throwOnFailure(this_4);
3654
+ return _Result___get_value__impl__bjfvqg2(this_4);
3655
+ }
3656
+ } catch ($p_0) {
3657
+ var e_1 = $p_0;
3658
+ if (this.exceptionState_1 === 10) {
3659
+ throw e_1;
3660
+ } else {
3661
+ this.state_1 = this.exceptionState_1;
3662
+ this.exception_1 = e_1;
3663
+ }
3664
+ }
3665
+ while (true);
3666
+ };
3667
+ $renewTokenSessionCOROUTINE$Class = $;
3668
+ }
3669
+ return $renewTokenSessionCOROUTINE$Class;
3670
+ }
3671
+ var $endSessionCOROUTINE$Class;
3672
+ function $endSessionCOROUTINE$() {
3673
+ if ($endSessionCOROUTINE$Class === VOID2) {
3674
+ let $ = function(_this__u8e3s4, resultContinuation) {
3675
+ CoroutineImpl().call(this, resultContinuation);
3676
+ this._this__u8e3s4__1 = _this__u8e3s4;
3677
+ };
3678
+ initMetadataForCoroutine($, CoroutineImpl());
3679
+ protoOf2($).doResume_5yljmg_k$ = function() {
3680
+ var suspendResult = this.result_1;
3681
+ $sm: do
3682
+ try {
3683
+ var tmp = this.state_1;
3684
+ switch (tmp) {
3685
+ case 0:
3686
+ this.exceptionState_1 = 6;
3687
+ this.state_1 = 1;
3079
3688
  continue $sm;
3080
- case 19:
3081
- this.tmp$ret$03__1 = null;
3082
- this.state_1 = 23;
3689
+ case 1:
3690
+ this.exceptionState_1 = 2;
3691
+ this._this__u8e3s4__1.settings_1.remove_6241ba_k$("activeLogin");
3692
+ this._this__u8e3s4__1.clearTokens();
3693
+ this.exceptionState_1 = 6;
3694
+ this.state_1 = 4;
3083
3695
  continue $sm;
3084
- case 20:
3085
- this.state_1 = 21;
3086
- var tmp_26 = _get_authM2M__c6rkbz(this._this__u8e3s4__1);
3087
- var tmp0_elvis_lhs_2 = this._this__u8e3s4__1.clientId;
3088
- var tmp_27;
3089
- if (tmp0_elvis_lhs_2 == null) {
3090
- throw Exception_init_$Create$("M2M Client ID not set");
3091
- } else {
3092
- tmp_27 = tmp0_elvis_lhs_2;
3093
- }
3094
- var tmp_28 = tmp_27;
3095
- var tmp1_elvis_lhs_0 = this._this__u8e3s4__1.clientSecret;
3096
- var tmp_29;
3097
- if (tmp1_elvis_lhs_0 == null) {
3098
- throw Exception_init_$Create$("M2M Client Secret not set");
3099
- } else {
3100
- tmp_29 = tmp1_elvis_lhs_0;
3101
- }
3102
- suspendResult = tmp_26.createM2MTokens$suspendBridge_5mlkf0_k$(new (CreateM2MTokensCommand())(tmp_28, tmp_29, normalizedM2MScopes(this._this__u8e3s4__1.scopes)), this);
3696
+ case 2:
3697
+ this.exceptionState_1 = 6;
3698
+ this.t0__1 = this.exception_1;
3699
+ this.state_1 = 3;
3700
+ suspendResult = this._this__u8e3s4__1.refreshFailure_1(this);
3103
3701
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
3104
3702
  return suspendResult;
3105
3703
  }
3106
3704
  continue $sm;
3107
- case 21:
3108
- var response = suspendResult;
3109
- if (!(response.status === Companion_getInstance_0().Created_1.value_1)) {
3110
- throw Exception_init_$Create$("M2M Token acquisition failed with status " + response.status);
3111
- }
3112
- this.state_1 = 22;
3113
- suspendResult = response.body$suspendBridge_a6dedm_k$(this);
3705
+ case 3:
3706
+ throw this.t0__1;
3707
+ case 4:
3708
+ this.exceptionState_1 = 6;
3709
+ this.state_1 = 5;
3710
+ suspendResult = this._this__u8e3s4__1.refreshFailure_1(this);
3114
3711
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
3115
3712
  return suspendResult;
3116
3713
  }
3117
3714
  continue $sm;
3118
- case 22:
3119
- var authResult_0 = suspendResult;
3120
- var tmp2_elvis_lhs = authResult_0.tokens;
3121
- var tmp_30;
3122
- if (tmp2_elvis_lhs == null) {
3123
- throw Exception_init_$Create$("M2M Token acquisition returned no tokens");
3124
- } else {
3125
- tmp_30 = tmp2_elvis_lhs;
3126
- }
3127
- var tokens_0 = tmp_30;
3128
- var builder_0 = new (JsonObjectBuilder())();
3129
- builder_0.put_mrde5n_k$("accessToken", JsonPrimitive(tokens_0.accessToken));
3130
- builder_0.put_mrde5n_k$("identity", JsonPrimitive(tokens_0.identity));
3131
- builder_0.put_mrde5n_k$("data", JsonPrimitive(tokens_0.data));
3132
- var jsonObject_0 = builder_0.build_bkh6qh_k$();
3133
- var this_12 = Default_getInstance2();
3134
- var this_13 = this_12.get_serializersModule_piitvg_k$();
3135
- var this_14 = serializer(this_13, createKType(getKClass(JsonObject()), arrayOf([]), false));
3136
- var jsonString_0 = this_12.encodeToString_k0apqx_k$(isInterface(this_14, KSerializer()) ? this_14 : THROW_CCE2(), jsonObject_0);
3137
- var encoded_0 = Default_getInstance_0().UrlSafe_1.encode$default_h4nonq_k$(toByteArray(jsonString_0));
3138
- this._this__u8e3s4__1.setToken(encoded_0);
3139
- this._this__u8e3s4__1.set_userId_wekl5g_k$(tokens_0.identity);
3140
- this._this__u8e3s4__1.tokenTimestamp = System_instance.now_2cba_k$().toEpochMilliseconds_82cfls_k$();
3141
- var tmp_31 = this;
3142
- var tmp3_safe_receiver_0 = this._this__u8e3s4__1.bearerToken_1;
3143
- var tmp_32;
3144
- if (tmp3_safe_receiver_0 == null) {
3145
- tmp_32 = null;
3146
- } else {
3147
- tmp_32 = new (BearerTokens())(tmp3_safe_receiver_0, "");
3148
- }
3149
- tmp_31.tmp$ret$03__1 = tmp_32;
3150
- this.state_1 = 23;
3151
- continue $sm;
3152
- case 23:
3153
- this.tmp$ret$22__1 = this.tmp$ret$03__1;
3154
- this.exceptionState_1 = 26;
3155
- this.state_1 = 24;
3156
- continue $sm;
3157
- case 24:
3158
- var tmp_33 = this.tmp$ret$22__1;
3159
- this.exceptionState_1 = 26;
3160
- this.this1__1.unlock_ulcrcl_k$(this.owner0__1);
3161
- return tmp_33;
3162
- case 25:
3163
- this.exceptionState_1 = 26;
3164
- var t = this.exception_1;
3165
- this.this1__1.unlock_ulcrcl_k$(this.owner0__1);
3166
- throw t;
3167
- case 26:
3715
+ case 5:
3716
+ return Unit_instance2;
3717
+ case 6:
3168
3718
  throw this.exception_1;
3169
3719
  }
3170
- } catch ($p_0) {
3171
- var e_1 = $p_0;
3172
- if (this.exceptionState_1 === 26) {
3173
- throw e_1;
3720
+ } catch ($p) {
3721
+ var e = $p;
3722
+ if (this.exceptionState_1 === 6) {
3723
+ throw e;
3174
3724
  } else {
3175
3725
  this.state_1 = this.exceptionState_1;
3176
- this.exception_1 = e_1;
3726
+ this.exception_1 = e;
3177
3727
  }
3178
3728
  }
3179
3729
  while (true);
3180
3730
  };
3181
- $refreshSessionCOROUTINE$Class = $;
3731
+ $endSessionCOROUTINE$Class = $;
3182
3732
  }
3183
- return $refreshSessionCOROUTINE$Class;
3733
+ return $endSessionCOROUTINE$Class;
3184
3734
  }
3185
3735
  var $revokeCookieSessionCOROUTINE$Class;
3186
3736
  function $revokeCookieSessionCOROUTINE$() {
@@ -3606,6 +4156,9 @@ function HomeApiBase() {
3606
4156
  var tmp_2 = this;
3607
4157
  tmp_2.authM2M$delegate_1 = lazy(HomeApiBase$authM2M$delegate$lambda(this));
3608
4158
  this.refreshLock_1 = Mutex();
4159
+ this.sessionScope_1 = CoroutineScope_0(SupervisorJob().plus_s13ygv_k$(Dispatchers_getInstance().Default_1));
4160
+ this.refreshGate_1 = Mutex();
4161
+ this.refreshInFlight_1 = null;
3609
4162
  this.cookieSessionGeneration_1 = 0;
3610
4163
  this.publicCacheStorage_1 = new (InvalidatingCacheStorage())(Companion_getInstance_3().Unlimited_1());
3611
4164
  this.privateCacheStorage_1 = new (InvalidatingCacheStorage())(Companion_getInstance_3().Unlimited_1());
@@ -3626,19 +4179,23 @@ function HomeApiBase() {
3626
4179
  var tmp_3 = this;
3627
4180
  tmp_3.clientConfigurator = HomeApiBase$clientConfigurator$lambda(this);
3628
4181
  var tmp_4 = this;
3629
- tmp_4.auth$delegate_1 = lazy(HomeApiBase$auth$delegate$lambda(this));
4182
+ tmp_4.refreshClientConfigurator_1 = HomeApiBase$refreshClientConfigurator$lambda(this);
3630
4183
  var tmp_5 = this;
3631
- tmp_5.sessionAuth$delegate_1 = lazy(HomeApiBase$sessionAuth$delegate$lambda(this));
4184
+ tmp_5.auth$delegate_1 = lazy(HomeApiBase$auth$delegate$lambda(this));
3632
4185
  var tmp_6 = this;
3633
- tmp_6.language$delegate_1 = lazy(HomeApiBase$language$delegate$lambda(this));
4186
+ tmp_6.refreshAuth$delegate_1 = lazy(HomeApiBase$refreshAuth$delegate$lambda(this));
3634
4187
  var tmp_7 = this;
3635
- tmp_7.devices$delegate_1 = lazy(HomeApiBase$devices$delegate$lambda(this));
4188
+ tmp_7.sessionAuth$delegate_1 = lazy(HomeApiBase$sessionAuth$delegate$lambda(this));
3636
4189
  var tmp_8 = this;
3637
- tmp_8.appStores$delegate_1 = lazy(HomeApiBase$appStores$delegate$lambda(this));
4190
+ tmp_8.language$delegate_1 = lazy(HomeApiBase$language$delegate$lambda(this));
3638
4191
  var tmp_9 = this;
3639
- tmp_9.unsubscribe$delegate_1 = lazy(HomeApiBase$unsubscribe$delegate$lambda(this));
4192
+ tmp_9.devices$delegate_1 = lazy(HomeApiBase$devices$delegate$lambda(this));
3640
4193
  var tmp_10 = this;
3641
- tmp_10.apiPathAuth$delegate_1 = lazy(HomeApiBase$apiPathAuth$delegate$lambda(this));
4194
+ tmp_10.appStores$delegate_1 = lazy(HomeApiBase$appStores$delegate$lambda(this));
4195
+ var tmp_11 = this;
4196
+ tmp_11.unsubscribe$delegate_1 = lazy(HomeApiBase$unsubscribe$delegate$lambda(this));
4197
+ var tmp_12 = this;
4198
+ tmp_12.apiPathAuth$delegate_1 = lazy(HomeApiBase$apiPathAuth$delegate$lambda(this));
3642
4199
  if (__soliboConverted && !__soliboBoundaryState.internalConstruction) return __soliboToJs(this);
3643
4200
  };
3644
4201
  initMetadataForClass2($, "HomeApiBase", VOID2, VOID2, VOID2, [1, 0, 2]);
@@ -3744,40 +4301,10 @@ function HomeApiBase() {
3744
4301
  this.baseUrl_1 = sanitizeBaseUrl(this, url);
3745
4302
  };
3746
4303
  protoOf2($).setToken = function(bearer2) {
3747
- this.bearerToken_1 = bearer2;
3748
4304
  var tmp0 = this.settings_1;
3749
- var tmp2 = "bearerToken";
3750
- var value = this.bearerToken_1;
3751
- var tmp;
3752
- if (value == null) {
3753
- tmp0.remove_6241ba_k$(tmp2);
3754
- tmp = Unit_instance2;
3755
- } else {
3756
- var tmp0_subject = PrimitiveClasses_getInstance().get_stringClass_bik2gy_k$();
3757
- var tmp_0;
3758
- if (tmp0_subject.equals(PrimitiveClasses_getInstance().get_intClass_mw4y9a_k$())) {
3759
- tmp0.putInt_yr2eaa_k$(tmp2, (!(value == null) ? typeof value === "number" : false) ? value : THROW_CCE2());
3760
- tmp_0 = Unit_instance2;
3761
- } else if (tmp0_subject.equals(PrimitiveClasses_getInstance().get_longClass_a79cj7_k$())) {
3762
- tmp0.putLong_2n8au3_k$(tmp2, (!(value == null) ? typeof value === "bigint" : false) ? value : THROW_CCE2());
3763
- tmp_0 = Unit_instance2;
3764
- } else if (tmp0_subject.equals(PrimitiveClasses_getInstance().get_stringClass_bik2gy_k$())) {
3765
- tmp0.putString_q7x3bk_k$(tmp2, (!(value == null) ? typeof value === "string" : false) ? value : THROW_CCE2());
3766
- tmp_0 = Unit_instance2;
3767
- } else if (tmp0_subject.equals(PrimitiveClasses_getInstance().get_floatClass_xlwq2t_k$())) {
3768
- tmp0.putFloat_g52tvf_k$(tmp2, (!(value == null) ? typeof value === "number" : false) ? value : THROW_CCE2());
3769
- tmp_0 = Unit_instance2;
3770
- } else if (tmp0_subject.equals(PrimitiveClasses_getInstance().get_doubleClass_dahzcy_k$())) {
3771
- tmp0.putDouble_go8clg_k$(tmp2, (!(value == null) ? typeof value === "number" : false) ? value : THROW_CCE2());
3772
- tmp_0 = Unit_instance2;
3773
- } else if (tmp0_subject.equals(PrimitiveClasses_getInstance().get_booleanClass_d285fr_k$())) {
3774
- tmp0.putBoolean_wwpo7g_k$(tmp2, (!(value == null) ? typeof value === "boolean" : false) ? value : THROW_CCE2());
3775
- tmp_0 = Unit_instance2;
3776
- } else {
3777
- throw IllegalArgumentException_init_$Create$("Invalid type!");
3778
- }
3779
- tmp = tmp_0;
3780
- }
4305
+ var key = "bearerToken";
4306
+ tmp0.putString_q7x3bk_k$(key, bearer2);
4307
+ this.bearerToken_1 = bearer2;
3781
4308
  };
3782
4309
  protoOf2($).setDelegatedToken_ikzdax_k$ = function(accessToken, identity) {
3783
4310
  var tmp;
@@ -3787,8 +4314,8 @@ function HomeApiBase() {
3787
4314
  var message = "Invalid JWT format";
3788
4315
  throw IllegalArgumentException_init_$Create$(toString(message));
3789
4316
  }
3790
- var payload = decodeToString(Default_getInstance_0().UrlSafe_1.decode$default_mne14l_k$(parts.get_c1px32_k$(1)));
3791
- var json = Default_getInstance2().parseToJsonElement_rqvr2k_k$(payload);
4317
+ var payload = decodeToString(Default_getInstance2().UrlSafe_1.decode$default_mne14l_k$(parts.get_c1px32_k$(1)));
4318
+ var json = Default_getInstance_0().parseToJsonElement_rqvr2k_k$(payload);
3792
4319
  var tmp0_safe_receiver = get_jsonObject(json).get_6bo4tg_k$("sub");
3793
4320
  var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : get_jsonPrimitive(tmp0_safe_receiver);
3794
4321
  var tmp2_elvis_lhs = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.get_content_h02jrk_k$();
@@ -3808,8 +4335,8 @@ function HomeApiBase() {
3808
4335
  builder.put_mrde5n_k$("identity", JsonPrimitive(sub));
3809
4336
  builder.put_mrde5n_k$("data", JsonPrimitive(accessToken));
3810
4337
  var envelope = builder.build_bkh6qh_k$();
3811
- var tmp_1 = Default_getInstance_0().UrlSafe_1;
3812
- var this_0 = Default_getInstance2();
4338
+ var tmp_1 = Default_getInstance2().UrlSafe_1;
4339
+ var this_0 = Default_getInstance_0();
3813
4340
  var this_1 = this_0.get_serializersModule_piitvg_k$();
3814
4341
  var this_2 = serializer(this_1, createKType(getKClass(JsonObject()), arrayOf([]), false));
3815
4342
  var tmp$ret$7 = isInterface(this_2, KSerializer()) ? this_2 : THROW_CCE2();
@@ -3830,40 +4357,10 @@ function HomeApiBase() {
3830
4357
  return tmp;
3831
4358
  };
3832
4359
  protoOf2($).setRefreshToken = function(refresh) {
3833
- this.refreshToken_1 = refresh;
3834
4360
  var tmp0 = this.settings_1;
3835
- var tmp2 = "refreshToken";
3836
- var value = this.refreshToken_1;
3837
- var tmp;
3838
- if (value == null) {
3839
- tmp0.remove_6241ba_k$(tmp2);
3840
- tmp = Unit_instance2;
3841
- } else {
3842
- var tmp0_subject = PrimitiveClasses_getInstance().get_stringClass_bik2gy_k$();
3843
- var tmp_0;
3844
- if (tmp0_subject.equals(PrimitiveClasses_getInstance().get_intClass_mw4y9a_k$())) {
3845
- tmp0.putInt_yr2eaa_k$(tmp2, (!(value == null) ? typeof value === "number" : false) ? value : THROW_CCE2());
3846
- tmp_0 = Unit_instance2;
3847
- } else if (tmp0_subject.equals(PrimitiveClasses_getInstance().get_longClass_a79cj7_k$())) {
3848
- tmp0.putLong_2n8au3_k$(tmp2, (!(value == null) ? typeof value === "bigint" : false) ? value : THROW_CCE2());
3849
- tmp_0 = Unit_instance2;
3850
- } else if (tmp0_subject.equals(PrimitiveClasses_getInstance().get_stringClass_bik2gy_k$())) {
3851
- tmp0.putString_q7x3bk_k$(tmp2, (!(value == null) ? typeof value === "string" : false) ? value : THROW_CCE2());
3852
- tmp_0 = Unit_instance2;
3853
- } else if (tmp0_subject.equals(PrimitiveClasses_getInstance().get_floatClass_xlwq2t_k$())) {
3854
- tmp0.putFloat_g52tvf_k$(tmp2, (!(value == null) ? typeof value === "number" : false) ? value : THROW_CCE2());
3855
- tmp_0 = Unit_instance2;
3856
- } else if (tmp0_subject.equals(PrimitiveClasses_getInstance().get_doubleClass_dahzcy_k$())) {
3857
- tmp0.putDouble_go8clg_k$(tmp2, (!(value == null) ? typeof value === "number" : false) ? value : THROW_CCE2());
3858
- tmp_0 = Unit_instance2;
3859
- } else if (tmp0_subject.equals(PrimitiveClasses_getInstance().get_booleanClass_d285fr_k$())) {
3860
- tmp0.putBoolean_wwpo7g_k$(tmp2, (!(value == null) ? typeof value === "boolean" : false) ? value : THROW_CCE2());
3861
- tmp_0 = Unit_instance2;
3862
- } else {
3863
- throw IllegalArgumentException_init_$Create$("Invalid type!");
3864
- }
3865
- tmp = tmp_0;
3866
- }
4361
+ var key = "refreshToken";
4362
+ tmp0.putString_q7x3bk_k$(key, refresh);
4363
+ this.refreshToken_1 = refresh;
3867
4364
  };
3868
4365
  protoOf2($).refresh_gpuu8g_k$ = function(oldTokens, $completion) {
3869
4366
  var tmp = new ($refreshCOROUTINE$())(this, oldTokens, $completion);
@@ -3894,13 +4391,13 @@ function HomeApiBase() {
3894
4391
  return tmp.doResume_5yljmg_k$();
3895
4392
  };
3896
4393
  protoOf2($).clearTokens = function() {
3897
- this.resetTokens();
3898
- this.bearerToken_1 = null;
4394
+ this.settings_1.remove_6241ba_k$("refreshToken");
3899
4395
  this.settings_1.remove_6241ba_k$("bearerToken");
4396
+ this.settings_1.remove_6241ba_k$("userId");
3900
4397
  this.refreshToken_1 = null;
3901
- this.settings_1.remove_6241ba_k$("refreshToken");
4398
+ this.bearerToken_1 = null;
3902
4399
  this.set_userId_wekl5g_k$(null);
3903
- this.settings_1.remove_6241ba_k$("userId");
4400
+ this.resetTokens();
3904
4401
  };
3905
4402
  protoOf2($).resetTokens = function() {
3906
4403
  var coreApis = listOf([this.auth, _get_sessionAuth__fjt4oj(this), _get_authM2M__c6rkbz(this), this.language, this.appStores, this.unsubscribe]);
@@ -4076,7 +4573,7 @@ function parseApiErrors(body) {
4076
4573
  _init_properties_HomeApiBase_kt__lck77e();
4077
4574
  var tmp;
4078
4575
  try {
4079
- var element = Default_getInstance2().parseToJsonElement_rqvr2k_k$(body);
4576
+ var element = Default_getInstance_0().parseToJsonElement_rqvr2k_k$(body);
4080
4577
  var tmp_0;
4081
4578
  if (element instanceof JsonArray()) {
4082
4579
  var destination = ArrayList_init_$Create$();
@@ -4408,6 +4905,38 @@ function rejectsRefreshToken(_this__u8e3s4) {
4408
4905
  return false;
4409
4906
  }
4410
4907
  }
4908
+ var KeyClass;
4909
+ function Key() {
4910
+ if (KeyClass === VOID2) {
4911
+ let $ = function() {
4912
+ };
4913
+ initMetadataForObject($, "Key");
4914
+ KeyClass = $;
4915
+ }
4916
+ return KeyClass;
4917
+ }
4918
+ var Key_instance;
4919
+ function Key_getInstance() {
4920
+ return Key_instance;
4921
+ }
4922
+ var RefreshInProgressClass;
4923
+ function RefreshInProgress() {
4924
+ if (RefreshInProgressClass === VOID2) {
4925
+ let $ = function() {
4926
+ RefreshInProgress_instance = this;
4927
+ AbstractCoroutineContextElement().call(this, Key_instance);
4928
+ };
4929
+ initMetadataForObject($, "RefreshInProgress", VOID2, AbstractCoroutineContextElement());
4930
+ RefreshInProgressClass = $;
4931
+ }
4932
+ return RefreshInProgressClass;
4933
+ }
4934
+ var RefreshInProgress_instance;
4935
+ function RefreshInProgress_getInstance() {
4936
+ if (RefreshInProgress_instance == null)
4937
+ new (RefreshInProgress())();
4938
+ return RefreshInProgress_instance;
4939
+ }
4411
4940
  function normalizedM2MScopes(_this__u8e3s4) {
4412
4941
  _init_properties_HomeApiBase_kt__lck77e();
4413
4942
  var tmp;
@@ -4469,11 +4998,12 @@ var properties_initialized_HomeApiBase_kt_ugkdjw;
4469
4998
  function _init_properties_HomeApiBase_kt__lck77e() {
4470
4999
  if (!properties_initialized_HomeApiBase_kt_ugkdjw) {
4471
5000
  properties_initialized_HomeApiBase_kt_ugkdjw = true;
4472
- refreshRefusalStatuses = setOf([Companion_getInstance_0().BadRequest_1.value_1, Companion_getInstance_0().NotFound_1.value_1, Companion_getInstance_0().UnprocessableEntity_1.value_1]);
5001
+ refreshRefusalStatuses = setOf([Companion_getInstance_1().BadRequest_1.value_1, Companion_getInstance_1().NotFound_1.value_1, Companion_getInstance_1().UnprocessableEntity_1.value_1]);
4473
5002
  signInSteps = listOf(["/auth/implicit/", "/auth/mfa/select", "/auth/mfa/sms/", "/auth/mfa/totp/", "/auth/password/", "/auth/devices/srp", "/auth/oauth2/"]);
4474
5003
  TRANSIENT_STATUSES = setOf([408, 429]);
4475
5004
  }
4476
5005
  }
5006
+ Key_instance = new (Key())();
4477
5007
  __soliboRegisterLookup("FailureKind", () => __soliboType_FailureKind());
4478
5008
  export {
4479
5009
  AuthMode_COOKIE_getInstance as AuthMode_COOKIE_getInstance3a85gc5n6t5ye,