@tuprolog/arg2p 0.10.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.
package/2p-utils.js ADDED
@@ -0,0 +1,1410 @@
1
+ (function (root, factory) {
2
+ if (typeof define === 'function' && define.amd)
3
+ define(['exports', './kotlin-kotlin-stdlib.js', './kt-math.js'], factory);
4
+ else if (typeof exports === 'object')
5
+ factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./kt-math.js'));
6
+ else {
7
+ if (typeof this['kotlin-kotlin-stdlib'] === 'undefined') {
8
+ throw new Error("Error loading module '2p-utils'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to '2p-utils'.");
9
+ }
10
+ if (typeof this['kt-math'] === 'undefined') {
11
+ throw new Error("Error loading module '2p-utils'. Its dependency 'kt-math' was not found. Please, check whether 'kt-math' is loaded prior to '2p-utils'.");
12
+ }
13
+ root['2p-utils'] = factory(typeof this['2p-utils'] === 'undefined' ? {} : this['2p-utils'], this['kotlin-kotlin-stdlib'], this['kt-math']);
14
+ }
15
+ }(this, function (_, kotlin_kotlin, kotlin_io_github_gciatto_kt_math) {
16
+ 'use strict';
17
+ //region block: imports
18
+ var imul = Math.imul;
19
+ var protoOf = kotlin_kotlin.$_$.b6;
20
+ var objectMeta = kotlin_kotlin.$_$.a6;
21
+ var setMetadataFor = kotlin_kotlin.$_$.c6;
22
+ var Unit_instance = kotlin_kotlin.$_$.s1;
23
+ var interfaceMeta = kotlin_kotlin.$_$.o5;
24
+ var THROW_CCE = kotlin_kotlin.$_$.y9;
25
+ var isInterface = kotlin_kotlin.$_$.r5;
26
+ var Iterable = kotlin_kotlin.$_$.u1;
27
+ var classMeta = kotlin_kotlin.$_$.f5;
28
+ var VOID = kotlin_kotlin.$_$.d;
29
+ var Sequence = kotlin_kotlin.$_$.y6;
30
+ var arrayIterator = kotlin_kotlin.$_$.z4;
31
+ var Comparable = kotlin_kotlin.$_$.n9;
32
+ var sequence = kotlin_kotlin.$_$.c8;
33
+ var hashCode = kotlin_kotlin.$_$.n5;
34
+ var asIterable = kotlin_kotlin.$_$.a7;
35
+ var toList = kotlin_kotlin.$_$.j8;
36
+ var asSequence = kotlin_kotlin.$_$.h2;
37
+ var asIterable_0 = kotlin_kotlin.$_$.c2;
38
+ var collectionSizeOrDefault = kotlin_kotlin.$_$.j2;
39
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.e;
40
+ var IntCompanionObject_instance = kotlin_kotlin.$_$.m1;
41
+ var IntRange = kotlin_kotlin.$_$.r6;
42
+ var zip = kotlin_kotlin.$_$.n8;
43
+ var map = kotlin_kotlin.$_$.v7;
44
+ var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.s;
45
+ var List = kotlin_kotlin.$_$.v1;
46
+ var CoroutineImpl = kotlin_kotlin.$_$.x4;
47
+ var SequenceScope = kotlin_kotlin.$_$.x6;
48
+ var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.w4;
49
+ var withIndex = kotlin_kotlin.$_$.m8;
50
+ var equals = kotlin_kotlin.$_$.i5;
51
+ var ensureNotNull = kotlin_kotlin.$_$.ca;
52
+ var filterNot = kotlin_kotlin.$_$.i7;
53
+ var toMutableList = kotlin_kotlin.$_$.k8;
54
+ var minWithOrNull = kotlin_kotlin.$_$.w7;
55
+ var Regex_init_$Create$ = kotlin_kotlin.$_$.k;
56
+ var toString = kotlin_kotlin.$_$.g6;
57
+ var Companion_getInstance = kotlin_io_github_gciatto_kt_math.$_$.e;
58
+ var Companion_getInstance_0 = kotlin_io_github_gciatto_kt_math.$_$.d;
59
+ var Map = kotlin_kotlin.$_$.x1;
60
+ var lazy = kotlin_kotlin.$_$.ea;
61
+ var getKClassFromExpression = kotlin_kotlin.$_$.b;
62
+ var KProperty1 = kotlin_kotlin.$_$.w6;
63
+ var getPropertyCallableRef = kotlin_kotlin.$_$.l5;
64
+ var NoSuchElementException_init_$Create$ = kotlin_kotlin.$_$.y;
65
+ var first = kotlin_kotlin.$_$.y2;
66
+ var to = kotlin_kotlin.$_$.la;
67
+ var Pair = kotlin_kotlin.$_$.w9;
68
+ var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.h;
69
+ var joinToString = kotlin_kotlin.$_$.r7;
70
+ var mutableListOf = kotlin_kotlin.$_$.u3;
71
+ var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.f;
72
+ var addAll = kotlin_kotlin.$_$.z1;
73
+ //endregion
74
+ //region block: pre-declaration
75
+ setMetadataFor(Companion, 'Companion', objectMeta);
76
+ function getOrSet(key, valueGenerator) {
77
+ var got = this.x2(key);
78
+ var tmp;
79
+ if (got instanceof Some) {
80
+ tmp = got.sp_1;
81
+ } else {
82
+ // Inline function 'kotlin.also' call
83
+ var this_0 = valueGenerator();
84
+ // Inline function 'kotlin.contracts.contract' call
85
+ // Inline function 'it.unibo.tuprolog.utils.Cache.getOrSet.<anonymous>' call
86
+ this.qp(key, this_0);
87
+ tmp = this_0;
88
+ }
89
+ return tmp;
90
+ }
91
+ setMetadataFor(Cache, 'Cache', interfaceMeta);
92
+ setMetadataFor(Companion_0, 'Companion', objectMeta);
93
+ function ifValid(consumer) {
94
+ var tmp;
95
+ if (this.up()) {
96
+ var tmp_0 = Companion_instance_5;
97
+ // Inline function 'kotlin.let' call
98
+ // Inline function 'kotlin.contracts.contract' call
99
+ var tmp$ret$0 = consumer(this.r2());
100
+ tmp = tmp_0.yp(tmp$ret$0);
101
+ } else {
102
+ tmp = Companion_instance_5.xp();
103
+ }
104
+ return tmp;
105
+ }
106
+ setMetadataFor(Cached, 'Cached', interfaceMeta);
107
+ function castTo() {
108
+ return isInterface(this, Castable) ? this : THROW_CCE();
109
+ }
110
+ setMetadataFor(Castable, 'Castable', interfaceMeta);
111
+ setMetadataFor(Companion_1, 'Companion', objectMeta);
112
+ setMetadataFor(_no_name_provided__qut3iv, VOID, classMeta, VOID, [Iterable]);
113
+ setMetadataFor(_no_name_provided__qut3iv_0, VOID, classMeta, VOID, [Sequence]);
114
+ function asIterable_1() {
115
+ // Inline function 'kotlin.collections.Iterable' call
116
+ return new _no_name_provided__qut3iv(this);
117
+ }
118
+ function asSequence_0() {
119
+ // Inline function 'kotlin.sequences.Sequence' call
120
+ return new _no_name_provided__qut3iv_0(this);
121
+ }
122
+ setMetadataFor(Cursor, 'Cursor', interfaceMeta);
123
+ function component1() {
124
+ return this.hq();
125
+ }
126
+ function component2() {
127
+ return this.r2();
128
+ }
129
+ setMetadataFor(Indexed, 'Indexed', interfaceMeta);
130
+ setMetadataFor(Companion_2, 'Companion', objectMeta);
131
+ function compareTo(other) {
132
+ return this.hq() - other.hq() | 0;
133
+ }
134
+ setMetadataFor(IntIndexed, 'IntIndexed', interfaceMeta, VOID, [Indexed, Comparable]);
135
+ setMetadataFor(sam$kotlin_Comparator$0, 'sam$kotlin_Comparator$0', classMeta);
136
+ setMetadataFor(dropLast$slambda, 'dropLast$slambda', classMeta, CoroutineImpl, VOID, VOID, VOID, VOID, [1]);
137
+ setMetadataFor(insertAt$slambda, 'insertAt$slambda', classMeta, CoroutineImpl, VOID, VOID, VOID, VOID, [1]);
138
+ setMetadataFor(sam$kotlin_Comparator$0_0, 'sam$kotlin_Comparator$0', classMeta);
139
+ setMetadataFor(merge$slambda, 'merge$slambda', classMeta, CoroutineImpl, VOID, VOID, VOID, VOID, [1]);
140
+ setMetadataFor(Companion_3, 'Companion', objectMeta);
141
+ function compareTo_0(other) {
142
+ return this.hq().ma(other.hq()).b9();
143
+ }
144
+ setMetadataFor(LongIndexed, 'LongIndexed', interfaceMeta, VOID, [Indexed, Comparable]);
145
+ setMetadataFor(Companion_4, 'Companion', objectMeta);
146
+ setMetadataFor(NumberTypeTester, 'NumberTypeTester', classMeta, VOID, VOID, NumberTypeTester);
147
+ setMetadataFor(Companion_5, 'Companion', objectMeta);
148
+ setMetadataFor(Optional, 'Optional', classMeta);
149
+ setMetadataFor(Some, 'Some', classMeta, Optional);
150
+ setMetadataFor(None, 'None', objectMeta, Optional);
151
+ function getTag(name) {
152
+ var tmp = this.us().x2(name);
153
+ return (tmp == null ? true : !(tmp == null)) ? tmp : THROW_CCE();
154
+ }
155
+ function containsTag(name) {
156
+ // Inline function 'kotlin.collections.contains' call
157
+ // Inline function 'kotlin.collections.containsKey' call
158
+ var this_0 = this.us();
159
+ return (isInterface(this_0, Map) ? this_0 : THROW_CCE()).u2(name);
160
+ }
161
+ setMetadataFor(Taggable, 'Taggable', interfaceMeta);
162
+ setMetadataFor(Companion_6, 'Companion', objectMeta);
163
+ setMetadataFor(AbstractCursor$iterator$1, VOID, classMeta);
164
+ setMetadataFor(AbstractCursor, 'AbstractCursor', classMeta, VOID, [Cursor]);
165
+ setMetadataFor(CachedImpl, 'CachedImpl', classMeta, VOID, [Cached]);
166
+ setMetadataFor(ConjunctionCursor, 'ConjunctionCursor', classMeta, AbstractCursor);
167
+ setMetadataFor(EmptyCursor, 'EmptyCursor', objectMeta, AbstractCursor);
168
+ setMetadataFor(IntIndexedImpl, 'IntIndexedImpl', classMeta, VOID, [IntIndexed]);
169
+ setMetadataFor(LazyCursor, 'LazyCursor', classMeta, AbstractCursor);
170
+ setMetadataFor(LongIndexedImpl, 'LongIndexedImpl', classMeta, VOID, [LongIndexed]);
171
+ setMetadataFor(MapperCursor, 'MapperCursor', classMeta, AbstractCursor);
172
+ setMetadataFor(NonLastCursor, 'NonLastCursor', classMeta, AbstractCursor);
173
+ setMetadataFor(SimpleLRUCache, 'SimpleLRUCache', classMeta, VOID, [Cache]);
174
+ setMetadataFor(ValueCursor, 'ValueCursor', classMeta, AbstractCursor);
175
+ //endregion
176
+ function Companion() {
177
+ }
178
+ protoOf(Companion).pp = function (capacity) {
179
+ return new SimpleLRUCache(capacity);
180
+ };
181
+ var Companion_instance;
182
+ function Companion_getInstance_1() {
183
+ return Companion_instance;
184
+ }
185
+ function Cache() {
186
+ }
187
+ function Companion_0() {
188
+ }
189
+ protoOf(Companion_0).tp = function (generator) {
190
+ return new CachedImpl(generator);
191
+ };
192
+ var Companion_instance_0;
193
+ function Companion_getInstance_2() {
194
+ return Companion_instance_0;
195
+ }
196
+ function Cached() {
197
+ }
198
+ function Castable() {
199
+ }
200
+ function Companion_1() {
201
+ }
202
+ protoOf(Companion_1).of = function (iterator) {
203
+ return toCursor(iterator);
204
+ };
205
+ protoOf(Companion_1).ofSequence = function (sequence) {
206
+ return cursor_0(sequence);
207
+ };
208
+ protoOf(Companion_1).empty = function () {
209
+ return EmptyCursor_getInstance();
210
+ };
211
+ var Companion_instance_1;
212
+ function Companion_getInstance_3() {
213
+ return Companion_instance_1;
214
+ }
215
+ function _no_name_provided__qut3iv(this$0) {
216
+ this.aq_1 = this$0;
217
+ }
218
+ protoOf(_no_name_provided__qut3iv).r = function () {
219
+ // Inline function 'it.unibo.tuprolog.utils.Cursor.asIterable.<anonymous>' call
220
+ return this.aq_1.iterator();
221
+ };
222
+ function _no_name_provided__qut3iv_0(this$0) {
223
+ this.bq_1 = this$0;
224
+ }
225
+ protoOf(_no_name_provided__qut3iv_0).r = function () {
226
+ // Inline function 'it.unibo.tuprolog.utils.Cursor.asSequence.<anonymous>' call
227
+ return this.bq_1.iterator();
228
+ };
229
+ function Cursor() {
230
+ }
231
+ function cursor(_this__u8e3s4) {
232
+ return toCursor(_this__u8e3s4.r());
233
+ }
234
+ function cursor_0(_this__u8e3s4) {
235
+ return toCursor(_this__u8e3s4.r());
236
+ }
237
+ function cursor_1(_this__u8e3s4) {
238
+ return toCursor(arrayIterator(_this__u8e3s4));
239
+ }
240
+ function plus(_this__u8e3s4, other) {
241
+ return other.eq() ? new ConjunctionCursor(_this__u8e3s4, forceCast(other)) : _this__u8e3s4.eq() ? _this__u8e3s4 : EmptyCursor_getInstance();
242
+ }
243
+ function toCursor(_this__u8e3s4) {
244
+ return Companion_instance_6.gq(_this__u8e3s4);
245
+ }
246
+ function Indexed() {
247
+ }
248
+ function Companion_2() {
249
+ }
250
+ protoOf(Companion_2).iq = function (index, value) {
251
+ return new IntIndexedImpl(index, value);
252
+ };
253
+ var Companion_instance_2;
254
+ function Companion_getInstance_4() {
255
+ return Companion_instance_2;
256
+ }
257
+ function IntIndexed() {
258
+ }
259
+ function dropLast(_this__u8e3s4) {
260
+ return sequence(dropLast$slambda_0(_this__u8e3s4, null));
261
+ }
262
+ function itemWiseHashCode(iterable) {
263
+ var hash = 13;
264
+ var i = iterable.r();
265
+ while (i.s()) {
266
+ var tmp = imul(31, hash);
267
+ var tmp0_safe_receiver = i.u();
268
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : hashCode(tmp0_safe_receiver);
269
+ hash = tmp + (tmp1_elvis_lhs == null ? 0 : tmp1_elvis_lhs) | 0;
270
+ }
271
+ return hash;
272
+ }
273
+ function insertAt(_this__u8e3s4, index, item, items) {
274
+ return sequence(insertAt$slambda_0(_this__u8e3s4, index, item, items, null));
275
+ }
276
+ function itemWiseHashCode_0(sequence) {
277
+ return itemWiseHashCode(asIterable(sequence));
278
+ }
279
+ function itemWiseEquals(sequence1, sequence2, comparator) {
280
+ return itemWiseEquals_0(asIterable(sequence1), asIterable(sequence2), comparator);
281
+ }
282
+ function cached(_this__u8e3s4) {
283
+ return cursor_0(_this__u8e3s4).asSequence();
284
+ }
285
+ function buffered(_this__u8e3s4) {
286
+ return asSequence(toList(_this__u8e3s4));
287
+ }
288
+ function itemWiseEquals_0(iterable1, iterable2, comparator) {
289
+ var i = iterable1.r();
290
+ var j = iterable2.r();
291
+ while (i.s() ? j.s() : false) {
292
+ var a = i.u();
293
+ var b = j.u();
294
+ if (!comparator(a, b)) {
295
+ return false;
296
+ }
297
+ }
298
+ return i.s() === j.s();
299
+ }
300
+ function itemWiseHashCode_1(items) {
301
+ return itemWiseHashCode(asIterable_0(items));
302
+ }
303
+ function itemWiseEquals_1(iterable1, iterable2) {
304
+ return itemWiseEquals_0(iterable1, iterable2, itemWiseEquals$lambda);
305
+ }
306
+ function mergeSequences(iterables, comparator) {
307
+ var tmp = new sam$kotlin_Comparator$0(comparator);
308
+ // Inline function 'kotlin.collections.map' call
309
+ // Inline function 'kotlin.collections.mapTo' call
310
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(iterables, 10));
311
+ var tmp0_iterator = iterables.r();
312
+ while (tmp0_iterator.s()) {
313
+ var item = tmp0_iterator.u();
314
+ // Inline function 'it.unibo.tuprolog.utils.mergeSequences.<anonymous>' call
315
+ var tmp$ret$0 = asIterable(item);
316
+ destination.o(tmp$ret$0);
317
+ }
318
+ return merge(tmp, destination);
319
+ }
320
+ function merge(comparator, iterables) {
321
+ return sequence(merge$slambda_0(iterables, comparator, null));
322
+ }
323
+ function indexed(_this__u8e3s4) {
324
+ var tmp = asSequence(new IntRange(0, IntCompanionObject_instance.MAX_VALUE));
325
+ return zip(_this__u8e3s4, tmp, indexed$lambda);
326
+ }
327
+ function assertItemsAreNotNull(_this__u8e3s4) {
328
+ return asIterable(assertItemsAreNotNull_0(asSequence(_this__u8e3s4)));
329
+ }
330
+ function assertItemsAreNotNull_0(_this__u8e3s4) {
331
+ var tmp = indexed(_this__u8e3s4);
332
+ return map(tmp, assertItemsAreNotNull$lambda);
333
+ }
334
+ function assertItemsAreNotNull_1(_this__u8e3s4) {
335
+ var iterator = _this__u8e3s4.r();
336
+ var index = 0;
337
+ while (iterator.s()) {
338
+ var index_0 = index;
339
+ index = index + 1 | 0;
340
+ var value = iterator.u();
341
+ if (value == null) {
342
+ throw IllegalArgumentException_init_$Create$('Item at index ' + index_0 + ' is null');
343
+ }
344
+ }
345
+ return isInterface(_this__u8e3s4, List) ? _this__u8e3s4 : THROW_CCE();
346
+ }
347
+ function sam$kotlin_Comparator$0(function_0) {
348
+ this.kq_1 = function_0;
349
+ }
350
+ protoOf(sam$kotlin_Comparator$0).o8 = function (a, b) {
351
+ return this.kq_1(a, b);
352
+ };
353
+ protoOf(sam$kotlin_Comparator$0).compare = function (a, b) {
354
+ return this.o8(a, b);
355
+ };
356
+ function dropLast$slambda($this_dropLast, resultContinuation) {
357
+ this.tq_1 = $this_dropLast;
358
+ CoroutineImpl.call(this, resultContinuation);
359
+ }
360
+ protoOf(dropLast$slambda).xq = function ($this$sequence, $completion) {
361
+ var tmp = this.yq($this$sequence, $completion);
362
+ tmp.hb_1 = Unit_instance;
363
+ tmp.ib_1 = null;
364
+ return tmp.qb();
365
+ };
366
+ protoOf(dropLast$slambda).dc = function (p1, $completion) {
367
+ return this.xq(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $completion);
368
+ };
369
+ protoOf(dropLast$slambda).qb = function () {
370
+ var suspendResult = this.hb_1;
371
+ $sm: do
372
+ try {
373
+ var tmp = this.fb_1;
374
+ switch (tmp) {
375
+ case 0:
376
+ this.gb_1 = 5;
377
+ this.vq_1 = this.tq_1.r();
378
+ this.fb_1 = 1;
379
+ continue $sm;
380
+ case 1:
381
+ if (!this.vq_1.s()) {
382
+ this.fb_1 = 4;
383
+ continue $sm;
384
+ }
385
+
386
+ this.wq_1 = this.vq_1.u();
387
+ if (this.vq_1.s()) {
388
+ this.fb_1 = 2;
389
+ suspendResult = this.uq_1.wd(this.wq_1, this);
390
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
391
+ return suspendResult;
392
+ }
393
+ continue $sm;
394
+ } else {
395
+ this.fb_1 = 3;
396
+ continue $sm;
397
+ }
398
+
399
+ case 2:
400
+ this.fb_1 = 3;
401
+ continue $sm;
402
+ case 3:
403
+ this.fb_1 = 1;
404
+ continue $sm;
405
+ case 4:
406
+ return Unit_instance;
407
+ case 5:
408
+ throw this.ib_1;
409
+ }
410
+ } catch ($p) {
411
+ var e = $p;
412
+ if (this.gb_1 === 5) {
413
+ throw e;
414
+ } else {
415
+ this.fb_1 = this.gb_1;
416
+ this.ib_1 = e;
417
+ }
418
+ }
419
+ while (true);
420
+ };
421
+ protoOf(dropLast$slambda).yq = function ($this$sequence, completion) {
422
+ var i = new dropLast$slambda(this.tq_1, completion);
423
+ i.uq_1 = $this$sequence;
424
+ return i;
425
+ };
426
+ function dropLast$slambda_0($this_dropLast, resultContinuation) {
427
+ var i = new dropLast$slambda($this_dropLast, resultContinuation);
428
+ var l = function ($this$sequence, $completion) {
429
+ return i.xq($this$sequence, $completion);
430
+ };
431
+ l.$arity = 1;
432
+ return l;
433
+ }
434
+ function insertAt$slambda($this_insertAt, $index, $item, $items, resultContinuation) {
435
+ this.hr_1 = $this_insertAt;
436
+ this.ir_1 = $index;
437
+ this.jr_1 = $item;
438
+ this.kr_1 = $items;
439
+ CoroutineImpl.call(this, resultContinuation);
440
+ }
441
+ protoOf(insertAt$slambda).xq = function ($this$sequence, $completion) {
442
+ var tmp = this.yq($this$sequence, $completion);
443
+ tmp.hb_1 = Unit_instance;
444
+ tmp.ib_1 = null;
445
+ return tmp.qb();
446
+ };
447
+ protoOf(insertAt$slambda).dc = function (p1, $completion) {
448
+ return this.xq(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $completion);
449
+ };
450
+ protoOf(insertAt$slambda).qb = function () {
451
+ var suspendResult = this.hb_1;
452
+ $sm: do
453
+ try {
454
+ var tmp = this.fb_1;
455
+ switch (tmp) {
456
+ case 0:
457
+ this.gb_1 = 7;
458
+ this.mr_1 = asIterable(withIndex(this.hr_1)).r();
459
+ this.fb_1 = 1;
460
+ continue $sm;
461
+ case 1:
462
+ if (!this.mr_1.s()) {
463
+ this.fb_1 = 6;
464
+ continue $sm;
465
+ }
466
+
467
+ this.nr_1 = this.mr_1.u();
468
+ this.pr_1 = this.nr_1.gd();
469
+ this.qr_1 = this.nr_1.hd();
470
+ if (this.pr_1 === this.ir_1) {
471
+ this.fb_1 = 2;
472
+ suspendResult = this.lr_1.wd(this.jr_1, this);
473
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
474
+ return suspendResult;
475
+ }
476
+ continue $sm;
477
+ } else {
478
+ this.fb_1 = 4;
479
+ continue $sm;
480
+ }
481
+
482
+ case 2:
483
+ this.fb_1 = 3;
484
+ suspendResult = this.lr_1.yd(asIterable_0(this.kr_1), this);
485
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
486
+ return suspendResult;
487
+ }
488
+
489
+ continue $sm;
490
+ case 3:
491
+ this.fb_1 = 4;
492
+ continue $sm;
493
+ case 4:
494
+ this.fb_1 = 5;
495
+ suspendResult = this.lr_1.wd(this.qr_1, this);
496
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
497
+ return suspendResult;
498
+ }
499
+
500
+ continue $sm;
501
+ case 5:
502
+ this.fb_1 = 1;
503
+ continue $sm;
504
+ case 6:
505
+ return Unit_instance;
506
+ case 7:
507
+ throw this.ib_1;
508
+ }
509
+ } catch ($p) {
510
+ var e = $p;
511
+ if (this.gb_1 === 7) {
512
+ throw e;
513
+ } else {
514
+ this.fb_1 = this.gb_1;
515
+ this.ib_1 = e;
516
+ }
517
+ }
518
+ while (true);
519
+ };
520
+ protoOf(insertAt$slambda).yq = function ($this$sequence, completion) {
521
+ var i = new insertAt$slambda(this.hr_1, this.ir_1, this.jr_1, this.kr_1, completion);
522
+ i.lr_1 = $this$sequence;
523
+ return i;
524
+ };
525
+ function insertAt$slambda_0($this_insertAt, $index, $item, $items, resultContinuation) {
526
+ var i = new insertAt$slambda($this_insertAt, $index, $item, $items, resultContinuation);
527
+ var l = function ($this$sequence, $completion) {
528
+ return i.xq($this$sequence, $completion);
529
+ };
530
+ l.$arity = 1;
531
+ return l;
532
+ }
533
+ function itemWiseEquals$lambda(a, b) {
534
+ return equals(a, b);
535
+ }
536
+ function sam$kotlin_Comparator$0_0(function_0) {
537
+ this.rr_1 = function_0;
538
+ }
539
+ protoOf(sam$kotlin_Comparator$0_0).o8 = function (a, b) {
540
+ return this.rr_1(a, b);
541
+ };
542
+ protoOf(sam$kotlin_Comparator$0_0).compare = function (a, b) {
543
+ return this.o8(a, b);
544
+ };
545
+ function merge$slambda$lambda(it) {
546
+ return cursor(it);
547
+ }
548
+ function merge$slambda$lambda_0(it) {
549
+ return it.fq();
550
+ }
551
+ function merge$slambda$lambda_1(it) {
552
+ return ensureNotNull(it.dq());
553
+ }
554
+ function merge$slambda$lambda_2($comparator) {
555
+ return function (a, b) {
556
+ return $comparator.compare(a.r2(), b.r2());
557
+ };
558
+ }
559
+ function merge$slambda($iterables, $comparator, resultContinuation) {
560
+ this.as_1 = $iterables;
561
+ this.bs_1 = $comparator;
562
+ CoroutineImpl.call(this, resultContinuation);
563
+ }
564
+ protoOf(merge$slambda).xq = function ($this$sequence, $completion) {
565
+ var tmp = this.yq($this$sequence, $completion);
566
+ tmp.hb_1 = Unit_instance;
567
+ tmp.ib_1 = null;
568
+ return tmp.qb();
569
+ };
570
+ protoOf(merge$slambda).dc = function (p1, $completion) {
571
+ return this.xq(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $completion);
572
+ };
573
+ protoOf(merge$slambda).qb = function () {
574
+ var suspendResult = this.hb_1;
575
+ $sm: do
576
+ try {
577
+ var tmp = this.fb_1;
578
+ switch (tmp) {
579
+ case 0:
580
+ this.gb_1 = 3;
581
+ var tmp_0 = this;
582
+ var tmp_1 = asSequence(this.as_1);
583
+ var tmp_2 = map(tmp_1, merge$slambda$lambda);
584
+ tmp_0.ds_1 = toMutableList(filterNot(tmp_2, merge$slambda$lambda_0));
585
+ this.fb_1 = 1;
586
+ continue $sm;
587
+ case 1:
588
+ if (!!this.ds_1.z()) {
589
+ this.fb_1 = 4;
590
+ continue $sm;
591
+ }
592
+
593
+ var tmp_3 = this;
594
+ var tmp_4 = asSequence(this.ds_1);
595
+ var tmp_5 = indexed(map(tmp_4, merge$slambda$lambda_1));
596
+ var tmp_6 = merge$slambda$lambda_2(this.bs_1);
597
+ tmp_3.es_1 = ensureNotNull(minWithOrNull(tmp_5, new sam$kotlin_Comparator$0_0(tmp_6)));
598
+ this.fs_1 = this.es_1.gd();
599
+ this.gs_1 = this.es_1.hd();
600
+ this.fb_1 = 2;
601
+ suspendResult = this.cs_1.wd(this.gs_1, this);
602
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
603
+ return suspendResult;
604
+ }
605
+
606
+ continue $sm;
607
+ case 2:
608
+ var it = this.ds_1.d1(this.fs_1).cq();
609
+ if (it.fq()) {
610
+ this.ds_1.f1(this.fs_1);
611
+ } else {
612
+ this.ds_1.m(this.fs_1, it);
613
+ }
614
+
615
+ this.fb_1 = 1;
616
+ continue $sm;
617
+ case 3:
618
+ throw this.ib_1;
619
+ case 4:
620
+ return Unit_instance;
621
+ }
622
+ } catch ($p) {
623
+ var e = $p;
624
+ if (this.gb_1 === 3) {
625
+ throw e;
626
+ } else {
627
+ this.fb_1 = this.gb_1;
628
+ this.ib_1 = e;
629
+ }
630
+ }
631
+ while (true);
632
+ };
633
+ protoOf(merge$slambda).yq = function ($this$sequence, completion) {
634
+ var i = new merge$slambda(this.as_1, this.bs_1, completion);
635
+ i.cs_1 = $this$sequence;
636
+ return i;
637
+ };
638
+ function merge$slambda_0($iterables, $comparator, resultContinuation) {
639
+ var i = new merge$slambda($iterables, $comparator, resultContinuation);
640
+ var l = function ($this$sequence, $completion) {
641
+ return i.xq($this$sequence, $completion);
642
+ };
643
+ l.$arity = 1;
644
+ return l;
645
+ }
646
+ function indexed$lambda(it, i) {
647
+ return Companion_instance_2.iq(i, it);
648
+ }
649
+ function assertItemsAreNotNull$lambda(it) {
650
+ var value = it.r2();
651
+ var tmp;
652
+ if (value == null) {
653
+ throw IllegalArgumentException_init_$Create$('Item at index ' + it.hq() + ' is null');
654
+ } else {
655
+ tmp = value;
656
+ }
657
+ return tmp;
658
+ }
659
+ function Companion_3() {
660
+ }
661
+ protoOf(Companion_3).hs = function (index, value) {
662
+ return new LongIndexedImpl(index, value);
663
+ };
664
+ var Companion_instance_3;
665
+ function Companion_getInstance_5() {
666
+ return Companion_instance_3;
667
+ }
668
+ function LongIndexed() {
669
+ }
670
+ function Companion_4() {
671
+ Companion_instance_4 = this;
672
+ var tmp = this;
673
+ // Inline function 'kotlin.text.toRegex' call
674
+ tmp.js_1 = Regex_init_$Create$('[0-9]+');
675
+ }
676
+ var Companion_instance_4;
677
+ function Companion_getInstance_6() {
678
+ if (Companion_instance_4 == null)
679
+ new Companion_4();
680
+ return Companion_instance_4;
681
+ }
682
+ function _get_stringRepresentation__xuqjt9(_this__u8e3s4, $this) {
683
+ return $this.ks_1.rp(_this__u8e3s4, NumberTypeTester$_get_stringRepresentation_$lambda_7w0qtg(_this__u8e3s4));
684
+ }
685
+ function NumberTypeTester$_get_stringRepresentation_$lambda_7w0qtg($this_stringRepresentation) {
686
+ return function () {
687
+ return toString($this_stringRepresentation);
688
+ };
689
+ }
690
+ function NumberTypeTester() {
691
+ Companion_getInstance_6();
692
+ this.ks_1 = Companion_instance.pp(8);
693
+ }
694
+ protoOf(NumberTypeTester).ls = function (_this__u8e3s4) {
695
+ return Companion_getInstance_6().js_1.i8(_get_stringRepresentation__xuqjt9(_this__u8e3s4, this));
696
+ };
697
+ protoOf(NumberTypeTester).ms = function (_this__u8e3s4) {
698
+ return Companion_getInstance().parse(_get_stringRepresentation__xuqjt9(_this__u8e3s4, this));
699
+ };
700
+ protoOf(NumberTypeTester).ns = function (_this__u8e3s4) {
701
+ return Companion_getInstance_0().parse(_get_stringRepresentation__xuqjt9(_this__u8e3s4, this));
702
+ };
703
+ protoOf(NumberTypeTester).os = function (number) {
704
+ return this.ls(number);
705
+ };
706
+ protoOf(NumberTypeTester).ps = function (number) {
707
+ return this.ms(number);
708
+ };
709
+ protoOf(NumberTypeTester).qs = function (number) {
710
+ return this.ns(number);
711
+ };
712
+ function Companion_5() {
713
+ }
714
+ protoOf(Companion_5).rs = function (value) {
715
+ return new Some(value);
716
+ };
717
+ protoOf(Companion_5).yp = function (value) {
718
+ var tmp;
719
+ if (value == null) {
720
+ tmp = this.xp();
721
+ } else {
722
+ tmp = this.rs(value);
723
+ }
724
+ return tmp;
725
+ };
726
+ protoOf(Companion_5).xp = function () {
727
+ return None_getInstance();
728
+ };
729
+ var Companion_instance_5;
730
+ function Companion_getInstance_7() {
731
+ return Companion_instance_5;
732
+ }
733
+ function Some(value) {
734
+ Optional.call(this);
735
+ this.sp_1 = value;
736
+ }
737
+ protoOf(Some).r2 = function () {
738
+ return this.sp_1;
739
+ };
740
+ protoOf(Some).ss = function () {
741
+ return true;
742
+ };
743
+ protoOf(Some).toString = function () {
744
+ return 'Some(' + this.sp_1 + ')';
745
+ };
746
+ protoOf(Some).hashCode = function () {
747
+ return this.sp_1 == null ? 0 : hashCode(this.sp_1);
748
+ };
749
+ protoOf(Some).equals = function (other) {
750
+ if (this === other)
751
+ return true;
752
+ if (!(other instanceof Some))
753
+ return false;
754
+ var tmp0_other_with_cast = other instanceof Some ? other : THROW_CCE();
755
+ if (!equals(this.sp_1, tmp0_other_with_cast.sp_1))
756
+ return false;
757
+ return true;
758
+ };
759
+ function None() {
760
+ None_instance = this;
761
+ Optional.call(this);
762
+ }
763
+ protoOf(None).r2 = function () {
764
+ return null;
765
+ };
766
+ protoOf(None).ss = function () {
767
+ return false;
768
+ };
769
+ protoOf(None).toString = function () {
770
+ return 'None';
771
+ };
772
+ var None_instance;
773
+ function None_getInstance() {
774
+ if (None_instance == null)
775
+ new None();
776
+ return None_instance;
777
+ }
778
+ function Optional() {
779
+ }
780
+ protoOf(Optional).ts = function () {
781
+ return !this.ss();
782
+ };
783
+ function Taggable() {
784
+ }
785
+ function setTags(_this__u8e3s4, tags) {
786
+ var tmp = _this__u8e3s4.resetTags(tags);
787
+ return isInterface(tmp, Taggable) ? tmp : THROW_CCE();
788
+ }
789
+ function synchronizedOnSelf(_this__u8e3s4, action) {
790
+ return synchronizedOn(_this__u8e3s4, action);
791
+ }
792
+ function Companion_6() {
793
+ }
794
+ protoOf(Companion_6).gq = function (source) {
795
+ var tmp;
796
+ if (source.s()) {
797
+ tmp = new LazyCursor(source);
798
+ } else {
799
+ tmp = EmptyCursor_getInstance();
800
+ }
801
+ return tmp;
802
+ };
803
+ var Companion_instance_6;
804
+ function Companion_getInstance_8() {
805
+ return Companion_instance_6;
806
+ }
807
+ function AbstractCursor$iterator$1(this$0) {
808
+ this.vs_1 = this$0;
809
+ }
810
+ protoOf(AbstractCursor$iterator$1).s = function () {
811
+ return !this.vs_1.fq();
812
+ };
813
+ protoOf(AbstractCursor$iterator$1).u = function () {
814
+ var result = this.vs_1.dq();
815
+ this.vs_1 = this.vs_1.cq();
816
+ return ensureNotNull(result);
817
+ };
818
+ function AbstractCursor() {
819
+ }
820
+ protoOf(AbstractCursor).toString = function () {
821
+ return this.fq() ? '[]' : !this.eq() ? '[' + this.dq() + ']' : '[' + this.dq() + ', ...]';
822
+ };
823
+ protoOf(AbstractCursor).r = function () {
824
+ return new AbstractCursor$iterator$1(this);
825
+ };
826
+ protoOf(AbstractCursor).iterator = function () {
827
+ return this.r();
828
+ };
829
+ protoOf(AbstractCursor).ws = function () {
830
+ return false;
831
+ };
832
+ protoOf(AbstractCursor).xs = function (mapper) {
833
+ return new MapperCursor(this, mapper);
834
+ };
835
+ protoOf(AbstractCursor).map = function (mapper) {
836
+ return this.xs(mapper);
837
+ };
838
+ function CachedImpl(generator) {
839
+ this.ys_1 = generator;
840
+ this.zs_1 = Companion_instance_5.xp();
841
+ }
842
+ protoOf(CachedImpl).up = function () {
843
+ return this.zs_1.ss();
844
+ };
845
+ protoOf(CachedImpl).at = function () {
846
+ return this.zs_1.ts();
847
+ };
848
+ protoOf(CachedImpl).r2 = function () {
849
+ this.bt();
850
+ return ensureNotNull(this.zs_1.r2());
851
+ };
852
+ protoOf(CachedImpl).bt = function () {
853
+ if (this.at()) {
854
+ this.zs_1 = Companion_instance_5.rs(this.ys_1());
855
+ }
856
+ };
857
+ protoOf(CachedImpl).vp = function () {
858
+ this.zs_1 = Companion_instance_5.xp();
859
+ };
860
+ protoOf(CachedImpl).toString = function () {
861
+ return 'CachedImpl(generator=' + this.ys_1 + ')';
862
+ };
863
+ protoOf(CachedImpl).hashCode = function () {
864
+ return hashCode(this.ys_1);
865
+ };
866
+ protoOf(CachedImpl).equals = function (other) {
867
+ if (this === other)
868
+ return true;
869
+ if (!(other instanceof CachedImpl))
870
+ return false;
871
+ var tmp0_other_with_cast = other instanceof CachedImpl ? other : THROW_CCE();
872
+ if (!equals(this.ys_1, tmp0_other_with_cast.ys_1))
873
+ return false;
874
+ return true;
875
+ };
876
+ function ConjunctionCursor$next$delegate$lambda(this$0) {
877
+ return function () {
878
+ return this$0.ct_1.eq() ? new ConjunctionCursor(this$0.ct_1.cq(), this$0.dt_1) : this$0.dt_1.ws() ? this$0.dt_1.cq() : this$0.dt_1;
879
+ };
880
+ }
881
+ function ConjunctionCursor(first, second) {
882
+ AbstractCursor.call(this);
883
+ this.ct_1 = first;
884
+ this.dt_1 = second;
885
+ var tmp = this;
886
+ tmp.et_1 = lazy(ConjunctionCursor$next$delegate$lambda(this));
887
+ }
888
+ protoOf(ConjunctionCursor).fq = function () {
889
+ return this.ct_1.fq() ? this.dt_1.fq() : false;
890
+ };
891
+ protoOf(ConjunctionCursor).cq = function () {
892
+ // Inline function 'kotlin.getValue' call
893
+ var this_0 = this.et_1;
894
+ next$factory();
895
+ return this_0.r2();
896
+ };
897
+ protoOf(ConjunctionCursor).dq = function () {
898
+ return this.ct_1.eq() ? this.ct_1.dq() : this.dt_1.dq();
899
+ };
900
+ protoOf(ConjunctionCursor).eq = function () {
901
+ return this.ct_1.eq() ? true : this.dt_1.eq();
902
+ };
903
+ protoOf(ConjunctionCursor).equals = function (other) {
904
+ if (this === other)
905
+ return true;
906
+ if (other == null ? true : !getKClassFromExpression(this).equals(getKClassFromExpression(other)))
907
+ return false;
908
+ if (!(other instanceof ConjunctionCursor))
909
+ THROW_CCE();
910
+ if (!equals(this.ct_1, other.ct_1))
911
+ return false;
912
+ if (!equals(this.dt_1, other.dt_1))
913
+ return false;
914
+ return true;
915
+ };
916
+ protoOf(ConjunctionCursor).hashCode = function () {
917
+ var result = hashCode(this.ct_1);
918
+ result = imul(31, result) + hashCode(this.dt_1) | 0;
919
+ return result;
920
+ };
921
+ function next$factory() {
922
+ return getPropertyCallableRef('next', 1, KProperty1, function (receiver) {
923
+ return receiver.cq();
924
+ }, null);
925
+ }
926
+ function EmptyCursor() {
927
+ EmptyCursor_instance = this;
928
+ AbstractCursor.call(this);
929
+ }
930
+ protoOf(EmptyCursor).cq = function () {
931
+ throw NoSuchElementException_init_$Create$();
932
+ };
933
+ protoOf(EmptyCursor).dq = function () {
934
+ return null;
935
+ };
936
+ protoOf(EmptyCursor).eq = function () {
937
+ return false;
938
+ };
939
+ protoOf(EmptyCursor).fq = function () {
940
+ return true;
941
+ };
942
+ protoOf(EmptyCursor).toString = function () {
943
+ return protoOf(AbstractCursor).toString.call(this);
944
+ };
945
+ protoOf(EmptyCursor).ft = function (mapper) {
946
+ return this;
947
+ };
948
+ protoOf(EmptyCursor).map = function (mapper) {
949
+ return this.ft(mapper);
950
+ };
951
+ protoOf(EmptyCursor).xs = function (mapper) {
952
+ return this.ft(mapper);
953
+ };
954
+ var EmptyCursor_instance;
955
+ function EmptyCursor_getInstance() {
956
+ if (EmptyCursor_instance == null)
957
+ new EmptyCursor();
958
+ return EmptyCursor_instance;
959
+ }
960
+ function IntIndexedImpl(index, value) {
961
+ this.gt_1 = index;
962
+ this.ht_1 = value;
963
+ }
964
+ protoOf(IntIndexedImpl).hq = function () {
965
+ return this.gt_1;
966
+ };
967
+ protoOf(IntIndexedImpl).r2 = function () {
968
+ return this.ht_1;
969
+ };
970
+ protoOf(IntIndexedImpl).gd = function () {
971
+ return this.gt_1;
972
+ };
973
+ protoOf(IntIndexedImpl).hd = function () {
974
+ return this.ht_1;
975
+ };
976
+ protoOf(IntIndexedImpl).toString = function () {
977
+ return 'IntIndexedImpl(index=' + this.gt_1 + ', value=' + this.ht_1 + ')';
978
+ };
979
+ protoOf(IntIndexedImpl).hashCode = function () {
980
+ var result = this.gt_1;
981
+ result = imul(result, 31) + (this.ht_1 == null ? 0 : hashCode(this.ht_1)) | 0;
982
+ return result;
983
+ };
984
+ protoOf(IntIndexedImpl).equals = function (other) {
985
+ if (this === other)
986
+ return true;
987
+ if (!(other instanceof IntIndexedImpl))
988
+ return false;
989
+ var tmp0_other_with_cast = other instanceof IntIndexedImpl ? other : THROW_CCE();
990
+ if (!(this.gt_1 === tmp0_other_with_cast.gt_1))
991
+ return false;
992
+ if (!equals(this.ht_1, tmp0_other_with_cast.ht_1))
993
+ return false;
994
+ return true;
995
+ };
996
+ protoOf(IntIndexedImpl).d = function (other) {
997
+ return this.jq((!(other == null) ? isInterface(other, IntIndexed) : false) ? other : THROW_CCE());
998
+ };
999
+ function _get_wrapped__s2ip8($this) {
1000
+ // Inline function 'kotlin.getValue' call
1001
+ var this_0 = $this.jt_1;
1002
+ wrapped$factory();
1003
+ return this_0.r2();
1004
+ }
1005
+ function LazyCursor$wrapped$delegate$lambda(this$0) {
1006
+ return function () {
1007
+ return new NonLastCursor(this$0.it_1);
1008
+ };
1009
+ }
1010
+ function LazyCursor(delegate) {
1011
+ AbstractCursor.call(this);
1012
+ this.it_1 = delegate;
1013
+ var tmp = this;
1014
+ tmp.jt_1 = lazy(LazyCursor$wrapped$delegate$lambda(this));
1015
+ }
1016
+ protoOf(LazyCursor).ws = function () {
1017
+ return true;
1018
+ };
1019
+ protoOf(LazyCursor).cq = function () {
1020
+ return _get_wrapped__s2ip8(this).cq();
1021
+ };
1022
+ protoOf(LazyCursor).dq = function () {
1023
+ return _get_wrapped__s2ip8(this).dq();
1024
+ };
1025
+ protoOf(LazyCursor).eq = function () {
1026
+ return true;
1027
+ };
1028
+ protoOf(LazyCursor).fq = function () {
1029
+ return false;
1030
+ };
1031
+ protoOf(LazyCursor).toString = function () {
1032
+ return protoOf(AbstractCursor).toString.call(this);
1033
+ };
1034
+ protoOf(LazyCursor).r = function () {
1035
+ return _get_wrapped__s2ip8(this).r();
1036
+ };
1037
+ protoOf(LazyCursor).iterator = function () {
1038
+ return this.r();
1039
+ };
1040
+ protoOf(LazyCursor).hashCode = function () {
1041
+ return hashCode(this.it_1);
1042
+ };
1043
+ protoOf(LazyCursor).equals = function (other) {
1044
+ if (this === other)
1045
+ return true;
1046
+ if (!(other instanceof LazyCursor))
1047
+ return false;
1048
+ var tmp0_other_with_cast = other instanceof LazyCursor ? other : THROW_CCE();
1049
+ if (!equals(this.it_1, tmp0_other_with_cast.it_1))
1050
+ return false;
1051
+ return true;
1052
+ };
1053
+ function wrapped$factory() {
1054
+ return getPropertyCallableRef('wrapped', 1, KProperty1, function (receiver) {
1055
+ return _get_wrapped__s2ip8(receiver);
1056
+ }, null);
1057
+ }
1058
+ function LongIndexedImpl(index, value) {
1059
+ this.kt_1 = index;
1060
+ this.lt_1 = value;
1061
+ }
1062
+ protoOf(LongIndexedImpl).hq = function () {
1063
+ return this.kt_1;
1064
+ };
1065
+ protoOf(LongIndexedImpl).r2 = function () {
1066
+ return this.lt_1;
1067
+ };
1068
+ protoOf(LongIndexedImpl).is = function (other) {
1069
+ return this.kt_1.ma(other.hq()).b9();
1070
+ };
1071
+ protoOf(LongIndexedImpl).d = function (other) {
1072
+ return this.is((!(other == null) ? isInterface(other, LongIndexed) : false) ? other : THROW_CCE());
1073
+ };
1074
+ protoOf(LongIndexedImpl).toString = function () {
1075
+ return 'LongIndexedImpl(index=' + this.kt_1.toString() + ', value=' + this.lt_1 + ')';
1076
+ };
1077
+ protoOf(LongIndexedImpl).hashCode = function () {
1078
+ var result = this.kt_1.hashCode();
1079
+ result = imul(result, 31) + (this.lt_1 == null ? 0 : hashCode(this.lt_1)) | 0;
1080
+ return result;
1081
+ };
1082
+ protoOf(LongIndexedImpl).equals = function (other) {
1083
+ if (this === other)
1084
+ return true;
1085
+ if (!(other instanceof LongIndexedImpl))
1086
+ return false;
1087
+ var tmp0_other_with_cast = other instanceof LongIndexedImpl ? other : THROW_CCE();
1088
+ if (!this.kt_1.equals(tmp0_other_with_cast.kt_1))
1089
+ return false;
1090
+ if (!equals(this.lt_1, tmp0_other_with_cast.lt_1))
1091
+ return false;
1092
+ return true;
1093
+ };
1094
+ function MapperCursor$current$delegate$lambda(this$0) {
1095
+ return function () {
1096
+ return this$0.nt_1(ensureNotNull(this$0.mt_1.dq()));
1097
+ };
1098
+ }
1099
+ function MapperCursor(wrapped, mapper) {
1100
+ AbstractCursor.call(this);
1101
+ this.mt_1 = wrapped;
1102
+ this.nt_1 = mapper;
1103
+ var tmp = this;
1104
+ tmp.ot_1 = lazy(MapperCursor$current$delegate$lambda(this));
1105
+ }
1106
+ protoOf(MapperCursor).cq = function () {
1107
+ return this.mt_1.cq().xs(this.nt_1);
1108
+ };
1109
+ protoOf(MapperCursor).dq = function () {
1110
+ // Inline function 'kotlin.getValue' call
1111
+ var this_0 = this.ot_1;
1112
+ current$factory();
1113
+ return this_0.r2();
1114
+ };
1115
+ protoOf(MapperCursor).eq = function () {
1116
+ return true;
1117
+ };
1118
+ protoOf(MapperCursor).fq = function () {
1119
+ return false;
1120
+ };
1121
+ protoOf(MapperCursor).equals = function (other) {
1122
+ if (this === other)
1123
+ return true;
1124
+ if (other == null ? true : !getKClassFromExpression(this).equals(getKClassFromExpression(other)))
1125
+ return false;
1126
+ if (!(other instanceof MapperCursor))
1127
+ THROW_CCE();
1128
+ if (!equals(this.mt_1, other.mt_1))
1129
+ return false;
1130
+ if (!equals(this.nt_1, other.nt_1))
1131
+ return false;
1132
+ return true;
1133
+ };
1134
+ protoOf(MapperCursor).hashCode = function () {
1135
+ var result = hashCode(this.mt_1);
1136
+ result = imul(31, result) + hashCode(this.nt_1) | 0;
1137
+ return result;
1138
+ };
1139
+ protoOf(MapperCursor).pt = function (mapper) {
1140
+ return new ValueCursor(mapper(this.dq()), this.cq().xs(mapper));
1141
+ };
1142
+ protoOf(MapperCursor).map = function (mapper) {
1143
+ return this.pt(mapper);
1144
+ };
1145
+ protoOf(MapperCursor).xs = function (mapper) {
1146
+ return this.pt(mapper);
1147
+ };
1148
+ function current$factory() {
1149
+ return getPropertyCallableRef('current', 1, KProperty1, function (receiver) {
1150
+ return receiver.dq();
1151
+ }, null);
1152
+ }
1153
+ function NonLastCursor$next$delegate$lambda($source, this$0) {
1154
+ return function () {
1155
+ // Inline function 'kotlin.also' call
1156
+ var this_0 = Companion_instance_6.gq($source);
1157
+ // Inline function 'kotlin.contracts.contract' call
1158
+ // Inline function 'it.unibo.tuprolog.utils.impl.NonLastCursor.next$delegate.<anonymous>.<anonymous>' call
1159
+ this$0.qt_1 = null;
1160
+ return this_0;
1161
+ };
1162
+ }
1163
+ function NonLastCursor(source) {
1164
+ AbstractCursor.call(this);
1165
+ this.qt_1 = source;
1166
+ var tmp = this;
1167
+ tmp.rt_1 = lazy(NonLastCursor$next$delegate$lambda(source, this));
1168
+ this.st_1 = source.u();
1169
+ }
1170
+ protoOf(NonLastCursor).cq = function () {
1171
+ // Inline function 'kotlin.getValue' call
1172
+ var this_0 = this.rt_1;
1173
+ next$factory_0();
1174
+ return this_0.r2();
1175
+ };
1176
+ protoOf(NonLastCursor).dq = function () {
1177
+ return this.st_1;
1178
+ };
1179
+ protoOf(NonLastCursor).eq = function () {
1180
+ return true;
1181
+ };
1182
+ protoOf(NonLastCursor).fq = function () {
1183
+ return false;
1184
+ };
1185
+ protoOf(NonLastCursor).toString = function () {
1186
+ return protoOf(AbstractCursor).toString.call(this);
1187
+ };
1188
+ function next$factory_0() {
1189
+ return getPropertyCallableRef('next', 1, KProperty1, function (receiver) {
1190
+ return receiver.cq();
1191
+ }, null);
1192
+ }
1193
+ function removeLeastRecent($this) {
1194
+ // Inline function 'kotlin.collections.asIterable' call
1195
+ var tmp$ret$0 = $this.ut_1.n2();
1196
+ var tmp0_container = first(tmp$ret$0);
1197
+ // Inline function 'kotlin.collections.component1' call
1198
+ var key = tmp0_container.q2();
1199
+ // Inline function 'kotlin.collections.component2' call
1200
+ var value = tmp0_container.r2();
1201
+ $this.ut_1.p2(key);
1202
+ return Companion_instance_5.rs(to(key, value));
1203
+ }
1204
+ function removeLeastRecentIfNecessary($this) {
1205
+ var tmp;
1206
+ if ($this.ut_1.l() >= $this.tt_1) {
1207
+ tmp = removeLeastRecent($this);
1208
+ } else {
1209
+ tmp = Companion_instance_5.xp();
1210
+ }
1211
+ return tmp;
1212
+ }
1213
+ function SimpleLRUCache$set$lambda(this$0, $key, $value) {
1214
+ return function () {
1215
+ var evicted = removeLeastRecentIfNecessary(this$0);
1216
+ var this_0 = this$0.ut_1;
1217
+ var key = $key;
1218
+ var value = $value;
1219
+ this_0.o2(key, value);
1220
+ return evicted;
1221
+ };
1222
+ }
1223
+ function SimpleLRUCache$get$lambda(this$0, $key) {
1224
+ return function () {
1225
+ var tmp;
1226
+ if (this$0.ut_1.u2($key)) {
1227
+ tmp = Companion_instance_5.yp(this$0.ut_1.x2($key));
1228
+ } else {
1229
+ tmp = Companion_instance_5.xp();
1230
+ }
1231
+ return tmp;
1232
+ };
1233
+ }
1234
+ function SimpleLRUCache$toSequence$lambda$lambda(it) {
1235
+ // Inline function 'kotlin.collections.toPair' call
1236
+ return new Pair(it.q2(), it.r2());
1237
+ }
1238
+ function SimpleLRUCache$toSequence$lambda(this$0) {
1239
+ return function () {
1240
+ var tmp = asSequence(this$0.ut_1.n2());
1241
+ return buffered(map(tmp, SimpleLRUCache$toSequence$lambda$lambda));
1242
+ };
1243
+ }
1244
+ function SimpleLRUCache$toString$lambda(it) {
1245
+ return '' + it.qd_1 + ' = ' + it.rd_1;
1246
+ }
1247
+ function SimpleLRUCache(capacity) {
1248
+ this.tt_1 = capacity;
1249
+ // Inline function 'kotlin.require' call
1250
+ // Inline function 'kotlin.contracts.contract' call
1251
+ // Inline function 'kotlin.require' call
1252
+ // Inline function 'kotlin.contracts.contract' call
1253
+ if (!(this.tt_1 > 0)) {
1254
+ // Inline function 'kotlin.require.<anonymous>' call
1255
+ var message = 'Failed requirement.';
1256
+ throw IllegalArgumentException_init_$Create$(toString(message));
1257
+ }
1258
+ this.ut_1 = LinkedHashMap_init_$Create$();
1259
+ }
1260
+ protoOf(SimpleLRUCache).qp = function (key, value) {
1261
+ return synchronizedOnSelf(this, SimpleLRUCache$set$lambda(this, key, value));
1262
+ };
1263
+ protoOf(SimpleLRUCache).x2 = function (key) {
1264
+ return synchronizedOnSelf(this, SimpleLRUCache$get$lambda(this, key));
1265
+ };
1266
+ protoOf(SimpleLRUCache).equals = function (other) {
1267
+ if (this === other)
1268
+ return true;
1269
+ if (other == null ? true : !getKClassFromExpression(this).equals(getKClassFromExpression(other)))
1270
+ return false;
1271
+ if (!(other instanceof SimpleLRUCache))
1272
+ THROW_CCE();
1273
+ if (!(this.tt_1 === other.tt_1))
1274
+ return false;
1275
+ if (!this.ut_1.equals(other.ut_1))
1276
+ return false;
1277
+ return true;
1278
+ };
1279
+ protoOf(SimpleLRUCache).hashCode = function () {
1280
+ var result = this.tt_1;
1281
+ result = imul(31, result) + this.ut_1.hashCode() | 0;
1282
+ return result;
1283
+ };
1284
+ protoOf(SimpleLRUCache).vt = function () {
1285
+ return synchronizedOnSelf(this, SimpleLRUCache$toSequence$lambda(this));
1286
+ };
1287
+ protoOf(SimpleLRUCache).toString = function () {
1288
+ var tmp = this.vt();
1289
+ return 'SimpleLRUCache(' + joinToString(map(tmp, SimpleLRUCache$toString$lambda), ', ') + ')';
1290
+ };
1291
+ function ValueCursor(current, next) {
1292
+ AbstractCursor.call(this);
1293
+ this.wt_1 = current;
1294
+ this.xt_1 = next;
1295
+ }
1296
+ protoOf(ValueCursor).dq = function () {
1297
+ return this.wt_1;
1298
+ };
1299
+ protoOf(ValueCursor).cq = function () {
1300
+ return this.xt_1;
1301
+ };
1302
+ protoOf(ValueCursor).eq = function () {
1303
+ return true;
1304
+ };
1305
+ protoOf(ValueCursor).fq = function () {
1306
+ return false;
1307
+ };
1308
+ function dequeOf(items) {
1309
+ return toMutableList(items);
1310
+ }
1311
+ function dequeOf_0(items) {
1312
+ return mutableListOf(items.slice());
1313
+ }
1314
+ function dequeOf_1(items) {
1315
+ // Inline function 'kotlin.also' call
1316
+ // Inline function 'kotlin.collections.mutableListOf' call
1317
+ var this_0 = ArrayList_init_$Create$_0();
1318
+ // Inline function 'kotlin.contracts.contract' call
1319
+ // Inline function 'it.unibo.tuprolog.utils.dequeOf.<anonymous>' call
1320
+ addAll(this_0, items);
1321
+ return this_0;
1322
+ }
1323
+ function takeFirst(_this__u8e3s4) {
1324
+ if (_this__u8e3s4.z())
1325
+ return null;
1326
+ var first = _this__u8e3s4.d1(0);
1327
+ _this__u8e3s4.f1(0);
1328
+ return first;
1329
+ }
1330
+ function addFirst(_this__u8e3s4, item) {
1331
+ _this__u8e3s4.q1(0, item);
1332
+ }
1333
+ function addFirst_0(_this__u8e3s4, items) {
1334
+ var i = _this__u8e3s4.z1();
1335
+ var tmp0_iterator = items.r();
1336
+ while (tmp0_iterator.s()) {
1337
+ var item = tmp0_iterator.u();
1338
+ i.r1(item);
1339
+ }
1340
+ }
1341
+ function synchronizedOn(obj, action) {
1342
+ return action();
1343
+ }
1344
+ function forceCast(_this__u8e3s4) {
1345
+ var it = _this__u8e3s4;
1346
+ return it;
1347
+ }
1348
+ //region block: post-declaration
1349
+ protoOf(AbstractCursor).asIterable = asIterable_1;
1350
+ protoOf(AbstractCursor).asSequence = asSequence_0;
1351
+ protoOf(CachedImpl).wp = ifValid;
1352
+ protoOf(IntIndexedImpl).jq = compareTo;
1353
+ protoOf(SimpleLRUCache).rp = getOrSet;
1354
+ //endregion
1355
+ //region block: init
1356
+ Companion_instance = new Companion();
1357
+ Companion_instance_0 = new Companion_0();
1358
+ Companion_instance_1 = new Companion_1();
1359
+ Companion_instance_2 = new Companion_2();
1360
+ Companion_instance_3 = new Companion_3();
1361
+ Companion_instance_5 = new Companion_5();
1362
+ Companion_instance_6 = new Companion_6();
1363
+ //endregion
1364
+ //region block: exports
1365
+ _.$_$ = _.$_$ || {};
1366
+ _.$_$.a = Companion_instance;
1367
+ _.$_$.b = Companion_instance_0;
1368
+ _.$_$.c = Companion_instance_1;
1369
+ _.$_$.d = Companion_instance_3;
1370
+ _.$_$.e = castTo;
1371
+ _.$_$.f = Castable;
1372
+ _.$_$.g = compareTo_0;
1373
+ _.$_$.h = LongIndexed;
1374
+ _.$_$.i = NumberTypeTester;
1375
+ _.$_$.j = Some;
1376
+ _.$_$.k = containsTag;
1377
+ _.$_$.l = getTag;
1378
+ _.$_$.m = Taggable;
1379
+ _.$_$.n = addFirst_0;
1380
+ _.$_$.o = addFirst;
1381
+ _.$_$.p = assertItemsAreNotNull_0;
1382
+ _.$_$.q = assertItemsAreNotNull;
1383
+ _.$_$.r = assertItemsAreNotNull_1;
1384
+ _.$_$.s = buffered;
1385
+ _.$_$.t = cached;
1386
+ _.$_$.u = cursor;
1387
+ _.$_$.v = cursor_0;
1388
+ _.$_$.w = cursor_1;
1389
+ _.$_$.x = dequeOf;
1390
+ _.$_$.y = dequeOf_1;
1391
+ _.$_$.z = dequeOf_0;
1392
+ _.$_$.a1 = dropLast;
1393
+ _.$_$.b1 = forceCast;
1394
+ _.$_$.c1 = insertAt;
1395
+ _.$_$.d1 = itemWiseEquals;
1396
+ _.$_$.e1 = itemWiseEquals_1;
1397
+ _.$_$.f1 = itemWiseHashCode;
1398
+ _.$_$.g1 = itemWiseHashCode_1;
1399
+ _.$_$.h1 = itemWiseHashCode_0;
1400
+ _.$_$.i1 = mergeSequences;
1401
+ _.$_$.j1 = plus;
1402
+ _.$_$.k1 = setTags;
1403
+ _.$_$.l1 = synchronizedOnSelf;
1404
+ _.$_$.m1 = synchronizedOn;
1405
+ _.$_$.n1 = takeFirst;
1406
+ //endregion
1407
+ return _;
1408
+ }));
1409
+
1410
+ //# sourceMappingURL=2p-utils.js.map