@solibo/home-api 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.
@@ -67,6 +67,7 @@ import {
67
67
  closeFinally1sadm0w9gt3u4 as closeFinally,
68
68
  Regex_init_$Create$2nx0fagcwc0mz as Regex_init_$Create$,
69
69
  removeSuffix3d61x5lsuvuho as removeSuffix,
70
+ Default_getInstance3483fw4bkmewo as Default_getInstance,
70
71
  IllegalStateException_init_$Create$38ax6c90susjc as IllegalStateException_init_$Create$,
71
72
  CancellationException_init_$Create$6nn2czcftw2s as CancellationException_init_$Create$_0,
72
73
  _Result___get_isFailure__impl__jpiriv2yxkms7bg2hpm as _Result___get_isFailure__impl__jpiriv,
@@ -76,15 +77,14 @@ import {
76
77
  multiply2k9eolhnz1bjv as multiply,
77
78
  DurationUnit_MILLISECONDS_getInstancedq9xrzm1t8sm as DurationUnit_MILLISECONDS_getInstance,
78
79
  toDurationba1nlt78o6vu as toDuration,
80
+ isBlank1dvkhjjvox3p0 as isBlank,
79
81
  to2cs3ny02qtbcb as to,
80
82
  mapOf2zpbbmyqk8xpf as mapOf,
81
83
  endsWith3cq61xxngobwh as endsWith,
82
84
  System_instance34rnn1q53nv02 as System_instance,
83
85
  subtract2orl8z9upxd9l as subtract,
84
86
  ensureNotNull1e947j3ixpazm as ensureNotNull,
85
- isBlank1dvkhjjvox3p0 as isBlank,
86
87
  Exception_init_$Create$1oj5if0wqsosr as Exception_init_$Create$,
87
- Default_getInstance3483fw4bkmewo as Default_getInstance,
88
88
  throwOnFailure24snjmtlqgzo8 as throwOnFailure,
89
89
  AtomicReferencef8ccdw84nrc3 as AtomicReference,
90
90
  lazy2hsh8ze7j6ikd as lazy,
@@ -110,6 +110,7 @@ import {
110
110
  firstOrNull1982767dljvdy as firstOrNull_0,
111
111
  joinToString1cxrrlmo0chqs as joinToString,
112
112
  Exception_init_$Init$2wjev6i7b48jh as Exception_init_$Init$_0,
113
+ AbstractCoroutineContextElement2rpehg0hv5szw as AbstractCoroutineContextElement,
113
114
  removePrefix279df90bhrqqg as removePrefix,
114
115
  setOf45ia9pnfhe90 as setOf,
115
116
  minus27abgkurcn6u0 as minus,
@@ -184,6 +185,10 @@ import {
184
185
  HttpClienthpouyso1j6ge as HttpClient_0,
185
186
  DefaultClientWebSocketSession1n8ok3lng45wy as DefaultClientWebSocketSession,
186
187
  webSocket2tlhmqnamvk0s as webSocket,
188
+ Companion_getInstance1bfe8d81dxwpf as Companion_getInstance_2,
189
+ createClientPlugin16sdkdabbewya as createClientPlugin,
190
+ get_HttpRequestRetry3m7x7jck45t4l as get_HttpRequestRetry,
191
+ HttpResponseValidator2d6ie1tmzg8fi as HttpResponseValidator,
187
192
  get_request3dwcif5y0fvf1 as get_request,
188
193
  plugin3vxt624hnu3pv as plugin,
189
194
  Send_instance1oebf6ttzyqzk as Send_instance,
@@ -194,11 +199,8 @@ import {
194
199
  ConnectTimeoutException35w4gpuoa1015 as ConnectTimeoutException,
195
200
  HttpResponse1532ob1hsse1y as HttpResponse,
196
201
  bodyAsText193cd91fn5h1t as bodyAsText,
202
+ OnRequestContext1tmu5b6bhlblg as OnRequestContext,
197
203
  accept2gi3b7wj4jds9 as accept,
198
- Companion_getInstance1bfe8d81dxwpf as Companion_getInstance_2,
199
- createClientPlugin16sdkdabbewya as createClientPlugin,
200
- get_HttpRequestRetry3m7x7jck45t4l as get_HttpRequestRetry,
201
- HttpResponseValidator2d6ie1tmzg8fi as HttpResponseValidator,
202
204
  Companion_getInstance1ud9wab8nnxdr as Companion_getInstance_3,
203
205
  JsClientEngineConfig3kf0a69j8wbzk as JsClientEngineConfig,
204
206
  Js_instance3n5zt8zzbodgt as Js_instance,
@@ -223,6 +225,8 @@ import {
223
225
  Channel3r72atmcithql as Channel,
224
226
  cancel36mj9lv3a0whl as cancel,
225
227
  delay2kng7ucb3aj62 as delay_0,
228
+ asyncz02dsa2nb2zt as async,
229
+ ensureActive2yo7199srjlgl as ensureActive,
226
230
  Mutex16li1l0asjv17 as Mutex,
227
231
  MutableStateFlow34bfoyvwu8czu as MutableStateFlow,
228
232
  awaitxmqwgrq6yfmw as await_1,
@@ -243,19 +247,21 @@ import {
243
247
  } from './ktor-ktor-websockets.mjs';
244
248
  import {
245
249
  Jsonsmkyu9xjl7fv as Json,
250
+ JsonObjectBuilder2nl6rv6vdayuk as JsonObjectBuilder,
251
+ JsonPrimitiveolttw629wj53 as JsonPrimitive,
246
252
  Default_getInstancevb13yk0g3h3e as Default_getInstance_1,
253
+ JsonObjectee06ihoeeiqj as JsonObject,
247
254
  JsonElementf07o4p6p57al as JsonElement,
248
255
  get_jsonObject2u4z2ch1uuca9 as get_jsonObject,
249
256
  get_jsonPrimitivez17tyd5rw1ql as get_jsonPrimitive,
250
- JsonObjectBuilder2nl6rv6vdayuk as JsonObjectBuilder,
251
- JsonPrimitiveolttw629wj53 as JsonPrimitive,
252
- JsonObjectee06ihoeeiqj as JsonObject,
253
257
  JsonArray2urf8ey7u44sd as JsonArray,
254
258
  JsonPrimitive3ttzjh2ft5dnx as JsonPrimitive_0,
255
259
  get_contentOrNull35s97cgi8z9eo as get_contentOrNull,
256
260
  JsonNull_getInstance1i1hv1sbjynto as JsonNull_getInstance,
257
261
  JsonNull2liwjj96vm0w2 as JsonNull,
258
262
  } from './kotlinx-serialization-kotlinx-serialization-json.mjs';
263
+ import { get_ContentNegotiationcp59ye9rorjc as get_ContentNegotiation } from './ktor-ktor-client-content-negotiation.mjs';
264
+ import { get_ContentEncoding3ntb7mwovz4dd as get_ContentEncoding } from './ktor-ktor-client-encoding.mjs';
259
265
  import {
260
266
  get_Auth3auwb1dqcwarr as get_Auth,
261
267
  get_authProviders394nbziurer3k as get_authProviders,
@@ -264,32 +270,6 @@ import {
264
270
  RefreshTokensParams3vv92jq8a1mg3 as RefreshTokensParams,
265
271
  bearer3b1oi44ec3xsb as bearer,
266
272
  } from './ktor-ktor-client-auth.mjs';
267
- import { get_ContentNegotiationcp59ye9rorjc as get_ContentNegotiation } from './ktor-ktor-client-content-negotiation.mjs';
268
- import {
269
- SpanKind_CLIENT_getInstance3t9h0o2265b13 as SpanKind_CLIENT_getInstance,
270
- Ok_getInstance2tnrifcx0546k as Ok_getInstance,
271
- Error2ro0zi7eg1yp3 as Error_0,
272
- Span2ijgmkxlpjw45 as Span,
273
- } from './opentelemetry-kotlin-api.mjs';
274
- import {
275
- Companion_getInstanceu2wrlss616lb as Companion_getInstance_4,
276
- Application_getInstance3vhi2qmce4cj0 as Application_getInstance,
277
- TextContent1rb6ftlpvl1d2 as TextContent,
278
- OutgoingContent3t2ohmyam9o76 as OutgoingContent,
279
- NullBody_instance22vwyocs8eppk as NullBody_instance,
280
- contentType2zzm38yxo3syt as contentType,
281
- contentType1lwcfjsjo0z8g as contentType_0,
282
- Companion_getInstance29j9s2wnmk34z as Companion_getInstance_5,
283
- get_encodedPathb4r5okm1fzvh as get_encodedPath,
284
- set_encodedPath3q0i8nsv3a7qy as set_encodedPath,
285
- URLBuilder1nlnzfhn643pn as URLBuilder,
286
- takeFromkqlcz7c6dx2r as takeFrom,
287
- encodeURLQueryComponent1fjq9wb8rn8hq as encodeURLQueryComponent,
288
- Companion_getInstance2mdqh2piyf0f8 as Companion_getInstance_6,
289
- Companion_getInstance25cbdbruarm2m as Companion_getInstance_7,
290
- isSuccess1pokn37fdu56v as isSuccess,
291
- contentType317fn4f991q9a as contentType_1,
292
- } from './ktor-ktor-http.mjs';
293
273
  import {
294
274
  serializer1i4e9ym37oxmo as serializer,
295
275
  KSerializerzf77vz1967fq as KSerializer,
@@ -316,12 +296,36 @@ import {
316
296
  throwArrayMissingFieldExceptionbk1mj238w44a as throwArrayMissingFieldException,
317
297
  ContextualSerializer1uidivg94sh5v as ContextualSerializer,
318
298
  } from './kotlinx-serialization-kotlinx-serialization-core.mjs';
319
- import { get_ContentEncoding3ntb7mwovz4dd as get_ContentEncoding } from './ktor-ktor-client-encoding.mjs';
320
299
  import {
321
300
  toByteArray1i3ns5jnoqlv6 as toByteArray_0,
322
301
  Charsets_getInstancezrqwjk0yrlyw as Charsets_getInstance,
323
302
  readBuffery45c0omfxhxc as readBuffer,
324
303
  } from './ktor-ktor-io.mjs';
304
+ import {
305
+ SpanKind_CLIENT_getInstance3t9h0o2265b13 as SpanKind_CLIENT_getInstance,
306
+ Ok_getInstance2tnrifcx0546k as Ok_getInstance,
307
+ Error2ro0zi7eg1yp3 as Error_0,
308
+ Span2ijgmkxlpjw45 as Span,
309
+ } from './opentelemetry-kotlin-api.mjs';
310
+ import {
311
+ Companion_getInstanceu2wrlss616lb as Companion_getInstance_4,
312
+ Application_getInstance3vhi2qmce4cj0 as Application_getInstance,
313
+ TextContent1rb6ftlpvl1d2 as TextContent,
314
+ OutgoingContent3t2ohmyam9o76 as OutgoingContent,
315
+ NullBody_instance22vwyocs8eppk as NullBody_instance,
316
+ contentType2zzm38yxo3syt as contentType,
317
+ contentType1lwcfjsjo0z8g as contentType_0,
318
+ Companion_getInstance29j9s2wnmk34z as Companion_getInstance_5,
319
+ get_encodedPathb4r5okm1fzvh as get_encodedPath,
320
+ set_encodedPath3q0i8nsv3a7qy as set_encodedPath,
321
+ URLBuilder1nlnzfhn643pn as URLBuilder,
322
+ takeFromkqlcz7c6dx2r as takeFrom,
323
+ encodeURLQueryComponent1fjq9wb8rn8hq as encodeURLQueryComponent,
324
+ Companion_getInstance2mdqh2piyf0f8 as Companion_getInstance_6,
325
+ Companion_getInstance25cbdbruarm2m as Companion_getInstance_7,
326
+ isSuccess1pokn37fdu56v as isSuccess,
327
+ contentType317fn4f991q9a as contentType_1,
328
+ } from './ktor-ktor-http.mjs';
325
329
  import {
326
330
  KotlinxSerializationConverter2xqbr965tscas as KotlinxSerializationConverter,
327
331
  serializerForTypeInfofg753n9o7cfi as serializerForTypeInfo,
@@ -398,15 +402,20 @@ initMetadataForClass(SoliboErrorDetail, 'SoliboErrorDetail');
398
402
  initMetadataForClass(SoliboSDKError, 'SoliboSDKError', VOID, Exception);
399
403
  initMetadataForClass(OriginRevoke, 'OriginRevoke', VOID, Enum);
400
404
  initMetadataForLambda(HomeApiBase$_init_$slambda_lo2tsw, CoroutineImpl, VOID, [0]);
401
- initMetadataForLambda(HomeApiBase$clientConfigurator$lambda$lambda$slambda, CoroutineImpl, VOID, [2]);
402
- initMetadataForLambda(HomeApiBase$clientConfigurator$lambda$lambda$slambda_1, CoroutineImpl, VOID, [2]);
403
- initMetadataForLambda(HomeApiBase$clientConfigurator$lambda$lambda$slambda_3, CoroutineImpl, VOID, [2]);
404
- initMetadataForLambda(HomeApiBase$clientConfigurator$lambda$lambda$slambda_5, CoroutineImpl, VOID, [1]);
405
- initMetadataForLambda(HomeApiBase$clientConfigurator$lambda$lambda$slambda_7, CoroutineImpl, VOID, [2]);
406
- initMetadataForLambda(HomeApiBase$clientConfigurator$lambda$lambda$slambda_9, CoroutineImpl, VOID, [2]);
407
- initMetadataForLambda(HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda, CoroutineImpl, VOID, [0]);
408
- initMetadataForLambda(HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda_1, CoroutineImpl, VOID, [1]);
409
- initMetadataForLambda(HomeApiBase$clientConfigurator$lambda$lambda$slambda_11, CoroutineImpl, VOID, [2]);
405
+ initMetadataForLambda(HomeApiBase$configureClient$lambda$slambda, CoroutineImpl, VOID, [2]);
406
+ initMetadataForLambda(HomeApiBase$configureClient$lambda$slambda_1, CoroutineImpl, VOID, [2]);
407
+ initMetadataForLambda(HomeApiBase$configureClient$lambda$slambda_3, CoroutineImpl, VOID, [2]);
408
+ initMetadataForLambda(HomeApiBase$configureClient$lambda$slambda_5, CoroutineImpl, VOID, [1]);
409
+ initMetadataForLambda(HomeApiBase$configureClient$lambda$slambda_7, CoroutineImpl, VOID, [2]);
410
+ initMetadataForLambda(HomeApiBase$configureClient$lambda$slambda_9, CoroutineImpl, VOID, [2]);
411
+ initMetadataForLambda(HomeApiBase$configureClient$lambda$lambda$slambda, CoroutineImpl, VOID, [0]);
412
+ initMetadataForLambda(HomeApiBase$configureClient$lambda$lambda$slambda_1, CoroutineImpl, VOID, [1]);
413
+ initMetadataForLambda(HomeApiBase$configureClient$lambda$slambda_11, CoroutineImpl, VOID, [3]);
414
+ initMetadataForLambda(HomeApiBase$configureClient$lambda$slambda_13, CoroutineImpl, VOID, [2]);
415
+ initMetadataForLambda(HomeApiBase$renewCookieSessionAfter$slambda, CoroutineImpl, VOID, [0]);
416
+ initMetadataForLambda(HomeApiBase$refreshSession$slambda, CoroutineImpl, VOID, [0]);
417
+ initMetadataForLambda(HomeApiBase$refreshSession$slambda_1, CoroutineImpl, VOID, [0]);
418
+ initMetadataForLambda(HomeApiBase$sharedRefresh$slambda, CoroutineImpl, VOID, [1]);
410
419
  initMetadataForLambda(HomeApiBase$eventBusConnection$slambda, CoroutineImpl, VOID, [0]);
411
420
  initMetadataForCoroutine($refreshCOROUTINE$, CoroutineImpl);
412
421
  initMetadataForCoroutine($refresh$suspendBridgeCOROUTINE$, CoroutineImpl);
@@ -414,6 +423,10 @@ initMetadataForCoroutine($refreshOrFailCOROUTINE$, CoroutineImpl);
414
423
  initMetadataForCoroutine($renewCookieSessionAfterCOROUTINE$, CoroutineImpl);
415
424
  initMetadataForCoroutine($renewCookieSessionCOROUTINE$, CoroutineImpl);
416
425
  initMetadataForCoroutine($refreshSessionCOROUTINE$, CoroutineImpl);
426
+ initMetadataForCoroutine($sharedRefreshCOROUTINE$, CoroutineImpl);
427
+ initMetadataForCoroutine($machineTokensCOROUTINE$, CoroutineImpl);
428
+ initMetadataForCoroutine($renewTokenSessionCOROUTINE$, CoroutineImpl);
429
+ initMetadataForCoroutine($endSessionCOROUTINE$, CoroutineImpl);
417
430
  initMetadataForCoroutine($revokeCookieSessionCOROUTINE$, CoroutineImpl);
418
431
  initMetadataForCoroutine($revokeCookieSession$suspendBridgeCOROUTINE$, CoroutineImpl);
419
432
  initMetadataForCoroutine($revokeAtOriginCOROUTINE$, CoroutineImpl);
@@ -422,6 +435,8 @@ initMetadataForCoroutine($revoke$suspendBridgeCOROUTINE$, CoroutineImpl);
422
435
  initMetadataForClass(HomeApiBase, 'HomeApiBase', VOID, VOID, VOID, [1, 0, 2]);
423
436
  initMetadataForClass(ApiArguments, 'ApiArguments');
424
437
  initMetadataForClass(RefreshRefused, 'RefreshRefused', VOID, Exception);
438
+ initMetadataForObject(Key, 'Key');
439
+ initMetadataForObject(RefreshInProgress, 'RefreshInProgress', VOID, AbstractCoroutineContextElement);
425
440
  initMetadataForCoroutine($findCOROUTINE$, CoroutineImpl);
426
441
  initMetadataForCoroutine($findAllCOROUTINE$, CoroutineImpl);
427
442
  initMetadataForClass(InvalidatingCacheStorage, 'InvalidatingCacheStorage', VOID, VOID, VOID, [2, 1, 0]);
@@ -3515,7 +3530,7 @@ function static_init_0() {
3515
3530
  var OriginRevoke_REVOKED_instance;
3516
3531
  var OriginRevoke_TRANSIENT_instance;
3517
3532
  var OriginRevoke_REFUSED_instance;
3518
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda$lambda($request, $route, $path) {
3533
+ function HomeApiBase$configureClient$lambda$slambda$lambda($request, $route, $path) {
3519
3534
  return function ($this$startSpan) {
3520
3535
  $this$startSpan.setStringAttribute_3st4vt_k$('http.request.method', $request.method_1.value_1);
3521
3536
  $this$startSpan.setStringAttribute_3st4vt_k$('url.template', $route);
@@ -3537,6 +3552,39 @@ function _get_authM2M__c6rkbz($this) {
3537
3552
  getPropertyCallableRef('authM2M', 1, tmp, HomeApiBase$_get_authM2M_$ref_69s5d4(), null);
3538
3553
  return tmp0.get_value_j01efc_k$();
3539
3554
  }
3555
+ function configureClient($this, $receiver, renewsSession) {
3556
+ var tmp = get_ContentNegotiation();
3557
+ $receiver.install_6m4asv_k$(tmp, HomeApiBase$configureClient$lambda);
3558
+ var tmp_0 = Companion_getInstance_2();
3559
+ $receiver.install_6m4asv_k$(tmp_0, HomeApiBase$configureClient$lambda_0($this));
3560
+ var tmp_1 = get_ContentEncoding();
3561
+ $receiver.install_6m4asv_k$(tmp_1, HomeApiBase$configureClient$lambda_1);
3562
+ $receiver.install$default_lc5jjj_k$(createClientPlugin('SoliboTracing', HomeApiBase$configureClient$lambda_2));
3563
+ var tmp_2 = get_HttpRequestRetry();
3564
+ $receiver.install_6m4asv_k$(tmp_2, HomeApiBase$configureClient$lambda_3($this));
3565
+ $receiver.install$default_lc5jjj_k$(createClientPlugin('EndFailedAttempts', HomeApiBase$configureClient$lambda_4));
3566
+ var tmp_3 = get_HttpTimeout();
3567
+ $receiver.install_6m4asv_k$(tmp_3, HomeApiBase$configureClient$lambda_5);
3568
+ $receiver.install$default_lc5jjj_k$(createClientPlugin('RemoveEmptyFields', HomeApiBase$configureClient$lambda_6));
3569
+ var tmp_4 = get_Logging();
3570
+ $receiver.install_6m4asv_k$(tmp_4, HomeApiBase$configureClient$lambda_7);
3571
+ HttpResponseValidator($receiver, HomeApiBase$configureClient$lambda_8($this));
3572
+ $receiver.install$default_lc5jjj_k$(createClientPlugin('M2MAuth', HomeApiBase$configureClient$lambda_9($this)));
3573
+ $receiver.install$default_lc5jjj_k$(createClientPlugin('RateLimitRetry', HomeApiBase$configureClient$lambda_10($this)));
3574
+ if ($this.authMode.equals(AuthMode_TOKEN_getInstance()) && renewsSession) {
3575
+ var tmp_5 = get_Auth();
3576
+ $receiver.install_6m4asv_k$(tmp_5, HomeApiBase$configureClient$lambda_11($this));
3577
+ } else if ($this.authMode.equals(AuthMode_TOKEN_getInstance())) {
3578
+ $receiver.install$default_lc5jjj_k$(createClientPlugin('RefreshBearer', HomeApiBase$configureClient$lambda_12($this)));
3579
+ } else if (!$this.authMode.equals(AuthMode_M2M_getInstance())) {
3580
+ $receiver.install$default_lc5jjj_k$(Companion_getInstance_1());
3581
+ $receiver.install$default_lc5jjj_k$(createClientPlugin('CookieSessionRefresh', HomeApiBase$configureClient$lambda_13($this)));
3582
+ }
3583
+ var platformName = (new Platform()).name_1;
3584
+ defaultRequest($receiver, HomeApiBase$configureClient$lambda_14($this, platformName));
3585
+ applyPlatformSpecificHttpClientConfig($receiver);
3586
+ $this.configurator_1($receiver);
3587
+ }
3540
3588
  function release($this, $receiver) {
3541
3589
  cancel($receiver.get_response_xlk07e_k$(), CancellationException_init_$Create$('The request is sent again'));
3542
3590
  }
@@ -3687,10 +3735,64 @@ function refreshSession($this, oldTokens, $completion) {
3687
3735
  tmp.exception_1 = null;
3688
3736
  return tmp.doResume_5yljmg_k$();
3689
3737
  }
3738
+ function sharedRefresh($this, renew, $completion) {
3739
+ var tmp = new $sharedRefreshCOROUTINE$($this, renew, $completion);
3740
+ tmp.result_1 = Unit_instance;
3741
+ tmp.exception_1 = null;
3742
+ return tmp.doResume_5yljmg_k$();
3743
+ }
3744
+ function machineTokens($this, $completion) {
3745
+ var tmp = new $machineTokensCOROUTINE$($this, $completion);
3746
+ tmp.result_1 = Unit_instance;
3747
+ tmp.exception_1 = null;
3748
+ return tmp.doResume_5yljmg_k$();
3749
+ }
3750
+ function bearerEnvelope($this, tokens) {
3751
+ // Inline function 'kotlinx.serialization.json.buildJsonObject' call
3752
+ var builder = new JsonObjectBuilder();
3753
+ builder.put_mrde5n_k$('accessToken', JsonPrimitive(tokens.accessToken));
3754
+ builder.put_mrde5n_k$('identity', JsonPrimitive(tokens.identity));
3755
+ builder.put_mrde5n_k$('data', JsonPrimitive(tokens.data));
3756
+ var envelope = builder.build_bkh6qh_k$();
3757
+ var tmp = Default_getInstance().UrlSafe_1;
3758
+ // Inline function 'kotlinx.serialization.json.Json.encodeToString' call
3759
+ var this_0 = Default_getInstance_1();
3760
+ // Inline function 'kotlinx.serialization.serializer' call
3761
+ var this_1 = this_0.get_serializersModule_piitvg_k$();
3762
+ // Inline function 'kotlinx.serialization.internal.cast' call
3763
+ var this_2 = serializer(this_1, createKType(getKClass(JsonObject), arrayOf([]), false));
3764
+ var tmp$ret$3 = isInterface(this_2, KSerializer) ? this_2 : THROW_CCE();
3765
+ var tmp$ret$2 = this_0.encodeToString_k0apqx_k$(tmp$ret$3, envelope);
3766
+ return tmp.encode$default_h4nonq_k$(toByteArray_0(tmp$ret$2));
3767
+ }
3768
+ function renewTokenSession($this, oldTokens, $completion) {
3769
+ var tmp = new $renewTokenSessionCOROUTINE$($this, oldTokens, $completion);
3770
+ tmp.result_1 = Unit_instance;
3771
+ tmp.exception_1 = null;
3772
+ return tmp.doResume_5yljmg_k$();
3773
+ }
3774
+ function storeRenewedSession($this, accessToken, renewedRefreshToken, identity) {
3775
+ if (renewedRefreshToken == null)
3776
+ null;
3777
+ else {
3778
+ // Inline function 'kotlin.let' call
3779
+ $this.setRefreshToken(renewedRefreshToken);
3780
+ }
3781
+ $this.setToken(accessToken);
3782
+ $this.set_userId_wekl5g_k$(identity);
3783
+ }
3690
3784
  function endSession($this, $completion) {
3691
- $this.settings_1.remove_6241ba_k$('activeLogin');
3692
- $this.clearTokens();
3693
- return $this.refreshFailure_1($completion);
3785
+ var tmp = new $endSessionCOROUTINE$($this, $completion);
3786
+ tmp.result_1 = Unit_instance;
3787
+ tmp.exception_1 = null;
3788
+ return tmp.doResume_5yljmg_k$();
3789
+ }
3790
+ function _get_refreshAuth__q4vj66($this) {
3791
+ var tmp0 = $this.refreshAuth$delegate_1;
3792
+ var tmp = KProperty1;
3793
+ // Inline function 'kotlin.getValue' call
3794
+ getPropertyCallableRef('refreshAuth', 1, tmp, HomeApiBase$_get_refreshAuth_$ref_x2cel7(), null);
3795
+ return tmp0.get_value_j01efc_k$();
3694
3796
  }
3695
3797
  function _get_sessionAuth__fjt4oj($this) {
3696
3798
  var tmp0 = $this.sessionAuth$delegate_1;
@@ -3810,42 +3912,54 @@ function HomeApiBase$_get_authM2M_$ref_69s5d4() {
3810
3912
  return _get_authM2M__c6rkbz(p0);
3811
3913
  }, 1, 0, 107);
3812
3914
  }
3813
- function HomeApiBase$clientConfigurator$lambda$lambda($this$install) {
3915
+ function HomeApiBase$clientConfigurator$lambda(this$0) {
3916
+ return function (_this__u8e3s4) {
3917
+ configureClient(this$0, _this__u8e3s4, true);
3918
+ return Unit_instance;
3919
+ };
3920
+ }
3921
+ function HomeApiBase$refreshClientConfigurator$lambda(this$0) {
3922
+ return function (_this__u8e3s4) {
3923
+ configureClient(this$0, _this__u8e3s4, false);
3924
+ return Unit_instance;
3925
+ };
3926
+ }
3927
+ function HomeApiBase$configureClient$lambda($this$install) {
3814
3928
  streamingJson($this$install, get_sdkJson());
3815
3929
  return Unit_instance;
3816
3930
  }
3817
- function HomeApiBase$clientConfigurator$lambda$lambda_0(this$0) {
3931
+ function HomeApiBase$configureClient$lambda_0(this$0) {
3818
3932
  return function ($this$install) {
3819
3933
  $this$install.publicStorage_gtmqh9_k$(this$0.publicCacheStorage_1);
3820
3934
  $this$install.privateStorage_dcznfd_k$(this$0.privateCacheStorage_1);
3821
3935
  return Unit_instance;
3822
3936
  };
3823
3937
  }
3824
- function HomeApiBase$clientConfigurator$lambda$lambda_1($this$install) {
3938
+ function HomeApiBase$configureClient$lambda_1($this$install) {
3825
3939
  $this$install.gzip$default_2n8zsi_k$();
3826
3940
  $this$install.deflate$default_llu6kj_k$();
3827
3941
  $this$install.identity$default_3sck2e_k$();
3828
3942
  return Unit_instance;
3829
3943
  }
3830
- function HomeApiBase$clientConfigurator$lambda$lambda_2($this$createClientPlugin) {
3944
+ function HomeApiBase$configureClient$lambda_2($this$createClientPlugin) {
3831
3945
  var tmp = Send_instance;
3832
- $this$createClientPlugin.on_z1oiz_k$(tmp, HomeApiBase$clientConfigurator$lambda$lambda$slambda_0(null));
3946
+ $this$createClientPlugin.on_z1oiz_k$(tmp, HomeApiBase$configureClient$lambda$slambda_0(null));
3833
3947
  return Unit_instance;
3834
3948
  }
3835
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda(resultContinuation) {
3949
+ function HomeApiBase$configureClient$lambda$slambda(resultContinuation) {
3836
3950
  CoroutineImpl.call(this, resultContinuation);
3837
3951
  }
3838
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda).invoke_nc6r0k_k$ = function ($this$on, request, $completion) {
3952
+ protoOf(HomeApiBase$configureClient$lambda$slambda).invoke_nc6r0k_k$ = function ($this$on, request, $completion) {
3839
3953
  var tmp = this.create_v0j3o4_k$($this$on, request, $completion);
3840
3954
  tmp.result_1 = Unit_instance;
3841
3955
  tmp.exception_1 = null;
3842
3956
  return tmp.doResume_5yljmg_k$();
3843
3957
  };
3844
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda).invoke_4tzzq6_k$ = function (p1, p2, $completion) {
3958
+ protoOf(HomeApiBase$configureClient$lambda$slambda).invoke_4tzzq6_k$ = function (p1, p2, $completion) {
3845
3959
  var tmp = p1 instanceof Sender ? p1 : THROW_CCE();
3846
3960
  return this.invoke_nc6r0k_k$(tmp, p2 instanceof HttpRequestBuilder ? p2 : THROW_CCE(), $completion);
3847
3961
  };
3848
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda).doResume_5yljmg_k$ = function () {
3962
+ protoOf(HomeApiBase$configureClient$lambda$slambda).doResume_5yljmg_k$ = function () {
3849
3963
  var suspendResult = this.result_1;
3850
3964
  $sm: do
3851
3965
  try {
@@ -3872,7 +3986,7 @@ protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda).doResume_5yljmg_k$
3872
3986
  var tmp_0 = this;
3873
3987
  var tmp_1 = httpSpanName(this.request_1.method_1.value_1, route);
3874
3988
  var tmp_2 = SpanKind_CLIENT_getInstance();
3875
- tmp_0.span0__1 = this.tracer2__1.startSpan$default_8x1s39_k$(tmp_1, VOID, tmp_2, VOID, HomeApiBase$clientConfigurator$lambda$lambda$slambda$lambda(this.request_1, route, path));
3989
+ tmp_0.span0__1 = this.tracer2__1.startSpan$default_8x1s39_k$(tmp_1, VOID, tmp_2, VOID, HomeApiBase$configureClient$lambda$slambda$lambda(this.request_1, route, path));
3876
3990
  this.request_1.attributes_1.put_gkntno_k$(get_SoliboSpanKey(), this.span0__1);
3877
3991
  this.state_1 = 2;
3878
3992
  continue $sm;
@@ -3935,19 +4049,19 @@ protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda).doResume_5yljmg_k$
3935
4049
  }
3936
4050
  while (true);
3937
4051
  };
3938
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda).create_v0j3o4_k$ = function ($this$on, request, completion) {
3939
- var i = new HomeApiBase$clientConfigurator$lambda$lambda$slambda(completion);
4052
+ protoOf(HomeApiBase$configureClient$lambda$slambda).create_v0j3o4_k$ = function ($this$on, request, completion) {
4053
+ var i = new HomeApiBase$configureClient$lambda$slambda(completion);
3940
4054
  i.$this$on_1 = $this$on;
3941
4055
  i.request_1 = request;
3942
4056
  return i;
3943
4057
  };
3944
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_0(resultContinuation) {
3945
- var i = new HomeApiBase$clientConfigurator$lambda$lambda$slambda(resultContinuation);
4058
+ function HomeApiBase$configureClient$lambda$slambda_0(resultContinuation) {
4059
+ var i = new HomeApiBase$configureClient$lambda$slambda(resultContinuation);
3946
4060
  return constructCallableReference(function ($this$on, request, $completion) {
3947
4061
  return i.invoke_nc6r0k_k$($this$on, request, $completion);
3948
4062
  }, 2);
3949
4063
  }
3950
- function HomeApiBase$clientConfigurator$lambda$lambda$lambda($this$retryOnExceptionIf, request, cause) {
4064
+ function HomeApiBase$configureClient$lambda$lambda($this$retryOnExceptionIf, request, cause) {
3951
4065
  var tmp;
3952
4066
  var tmp_0;
3953
4067
  var tmp_1;
@@ -4007,7 +4121,7 @@ function HomeApiBase$clientConfigurator$lambda$lambda$lambda($this$retryOnExcept
4007
4121
  }
4008
4122
  return tmp;
4009
4123
  }
4010
- function HomeApiBase$clientConfigurator$lambda$lambda$lambda_0(this$0) {
4124
+ function HomeApiBase$configureClient$lambda$lambda_0(this$0) {
4011
4125
  return function ($this$modifyRequest, request) {
4012
4126
  var tmp;
4013
4127
  var tmp_0;
@@ -4038,7 +4152,7 @@ function HomeApiBase$clientConfigurator$lambda$lambda$lambda_0(this$0) {
4038
4152
  return Unit_instance;
4039
4153
  };
4040
4154
  }
4041
- function HomeApiBase$clientConfigurator$lambda$lambda$lambda_1($this$retryIf, request, response) {
4155
+ function HomeApiBase$configureClient$lambda$lambda_1($this$retryIf, request, response) {
4042
4156
  var tmp;
4043
4157
  var tmp_0;
4044
4158
  var containsArg = response.get_status_jnf6d7_k$().value_1;
@@ -4054,35 +4168,35 @@ function HomeApiBase$clientConfigurator$lambda$lambda$lambda_1($this$retryIf, re
4054
4168
  }
4055
4169
  return tmp;
4056
4170
  }
4057
- function HomeApiBase$clientConfigurator$lambda$lambda_3(this$0) {
4171
+ function HomeApiBase$configureClient$lambda_3(this$0) {
4058
4172
  return function ($this$install) {
4059
4173
  $this$install.maxRetries_1 = 5;
4060
- $this$install.retryOnExceptionIf$default_s26x3m_k$(VOID, HomeApiBase$clientConfigurator$lambda$lambda$lambda);
4061
- $this$install.modifyRequest_6qlpaw_k$(HomeApiBase$clientConfigurator$lambda$lambda$lambda_0(this$0));
4062
- $this$install.retryIf_sig7v0_k$(5, HomeApiBase$clientConfigurator$lambda$lambda$lambda_1);
4174
+ $this$install.retryOnExceptionIf$default_s26x3m_k$(VOID, HomeApiBase$configureClient$lambda$lambda);
4175
+ $this$install.modifyRequest_6qlpaw_k$(HomeApiBase$configureClient$lambda$lambda_0(this$0));
4176
+ $this$install.retryIf_sig7v0_k$(5, HomeApiBase$configureClient$lambda$lambda_1);
4063
4177
  $this$install.exponentialDelay$default_gkwfsg_k$();
4064
4178
  return Unit_instance;
4065
4179
  };
4066
4180
  }
4067
- function HomeApiBase$clientConfigurator$lambda$lambda_4($this$createClientPlugin) {
4181
+ function HomeApiBase$configureClient$lambda_4($this$createClientPlugin) {
4068
4182
  var tmp = Send_instance;
4069
- $this$createClientPlugin.on_z1oiz_k$(tmp, HomeApiBase$clientConfigurator$lambda$lambda$slambda_2(null));
4183
+ $this$createClientPlugin.on_z1oiz_k$(tmp, HomeApiBase$configureClient$lambda$slambda_2(null));
4070
4184
  return Unit_instance;
4071
4185
  }
4072
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_1(resultContinuation) {
4186
+ function HomeApiBase$configureClient$lambda$slambda_1(resultContinuation) {
4073
4187
  CoroutineImpl.call(this, resultContinuation);
4074
4188
  }
4075
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_1).invoke_nc6r0k_k$ = function ($this$on, attempt, $completion) {
4189
+ protoOf(HomeApiBase$configureClient$lambda$slambda_1).invoke_nc6r0k_k$ = function ($this$on, attempt, $completion) {
4076
4190
  var tmp = this.create_v0j3o4_k$($this$on, attempt, $completion);
4077
4191
  tmp.result_1 = Unit_instance;
4078
4192
  tmp.exception_1 = null;
4079
4193
  return tmp.doResume_5yljmg_k$();
4080
4194
  };
4081
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_1).invoke_4tzzq6_k$ = function (p1, p2, $completion) {
4195
+ protoOf(HomeApiBase$configureClient$lambda$slambda_1).invoke_4tzzq6_k$ = function (p1, p2, $completion) {
4082
4196
  var tmp = p1 instanceof Sender ? p1 : THROW_CCE();
4083
4197
  return this.invoke_nc6r0k_k$(tmp, p2 instanceof HttpRequestBuilder ? p2 : THROW_CCE(), $completion);
4084
4198
  };
4085
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_1).doResume_5yljmg_k$ = function () {
4199
+ protoOf(HomeApiBase$configureClient$lambda$slambda_1).doResume_5yljmg_k$ = function () {
4086
4200
  var suspendResult = this.result_1;
4087
4201
  $sm: do
4088
4202
  try {
@@ -4132,43 +4246,43 @@ protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_1).doResume_5yljmg_
4132
4246
  }
4133
4247
  while (true);
4134
4248
  };
4135
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_1).create_v0j3o4_k$ = function ($this$on, attempt, completion) {
4136
- var i = new HomeApiBase$clientConfigurator$lambda$lambda$slambda_1(completion);
4249
+ protoOf(HomeApiBase$configureClient$lambda$slambda_1).create_v0j3o4_k$ = function ($this$on, attempt, completion) {
4250
+ var i = new HomeApiBase$configureClient$lambda$slambda_1(completion);
4137
4251
  i.$this$on_1 = $this$on;
4138
4252
  i.attempt_1 = attempt;
4139
4253
  return i;
4140
4254
  };
4141
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_2(resultContinuation) {
4142
- var i = new HomeApiBase$clientConfigurator$lambda$lambda$slambda_1(resultContinuation);
4255
+ function HomeApiBase$configureClient$lambda$slambda_2(resultContinuation) {
4256
+ var i = new HomeApiBase$configureClient$lambda$slambda_1(resultContinuation);
4143
4257
  return constructCallableReference(function ($this$on, attempt, $completion) {
4144
4258
  return i.invoke_nc6r0k_k$($this$on, attempt, $completion);
4145
4259
  }, 2);
4146
4260
  }
4147
- function HomeApiBase$clientConfigurator$lambda$lambda_5($this$install) {
4261
+ function HomeApiBase$configureClient$lambda_5($this$install) {
4148
4262
  $this$install.set_requestTimeoutMillis_9cb75s_k$(500000n);
4149
4263
  $this$install.set_connectTimeoutMillis_48d5dx_k$(5000n);
4150
4264
  $this$install.set_socketTimeoutMillis_faj43m_k$(500000n);
4151
4265
  return Unit_instance;
4152
4266
  }
4153
- function HomeApiBase$clientConfigurator$lambda$lambda_6($this$createClientPlugin) {
4267
+ function HomeApiBase$configureClient$lambda_6($this$createClientPlugin) {
4154
4268
  var tmp = Send_instance;
4155
- $this$createClientPlugin.on_z1oiz_k$(tmp, HomeApiBase$clientConfigurator$lambda$lambda$slambda_4(null));
4269
+ $this$createClientPlugin.on_z1oiz_k$(tmp, HomeApiBase$configureClient$lambda$slambda_4(null));
4156
4270
  return Unit_instance;
4157
4271
  }
4158
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_3(resultContinuation) {
4272
+ function HomeApiBase$configureClient$lambda$slambda_3(resultContinuation) {
4159
4273
  CoroutineImpl.call(this, resultContinuation);
4160
4274
  }
4161
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_3).invoke_nc6r0k_k$ = function ($this$on, request, $completion) {
4275
+ protoOf(HomeApiBase$configureClient$lambda$slambda_3).invoke_nc6r0k_k$ = function ($this$on, request, $completion) {
4162
4276
  var tmp = this.create_v0j3o4_k$($this$on, request, $completion);
4163
4277
  tmp.result_1 = Unit_instance;
4164
4278
  tmp.exception_1 = null;
4165
4279
  return tmp.doResume_5yljmg_k$();
4166
4280
  };
4167
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_3).invoke_4tzzq6_k$ = function (p1, p2, $completion) {
4281
+ protoOf(HomeApiBase$configureClient$lambda$slambda_3).invoke_4tzzq6_k$ = function (p1, p2, $completion) {
4168
4282
  var tmp = p1 instanceof Sender ? p1 : THROW_CCE();
4169
4283
  return this.invoke_nc6r0k_k$(tmp, p2 instanceof HttpRequestBuilder ? p2 : THROW_CCE(), $completion);
4170
4284
  };
4171
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_3).doResume_5yljmg_k$ = function () {
4285
+ protoOf(HomeApiBase$configureClient$lambda$slambda_3).doResume_5yljmg_k$ = function () {
4172
4286
  var suspendResult = this.result_1;
4173
4287
  $sm: do
4174
4288
  try {
@@ -4261,41 +4375,41 @@ protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_3).doResume_5yljmg_
4261
4375
  }
4262
4376
  while (true);
4263
4377
  };
4264
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_3).create_v0j3o4_k$ = function ($this$on, request, completion) {
4265
- var i = new HomeApiBase$clientConfigurator$lambda$lambda$slambda_3(completion);
4378
+ protoOf(HomeApiBase$configureClient$lambda$slambda_3).create_v0j3o4_k$ = function ($this$on, request, completion) {
4379
+ var i = new HomeApiBase$configureClient$lambda$slambda_3(completion);
4266
4380
  i.$this$on_1 = $this$on;
4267
4381
  i.request_1 = request;
4268
4382
  return i;
4269
4383
  };
4270
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_4(resultContinuation) {
4271
- var i = new HomeApiBase$clientConfigurator$lambda$lambda$slambda_3(resultContinuation);
4384
+ function HomeApiBase$configureClient$lambda$slambda_4(resultContinuation) {
4385
+ var i = new HomeApiBase$configureClient$lambda$slambda_3(resultContinuation);
4272
4386
  return constructCallableReference(function ($this$on, request, $completion) {
4273
4387
  return i.invoke_nc6r0k_k$($this$on, request, $completion);
4274
4388
  }, 2);
4275
4389
  }
4276
- function HomeApiBase$clientConfigurator$lambda$lambda_7($this$install) {
4390
+ function HomeApiBase$configureClient$lambda_7($this$install) {
4277
4391
  $this$install.level_1 = LogLevel_NONE_getInstance();
4278
- $this$install.sanitizeHeader$default_8x7pzj_k$(VOID, HomeApiBase$clientConfigurator$lambda$lambda$lambda_2);
4392
+ $this$install.sanitizeHeader$default_8x7pzj_k$(VOID, HomeApiBase$configureClient$lambda$lambda_2);
4279
4393
  return Unit_instance;
4280
4394
  }
4281
- function HomeApiBase$clientConfigurator$lambda$lambda$lambda_2(header) {
4395
+ function HomeApiBase$configureClient$lambda$lambda_2(header) {
4282
4396
  return header === 'Authorization';
4283
4397
  }
4284
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_5($this_HttpResponseValidator, this$0, resultContinuation) {
4398
+ function HomeApiBase$configureClient$lambda$slambda_5($this_HttpResponseValidator, this$0, resultContinuation) {
4285
4399
  this.$this_HttpResponseValidator_1 = $this_HttpResponseValidator;
4286
4400
  this.this$0__1 = this$0;
4287
4401
  CoroutineImpl.call(this, resultContinuation);
4288
4402
  }
4289
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_5).invoke_g2i713_k$ = function (response, $completion) {
4403
+ protoOf(HomeApiBase$configureClient$lambda$slambda_5).invoke_g2i713_k$ = function (response, $completion) {
4290
4404
  var tmp = this.create_e75tx1_k$(response, $completion);
4291
4405
  tmp.result_1 = Unit_instance;
4292
4406
  tmp.exception_1 = null;
4293
4407
  return tmp.doResume_5yljmg_k$();
4294
4408
  };
4295
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_5).invoke_qns8j1_k$ = function (p1, $completion) {
4409
+ protoOf(HomeApiBase$configureClient$lambda$slambda_5).invoke_qns8j1_k$ = function (p1, $completion) {
4296
4410
  return this.invoke_g2i713_k$(p1 instanceof HttpResponse ? p1 : THROW_CCE(), $completion);
4297
4411
  };
4298
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_5).doResume_5yljmg_k$ = function () {
4412
+ protoOf(HomeApiBase$configureClient$lambda$slambda_5).doResume_5yljmg_k$ = function () {
4299
4413
  var suspendResult = this.result_1;
4300
4414
  $sm: do
4301
4415
  try {
@@ -4417,38 +4531,38 @@ protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_5).doResume_5yljmg_
4417
4531
  }
4418
4532
  while (true);
4419
4533
  };
4420
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_5).create_e75tx1_k$ = function (response, completion) {
4421
- var i = new HomeApiBase$clientConfigurator$lambda$lambda$slambda_5(this.$this_HttpResponseValidator_1, this.this$0__1, completion);
4534
+ protoOf(HomeApiBase$configureClient$lambda$slambda_5).create_e75tx1_k$ = function (response, completion) {
4535
+ var i = new HomeApiBase$configureClient$lambda$slambda_5(this.$this_HttpResponseValidator_1, this.this$0__1, completion);
4422
4536
  i.response_1 = response;
4423
4537
  return i;
4424
4538
  };
4425
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_6($this_HttpResponseValidator, this$0, resultContinuation) {
4426
- var i = new HomeApiBase$clientConfigurator$lambda$lambda$slambda_5($this_HttpResponseValidator, this$0, resultContinuation);
4539
+ function HomeApiBase$configureClient$lambda$slambda_6($this_HttpResponseValidator, this$0, resultContinuation) {
4540
+ var i = new HomeApiBase$configureClient$lambda$slambda_5($this_HttpResponseValidator, this$0, resultContinuation);
4427
4541
  return constructCallableReference(function (response, $completion) {
4428
4542
  return i.invoke_g2i713_k$(response, $completion);
4429
4543
  }, 1);
4430
4544
  }
4431
- function HomeApiBase$clientConfigurator$lambda$lambda_8(this$0) {
4545
+ function HomeApiBase$configureClient$lambda_8(this$0) {
4432
4546
  return function ($this$HttpResponseValidator) {
4433
- $this$HttpResponseValidator.validateResponse_cfyktb_k$(HomeApiBase$clientConfigurator$lambda$lambda$slambda_6($this$HttpResponseValidator, this$0, null));
4547
+ $this$HttpResponseValidator.validateResponse_cfyktb_k$(HomeApiBase$configureClient$lambda$slambda_6($this$HttpResponseValidator, this$0, null));
4434
4548
  return Unit_instance;
4435
4549
  };
4436
4550
  }
4437
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_7(this$0, resultContinuation) {
4551
+ function HomeApiBase$configureClient$lambda$slambda_7(this$0, resultContinuation) {
4438
4552
  this.this$0__1 = this$0;
4439
4553
  CoroutineImpl.call(this, resultContinuation);
4440
4554
  }
4441
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_7).invoke_nc6r0k_k$ = function ($this$on, request, $completion) {
4555
+ protoOf(HomeApiBase$configureClient$lambda$slambda_7).invoke_nc6r0k_k$ = function ($this$on, request, $completion) {
4442
4556
  var tmp = this.create_v0j3o4_k$($this$on, request, $completion);
4443
4557
  tmp.result_1 = Unit_instance;
4444
4558
  tmp.exception_1 = null;
4445
4559
  return tmp.doResume_5yljmg_k$();
4446
4560
  };
4447
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_7).invoke_4tzzq6_k$ = function (p1, p2, $completion) {
4561
+ protoOf(HomeApiBase$configureClient$lambda$slambda_7).invoke_4tzzq6_k$ = function (p1, p2, $completion) {
4448
4562
  var tmp = p1 instanceof Sender ? p1 : THROW_CCE();
4449
4563
  return this.invoke_nc6r0k_k$(tmp, p2 instanceof HttpRequestBuilder ? p2 : THROW_CCE(), $completion);
4450
4564
  };
4451
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_7).doResume_5yljmg_k$ = function () {
4565
+ protoOf(HomeApiBase$configureClient$lambda$slambda_7).doResume_5yljmg_k$ = function () {
4452
4566
  var suspendResult = this.result_1;
4453
4567
  $sm: do
4454
4568
  try {
@@ -4500,40 +4614,40 @@ protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_7).doResume_5yljmg_
4500
4614
  }
4501
4615
  while (true);
4502
4616
  };
4503
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_7).create_v0j3o4_k$ = function ($this$on, request, completion) {
4504
- var i = new HomeApiBase$clientConfigurator$lambda$lambda$slambda_7(this.this$0__1, completion);
4617
+ protoOf(HomeApiBase$configureClient$lambda$slambda_7).create_v0j3o4_k$ = function ($this$on, request, completion) {
4618
+ var i = new HomeApiBase$configureClient$lambda$slambda_7(this.this$0__1, completion);
4505
4619
  i.$this$on_1 = $this$on;
4506
4620
  i.request_1 = request;
4507
4621
  return i;
4508
4622
  };
4509
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_8(this$0, resultContinuation) {
4510
- var i = new HomeApiBase$clientConfigurator$lambda$lambda$slambda_7(this$0, resultContinuation);
4623
+ function HomeApiBase$configureClient$lambda$slambda_8(this$0, resultContinuation) {
4624
+ var i = new HomeApiBase$configureClient$lambda$slambda_7(this$0, resultContinuation);
4511
4625
  return constructCallableReference(function ($this$on, request, $completion) {
4512
4626
  return i.invoke_nc6r0k_k$($this$on, request, $completion);
4513
4627
  }, 2);
4514
4628
  }
4515
- function HomeApiBase$clientConfigurator$lambda$lambda_9(this$0) {
4629
+ function HomeApiBase$configureClient$lambda_9(this$0) {
4516
4630
  return function ($this$createClientPlugin) {
4517
4631
  var tmp = Send_instance;
4518
- $this$createClientPlugin.on_z1oiz_k$(tmp, HomeApiBase$clientConfigurator$lambda$lambda$slambda_8(this$0, null));
4632
+ $this$createClientPlugin.on_z1oiz_k$(tmp, HomeApiBase$configureClient$lambda$slambda_8(this$0, null));
4519
4633
  return Unit_instance;
4520
4634
  };
4521
4635
  }
4522
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_9(this$0, resultContinuation) {
4636
+ function HomeApiBase$configureClient$lambda$slambda_9(this$0, resultContinuation) {
4523
4637
  this.this$0__1 = this$0;
4524
4638
  CoroutineImpl.call(this, resultContinuation);
4525
4639
  }
4526
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_9).invoke_nc6r0k_k$ = function ($this$on, request, $completion) {
4640
+ protoOf(HomeApiBase$configureClient$lambda$slambda_9).invoke_nc6r0k_k$ = function ($this$on, request, $completion) {
4527
4641
  var tmp = this.create_v0j3o4_k$($this$on, request, $completion);
4528
4642
  tmp.result_1 = Unit_instance;
4529
4643
  tmp.exception_1 = null;
4530
4644
  return tmp.doResume_5yljmg_k$();
4531
4645
  };
4532
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_9).invoke_4tzzq6_k$ = function (p1, p2, $completion) {
4646
+ protoOf(HomeApiBase$configureClient$lambda$slambda_9).invoke_4tzzq6_k$ = function (p1, p2, $completion) {
4533
4647
  var tmp = p1 instanceof Sender ? p1 : THROW_CCE();
4534
4648
  return this.invoke_nc6r0k_k$(tmp, p2 instanceof HttpRequestBuilder ? p2 : THROW_CCE(), $completion);
4535
4649
  };
4536
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_9).doResume_5yljmg_k$ = function () {
4650
+ protoOf(HomeApiBase$configureClient$lambda$slambda_9).doResume_5yljmg_k$ = function () {
4537
4651
  var suspendResult = this.result_1;
4538
4652
  $sm: do
4539
4653
  try {
@@ -4602,39 +4716,39 @@ protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_9).doResume_5yljmg_
4602
4716
  }
4603
4717
  while (true);
4604
4718
  };
4605
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_9).create_v0j3o4_k$ = function ($this$on, request, completion) {
4606
- var i = new HomeApiBase$clientConfigurator$lambda$lambda$slambda_9(this.this$0__1, completion);
4719
+ protoOf(HomeApiBase$configureClient$lambda$slambda_9).create_v0j3o4_k$ = function ($this$on, request, completion) {
4720
+ var i = new HomeApiBase$configureClient$lambda$slambda_9(this.this$0__1, completion);
4607
4721
  i.$this$on_1 = $this$on;
4608
4722
  i.request_1 = request;
4609
4723
  return i;
4610
4724
  };
4611
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_10(this$0, resultContinuation) {
4612
- var i = new HomeApiBase$clientConfigurator$lambda$lambda$slambda_9(this$0, resultContinuation);
4725
+ function HomeApiBase$configureClient$lambda$slambda_10(this$0, resultContinuation) {
4726
+ var i = new HomeApiBase$configureClient$lambda$slambda_9(this$0, resultContinuation);
4613
4727
  return constructCallableReference(function ($this$on, request, $completion) {
4614
4728
  return i.invoke_nc6r0k_k$($this$on, request, $completion);
4615
4729
  }, 2);
4616
4730
  }
4617
- function HomeApiBase$clientConfigurator$lambda$lambda_10(this$0) {
4731
+ function HomeApiBase$configureClient$lambda_10(this$0) {
4618
4732
  return function ($this$createClientPlugin) {
4619
4733
  var tmp = Send_instance;
4620
- $this$createClientPlugin.on_z1oiz_k$(tmp, HomeApiBase$clientConfigurator$lambda$lambda$slambda_10(this$0, null));
4734
+ $this$createClientPlugin.on_z1oiz_k$(tmp, HomeApiBase$configureClient$lambda$slambda_10(this$0, null));
4621
4735
  return Unit_instance;
4622
4736
  };
4623
4737
  }
4624
- function HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda(this$0, resultContinuation) {
4738
+ function HomeApiBase$configureClient$lambda$lambda$slambda(this$0, resultContinuation) {
4625
4739
  this.this$0__1 = this$0;
4626
4740
  CoroutineImpl.call(this, resultContinuation);
4627
4741
  }
4628
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda).invoke_llb9nu_k$ = function ($completion) {
4742
+ protoOf(HomeApiBase$configureClient$lambda$lambda$slambda).invoke_llb9nu_k$ = function ($completion) {
4629
4743
  var tmp = this.create_d196fn_k$($completion);
4630
4744
  tmp.result_1 = Unit_instance;
4631
4745
  tmp.exception_1 = null;
4632
4746
  return tmp.doResume_5yljmg_k$();
4633
4747
  };
4634
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda).invoke_ib42db_k$ = function ($completion) {
4748
+ protoOf(HomeApiBase$configureClient$lambda$lambda$slambda).invoke_ib42db_k$ = function ($completion) {
4635
4749
  return this.invoke_llb9nu_k$($completion);
4636
4750
  };
4637
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda).doResume_5yljmg_k$ = function () {
4751
+ protoOf(HomeApiBase$configureClient$lambda$lambda$slambda).doResume_5yljmg_k$ = function () {
4638
4752
  var suspendResult = this.result_1;
4639
4753
  $sm: do
4640
4754
  try {
@@ -4655,29 +4769,29 @@ protoOf(HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda).doResume_5y
4655
4769
  }
4656
4770
  while (true);
4657
4771
  };
4658
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda).create_d196fn_k$ = function (completion) {
4659
- return new HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda(this.this$0__1, completion);
4772
+ protoOf(HomeApiBase$configureClient$lambda$lambda$slambda).create_d196fn_k$ = function (completion) {
4773
+ return new HomeApiBase$configureClient$lambda$lambda$slambda(this.this$0__1, completion);
4660
4774
  };
4661
- function HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda_0(this$0, resultContinuation) {
4662
- var i = new HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda(this$0, resultContinuation);
4775
+ function HomeApiBase$configureClient$lambda$lambda$slambda_0(this$0, resultContinuation) {
4776
+ var i = new HomeApiBase$configureClient$lambda$lambda$slambda(this$0, resultContinuation);
4663
4777
  return constructCallableReference(function ($completion) {
4664
4778
  return i.invoke_llb9nu_k$($completion);
4665
4779
  }, 0);
4666
4780
  }
4667
- function HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda_1(this$0, resultContinuation) {
4781
+ function HomeApiBase$configureClient$lambda$lambda$slambda_1(this$0, resultContinuation) {
4668
4782
  this.this$0__1 = this$0;
4669
4783
  CoroutineImpl.call(this, resultContinuation);
4670
4784
  }
4671
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda_1).invoke_5ffmyk_k$ = function ($this$refreshTokens, $completion) {
4785
+ protoOf(HomeApiBase$configureClient$lambda$lambda$slambda_1).invoke_5ffmyk_k$ = function ($this$refreshTokens, $completion) {
4672
4786
  var tmp = this.create_ig4e4p_k$($this$refreshTokens, $completion);
4673
4787
  tmp.result_1 = Unit_instance;
4674
4788
  tmp.exception_1 = null;
4675
4789
  return tmp.doResume_5yljmg_k$();
4676
4790
  };
4677
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda_1).invoke_qns8j1_k$ = function (p1, $completion) {
4791
+ protoOf(HomeApiBase$configureClient$lambda$lambda$slambda_1).invoke_qns8j1_k$ = function (p1, $completion) {
4678
4792
  return this.invoke_5ffmyk_k$(p1 instanceof RefreshTokensParams ? p1 : THROW_CCE(), $completion);
4679
4793
  };
4680
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda_1).doResume_5yljmg_k$ = function () {
4794
+ protoOf(HomeApiBase$configureClient$lambda$lambda$slambda_1).doResume_5yljmg_k$ = function () {
4681
4795
  var suspendResult = this.result_1;
4682
4796
  $sm: do
4683
4797
  try {
@@ -4723,45 +4837,115 @@ protoOf(HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda_1).doResume_
4723
4837
  }
4724
4838
  while (true);
4725
4839
  };
4726
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda_1).create_ig4e4p_k$ = function ($this$refreshTokens, completion) {
4727
- var i = new HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda_1(this.this$0__1, completion);
4840
+ protoOf(HomeApiBase$configureClient$lambda$lambda$slambda_1).create_ig4e4p_k$ = function ($this$refreshTokens, completion) {
4841
+ var i = new HomeApiBase$configureClient$lambda$lambda$slambda_1(this.this$0__1, completion);
4728
4842
  i.$this$refreshTokens_1 = $this$refreshTokens;
4729
4843
  return i;
4730
4844
  };
4731
- function HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda_2(this$0, resultContinuation) {
4732
- var i = new HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda_1(this$0, resultContinuation);
4845
+ function HomeApiBase$configureClient$lambda$lambda$slambda_2(this$0, resultContinuation) {
4846
+ var i = new HomeApiBase$configureClient$lambda$lambda$slambda_1(this$0, resultContinuation);
4733
4847
  return constructCallableReference(function ($this$refreshTokens, $completion) {
4734
4848
  return i.invoke_5ffmyk_k$($this$refreshTokens, $completion);
4735
4849
  }, 1);
4736
4850
  }
4737
- function HomeApiBase$clientConfigurator$lambda$lambda$lambda_3(this$0) {
4851
+ function HomeApiBase$configureClient$lambda$lambda_3(this$0) {
4738
4852
  return function ($this$bearer) {
4739
- $this$bearer.loadTokens_z0xglj_k$(HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda_0(this$0, null));
4740
- $this$bearer.refreshTokens_l9342v_k$(HomeApiBase$clientConfigurator$lambda$lambda$lambda$slambda_2(this$0, null));
4853
+ $this$bearer.loadTokens_z0xglj_k$(HomeApiBase$configureClient$lambda$lambda$slambda_0(this$0, null));
4854
+ $this$bearer.refreshTokens_l9342v_k$(HomeApiBase$configureClient$lambda$lambda$slambda_2(this$0, null));
4741
4855
  return Unit_instance;
4742
4856
  };
4743
4857
  }
4744
- function HomeApiBase$clientConfigurator$lambda$lambda_11(this$0) {
4858
+ function HomeApiBase$configureClient$lambda_11(this$0) {
4745
4859
  return function ($this$install) {
4746
- bearer($this$install, HomeApiBase$clientConfigurator$lambda$lambda$lambda_3(this$0));
4860
+ bearer($this$install, HomeApiBase$configureClient$lambda$lambda_3(this$0));
4747
4861
  return Unit_instance;
4748
4862
  };
4749
4863
  }
4750
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_11(this$0, resultContinuation) {
4864
+ function HomeApiBase$configureClient$lambda$slambda_11(this$0, resultContinuation) {
4751
4865
  this.this$0__1 = this$0;
4752
4866
  CoroutineImpl.call(this, resultContinuation);
4753
4867
  }
4754
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_11).invoke_nc6r0k_k$ = function ($this$on, request, $completion) {
4868
+ protoOf(HomeApiBase$configureClient$lambda$slambda_11).invoke_572pd7_k$ = function ($this$onRequest, request, _unused_var__etf5q3, $completion) {
4869
+ var tmp = this.create_2brvp3_k$($this$onRequest, request, _unused_var__etf5q3, $completion);
4870
+ tmp.result_1 = Unit_instance;
4871
+ tmp.exception_1 = null;
4872
+ return tmp.doResume_5yljmg_k$();
4873
+ };
4874
+ protoOf(HomeApiBase$configureClient$lambda$slambda_11).invoke_ihdh7y_k$ = function (p1, p2, p3, $completion) {
4875
+ var tmp = p1 instanceof OnRequestContext ? p1 : THROW_CCE();
4876
+ var tmp_0 = p2 instanceof HttpRequestBuilder ? p2 : THROW_CCE();
4877
+ return this.invoke_572pd7_k$(tmp, tmp_0, !(p3 == null) ? p3 : THROW_CCE(), $completion);
4878
+ };
4879
+ protoOf(HomeApiBase$configureClient$lambda$slambda_11).doResume_5yljmg_k$ = function () {
4880
+ var suspendResult = this.result_1;
4881
+ $sm: do
4882
+ try {
4883
+ var tmp = this.state_1;
4884
+ if (tmp === 0) {
4885
+ this.exceptionState_1 = 1;
4886
+ var tmp0_safe_receiver = this.this$0__1.bearerToken_1;
4887
+ var tmp_0;
4888
+ if (tmp0_safe_receiver == null) {
4889
+ tmp_0 = null;
4890
+ } else {
4891
+ var tmp_1;
4892
+ if (!isBlank(tmp0_safe_receiver)) {
4893
+ tmp_1 = tmp0_safe_receiver;
4894
+ } else {
4895
+ tmp_1 = null;
4896
+ }
4897
+ tmp_0 = tmp_1;
4898
+ }
4899
+ var tmp1_safe_receiver = tmp_0;
4900
+ if (tmp1_safe_receiver == null)
4901
+ null;
4902
+ else {
4903
+ header(this.request_1, 'Authorization', 'Bearer ' + tmp1_safe_receiver);
4904
+ }
4905
+ return Unit_instance;
4906
+ } else if (tmp === 1) {
4907
+ throw this.exception_1;
4908
+ }
4909
+ } catch ($p) {
4910
+ var e = $p;
4911
+ throw e;
4912
+ }
4913
+ while (true);
4914
+ };
4915
+ protoOf(HomeApiBase$configureClient$lambda$slambda_11).create_2brvp3_k$ = function ($this$onRequest, request, _unused_var__etf5q3, completion) {
4916
+ var i = new HomeApiBase$configureClient$lambda$slambda_11(this.this$0__1, completion);
4917
+ i.$this$onRequest_1 = $this$onRequest;
4918
+ i.request_1 = request;
4919
+ i._unused_var__etf5q3__1 = _unused_var__etf5q3;
4920
+ return i;
4921
+ };
4922
+ function HomeApiBase$configureClient$lambda$slambda_12(this$0, resultContinuation) {
4923
+ var i = new HomeApiBase$configureClient$lambda$slambda_11(this$0, resultContinuation);
4924
+ return constructCallableReference(function ($this$onRequest, request, _unused_var__etf5q3, $completion) {
4925
+ return i.invoke_572pd7_k$($this$onRequest, request, _unused_var__etf5q3, $completion);
4926
+ }, 3);
4927
+ }
4928
+ function HomeApiBase$configureClient$lambda_12(this$0) {
4929
+ return function ($this$createClientPlugin) {
4930
+ $this$createClientPlugin.onRequest_fk8bil_k$(HomeApiBase$configureClient$lambda$slambda_12(this$0, null));
4931
+ return Unit_instance;
4932
+ };
4933
+ }
4934
+ function HomeApiBase$configureClient$lambda$slambda_13(this$0, resultContinuation) {
4935
+ this.this$0__1 = this$0;
4936
+ CoroutineImpl.call(this, resultContinuation);
4937
+ }
4938
+ protoOf(HomeApiBase$configureClient$lambda$slambda_13).invoke_nc6r0k_k$ = function ($this$on, request, $completion) {
4755
4939
  var tmp = this.create_v0j3o4_k$($this$on, request, $completion);
4756
4940
  tmp.result_1 = Unit_instance;
4757
4941
  tmp.exception_1 = null;
4758
4942
  return tmp.doResume_5yljmg_k$();
4759
4943
  };
4760
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_11).invoke_4tzzq6_k$ = function (p1, p2, $completion) {
4944
+ protoOf(HomeApiBase$configureClient$lambda$slambda_13).invoke_4tzzq6_k$ = function (p1, p2, $completion) {
4761
4945
  var tmp = p1 instanceof Sender ? p1 : THROW_CCE();
4762
4946
  return this.invoke_nc6r0k_k$(tmp, p2 instanceof HttpRequestBuilder ? p2 : THROW_CCE(), $completion);
4763
4947
  };
4764
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_11).doResume_5yljmg_k$ = function () {
4948
+ protoOf(HomeApiBase$configureClient$lambda$slambda_13).doResume_5yljmg_k$ = function () {
4765
4949
  var suspendResult = this.result_1;
4766
4950
  $sm: do
4767
4951
  try {
@@ -4829,77 +5013,34 @@ protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_11).doResume_5yljmg
4829
5013
  }
4830
5014
  while (true);
4831
5015
  };
4832
- protoOf(HomeApiBase$clientConfigurator$lambda$lambda$slambda_11).create_v0j3o4_k$ = function ($this$on, request, completion) {
4833
- var i = new HomeApiBase$clientConfigurator$lambda$lambda$slambda_11(this.this$0__1, completion);
5016
+ protoOf(HomeApiBase$configureClient$lambda$slambda_13).create_v0j3o4_k$ = function ($this$on, request, completion) {
5017
+ var i = new HomeApiBase$configureClient$lambda$slambda_13(this.this$0__1, completion);
4834
5018
  i.$this$on_1 = $this$on;
4835
5019
  i.request_1 = request;
4836
5020
  return i;
4837
5021
  };
4838
- function HomeApiBase$clientConfigurator$lambda$lambda$slambda_12(this$0, resultContinuation) {
4839
- var i = new HomeApiBase$clientConfigurator$lambda$lambda$slambda_11(this$0, resultContinuation);
5022
+ function HomeApiBase$configureClient$lambda$slambda_14(this$0, resultContinuation) {
5023
+ var i = new HomeApiBase$configureClient$lambda$slambda_13(this$0, resultContinuation);
4840
5024
  return constructCallableReference(function ($this$on, request, $completion) {
4841
5025
  return i.invoke_nc6r0k_k$($this$on, request, $completion);
4842
5026
  }, 2);
4843
5027
  }
4844
- function HomeApiBase$clientConfigurator$lambda$lambda_12(this$0) {
5028
+ function HomeApiBase$configureClient$lambda_13(this$0) {
4845
5029
  return function ($this$createClientPlugin) {
4846
5030
  var tmp = Send_instance;
4847
- $this$createClientPlugin.on_z1oiz_k$(tmp, HomeApiBase$clientConfigurator$lambda$lambda$slambda_12(this$0, null));
5031
+ $this$createClientPlugin.on_z1oiz_k$(tmp, HomeApiBase$configureClient$lambda$slambda_14(this$0, null));
4848
5032
  return Unit_instance;
4849
5033
  };
4850
5034
  }
4851
- function HomeApiBase$clientConfigurator$lambda$lambda_13(this$0, $platformName) {
5035
+ function HomeApiBase$configureClient$lambda_14(this$0, $platformName) {
4852
5036
  return function ($this$defaultRequest) {
4853
5037
  if (contentType($this$defaultRequest) == null) {
4854
5038
  contentType_0($this$defaultRequest, Application_getInstance().Json_1);
4855
5039
  }
4856
5040
  accept($this$defaultRequest, Application_getInstance().Json_1);
4857
5041
  header($this$defaultRequest, 'Accept-Language', buildAcceptLanguage(this$0.userLanguage));
4858
- header($this$defaultRequest, 'User-Agent', 'SoliboSDK/1.55.0 (' + $platformName + ')');
4859
- header($this$defaultRequest, 'X-Solibo-SDK-Version', '1.55.0');
4860
- return Unit_instance;
4861
- };
4862
- }
4863
- function HomeApiBase$clientConfigurator$lambda(this$0) {
4864
- return function (_this__u8e3s4) {
4865
- var tmp = get_ContentNegotiation();
4866
- _this__u8e3s4.install_6m4asv_k$(tmp, HomeApiBase$clientConfigurator$lambda$lambda);
4867
- var tmp_0 = Companion_getInstance_2();
4868
- _this__u8e3s4.install_6m4asv_k$(tmp_0, HomeApiBase$clientConfigurator$lambda$lambda_0(this$0));
4869
- var tmp_1 = get_ContentEncoding();
4870
- _this__u8e3s4.install_6m4asv_k$(tmp_1, HomeApiBase$clientConfigurator$lambda$lambda_1);
4871
- _this__u8e3s4.install$default_lc5jjj_k$(createClientPlugin('SoliboTracing', HomeApiBase$clientConfigurator$lambda$lambda_2));
4872
- var tmp_2 = get_HttpRequestRetry();
4873
- _this__u8e3s4.install_6m4asv_k$(tmp_2, HomeApiBase$clientConfigurator$lambda$lambda_3(this$0));
4874
- _this__u8e3s4.install$default_lc5jjj_k$(createClientPlugin('EndFailedAttempts', HomeApiBase$clientConfigurator$lambda$lambda_4));
4875
- var tmp_3 = get_HttpTimeout();
4876
- _this__u8e3s4.install_6m4asv_k$(tmp_3, HomeApiBase$clientConfigurator$lambda$lambda_5);
4877
- _this__u8e3s4.install$default_lc5jjj_k$(createClientPlugin('RemoveEmptyFields', HomeApiBase$clientConfigurator$lambda$lambda_6));
4878
- var tmp_4 = get_Logging();
4879
- _this__u8e3s4.install_6m4asv_k$(tmp_4, HomeApiBase$clientConfigurator$lambda$lambda_7);
4880
- HttpResponseValidator(_this__u8e3s4, HomeApiBase$clientConfigurator$lambda$lambda_8(this$0));
4881
- _this__u8e3s4.install$default_lc5jjj_k$(createClientPlugin('M2MAuth', HomeApiBase$clientConfigurator$lambda$lambda_9(this$0)));
4882
- _this__u8e3s4.install$default_lc5jjj_k$(createClientPlugin('RateLimitRetry', HomeApiBase$clientConfigurator$lambda$lambda_10(this$0)));
4883
- var tmp_5;
4884
- switch (this$0.authMode.ordinal_1) {
4885
- case 0:
4886
- var tmp_6 = get_Auth();
4887
- _this__u8e3s4.install_6m4asv_k$(tmp_6, HomeApiBase$clientConfigurator$lambda$lambda_11(this$0));
4888
- tmp_5 = Unit_instance;
4889
- break;
4890
- case 2:
4891
- tmp_5 = Unit_instance;
4892
- break;
4893
- default:
4894
- _this__u8e3s4.install$default_lc5jjj_k$(Companion_getInstance_1());
4895
- _this__u8e3s4.install$default_lc5jjj_k$(createClientPlugin('CookieSessionRefresh', HomeApiBase$clientConfigurator$lambda$lambda_12(this$0)));
4896
- tmp_5 = Unit_instance;
4897
- break;
4898
- }
4899
- var platformName = (new Platform()).name_1;
4900
- defaultRequest(_this__u8e3s4, HomeApiBase$clientConfigurator$lambda$lambda_13(this$0, platformName));
4901
- applyPlatformSpecificHttpClientConfig(_this__u8e3s4);
4902
- this$0.configurator_1(_this__u8e3s4);
5042
+ header($this$defaultRequest, 'User-Agent', 'SoliboSDK/1.56.0 (' + $platformName + ')');
5043
+ header($this$defaultRequest, 'X-Solibo-SDK-Version', '1.56.0');
4903
5044
  return Unit_instance;
4904
5045
  };
4905
5046
  }
@@ -4917,6 +5058,230 @@ function HomeApiBase$recordFailureOnSpan$lambda($it) {
4917
5058
  return Unit_instance;
4918
5059
  };
4919
5060
  }
5061
+ function HomeApiBase$renewCookieSessionAfter$slambda(this$0, $generation, resultContinuation) {
5062
+ this.this$0__1 = this$0;
5063
+ this.$generation_1 = $generation;
5064
+ CoroutineImpl.call(this, resultContinuation);
5065
+ }
5066
+ protoOf(HomeApiBase$renewCookieSessionAfter$slambda).invoke_llb9nu_k$ = function ($completion) {
5067
+ var tmp = this.create_d196fn_k$($completion);
5068
+ tmp.result_1 = Unit_instance;
5069
+ tmp.exception_1 = null;
5070
+ return tmp.doResume_5yljmg_k$();
5071
+ };
5072
+ protoOf(HomeApiBase$renewCookieSessionAfter$slambda).invoke_ib42db_k$ = function ($completion) {
5073
+ return this.invoke_llb9nu_k$($completion);
5074
+ };
5075
+ protoOf(HomeApiBase$renewCookieSessionAfter$slambda).doResume_5yljmg_k$ = function () {
5076
+ var suspendResult = this.result_1;
5077
+ $sm: do
5078
+ try {
5079
+ var tmp = this.state_1;
5080
+ switch (tmp) {
5081
+ case 0:
5082
+ this.exceptionState_1 = 3;
5083
+ if (this.this$0__1.cookieSessionGeneration_1 === this.$generation_1) {
5084
+ this.state_1 = 1;
5085
+ suspendResult = renewCookieSession(this.this$0__1, this);
5086
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
5087
+ return suspendResult;
5088
+ }
5089
+ continue $sm;
5090
+ } else {
5091
+ this.state_1 = 2;
5092
+ continue $sm;
5093
+ }
5094
+
5095
+ case 1:
5096
+ this.state_1 = 2;
5097
+ continue $sm;
5098
+ case 2:
5099
+ return null;
5100
+ case 3:
5101
+ throw this.exception_1;
5102
+ }
5103
+ } catch ($p) {
5104
+ var e = $p;
5105
+ if (this.exceptionState_1 === 3) {
5106
+ throw e;
5107
+ } else {
5108
+ this.state_1 = this.exceptionState_1;
5109
+ this.exception_1 = e;
5110
+ }
5111
+ }
5112
+ while (true);
5113
+ };
5114
+ protoOf(HomeApiBase$renewCookieSessionAfter$slambda).create_d196fn_k$ = function (completion) {
5115
+ return new HomeApiBase$renewCookieSessionAfter$slambda(this.this$0__1, this.$generation_1, completion);
5116
+ };
5117
+ function HomeApiBase$renewCookieSessionAfter$slambda_0(this$0, $generation, resultContinuation) {
5118
+ var i = new HomeApiBase$renewCookieSessionAfter$slambda(this$0, $generation, resultContinuation);
5119
+ return constructCallableReference(function ($completion) {
5120
+ return i.invoke_llb9nu_k$($completion);
5121
+ }, 0);
5122
+ }
5123
+ function HomeApiBase$refreshSession$slambda(this$0, resultContinuation) {
5124
+ this.this$0__1 = this$0;
5125
+ CoroutineImpl.call(this, resultContinuation);
5126
+ }
5127
+ protoOf(HomeApiBase$refreshSession$slambda).invoke_llb9nu_k$ = function ($completion) {
5128
+ var tmp = this.create_d196fn_k$($completion);
5129
+ tmp.result_1 = Unit_instance;
5130
+ tmp.exception_1 = null;
5131
+ return tmp.doResume_5yljmg_k$();
5132
+ };
5133
+ protoOf(HomeApiBase$refreshSession$slambda).invoke_ib42db_k$ = function ($completion) {
5134
+ return this.invoke_llb9nu_k$($completion);
5135
+ };
5136
+ protoOf(HomeApiBase$refreshSession$slambda).doResume_5yljmg_k$ = function () {
5137
+ var suspendResult = this.result_1;
5138
+ $sm: do
5139
+ try {
5140
+ var tmp = this.state_1;
5141
+ switch (tmp) {
5142
+ case 0:
5143
+ this.exceptionState_1 = 2;
5144
+ this.state_1 = 1;
5145
+ suspendResult = renewCookieSession(this.this$0__1, this);
5146
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
5147
+ return suspendResult;
5148
+ }
5149
+
5150
+ continue $sm;
5151
+ case 1:
5152
+ return null;
5153
+ case 2:
5154
+ throw this.exception_1;
5155
+ }
5156
+ } catch ($p) {
5157
+ var e = $p;
5158
+ if (this.exceptionState_1 === 2) {
5159
+ throw e;
5160
+ } else {
5161
+ this.state_1 = this.exceptionState_1;
5162
+ this.exception_1 = e;
5163
+ }
5164
+ }
5165
+ while (true);
5166
+ };
5167
+ protoOf(HomeApiBase$refreshSession$slambda).create_d196fn_k$ = function (completion) {
5168
+ return new HomeApiBase$refreshSession$slambda(this.this$0__1, completion);
5169
+ };
5170
+ function HomeApiBase$refreshSession$slambda_0(this$0, resultContinuation) {
5171
+ var i = new HomeApiBase$refreshSession$slambda(this$0, resultContinuation);
5172
+ return constructCallableReference(function ($completion) {
5173
+ return i.invoke_llb9nu_k$($completion);
5174
+ }, 0);
5175
+ }
5176
+ function HomeApiBase$refreshSession$slambda_1(this$0, $oldTokens, resultContinuation) {
5177
+ this.this$0__1 = this$0;
5178
+ this.$oldTokens_1 = $oldTokens;
5179
+ CoroutineImpl.call(this, resultContinuation);
5180
+ }
5181
+ protoOf(HomeApiBase$refreshSession$slambda_1).invoke_llb9nu_k$ = function ($completion) {
5182
+ var tmp = this.create_d196fn_k$($completion);
5183
+ tmp.result_1 = Unit_instance;
5184
+ tmp.exception_1 = null;
5185
+ return tmp.doResume_5yljmg_k$();
5186
+ };
5187
+ protoOf(HomeApiBase$refreshSession$slambda_1).invoke_ib42db_k$ = function ($completion) {
5188
+ return this.invoke_llb9nu_k$($completion);
5189
+ };
5190
+ protoOf(HomeApiBase$refreshSession$slambda_1).doResume_5yljmg_k$ = function () {
5191
+ var suspendResult = this.result_1;
5192
+ $sm: do
5193
+ try {
5194
+ var tmp = this.state_1;
5195
+ switch (tmp) {
5196
+ case 0:
5197
+ this.exceptionState_1 = 2;
5198
+ this.state_1 = 1;
5199
+ suspendResult = renewTokenSession(this.this$0__1, this.$oldTokens_1, this);
5200
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
5201
+ return suspendResult;
5202
+ }
5203
+
5204
+ continue $sm;
5205
+ case 1:
5206
+ return suspendResult;
5207
+ case 2:
5208
+ throw this.exception_1;
5209
+ }
5210
+ } catch ($p) {
5211
+ var e = $p;
5212
+ if (this.exceptionState_1 === 2) {
5213
+ throw e;
5214
+ } else {
5215
+ this.state_1 = this.exceptionState_1;
5216
+ this.exception_1 = e;
5217
+ }
5218
+ }
5219
+ while (true);
5220
+ };
5221
+ protoOf(HomeApiBase$refreshSession$slambda_1).create_d196fn_k$ = function (completion) {
5222
+ return new HomeApiBase$refreshSession$slambda_1(this.this$0__1, this.$oldTokens_1, completion);
5223
+ };
5224
+ function HomeApiBase$refreshSession$slambda_2(this$0, $oldTokens, resultContinuation) {
5225
+ var i = new HomeApiBase$refreshSession$slambda_1(this$0, $oldTokens, resultContinuation);
5226
+ return constructCallableReference(function ($completion) {
5227
+ return i.invoke_llb9nu_k$($completion);
5228
+ }, 0);
5229
+ }
5230
+ function HomeApiBase$sharedRefresh$slambda($renew, resultContinuation) {
5231
+ this.$renew_1 = $renew;
5232
+ CoroutineImpl.call(this, resultContinuation);
5233
+ }
5234
+ protoOf(HomeApiBase$sharedRefresh$slambda).invoke_o46nj0_k$ = function ($this$async, $completion) {
5235
+ var tmp = this.create_rcuf4x_k$($this$async, $completion);
5236
+ tmp.result_1 = Unit_instance;
5237
+ tmp.exception_1 = null;
5238
+ return tmp.doResume_5yljmg_k$();
5239
+ };
5240
+ protoOf(HomeApiBase$sharedRefresh$slambda).invoke_qns8j1_k$ = function (p1, $completion) {
5241
+ return this.invoke_o46nj0_k$((!(p1 == null) ? isInterface(p1, CoroutineScope) : false) ? p1 : THROW_CCE(), $completion);
5242
+ };
5243
+ protoOf(HomeApiBase$sharedRefresh$slambda).doResume_5yljmg_k$ = function () {
5244
+ var suspendResult = this.result_1;
5245
+ $sm: do
5246
+ try {
5247
+ var tmp = this.state_1;
5248
+ switch (tmp) {
5249
+ case 0:
5250
+ this.exceptionState_1 = 2;
5251
+ this.state_1 = 1;
5252
+ suspendResult = this.$renew_1(this);
5253
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
5254
+ return suspendResult;
5255
+ }
5256
+
5257
+ continue $sm;
5258
+ case 1:
5259
+ return suspendResult;
5260
+ case 2:
5261
+ throw this.exception_1;
5262
+ }
5263
+ } catch ($p) {
5264
+ var e = $p;
5265
+ if (this.exceptionState_1 === 2) {
5266
+ throw e;
5267
+ } else {
5268
+ this.state_1 = this.exceptionState_1;
5269
+ this.exception_1 = e;
5270
+ }
5271
+ }
5272
+ while (true);
5273
+ };
5274
+ protoOf(HomeApiBase$sharedRefresh$slambda).create_rcuf4x_k$ = function ($this$async, completion) {
5275
+ var i = new HomeApiBase$sharedRefresh$slambda(this.$renew_1, completion);
5276
+ i.$this$async_1 = $this$async;
5277
+ return i;
5278
+ };
5279
+ function HomeApiBase$sharedRefresh$slambda_0($renew, resultContinuation) {
5280
+ var i = new HomeApiBase$sharedRefresh$slambda($renew, resultContinuation);
5281
+ return constructCallableReference(function ($this$async, $completion) {
5282
+ return i.invoke_o46nj0_k$($this$async, $completion);
5283
+ }, 1);
5284
+ }
4920
5285
  function HomeApiBase$auth$delegate$lambda(this$0) {
4921
5286
  return function () {
4922
5287
  var tmp0_elvis_lhs = this$0.baseUrl_1;
@@ -4934,6 +5299,23 @@ function HomeApiBase$_get_auth_$ref_94oz3e() {
4934
5299
  return p0.auth;
4935
5300
  }, 1, 0, 108);
4936
5301
  }
5302
+ function HomeApiBase$refreshAuth$delegate$lambda(this$0) {
5303
+ return function () {
5304
+ var tmp0_elvis_lhs = this$0.baseUrl_1;
5305
+ var tmp;
5306
+ if (tmp0_elvis_lhs == null) {
5307
+ throw IllegalStateException_init_$Create$('No Baseurl set!');
5308
+ } else {
5309
+ tmp = tmp0_elvis_lhs;
5310
+ }
5311
+ return create_0(tmp, this$0.httpClientEngine_1, this$0.refreshClientConfigurator_1);
5312
+ };
5313
+ }
5314
+ function HomeApiBase$_get_refreshAuth_$ref_x2cel7() {
5315
+ return constructCallableReference(function (p0) {
5316
+ return _get_refreshAuth__q4vj66(p0);
5317
+ }, 1, 0, 109);
5318
+ }
4937
5319
  function HomeApiBase$sessionAuth$delegate$lambda(this$0) {
4938
5320
  return function () {
4939
5321
  var tmp0_elvis_lhs = this$0.baseUrl_1;
@@ -4949,7 +5331,7 @@ function HomeApiBase$sessionAuth$delegate$lambda(this$0) {
4949
5331
  function HomeApiBase$_get_sessionAuth_$ref_nw0oga() {
4950
5332
  return constructCallableReference(function (p0) {
4951
5333
  return _get_sessionAuth__fjt4oj(p0);
4952
- }, 1, 0, 109);
5334
+ }, 1, 0, 110);
4953
5335
  }
4954
5336
  function HomeApiBase$language$delegate$lambda(this$0) {
4955
5337
  return function () {
@@ -4966,7 +5348,7 @@ function HomeApiBase$language$delegate$lambda(this$0) {
4966
5348
  function HomeApiBase$_get_language_$ref_d0oebq() {
4967
5349
  return constructCallableReference(function (p0) {
4968
5350
  return p0.language;
4969
- }, 1, 0, 110);
5351
+ }, 1, 0, 111);
4970
5352
  }
4971
5353
  function HomeApiBase$devices$delegate$lambda(this$0) {
4972
5354
  return function () {
@@ -4983,7 +5365,7 @@ function HomeApiBase$devices$delegate$lambda(this$0) {
4983
5365
  function HomeApiBase$_get_devices_$ref_5mpuln() {
4984
5366
  return constructCallableReference(function (p0) {
4985
5367
  return p0.devices;
4986
- }, 1, 0, 111);
5368
+ }, 1, 0, 112);
4987
5369
  }
4988
5370
  function HomeApiBase$eventBusConnection$slambda(this$0, resultContinuation) {
4989
5371
  this.this$0__1 = this$0;
@@ -5061,7 +5443,7 @@ function HomeApiBase$appStores$delegate$lambda(this$0) {
5061
5443
  function HomeApiBase$_get_appStores_$ref_k22az() {
5062
5444
  return constructCallableReference(function (p0) {
5063
5445
  return p0.appStores;
5064
- }, 1, 0, 112);
5446
+ }, 1, 0, 113);
5065
5447
  }
5066
5448
  function HomeApiBase$unsubscribe$delegate$lambda(this$0) {
5067
5449
  return function () {
@@ -5078,7 +5460,7 @@ function HomeApiBase$unsubscribe$delegate$lambda(this$0) {
5078
5460
  function HomeApiBase$_get_unsubscribe_$ref_yqv4cp() {
5079
5461
  return constructCallableReference(function (p0) {
5080
5462
  return p0.unsubscribe;
5081
- }, 1, 0, 113);
5463
+ }, 1, 0, 114);
5082
5464
  }
5083
5465
  function HomeApiBase$apiPathAuth$delegate$lambda(this$0) {
5084
5466
  return function () {
@@ -5102,7 +5484,7 @@ function HomeApiBase$apiPathAuth$delegate$lambda(this$0) {
5102
5484
  function HomeApiBase$_get_apiPathAuth_$ref_auoli7() {
5103
5485
  return constructCallableReference(function (p0) {
5104
5486
  return _get_apiPathAuth__nqn62(p0);
5105
- }, 1, 0, 114);
5487
+ }, 1, 0, 115);
5106
5488
  }
5107
5489
  function OriginRevoke_REVOKED_getInstance() {
5108
5490
  static_init_0();
@@ -5290,51 +5672,22 @@ protoOf($renewCookieSessionAfterCOROUTINE$).doResume_5yljmg_k$ = function () {
5290
5672
  var tmp = this.state_1;
5291
5673
  switch (tmp) {
5292
5674
  case 0:
5293
- this.exceptionState_1 = 11;
5294
- this.this1__1 = this._this__u8e3s4__1.refreshLock_1;
5295
- this.owner0__1 = null;
5675
+ this.exceptionState_1 = 3;
5676
+ this.exceptionState_1 = 2;
5296
5677
  this.state_1 = 1;
5297
- suspendResult = this.this1__1.lock_ugrcvf_k$(this.owner0__1, this);
5678
+ suspendResult = sharedRefresh(this._this__u8e3s4__1, HomeApiBase$renewCookieSessionAfter$slambda_0(this._this__u8e3s4__1, this.generation_1, null), this);
5298
5679
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
5299
5680
  return suspendResult;
5300
5681
  }
5301
5682
 
5302
5683
  continue $sm;
5303
5684
  case 1:
5304
- this.tmp$ret$22__1 = Unit_instance;
5305
- this.state_1 = 2;
5685
+ this.TRY_RESULT0__1 = true;
5686
+ this.exceptionState_1 = 3;
5687
+ this.state_1 = 4;
5306
5688
  continue $sm;
5307
5689
  case 2:
5308
- this.exceptionState_1 = 10;
5309
- this.tmp$ret$03__1 = Unit_instance;
5310
- this.state_1 = 3;
5311
- continue $sm;
5312
- case 3:
5313
- if (!(this._this__u8e3s4__1.cookieSessionGeneration_1 === this.generation_1)) {
5314
- this.tmp$ret$03__1 = true;
5315
- this.state_1 = 8;
5316
- continue $sm;
5317
- } else {
5318
- this.state_1 = 4;
5319
- continue $sm;
5320
- }
5321
-
5322
- case 4:
5323
- this.exceptionState_1 = 6;
5324
- this.state_1 = 5;
5325
- suspendResult = renewCookieSession(this._this__u8e3s4__1, this);
5326
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
5327
- return suspendResult;
5328
- }
5329
-
5330
- continue $sm;
5331
- case 5:
5332
- this.TRY_RESULT4__1 = true;
5333
- this.exceptionState_1 = 10;
5334
- this.state_1 = 7;
5335
- continue $sm;
5336
- case 6:
5337
- this.exceptionState_1 = 10;
5690
+ this.exceptionState_1 = 3;
5338
5691
  var tmp_0 = this.exception_1;
5339
5692
  if (tmp_0 instanceof CancellationException) {
5340
5693
  var cancelled = this.exception_1;
@@ -5345,45 +5698,23 @@ protoOf($renewCookieSessionAfterCOROUTINE$).doResume_5yljmg_k$ = function () {
5345
5698
  if (tmp_2 instanceof Exception) {
5346
5699
  var failure = this.exception_1;
5347
5700
  var tmp_3 = this;
5348
- tmp_3.TRY_RESULT4__1 = false;
5349
- this.state_1 = 7;
5701
+ tmp_3.TRY_RESULT0__1 = false;
5702
+ this.state_1 = 4;
5350
5703
  continue $sm;
5351
5704
  } else {
5352
5705
  throw this.exception_1;
5353
5706
  }
5354
5707
  }
5355
5708
 
5356
- case 7:
5357
- this.exceptionState_1 = 10;
5358
- this.tmp$ret$03__1 = this.TRY_RESULT4__1;
5359
- if (false) {
5360
- this.state_1 = 3;
5361
- continue $sm;
5362
- }
5363
-
5364
- this.state_1 = 8;
5365
- continue $sm;
5366
- case 8:
5367
- this.tmp$ret$22__1 = this.tmp$ret$03__1;
5368
- this.exceptionState_1 = 11;
5369
- this.state_1 = 9;
5370
- continue $sm;
5371
- case 9:
5372
- var tmp_4 = this.tmp$ret$22__1;
5373
- this.exceptionState_1 = 11;
5374
- this.this1__1.unlock_ulcrcl_k$(this.owner0__1);
5375
- return tmp_4;
5376
- case 10:
5377
- this.exceptionState_1 = 11;
5378
- var t = this.exception_1;
5379
- this.this1__1.unlock_ulcrcl_k$(this.owner0__1);
5380
- throw t;
5381
- case 11:
5709
+ case 3:
5382
5710
  throw this.exception_1;
5711
+ case 4:
5712
+ this.exceptionState_1 = 3;
5713
+ return this.TRY_RESULT0__1;
5383
5714
  }
5384
5715
  } catch ($p) {
5385
5716
  var e = $p;
5386
- if (this.exceptionState_1 === 11) {
5717
+ if (this.exceptionState_1 === 3) {
5387
5718
  throw e;
5388
5719
  } else {
5389
5720
  this.state_1 = this.exceptionState_1;
@@ -5528,173 +5859,418 @@ protoOf($refreshSessionCOROUTINE$).doResume_5yljmg_k$ = function () {
5528
5859
  var tmp = this.state_1;
5529
5860
  switch (tmp) {
5530
5861
  case 0:
5531
- this.exceptionState_1 = 26;
5532
- this.this1__1 = this._this__u8e3s4__1.refreshLock_1;
5533
- this.owner0__1 = null;
5862
+ this.exceptionState_1 = 9;
5863
+ var tmp0 = this._this__u8e3s4__1.authMode.ordinal_1;
5864
+ if (tmp0 === 2) {
5865
+ this.this1__1 = this._this__u8e3s4__1.refreshLock_1;
5866
+ this.owner0__1 = null;
5867
+ this.state_1 = 3;
5868
+ suspendResult = this.this1__1.lock_ugrcvf_k$(this.owner0__1, this);
5869
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
5870
+ return suspendResult;
5871
+ }
5872
+ continue $sm;
5873
+ } else {
5874
+ if (tmp0 === 1) {
5875
+ this.state_1 = 2;
5876
+ suspendResult = sharedRefresh(this._this__u8e3s4__1, HomeApiBase$refreshSession$slambda_0(this._this__u8e3s4__1, null), this);
5877
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
5878
+ return suspendResult;
5879
+ }
5880
+ continue $sm;
5881
+ } else {
5882
+ if (tmp0 === 0) {
5883
+ this.state_1 = 1;
5884
+ suspendResult = sharedRefresh(this._this__u8e3s4__1, HomeApiBase$refreshSession$slambda_2(this._this__u8e3s4__1, this.oldTokens_1, null), this);
5885
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
5886
+ return suspendResult;
5887
+ }
5888
+ continue $sm;
5889
+ } else {
5890
+ var tmp_0 = this;
5891
+ noWhenBranchMatchedException();
5892
+ }
5893
+ }
5894
+ }
5895
+
5896
+ break;
5897
+ case 1:
5898
+ this.WHEN_RESULT2__1 = suspendResult;
5899
+ this.state_1 = 7;
5900
+ continue $sm;
5901
+ case 2:
5902
+ this.WHEN_RESULT2__1 = suspendResult;
5903
+ this.state_1 = 7;
5904
+ continue $sm;
5905
+ case 3:
5906
+ this.tmp$ret$03__1 = Unit_instance;
5907
+ this.state_1 = 4;
5908
+ continue $sm;
5909
+ case 4:
5910
+ this.exceptionState_1 = 8;
5911
+ this.state_1 = 5;
5912
+ suspendResult = machineTokens(this._this__u8e3s4__1, this);
5913
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
5914
+ return suspendResult;
5915
+ }
5916
+
5917
+ continue $sm;
5918
+ case 5:
5919
+ this.tmp$ret$03__1 = suspendResult;
5920
+ this.exceptionState_1 = 9;
5921
+ this.state_1 = 6;
5922
+ continue $sm;
5923
+ case 6:
5924
+ var tmp_1 = this.tmp$ret$03__1;
5925
+ this.exceptionState_1 = 9;
5926
+ this.this1__1.unlock_ulcrcl_k$(this.owner0__1);
5927
+ this.WHEN_RESULT2__1 = tmp_1;
5928
+ this.state_1 = 7;
5929
+ continue $sm;
5930
+ case 7:
5931
+ return this.WHEN_RESULT2__1;
5932
+ case 8:
5933
+ this.exceptionState_1 = 9;
5934
+ var t = this.exception_1;
5935
+ this.this1__1.unlock_ulcrcl_k$(this.owner0__1);
5936
+ throw t;
5937
+ case 9:
5938
+ throw this.exception_1;
5939
+ }
5940
+ } catch ($p) {
5941
+ var e = $p;
5942
+ if (this.exceptionState_1 === 9) {
5943
+ throw e;
5944
+ } else {
5945
+ this.state_1 = this.exceptionState_1;
5946
+ this.exception_1 = e;
5947
+ }
5948
+ }
5949
+ while (true);
5950
+ };
5951
+ function $sharedRefreshCOROUTINE$(_this__u8e3s4, renew, resultContinuation) {
5952
+ CoroutineImpl.call(this, resultContinuation);
5953
+ this._this__u8e3s4__1 = _this__u8e3s4;
5954
+ this.renew_1 = renew;
5955
+ }
5956
+ protoOf($sharedRefreshCOROUTINE$).doResume_5yljmg_k$ = function () {
5957
+ var suspendResult = this.result_1;
5958
+ $sm: do
5959
+ try {
5960
+ var tmp = this.state_1;
5961
+ switch (tmp) {
5962
+ case 0:
5963
+ this.exceptionState_1 = 5;
5964
+ if (!(this.get_context_h02k06_k$().get_y2st91_k$(Key_instance) == null))
5965
+ return null;
5966
+ this.this2__1 = this._this__u8e3s4__1.refreshGate_1;
5967
+ this.owner1__1 = null;
5534
5968
  this.state_1 = 1;
5535
- suspendResult = this.this1__1.lock_ugrcvf_k$(this.owner0__1, this);
5969
+ suspendResult = this.this2__1.lock_ugrcvf_k$(this.owner1__1, this);
5536
5970
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
5537
5971
  return suspendResult;
5538
5972
  }
5539
5973
 
5540
5974
  continue $sm;
5541
5975
  case 1:
5542
- this.tmp$ret$22__1 = Unit_instance;
5976
+ var tmp$ret$0 = Unit_instance;
5977
+ l$ret$1: do {
5978
+ var tmp_0;
5979
+ try {
5980
+ var tmp0_safe_receiver = this._this__u8e3s4__1.refreshInFlight_1;
5981
+ var tmp_1;
5982
+ if (tmp0_safe_receiver == null) {
5983
+ tmp_1 = null;
5984
+ } else {
5985
+ var tmp_2;
5986
+ if (tmp0_safe_receiver.get_isActive_quafmh_k$()) {
5987
+ tmp_2 = tmp0_safe_receiver;
5988
+ } else {
5989
+ tmp_2 = null;
5990
+ }
5991
+ tmp_1 = tmp_2;
5992
+ }
5993
+ var tmp1_elvis_lhs = tmp_1;
5994
+ var tmp_3;
5995
+ if (tmp1_elvis_lhs == null) {
5996
+ var tmp_4 = RefreshInProgress_getInstance();
5997
+ var this_0 = async(this._this__u8e3s4__1.sessionScope_1, tmp_4, VOID, HomeApiBase$sharedRefresh$slambda_0(this.renew_1, null));
5998
+ this._this__u8e3s4__1.refreshInFlight_1 = this_0;
5999
+ tmp_3 = this_0;
6000
+ } else {
6001
+ tmp_3 = tmp1_elvis_lhs;
6002
+ }
6003
+ tmp$ret$0 = tmp_3;
6004
+ break l$ret$1;
6005
+ } catch ($p) {
6006
+ var tmp_5;
6007
+ var t = $p;
6008
+ this.this2__1.unlock_ulcrcl_k$(this.owner1__1);
6009
+ throw t;
6010
+ }
6011
+ }
6012
+ while (false);
6013
+ var tmp_6 = tmp$ret$0;
6014
+ this.this2__1.unlock_ulcrcl_k$(this.owner1__1);
6015
+ var refresh = tmp_6;
6016
+ this.exceptionState_1 = 3;
5543
6017
  this.state_1 = 2;
6018
+ suspendResult = refresh.await_4rdzbx_k$(this);
6019
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
6020
+ return suspendResult;
6021
+ }
6022
+
5544
6023
  continue $sm;
5545
6024
  case 2:
5546
- this.exceptionState_1 = 25;
5547
- this.tmp$ret$03__1 = Unit_instance;
5548
- this.state_1 = 3;
6025
+ this.TRY_RESULT0__1 = suspendResult;
6026
+ this.exceptionState_1 = 5;
6027
+ this.state_1 = 4;
5549
6028
  continue $sm;
5550
6029
  case 3:
5551
- if (this._this__u8e3s4__1.authMode.equals(AuthMode_M2M_getInstance())) {
5552
- var now = System_instance.now_2cba_k$().toEpochMilliseconds_82cfls_k$();
5553
- var tokenAge = subtract(now, this._this__u8e3s4__1.tokenTimestamp);
5554
- if (!(this._this__u8e3s4__1.bearerToken_1 == null) && tokenAge < 900000n) {
5555
- this.tmp$ret$03__1 = new BearerTokens(ensureNotNull(this._this__u8e3s4__1.bearerToken_1), '');
5556
- this.state_1 = 23;
5557
- continue $sm;
5558
- } else {
5559
- this.state_1 = 20;
5560
- continue $sm;
5561
- }
6030
+ this.exceptionState_1 = 5;
6031
+ var tmp_7 = this.exception_1;
6032
+ if (tmp_7 instanceof CancellationException) {
6033
+ var cancelled = this.exception_1;
6034
+ var tmp_8 = this;
6035
+ ensureActive(this.get_context_h02k06_k$());
6036
+ throw new UnknownRefreshErrorException('The refresh was interrupted');
5562
6037
  } else {
5563
- this.state_1 = 4;
5564
- continue $sm;
6038
+ throw this.exception_1;
5565
6039
  }
5566
6040
 
5567
6041
  case 4:
5568
- if (this._this__u8e3s4__1.authMode.equals(AuthMode_COOKIE_getInstance())) {
5569
- this.state_1 = 19;
5570
- suspendResult = renewCookieSession(this._this__u8e3s4__1, this);
5571
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
5572
- return suspendResult;
5573
- }
5574
- continue $sm;
5575
- } else {
5576
- this.state_1 = 5;
5577
- continue $sm;
6042
+ this.exceptionState_1 = 5;
6043
+ return this.TRY_RESULT0__1;
6044
+ case 5:
6045
+ throw this.exception_1;
6046
+ }
6047
+ } catch ($p_0) {
6048
+ var e = $p_0;
6049
+ if (this.exceptionState_1 === 5) {
6050
+ throw e;
6051
+ } else {
6052
+ this.state_1 = this.exceptionState_1;
6053
+ this.exception_1 = e;
6054
+ }
6055
+ }
6056
+ while (true);
6057
+ };
6058
+ function $machineTokensCOROUTINE$(_this__u8e3s4, resultContinuation) {
6059
+ CoroutineImpl.call(this, resultContinuation);
6060
+ this._this__u8e3s4__1 = _this__u8e3s4;
6061
+ }
6062
+ protoOf($machineTokensCOROUTINE$).doResume_5yljmg_k$ = function () {
6063
+ var suspendResult = this.result_1;
6064
+ $sm: do
6065
+ try {
6066
+ var tmp = this.state_1;
6067
+ switch (tmp) {
6068
+ case 0:
6069
+ this.exceptionState_1 = 3;
6070
+ var now = System_instance.now_2cba_k$().toEpochMilliseconds_82cfls_k$();
6071
+ var tokenAge = subtract(now, this._this__u8e3s4__1.tokenTimestamp);
6072
+ if (!(this._this__u8e3s4__1.bearerToken_1 == null) && tokenAge < 900000n) {
6073
+ return new BearerTokens(ensureNotNull(this._this__u8e3s4__1.bearerToken_1), '');
5578
6074
  }
5579
6075
 
5580
- case 5:
5581
- var tmp_0 = this;
5582
- var tmp4_elvis_lhs = this.oldTokens_1;
6076
+ this.state_1 = 1;
6077
+ var tmp_0 = _get_authM2M__c6rkbz(this._this__u8e3s4__1);
6078
+ var tmp0_elvis_lhs = this._this__u8e3s4__1.clientId;
5583
6079
  var tmp_1;
5584
- if (tmp4_elvis_lhs == null) {
5585
- var tmp5_elvis_lhs = this._this__u8e3s4__1.bearerToken_1;
5586
- tmp_1 = new BearerTokens(tmp5_elvis_lhs == null ? '' : tmp5_elvis_lhs, this._this__u8e3s4__1.refreshToken_1);
6080
+ if (tmp0_elvis_lhs == null) {
6081
+ throw Exception_init_$Create$('M2M Client ID not set');
5587
6082
  } else {
5588
- tmp_1 = tmp4_elvis_lhs;
6083
+ tmp_1 = tmp0_elvis_lhs;
5589
6084
  }
5590
6085
 
5591
- tmp_0.tokensToUse5__1 = tmp_1;
5592
- var persisted = this._this__u8e3s4__1.settings_1.getStringOrNull_w9a5ex_k$('refreshToken');
5593
- var current = this._this__u8e3s4__1.refreshToken_1;
5594
- var old = this.tokensToUse5__1.refreshToken_1;
5595
- var tmp_2;
6086
+ var tmp_2 = tmp_1;
6087
+ var tmp1_elvis_lhs = this._this__u8e3s4__1.clientSecret;
5596
6088
  var tmp_3;
5597
- if (old == null || isBlank(old)) {
5598
- tmp_3 = true;
6089
+ if (tmp1_elvis_lhs == null) {
6090
+ throw Exception_init_$Create$('M2M Client Secret not set');
5599
6091
  } else {
5600
- tmp_3 = !(old == persisted);
6092
+ tmp_3 = tmp1_elvis_lhs;
5601
6093
  }
5602
6094
 
5603
- if (tmp_3) {
6095
+ suspendResult = tmp_0.createM2MTokens$suspendBridge_5mlkf0_k$(new CreateM2MTokensCommand(tmp_2, tmp_3, normalizedM2MScopes(this._this__u8e3s4__1.scopes)), this);
6096
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
6097
+ return suspendResult;
6098
+ }
6099
+
6100
+ continue $sm;
6101
+ case 1:
6102
+ var response = suspendResult;
6103
+ if (!(response.status === Companion_getInstance_4().Created_1.value_1)) {
6104
+ throw Exception_init_$Create$('M2M Token acquisition failed with status ' + response.status);
6105
+ }
6106
+
6107
+ this.state_1 = 2;
6108
+ suspendResult = response.body$suspendBridge_a6dedm_k$(this);
6109
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
6110
+ return suspendResult;
6111
+ }
6112
+
6113
+ continue $sm;
6114
+ case 2:
6115
+ var authResult = suspendResult;
6116
+ var tmp2_elvis_lhs = authResult.tokens;
6117
+ var tmp_4;
6118
+ if (tmp2_elvis_lhs == null) {
6119
+ throw Exception_init_$Create$('M2M Token acquisition returned no tokens');
6120
+ } else {
6121
+ tmp_4 = tmp2_elvis_lhs;
6122
+ }
6123
+
6124
+ var tokens = tmp_4;
6125
+ this._this__u8e3s4__1.setToken(bearerEnvelope(this._this__u8e3s4__1, tokens));
6126
+ this._this__u8e3s4__1.set_userId_wekl5g_k$(tokens.identity);
6127
+ this._this__u8e3s4__1.tokenTimestamp = System_instance.now_2cba_k$().toEpochMilliseconds_82cfls_k$();
6128
+ var tmp3_safe_receiver = this._this__u8e3s4__1.bearerToken_1;
6129
+ var tmp_5;
6130
+ if (tmp3_safe_receiver == null) {
6131
+ tmp_5 = null;
6132
+ } else {
6133
+ tmp_5 = new BearerTokens(tmp3_safe_receiver, '');
6134
+ }
6135
+
6136
+ return tmp_5;
6137
+ case 3:
6138
+ throw this.exception_1;
6139
+ }
6140
+ } catch ($p) {
6141
+ var e = $p;
6142
+ if (this.exceptionState_1 === 3) {
6143
+ throw e;
6144
+ } else {
6145
+ this.state_1 = this.exceptionState_1;
6146
+ this.exception_1 = e;
6147
+ }
6148
+ }
6149
+ while (true);
6150
+ };
6151
+ function $renewTokenSessionCOROUTINE$(_this__u8e3s4, oldTokens, resultContinuation) {
6152
+ CoroutineImpl.call(this, resultContinuation);
6153
+ this._this__u8e3s4__1 = _this__u8e3s4;
6154
+ this.oldTokens_1 = oldTokens;
6155
+ }
6156
+ protoOf($renewTokenSessionCOROUTINE$).doResume_5yljmg_k$ = function () {
6157
+ var suspendResult = this.result_1;
6158
+ $sm: do
6159
+ try {
6160
+ var tmp = this.state_1;
6161
+ switch (tmp) {
6162
+ case 0:
6163
+ this.exceptionState_1 = 10;
6164
+ var tmp0_elvis_lhs = this.oldTokens_1;
6165
+ var tmp_0;
6166
+ if (tmp0_elvis_lhs == null) {
6167
+ var tmp1_elvis_lhs = this._this__u8e3s4__1.bearerToken_1;
6168
+ tmp_0 = new BearerTokens(tmp1_elvis_lhs == null ? '' : tmp1_elvis_lhs, this._this__u8e3s4__1.refreshToken_1);
6169
+ } else {
6170
+ tmp_0 = tmp0_elvis_lhs;
6171
+ }
6172
+
6173
+ var tokensToUse = tmp_0;
6174
+ var persisted = this._this__u8e3s4__1.settings_1.getStringOrNull_w9a5ex_k$('refreshToken');
6175
+ var current = this._this__u8e3s4__1.refreshToken_1;
6176
+ this.old0__1 = tokensToUse.refreshToken_1;
6177
+ var tmp_1;
6178
+ var tmp_2;
6179
+ var this_0 = this.old0__1;
6180
+ if (this_0 == null || isBlank(this_0)) {
5604
6181
  tmp_2 = true;
5605
6182
  } else {
5606
- tmp_2 = !(old == current);
6183
+ tmp_2 = !(this.old0__1 == persisted);
5607
6184
  }
5608
6185
 
5609
6186
  if (tmp_2) {
5610
- var tmp_4 = this;
5611
- var tmp0_elvis_lhs = this._this__u8e3s4__1.bearerToken_1;
5612
- var tmp_5 = tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs;
5613
- tmp_4.tmp$ret$03__1 = new BearerTokens(tmp_5, current == null ? '' : current);
5614
- this.state_1 = 23;
5615
- continue $sm;
6187
+ tmp_1 = true;
5616
6188
  } else {
5617
- this.state_1 = 6;
5618
- continue $sm;
6189
+ tmp_1 = !(this.old0__1 == current);
5619
6190
  }
5620
6191
 
5621
- case 6:
5622
- if (!(this._this__u8e3s4__1.refreshToken_1 == this.tokensToUse5__1.refreshToken_1)) {
5623
- var tmp_6 = this;
5624
- var tmp6_elvis_lhs = this._this__u8e3s4__1.bearerToken_1;
5625
- var tmp_7 = tmp6_elvis_lhs == null ? '' : tmp6_elvis_lhs;
5626
- var tmp7_elvis_lhs = this._this__u8e3s4__1.refreshToken_1;
5627
- tmp_6.tmp$ret$03__1 = new BearerTokens(tmp_7, tmp7_elvis_lhs == null ? '' : tmp7_elvis_lhs);
5628
- this.state_1 = 23;
5629
- continue $sm;
6192
+ if (tmp_1) {
6193
+ var tmp0_elvis_lhs_0 = this._this__u8e3s4__1.bearerToken_1;
6194
+ var tmp_3 = tmp0_elvis_lhs_0 == null ? '' : tmp0_elvis_lhs_0;
6195
+ return new BearerTokens(tmp_3, current == null ? '' : current);
6196
+ }
6197
+
6198
+ var tmp2_safe_receiver = this._this__u8e3s4__1.userId;
6199
+ var tmp_4;
6200
+ if (tmp2_safe_receiver == null) {
6201
+ tmp_4 = null;
5630
6202
  } else {
5631
- this.state_1 = 7;
5632
- continue $sm;
6203
+ var tmp_5;
6204
+ if (!isBlank(tmp2_safe_receiver)) {
6205
+ tmp_5 = tmp2_safe_receiver;
6206
+ } else {
6207
+ tmp_5 = null;
6208
+ }
6209
+ tmp_4 = tmp_5;
5633
6210
  }
5634
6211
 
5635
- case 7:
5636
- var this_0 = this.tokensToUse5__1.refreshToken_1;
5637
- if (this_0 == null || isBlank(this_0)) {
5638
- var tmp_8 = this;
5639
- tmp_8.WHEN_RESULT4__1 = null;
5640
- this.state_1 = 18;
5641
- continue $sm;
6212
+ var tmp3_elvis_lhs = tmp_4;
6213
+ var tmp_6;
6214
+ if (tmp3_elvis_lhs == null) {
6215
+ return null;
5642
6216
  } else {
5643
- var this_1 = this._this__u8e3s4__1.userId;
5644
- if (this_1 == null || isBlank(this_1)) {
5645
- var tmp_9 = this;
5646
- tmp_9.WHEN_RESULT4__1 = null;
5647
- this.state_1 = 18;
5648
- continue $sm;
6217
+ tmp_6 = tmp3_elvis_lhs;
6218
+ }
6219
+
6220
+ var user = tmp_6;
6221
+ var tmp4_safe_receiver = this._this__u8e3s4__1.clientId;
6222
+ var tmp_7;
6223
+ if (tmp4_safe_receiver == null) {
6224
+ tmp_7 = null;
6225
+ } else {
6226
+ var tmp_8;
6227
+ if (!isBlank(tmp4_safe_receiver)) {
6228
+ tmp_8 = tmp4_safe_receiver;
5649
6229
  } else {
5650
- var this_2 = this._this__u8e3s4__1.clientId;
5651
- if (this_2 == null || isBlank(this_2)) {
5652
- var tmp_10 = this;
5653
- tmp_10.WHEN_RESULT4__1 = null;
5654
- this.state_1 = 18;
5655
- continue $sm;
5656
- } else {
5657
- var this_3 = this._this__u8e3s4__1;
5658
- this.exceptionState_1 = 16;
5659
- this.tmp07__1 = Companion_instance;
5660
- this.$this$runCatching11__1 = this_3;
5661
- var deviceKey = this.$this$runCatching11__1.device_1.key(ensureNotNull(this.$this$runCatching11__1.userId));
5662
- var this_4 = logging();
5663
- if (KmLogging_getInstance().isLoggingDebug_1) {
5664
- this_4.debugApi_8ssb7n_k$(this_4.tagName_1, toString('Device key for refresh: ' + deviceKey));
5665
- }
5666
- this.exceptionState_1 = 9;
5667
- this.state_1 = 8;
5668
- var tmp_11 = this.$this$runCatching11__1.auth;
5669
- var tmp1_clientId = ensureNotNull(this.$this$runCatching11__1.clientId);
5670
- var tmp2_fingerprint = this.$this$runCatching11__1.fingerprinter_1.print(ensureNotNull(this.$this$runCatching11__1.userId));
5671
- var tmp0_elvis_lhs_0 = this.$this$runCatching11__1.refreshToken_1;
5672
- var tmp3_refreshToken = tmp0_elvis_lhs_0 == null ? ensureNotNull(this.tokensToUse5__1.refreshToken_1) : tmp0_elvis_lhs_0;
5673
- var tmp4_userId = ensureNotNull(this.$this$runCatching11__1.userId);
5674
- var tmp5_deviceKey = this.$this$runCatching11__1.device_1.key(ensureNotNull(this.$this$runCatching11__1.userId));
5675
- suspendResult = tmp_11.refreshTokens$suspendBridge_qhelbw_k$(new RefreshTokensCommand(tmp1_clientId, tmp5_deviceKey, tmp2_fingerprint, tmp3_refreshToken, tmp4_userId), this);
5676
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
5677
- return suspendResult;
5678
- }
5679
- continue $sm;
5680
- }
6230
+ tmp_8 = null;
5681
6231
  }
6232
+ tmp_7 = tmp_8;
6233
+ }
6234
+
6235
+ var tmp5_elvis_lhs = tmp_7;
6236
+ var tmp_9;
6237
+ if (tmp5_elvis_lhs == null) {
6238
+ return null;
6239
+ } else {
6240
+ tmp_9 = tmp5_elvis_lhs;
6241
+ }
6242
+
6243
+ var client = tmp_9;
6244
+ var this_1 = this._this__u8e3s4__1;
6245
+ this.exceptionState_1 = 9;
6246
+ this.tmp02__1 = Companion_instance;
6247
+ this.$this$runCatching6__1 = this_1;
6248
+ this.exceptionState_1 = 2;
6249
+ this.state_1 = 1;
6250
+ var tmp_10 = _get_refreshAuth__q4vj66(this.$this$runCatching6__1);
6251
+ var tmp0_fingerprint = this.$this$runCatching6__1.fingerprinter_1.print(user);
6252
+ var tmp1_refreshToken = this.old0__1;
6253
+ var tmp2_deviceKey = this.$this$runCatching6__1.device_1.key(user);
6254
+ suspendResult = tmp_10.refreshTokens$suspendBridge_qhelbw_k$(new RefreshTokensCommand(client, tmp2_deviceKey, tmp0_fingerprint, tmp1_refreshToken, user), this);
6255
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
6256
+ return suspendResult;
5682
6257
  }
5683
6258
 
5684
- case 8:
5685
- this.TRY_RESULT12__1 = suspendResult;
5686
- this.exceptionState_1 = 16;
5687
- this.state_1 = 11;
5688
6259
  continue $sm;
5689
- case 9:
5690
- this.exceptionState_1 = 16;
5691
- var tmp_12 = this.exception_1;
5692
- if (tmp_12 instanceof SoliboSDKError) {
5693
- this.failure13__1 = this.exception_1;
5694
- if (!rejectsRefreshToken(this.failure13__1))
5695
- throw this.failure13__1;
5696
- this.state_1 = 10;
5697
- suspendResult = endSession(this.$this$runCatching11__1, this);
6260
+ case 1:
6261
+ this.TRY_RESULT7__1 = suspendResult;
6262
+ this.exceptionState_1 = 9;
6263
+ this.state_1 = 4;
6264
+ continue $sm;
6265
+ case 2:
6266
+ this.exceptionState_1 = 9;
6267
+ var tmp_11 = this.exception_1;
6268
+ if (tmp_11 instanceof SoliboSDKError) {
6269
+ this.failure8__1 = this.exception_1;
6270
+ if (!rejectsRefreshToken(this.failure8__1))
6271
+ throw this.failure8__1;
6272
+ this.state_1 = 3;
6273
+ suspendResult = endSession(this.$this$runCatching6__1, this);
5698
6274
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
5699
6275
  return suspendResult;
5700
6276
  }
@@ -5703,275 +6279,196 @@ protoOf($refreshSessionCOROUTINE$).doResume_5yljmg_k$ = function () {
5703
6279
  throw this.exception_1;
5704
6280
  }
5705
6281
 
5706
- case 10:
5707
- var tmp_13 = this;
5708
- throw new RefreshRefused(this.failure13__1);
5709
- case 11:
5710
- this.exceptionState_1 = 16;
5711
- this.response10__1 = this.TRY_RESULT12__1;
5712
- var tmp6_subject = this.response10__1.status;
5713
- if (tmp6_subject === Companion_getInstance_4().Accepted_1.value_1) {
5714
- this.state_1 = 14;
5715
- suspendResult = this.response10__1.body$suspendBridge_a6dedm_k$(this);
6282
+ case 3:
6283
+ var tmp_12 = this;
6284
+ throw new RefreshRefused(this.failure8__1);
6285
+ case 4:
6286
+ this.exceptionState_1 = 9;
6287
+ this.response5__1 = this.TRY_RESULT7__1;
6288
+ var tmp3_subject = this.response5__1.status;
6289
+ if (tmp3_subject === Companion_getInstance_4().Accepted_1.value_1) {
6290
+ this.state_1 = 7;
6291
+ suspendResult = this.response5__1.body$suspendBridge_a6dedm_k$(this);
5716
6292
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
5717
6293
  return suspendResult;
5718
6294
  }
5719
6295
  continue $sm;
5720
6296
  } else {
5721
- if (tmp6_subject === Companion_getInstance_4().Unauthorized_1.value_1) {
5722
- this.state_1 = 12;
5723
- suspendResult = endSession(this.$this$runCatching11__1, this);
6297
+ if (tmp3_subject === Companion_getInstance_4().Unauthorized_1.value_1) {
6298
+ this.state_1 = 5;
6299
+ suspendResult = endSession(this.$this$runCatching6__1, this);
5724
6300
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
5725
6301
  return suspendResult;
5726
6302
  }
5727
6303
  continue $sm;
5728
6304
  } else {
5729
- var tmp_14 = this;
5730
- throw new UnknownRefreshErrorException('Refresh failed with status ' + this.response10__1.status);
6305
+ var tmp_13 = this;
6306
+ throw new UnknownRefreshErrorException('Refresh failed with status ' + this.response5__1.status);
5731
6307
  }
5732
6308
  }
5733
6309
 
5734
- case 12:
5735
- this.ARGUMENT9__1 = Companion_getInstance_4().Unauthorized_1.value_1;
5736
- this.state_1 = 13;
5737
- suspendResult = bodyAsText(this.response10__1.response, VOID, this);
6310
+ case 5:
6311
+ this.ARGUMENT4__1 = Companion_getInstance_4().Unauthorized_1.value_1;
6312
+ this.state_1 = 6;
6313
+ suspendResult = bodyAsText(this.response5__1.response, VOID, this);
5738
6314
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
5739
6315
  return suspendResult;
5740
6316
  }
5741
6317
 
5742
6318
  continue $sm;
5743
- case 13:
6319
+ case 6:
5744
6320
  var ARGUMENT = suspendResult;
5745
6321
  var ARGUMENT_0 = parseApiErrors(ARGUMENT);
5746
- var ARGUMENT_1 = new SoliboSDKError(this.ARGUMENT9__1, ARGUMENT_0, FailureKind_EXPECTED_AUTH_getInstance());
5747
- var tmp_15 = this;
6322
+ var ARGUMENT_1 = new SoliboSDKError(this.ARGUMENT4__1, ARGUMENT_0, FailureKind_EXPECTED_AUTH_getInstance());
6323
+ var tmp_14 = this;
5748
6324
  throw new RefreshRefused(ARGUMENT_1);
5749
- case 14:
5750
- this.WHEN_RESULT8__1 = suspendResult;
5751
- this.state_1 = 15;
6325
+ case 7:
6326
+ this.WHEN_RESULT3__1 = suspendResult;
6327
+ this.state_1 = 8;
5752
6328
  continue $sm;
5753
- case 15:
5754
- var tmp2 = this.WHEN_RESULT8__1;
5755
- var tmp_16 = this;
5756
- this.tmp07__1;
5757
- tmp_16.TRY_RESULT6__1 = _Result___init__impl__xyqfz8(tmp2);
5758
- this.exceptionState_1 = 25;
5759
- this.state_1 = 17;
6329
+ case 8:
6330
+ var tmp2 = this.WHEN_RESULT3__1;
6331
+ var tmp_15 = this;
6332
+ this.tmp02__1;
6333
+ tmp_15.TRY_RESULT1__1 = _Result___init__impl__xyqfz8(tmp2);
6334
+ this.exceptionState_1 = 10;
6335
+ this.state_1 = 11;
5760
6336
  continue $sm;
5761
- case 16:
5762
- this.exceptionState_1 = 25;
5763
- var tmp_17 = this.exception_1;
5764
- if (tmp_17 instanceof Error) {
6337
+ case 9:
6338
+ this.exceptionState_1 = 10;
6339
+ var tmp_16 = this.exception_1;
6340
+ if (tmp_16 instanceof Error) {
5765
6341
  var e = this.exception_1;
5766
- var tmp_18 = this;
5767
- tmp_18.TRY_RESULT6__1 = _Result___init__impl__xyqfz8(createFailure(e));
5768
- this.state_1 = 17;
6342
+ var tmp_17 = this;
6343
+ tmp_17.TRY_RESULT1__1 = _Result___init__impl__xyqfz8(createFailure(e));
6344
+ this.state_1 = 11;
5769
6345
  continue $sm;
5770
6346
  } else {
5771
6347
  throw this.exception_1;
5772
6348
  }
5773
6349
 
5774
- case 17:
5775
- this.exceptionState_1 = 25;
5776
- var this_5 = this.TRY_RESULT6__1;
5777
- var tmp_19;
5778
- if (_Result___get_isSuccess__impl__sndoy8(this_5)) {
5779
- var this_6 = new Result(this_5);
5780
- var tmp_20;
6350
+ case 10:
6351
+ throw this.exception_1;
6352
+ case 11:
6353
+ this.exceptionState_1 = 10;
6354
+ var this_2 = this.TRY_RESULT1__1;
6355
+ var tmp_18;
6356
+ if (_Result___get_isSuccess__impl__sndoy8(this_2)) {
6357
+ var this_3 = new Result(this_2);
6358
+ var tmp_19;
5781
6359
  try {
5782
- var $this$runCatching = this_6.value_1;
6360
+ var $this$runCatching = this_3.value_1;
5783
6361
  var authResult = _Result___get_value__impl__bjfvqg($this$runCatching);
5784
6362
  var tmp0_elvis_lhs_1 = authResult.tokens;
5785
- var tmp_21;
6363
+ var tmp_20;
5786
6364
  if (tmp0_elvis_lhs_1 == null) {
5787
6365
  throw Exception_init_$Create$('Refresh succeeded but tokens were missing');
5788
6366
  } else {
5789
- tmp_21 = tmp0_elvis_lhs_1;
5790
- }
5791
- var tokens = tmp_21;
5792
- var builder = new JsonObjectBuilder();
5793
- builder.put_mrde5n_k$('accessToken', JsonPrimitive(tokens.accessToken));
5794
- builder.put_mrde5n_k$('identity', JsonPrimitive(tokens.identity));
5795
- builder.put_mrde5n_k$('data', JsonPrimitive(tokens.data));
5796
- var jsonObject = builder.build_bkh6qh_k$();
5797
- var this_7 = Default_getInstance_1();
5798
- var this_8 = this_7.get_serializersModule_piitvg_k$();
5799
- var this_9 = serializer(this_8, createKType(getKClass(JsonObject), arrayOf([]), false));
5800
- var jsonString = this_7.encodeToString_k0apqx_k$(isInterface(this_9, KSerializer) ? this_9 : THROW_CCE(), jsonObject);
5801
- var encoded = Default_getInstance().UrlSafe_1.encode$default_h4nonq_k$(toByteArray_0(jsonString));
5802
- this._this__u8e3s4__1.setToken(encoded);
5803
- var tmp1_elvis_lhs = authResult.refreshToken;
5804
- var tmp_22;
5805
- if (tmp1_elvis_lhs == null) {
5806
- var tmp2_safe_receiver = authResult.tokens;
5807
- tmp_22 = tmp2_safe_receiver == null ? null : tmp2_safe_receiver.refreshToken;
5808
- } else {
5809
- tmp_22 = tmp1_elvis_lhs;
5810
- }
5811
- var tmp3_safe_receiver = tmp_22;
5812
- if (tmp3_safe_receiver == null)
5813
- null;
5814
- else {
5815
- this._this__u8e3s4__1.setRefreshToken(tmp3_safe_receiver);
6367
+ tmp_20 = tmp0_elvis_lhs_1;
5816
6368
  }
5817
- this._this__u8e3s4__1.set_userId_wekl5g_k$(tokens.identity);
5818
- var tmp4_elvis_lhs_0 = authResult.refreshToken;
5819
- var tmp_23;
5820
- if (tmp4_elvis_lhs_0 == null) {
5821
- var tmp5_safe_receiver = authResult.tokens;
5822
- tmp_23 = tmp5_safe_receiver == null ? null : tmp5_safe_receiver.refreshToken;
5823
- } else {
5824
- tmp_23 = tmp4_elvis_lhs_0;
5825
- }
5826
- var tmp6_elvis_lhs_0 = tmp_23;
5827
- var value = new BearerTokens(encoded, tmp6_elvis_lhs_0 == null ? this.tokensToUse5__1.refreshToken_1 : tmp6_elvis_lhs_0);
5828
- tmp_20 = _Result___init__impl__xyqfz8(value);
6369
+ var tokens = tmp_20;
6370
+ var accessToken = bearerEnvelope(this._this__u8e3s4__1, tokens);
6371
+ var tmp1_elvis_lhs_0 = authResult.refreshToken;
6372
+ var renewedRefreshToken = tmp1_elvis_lhs_0 == null ? tokens.refreshToken : tmp1_elvis_lhs_0;
6373
+ storeRenewedSession(this._this__u8e3s4__1, accessToken, renewedRefreshToken, tokens.identity);
6374
+ var value = new BearerTokens(accessToken, renewedRefreshToken == null ? this.old0__1 : renewedRefreshToken);
6375
+ tmp_19 = _Result___init__impl__xyqfz8(value);
5829
6376
  } catch ($p) {
5830
- var tmp_24;
6377
+ var tmp_21;
5831
6378
  if ($p instanceof Error) {
5832
6379
  var e_0 = $p;
5833
- tmp_24 = _Result___init__impl__xyqfz8(createFailure(e_0));
6380
+ tmp_21 = _Result___init__impl__xyqfz8(createFailure(e_0));
5834
6381
  } else {
5835
6382
  throw $p;
5836
6383
  }
5837
- tmp_20 = tmp_24;
6384
+ tmp_19 = tmp_21;
5838
6385
  }
5839
- tmp_19 = tmp_20;
6386
+ tmp_18 = tmp_19;
5840
6387
  } else {
5841
- tmp_19 = _Result___init__impl__xyqfz8(_Result___get_value__impl__bjfvqg(this_5));
6388
+ tmp_18 = _Result___init__impl__xyqfz8(_Result___get_value__impl__bjfvqg(this_2));
5842
6389
  }
5843
6390
 
5844
- var this_10 = tmp_19;
5845
- var tmp0_safe_receiver = Result__exceptionOrNull_impl_p6xea9(this_10);
6391
+ var this_4 = tmp_18;
6392
+ var tmp0_safe_receiver = Result__exceptionOrNull_impl_p6xea9(this_4);
5846
6393
  if (tmp0_safe_receiver == null)
5847
6394
  null;
5848
6395
  else {
5849
6396
  if (tmp0_safe_receiver instanceof CancellationException)
5850
6397
  throw tmp0_safe_receiver;
5851
- var this_11 = logging();
6398
+ var this_5 = logging();
5852
6399
  if (KmLogging_getInstance().isLoggingInfo_1) {
5853
- this_11.infoApi_6vw3du_k$(this_11.tagName_1, toString('Refresh successfully failed!'));
6400
+ this_5.infoApi_6vw3du_k$(this_5.tagName_1, toString('Refresh successfully failed!'));
5854
6401
  }
5855
6402
  }
5856
6403
 
5857
- var tmp_25 = this;
5858
- throwOnFailure(this_10);
5859
- tmp_25.WHEN_RESULT4__1 = _Result___get_value__impl__bjfvqg(this_10);
5860
- this.state_1 = 18;
5861
- continue $sm;
5862
- case 18:
5863
- this.tmp$ret$03__1 = this.WHEN_RESULT4__1;
5864
- if (false) {
5865
- this.state_1 = 3;
5866
- continue $sm;
5867
- }
5868
-
5869
- this.state_1 = 23;
6404
+ throwOnFailure(this_4);
6405
+ return _Result___get_value__impl__bjfvqg(this_4);
6406
+ }
6407
+ } catch ($p_0) {
6408
+ var e_1 = $p_0;
6409
+ if (this.exceptionState_1 === 10) {
6410
+ throw e_1;
6411
+ } else {
6412
+ this.state_1 = this.exceptionState_1;
6413
+ this.exception_1 = e_1;
6414
+ }
6415
+ }
6416
+ while (true);
6417
+ };
6418
+ function $endSessionCOROUTINE$(_this__u8e3s4, resultContinuation) {
6419
+ CoroutineImpl.call(this, resultContinuation);
6420
+ this._this__u8e3s4__1 = _this__u8e3s4;
6421
+ }
6422
+ protoOf($endSessionCOROUTINE$).doResume_5yljmg_k$ = function () {
6423
+ var suspendResult = this.result_1;
6424
+ $sm: do
6425
+ try {
6426
+ var tmp = this.state_1;
6427
+ switch (tmp) {
6428
+ case 0:
6429
+ this.exceptionState_1 = 6;
6430
+ this.state_1 = 1;
5870
6431
  continue $sm;
5871
- case 19:
5872
- this.tmp$ret$03__1 = null;
5873
- this.state_1 = 23;
6432
+ case 1:
6433
+ this.exceptionState_1 = 2;
6434
+ this._this__u8e3s4__1.settings_1.remove_6241ba_k$('activeLogin');
6435
+ this._this__u8e3s4__1.clearTokens();
6436
+ this.exceptionState_1 = 6;
6437
+ this.state_1 = 4;
5874
6438
  continue $sm;
5875
- case 20:
5876
- this.state_1 = 21;
5877
- var tmp_26 = _get_authM2M__c6rkbz(this._this__u8e3s4__1);
5878
- var tmp0_elvis_lhs_2 = this._this__u8e3s4__1.clientId;
5879
- var tmp_27;
5880
- if (tmp0_elvis_lhs_2 == null) {
5881
- throw Exception_init_$Create$('M2M Client ID not set');
5882
- } else {
5883
- tmp_27 = tmp0_elvis_lhs_2;
5884
- }
5885
-
5886
- var tmp_28 = tmp_27;
5887
- var tmp1_elvis_lhs_0 = this._this__u8e3s4__1.clientSecret;
5888
- var tmp_29;
5889
- if (tmp1_elvis_lhs_0 == null) {
5890
- throw Exception_init_$Create$('M2M Client Secret not set');
5891
- } else {
5892
- tmp_29 = tmp1_elvis_lhs_0;
5893
- }
5894
-
5895
- suspendResult = tmp_26.createM2MTokens$suspendBridge_5mlkf0_k$(new CreateM2MTokensCommand(tmp_28, tmp_29, normalizedM2MScopes(this._this__u8e3s4__1.scopes)), this);
6439
+ case 2:
6440
+ this.exceptionState_1 = 6;
6441
+ this.t0__1 = this.exception_1;
6442
+ this.state_1 = 3;
6443
+ suspendResult = this._this__u8e3s4__1.refreshFailure_1(this);
5896
6444
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
5897
6445
  return suspendResult;
5898
6446
  }
5899
6447
 
5900
6448
  continue $sm;
5901
- case 21:
5902
- var response = suspendResult;
5903
- if (!(response.status === Companion_getInstance_4().Created_1.value_1)) {
5904
- throw Exception_init_$Create$('M2M Token acquisition failed with status ' + response.status);
5905
- }
5906
-
5907
- this.state_1 = 22;
5908
- suspendResult = response.body$suspendBridge_a6dedm_k$(this);
6449
+ case 3:
6450
+ throw this.t0__1;
6451
+ case 4:
6452
+ this.exceptionState_1 = 6;
6453
+ this.state_1 = 5;
6454
+ suspendResult = this._this__u8e3s4__1.refreshFailure_1(this);
5909
6455
  if (suspendResult === get_COROUTINE_SUSPENDED()) {
5910
6456
  return suspendResult;
5911
6457
  }
5912
6458
 
5913
6459
  continue $sm;
5914
- case 22:
5915
- var authResult_0 = suspendResult;
5916
- var tmp2_elvis_lhs = authResult_0.tokens;
5917
- var tmp_30;
5918
- if (tmp2_elvis_lhs == null) {
5919
- throw Exception_init_$Create$('M2M Token acquisition returned no tokens');
5920
- } else {
5921
- tmp_30 = tmp2_elvis_lhs;
5922
- }
5923
-
5924
- var tokens_0 = tmp_30;
5925
- var builder_0 = new JsonObjectBuilder();
5926
- builder_0.put_mrde5n_k$('accessToken', JsonPrimitive(tokens_0.accessToken));
5927
- builder_0.put_mrde5n_k$('identity', JsonPrimitive(tokens_0.identity));
5928
- builder_0.put_mrde5n_k$('data', JsonPrimitive(tokens_0.data));
5929
- var jsonObject_0 = builder_0.build_bkh6qh_k$();
5930
- var this_12 = Default_getInstance_1();
5931
- var this_13 = this_12.get_serializersModule_piitvg_k$();
5932
- var this_14 = serializer(this_13, createKType(getKClass(JsonObject), arrayOf([]), false));
5933
- var jsonString_0 = this_12.encodeToString_k0apqx_k$(isInterface(this_14, KSerializer) ? this_14 : THROW_CCE(), jsonObject_0);
5934
- var encoded_0 = Default_getInstance().UrlSafe_1.encode$default_h4nonq_k$(toByteArray_0(jsonString_0));
5935
- this._this__u8e3s4__1.setToken(encoded_0);
5936
- this._this__u8e3s4__1.set_userId_wekl5g_k$(tokens_0.identity);
5937
- this._this__u8e3s4__1.tokenTimestamp = System_instance.now_2cba_k$().toEpochMilliseconds_82cfls_k$();
5938
- var tmp_31 = this;
5939
- var tmp3_safe_receiver_0 = this._this__u8e3s4__1.bearerToken_1;
5940
- var tmp_32;
5941
- if (tmp3_safe_receiver_0 == null) {
5942
- tmp_32 = null;
5943
- } else {
5944
- tmp_32 = new BearerTokens(tmp3_safe_receiver_0, '');
5945
- }
5946
-
5947
- tmp_31.tmp$ret$03__1 = tmp_32;
5948
- this.state_1 = 23;
5949
- continue $sm;
5950
- case 23:
5951
- this.tmp$ret$22__1 = this.tmp$ret$03__1;
5952
- this.exceptionState_1 = 26;
5953
- this.state_1 = 24;
5954
- continue $sm;
5955
- case 24:
5956
- var tmp_33 = this.tmp$ret$22__1;
5957
- this.exceptionState_1 = 26;
5958
- this.this1__1.unlock_ulcrcl_k$(this.owner0__1);
5959
- return tmp_33;
5960
- case 25:
5961
- this.exceptionState_1 = 26;
5962
- var t = this.exception_1;
5963
- this.this1__1.unlock_ulcrcl_k$(this.owner0__1);
5964
- throw t;
5965
- case 26:
6460
+ case 5:
6461
+ return Unit_instance;
6462
+ case 6:
5966
6463
  throw this.exception_1;
5967
6464
  }
5968
- } catch ($p_0) {
5969
- var e_1 = $p_0;
5970
- if (this.exceptionState_1 === 26) {
5971
- throw e_1;
6465
+ } catch ($p) {
6466
+ var e = $p;
6467
+ if (this.exceptionState_1 === 6) {
6468
+ throw e;
5972
6469
  } else {
5973
6470
  this.state_1 = this.exceptionState_1;
5974
- this.exception_1 = e_1;
6471
+ this.exception_1 = e;
5975
6472
  }
5976
6473
  }
5977
6474
  while (true);
@@ -6356,6 +6853,9 @@ function HomeApiBase(fingerprinter, device, httpClientEngine, settings, configur
6356
6853
  var tmp_2 = this;
6357
6854
  tmp_2.authM2M$delegate_1 = lazy(HomeApiBase$authM2M$delegate$lambda(this));
6358
6855
  this.refreshLock_1 = Mutex();
6856
+ this.sessionScope_1 = CoroutineScope_0(SupervisorJob().plus_s13ygv_k$(Dispatchers_getInstance().Default_1));
6857
+ this.refreshGate_1 = Mutex();
6858
+ this.refreshInFlight_1 = null;
6359
6859
  this.cookieSessionGeneration_1 = 0;
6360
6860
  this.publicCacheStorage_1 = new InvalidatingCacheStorage(Companion_getInstance_3().Unlimited_1());
6361
6861
  this.privateCacheStorage_1 = new InvalidatingCacheStorage(Companion_getInstance_3().Unlimited_1());
@@ -6376,19 +6876,23 @@ function HomeApiBase(fingerprinter, device, httpClientEngine, settings, configur
6376
6876
  var tmp_3 = this;
6377
6877
  tmp_3.clientConfigurator = HomeApiBase$clientConfigurator$lambda(this);
6378
6878
  var tmp_4 = this;
6379
- tmp_4.auth$delegate_1 = lazy(HomeApiBase$auth$delegate$lambda(this));
6879
+ tmp_4.refreshClientConfigurator_1 = HomeApiBase$refreshClientConfigurator$lambda(this);
6380
6880
  var tmp_5 = this;
6381
- tmp_5.sessionAuth$delegate_1 = lazy(HomeApiBase$sessionAuth$delegate$lambda(this));
6881
+ tmp_5.auth$delegate_1 = lazy(HomeApiBase$auth$delegate$lambda(this));
6382
6882
  var tmp_6 = this;
6383
- tmp_6.language$delegate_1 = lazy(HomeApiBase$language$delegate$lambda(this));
6883
+ tmp_6.refreshAuth$delegate_1 = lazy(HomeApiBase$refreshAuth$delegate$lambda(this));
6384
6884
  var tmp_7 = this;
6385
- tmp_7.devices$delegate_1 = lazy(HomeApiBase$devices$delegate$lambda(this));
6885
+ tmp_7.sessionAuth$delegate_1 = lazy(HomeApiBase$sessionAuth$delegate$lambda(this));
6386
6886
  var tmp_8 = this;
6387
- tmp_8.appStores$delegate_1 = lazy(HomeApiBase$appStores$delegate$lambda(this));
6887
+ tmp_8.language$delegate_1 = lazy(HomeApiBase$language$delegate$lambda(this));
6388
6888
  var tmp_9 = this;
6389
- tmp_9.unsubscribe$delegate_1 = lazy(HomeApiBase$unsubscribe$delegate$lambda(this));
6889
+ tmp_9.devices$delegate_1 = lazy(HomeApiBase$devices$delegate$lambda(this));
6390
6890
  var tmp_10 = this;
6391
- tmp_10.apiPathAuth$delegate_1 = lazy(HomeApiBase$apiPathAuth$delegate$lambda(this));
6891
+ tmp_10.appStores$delegate_1 = lazy(HomeApiBase$appStores$delegate$lambda(this));
6892
+ var tmp_11 = this;
6893
+ tmp_11.unsubscribe$delegate_1 = lazy(HomeApiBase$unsubscribe$delegate$lambda(this));
6894
+ var tmp_12 = this;
6895
+ tmp_12.apiPathAuth$delegate_1 = lazy(HomeApiBase$apiPathAuth$delegate$lambda(this));
6392
6896
  }
6393
6897
  protoOf(HomeApiBase).get_authMode_84brv0_k$ = function () {
6394
6898
  return this.authMode_1;
@@ -6496,42 +7000,11 @@ protoOf(HomeApiBase).setInitialBaseUrl = function (url) {
6496
7000
  this.baseUrl_1 = sanitizeBaseUrl(this, url);
6497
7001
  };
6498
7002
  protoOf(HomeApiBase).setToken = function (bearer) {
6499
- this.bearerToken_1 = bearer;
6500
7003
  var tmp0 = this.settings_1;
6501
- var tmp2 = 'bearerToken';
6502
7004
  // Inline function 'com.russhwolf.settings.set' call
6503
- var value = this.bearerToken_1;
6504
- var tmp;
6505
- if (value == null) {
6506
- // Inline function 'com.russhwolf.settings.minusAssign' call
6507
- tmp0.remove_6241ba_k$(tmp2);
6508
- tmp = Unit_instance;
6509
- } else {
6510
- var tmp0_subject = PrimitiveClasses_getInstance().get_stringClass_bik2gy_k$();
6511
- var tmp_0;
6512
- if (tmp0_subject.equals(PrimitiveClasses_getInstance().get_intClass_mw4y9a_k$())) {
6513
- tmp0.putInt_yr2eaa_k$(tmp2, (!(value == null) ? typeof value === 'number' : false) ? value : THROW_CCE());
6514
- tmp_0 = Unit_instance;
6515
- } else if (tmp0_subject.equals(PrimitiveClasses_getInstance().get_longClass_a79cj7_k$())) {
6516
- tmp0.putLong_2n8au3_k$(tmp2, (!(value == null) ? typeof value === 'bigint' : false) ? value : THROW_CCE());
6517
- tmp_0 = Unit_instance;
6518
- } else if (tmp0_subject.equals(PrimitiveClasses_getInstance().get_stringClass_bik2gy_k$())) {
6519
- tmp0.putString_q7x3bk_k$(tmp2, (!(value == null) ? typeof value === 'string' : false) ? value : THROW_CCE());
6520
- tmp_0 = Unit_instance;
6521
- } else if (tmp0_subject.equals(PrimitiveClasses_getInstance().get_floatClass_xlwq2t_k$())) {
6522
- tmp0.putFloat_g52tvf_k$(tmp2, (!(value == null) ? typeof value === 'number' : false) ? value : THROW_CCE());
6523
- tmp_0 = Unit_instance;
6524
- } else if (tmp0_subject.equals(PrimitiveClasses_getInstance().get_doubleClass_dahzcy_k$())) {
6525
- tmp0.putDouble_go8clg_k$(tmp2, (!(value == null) ? typeof value === 'number' : false) ? value : THROW_CCE());
6526
- tmp_0 = Unit_instance;
6527
- } else if (tmp0_subject.equals(PrimitiveClasses_getInstance().get_booleanClass_d285fr_k$())) {
6528
- tmp0.putBoolean_wwpo7g_k$(tmp2, (!(value == null) ? typeof value === 'boolean' : false) ? value : THROW_CCE());
6529
- tmp_0 = Unit_instance;
6530
- } else {
6531
- throw IllegalArgumentException_init_$Create$('Invalid type!');
6532
- }
6533
- tmp = tmp_0;
6534
- }
7005
+ var key = 'bearerToken';
7006
+ tmp0.putString_q7x3bk_k$(key, bearer);
7007
+ this.bearerToken_1 = bearer;
6535
7008
  };
6536
7009
  protoOf(HomeApiBase).setDelegatedToken_ikzdax_k$ = function (accessToken, identity) {
6537
7010
  var tmp;
@@ -6590,42 +7063,11 @@ protoOf(HomeApiBase).setDelegatedToken = function (accessToken, identity, $super
6590
7063
  return tmp;
6591
7064
  };
6592
7065
  protoOf(HomeApiBase).setRefreshToken = function (refresh) {
6593
- this.refreshToken_1 = refresh;
6594
7066
  var tmp0 = this.settings_1;
6595
- var tmp2 = 'refreshToken';
6596
7067
  // Inline function 'com.russhwolf.settings.set' call
6597
- var value = this.refreshToken_1;
6598
- var tmp;
6599
- if (value == null) {
6600
- // Inline function 'com.russhwolf.settings.minusAssign' call
6601
- tmp0.remove_6241ba_k$(tmp2);
6602
- tmp = Unit_instance;
6603
- } else {
6604
- var tmp0_subject = PrimitiveClasses_getInstance().get_stringClass_bik2gy_k$();
6605
- var tmp_0;
6606
- if (tmp0_subject.equals(PrimitiveClasses_getInstance().get_intClass_mw4y9a_k$())) {
6607
- tmp0.putInt_yr2eaa_k$(tmp2, (!(value == null) ? typeof value === 'number' : false) ? value : THROW_CCE());
6608
- tmp_0 = Unit_instance;
6609
- } else if (tmp0_subject.equals(PrimitiveClasses_getInstance().get_longClass_a79cj7_k$())) {
6610
- tmp0.putLong_2n8au3_k$(tmp2, (!(value == null) ? typeof value === 'bigint' : false) ? value : THROW_CCE());
6611
- tmp_0 = Unit_instance;
6612
- } else if (tmp0_subject.equals(PrimitiveClasses_getInstance().get_stringClass_bik2gy_k$())) {
6613
- tmp0.putString_q7x3bk_k$(tmp2, (!(value == null) ? typeof value === 'string' : false) ? value : THROW_CCE());
6614
- tmp_0 = Unit_instance;
6615
- } else if (tmp0_subject.equals(PrimitiveClasses_getInstance().get_floatClass_xlwq2t_k$())) {
6616
- tmp0.putFloat_g52tvf_k$(tmp2, (!(value == null) ? typeof value === 'number' : false) ? value : THROW_CCE());
6617
- tmp_0 = Unit_instance;
6618
- } else if (tmp0_subject.equals(PrimitiveClasses_getInstance().get_doubleClass_dahzcy_k$())) {
6619
- tmp0.putDouble_go8clg_k$(tmp2, (!(value == null) ? typeof value === 'number' : false) ? value : THROW_CCE());
6620
- tmp_0 = Unit_instance;
6621
- } else if (tmp0_subject.equals(PrimitiveClasses_getInstance().get_booleanClass_d285fr_k$())) {
6622
- tmp0.putBoolean_wwpo7g_k$(tmp2, (!(value == null) ? typeof value === 'boolean' : false) ? value : THROW_CCE());
6623
- tmp_0 = Unit_instance;
6624
- } else {
6625
- throw IllegalArgumentException_init_$Create$('Invalid type!');
6626
- }
6627
- tmp = tmp_0;
6628
- }
7068
+ var key = 'refreshToken';
7069
+ tmp0.putString_q7x3bk_k$(key, refresh);
7070
+ this.refreshToken_1 = refresh;
6629
7071
  };
6630
7072
  protoOf(HomeApiBase).refresh_gpuu8g_k$ = function (oldTokens, $completion) {
6631
7073
  var tmp = new $refreshCOROUTINE$(this, oldTokens, $completion);
@@ -6656,13 +7098,13 @@ protoOf(HomeApiBase).refreshOrFail_pa247y_k$ = function ($completion) {
6656
7098
  return tmp.doResume_5yljmg_k$();
6657
7099
  };
6658
7100
  protoOf(HomeApiBase).clearTokens = function () {
6659
- this.resetTokens();
6660
- this.bearerToken_1 = null;
7101
+ this.settings_1.remove_6241ba_k$('refreshToken');
6661
7102
  this.settings_1.remove_6241ba_k$('bearerToken');
7103
+ this.settings_1.remove_6241ba_k$('userId');
6662
7104
  this.refreshToken_1 = null;
6663
- this.settings_1.remove_6241ba_k$('refreshToken');
7105
+ this.bearerToken_1 = null;
6664
7106
  this.set_userId_wekl5g_k$(null);
6665
- this.settings_1.remove_6241ba_k$('userId');
7107
+ this.resetTokens();
6666
7108
  };
6667
7109
  protoOf(HomeApiBase).resetTokens = function () {
6668
7110
  var coreApis = listOf([this.auth, _get_sessionAuth__fjt4oj(this), _get_authM2M__c6rkbz(this), this.language, this.appStores, this.unsubscribe]);
@@ -7159,6 +7601,22 @@ function rejectsRefreshToken(_this__u8e3s4) {
7159
7601
  return false;
7160
7602
  }
7161
7603
  }
7604
+ function Key() {
7605
+ }
7606
+ var Key_instance;
7607
+ function Key_getInstance() {
7608
+ return Key_instance;
7609
+ }
7610
+ function RefreshInProgress() {
7611
+ RefreshInProgress_instance = this;
7612
+ AbstractCoroutineContextElement.call(this, Key_instance);
7613
+ }
7614
+ var RefreshInProgress_instance;
7615
+ function RefreshInProgress_getInstance() {
7616
+ if (RefreshInProgress_instance == null)
7617
+ new RefreshInProgress();
7618
+ return RefreshInProgress_instance;
7619
+ }
7162
7620
  function normalizedM2MScopes(_this__u8e3s4) {
7163
7621
  _init_properties_HomeApiBase_kt__lck77e();
7164
7622
  var tmp;
@@ -8177,8 +8635,8 @@ function Auth$handleCorrectAuthentication$lambda(this$0) {
8177
8635
  tmp_0 = false;
8178
8636
  }
8179
8637
  if (tmp_0) {
8180
- this$0.api.setToken(Default_getInstance().UrlSafe_1.encode$default_h4nonq_k$(toByteArray_0(jsonString)));
8181
8638
  this$0.api.setRefreshToken(refreshToken);
8639
+ this$0.api.setToken(Default_getInstance().UrlSafe_1.encode$default_h4nonq_k$(toByteArray_0(jsonString)));
8182
8640
  tmp = Unit_instance;
8183
8641
  }
8184
8642
  this$0.api.set_userId_wekl5g_k$(tokens.identity);
@@ -17605,7 +18063,7 @@ function SoliboOpenTelemetry() {
17605
18063
  }
17606
18064
  protoOf(SoliboOpenTelemetry).tracer_4zr7of_k$ = function () {
17607
18065
  var tmp0_elvis_lhs = this.installed_1;
17608
- return (tmp0_elvis_lhs == null ? get_NoopOpenTelemetry() : tmp0_elvis_lhs).get_tracerProvider_kgfk0p_k$().getTracer$default_y9z64o_k$('no.solibo.oss.sdk', '1.55.0');
18066
+ return (tmp0_elvis_lhs == null ? get_NoopOpenTelemetry() : tmp0_elvis_lhs).get_tracerProvider_kgfk0p_k$().getTracer$default_y9z64o_k$('no.solibo.oss.sdk', '1.56.0');
17609
18067
  };
17610
18068
  var SoliboOpenTelemetry_instance;
17611
18069
  function SoliboOpenTelemetry_getInstance() {
@@ -25968,7 +26426,7 @@ function ApiClient$authentications$delegate$lambda() {
25968
26426
  function ApiClient$_get_authentications_$ref_9p12je() {
25969
26427
  return constructCallableReference(function (p0) {
25970
26428
  return _get_authentications__apunwq(p0);
25971
- }, 1, 0, 115);
26429
+ }, 1, 0, 116);
25972
26430
  }
25973
26431
  function ApiClient$request$lambda(this$0, $requestConfig, $$this$request) {
25974
26432
  return function ($this$url, it) {
@@ -27460,12 +27918,12 @@ function fileBody(_this__u8e3s4, serializer, raw, $completion) {
27460
27918
  function Base64ByteArray$_init_$ref_e13pdp() {
27461
27919
  return constructCallableReference(function (p0) {
27462
27920
  return new Base64ByteArray(p0);
27463
- }, 1, 0, 116, '<init>');
27921
+ }, 1, 0, 117, '<init>');
27464
27922
  }
27465
27923
  function OctetByteArray$_init_$ref_xqpg5f() {
27466
27924
  return constructCallableReference(function (p0) {
27467
27925
  return new OctetByteArray(p0);
27468
- }, 1, 0, 117, '<init>');
27926
+ }, 1, 0, 118, '<init>');
27469
27927
  }
27470
27928
  function $decodeBodyCOROUTINE$(_this__u8e3s4, type, resultContinuation) {
27471
27929
  CoroutineImpl.call(this, resultContinuation);
@@ -78813,6 +79271,7 @@ Companion_instance_2 = new Companion();
78813
79271
  NoOpFingerprinter_instance = new NoOpFingerprinter();
78814
79272
  NoOpPushTokenProvider_instance = new NoOpPushTokenProvider();
78815
79273
  Companion_instance_3 = new Companion_0();
79274
+ Key_instance = new Key();
78816
79275
  Companion_instance_7 = new Companion_4();
78817
79276
  SoliboOpenTelemetry_instance = new SoliboOpenTelemetry();
78818
79277
  decodesJsonFromBytes = false;