game_client_logic_deb 1.6.37 → 1.6.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/88b0986a7186d029-atomicfu-js-ir.js +26 -26
  2. package/88b0986a7186d029-atomicfu-js-ir.js.map +1 -1
  3. package/{KosiTypeSystem-kaverit.js → Kosi-Kaverit-kaverit.js} +115 -115
  4. package/Kosi-Kaverit-kaverit.js.map +1 -0
  5. package/{Kodein-kodein-di.js → Kosi-Kodein-kodein-di.js} +696 -605
  6. package/Kosi-Kodein-kodein-di.js.map +1 -0
  7. package/Kotlin-DateTime-library-kotlinx-datetime.js +798 -0
  8. package/Kotlin-DateTime-library-kotlinx-datetime.js.map +1 -0
  9. package/Logic_Debertz-core.js +3070 -2194
  10. package/Logic_Debertz-core.js.map +1 -1
  11. package/Logic_Debertz-engine.js +12385 -11536
  12. package/Logic_Debertz-engine.js.map +1 -1
  13. package/Logic_Debertz-game_client.d.ts +204 -41
  14. package/Logic_Debertz-game_client.js +4993 -4820
  15. package/Logic_Debertz-game_client.js.map +1 -1
  16. package/kotlin-kotlin-stdlib.js +2473 -2080
  17. package/kotlin-kotlin-stdlib.js.map +1 -1
  18. package/kotlinx-io-kotlinx-io-bytestring.js +15 -0
  19. package/kotlinx-io-kotlinx-io-bytestring.js.map +1 -0
  20. package/kotlinx-io-kotlinx-io-core.js +1191 -0
  21. package/kotlinx-io-kotlinx-io-core.js.map +1 -0
  22. package/{kotlinx-serialization-kotlinx-serialization-core-js-ir.js → kotlinx-serialization-kotlinx-serialization-core.js} +1977 -1969
  23. package/kotlinx-serialization-kotlinx-serialization-core.js.map +1 -0
  24. package/{kotlinx-serialization-kotlinx-serialization-json-js-ir.js → kotlinx-serialization-kotlinx-serialization-json.js} +1693 -1493
  25. package/kotlinx-serialization-kotlinx-serialization-json.js.map +1 -0
  26. package/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js +2592 -2585
  27. package/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js.map +1 -1
  28. package/package.json +1 -1
  29. package/{uuid-js-ir.js → uuid.js} +40 -40
  30. package/uuid.js.map +1 -0
  31. package/Kodein-kodein-di.js.map +0 -1
  32. package/KosiTypeSystem-kaverit.js.map +0 -1
  33. package/Kotlin-DateTime-library-kotlinx-datetime-js-ir.js +0 -386
  34. package/Kotlin-DateTime-library-kotlinx-datetime-js-ir.js.map +0 -1
  35. package/kotlinx-serialization-kotlinx-serialization-core-js-ir.js.map +0 -1
  36. package/kotlinx-serialization-kotlinx-serialization-json-js-ir.js.map +0 -1
  37. package/uuid-js-ir.js.map +0 -1
@@ -0,0 +1,1191 @@
1
+ (function (root, factory) {
2
+ if (typeof define === 'function' && define.amd)
3
+ define(['exports', './kotlin-kotlin-stdlib.js'], factory);
4
+ else if (typeof exports === 'object')
5
+ factory(module.exports, require('./kotlin-kotlin-stdlib.js'));
6
+ else {
7
+ if (typeof this['kotlin-kotlin-stdlib'] === 'undefined') {
8
+ throw new Error("Error loading module 'kotlinx-io-kotlinx-io-core'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to 'kotlinx-io-kotlinx-io-core'.");
9
+ }
10
+ root['kotlinx-io-kotlinx-io-core'] = factory(typeof this['kotlinx-io-kotlinx-io-core'] === 'undefined' ? {} : this['kotlinx-io-kotlinx-io-core'], this['kotlin-kotlin-stdlib']);
11
+ }
12
+ }(this, function (_, kotlin_kotlin) {
13
+ 'use strict';
14
+ //region block: imports
15
+ var imul = Math.imul;
16
+ var IndexOutOfBoundsException_init_$Create$ = kotlin_kotlin.$_$.s1;
17
+ var Long = kotlin_kotlin.$_$.nd;
18
+ var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.n1;
19
+ var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.l2;
20
+ var charArrayOf = kotlin_kotlin.$_$.m9;
21
+ var protoOf = kotlin_kotlin.$_$.ua;
22
+ var Unit_instance = kotlin_kotlin.$_$.y4;
23
+ var ensureNotNull = kotlin_kotlin.$_$.ke;
24
+ var toLong = kotlin_kotlin.$_$.xa;
25
+ var toString = kotlin_kotlin.$_$.za;
26
+ var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.d1;
27
+ var classMeta = kotlin_kotlin.$_$.r9;
28
+ var setMetadataFor = kotlin_kotlin.$_$.va;
29
+ var VOID = kotlin_kotlin.$_$.f;
30
+ var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.q1;
31
+ var objectCreate = kotlin_kotlin.$_$.sa;
32
+ var objectMeta = kotlin_kotlin.$_$.ta;
33
+ var arrayCopy = kotlin_kotlin.$_$.n5;
34
+ var IllegalArgumentException_init_$Create$_0 = kotlin_kotlin.$_$.l1;
35
+ var charSequenceGet = kotlin_kotlin.$_$.o9;
36
+ var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.o2;
37
+ var toByte = kotlin_kotlin.$_$.wa;
38
+ var interfaceMeta = kotlin_kotlin.$_$.ba;
39
+ var toString_0 = kotlin_kotlin.$_$.p2;
40
+ var startsWith = kotlin_kotlin.$_$.ic;
41
+ var StringBuilder_init_$Create$_0 = kotlin_kotlin.$_$.e1;
42
+ var charSequenceLength = kotlin_kotlin.$_$.p9;
43
+ var endsWith = kotlin_kotlin.$_$.wb;
44
+ var captureStack = kotlin_kotlin.$_$.l9;
45
+ var Exception = kotlin_kotlin.$_$.kd;
46
+ var Exception_init_$Init$ = kotlin_kotlin.$_$.i1;
47
+ var THROW_CCE = kotlin_kotlin.$_$.td;
48
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.m;
49
+ var asReversed = kotlin_kotlin.$_$.p5;
50
+ var equals = kotlin_kotlin.$_$.u9;
51
+ var contains = kotlin_kotlin.$_$.vb;
52
+ var getStringHashCode = kotlin_kotlin.$_$.z9;
53
+ var Char = kotlin_kotlin.$_$.dd;
54
+ var KProperty0 = kotlin_kotlin.$_$.kb;
55
+ var getPropertyCallableRef = kotlin_kotlin.$_$.y9;
56
+ var lazy = kotlin_kotlin.$_$.pe;
57
+ //endregion
58
+ //region block: pre-declaration
59
+ setMetadataFor(Buffer, 'Buffer', classMeta, VOID, VOID, Buffer);
60
+ setMetadataFor(RealSink, 'RealSink', classMeta);
61
+ setMetadataFor(Companion, 'Companion', objectMeta);
62
+ setMetadataFor(Segment, 'Segment', classMeta, VOID, VOID, Segment_init_$Create$);
63
+ function delete$default(path, mustExist, $super) {
64
+ mustExist = mustExist === VOID ? true : mustExist;
65
+ var tmp;
66
+ if ($super === VOID) {
67
+ this.l1p(path, mustExist);
68
+ tmp = Unit_instance;
69
+ } else {
70
+ tmp = $super.l1p.call(this, path, mustExist);
71
+ }
72
+ return tmp;
73
+ }
74
+ function createDirectories$default(path, mustCreate, $super) {
75
+ mustCreate = mustCreate === VOID ? false : mustCreate;
76
+ var tmp;
77
+ if ($super === VOID) {
78
+ this.n1p(path, mustCreate);
79
+ tmp = Unit_instance;
80
+ } else {
81
+ tmp = $super.n1p.call(this, path, mustCreate);
82
+ }
83
+ return tmp;
84
+ }
85
+ setMetadataFor(FileSystem, 'FileSystem', interfaceMeta);
86
+ setMetadataFor(SystemFileSystemImpl, 'SystemFileSystemImpl', classMeta, VOID, [FileSystem]);
87
+ setMetadataFor(FileMetadata, 'FileMetadata', classMeta, VOID, VOID, FileMetadata);
88
+ setMetadataFor(IOException, 'IOException', classMeta, Exception, VOID, IOException_init_$Create$_0);
89
+ setMetadataFor(EOFException, 'EOFException', classMeta, IOException, VOID, EOFException_init_$Create$);
90
+ setMetadataFor(SegmentPool, 'SegmentPool', objectMeta);
91
+ setMetadataFor(FileNotFoundException, 'FileNotFoundException', classMeta, IOException);
92
+ setMetadataFor(SystemFileSystem$1, VOID, classMeta, SystemFileSystemImpl);
93
+ setMetadataFor(Path_1, 'Path', classMeta);
94
+ setMetadataFor(FileSink, 'FileSink', classMeta);
95
+ //endregion
96
+ function get_HEX_DIGIT_CHARS() {
97
+ _init_properties__Util_kt__g8tcl9();
98
+ return HEX_DIGIT_CHARS;
99
+ }
100
+ var HEX_DIGIT_CHARS;
101
+ function checkBounds(size, startIndex, endIndex) {
102
+ _init_properties__Util_kt__g8tcl9();
103
+ if (startIndex.k8(new Long(0, 0)) < 0 ? true : endIndex.k8(size) > 0) {
104
+ throw IndexOutOfBoundsException_init_$Create$('startIndex (' + startIndex.toString() + ') and endIndex (' + endIndex.toString() + ') are not within the range [0..size(' + size.toString() + '))');
105
+ }
106
+ if (startIndex.k8(endIndex) > 0) {
107
+ throw IllegalArgumentException_init_$Create$('startIndex (' + startIndex.toString() + ') > endIndex (' + endIndex.toString() + ')');
108
+ }
109
+ }
110
+ function checkOffsetAndCount(size, offset, byteCount) {
111
+ _init_properties__Util_kt__g8tcl9();
112
+ if (((offset.k8(new Long(0, 0)) < 0 ? true : offset.k8(size) > 0) ? true : size.p9(offset).k8(byteCount) < 0) ? true : byteCount.k8(new Long(0, 0)) < 0) {
113
+ throw IllegalArgumentException_init_$Create$('offset (' + offset.toString() + ') and byteCount (' + byteCount.toString() + ') are not within the range [0..size(' + size.toString() + '))');
114
+ }
115
+ }
116
+ var properties_initialized__Util_kt_67kc5b;
117
+ function _init_properties__Util_kt__g8tcl9() {
118
+ if (!properties_initialized__Util_kt_67kc5b) {
119
+ properties_initialized__Util_kt_67kc5b = true;
120
+ // Inline function 'kotlin.charArrayOf' call
121
+ HEX_DIGIT_CHARS = charArrayOf([_Char___init__impl__6a9atx(48), _Char___init__impl__6a9atx(49), _Char___init__impl__6a9atx(50), _Char___init__impl__6a9atx(51), _Char___init__impl__6a9atx(52), _Char___init__impl__6a9atx(53), _Char___init__impl__6a9atx(54), _Char___init__impl__6a9atx(55), _Char___init__impl__6a9atx(56), _Char___init__impl__6a9atx(57), _Char___init__impl__6a9atx(97), _Char___init__impl__6a9atx(98), _Char___init__impl__6a9atx(99), _Char___init__impl__6a9atx(100), _Char___init__impl__6a9atx(101), _Char___init__impl__6a9atx(102)]);
122
+ }
123
+ }
124
+ function Buffer() {
125
+ this.d1o_1 = null;
126
+ this.e1o_1 = new Long(0, 0);
127
+ this.f1o_1 = this;
128
+ }
129
+ protoOf(Buffer).g1o = function () {
130
+ return this.f1o_1;
131
+ };
132
+ protoOf(Buffer).h1o = function () {
133
+ return Unit_instance;
134
+ };
135
+ protoOf(Buffer).i1o = function () {
136
+ var result = this.e1o_1;
137
+ if (result.equals(new Long(0, 0)))
138
+ return new Long(0, 0);
139
+ var tail = ensureNotNull(ensureNotNull(this.d1o_1).p1o_1);
140
+ var tmp;
141
+ var tmp_0 = tail.l1o_1;
142
+ if (tmp_0 < 8192) {
143
+ tmp = tail.n1o_1;
144
+ } else {
145
+ tmp = false;
146
+ }
147
+ if (tmp) {
148
+ result = result.p9(toLong(tail.l1o_1 - tail.k1o_1 | 0));
149
+ }
150
+ return result;
151
+ };
152
+ protoOf(Buffer).q1o = function (byteCount) {
153
+ // Inline function 'kotlinx.io.checkByteCount' call
154
+ // Inline function 'kotlin.require' call
155
+ // Inline function 'kotlin.contracts.contract' call
156
+ if (!(byteCount.k8(new Long(0, 0)) >= 0)) {
157
+ // Inline function 'kotlinx.io.checkByteCount.<anonymous>' call
158
+ var message = 'byteCount (' + byteCount.toString() + ') < 0';
159
+ throw IllegalArgumentException_init_$Create$(toString(message));
160
+ }
161
+ var remainingByteCount = byteCount;
162
+ while (remainingByteCount.k8(new Long(0, 0)) > 0) {
163
+ var tmp0_elvis_lhs = this.d1o_1;
164
+ var tmp;
165
+ if (tmp0_elvis_lhs == null) {
166
+ throw new EOFException('Buffer exhausted before skipping ' + byteCount.toString() + ' bytes.');
167
+ } else {
168
+ tmp = tmp0_elvis_lhs;
169
+ }
170
+ var head = tmp;
171
+ // Inline function 'kotlinx.io.minOf' call
172
+ var a = remainingByteCount;
173
+ var b = head.l1o_1 - head.k1o_1 | 0;
174
+ // Inline function 'kotlin.comparisons.minOf' call
175
+ var b_0 = toLong(b);
176
+ var toSkip = (a.k8(b_0) <= 0 ? a : b_0).s8();
177
+ this.e1o_1 = this.e1o_1.p9(toLong(toSkip));
178
+ remainingByteCount = remainingByteCount.p9(toLong(toSkip));
179
+ head.k1o_1 = head.k1o_1 + toSkip | 0;
180
+ if (head.k1o_1 === head.l1o_1) {
181
+ this.d1o_1 = head.r1o();
182
+ SegmentPool_instance.u1o(head);
183
+ }
184
+ }
185
+ };
186
+ protoOf(Buffer).v1o = function (minimumCapacity) {
187
+ // Inline function 'kotlin.require' call
188
+ var tmp;
189
+ if (minimumCapacity >= 1) {
190
+ tmp = minimumCapacity <= 8192;
191
+ } else {
192
+ tmp = false;
193
+ }
194
+ // Inline function 'kotlin.contracts.contract' call
195
+ if (!tmp) {
196
+ // Inline function 'kotlinx.io.Buffer.writableSegment.<anonymous>' call
197
+ var message = 'unexpected capacity';
198
+ throw IllegalArgumentException_init_$Create$(toString(message));
199
+ }
200
+ if (this.d1o_1 == null) {
201
+ var result = SegmentPool_instance.w1o();
202
+ this.d1o_1 = result;
203
+ result.p1o_1 = result;
204
+ result.o1o_1 = result;
205
+ return result;
206
+ }
207
+ var tail = ensureNotNull(this.d1o_1).p1o_1;
208
+ var tmp_0;
209
+ var tmp_1 = ensureNotNull(tail).l1o_1 + minimumCapacity | 0;
210
+ if (tmp_1 > 8192) {
211
+ tmp_0 = true;
212
+ } else {
213
+ tmp_0 = !tail.n1o_1;
214
+ }
215
+ if (tmp_0) {
216
+ tail = tail.x1o(SegmentPool_instance.w1o());
217
+ }
218
+ return tail;
219
+ };
220
+ protoOf(Buffer).y1o = function (source, byteCount) {
221
+ // Inline function 'kotlin.require' call
222
+ // Inline function 'kotlin.contracts.contract' call
223
+ if (!!(source === this)) {
224
+ // Inline function 'kotlinx.io.Buffer.write.<anonymous>' call
225
+ var message = 'source == this';
226
+ throw IllegalArgumentException_init_$Create$(toString(message));
227
+ }
228
+ checkOffsetAndCount(source.e1o_1, new Long(0, 0), byteCount);
229
+ var remainingByteCount = byteCount;
230
+ while (remainingByteCount.k8(new Long(0, 0)) > 0) {
231
+ if (remainingByteCount.k8(toLong(ensureNotNull(source.d1o_1).l1o_1 - ensureNotNull(source.d1o_1).k1o_1 | 0)) < 0) {
232
+ var tail = !(this.d1o_1 == null) ? ensureNotNull(this.d1o_1).p1o_1 : null;
233
+ var tmp;
234
+ if (!(tail == null) ? tail.n1o_1 : false) {
235
+ // Inline function 'kotlin.Long.minus' call
236
+ // Inline function 'kotlin.Long.plus' call
237
+ var this_0 = remainingByteCount;
238
+ var other = tail.l1o_1;
239
+ var this_1 = this_0.o9(toLong(other));
240
+ var other_0 = tail.m1o_1 ? 0 : tail.k1o_1;
241
+ var tmp_0 = this_1.p9(toLong(other_0));
242
+ tmp = tmp_0.k8(toLong(8192)) <= 0;
243
+ } else {
244
+ tmp = false;
245
+ }
246
+ if (tmp) {
247
+ ensureNotNull(source.d1o_1).a1p(tail, remainingByteCount.s8());
248
+ source.e1o_1 = source.e1o_1.p9(remainingByteCount);
249
+ this.e1o_1 = this.e1o_1.o9(remainingByteCount);
250
+ return Unit_instance;
251
+ } else {
252
+ source.d1o_1 = ensureNotNull(source.d1o_1).z1o(remainingByteCount.s8());
253
+ }
254
+ }
255
+ var segmentToMove = source.d1o_1;
256
+ var movedByteCount = toLong(ensureNotNull(segmentToMove).l1o_1 - segmentToMove.k1o_1 | 0);
257
+ source.d1o_1 = segmentToMove.r1o();
258
+ if (this.d1o_1 == null) {
259
+ this.d1o_1 = segmentToMove;
260
+ segmentToMove.p1o_1 = segmentToMove;
261
+ segmentToMove.o1o_1 = segmentToMove.p1o_1;
262
+ } else {
263
+ var tail_0 = ensureNotNull(this.d1o_1).p1o_1;
264
+ tail_0 = ensureNotNull(tail_0).x1o(segmentToMove);
265
+ tail_0.b1p();
266
+ }
267
+ source.e1o_1 = source.e1o_1.p9(movedByteCount);
268
+ this.e1o_1 = this.e1o_1.o9(movedByteCount);
269
+ remainingByteCount = remainingByteCount.p9(movedByteCount);
270
+ }
271
+ };
272
+ protoOf(Buffer).c1p = function (byte) {
273
+ var tail = this.v1o(1);
274
+ var tmp1 = tail.l1o_1;
275
+ tail.l1o_1 = tmp1 + 1 | 0;
276
+ tail.j1o_1[tmp1] = byte;
277
+ this.e1o_1 = this.e1o_1.o9(new Long(1, 0));
278
+ };
279
+ protoOf(Buffer).d1p = function () {
280
+ return Unit_instance;
281
+ };
282
+ protoOf(Buffer).toString = function () {
283
+ if (this.e1o_1.equals(new Long(0, 0)))
284
+ return 'Buffer(size=0)';
285
+ var maxPrintableBytes = 64;
286
+ // Inline function 'kotlinx.io.minOf' call
287
+ var b = this.e1o_1;
288
+ // Inline function 'kotlin.comparisons.minOf' call
289
+ var a = toLong(maxPrintableBytes);
290
+ var len = (a.k8(b) <= 0 ? a : b).s8();
291
+ var builder = StringBuilder_init_$Create$(imul(len, 2) + (this.e1o_1.k8(toLong(maxPrintableBytes)) > 0 ? 1 : 0) | 0);
292
+ var curr = ensureNotNull(this.d1o_1);
293
+ var bytesWritten = 0;
294
+ var pos = curr.k1o_1;
295
+ while (bytesWritten < len) {
296
+ if (pos === curr.l1o_1) {
297
+ curr = ensureNotNull(curr.o1o_1);
298
+ pos = curr.k1o_1;
299
+ }
300
+ var tmp = curr.j1o_1;
301
+ var tmp0 = pos;
302
+ pos = tmp0 + 1 | 0;
303
+ var b_0 = tmp[tmp0];
304
+ bytesWritten = bytesWritten + 1 | 0;
305
+ builder.f5(get_HEX_DIGIT_CHARS()[b_0 >> 4 & 15]).f5(get_HEX_DIGIT_CHARS()[b_0 & 15]);
306
+ }
307
+ if (this.e1o_1.k8(toLong(maxPrintableBytes)) > 0) {
308
+ builder.f5(_Char___init__impl__6a9atx(8230));
309
+ }
310
+ return 'Buffer(size=' + this.e1o_1.toString() + ' hex=' + builder + ')';
311
+ };
312
+ function buffered(_this__u8e3s4) {
313
+ return new RealSink(_this__u8e3s4);
314
+ }
315
+ function RealSink(sink) {
316
+ this.e1p_1 = sink;
317
+ this.f1p_1 = false;
318
+ this.g1p_1 = new Buffer();
319
+ }
320
+ protoOf(RealSink).g1o = function () {
321
+ return this.g1p_1;
322
+ };
323
+ protoOf(RealSink).y1o = function (source, byteCount) {
324
+ // Inline function 'kotlinx.io.RealSink.checkNotClosed' call
325
+ // Inline function 'kotlin.check' call
326
+ // Inline function 'kotlin.contracts.contract' call
327
+ if (!!this.f1p_1) {
328
+ // Inline function 'kotlinx.io.RealSink.checkNotClosed.<anonymous>' call
329
+ var message = 'Sink is closed.';
330
+ throw IllegalStateException_init_$Create$(toString(message));
331
+ }
332
+ // Inline function 'kotlin.require' call
333
+ // Inline function 'kotlin.contracts.contract' call
334
+ if (!(byteCount.k8(new Long(0, 0)) >= 0)) {
335
+ // Inline function 'kotlinx.io.RealSink.write.<anonymous>' call
336
+ var message_0 = 'byteCount: ' + byteCount.toString();
337
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
338
+ }
339
+ this.g1p_1.y1o(source, byteCount);
340
+ this.h1o();
341
+ };
342
+ protoOf(RealSink).h1o = function () {
343
+ // Inline function 'kotlinx.io.RealSink.checkNotClosed' call
344
+ // Inline function 'kotlin.check' call
345
+ // Inline function 'kotlin.contracts.contract' call
346
+ if (!!this.f1p_1) {
347
+ // Inline function 'kotlinx.io.RealSink.checkNotClosed.<anonymous>' call
348
+ var message = 'Sink is closed.';
349
+ throw IllegalStateException_init_$Create$(toString(message));
350
+ }
351
+ var byteCount = this.g1p_1.i1o();
352
+ if (byteCount.k8(new Long(0, 0)) > 0) {
353
+ this.e1p_1.y1o(this.g1p_1, byteCount);
354
+ }
355
+ };
356
+ protoOf(RealSink).d1p = function () {
357
+ if (this.f1p_1)
358
+ return Unit_instance;
359
+ var thrown = null;
360
+ try {
361
+ if (this.g1p_1.e1o_1.k8(new Long(0, 0)) > 0) {
362
+ this.e1p_1.y1o(this.g1p_1, this.g1p_1.e1o_1);
363
+ }
364
+ } catch ($p) {
365
+ if ($p instanceof Error) {
366
+ var e = $p;
367
+ thrown = e;
368
+ } else {
369
+ throw $p;
370
+ }
371
+ }
372
+ try {
373
+ this.e1p_1.d1p();
374
+ } catch ($p) {
375
+ if ($p instanceof Error) {
376
+ var e_0 = $p;
377
+ if (thrown == null)
378
+ thrown = e_0;
379
+ } else {
380
+ throw $p;
381
+ }
382
+ }
383
+ this.f1p_1 = true;
384
+ if (!(thrown == null))
385
+ throw thrown;
386
+ };
387
+ protoOf(RealSink).toString = function () {
388
+ return 'buffered(' + this.e1p_1 + ')';
389
+ };
390
+ function Segment_init_$Init$($this) {
391
+ Segment.call($this);
392
+ $this.j1o_1 = new Int8Array(8192);
393
+ $this.n1o_1 = true;
394
+ $this.m1o_1 = false;
395
+ return $this;
396
+ }
397
+ function Segment_init_$Create$() {
398
+ return Segment_init_$Init$(objectCreate(protoOf(Segment)));
399
+ }
400
+ function Segment_init_$Init$_0(data, pos, limit, shared, owner, $this) {
401
+ Segment.call($this);
402
+ $this.j1o_1 = data;
403
+ $this.k1o_1 = pos;
404
+ $this.l1o_1 = limit;
405
+ $this.m1o_1 = shared;
406
+ $this.n1o_1 = owner;
407
+ return $this;
408
+ }
409
+ function Segment_init_$Create$_0(data, pos, limit, shared, owner) {
410
+ return Segment_init_$Init$_0(data, pos, limit, shared, owner, objectCreate(protoOf(Segment)));
411
+ }
412
+ function Companion() {
413
+ this.h1p_1 = 8192;
414
+ this.i1p_1 = 1024;
415
+ }
416
+ var Companion_instance;
417
+ function Companion_getInstance() {
418
+ return Companion_instance;
419
+ }
420
+ protoOf(Segment).j1p = function () {
421
+ this.m1o_1 = true;
422
+ return Segment_init_$Create$_0(this.j1o_1, this.k1o_1, this.l1o_1, true, false);
423
+ };
424
+ protoOf(Segment).r1o = function () {
425
+ var result = !(this.o1o_1 === this) ? this.o1o_1 : null;
426
+ ensureNotNull(this.p1o_1).o1o_1 = this.o1o_1;
427
+ ensureNotNull(this.o1o_1).p1o_1 = this.p1o_1;
428
+ this.o1o_1 = null;
429
+ this.p1o_1 = null;
430
+ return result;
431
+ };
432
+ protoOf(Segment).x1o = function (segment) {
433
+ segment.p1o_1 = this;
434
+ segment.o1o_1 = this.o1o_1;
435
+ ensureNotNull(this.o1o_1).p1o_1 = segment;
436
+ this.o1o_1 = segment;
437
+ return segment;
438
+ };
439
+ protoOf(Segment).z1o = function (byteCount) {
440
+ // Inline function 'kotlin.require' call
441
+ // Inline function 'kotlin.contracts.contract' call
442
+ if (!(byteCount > 0 ? byteCount <= (this.l1o_1 - this.k1o_1 | 0) : false)) {
443
+ // Inline function 'kotlinx.io.Segment.split.<anonymous>' call
444
+ var message = 'byteCount out of range';
445
+ throw IllegalArgumentException_init_$Create$(toString(message));
446
+ }
447
+ var prefix;
448
+ if (byteCount >= 1024) {
449
+ prefix = this.j1p();
450
+ } else {
451
+ prefix = SegmentPool_instance.w1o();
452
+ // Inline function 'kotlin.collections.copyInto' call
453
+ var this_0 = this.j1o_1;
454
+ var destination = prefix.j1o_1;
455
+ var startIndex = this.k1o_1;
456
+ var endIndex = this.k1o_1 + byteCount | 0;
457
+ // Inline function 'kotlin.js.unsafeCast' call
458
+ // Inline function 'kotlin.js.asDynamic' call
459
+ var tmp = this_0;
460
+ // Inline function 'kotlin.js.unsafeCast' call
461
+ // Inline function 'kotlin.js.asDynamic' call
462
+ arrayCopy(tmp, destination, 0, startIndex, endIndex);
463
+ }
464
+ prefix.l1o_1 = prefix.k1o_1 + byteCount | 0;
465
+ this.k1o_1 = this.k1o_1 + byteCount | 0;
466
+ ensureNotNull(this.p1o_1).x1o(prefix);
467
+ return prefix;
468
+ };
469
+ protoOf(Segment).b1p = function () {
470
+ // Inline function 'kotlin.check' call
471
+ // Inline function 'kotlin.contracts.contract' call
472
+ if (!!(this.p1o_1 === this)) {
473
+ // Inline function 'kotlinx.io.Segment.compact.<anonymous>' call
474
+ var message = 'cannot compact';
475
+ throw IllegalStateException_init_$Create$(toString(message));
476
+ }
477
+ if (!ensureNotNull(this.p1o_1).n1o_1)
478
+ return Unit_instance;
479
+ var byteCount = this.l1o_1 - this.k1o_1 | 0;
480
+ var availableByteCount = (8192 - ensureNotNull(this.p1o_1).l1o_1 | 0) + (ensureNotNull(this.p1o_1).m1o_1 ? 0 : ensureNotNull(this.p1o_1).k1o_1) | 0;
481
+ if (byteCount > availableByteCount)
482
+ return Unit_instance;
483
+ this.a1p(ensureNotNull(this.p1o_1), byteCount);
484
+ this.r1o();
485
+ SegmentPool_instance.u1o(this);
486
+ };
487
+ protoOf(Segment).a1p = function (sink, byteCount) {
488
+ // Inline function 'kotlin.check' call
489
+ // Inline function 'kotlin.contracts.contract' call
490
+ if (!sink.n1o_1) {
491
+ // Inline function 'kotlinx.io.Segment.writeTo.<anonymous>' call
492
+ var message = 'only owner can write';
493
+ throw IllegalStateException_init_$Create$(toString(message));
494
+ }
495
+ if ((sink.l1o_1 + byteCount | 0) > 8192) {
496
+ if (sink.m1o_1)
497
+ throw IllegalArgumentException_init_$Create$_0();
498
+ if (((sink.l1o_1 + byteCount | 0) - sink.k1o_1 | 0) > 8192)
499
+ throw IllegalArgumentException_init_$Create$_0();
500
+ // Inline function 'kotlin.collections.copyInto' call
501
+ var this_0 = sink.j1o_1;
502
+ var destination = sink.j1o_1;
503
+ var startIndex = sink.k1o_1;
504
+ var endIndex = sink.l1o_1;
505
+ // Inline function 'kotlin.js.unsafeCast' call
506
+ // Inline function 'kotlin.js.asDynamic' call
507
+ var tmp = this_0;
508
+ // Inline function 'kotlin.js.unsafeCast' call
509
+ // Inline function 'kotlin.js.asDynamic' call
510
+ arrayCopy(tmp, destination, 0, startIndex, endIndex);
511
+ sink.l1o_1 = sink.l1o_1 - sink.k1o_1 | 0;
512
+ sink.k1o_1 = 0;
513
+ }
514
+ // Inline function 'kotlin.collections.copyInto' call
515
+ var this_1 = this.j1o_1;
516
+ var destination_0 = sink.j1o_1;
517
+ var destinationOffset = sink.l1o_1;
518
+ var startIndex_0 = this.k1o_1;
519
+ var endIndex_0 = this.k1o_1 + byteCount | 0;
520
+ // Inline function 'kotlin.js.unsafeCast' call
521
+ // Inline function 'kotlin.js.asDynamic' call
522
+ var tmp_0 = this_1;
523
+ // Inline function 'kotlin.js.unsafeCast' call
524
+ // Inline function 'kotlin.js.asDynamic' call
525
+ arrayCopy(tmp_0, destination_0, destinationOffset, startIndex_0, endIndex_0);
526
+ sink.l1o_1 = sink.l1o_1 + byteCount | 0;
527
+ this.k1o_1 = this.k1o_1 + byteCount | 0;
528
+ };
529
+ function Segment() {
530
+ this.k1o_1 = 0;
531
+ this.l1o_1 = 0;
532
+ this.m1o_1 = false;
533
+ this.n1o_1 = false;
534
+ this.o1o_1 = null;
535
+ this.p1o_1 = null;
536
+ }
537
+ function writeString(_this__u8e3s4, string, startIndex, endIndex) {
538
+ startIndex = startIndex === VOID ? 0 : startIndex;
539
+ endIndex = endIndex === VOID ? string.length : endIndex;
540
+ // Inline function 'kotlinx.io.writeString.<anonymous>' call
541
+ var it = _this__u8e3s4.g1o();
542
+ commonWriteUtf8(it, string, startIndex, endIndex);
543
+ _this__u8e3s4.h1o();
544
+ return Unit_instance;
545
+ }
546
+ function commonWriteUtf8(_this__u8e3s4, string, beginIndex, endIndex) {
547
+ // Inline function 'kotlinx.io.checkBounds' call
548
+ var size = string.length;
549
+ checkBounds(toLong(size), toLong(beginIndex), toLong(endIndex));
550
+ var i = beginIndex;
551
+ while (i < endIndex) {
552
+ // Inline function 'kotlin.code' call
553
+ var this_0 = charSequenceGet(string, i);
554
+ var c = Char__toInt_impl_vasixd(this_0);
555
+ if (c < 128) {
556
+ var tail = _this__u8e3s4.v1o(1);
557
+ var data = tail.j1o_1;
558
+ var segmentOffset = tail.l1o_1 - i | 0;
559
+ // Inline function 'kotlin.comparisons.minOf' call
560
+ var b = 8192 - segmentOffset | 0;
561
+ var runLimit = Math.min(endIndex, b);
562
+ var tmp0 = i;
563
+ i = tmp0 + 1 | 0;
564
+ data[segmentOffset + tmp0 | 0] = toByte(c);
565
+ $l$loop: while (i < runLimit) {
566
+ // Inline function 'kotlin.code' call
567
+ var this_1 = charSequenceGet(string, i);
568
+ c = Char__toInt_impl_vasixd(this_1);
569
+ if (c >= 128)
570
+ break $l$loop;
571
+ var tmp1 = i;
572
+ i = tmp1 + 1 | 0;
573
+ data[segmentOffset + tmp1 | 0] = toByte(c);
574
+ }
575
+ var runSize = (i + segmentOffset | 0) - tail.l1o_1 | 0;
576
+ tail.l1o_1 = tail.l1o_1 + runSize | 0;
577
+ _this__u8e3s4.e1o_1 = _this__u8e3s4.e1o_1.o9(toLong(runSize));
578
+ } else if (c < 2048) {
579
+ var tail_0 = _this__u8e3s4.v1o(2);
580
+ tail_0.j1o_1[tail_0.l1o_1] = toByte(c >> 6 | 192);
581
+ tail_0.j1o_1[tail_0.l1o_1 + 1 | 0] = toByte(c & 63 | 128);
582
+ tail_0.l1o_1 = tail_0.l1o_1 + 2 | 0;
583
+ _this__u8e3s4.e1o_1 = _this__u8e3s4.e1o_1.o9(new Long(2, 0));
584
+ i = i + 1 | 0;
585
+ } else if (c < 55296 ? true : c > 57343) {
586
+ var tail_1 = _this__u8e3s4.v1o(3);
587
+ tail_1.j1o_1[tail_1.l1o_1] = toByte(c >> 12 | 224);
588
+ tail_1.j1o_1[tail_1.l1o_1 + 1 | 0] = toByte(c >> 6 & 63 | 128);
589
+ tail_1.j1o_1[tail_1.l1o_1 + 2 | 0] = toByte(c & 63 | 128);
590
+ tail_1.l1o_1 = tail_1.l1o_1 + 3 | 0;
591
+ _this__u8e3s4.e1o_1 = _this__u8e3s4.e1o_1.o9(new Long(3, 0));
592
+ i = i + 1 | 0;
593
+ } else {
594
+ var tmp;
595
+ if ((i + 1 | 0) < endIndex) {
596
+ // Inline function 'kotlin.code' call
597
+ var this_2 = charSequenceGet(string, i + 1 | 0);
598
+ tmp = Char__toInt_impl_vasixd(this_2);
599
+ } else {
600
+ tmp = 0;
601
+ }
602
+ var low = tmp;
603
+ if (c > 56319 ? true : !(56320 <= low ? low <= 57343 : false)) {
604
+ _this__u8e3s4.c1p(63);
605
+ i = i + 1 | 0;
606
+ } else {
607
+ var codePoint = 65536 + ((c & 1023) << 10 | low & 1023) | 0;
608
+ var tail_2 = _this__u8e3s4.v1o(4);
609
+ tail_2.j1o_1[tail_2.l1o_1] = toByte(codePoint >> 18 | 240);
610
+ tail_2.j1o_1[tail_2.l1o_1 + 1 | 0] = toByte(codePoint >> 12 & 63 | 128);
611
+ tail_2.j1o_1[tail_2.l1o_1 + 2 | 0] = toByte(codePoint >> 6 & 63 | 128);
612
+ tail_2.j1o_1[tail_2.l1o_1 + 3 | 0] = toByte(codePoint & 63 | 128);
613
+ tail_2.l1o_1 = tail_2.l1o_1 + 4 | 0;
614
+ _this__u8e3s4.e1o_1 = _this__u8e3s4.e1o_1.o9(new Long(4, 0));
615
+ i = i + 2 | 0;
616
+ }
617
+ }
618
+ }
619
+ }
620
+ function FileSystem() {
621
+ }
622
+ function SystemFileSystemImpl() {
623
+ }
624
+ function FileMetadata(isRegularFile, isDirectory, size) {
625
+ isRegularFile = isRegularFile === VOID ? false : isRegularFile;
626
+ isDirectory = isDirectory === VOID ? false : isDirectory;
627
+ size = size === VOID ? new Long(0, 0) : size;
628
+ this.q1p_1 = isRegularFile;
629
+ this.r1p_1 = isDirectory;
630
+ this.s1p_1 = size;
631
+ }
632
+ function get_UnixPathSeparator() {
633
+ return UnixPathSeparator;
634
+ }
635
+ var UnixPathSeparator;
636
+ function get_WindowsPathSeparator() {
637
+ return WindowsPathSeparator;
638
+ }
639
+ var WindowsPathSeparator;
640
+ function removeTrailingSeparators(path, isWindows_) {
641
+ isWindows_ = isWindows_ === VOID ? get_isWindows() : isWindows_;
642
+ if (isWindows_) {
643
+ var tmp;
644
+ if (path.length > 1) {
645
+ var tmp_0;
646
+ if (charSequenceGet(path, 1) === _Char___init__impl__6a9atx(58)) {
647
+ tmp_0 = 3;
648
+ } else if (isUnc(path)) {
649
+ tmp_0 = 2;
650
+ } else {
651
+ tmp_0 = 1;
652
+ }
653
+ tmp = tmp_0;
654
+ } else {
655
+ tmp = 1;
656
+ }
657
+ var limit = tmp;
658
+ return removeTrailingSeparatorsWindows(limit, path);
659
+ }
660
+ return removeTrailingSeparatorsUnix(path);
661
+ }
662
+ function isUnc(path) {
663
+ if (path.length < 2)
664
+ return false;
665
+ if (startsWith(path, toString_0(get_WindowsPathSeparator()) + toString_0(get_WindowsPathSeparator())))
666
+ return true;
667
+ if (startsWith(path, toString_0(get_UnixPathSeparator()) + toString_0(get_UnixPathSeparator())))
668
+ return true;
669
+ return false;
670
+ }
671
+ function removeTrailingSeparatorsWindows(suffixLength, path) {
672
+ // Inline function 'kotlin.require' call
673
+ // Inline function 'kotlin.contracts.contract' call
674
+ // Inline function 'kotlin.require' call
675
+ // Inline function 'kotlin.contracts.contract' call
676
+ if (!(suffixLength >= 1)) {
677
+ // Inline function 'kotlin.require.<anonymous>' call
678
+ var message = 'Failed requirement.';
679
+ throw IllegalArgumentException_init_$Create$(toString(message));
680
+ }
681
+ var idx = path.length;
682
+ $l$loop: while (idx > suffixLength) {
683
+ var c = charSequenceGet(path, idx - 1 | 0);
684
+ if (!(c === get_WindowsPathSeparator()) ? !(c === get_UnixPathSeparator()) : false)
685
+ break $l$loop;
686
+ idx = idx - 1 | 0;
687
+ }
688
+ // Inline function 'kotlin.text.substring' call
689
+ var endIndex = idx;
690
+ // Inline function 'kotlin.js.asDynamic' call
691
+ return path.substring(0, endIndex);
692
+ }
693
+ function removeTrailingSeparatorsUnix(path) {
694
+ var idx = path.length;
695
+ while (idx > 1 ? charSequenceGet(path, idx - 1 | 0) === get_UnixPathSeparator() : false) {
696
+ idx = idx - 1 | 0;
697
+ }
698
+ // Inline function 'kotlin.text.substring' call
699
+ var endIndex = idx;
700
+ // Inline function 'kotlin.js.asDynamic' call
701
+ return path.substring(0, endIndex);
702
+ }
703
+ function Path(base, parts) {
704
+ return Path_0(base.toString(), parts.slice());
705
+ }
706
+ function Path_0(base, parts) {
707
+ // Inline function 'kotlin.text.buildString' call
708
+ // Inline function 'kotlin.contracts.contract' call
709
+ // Inline function 'kotlin.apply' call
710
+ var this_0 = StringBuilder_init_$Create$_0();
711
+ // Inline function 'kotlin.contracts.contract' call
712
+ // Inline function 'kotlinx.io.files.Path.<anonymous>' call
713
+ this_0.e5(base);
714
+ // Inline function 'kotlin.collections.forEach' call
715
+ var inductionVariable = 0;
716
+ var last = parts.length;
717
+ while (inductionVariable < last) {
718
+ var element = parts[inductionVariable];
719
+ inductionVariable = inductionVariable + 1 | 0;
720
+ // Inline function 'kotlinx.io.files.Path.<anonymous>.<anonymous>' call
721
+ var tmp;
722
+ // Inline function 'kotlin.text.isNotEmpty' call
723
+ if (charSequenceLength(this_0) > 0) {
724
+ tmp = !endsWith(this_0, get_SystemPathSeparator());
725
+ } else {
726
+ tmp = false;
727
+ }
728
+ if (tmp) {
729
+ this_0.f5(get_SystemPathSeparator());
730
+ }
731
+ this_0.e5(element);
732
+ }
733
+ var tmp$ret$2 = this_0.toString();
734
+ return Path_2(tmp$ret$2);
735
+ }
736
+ function IOException_init_$Init$(message, $this) {
737
+ IOException.call($this, message, null);
738
+ return $this;
739
+ }
740
+ function IOException_init_$Create$(message) {
741
+ var tmp = IOException_init_$Init$(message, objectCreate(protoOf(IOException)));
742
+ captureStack(tmp, IOException_init_$Create$);
743
+ return tmp;
744
+ }
745
+ function IOException_init_$Init$_0($this) {
746
+ IOException_init_$Init$(null, $this);
747
+ return $this;
748
+ }
749
+ function IOException_init_$Create$_0() {
750
+ var tmp = IOException_init_$Init$_0(objectCreate(protoOf(IOException)));
751
+ captureStack(tmp, IOException_init_$Create$_0);
752
+ return tmp;
753
+ }
754
+ function IOException(message, cause) {
755
+ Exception_init_$Init$(message, cause, this);
756
+ captureStack(this, IOException);
757
+ }
758
+ function EOFException_init_$Init$($this) {
759
+ EOFException.call($this, null);
760
+ return $this;
761
+ }
762
+ function EOFException_init_$Create$() {
763
+ var tmp = EOFException_init_$Init$(objectCreate(protoOf(EOFException)));
764
+ captureStack(tmp, EOFException_init_$Create$);
765
+ return tmp;
766
+ }
767
+ function EOFException(message) {
768
+ IOException_init_$Init$(message, this);
769
+ captureStack(this, EOFException);
770
+ }
771
+ function SegmentPool() {
772
+ this.s1o_1 = 0;
773
+ this.t1o_1 = 0;
774
+ }
775
+ protoOf(SegmentPool).w1o = function () {
776
+ return Segment_init_$Create$();
777
+ };
778
+ protoOf(SegmentPool).u1o = function (segment) {
779
+ };
780
+ var SegmentPool_instance;
781
+ function SegmentPool_getInstance() {
782
+ return SegmentPool_instance;
783
+ }
784
+ function get_SystemFileSystem() {
785
+ _init_properties_FileSystemJs_kt__4boaac();
786
+ return SystemFileSystem;
787
+ }
788
+ var SystemFileSystem;
789
+ function get_isWindows() {
790
+ _init_properties_FileSystemJs_kt__4boaac();
791
+ return isWindows;
792
+ }
793
+ var isWindows;
794
+ function FileNotFoundException(message) {
795
+ IOException_init_$Init$(message, this);
796
+ captureStack(this, FileNotFoundException);
797
+ }
798
+ function get_SystemTemporaryDirectory() {
799
+ _init_properties_FileSystemJs_kt__4boaac();
800
+ // Inline function 'kotlin.check' call
801
+ // Inline function 'kotlin.contracts.contract' call
802
+ if (!(get_os() !== null)) {
803
+ // Inline function 'kotlinx.io.files.<get-SystemTemporaryDirectory>.<anonymous>' call
804
+ var message = "Module 'os' was not found";
805
+ throw IllegalStateException_init_$Create$(toString(message));
806
+ }
807
+ var tmp = get_os().tmpdir();
808
+ var tmp0_elvis_lhs = (!(tmp == null) ? typeof tmp === 'string' : false) ? tmp : null;
809
+ return Path_2(tmp0_elvis_lhs == null ? '' : tmp0_elvis_lhs);
810
+ }
811
+ function SystemFileSystem$1() {
812
+ SystemFileSystemImpl.call(this);
813
+ }
814
+ protoOf(SystemFileSystem$1).k1p = function (path) {
815
+ // Inline function 'kotlin.check' call
816
+ // Inline function 'kotlin.contracts.contract' call
817
+ if (!(get_fs() !== null)) {
818
+ // Inline function 'kotlinx.io.files.<no name provided>.exists.<anonymous>' call
819
+ var message = "Module 'fs' was not found";
820
+ throw IllegalStateException_init_$Create$(toString(message));
821
+ }
822
+ var tmp = get_fs().existsSync(path.t1p_1);
823
+ return (!(tmp == null) ? typeof tmp === 'boolean' : false) ? tmp : THROW_CCE();
824
+ };
825
+ protoOf(SystemFileSystem$1).l1p = function (path, mustExist) {
826
+ // Inline function 'kotlin.check' call
827
+ // Inline function 'kotlin.contracts.contract' call
828
+ if (!(get_fs() !== null)) {
829
+ // Inline function 'kotlinx.io.files.<no name provided>.delete.<anonymous>' call
830
+ var message = "Module 'fs' was not found";
831
+ throw IllegalStateException_init_$Create$(toString(message));
832
+ }
833
+ if (!this.k1p(path)) {
834
+ if (mustExist) {
835
+ throw new FileNotFoundException('File does not exist: ' + path.t1p_1);
836
+ }
837
+ return Unit_instance;
838
+ }
839
+ try {
840
+ var stats = get_fs().statSync(path.t1p_1);
841
+ var tmp = stats.isDirectory();
842
+ if ((!(tmp == null) ? typeof tmp === 'boolean' : false) ? tmp : THROW_CCE()) {
843
+ get_fs().rmdirSync(path.t1p_1);
844
+ } else {
845
+ get_fs().rmSync(path.t1p_1);
846
+ }
847
+ } catch ($p) {
848
+ if ($p instanceof Error) {
849
+ var t = $p;
850
+ throw new IOException('Delete failed for ' + path, t);
851
+ } else {
852
+ throw $p;
853
+ }
854
+ }
855
+ };
856
+ protoOf(SystemFileSystem$1).n1p = function (path, mustCreate) {
857
+ var metadata = this.u1p(path);
858
+ if (!(metadata == null)) {
859
+ if (mustCreate) {
860
+ throw IOException_init_$Create$('Path already exists: ' + path);
861
+ }
862
+ if (metadata.q1p_1) {
863
+ throw IOException_init_$Create$("Path already exists and it's a file: " + path);
864
+ }
865
+ return Unit_instance;
866
+ }
867
+ // Inline function 'kotlin.collections.arrayListOf' call
868
+ var parts = ArrayList_init_$Create$();
869
+ var p = path;
870
+ while (!(p == null) ? !this.k1p(p) : false) {
871
+ parts.s(p.toString());
872
+ p = p.v1p();
873
+ }
874
+ // Inline function 'kotlin.collections.forEach' call
875
+ var tmp0_iterator = asReversed(parts).v();
876
+ while (tmp0_iterator.w()) {
877
+ var element = tmp0_iterator.y();
878
+ // Inline function 'kotlinx.io.files.<no name provided>.createDirectories.<anonymous>' call
879
+ get_fs().mkdirSync(element);
880
+ }
881
+ };
882
+ protoOf(SystemFileSystem$1).u1p = function (path) {
883
+ // Inline function 'kotlin.check' call
884
+ // Inline function 'kotlin.contracts.contract' call
885
+ if (!(get_fs() !== null)) {
886
+ // Inline function 'kotlinx.io.files.<no name provided>.metadataOrNull.<anonymous>' call
887
+ var message = "Module 'fs' was not found";
888
+ throw IllegalStateException_init_$Create$(toString(message));
889
+ }
890
+ var tmp;
891
+ try {
892
+ var stat = get_fs().statSync(path.t1p_1);
893
+ var tmp_0 = stat.mode;
894
+ var mode = (!(tmp_0 == null) ? typeof tmp_0 === 'number' : false) ? tmp_0 : THROW_CCE();
895
+ var tmp_1 = get_fs().constants.S_IFMT;
896
+ var isFile = equals(mode & ((!(tmp_1 == null) ? typeof tmp_1 === 'number' : false) ? tmp_1 : THROW_CCE()), get_fs().constants.S_IFREG);
897
+ var tmp_2 = get_fs().constants.S_IFMT;
898
+ var tmp_3 = equals(mode & ((!(tmp_2 == null) ? typeof tmp_2 === 'number' : false) ? tmp_2 : THROW_CCE()), get_fs().constants.S_IFDIR);
899
+ var tmp_4;
900
+ if (isFile) {
901
+ var tmp_5 = stat.size;
902
+ tmp_4 = toLong((!(tmp_5 == null) ? typeof tmp_5 === 'number' : false) ? tmp_5 : THROW_CCE());
903
+ } else {
904
+ tmp_4 = new Long(-1, -1);
905
+ }
906
+ tmp = new FileMetadata(isFile, tmp_3, tmp_4);
907
+ } catch ($p) {
908
+ var tmp_6;
909
+ if ($p instanceof Error) {
910
+ var t = $p;
911
+ if (this.k1p(path))
912
+ throw new IOException('Stat failed for ' + path, t);
913
+ return null;
914
+ } else {
915
+ throw $p;
916
+ }
917
+ }
918
+ return tmp;
919
+ };
920
+ protoOf(SystemFileSystem$1).p1p = function (path, append) {
921
+ // Inline function 'kotlin.check' call
922
+ // Inline function 'kotlin.contracts.contract' call
923
+ if (!(get_fs() !== null)) {
924
+ // Inline function 'kotlinx.io.files.<no name provided>.sink.<anonymous>' call
925
+ var message = "Module 'fs' was not found";
926
+ throw IllegalStateException_init_$Create$(toString(message));
927
+ }
928
+ // Inline function 'kotlin.check' call
929
+ // Inline function 'kotlin.contracts.contract' call
930
+ if (!(get_buffer() !== null)) {
931
+ // Inline function 'kotlinx.io.files.<no name provided>.sink.<anonymous>' call
932
+ var message_0 = "Module 'buffer' was not found";
933
+ throw IllegalStateException_init_$Create$(toString(message_0));
934
+ }
935
+ return new FileSink(path, append);
936
+ };
937
+ var properties_initialized_FileSystemJs_kt_lg8f5i;
938
+ function _init_properties_FileSystemJs_kt__4boaac() {
939
+ if (!properties_initialized_FileSystemJs_kt_lg8f5i) {
940
+ properties_initialized_FileSystemJs_kt_lg8f5i = true;
941
+ SystemFileSystem = new SystemFileSystem$1();
942
+ isWindows = get_os().platform() == 'win32';
943
+ }
944
+ }
945
+ function get_SystemPathSeparator() {
946
+ _init_properties_PathsJs_kt__cx5uqj();
947
+ // Inline function 'kotlin.getValue' call
948
+ var this_0 = SystemPathSeparator$delegate;
949
+ SystemPathSeparator$factory();
950
+ return this_0.o2().u8_1;
951
+ }
952
+ var SystemPathSeparator$delegate;
953
+ function Path_1(rawPath, any) {
954
+ this.t1p_1 = removeTrailingSeparators(rawPath);
955
+ }
956
+ protoOf(Path_1).v1p = function () {
957
+ // Inline function 'kotlin.check' call
958
+ // Inline function 'kotlin.contracts.contract' call
959
+ if (!(get_pathLib() !== null)) {
960
+ // Inline function 'kotlinx.io.files.Path.<get-parent>.<anonymous>' call
961
+ var message = 'Path module not found';
962
+ throw IllegalStateException_init_$Create$(toString(message));
963
+ }
964
+ // Inline function 'kotlin.text.isEmpty' call
965
+ var this_0 = this.t1p_1;
966
+ if (charSequenceLength(this_0) === 0)
967
+ return null;
968
+ if (get_isWindows()) {
969
+ if (!contains(this.t1p_1, get_UnixPathSeparator()) ? !contains(this.t1p_1, get_WindowsPathSeparator()) : false) {
970
+ return null;
971
+ }
972
+ } else if (!contains(this.t1p_1, get_SystemPathSeparator())) {
973
+ return null;
974
+ }
975
+ var tmp = get_pathLib().dirname(this.t1p_1);
976
+ var p = (tmp == null ? true : typeof tmp === 'string') ? tmp : THROW_CCE();
977
+ var tmp_0;
978
+ // Inline function 'kotlin.text.isNullOrEmpty' call
979
+ // Inline function 'kotlin.contracts.contract' call
980
+ if (p == null ? true : charSequenceLength(p) === 0) {
981
+ tmp_0 = null;
982
+ } else {
983
+ if (p === this.t1p_1) {
984
+ tmp_0 = null;
985
+ } else {
986
+ tmp_0 = Path_2(p);
987
+ }
988
+ }
989
+ return tmp_0;
990
+ };
991
+ protoOf(Path_1).toString = function () {
992
+ return this.t1p_1;
993
+ };
994
+ protoOf(Path_1).equals = function (other) {
995
+ if (this === other)
996
+ return true;
997
+ if (!(other instanceof Path_1))
998
+ return false;
999
+ return this.t1p_1 === other.t1p_1;
1000
+ };
1001
+ protoOf(Path_1).hashCode = function () {
1002
+ return getStringHashCode(this.t1p_1);
1003
+ };
1004
+ function open($this, path, append) {
1005
+ var flags = append ? 'a' : 'w';
1006
+ var tmp;
1007
+ try {
1008
+ tmp = get_fs().openSync(path.t1p_1, flags);
1009
+ } catch ($p) {
1010
+ var tmp_0;
1011
+ if ($p instanceof Error) {
1012
+ var e = $p;
1013
+ throw new IOException('Failed to open a file ' + path.t1p_1 + '.', e);
1014
+ } else {
1015
+ throw $p;
1016
+ }
1017
+ }
1018
+ var fd = tmp;
1019
+ if (fd < 0)
1020
+ throw IOException_init_$Create$('Failed to open a file ' + path.t1p_1 + '.');
1021
+ return fd;
1022
+ }
1023
+ function FileSink(path, append) {
1024
+ this.w1p_1 = false;
1025
+ this.x1p_1 = open(this, path, append);
1026
+ }
1027
+ protoOf(FileSink).y1o = function (source, byteCount) {
1028
+ // Inline function 'kotlin.check' call
1029
+ // Inline function 'kotlin.contracts.contract' call
1030
+ if (!!this.w1p_1) {
1031
+ // Inline function 'kotlinx.io.files.FileSink.write.<anonymous>' call
1032
+ var message = 'Sink is closed.';
1033
+ throw IllegalStateException_init_$Create$(toString(message));
1034
+ }
1035
+ if (byteCount.equals(new Long(0, 0))) {
1036
+ return Unit_instance;
1037
+ }
1038
+ // Inline function 'kotlin.comparisons.minOf' call
1039
+ var b = source.e1o_1;
1040
+ var remainingBytes = byteCount.k8(b) <= 0 ? byteCount : b;
1041
+ while (remainingBytes.k8(new Long(0, 0)) > 0) {
1042
+ var head = ensureNotNull(source.d1o_1);
1043
+ var segmentBytes = head.l1o_1 - head.k1o_1 | 0;
1044
+ var buf = get_buffer().Buffer.allocUnsafe(segmentBytes);
1045
+ buf.fill(head.j1o_1, head.k1o_1, segmentBytes);
1046
+ try {
1047
+ get_fs().writeFileSync(this.x1p_1, buf);
1048
+ } catch ($p) {
1049
+ if ($p instanceof Error) {
1050
+ var e = $p;
1051
+ throw new IOException('Write failed', e);
1052
+ } else {
1053
+ throw $p;
1054
+ }
1055
+ }
1056
+ source.q1o(toLong(segmentBytes));
1057
+ // Inline function 'kotlin.Long.minus' call
1058
+ remainingBytes = remainingBytes.p9(toLong(segmentBytes));
1059
+ }
1060
+ };
1061
+ protoOf(FileSink).d1p = function () {
1062
+ if (!this.w1p_1) {
1063
+ this.w1p_1 = true;
1064
+ get_fs().closeSync(this.x1p_1);
1065
+ }
1066
+ };
1067
+ function Path_2(path) {
1068
+ _init_properties_PathsJs_kt__cx5uqj();
1069
+ return new Path_1(path, null);
1070
+ }
1071
+ function SystemPathSeparator$delegate$lambda() {
1072
+ _init_properties_PathsJs_kt__cx5uqj();
1073
+ // Inline function 'kotlin.check' call
1074
+ // Inline function 'kotlin.contracts.contract' call
1075
+ if (!(get_pathLib() != null)) {
1076
+ // Inline function 'kotlinx.io.files.SystemPathSeparator$delegate.<anonymous>.<anonymous>' call
1077
+ var message = 'Path module not found';
1078
+ throw IllegalStateException_init_$Create$(toString(message));
1079
+ }
1080
+ var tmp = get_pathLib().sep;
1081
+ var sep = (!(tmp == null) ? typeof tmp === 'string' : false) ? tmp : THROW_CCE();
1082
+ // Inline function 'kotlin.check' call
1083
+ // Inline function 'kotlin.contracts.contract' call
1084
+ // Inline function 'kotlin.check' call
1085
+ // Inline function 'kotlin.contracts.contract' call
1086
+ if (!(sep.length === 1)) {
1087
+ // Inline function 'kotlin.check.<anonymous>' call
1088
+ var message_0 = 'Check failed.';
1089
+ throw IllegalStateException_init_$Create$(toString(message_0));
1090
+ }
1091
+ return new Char(charSequenceGet(sep, 0));
1092
+ }
1093
+ function SystemPathSeparator$factory() {
1094
+ return getPropertyCallableRef('SystemPathSeparator', 0, KProperty0, function () {
1095
+ return new Char(get_SystemPathSeparator());
1096
+ }, null);
1097
+ }
1098
+ var properties_initialized_PathsJs_kt_chgord;
1099
+ function _init_properties_PathsJs_kt__cx5uqj() {
1100
+ if (!properties_initialized_PathsJs_kt_chgord) {
1101
+ properties_initialized_PathsJs_kt_chgord = true;
1102
+ SystemPathSeparator$delegate = lazy(SystemPathSeparator$delegate$lambda);
1103
+ }
1104
+ }
1105
+ function get_fs() {
1106
+ var tmp;
1107
+ try {
1108
+ tmp = require('fs');
1109
+ } catch ($p) {
1110
+ var tmp_0;
1111
+ if ($p instanceof Error) {
1112
+ var t = $p;
1113
+ tmp_0 = null;
1114
+ } else {
1115
+ throw $p;
1116
+ }
1117
+ tmp = tmp_0;
1118
+ }
1119
+ return tmp;
1120
+ }
1121
+ function get_buffer() {
1122
+ var tmp;
1123
+ try {
1124
+ tmp = require('buffer');
1125
+ } catch ($p) {
1126
+ var tmp_0;
1127
+ if ($p instanceof Error) {
1128
+ var t = $p;
1129
+ tmp_0 = null;
1130
+ } else {
1131
+ throw $p;
1132
+ }
1133
+ tmp = tmp_0;
1134
+ }
1135
+ return tmp;
1136
+ }
1137
+ function get_os() {
1138
+ var tmp;
1139
+ try {
1140
+ tmp = require('os');
1141
+ } catch ($p) {
1142
+ var tmp_0;
1143
+ if ($p instanceof Error) {
1144
+ var t = $p;
1145
+ tmp_0 = null;
1146
+ } else {
1147
+ throw $p;
1148
+ }
1149
+ tmp = tmp_0;
1150
+ }
1151
+ return tmp;
1152
+ }
1153
+ function get_pathLib() {
1154
+ var tmp;
1155
+ try {
1156
+ tmp = require('path');
1157
+ } catch ($p) {
1158
+ var tmp_0;
1159
+ if ($p instanceof Error) {
1160
+ var t = $p;
1161
+ tmp_0 = null;
1162
+ } else {
1163
+ throw $p;
1164
+ }
1165
+ tmp = tmp_0;
1166
+ }
1167
+ return tmp;
1168
+ }
1169
+ //region block: post-declaration
1170
+ protoOf(SystemFileSystemImpl).m1p = delete$default;
1171
+ protoOf(SystemFileSystemImpl).o1p = createDirectories$default;
1172
+ //endregion
1173
+ //region block: init
1174
+ Companion_instance = new Companion();
1175
+ UnixPathSeparator = _Char___init__impl__6a9atx(47);
1176
+ WindowsPathSeparator = _Char___init__impl__6a9atx(92);
1177
+ SegmentPool_instance = new SegmentPool();
1178
+ //endregion
1179
+ //region block: exports
1180
+ _.$_$ = _.$_$ || {};
1181
+ _.$_$.a = Path;
1182
+ _.$_$.b = Path_2;
1183
+ _.$_$.c = get_SystemFileSystem;
1184
+ _.$_$.d = get_SystemTemporaryDirectory;
1185
+ _.$_$.e = buffered;
1186
+ _.$_$.f = writeString;
1187
+ //endregion
1188
+ return _;
1189
+ }));
1190
+
1191
+ //# sourceMappingURL=kotlinx-io-kotlinx-io-core.js.map