@solibo/home-api 1.1.9 → 1.1.10

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 (113) hide show
  1. package/Kotlin-DateTime-library-kotlinx-datetime.mjs +3601 -0
  2. package/Kotlin-DateTime-library-kotlinx-datetime.mjs.map +1 -0
  3. package/MultiplatformSettings-multiplatform-settings-no-arg.mjs +4 -0
  4. package/{MultiplatformSettings-multiplatform-settings.js.map → MultiplatformSettings-multiplatform-settings-no-arg.mjs.map} +1 -1
  5. package/MultiplatformSettings-multiplatform-settings.mjs +4 -0
  6. package/{kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js.map → MultiplatformSettings-multiplatform-settings.mjs.map} +1 -1
  7. package/kotlin-kotlin-stdlib.mjs +17369 -0
  8. package/kotlin-kotlin-stdlib.mjs.map +1 -0
  9. package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs +4 -0
  10. package/{kotlinx-serialization-kotlinx-serialization-json-io.js.map → kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs.map} +1 -1
  11. package/kotlinx-atomicfu.mjs +250 -0
  12. package/kotlinx-atomicfu.mjs.map +1 -0
  13. package/kotlinx-browser.mjs +8 -0
  14. package/{kotlinx-browser.js.map → kotlinx-browser.mjs.map} +1 -1
  15. package/kotlinx-coroutines-core.mjs +8888 -0
  16. package/kotlinx-coroutines-core.mjs.map +1 -0
  17. package/kotlinx-io-kotlinx-io-bytestring.mjs +202 -0
  18. package/kotlinx-io-kotlinx-io-bytestring.mjs.map +1 -0
  19. package/kotlinx-io-kotlinx-io-core.mjs +2020 -0
  20. package/kotlinx-io-kotlinx-io-core.mjs.map +1 -0
  21. package/kotlinx-serialization-kotlinx-serialization-core.mjs +6045 -0
  22. package/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -0
  23. package/kotlinx-serialization-kotlinx-serialization-json-io.mjs +4 -0
  24. package/{MultiplatformSettings-multiplatform-settings-no-arg.js.map → kotlinx-serialization-kotlinx-serialization-json-io.mjs.map} +1 -1
  25. package/kotlinx-serialization-kotlinx-serialization-json.mjs +5061 -0
  26. package/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
  27. package/ktor-ktor-client-auth.mjs +4 -0
  28. package/ktor-ktor-client-auth.mjs.map +1 -0
  29. package/ktor-ktor-client-content-negotiation.mjs +750 -0
  30. package/ktor-ktor-client-content-negotiation.mjs.map +1 -0
  31. package/ktor-ktor-client-core.mjs +9810 -0
  32. package/ktor-ktor-client-core.mjs.map +1 -0
  33. package/ktor-ktor-client-logging.mjs +4 -0
  34. package/ktor-ktor-client-logging.mjs.map +1 -0
  35. package/ktor-ktor-events.mjs +81 -0
  36. package/ktor-ktor-events.mjs.map +1 -0
  37. package/ktor-ktor-http-cio.mjs +2254 -0
  38. package/ktor-ktor-http-cio.mjs.map +1 -0
  39. package/ktor-ktor-http.mjs +3238 -0
  40. package/ktor-ktor-http.mjs.map +1 -0
  41. package/ktor-ktor-io.mjs +3536 -0
  42. package/ktor-ktor-io.mjs.map +1 -0
  43. package/ktor-ktor-serialization-kotlinx-json.mjs +46 -0
  44. package/{ktor-ktor-serialization-kotlinx-json.js.map → ktor-ktor-serialization-kotlinx-json.mjs.map} +1 -1
  45. package/ktor-ktor-serialization-kotlinx.mjs +843 -0
  46. package/ktor-ktor-serialization-kotlinx.mjs.map +1 -0
  47. package/ktor-ktor-serialization.mjs +364 -0
  48. package/ktor-ktor-serialization.mjs.map +1 -0
  49. package/ktor-ktor-sse.mjs +4 -0
  50. package/ktor-ktor-sse.mjs.map +1 -0
  51. package/ktor-ktor-utils.mjs +2620 -0
  52. package/ktor-ktor-utils.mjs.map +1 -0
  53. package/ktor-ktor-websocket-serialization.mjs +4 -0
  54. package/ktor-ktor-websocket-serialization.mjs.map +1 -0
  55. package/ktor-ktor-websockets.mjs +2535 -0
  56. package/ktor-ktor-websockets.mjs.map +1 -0
  57. package/package.json +2 -3
  58. package/solibo-sdk-sdk-home-api.d.mts +13419 -0
  59. package/solibo-sdk-sdk-home-api.mjs +199394 -0
  60. package/solibo-sdk-sdk-home-api.mjs.map +1 -0
  61. package/Kotlin-DateTime-library-kotlinx-datetime.js +0 -3614
  62. package/Kotlin-DateTime-library-kotlinx-datetime.js.map +0 -1
  63. package/MultiplatformSettings-multiplatform-settings-no-arg.js +0 -15
  64. package/MultiplatformSettings-multiplatform-settings.js +0 -15
  65. package/kotlin-kotlin-stdlib.js +0 -17392
  66. package/kotlin-kotlin-stdlib.js.map +0 -1
  67. package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js +0 -15
  68. package/kotlinx-atomicfu.js +0 -262
  69. package/kotlinx-atomicfu.js.map +0 -1
  70. package/kotlinx-browser.js +0 -19
  71. package/kotlinx-coroutines-core.js +0 -8901
  72. package/kotlinx-coroutines-core.js.map +0 -1
  73. package/kotlinx-io-kotlinx-io-bytestring.js +0 -214
  74. package/kotlinx-io-kotlinx-io-bytestring.js.map +0 -1
  75. package/kotlinx-io-kotlinx-io-core.js +0 -2035
  76. package/kotlinx-io-kotlinx-io-core.js.map +0 -1
  77. package/kotlinx-serialization-kotlinx-serialization-core.js +0 -6057
  78. package/kotlinx-serialization-kotlinx-serialization-core.js.map +0 -1
  79. package/kotlinx-serialization-kotlinx-serialization-json-io.js +0 -15
  80. package/kotlinx-serialization-kotlinx-serialization-json.js +0 -5074
  81. package/kotlinx-serialization-kotlinx-serialization-json.js.map +0 -1
  82. package/ktor-ktor-client-auth.js +0 -15
  83. package/ktor-ktor-client-auth.js.map +0 -1
  84. package/ktor-ktor-client-content-negotiation.js +0 -767
  85. package/ktor-ktor-client-content-negotiation.js.map +0 -1
  86. package/ktor-ktor-client-core.js +0 -9839
  87. package/ktor-ktor-client-core.js.map +0 -1
  88. package/ktor-ktor-client-logging.js +0 -15
  89. package/ktor-ktor-client-logging.js.map +0 -1
  90. package/ktor-ktor-events.js +0 -94
  91. package/ktor-ktor-events.js.map +0 -1
  92. package/ktor-ktor-http-cio.js +0 -2271
  93. package/ktor-ktor-http-cio.js.map +0 -1
  94. package/ktor-ktor-http.js +0 -3253
  95. package/ktor-ktor-http.js.map +0 -1
  96. package/ktor-ktor-io.js +0 -3556
  97. package/ktor-ktor-io.js.map +0 -1
  98. package/ktor-ktor-serialization-kotlinx-json.js +0 -67
  99. package/ktor-ktor-serialization-kotlinx.js +0 -865
  100. package/ktor-ktor-serialization-kotlinx.js.map +0 -1
  101. package/ktor-ktor-serialization.js +0 -379
  102. package/ktor-ktor-serialization.js.map +0 -1
  103. package/ktor-ktor-sse.js +0 -15
  104. package/ktor-ktor-sse.js.map +0 -1
  105. package/ktor-ktor-utils.js +0 -2639
  106. package/ktor-ktor-utils.js.map +0 -1
  107. package/ktor-ktor-websocket-serialization.js +0 -15
  108. package/ktor-ktor-websocket-serialization.js.map +0 -1
  109. package/ktor-ktor-websockets.js +0 -2552
  110. package/ktor-ktor-websockets.js.map +0 -1
  111. package/solibo-sdk-sdk-home-api.d.ts +0 -12624
  112. package/solibo-sdk-sdk-home-api.js +0 -203510
  113. package/solibo-sdk-sdk-home-api.js.map +0 -1
@@ -1,2035 +0,0 @@
1
- (function (factory) {
2
- if (typeof define === 'function' && define.amd)
3
- define(['exports', './kotlin-kotlin-stdlib.js', './kotlinx-io-kotlinx-io-bytestring.js'], factory);
4
- else if (typeof exports === 'object')
5
- factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./kotlinx-io-kotlinx-io-bytestring.js'));
6
- else {
7
- if (typeof globalThis['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
- if (typeof globalThis['kotlinx-io-kotlinx-io-bytestring'] === 'undefined') {
11
- throw new Error("Error loading module 'kotlinx-io-kotlinx-io-core'. Its dependency 'kotlinx-io-kotlinx-io-bytestring' was not found. Please, check whether 'kotlinx-io-kotlinx-io-bytestring' is loaded prior to 'kotlinx-io-kotlinx-io-core'.");
12
- }
13
- globalThis['kotlinx-io-kotlinx-io-core'] = factory(typeof globalThis['kotlinx-io-kotlinx-io-core'] === 'undefined' ? {} : globalThis['kotlinx-io-kotlinx-io-core'], globalThis['kotlin-kotlin-stdlib'], globalThis['kotlinx-io-kotlinx-io-bytestring']);
14
- }
15
- }(function (_, kotlin_kotlin, kotlin_org_jetbrains_kotlinx_kotlinx_io_bytestring) {
16
- 'use strict';
17
- //region block: imports
18
- var imul = Math.imul;
19
- var IndexOutOfBoundsException_init_$Create$ = kotlin_kotlin.$_$.u1;
20
- var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.n1;
21
- var subtract = kotlin_kotlin.$_$.z9;
22
- var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.g2;
23
- var charArrayOf = kotlin_kotlin.$_$.ga;
24
- var protoOf = kotlin_kotlin.$_$.ub;
25
- var toString = kotlin_kotlin.$_$.xb;
26
- var Unit_instance = kotlin_kotlin.$_$.y4;
27
- var toShort = kotlin_kotlin.$_$.wb;
28
- var add = kotlin_kotlin.$_$.l9;
29
- var ensureNotNull = kotlin_kotlin.$_$.ng;
30
- var fromInt = kotlin_kotlin.$_$.q9;
31
- var convertToInt = kotlin_kotlin.$_$.n9;
32
- var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.b1;
33
- var initMetadataForClass = kotlin_kotlin.$_$.xa;
34
- var VOID = kotlin_kotlin.$_$.b;
35
- var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.r1;
36
- var UnsafeByteStringOperations_instance = kotlin_org_jetbrains_kotlinx_kotlinx_io_bytestring.$_$.b;
37
- var AutoCloseable = kotlin_kotlin.$_$.ff;
38
- var objectCreate = kotlin_kotlin.$_$.tb;
39
- var initMetadataForCompanion = kotlin_kotlin.$_$.ya;
40
- var arrayCopy = kotlin_kotlin.$_$.p5;
41
- var toByte = kotlin_kotlin.$_$.vb;
42
- var IllegalArgumentException_init_$Create$_0 = kotlin_kotlin.$_$.l1;
43
- var initMetadataForObject = kotlin_kotlin.$_$.db;
44
- var initMetadataForInterface = kotlin_kotlin.$_$.bb;
45
- var multiply = kotlin_kotlin.$_$.u9;
46
- var charCodeAt = kotlin_kotlin.$_$.ia;
47
- var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.m2;
48
- var charArray = kotlin_kotlin.$_$.ha;
49
- var numberToChar = kotlin_kotlin.$_$.sb;
50
- var concatToString = kotlin_kotlin.$_$.wc;
51
- var Exception_init_$Init$ = kotlin_kotlin.$_$.g1;
52
- var captureStack = kotlin_kotlin.$_$.fa;
53
- var Exception_init_$Init$_0 = kotlin_kotlin.$_$.h1;
54
- var Exception_init_$Init$_1 = kotlin_kotlin.$_$.j1;
55
- var Exception = kotlin_kotlin.$_$.of;
56
- //endregion
57
- //region block: pre-declaration
58
- initMetadataForInterface(Source, 'Source', VOID, VOID, [AutoCloseable]);
59
- function write$default(source, startIndex, endIndex, $super) {
60
- startIndex = startIndex === VOID ? 0 : startIndex;
61
- endIndex = endIndex === VOID ? source.length : endIndex;
62
- var tmp;
63
- if ($super === VOID) {
64
- this.aq(source, startIndex, endIndex);
65
- tmp = Unit_instance;
66
- } else {
67
- tmp = $super.aq.call(this, source, startIndex, endIndex);
68
- }
69
- return tmp;
70
- }
71
- initMetadataForInterface(Sink, 'Sink', VOID, VOID, [AutoCloseable]);
72
- initMetadataForClass(Buffer, 'Buffer', Buffer, VOID, [Source, Sink]);
73
- initMetadataForClass(PeekSource, 'PeekSource', VOID, VOID, [AutoCloseable]);
74
- initMetadataForClass(RealSource, 'RealSource', VOID, VOID, [Source]);
75
- initMetadataForCompanion(Companion);
76
- initMetadataForClass(Segment, 'Segment');
77
- initMetadataForClass(SegmentCopyTracker, 'SegmentCopyTracker');
78
- initMetadataForObject(AlwaysSharedCopyTracker, 'AlwaysSharedCopyTracker', VOID, SegmentCopyTracker);
79
- initMetadataForObject(UnsafeBufferOperations, 'UnsafeBufferOperations');
80
- initMetadataForClass(SegmentReadContextImpl$1);
81
- initMetadataForClass(SegmentWriteContextImpl$1);
82
- initMetadataForClass(BufferIterationContextImpl$1);
83
- initMetadataForClass(IOException, 'IOException', IOException_init_$Create$, Exception);
84
- initMetadataForClass(EOFException, 'EOFException', EOFException_init_$Create$, IOException);
85
- initMetadataForObject(SegmentPool, 'SegmentPool');
86
- //endregion
87
- function get_HEX_DIGIT_CHARS() {
88
- _init_properties__Util_kt__g8tcl9();
89
- return HEX_DIGIT_CHARS;
90
- }
91
- var HEX_DIGIT_CHARS;
92
- function checkBounds(size, startIndex, endIndex) {
93
- _init_properties__Util_kt__g8tcl9();
94
- if (startIndex < 0n || endIndex > size) {
95
- throw IndexOutOfBoundsException_init_$Create$('startIndex (' + startIndex.toString() + ') and endIndex (' + endIndex.toString() + ') are not within the range [0..size(' + size.toString() + '))');
96
- }
97
- if (startIndex > endIndex) {
98
- throw IllegalArgumentException_init_$Create$('startIndex (' + startIndex.toString() + ') > endIndex (' + endIndex.toString() + ')');
99
- }
100
- }
101
- function checkOffsetAndCount(size, offset, byteCount) {
102
- _init_properties__Util_kt__g8tcl9();
103
- if (offset < 0n || offset > size || subtract(size, offset) < byteCount || byteCount < 0n) {
104
- throw IllegalArgumentException_init_$Create$('offset (' + offset.toString() + ') and byteCount (' + byteCount.toString() + ') are not within the range [0..size(' + size.toString() + '))');
105
- }
106
- }
107
- var properties_initialized__Util_kt_67kc5b;
108
- function _init_properties__Util_kt__g8tcl9() {
109
- if (!properties_initialized__Util_kt_67kc5b) {
110
- properties_initialized__Util_kt_67kc5b = true;
111
- // Inline function 'kotlin.charArrayOf' call
112
- 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)]);
113
- }
114
- }
115
- function throwEof($this, byteCount) {
116
- throw EOFException_init_$Create$_0("Buffer doesn't contain required number of bytes (size: " + $this.g1().toString() + ', required: ' + byteCount.toString() + ')');
117
- }
118
- function Buffer() {
119
- this.no_1 = null;
120
- this.oo_1 = null;
121
- this.po_1 = 0n;
122
- }
123
- protoOf(Buffer).g1 = function () {
124
- return this.po_1;
125
- };
126
- protoOf(Buffer).qo = function () {
127
- return this;
128
- };
129
- protoOf(Buffer).ro = function () {
130
- return this.g1() === 0n;
131
- };
132
- protoOf(Buffer).so = function (byteCount) {
133
- // Inline function 'kotlin.require' call
134
- if (!(byteCount >= 0n)) {
135
- var message = 'byteCount: ' + byteCount.toString();
136
- throw IllegalArgumentException_init_$Create$(toString(message));
137
- }
138
- if (this.g1() < byteCount) {
139
- throw EOFException_init_$Create$_0("Buffer doesn't contain required number of bytes (size: " + this.g1().toString() + ', required: ' + byteCount.toString() + ')');
140
- }
141
- };
142
- protoOf(Buffer).to = function (byteCount) {
143
- // Inline function 'kotlin.require' call
144
- if (!(byteCount >= 0n)) {
145
- var message = 'byteCount: ' + byteCount.toString() + ' < 0';
146
- throw IllegalArgumentException_init_$Create$(toString(message));
147
- }
148
- return this.g1() >= byteCount;
149
- };
150
- protoOf(Buffer).uo = function () {
151
- var tmp0_elvis_lhs = this.no_1;
152
- var tmp;
153
- if (tmp0_elvis_lhs == null) {
154
- throwEof(this, 1n);
155
- } else {
156
- tmp = tmp0_elvis_lhs;
157
- }
158
- var segment = tmp;
159
- var segmentSize = segment.g1();
160
- if (segmentSize === 0) {
161
- this.cp();
162
- return this.uo();
163
- }
164
- var v = segment.dp();
165
- this.po_1 = subtract(this.po_1, 1n);
166
- if (segmentSize === 1) {
167
- this.cp();
168
- }
169
- return v;
170
- };
171
- protoOf(Buffer).ep = function () {
172
- var tmp0_elvis_lhs = this.no_1;
173
- var tmp;
174
- if (tmp0_elvis_lhs == null) {
175
- throwEof(this, 2n);
176
- } else {
177
- tmp = tmp0_elvis_lhs;
178
- }
179
- var segment = tmp;
180
- var segmentSize = segment.g1();
181
- if (segmentSize < 2) {
182
- this.so(2n);
183
- if (segmentSize === 0) {
184
- this.cp();
185
- return this.ep();
186
- }
187
- // Inline function 'kotlinx.io.and' call
188
- var tmp_0 = (this.uo() & 255) << 8;
189
- // Inline function 'kotlinx.io.and' call
190
- var tmp$ret$1 = this.uo() & 255;
191
- return toShort(tmp_0 | tmp$ret$1);
192
- }
193
- var v = segment.fp();
194
- this.po_1 = subtract(this.po_1, 2n);
195
- if (segmentSize === 2) {
196
- this.cp();
197
- }
198
- return v;
199
- };
200
- protoOf(Buffer).gp = function () {
201
- return Unit_instance;
202
- };
203
- protoOf(Buffer).hp = function (out, startIndex, endIndex) {
204
- checkBounds(this.g1(), startIndex, endIndex);
205
- if (startIndex === endIndex)
206
- return Unit_instance;
207
- var currentOffset = startIndex;
208
- var remainingByteCount = subtract(endIndex, startIndex);
209
- out.po_1 = add(out.po_1, remainingByteCount);
210
- var s = this.no_1;
211
- while (currentOffset >= fromInt(ensureNotNull(s).xo_1 - s.wo_1 | 0)) {
212
- currentOffset = subtract(currentOffset, fromInt(s.xo_1 - s.wo_1 | 0));
213
- s = s.ap_1;
214
- }
215
- while (remainingByteCount > 0n) {
216
- var copy = ensureNotNull(s).ip();
217
- copy.wo_1 = copy.wo_1 + convertToInt(currentOffset) | 0;
218
- var tmp = copy;
219
- var tmp0 = copy.wo_1 + convertToInt(remainingByteCount) | 0;
220
- // Inline function 'kotlin.comparisons.minOf' call
221
- var b = copy.xo_1;
222
- tmp.xo_1 = Math.min(tmp0, b);
223
- // Inline function 'kotlinx.io.Buffer.pushSegment' call
224
- if (out.no_1 == null) {
225
- out.no_1 = copy;
226
- out.oo_1 = copy;
227
- } else if (false) {
228
- out.oo_1 = ensureNotNull(out.oo_1).jp(copy).kp();
229
- if (ensureNotNull(out.oo_1).bp_1 == null) {
230
- out.no_1 = out.oo_1;
231
- }
232
- } else {
233
- out.oo_1 = ensureNotNull(out.oo_1).jp(copy);
234
- }
235
- remainingByteCount = subtract(remainingByteCount, fromInt(copy.xo_1 - copy.wo_1 | 0));
236
- currentOffset = 0n;
237
- s = s.ap_1;
238
- }
239
- };
240
- protoOf(Buffer).lp = function () {
241
- var result = this.g1();
242
- if (result === 0n)
243
- return 0n;
244
- var tail = ensureNotNull(this.oo_1);
245
- if (tail.xo_1 < 8192 && tail.zo_1) {
246
- result = subtract(result, fromInt(tail.xo_1 - tail.wo_1 | 0));
247
- }
248
- return result;
249
- };
250
- protoOf(Buffer).mp = function (position) {
251
- if (position < 0n || position >= this.g1()) {
252
- throw IndexOutOfBoundsException_init_$Create$('position (' + position.toString() + ') is not within the range [0..size(' + this.g1().toString() + '))');
253
- }
254
- if (position === 0n) {
255
- return ensureNotNull(this.no_1).np(0);
256
- }
257
- // Inline function 'kotlinx.io.seek' call
258
- if (this.no_1 == null) {
259
- return ensureNotNull(null).np(convertToInt(subtract(position, -1n)));
260
- }
261
- if (subtract(this.g1(), position) < position) {
262
- var s = this.oo_1;
263
- var offset = this.g1();
264
- $l$loop: while (!(s == null) && offset > position) {
265
- offset = subtract(offset, fromInt(s.xo_1 - s.wo_1 | 0));
266
- if (offset <= position)
267
- break $l$loop;
268
- s = s.bp_1;
269
- }
270
- var tmp0 = s;
271
- var offset_0 = offset;
272
- return ensureNotNull(tmp0).np(convertToInt(subtract(position, offset_0)));
273
- } else {
274
- var s_0 = this.no_1;
275
- var offset_1 = 0n;
276
- $l$loop_0: while (!(s_0 == null)) {
277
- var tmp0_0 = offset_1;
278
- // Inline function 'kotlin.Long.plus' call
279
- var other = s_0.xo_1 - s_0.wo_1 | 0;
280
- var nextOffset = add(tmp0_0, fromInt(other));
281
- if (nextOffset > position)
282
- break $l$loop_0;
283
- s_0 = s_0.ap_1;
284
- offset_1 = nextOffset;
285
- }
286
- var tmp0_1 = s_0;
287
- var offset_2 = offset_1;
288
- return ensureNotNull(tmp0_1).np(convertToInt(subtract(position, offset_2)));
289
- }
290
- };
291
- protoOf(Buffer).n2 = function () {
292
- return this.op(this.g1());
293
- };
294
- protoOf(Buffer).op = function (byteCount) {
295
- // Inline function 'kotlinx.io.checkByteCount' call
296
- // Inline function 'kotlin.require' call
297
- if (!(byteCount >= 0n)) {
298
- var message = 'byteCount (' + byteCount.toString() + ') < 0';
299
- throw IllegalArgumentException_init_$Create$(toString(message));
300
- }
301
- var remainingByteCount = byteCount;
302
- while (remainingByteCount > 0n) {
303
- var tmp0_elvis_lhs = this.no_1;
304
- var tmp;
305
- if (tmp0_elvis_lhs == null) {
306
- throw EOFException_init_$Create$_0('Buffer exhausted before skipping ' + byteCount.toString() + ' bytes.');
307
- } else {
308
- tmp = tmp0_elvis_lhs;
309
- }
310
- var head = tmp;
311
- var tmp0 = remainingByteCount;
312
- // Inline function 'kotlinx.io.minOf' call
313
- var b = head.xo_1 - head.wo_1 | 0;
314
- // Inline function 'kotlin.comparisons.minOf' call
315
- var b_0 = fromInt(b);
316
- var tmp$ret$4 = tmp0 <= b_0 ? tmp0 : b_0;
317
- var toSkip = convertToInt(tmp$ret$4);
318
- this.po_1 = subtract(this.po_1, fromInt(toSkip));
319
- remainingByteCount = subtract(remainingByteCount, fromInt(toSkip));
320
- head.wo_1 = head.wo_1 + toSkip | 0;
321
- if (head.wo_1 === head.xo_1) {
322
- this.cp();
323
- }
324
- }
325
- };
326
- protoOf(Buffer).pp = function (sink, startIndex, endIndex) {
327
- // Inline function 'kotlinx.io.checkBounds' call
328
- var size = sink.length;
329
- checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
330
- var tmp0_elvis_lhs = this.no_1;
331
- var tmp;
332
- if (tmp0_elvis_lhs == null) {
333
- return -1;
334
- } else {
335
- tmp = tmp0_elvis_lhs;
336
- }
337
- var s = tmp;
338
- var tmp0 = endIndex - startIndex | 0;
339
- // Inline function 'kotlin.comparisons.minOf' call
340
- var b = s.g1();
341
- var toCopy = Math.min(tmp0, b);
342
- s.qp(sink, startIndex, startIndex + toCopy | 0);
343
- this.po_1 = subtract(this.po_1, fromInt(toCopy));
344
- if (isEmpty(s)) {
345
- this.cp();
346
- }
347
- return toCopy;
348
- };
349
- protoOf(Buffer).rp = function (sink, byteCount) {
350
- // Inline function 'kotlinx.io.checkByteCount' call
351
- // Inline function 'kotlin.require' call
352
- if (!(byteCount >= 0n)) {
353
- var message = 'byteCount (' + byteCount.toString() + ') < 0';
354
- throw IllegalArgumentException_init_$Create$(toString(message));
355
- }
356
- if (this.g1() === 0n)
357
- return -1n;
358
- var bytesWritten = byteCount > this.g1() ? this.g1() : byteCount;
359
- sink.sp(this, bytesWritten);
360
- return bytesWritten;
361
- };
362
- protoOf(Buffer).tp = function (sink, byteCount) {
363
- // Inline function 'kotlinx.io.checkByteCount' call
364
- // Inline function 'kotlin.require' call
365
- if (!(byteCount >= 0n)) {
366
- var message = 'byteCount (' + byteCount.toString() + ') < 0';
367
- throw IllegalArgumentException_init_$Create$(toString(message));
368
- }
369
- if (this.g1() < byteCount) {
370
- sink.sp(this, this.g1());
371
- throw EOFException_init_$Create$_0('Buffer exhausted before writing ' + byteCount.toString() + ' bytes. Only ' + this.g1().toString() + ' bytes were written.');
372
- }
373
- sink.sp(this, byteCount);
374
- };
375
- protoOf(Buffer).up = function (sink) {
376
- var byteCount = this.g1();
377
- if (byteCount > 0n) {
378
- sink.sp(this, byteCount);
379
- }
380
- return byteCount;
381
- };
382
- protoOf(Buffer).vp = function () {
383
- return buffered(new PeekSource(this));
384
- };
385
- protoOf(Buffer).wp = function (minimumCapacity) {
386
- // Inline function 'kotlin.require' call
387
- if (!(minimumCapacity >= 1 && minimumCapacity <= 8192)) {
388
- var message = 'unexpected capacity (' + minimumCapacity + '), should be in range [1, 8192]';
389
- throw IllegalArgumentException_init_$Create$(toString(message));
390
- }
391
- if (this.oo_1 == null) {
392
- var result = SegmentPool_instance.zp();
393
- this.no_1 = result;
394
- this.oo_1 = result;
395
- return result;
396
- }
397
- var t = ensureNotNull(this.oo_1);
398
- if ((t.xo_1 + minimumCapacity | 0) > 8192 || !t.zo_1) {
399
- var newTail = t.jp(SegmentPool_instance.zp());
400
- this.oo_1 = newTail;
401
- return newTail;
402
- }
403
- return t;
404
- };
405
- protoOf(Buffer).aq = function (source, startIndex, endIndex) {
406
- // Inline function 'kotlinx.io.checkBounds' call
407
- var size = source.length;
408
- checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
409
- var currentOffset = startIndex;
410
- while (currentOffset < endIndex) {
411
- var tail = this.wp(1);
412
- var tmp0 = endIndex - currentOffset | 0;
413
- // Inline function 'kotlin.comparisons.minOf' call
414
- var b = tail.bq();
415
- var toCopy = Math.min(tmp0, b);
416
- tail.cq(source, currentOffset, currentOffset + toCopy | 0);
417
- currentOffset = currentOffset + toCopy | 0;
418
- }
419
- var tmp = this;
420
- var tmp0_0 = this.po_1;
421
- // Inline function 'kotlin.Long.plus' call
422
- var other = endIndex - startIndex | 0;
423
- tmp.po_1 = add(tmp0_0, fromInt(other));
424
- };
425
- protoOf(Buffer).eq = function (source, byteCount) {
426
- // Inline function 'kotlinx.io.checkByteCount' call
427
- // Inline function 'kotlin.require' call
428
- if (!(byteCount >= 0n)) {
429
- var message = 'byteCount (' + byteCount.toString() + ') < 0';
430
- throw IllegalArgumentException_init_$Create$(toString(message));
431
- }
432
- var remainingByteCount = byteCount;
433
- while (remainingByteCount > 0n) {
434
- var read = source.rp(this, remainingByteCount);
435
- if (read === -1n) {
436
- throw EOFException_init_$Create$_0('Source exhausted before reading ' + byteCount.toString() + ' bytes. ' + ('Only ' + subtract(byteCount, remainingByteCount).toString() + ' were read.'));
437
- }
438
- remainingByteCount = subtract(remainingByteCount, read);
439
- }
440
- };
441
- protoOf(Buffer).sp = function (source, byteCount) {
442
- // Inline function 'kotlin.require' call
443
- if (!!(source === this)) {
444
- var message = 'source == this';
445
- throw IllegalArgumentException_init_$Create$(toString(message));
446
- }
447
- checkOffsetAndCount(source.po_1, 0n, byteCount);
448
- var remainingByteCount = byteCount;
449
- while (remainingByteCount > 0n) {
450
- if (remainingByteCount < fromInt(ensureNotNull(source.no_1).g1())) {
451
- var tail = this.oo_1;
452
- var tmp;
453
- if (!(tail == null) && tail.zo_1) {
454
- var tmp0 = remainingByteCount;
455
- // Inline function 'kotlin.Long.plus' call
456
- var other = tail.xo_1;
457
- var tmp0_0 = add(tmp0, fromInt(other));
458
- // Inline function 'kotlin.Long.minus' call
459
- var other_0 = tail.fq() ? 0 : tail.wo_1;
460
- tmp = subtract(tmp0_0, fromInt(other_0)) <= 8192n;
461
- } else {
462
- tmp = false;
463
- }
464
- if (tmp) {
465
- ensureNotNull(source.no_1).hq(tail, convertToInt(remainingByteCount));
466
- source.po_1 = subtract(source.po_1, remainingByteCount);
467
- this.po_1 = add(this.po_1, remainingByteCount);
468
- return Unit_instance;
469
- } else {
470
- source.no_1 = ensureNotNull(source.no_1).gq(convertToInt(remainingByteCount));
471
- }
472
- }
473
- var segmentToMove = ensureNotNull(source.no_1);
474
- var movedByteCount = fromInt(segmentToMove.g1());
475
- source.no_1 = segmentToMove.iq();
476
- if (source.no_1 == null) {
477
- source.oo_1 = null;
478
- }
479
- // Inline function 'kotlinx.io.Buffer.pushSegment' call
480
- if (this.no_1 == null) {
481
- this.no_1 = segmentToMove;
482
- this.oo_1 = segmentToMove;
483
- } else if (true) {
484
- this.oo_1 = ensureNotNull(this.oo_1).jp(segmentToMove).kp();
485
- if (ensureNotNull(this.oo_1).bp_1 == null) {
486
- this.no_1 = this.oo_1;
487
- }
488
- } else {
489
- this.oo_1 = ensureNotNull(this.oo_1).jp(segmentToMove);
490
- }
491
- source.po_1 = subtract(source.po_1, movedByteCount);
492
- this.po_1 = add(this.po_1, movedByteCount);
493
- remainingByteCount = subtract(remainingByteCount, movedByteCount);
494
- }
495
- };
496
- protoOf(Buffer).jq = function (source) {
497
- var totalBytesRead = 0n;
498
- $l$loop: while (true) {
499
- var readCount = source.rp(this, 8192n);
500
- if (readCount === -1n)
501
- break $l$loop;
502
- totalBytesRead = add(totalBytesRead, readCount);
503
- }
504
- return totalBytesRead;
505
- };
506
- protoOf(Buffer).kq = function (byte) {
507
- this.wp(1).lq(byte);
508
- this.po_1 = add(this.po_1, 1n);
509
- };
510
- protoOf(Buffer).mq = function (short) {
511
- this.wp(2).nq(short);
512
- this.po_1 = add(this.po_1, 2n);
513
- };
514
- protoOf(Buffer).j4 = function () {
515
- return Unit_instance;
516
- };
517
- protoOf(Buffer).toString = function () {
518
- if (this.g1() === 0n)
519
- return 'Buffer(size=0)';
520
- var maxPrintableBytes = 64;
521
- // Inline function 'kotlinx.io.minOf' call
522
- var b = this.g1();
523
- // Inline function 'kotlin.comparisons.minOf' call
524
- var a = fromInt(maxPrintableBytes);
525
- var tmp$ret$1 = a <= b ? a : b;
526
- var len = convertToInt(tmp$ret$1);
527
- var builder = StringBuilder_init_$Create$(imul(len, 2) + (this.g1() > fromInt(maxPrintableBytes) ? 1 : 0) | 0);
528
- var bytesWritten = 0;
529
- // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.forEachSegment' call
530
- var curr = this.no_1;
531
- while (!(curr == null)) {
532
- var tmp0 = get_SegmentReadContextImpl();
533
- var segment = curr;
534
- var idx = 0;
535
- while (bytesWritten < len && idx < segment.g1()) {
536
- var _unary__edvuaz = idx;
537
- idx = _unary__edvuaz + 1 | 0;
538
- var b_0 = tmp0.oq(segment, _unary__edvuaz);
539
- bytesWritten = bytesWritten + 1 | 0;
540
- var tmp = get_HEX_DIGIT_CHARS();
541
- // Inline function 'kotlinx.io.shr' call
542
- var tmp$ret$2 = b_0 >> 4;
543
- var tmp_0 = builder.s(tmp[tmp$ret$2 & 15]);
544
- var tmp_1 = get_HEX_DIGIT_CHARS();
545
- // Inline function 'kotlinx.io.and' call
546
- var tmp$ret$3 = b_0 & 15;
547
- tmp_0.s(tmp_1[tmp$ret$3]);
548
- }
549
- curr = curr.ap_1;
550
- }
551
- if (this.g1() > fromInt(maxPrintableBytes)) {
552
- builder.s(_Char___init__impl__6a9atx(8230));
553
- }
554
- return 'Buffer(size=' + this.g1().toString() + ' hex=' + builder.toString() + ')';
555
- };
556
- protoOf(Buffer).cp = function () {
557
- var oldHead = ensureNotNull(this.no_1);
558
- var nextHead = oldHead.ap_1;
559
- this.no_1 = nextHead;
560
- if (nextHead == null) {
561
- this.oo_1 = null;
562
- } else {
563
- nextHead.bp_1 = null;
564
- }
565
- oldHead.ap_1 = null;
566
- SegmentPool_instance.pq(oldHead);
567
- };
568
- protoOf(Buffer).qq = function () {
569
- var oldTail = ensureNotNull(this.oo_1);
570
- var newTail = oldTail.bp_1;
571
- this.oo_1 = newTail;
572
- if (newTail == null) {
573
- this.no_1 = null;
574
- } else {
575
- newTail.ap_1 = null;
576
- }
577
- oldTail.bp_1 = null;
578
- SegmentPool_instance.pq(oldTail);
579
- };
580
- function indexOf(_this__u8e3s4, byte, startIndex, endIndex) {
581
- startIndex = startIndex === VOID ? 0n : startIndex;
582
- endIndex = endIndex === VOID ? _this__u8e3s4.g1() : endIndex;
583
- // Inline function 'kotlin.comparisons.minOf' call
584
- var b = _this__u8e3s4.g1();
585
- var endOffset = endIndex <= b ? endIndex : b;
586
- checkBounds(_this__u8e3s4.g1(), startIndex, endOffset);
587
- if (startIndex === endOffset)
588
- return -1n;
589
- // Inline function 'kotlinx.io.seek' call
590
- if (_this__u8e3s4.no_1 == null) {
591
- if (-1n === -1n) {
592
- return -1n;
593
- }
594
- var segment = null;
595
- var offset = -1n;
596
- do {
597
- // Inline function 'kotlin.check' call
598
- if (!(endOffset > offset)) {
599
- throw IllegalStateException_init_$Create$('Check failed.');
600
- }
601
- ensureNotNull(segment);
602
- var tmp = segment;
603
- // Inline function 'kotlin.comparisons.maxOf' call
604
- var a = convertToInt(subtract(startIndex, offset));
605
- var tmp_0 = Math.max(a, 0);
606
- var tmp0 = segment.g1();
607
- // Inline function 'kotlin.comparisons.minOf' call
608
- var b_0 = convertToInt(subtract(endOffset, offset));
609
- var tmp$ret$3 = Math.min(tmp0, b_0);
610
- var idx = indexOf_0(tmp, byte, tmp_0, tmp$ret$3);
611
- if (!(idx === -1)) {
612
- return add(offset, fromInt(idx));
613
- }
614
- var tmp0_0 = offset;
615
- // Inline function 'kotlin.Long.plus' call
616
- var other = segment.g1();
617
- offset = add(tmp0_0, fromInt(other));
618
- segment = segment.ap_1;
619
- }
620
- while (!(segment == null) && offset < endOffset);
621
- return -1n;
622
- }
623
- if (subtract(_this__u8e3s4.g1(), startIndex) < startIndex) {
624
- var s = _this__u8e3s4.oo_1;
625
- var offset_0 = _this__u8e3s4.g1();
626
- $l$loop: while (!(s == null) && offset_0 > startIndex) {
627
- offset_0 = subtract(offset_0, fromInt(s.xo_1 - s.wo_1 | 0));
628
- if (offset_0 <= startIndex)
629
- break $l$loop;
630
- s = s.bp_1;
631
- }
632
- var tmp0_1 = s;
633
- var o = offset_0;
634
- if (o === -1n) {
635
- return -1n;
636
- }
637
- var segment_0 = tmp0_1;
638
- var offset_1 = o;
639
- do {
640
- // Inline function 'kotlin.check' call
641
- if (!(endOffset > offset_1)) {
642
- throw IllegalStateException_init_$Create$('Check failed.');
643
- }
644
- ensureNotNull(segment_0);
645
- var tmp_1 = segment_0;
646
- // Inline function 'kotlin.comparisons.maxOf' call
647
- var a_0 = convertToInt(subtract(startIndex, offset_1));
648
- var tmp_2 = Math.max(a_0, 0);
649
- var tmp0_2 = segment_0.g1();
650
- // Inline function 'kotlin.comparisons.minOf' call
651
- var b_1 = convertToInt(subtract(endOffset, offset_1));
652
- var tmp$ret$8 = Math.min(tmp0_2, b_1);
653
- var idx_0 = indexOf_0(tmp_1, byte, tmp_2, tmp$ret$8);
654
- if (!(idx_0 === -1)) {
655
- return add(offset_1, fromInt(idx_0));
656
- }
657
- var tmp0_3 = offset_1;
658
- // Inline function 'kotlin.Long.plus' call
659
- var other_0 = segment_0.g1();
660
- offset_1 = add(tmp0_3, fromInt(other_0));
661
- segment_0 = segment_0.ap_1;
662
- }
663
- while (!(segment_0 == null) && offset_1 < endOffset);
664
- return -1n;
665
- } else {
666
- var s_0 = _this__u8e3s4.no_1;
667
- var offset_2 = 0n;
668
- $l$loop_0: while (!(s_0 == null)) {
669
- var tmp0_4 = offset_2;
670
- // Inline function 'kotlin.Long.plus' call
671
- var other_1 = s_0.xo_1 - s_0.wo_1 | 0;
672
- var nextOffset = add(tmp0_4, fromInt(other_1));
673
- if (nextOffset > startIndex)
674
- break $l$loop_0;
675
- s_0 = s_0.ap_1;
676
- offset_2 = nextOffset;
677
- }
678
- var tmp0_5 = s_0;
679
- var o_0 = offset_2;
680
- if (o_0 === -1n) {
681
- return -1n;
682
- }
683
- var segment_1 = tmp0_5;
684
- var offset_3 = o_0;
685
- do {
686
- // Inline function 'kotlin.check' call
687
- if (!(endOffset > offset_3)) {
688
- throw IllegalStateException_init_$Create$('Check failed.');
689
- }
690
- ensureNotNull(segment_1);
691
- var tmp_3 = segment_1;
692
- // Inline function 'kotlin.comparisons.maxOf' call
693
- var a_1 = convertToInt(subtract(startIndex, offset_3));
694
- var tmp_4 = Math.max(a_1, 0);
695
- var tmp0_6 = segment_1.g1();
696
- // Inline function 'kotlin.comparisons.minOf' call
697
- var b_2 = convertToInt(subtract(endOffset, offset_3));
698
- var tmp$ret$13 = Math.min(tmp0_6, b_2);
699
- var idx_1 = indexOf_0(tmp_3, byte, tmp_4, tmp$ret$13);
700
- if (!(idx_1 === -1)) {
701
- return add(offset_3, fromInt(idx_1));
702
- }
703
- var tmp0_7 = offset_3;
704
- // Inline function 'kotlin.Long.plus' call
705
- var other_2 = segment_1.g1();
706
- offset_3 = add(tmp0_7, fromInt(other_2));
707
- segment_1 = segment_1.ap_1;
708
- }
709
- while (!(segment_1 == null) && offset_3 < endOffset);
710
- return -1n;
711
- }
712
- }
713
- function readByteString(_this__u8e3s4, byteCount) {
714
- return UnsafeByteStringOperations_instance.mo(readByteArray_0(_this__u8e3s4, byteCount));
715
- }
716
- function buffered(_this__u8e3s4) {
717
- return new RealSource(_this__u8e3s4);
718
- }
719
- function PeekSource(upstream) {
720
- this.rq_1 = upstream;
721
- this.sq_1 = this.rq_1.qo();
722
- this.tq_1 = this.sq_1.no_1;
723
- var tmp = this;
724
- var tmp0_safe_receiver = this.sq_1.no_1;
725
- var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.wo_1;
726
- tmp.uq_1 = tmp1_elvis_lhs == null ? -1 : tmp1_elvis_lhs;
727
- this.vq_1 = false;
728
- this.wq_1 = 0n;
729
- }
730
- protoOf(PeekSource).rp = function (sink, byteCount) {
731
- // Inline function 'kotlin.check' call
732
- if (!!this.vq_1) {
733
- var message = 'Source is closed.';
734
- throw IllegalStateException_init_$Create$(toString(message));
735
- }
736
- // Inline function 'kotlinx.io.checkByteCount' call
737
- // Inline function 'kotlin.require' call
738
- if (!(byteCount >= 0n)) {
739
- var message_0 = 'byteCount (' + byteCount.toString() + ') < 0';
740
- throw IllegalArgumentException_init_$Create$(toString(message_0));
741
- }
742
- // Inline function 'kotlin.check' call
743
- if (!(this.tq_1 == null || (this.tq_1 === this.sq_1.no_1 && this.uq_1 === ensureNotNull(this.sq_1.no_1).wo_1))) {
744
- var message_1 = 'Peek source is invalid because upstream source was used';
745
- throw IllegalStateException_init_$Create$(toString(message_1));
746
- }
747
- if (byteCount === 0n)
748
- return 0n;
749
- // Inline function 'kotlin.Long.plus' call
750
- var this_0 = this.wq_1;
751
- var tmp$ret$7 = add(this_0, fromInt(1));
752
- if (!this.rq_1.to(tmp$ret$7))
753
- return -1n;
754
- if (this.tq_1 == null && !(this.sq_1.no_1 == null)) {
755
- this.tq_1 = this.sq_1.no_1;
756
- this.uq_1 = ensureNotNull(this.sq_1.no_1).wo_1;
757
- }
758
- // Inline function 'kotlin.comparisons.minOf' call
759
- var b = subtract(this.sq_1.g1(), this.wq_1);
760
- var toCopy = byteCount <= b ? byteCount : b;
761
- this.sq_1.hp(sink, this.wq_1, add(this.wq_1, toCopy));
762
- this.wq_1 = add(this.wq_1, toCopy);
763
- return toCopy;
764
- };
765
- protoOf(PeekSource).j4 = function () {
766
- this.vq_1 = true;
767
- };
768
- function RealSource(source) {
769
- this.xq_1 = source;
770
- this.yq_1 = false;
771
- this.zq_1 = new Buffer();
772
- }
773
- protoOf(RealSource).qo = function () {
774
- return this.zq_1;
775
- };
776
- protoOf(RealSource).rp = function (sink, byteCount) {
777
- // Inline function 'kotlinx.io.RealSource.checkNotClosed' call
778
- // Inline function 'kotlin.check' call
779
- if (!!this.yq_1) {
780
- var message = 'Source is closed.';
781
- throw IllegalStateException_init_$Create$(toString(message));
782
- }
783
- // Inline function 'kotlin.require' call
784
- if (!(byteCount >= 0n)) {
785
- var message_0 = 'byteCount: ' + byteCount.toString();
786
- throw IllegalArgumentException_init_$Create$(toString(message_0));
787
- }
788
- if (this.zq_1.g1() === 0n) {
789
- var read = this.xq_1.rp(this.zq_1, 8192n);
790
- if (read === -1n)
791
- return -1n;
792
- }
793
- // Inline function 'kotlin.comparisons.minOf' call
794
- var b = this.zq_1.g1();
795
- var toRead = byteCount <= b ? byteCount : b;
796
- return this.zq_1.rp(sink, toRead);
797
- };
798
- protoOf(RealSource).ro = function () {
799
- // Inline function 'kotlinx.io.RealSource.checkNotClosed' call
800
- // Inline function 'kotlin.check' call
801
- if (!!this.yq_1) {
802
- var message = 'Source is closed.';
803
- throw IllegalStateException_init_$Create$(toString(message));
804
- }
805
- return this.zq_1.ro() && this.xq_1.rp(this.zq_1, 8192n) === -1n;
806
- };
807
- protoOf(RealSource).so = function (byteCount) {
808
- if (!this.to(byteCount))
809
- throw EOFException_init_$Create$_0("Source doesn't contain required number of bytes (" + byteCount.toString() + ').');
810
- };
811
- protoOf(RealSource).to = function (byteCount) {
812
- // Inline function 'kotlinx.io.RealSource.checkNotClosed' call
813
- // Inline function 'kotlin.check' call
814
- if (!!this.yq_1) {
815
- var message = 'Source is closed.';
816
- throw IllegalStateException_init_$Create$(toString(message));
817
- }
818
- // Inline function 'kotlin.require' call
819
- if (!(byteCount >= 0n)) {
820
- var message_0 = 'byteCount: ' + byteCount.toString();
821
- throw IllegalArgumentException_init_$Create$(toString(message_0));
822
- }
823
- while (this.zq_1.g1() < byteCount) {
824
- if (this.xq_1.rp(this.zq_1, 8192n) === -1n)
825
- return false;
826
- }
827
- return true;
828
- };
829
- protoOf(RealSource).uo = function () {
830
- this.so(1n);
831
- return this.zq_1.uo();
832
- };
833
- protoOf(RealSource).pp = function (sink, startIndex, endIndex) {
834
- // Inline function 'kotlinx.io.checkBounds' call
835
- var size = sink.length;
836
- checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
837
- if (this.zq_1.g1() === 0n) {
838
- var read = this.xq_1.rp(this.zq_1, 8192n);
839
- if (read === -1n)
840
- return -1;
841
- }
842
- var tmp0 = endIndex - startIndex | 0;
843
- // Inline function 'kotlinx.io.minOf' call
844
- var b = this.zq_1.g1();
845
- // Inline function 'kotlin.comparisons.minOf' call
846
- var a = fromInt(tmp0);
847
- var tmp$ret$2 = a <= b ? a : b;
848
- var toRead = convertToInt(tmp$ret$2);
849
- return this.zq_1.pp(sink, startIndex, startIndex + toRead | 0);
850
- };
851
- protoOf(RealSource).tp = function (sink, byteCount) {
852
- try {
853
- this.so(byteCount);
854
- } catch ($p) {
855
- if ($p instanceof EOFException) {
856
- var e = $p;
857
- sink.sp(this.zq_1, this.zq_1.g1());
858
- throw e;
859
- } else {
860
- throw $p;
861
- }
862
- }
863
- this.zq_1.tp(sink, byteCount);
864
- };
865
- protoOf(RealSource).up = function (sink) {
866
- var totalBytesWritten = 0n;
867
- while (!(this.xq_1.rp(this.zq_1, 8192n) === -1n)) {
868
- var emitByteCount = this.zq_1.lp();
869
- if (emitByteCount > 0n) {
870
- totalBytesWritten = add(totalBytesWritten, emitByteCount);
871
- sink.sp(this.zq_1, emitByteCount);
872
- }
873
- }
874
- if (this.zq_1.g1() > 0n) {
875
- totalBytesWritten = add(totalBytesWritten, this.zq_1.g1());
876
- sink.sp(this.zq_1, this.zq_1.g1());
877
- }
878
- return totalBytesWritten;
879
- };
880
- protoOf(RealSource).ep = function () {
881
- this.so(2n);
882
- return this.zq_1.ep();
883
- };
884
- protoOf(RealSource).vp = function () {
885
- // Inline function 'kotlinx.io.RealSource.checkNotClosed' call
886
- // Inline function 'kotlin.check' call
887
- if (!!this.yq_1) {
888
- var message = 'Source is closed.';
889
- throw IllegalStateException_init_$Create$(toString(message));
890
- }
891
- return buffered(new PeekSource(this));
892
- };
893
- protoOf(RealSource).j4 = function () {
894
- if (this.yq_1)
895
- return Unit_instance;
896
- this.yq_1 = true;
897
- this.xq_1.j4();
898
- this.zq_1.n2();
899
- };
900
- protoOf(RealSource).toString = function () {
901
- return 'buffered(' + toString(this.xq_1) + ')';
902
- };
903
- function Segment_init_$Init$($this) {
904
- Segment.call($this);
905
- $this.vo_1 = new Int8Array(8192);
906
- $this.zo_1 = true;
907
- $this.yo_1 = null;
908
- return $this;
909
- }
910
- function Segment_init_$Create$() {
911
- return Segment_init_$Init$(objectCreate(protoOf(Segment)));
912
- }
913
- function Segment_init_$Init$_0(data, pos, limit, shareToken, owner, $this) {
914
- Segment.call($this);
915
- $this.vo_1 = data;
916
- $this.wo_1 = pos;
917
- $this.xo_1 = limit;
918
- $this.yo_1 = shareToken;
919
- $this.zo_1 = owner;
920
- return $this;
921
- }
922
- function Segment_init_$Create$_0(data, pos, limit, shareToken, owner) {
923
- return Segment_init_$Init$_0(data, pos, limit, shareToken, owner, objectCreate(protoOf(Segment)));
924
- }
925
- function Companion() {
926
- this.ar_1 = 8192;
927
- this.br_1 = 1024;
928
- }
929
- protoOf(Companion).cr = function () {
930
- return Segment_init_$Create$();
931
- };
932
- var Companion_instance;
933
- function Companion_getInstance() {
934
- return Companion_instance;
935
- }
936
- protoOf(Segment).fq = function () {
937
- var tmp0_safe_receiver = this.yo_1;
938
- var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.dr();
939
- return tmp1_elvis_lhs == null ? false : tmp1_elvis_lhs;
940
- };
941
- protoOf(Segment).ip = function () {
942
- var tmp0_elvis_lhs = this.yo_1;
943
- var tmp;
944
- if (tmp0_elvis_lhs == null) {
945
- // Inline function 'kotlin.also' call
946
- var this_0 = SegmentPool_instance.er();
947
- this.yo_1 = this_0;
948
- tmp = this_0;
949
- } else {
950
- tmp = tmp0_elvis_lhs;
951
- }
952
- var t = tmp;
953
- var tmp_0 = this.wo_1;
954
- var tmp_1 = this.xo_1;
955
- // Inline function 'kotlin.also' call
956
- t.fr();
957
- return Segment_init_$Create$_0(this.vo_1, tmp_0, tmp_1, t, false);
958
- };
959
- protoOf(Segment).iq = function () {
960
- var result = this.ap_1;
961
- if (!(this.bp_1 == null)) {
962
- ensureNotNull(this.bp_1).ap_1 = this.ap_1;
963
- }
964
- if (!(this.ap_1 == null)) {
965
- ensureNotNull(this.ap_1).bp_1 = this.bp_1;
966
- }
967
- this.ap_1 = null;
968
- this.bp_1 = null;
969
- return result;
970
- };
971
- protoOf(Segment).jp = function (segment) {
972
- segment.bp_1 = this;
973
- segment.ap_1 = this.ap_1;
974
- if (!(this.ap_1 == null)) {
975
- ensureNotNull(this.ap_1).bp_1 = segment;
976
- }
977
- this.ap_1 = segment;
978
- return segment;
979
- };
980
- protoOf(Segment).gq = function (byteCount) {
981
- // Inline function 'kotlin.require' call
982
- if (!(byteCount > 0 && byteCount <= (this.xo_1 - this.wo_1 | 0))) {
983
- var message = 'byteCount out of range';
984
- throw IllegalArgumentException_init_$Create$(toString(message));
985
- }
986
- var prefix;
987
- if (byteCount >= 1024) {
988
- prefix = this.ip();
989
- } else {
990
- prefix = SegmentPool_instance.zp();
991
- var tmp0 = this.vo_1;
992
- var tmp2 = prefix.vo_1;
993
- var tmp5 = this.wo_1;
994
- // Inline function 'kotlin.collections.copyInto' call
995
- var endIndex = this.wo_1 + byteCount | 0;
996
- // Inline function 'kotlin.js.unsafeCast' call
997
- // Inline function 'kotlin.js.asDynamic' call
998
- var tmp = tmp0;
999
- // Inline function 'kotlin.js.unsafeCast' call
1000
- // Inline function 'kotlin.js.asDynamic' call
1001
- arrayCopy(tmp, tmp2, 0, tmp5, endIndex);
1002
- }
1003
- prefix.xo_1 = prefix.wo_1 + byteCount | 0;
1004
- this.wo_1 = this.wo_1 + byteCount | 0;
1005
- if (!(this.bp_1 == null)) {
1006
- ensureNotNull(this.bp_1).jp(prefix);
1007
- } else {
1008
- prefix.ap_1 = this;
1009
- this.bp_1 = prefix;
1010
- }
1011
- return prefix;
1012
- };
1013
- protoOf(Segment).kp = function () {
1014
- // Inline function 'kotlin.check' call
1015
- if (!!(this.bp_1 == null)) {
1016
- var message = 'cannot compact';
1017
- throw IllegalStateException_init_$Create$(toString(message));
1018
- }
1019
- if (!ensureNotNull(this.bp_1).zo_1)
1020
- return this;
1021
- var byteCount = this.xo_1 - this.wo_1 | 0;
1022
- var availableByteCount = (8192 - ensureNotNull(this.bp_1).xo_1 | 0) + (ensureNotNull(this.bp_1).fq() ? 0 : ensureNotNull(this.bp_1).wo_1) | 0;
1023
- if (byteCount > availableByteCount)
1024
- return this;
1025
- var predecessor = this.bp_1;
1026
- this.hq(ensureNotNull(predecessor), byteCount);
1027
- var successor = this.iq();
1028
- // Inline function 'kotlin.check' call
1029
- if (!(successor == null)) {
1030
- throw IllegalStateException_init_$Create$('Check failed.');
1031
- }
1032
- SegmentPool_instance.pq(this);
1033
- return predecessor;
1034
- };
1035
- protoOf(Segment).lq = function (byte) {
1036
- var _unary__edvuaz = this.xo_1;
1037
- this.xo_1 = _unary__edvuaz + 1 | 0;
1038
- this.vo_1[_unary__edvuaz] = byte;
1039
- };
1040
- protoOf(Segment).nq = function (short) {
1041
- var data = this.vo_1;
1042
- var limit = this.xo_1;
1043
- var _unary__edvuaz = limit;
1044
- limit = _unary__edvuaz + 1 | 0;
1045
- data[_unary__edvuaz] = toByte((short >>> 8 | 0) & 255);
1046
- var _unary__edvuaz_0 = limit;
1047
- limit = _unary__edvuaz_0 + 1 | 0;
1048
- data[_unary__edvuaz_0] = toByte(short & 255);
1049
- this.xo_1 = limit;
1050
- };
1051
- protoOf(Segment).dp = function () {
1052
- var _unary__edvuaz = this.wo_1;
1053
- this.wo_1 = _unary__edvuaz + 1 | 0;
1054
- return this.vo_1[_unary__edvuaz];
1055
- };
1056
- protoOf(Segment).fp = function () {
1057
- var data = this.vo_1;
1058
- var pos = this.wo_1;
1059
- var _unary__edvuaz = pos;
1060
- pos = _unary__edvuaz + 1 | 0;
1061
- // Inline function 'kotlinx.io.and' call
1062
- var tmp = (data[_unary__edvuaz] & 255) << 8;
1063
- var _unary__edvuaz_0 = pos;
1064
- pos = _unary__edvuaz_0 + 1 | 0;
1065
- // Inline function 'kotlinx.io.and' call
1066
- var tmp$ret$1 = data[_unary__edvuaz_0] & 255;
1067
- var s = toShort(tmp | tmp$ret$1);
1068
- this.wo_1 = pos;
1069
- return s;
1070
- };
1071
- protoOf(Segment).hq = function (sink, byteCount) {
1072
- // Inline function 'kotlin.check' call
1073
- if (!sink.zo_1) {
1074
- var message = 'only owner can write';
1075
- throw IllegalStateException_init_$Create$(toString(message));
1076
- }
1077
- if ((sink.xo_1 + byteCount | 0) > 8192) {
1078
- if (sink.fq())
1079
- throw IllegalArgumentException_init_$Create$_0();
1080
- if (((sink.xo_1 + byteCount | 0) - sink.wo_1 | 0) > 8192)
1081
- throw IllegalArgumentException_init_$Create$_0();
1082
- var tmp0 = sink.vo_1;
1083
- var tmp2 = sink.vo_1;
1084
- var tmp5 = sink.wo_1;
1085
- // Inline function 'kotlin.collections.copyInto' call
1086
- var endIndex = sink.xo_1;
1087
- // Inline function 'kotlin.js.unsafeCast' call
1088
- // Inline function 'kotlin.js.asDynamic' call
1089
- var tmp = tmp0;
1090
- // Inline function 'kotlin.js.unsafeCast' call
1091
- // Inline function 'kotlin.js.asDynamic' call
1092
- arrayCopy(tmp, tmp2, 0, tmp5, endIndex);
1093
- sink.xo_1 = sink.xo_1 - sink.wo_1 | 0;
1094
- sink.wo_1 = 0;
1095
- }
1096
- var tmp0_0 = this.vo_1;
1097
- var tmp2_0 = sink.vo_1;
1098
- var tmp4 = sink.xo_1;
1099
- var tmp6 = this.wo_1;
1100
- // Inline function 'kotlin.collections.copyInto' call
1101
- var endIndex_0 = this.wo_1 + byteCount | 0;
1102
- // Inline function 'kotlin.js.unsafeCast' call
1103
- // Inline function 'kotlin.js.asDynamic' call
1104
- var tmp_0 = tmp0_0;
1105
- // Inline function 'kotlin.js.unsafeCast' call
1106
- // Inline function 'kotlin.js.asDynamic' call
1107
- arrayCopy(tmp_0, tmp2_0, tmp4, tmp6, endIndex_0);
1108
- sink.xo_1 = sink.xo_1 + byteCount | 0;
1109
- this.wo_1 = this.wo_1 + byteCount | 0;
1110
- };
1111
- protoOf(Segment).qp = function (dst, dstStartOffset, dstEndOffset) {
1112
- var len = dstEndOffset - dstStartOffset | 0;
1113
- var tmp0 = this.vo_1;
1114
- var tmp6 = this.wo_1;
1115
- // Inline function 'kotlin.collections.copyInto' call
1116
- var endIndex = this.wo_1 + len | 0;
1117
- // Inline function 'kotlin.js.unsafeCast' call
1118
- // Inline function 'kotlin.js.asDynamic' call
1119
- var tmp = tmp0;
1120
- // Inline function 'kotlin.js.unsafeCast' call
1121
- // Inline function 'kotlin.js.asDynamic' call
1122
- arrayCopy(tmp, dst, dstStartOffset, tmp6, endIndex);
1123
- this.wo_1 = this.wo_1 + len | 0;
1124
- };
1125
- protoOf(Segment).cq = function (src, srcStartOffset, srcEndOffset) {
1126
- var tmp2 = this.vo_1;
1127
- // Inline function 'kotlin.collections.copyInto' call
1128
- var destinationOffset = this.xo_1;
1129
- // Inline function 'kotlin.js.unsafeCast' call
1130
- // Inline function 'kotlin.js.asDynamic' call
1131
- var tmp = src;
1132
- // Inline function 'kotlin.js.unsafeCast' call
1133
- // Inline function 'kotlin.js.asDynamic' call
1134
- arrayCopy(tmp, tmp2, destinationOffset, srcStartOffset, srcEndOffset);
1135
- this.xo_1 = this.xo_1 + (srcEndOffset - srcStartOffset | 0) | 0;
1136
- };
1137
- protoOf(Segment).g1 = function () {
1138
- return this.xo_1 - this.wo_1 | 0;
1139
- };
1140
- protoOf(Segment).bq = function () {
1141
- return this.vo_1.length - this.xo_1 | 0;
1142
- };
1143
- protoOf(Segment).gr = function (readOnly) {
1144
- return this.vo_1;
1145
- };
1146
- protoOf(Segment).np = function (index) {
1147
- return this.vo_1[this.wo_1 + index | 0];
1148
- };
1149
- protoOf(Segment).hr = function (index, value) {
1150
- this.vo_1[this.xo_1 + index | 0] = value;
1151
- };
1152
- protoOf(Segment).ir = function (index, b0, b1) {
1153
- var d = this.vo_1;
1154
- var l = this.xo_1;
1155
- d[l + index | 0] = b0;
1156
- d[(l + index | 0) + 1 | 0] = b1;
1157
- };
1158
- protoOf(Segment).jr = function (index, b0, b1, b2) {
1159
- var d = this.vo_1;
1160
- var l = this.xo_1;
1161
- d[l + index | 0] = b0;
1162
- d[(l + index | 0) + 1 | 0] = b1;
1163
- d[(l + index | 0) + 2 | 0] = b2;
1164
- };
1165
- protoOf(Segment).kr = function (index, b0, b1, b2, b3) {
1166
- var d = this.vo_1;
1167
- var l = this.xo_1;
1168
- d[l + index | 0] = b0;
1169
- d[(l + index | 0) + 1 | 0] = b1;
1170
- d[(l + index | 0) + 2 | 0] = b2;
1171
- d[(l + index | 0) + 3 | 0] = b3;
1172
- };
1173
- function Segment() {
1174
- this.wo_1 = 0;
1175
- this.xo_1 = 0;
1176
- this.yo_1 = null;
1177
- this.zo_1 = false;
1178
- this.ap_1 = null;
1179
- this.bp_1 = null;
1180
- }
1181
- function isEmpty(_this__u8e3s4) {
1182
- return _this__u8e3s4.g1() === 0;
1183
- }
1184
- function SegmentCopyTracker() {
1185
- }
1186
- function AlwaysSharedCopyTracker() {
1187
- AlwaysSharedCopyTracker_instance = this;
1188
- SegmentCopyTracker.call(this);
1189
- }
1190
- protoOf(AlwaysSharedCopyTracker).dr = function () {
1191
- return true;
1192
- };
1193
- protoOf(AlwaysSharedCopyTracker).fr = function () {
1194
- return Unit_instance;
1195
- };
1196
- var AlwaysSharedCopyTracker_instance;
1197
- function AlwaysSharedCopyTracker_getInstance() {
1198
- if (AlwaysSharedCopyTracker_instance == null)
1199
- new AlwaysSharedCopyTracker();
1200
- return AlwaysSharedCopyTracker_instance;
1201
- }
1202
- function indexOf_0(_this__u8e3s4, byte, startOffset, endOffset) {
1203
- // Inline function 'kotlin.require' call
1204
- if (!(0 <= startOffset ? startOffset < _this__u8e3s4.g1() : false)) {
1205
- var message = '' + startOffset;
1206
- throw IllegalArgumentException_init_$Create$(toString(message));
1207
- }
1208
- // Inline function 'kotlin.require' call
1209
- if (!(startOffset <= endOffset ? endOffset <= _this__u8e3s4.g1() : false)) {
1210
- var message_0 = '' + endOffset;
1211
- throw IllegalArgumentException_init_$Create$(toString(message_0));
1212
- }
1213
- var p = _this__u8e3s4.wo_1;
1214
- var data = _this__u8e3s4.gr(true);
1215
- var inductionVariable = startOffset;
1216
- if (inductionVariable < endOffset)
1217
- do {
1218
- var idx = inductionVariable;
1219
- inductionVariable = inductionVariable + 1 | 0;
1220
- if (data[p + idx | 0] === byte) {
1221
- return idx;
1222
- }
1223
- }
1224
- while (inductionVariable < endOffset);
1225
- return -1;
1226
- }
1227
- function Sink() {
1228
- }
1229
- function Source() {
1230
- }
1231
- function readByteArray(_this__u8e3s4) {
1232
- return readByteArrayImpl(_this__u8e3s4, -1);
1233
- }
1234
- function readByteArray_0(_this__u8e3s4, byteCount) {
1235
- // Inline function 'kotlinx.io.checkByteCount' call
1236
- var byteCount_0 = fromInt(byteCount);
1237
- // Inline function 'kotlin.require' call
1238
- if (!(byteCount_0 >= 0n)) {
1239
- var message = 'byteCount (' + byteCount_0.toString() + ') < 0';
1240
- throw IllegalArgumentException_init_$Create$(toString(message));
1241
- }
1242
- return readByteArrayImpl(_this__u8e3s4, byteCount);
1243
- }
1244
- function indexOf_1(_this__u8e3s4, byte, startIndex, endIndex) {
1245
- startIndex = startIndex === VOID ? 0n : startIndex;
1246
- endIndex = endIndex === VOID ? 9223372036854775807n : endIndex;
1247
- // Inline function 'kotlin.require' call
1248
- if (!(0n <= startIndex ? startIndex <= endIndex : false)) {
1249
- var tmp;
1250
- if (endIndex < 0n) {
1251
- tmp = 'startIndex (' + startIndex.toString() + ') and endIndex (' + endIndex.toString() + ') should be non negative';
1252
- } else {
1253
- tmp = 'startIndex (' + startIndex.toString() + ') is not within the range [0..endIndex(' + endIndex.toString() + '))';
1254
- }
1255
- var message = tmp;
1256
- throw IllegalArgumentException_init_$Create$(toString(message));
1257
- }
1258
- if (startIndex === endIndex)
1259
- return -1n;
1260
- var offset = startIndex;
1261
- $l$loop: while (true) {
1262
- var tmp_0;
1263
- if (offset < endIndex) {
1264
- // Inline function 'kotlin.Long.plus' call
1265
- var this_0 = offset;
1266
- var tmp$ret$2 = add(this_0, fromInt(1));
1267
- tmp_0 = _this__u8e3s4.to(tmp$ret$2);
1268
- } else {
1269
- tmp_0 = false;
1270
- }
1271
- if (!tmp_0) {
1272
- break $l$loop;
1273
- }
1274
- var tmp_1 = _this__u8e3s4.qo();
1275
- var tmp_2 = offset;
1276
- // Inline function 'kotlin.comparisons.minOf' call
1277
- var b = _this__u8e3s4.qo().g1();
1278
- var tmp$ret$3 = endIndex <= b ? endIndex : b;
1279
- var idx = indexOf(tmp_1, byte, tmp_2, tmp$ret$3);
1280
- if (!(idx === -1n)) {
1281
- return idx;
1282
- }
1283
- offset = _this__u8e3s4.qo().g1();
1284
- }
1285
- return -1n;
1286
- }
1287
- function readByteArrayImpl(_this__u8e3s4, size) {
1288
- var arraySize = size;
1289
- if (size === -1) {
1290
- var fetchSize = 2147483647n;
1291
- while (_this__u8e3s4.qo().g1() < 2147483647n && _this__u8e3s4.to(fetchSize)) {
1292
- // Inline function 'kotlin.Long.times' call
1293
- var this_0 = fetchSize;
1294
- fetchSize = multiply(this_0, fromInt(2));
1295
- }
1296
- // Inline function 'kotlin.check' call
1297
- if (!(_this__u8e3s4.qo().g1() < 2147483647n)) {
1298
- var message = "Can't create an array of size " + _this__u8e3s4.qo().g1().toString();
1299
- throw IllegalStateException_init_$Create$(toString(message));
1300
- }
1301
- arraySize = convertToInt(_this__u8e3s4.qo().g1());
1302
- } else {
1303
- _this__u8e3s4.so(fromInt(size));
1304
- }
1305
- var array = new Int8Array(arraySize);
1306
- readTo(_this__u8e3s4.qo(), array);
1307
- return array;
1308
- }
1309
- function readTo(_this__u8e3s4, sink, startIndex, endIndex) {
1310
- startIndex = startIndex === VOID ? 0 : startIndex;
1311
- endIndex = endIndex === VOID ? sink.length : endIndex;
1312
- // Inline function 'kotlinx.io.checkBounds' call
1313
- var size = sink.length;
1314
- checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
1315
- var offset = startIndex;
1316
- while (offset < endIndex) {
1317
- var bytesRead = _this__u8e3s4.pp(sink, offset, endIndex);
1318
- if (bytesRead === -1) {
1319
- throw EOFException_init_$Create$_0('Source exhausted before reading ' + (endIndex - startIndex | 0) + ' bytes. ' + ('Only ' + bytesRead + ' bytes were read.'));
1320
- }
1321
- offset = offset + bytesRead | 0;
1322
- }
1323
- }
1324
- function readString(_this__u8e3s4, byteCount) {
1325
- _this__u8e3s4.so(byteCount);
1326
- return commonReadUtf8(_this__u8e3s4.qo(), byteCount);
1327
- }
1328
- function readString_0(_this__u8e3s4) {
1329
- _this__u8e3s4.to(9223372036854775807n);
1330
- return commonReadUtf8(_this__u8e3s4.qo(), _this__u8e3s4.qo().g1());
1331
- }
1332
- function writeString(_this__u8e3s4, string, startIndex, endIndex) {
1333
- startIndex = startIndex === VOID ? 0 : startIndex;
1334
- endIndex = endIndex === VOID ? string.length : endIndex;
1335
- // Inline function 'kotlinx.io.checkBounds' call
1336
- var size = string.length;
1337
- checkBounds(fromInt(size), fromInt(startIndex), fromInt(endIndex));
1338
- // Inline function 'kotlinx.io.writeToInternalBuffer' call
1339
- // Inline function 'kotlinx.io.commonWriteUtf8' call
1340
- var this_0 = _this__u8e3s4.qo();
1341
- var i = startIndex;
1342
- while (i < endIndex) {
1343
- var p0 = i;
1344
- // Inline function 'kotlin.code' call
1345
- var this_1 = charCodeAt(string, p0);
1346
- var c = Char__toInt_impl_vasixd(this_1);
1347
- if (c < 128) {
1348
- $l$block_0: {
1349
- // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
1350
- var tail = this_0.wp(1);
1351
- var ctx = get_SegmentWriteContextImpl();
1352
- var segmentOffset = -i | 0;
1353
- // Inline function 'kotlin.comparisons.minOf' call
1354
- var b = i + tail.bq() | 0;
1355
- var runLimit = Math.min(endIndex, b);
1356
- var _unary__edvuaz = i;
1357
- i = _unary__edvuaz + 1 | 0;
1358
- ctx.or(tail, segmentOffset + _unary__edvuaz | 0, toByte(c));
1359
- $l$loop: while (i < runLimit) {
1360
- var p0_0 = i;
1361
- // Inline function 'kotlin.code' call
1362
- var this_2 = charCodeAt(string, p0_0);
1363
- c = Char__toInt_impl_vasixd(this_2);
1364
- if (c >= 128)
1365
- break $l$loop;
1366
- var _unary__edvuaz_0 = i;
1367
- i = _unary__edvuaz_0 + 1 | 0;
1368
- ctx.or(tail, segmentOffset + _unary__edvuaz_0 | 0, toByte(c));
1369
- }
1370
- var bytesWritten = i + segmentOffset | 0;
1371
- if (bytesWritten === 1) {
1372
- tail.xo_1 = tail.xo_1 + bytesWritten | 0;
1373
- var tmp = this_0;
1374
- // Inline function 'kotlin.Long.plus' call
1375
- var this_3 = this_0.po_1;
1376
- tmp.po_1 = add(this_3, fromInt(bytesWritten));
1377
- break $l$block_0;
1378
- }
1379
- // Inline function 'kotlin.check' call
1380
- if (!(0 <= bytesWritten ? bytesWritten <= tail.bq() : false)) {
1381
- var message = 'Invalid number of bytes written: ' + bytesWritten + '. Should be in 0..' + tail.bq();
1382
- throw IllegalStateException_init_$Create$(toString(message));
1383
- }
1384
- if (!(bytesWritten === 0)) {
1385
- tail.xo_1 = tail.xo_1 + bytesWritten | 0;
1386
- var tmp_0 = this_0;
1387
- // Inline function 'kotlin.Long.plus' call
1388
- var this_4 = this_0.po_1;
1389
- tmp_0.po_1 = add(this_4, fromInt(bytesWritten));
1390
- break $l$block_0;
1391
- }
1392
- if (isEmpty(tail)) {
1393
- this_0.qq();
1394
- }
1395
- }
1396
- } else if (c < 2048) {
1397
- $l$block_2: {
1398
- // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
1399
- var tail_0 = this_0.wp(2);
1400
- get_SegmentWriteContextImpl().nr(tail_0, 0, toByte(c >> 6 | 192), toByte(c & 63 | 128));
1401
- var bytesWritten_0 = 2;
1402
- if (bytesWritten_0 === 2) {
1403
- tail_0.xo_1 = tail_0.xo_1 + bytesWritten_0 | 0;
1404
- var tmp_1 = this_0;
1405
- // Inline function 'kotlin.Long.plus' call
1406
- var this_5 = this_0.po_1;
1407
- tmp_1.po_1 = add(this_5, fromInt(bytesWritten_0));
1408
- break $l$block_2;
1409
- }
1410
- // Inline function 'kotlin.check' call
1411
- if (!(0 <= bytesWritten_0 ? bytesWritten_0 <= tail_0.bq() : false)) {
1412
- var message_0 = 'Invalid number of bytes written: ' + bytesWritten_0 + '. Should be in 0..' + tail_0.bq();
1413
- throw IllegalStateException_init_$Create$(toString(message_0));
1414
- }
1415
- if (!(bytesWritten_0 === 0)) {
1416
- tail_0.xo_1 = tail_0.xo_1 + bytesWritten_0 | 0;
1417
- var tmp_2 = this_0;
1418
- // Inline function 'kotlin.Long.plus' call
1419
- var this_6 = this_0.po_1;
1420
- tmp_2.po_1 = add(this_6, fromInt(bytesWritten_0));
1421
- break $l$block_2;
1422
- }
1423
- if (isEmpty(tail_0)) {
1424
- this_0.qq();
1425
- }
1426
- }
1427
- i = i + 1 | 0;
1428
- } else if (c < 55296 || c > 57343) {
1429
- $l$block_4: {
1430
- // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
1431
- var tail_1 = this_0.wp(3);
1432
- get_SegmentWriteContextImpl().mr(tail_1, 0, toByte(c >> 12 | 224), toByte(c >> 6 & 63 | 128), toByte(c & 63 | 128));
1433
- var bytesWritten_1 = 3;
1434
- if (bytesWritten_1 === 3) {
1435
- tail_1.xo_1 = tail_1.xo_1 + bytesWritten_1 | 0;
1436
- var tmp_3 = this_0;
1437
- // Inline function 'kotlin.Long.plus' call
1438
- var this_7 = this_0.po_1;
1439
- tmp_3.po_1 = add(this_7, fromInt(bytesWritten_1));
1440
- break $l$block_4;
1441
- }
1442
- // Inline function 'kotlin.check' call
1443
- if (!(0 <= bytesWritten_1 ? bytesWritten_1 <= tail_1.bq() : false)) {
1444
- var message_1 = 'Invalid number of bytes written: ' + bytesWritten_1 + '. Should be in 0..' + tail_1.bq();
1445
- throw IllegalStateException_init_$Create$(toString(message_1));
1446
- }
1447
- if (!(bytesWritten_1 === 0)) {
1448
- tail_1.xo_1 = tail_1.xo_1 + bytesWritten_1 | 0;
1449
- var tmp_4 = this_0;
1450
- // Inline function 'kotlin.Long.plus' call
1451
- var this_8 = this_0.po_1;
1452
- tmp_4.po_1 = add(this_8, fromInt(bytesWritten_1));
1453
- break $l$block_4;
1454
- }
1455
- if (isEmpty(tail_1)) {
1456
- this_0.qq();
1457
- }
1458
- }
1459
- i = i + 1 | 0;
1460
- } else {
1461
- var tmp_5;
1462
- if ((i + 1 | 0) < endIndex) {
1463
- var p0_1 = i + 1 | 0;
1464
- // Inline function 'kotlin.code' call
1465
- var this_9 = charCodeAt(string, p0_1);
1466
- tmp_5 = Char__toInt_impl_vasixd(this_9);
1467
- } else {
1468
- tmp_5 = 0;
1469
- }
1470
- var low = tmp_5;
1471
- if (c > 56319 || !(56320 <= low ? low <= 57343 : false)) {
1472
- // Inline function 'kotlin.code' call
1473
- var this_10 = _Char___init__impl__6a9atx(63);
1474
- var tmp$ret$26 = Char__toInt_impl_vasixd(this_10);
1475
- this_0.kq(toByte(tmp$ret$26));
1476
- i = i + 1 | 0;
1477
- } else {
1478
- var codePoint = 65536 + ((c & 1023) << 10 | low & 1023) | 0;
1479
- $l$block_6: {
1480
- // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
1481
- var tail_2 = this_0.wp(4);
1482
- get_SegmentWriteContextImpl().lr(tail_2, 0, toByte(codePoint >> 18 | 240), toByte(codePoint >> 12 & 63 | 128), toByte(codePoint >> 6 & 63 | 128), toByte(codePoint & 63 | 128));
1483
- var bytesWritten_2 = 4;
1484
- if (bytesWritten_2 === 4) {
1485
- tail_2.xo_1 = tail_2.xo_1 + bytesWritten_2 | 0;
1486
- var tmp_6 = this_0;
1487
- // Inline function 'kotlin.Long.plus' call
1488
- var this_11 = this_0.po_1;
1489
- tmp_6.po_1 = add(this_11, fromInt(bytesWritten_2));
1490
- break $l$block_6;
1491
- }
1492
- // Inline function 'kotlin.check' call
1493
- if (!(0 <= bytesWritten_2 ? bytesWritten_2 <= tail_2.bq() : false)) {
1494
- var message_2 = 'Invalid number of bytes written: ' + bytesWritten_2 + '. Should be in 0..' + tail_2.bq();
1495
- throw IllegalStateException_init_$Create$(toString(message_2));
1496
- }
1497
- if (!(bytesWritten_2 === 0)) {
1498
- tail_2.xo_1 = tail_2.xo_1 + bytesWritten_2 | 0;
1499
- var tmp_7 = this_0;
1500
- // Inline function 'kotlin.Long.plus' call
1501
- var this_12 = this_0.po_1;
1502
- tmp_7.po_1 = add(this_12, fromInt(bytesWritten_2));
1503
- break $l$block_6;
1504
- }
1505
- if (isEmpty(tail_2)) {
1506
- this_0.qq();
1507
- }
1508
- }
1509
- i = i + 2 | 0;
1510
- }
1511
- }
1512
- }
1513
- _this__u8e3s4.gp();
1514
- }
1515
- function commonReadUtf8(_this__u8e3s4, byteCount) {
1516
- if (byteCount === 0n)
1517
- return '';
1518
- // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.forEachSegment' call
1519
- var curr = _this__u8e3s4.no_1;
1520
- while (!(curr == null)) {
1521
- get_SegmentReadContextImpl();
1522
- if (fromInt(curr.g1()) >= byteCount) {
1523
- var result = '';
1524
- // Inline function 'kotlinx.io.unsafe.withData' call
1525
- var tmp0 = curr.gr(true);
1526
- var tmp2 = curr.wo_1;
1527
- var tmp0_0 = curr.xo_1;
1528
- // Inline function 'kotlin.math.min' call
1529
- var b = tmp2 + convertToInt(byteCount) | 0;
1530
- var tmp$ret$0 = Math.min(tmp0_0, b);
1531
- result = commonToUtf8String(tmp0, tmp2, tmp$ret$0);
1532
- _this__u8e3s4.op(byteCount);
1533
- return result;
1534
- }
1535
- return commonToUtf8String(readByteArray_0(_this__u8e3s4, convertToInt(byteCount)));
1536
- }
1537
- // Inline function 'kotlin.error' call
1538
- var message = 'Unreacheable';
1539
- throw IllegalStateException_init_$Create$(toString(message));
1540
- }
1541
- function commonToUtf8String(_this__u8e3s4, beginIndex, endIndex) {
1542
- beginIndex = beginIndex === VOID ? 0 : beginIndex;
1543
- endIndex = endIndex === VOID ? _this__u8e3s4.length : endIndex;
1544
- if (beginIndex < 0 || endIndex > _this__u8e3s4.length || beginIndex > endIndex) {
1545
- throw IndexOutOfBoundsException_init_$Create$('size=' + _this__u8e3s4.length + ' beginIndex=' + beginIndex + ' endIndex=' + endIndex);
1546
- }
1547
- var chars = charArray(endIndex - beginIndex | 0);
1548
- var length = 0;
1549
- // Inline function 'kotlinx.io.internal.processUtf16Chars' call
1550
- var index = beginIndex;
1551
- while (index < endIndex) {
1552
- var b0 = _this__u8e3s4[index];
1553
- if (b0 >= 0) {
1554
- var c = numberToChar(b0);
1555
- var _unary__edvuaz = length;
1556
- length = _unary__edvuaz + 1 | 0;
1557
- chars[_unary__edvuaz] = c;
1558
- index = index + 1 | 0;
1559
- while (index < endIndex && _this__u8e3s4[index] >= 0) {
1560
- var _unary__edvuaz_0 = index;
1561
- index = _unary__edvuaz_0 + 1 | 0;
1562
- var c_0 = numberToChar(_this__u8e3s4[_unary__edvuaz_0]);
1563
- var _unary__edvuaz_1 = length;
1564
- length = _unary__edvuaz_1 + 1 | 0;
1565
- chars[_unary__edvuaz_1] = c_0;
1566
- }
1567
- } else {
1568
- // Inline function 'kotlinx.io.shr' call
1569
- if (b0 >> 5 === -2) {
1570
- var tmp = index;
1571
- var tmp2 = index;
1572
- var tmp$ret$5;
1573
- $l$block_0: {
1574
- // Inline function 'kotlinx.io.internal.process2Utf8Bytes' call
1575
- if (endIndex <= (tmp2 + 1 | 0)) {
1576
- var c_1 = numberToChar(65533);
1577
- var _unary__edvuaz_2 = length;
1578
- length = _unary__edvuaz_2 + 1 | 0;
1579
- chars[_unary__edvuaz_2] = c_1;
1580
- tmp$ret$5 = 1;
1581
- break $l$block_0;
1582
- }
1583
- var b0_0 = _this__u8e3s4[tmp2];
1584
- var b1 = _this__u8e3s4[tmp2 + 1 | 0];
1585
- // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1586
- // Inline function 'kotlinx.io.and' call
1587
- if (!((b1 & 192) === 128)) {
1588
- var c_2 = numberToChar(65533);
1589
- var _unary__edvuaz_3 = length;
1590
- length = _unary__edvuaz_3 + 1 | 0;
1591
- chars[_unary__edvuaz_3] = c_2;
1592
- tmp$ret$5 = 1;
1593
- break $l$block_0;
1594
- }
1595
- var codePoint = 3968 ^ b1 ^ b0_0 << 6;
1596
- if (codePoint < 128) {
1597
- var c_3 = numberToChar(65533);
1598
- var _unary__edvuaz_4 = length;
1599
- length = _unary__edvuaz_4 + 1 | 0;
1600
- chars[_unary__edvuaz_4] = c_3;
1601
- } else {
1602
- var c_4 = numberToChar(codePoint);
1603
- var _unary__edvuaz_5 = length;
1604
- length = _unary__edvuaz_5 + 1 | 0;
1605
- chars[_unary__edvuaz_5] = c_4;
1606
- }
1607
- tmp$ret$5 = 2;
1608
- }
1609
- index = tmp + tmp$ret$5 | 0;
1610
- } else {
1611
- // Inline function 'kotlinx.io.shr' call
1612
- if (b0 >> 4 === -2) {
1613
- var tmp_0 = index;
1614
- var tmp2_0 = index;
1615
- var tmp$ret$19;
1616
- $l$block_4: {
1617
- // Inline function 'kotlinx.io.internal.process3Utf8Bytes' call
1618
- if (endIndex <= (tmp2_0 + 2 | 0)) {
1619
- var c_5 = numberToChar(65533);
1620
- var _unary__edvuaz_6 = length;
1621
- length = _unary__edvuaz_6 + 1 | 0;
1622
- chars[_unary__edvuaz_6] = c_5;
1623
- var tmp_1;
1624
- if (endIndex <= (tmp2_0 + 1 | 0)) {
1625
- tmp_1 = true;
1626
- } else {
1627
- // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1628
- // Inline function 'kotlinx.io.and' call
1629
- tmp_1 = !((_this__u8e3s4[tmp2_0 + 1 | 0] & 192) === 128);
1630
- }
1631
- if (tmp_1) {
1632
- tmp$ret$19 = 1;
1633
- break $l$block_4;
1634
- } else {
1635
- tmp$ret$19 = 2;
1636
- break $l$block_4;
1637
- }
1638
- }
1639
- var b0_1 = _this__u8e3s4[tmp2_0];
1640
- var b1_0 = _this__u8e3s4[tmp2_0 + 1 | 0];
1641
- // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1642
- // Inline function 'kotlinx.io.and' call
1643
- if (!((b1_0 & 192) === 128)) {
1644
- var c_6 = numberToChar(65533);
1645
- var _unary__edvuaz_7 = length;
1646
- length = _unary__edvuaz_7 + 1 | 0;
1647
- chars[_unary__edvuaz_7] = c_6;
1648
- tmp$ret$19 = 1;
1649
- break $l$block_4;
1650
- }
1651
- var b2 = _this__u8e3s4[tmp2_0 + 2 | 0];
1652
- // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1653
- // Inline function 'kotlinx.io.and' call
1654
- if (!((b2 & 192) === 128)) {
1655
- var c_7 = numberToChar(65533);
1656
- var _unary__edvuaz_8 = length;
1657
- length = _unary__edvuaz_8 + 1 | 0;
1658
- chars[_unary__edvuaz_8] = c_7;
1659
- tmp$ret$19 = 2;
1660
- break $l$block_4;
1661
- }
1662
- var codePoint_0 = -123008 ^ b2 ^ b1_0 << 6 ^ b0_1 << 12;
1663
- if (codePoint_0 < 2048) {
1664
- var c_8 = numberToChar(65533);
1665
- var _unary__edvuaz_9 = length;
1666
- length = _unary__edvuaz_9 + 1 | 0;
1667
- chars[_unary__edvuaz_9] = c_8;
1668
- } else if (55296 <= codePoint_0 ? codePoint_0 <= 57343 : false) {
1669
- var c_9 = numberToChar(65533);
1670
- var _unary__edvuaz_10 = length;
1671
- length = _unary__edvuaz_10 + 1 | 0;
1672
- chars[_unary__edvuaz_10] = c_9;
1673
- } else {
1674
- var c_10 = numberToChar(codePoint_0);
1675
- var _unary__edvuaz_11 = length;
1676
- length = _unary__edvuaz_11 + 1 | 0;
1677
- chars[_unary__edvuaz_11] = c_10;
1678
- }
1679
- tmp$ret$19 = 3;
1680
- }
1681
- index = tmp_0 + tmp$ret$19 | 0;
1682
- } else {
1683
- // Inline function 'kotlinx.io.shr' call
1684
- if (b0 >> 3 === -2) {
1685
- var tmp_2 = index;
1686
- var tmp2_1 = index;
1687
- var tmp$ret$41;
1688
- $l$block_10: {
1689
- // Inline function 'kotlinx.io.internal.process4Utf8Bytes' call
1690
- if (endIndex <= (tmp2_1 + 3 | 0)) {
1691
- if (!(65533 === 65533)) {
1692
- var c_11 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1693
- var _unary__edvuaz_12 = length;
1694
- length = _unary__edvuaz_12 + 1 | 0;
1695
- chars[_unary__edvuaz_12] = c_11;
1696
- var c_12 = numberToChar((65533 & 1023) + 56320 | 0);
1697
- var _unary__edvuaz_13 = length;
1698
- length = _unary__edvuaz_13 + 1 | 0;
1699
- chars[_unary__edvuaz_13] = c_12;
1700
- } else {
1701
- var c_13 = _Char___init__impl__6a9atx(65533);
1702
- var _unary__edvuaz_14 = length;
1703
- length = _unary__edvuaz_14 + 1 | 0;
1704
- chars[_unary__edvuaz_14] = c_13;
1705
- }
1706
- var tmp_3;
1707
- if (endIndex <= (tmp2_1 + 1 | 0)) {
1708
- tmp_3 = true;
1709
- } else {
1710
- // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1711
- // Inline function 'kotlinx.io.and' call
1712
- tmp_3 = !((_this__u8e3s4[tmp2_1 + 1 | 0] & 192) === 128);
1713
- }
1714
- if (tmp_3) {
1715
- tmp$ret$41 = 1;
1716
- break $l$block_10;
1717
- } else {
1718
- var tmp_4;
1719
- if (endIndex <= (tmp2_1 + 2 | 0)) {
1720
- tmp_4 = true;
1721
- } else {
1722
- // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1723
- // Inline function 'kotlinx.io.and' call
1724
- tmp_4 = !((_this__u8e3s4[tmp2_1 + 2 | 0] & 192) === 128);
1725
- }
1726
- if (tmp_4) {
1727
- tmp$ret$41 = 2;
1728
- break $l$block_10;
1729
- } else {
1730
- tmp$ret$41 = 3;
1731
- break $l$block_10;
1732
- }
1733
- }
1734
- }
1735
- var b0_2 = _this__u8e3s4[tmp2_1];
1736
- var b1_1 = _this__u8e3s4[tmp2_1 + 1 | 0];
1737
- // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1738
- // Inline function 'kotlinx.io.and' call
1739
- if (!((b1_1 & 192) === 128)) {
1740
- if (!(65533 === 65533)) {
1741
- var c_14 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1742
- var _unary__edvuaz_15 = length;
1743
- length = _unary__edvuaz_15 + 1 | 0;
1744
- chars[_unary__edvuaz_15] = c_14;
1745
- var c_15 = numberToChar((65533 & 1023) + 56320 | 0);
1746
- var _unary__edvuaz_16 = length;
1747
- length = _unary__edvuaz_16 + 1 | 0;
1748
- chars[_unary__edvuaz_16] = c_15;
1749
- } else {
1750
- var c_16 = _Char___init__impl__6a9atx(65533);
1751
- var _unary__edvuaz_17 = length;
1752
- length = _unary__edvuaz_17 + 1 | 0;
1753
- chars[_unary__edvuaz_17] = c_16;
1754
- }
1755
- tmp$ret$41 = 1;
1756
- break $l$block_10;
1757
- }
1758
- var b2_0 = _this__u8e3s4[tmp2_1 + 2 | 0];
1759
- // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1760
- // Inline function 'kotlinx.io.and' call
1761
- if (!((b2_0 & 192) === 128)) {
1762
- if (!(65533 === 65533)) {
1763
- var c_17 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1764
- var _unary__edvuaz_18 = length;
1765
- length = _unary__edvuaz_18 + 1 | 0;
1766
- chars[_unary__edvuaz_18] = c_17;
1767
- var c_18 = numberToChar((65533 & 1023) + 56320 | 0);
1768
- var _unary__edvuaz_19 = length;
1769
- length = _unary__edvuaz_19 + 1 | 0;
1770
- chars[_unary__edvuaz_19] = c_18;
1771
- } else {
1772
- var c_19 = _Char___init__impl__6a9atx(65533);
1773
- var _unary__edvuaz_20 = length;
1774
- length = _unary__edvuaz_20 + 1 | 0;
1775
- chars[_unary__edvuaz_20] = c_19;
1776
- }
1777
- tmp$ret$41 = 2;
1778
- break $l$block_10;
1779
- }
1780
- var b3 = _this__u8e3s4[tmp2_1 + 3 | 0];
1781
- // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1782
- // Inline function 'kotlinx.io.and' call
1783
- if (!((b3 & 192) === 128)) {
1784
- if (!(65533 === 65533)) {
1785
- var c_20 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1786
- var _unary__edvuaz_21 = length;
1787
- length = _unary__edvuaz_21 + 1 | 0;
1788
- chars[_unary__edvuaz_21] = c_20;
1789
- var c_21 = numberToChar((65533 & 1023) + 56320 | 0);
1790
- var _unary__edvuaz_22 = length;
1791
- length = _unary__edvuaz_22 + 1 | 0;
1792
- chars[_unary__edvuaz_22] = c_21;
1793
- } else {
1794
- var c_22 = _Char___init__impl__6a9atx(65533);
1795
- var _unary__edvuaz_23 = length;
1796
- length = _unary__edvuaz_23 + 1 | 0;
1797
- chars[_unary__edvuaz_23] = c_22;
1798
- }
1799
- tmp$ret$41 = 3;
1800
- break $l$block_10;
1801
- }
1802
- var codePoint_1 = 3678080 ^ b3 ^ b2_0 << 6 ^ b1_1 << 12 ^ b0_2 << 18;
1803
- if (codePoint_1 > 1114111) {
1804
- if (!(65533 === 65533)) {
1805
- var c_23 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1806
- var _unary__edvuaz_24 = length;
1807
- length = _unary__edvuaz_24 + 1 | 0;
1808
- chars[_unary__edvuaz_24] = c_23;
1809
- var c_24 = numberToChar((65533 & 1023) + 56320 | 0);
1810
- var _unary__edvuaz_25 = length;
1811
- length = _unary__edvuaz_25 + 1 | 0;
1812
- chars[_unary__edvuaz_25] = c_24;
1813
- } else {
1814
- var c_25 = _Char___init__impl__6a9atx(65533);
1815
- var _unary__edvuaz_26 = length;
1816
- length = _unary__edvuaz_26 + 1 | 0;
1817
- chars[_unary__edvuaz_26] = c_25;
1818
- }
1819
- } else if (55296 <= codePoint_1 ? codePoint_1 <= 57343 : false) {
1820
- if (!(65533 === 65533)) {
1821
- var c_26 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1822
- var _unary__edvuaz_27 = length;
1823
- length = _unary__edvuaz_27 + 1 | 0;
1824
- chars[_unary__edvuaz_27] = c_26;
1825
- var c_27 = numberToChar((65533 & 1023) + 56320 | 0);
1826
- var _unary__edvuaz_28 = length;
1827
- length = _unary__edvuaz_28 + 1 | 0;
1828
- chars[_unary__edvuaz_28] = c_27;
1829
- } else {
1830
- var c_28 = _Char___init__impl__6a9atx(65533);
1831
- var _unary__edvuaz_29 = length;
1832
- length = _unary__edvuaz_29 + 1 | 0;
1833
- chars[_unary__edvuaz_29] = c_28;
1834
- }
1835
- } else if (codePoint_1 < 65536) {
1836
- if (!(65533 === 65533)) {
1837
- var c_29 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1838
- var _unary__edvuaz_30 = length;
1839
- length = _unary__edvuaz_30 + 1 | 0;
1840
- chars[_unary__edvuaz_30] = c_29;
1841
- var c_30 = numberToChar((65533 & 1023) + 56320 | 0);
1842
- var _unary__edvuaz_31 = length;
1843
- length = _unary__edvuaz_31 + 1 | 0;
1844
- chars[_unary__edvuaz_31] = c_30;
1845
- } else {
1846
- var c_31 = _Char___init__impl__6a9atx(65533);
1847
- var _unary__edvuaz_32 = length;
1848
- length = _unary__edvuaz_32 + 1 | 0;
1849
- chars[_unary__edvuaz_32] = c_31;
1850
- }
1851
- } else {
1852
- if (!(codePoint_1 === 65533)) {
1853
- var c_32 = numberToChar((codePoint_1 >>> 10 | 0) + 55232 | 0);
1854
- var _unary__edvuaz_33 = length;
1855
- length = _unary__edvuaz_33 + 1 | 0;
1856
- chars[_unary__edvuaz_33] = c_32;
1857
- var c_33 = numberToChar((codePoint_1 & 1023) + 56320 | 0);
1858
- var _unary__edvuaz_34 = length;
1859
- length = _unary__edvuaz_34 + 1 | 0;
1860
- chars[_unary__edvuaz_34] = c_33;
1861
- } else {
1862
- var c_34 = _Char___init__impl__6a9atx(65533);
1863
- var _unary__edvuaz_35 = length;
1864
- length = _unary__edvuaz_35 + 1 | 0;
1865
- chars[_unary__edvuaz_35] = c_34;
1866
- }
1867
- }
1868
- tmp$ret$41 = 4;
1869
- }
1870
- index = tmp_2 + tmp$ret$41 | 0;
1871
- } else {
1872
- var c_35 = _Char___init__impl__6a9atx(65533);
1873
- var _unary__edvuaz_36 = length;
1874
- length = _unary__edvuaz_36 + 1 | 0;
1875
- chars[_unary__edvuaz_36] = c_35;
1876
- index = index + 1 | 0;
1877
- }
1878
- }
1879
- }
1880
- }
1881
- }
1882
- return concatToString(chars, 0, length);
1883
- }
1884
- function get_SegmentReadContextImpl() {
1885
- _init_properties_UnsafeBufferOperations_kt__xw75gy();
1886
- return SegmentReadContextImpl;
1887
- }
1888
- var SegmentReadContextImpl;
1889
- function get_SegmentWriteContextImpl() {
1890
- _init_properties_UnsafeBufferOperations_kt__xw75gy();
1891
- return SegmentWriteContextImpl;
1892
- }
1893
- var SegmentWriteContextImpl;
1894
- var BufferIterationContextImpl;
1895
- function UnsafeBufferOperations() {
1896
- }
1897
- var UnsafeBufferOperations_instance;
1898
- function UnsafeBufferOperations_getInstance() {
1899
- return UnsafeBufferOperations_instance;
1900
- }
1901
- function SegmentReadContextImpl$1() {
1902
- }
1903
- protoOf(SegmentReadContextImpl$1).oq = function (segment, offset) {
1904
- return segment.np(offset);
1905
- };
1906
- function SegmentWriteContextImpl$1() {
1907
- }
1908
- protoOf(SegmentWriteContextImpl$1).or = function (segment, offset, value) {
1909
- segment.hr(offset, value);
1910
- };
1911
- protoOf(SegmentWriteContextImpl$1).nr = function (segment, offset, b0, b1) {
1912
- segment.ir(offset, b0, b1);
1913
- };
1914
- protoOf(SegmentWriteContextImpl$1).mr = function (segment, offset, b0, b1, b2) {
1915
- segment.jr(offset, b0, b1, b2);
1916
- };
1917
- protoOf(SegmentWriteContextImpl$1).lr = function (segment, offset, b0, b1, b2, b3) {
1918
- segment.kr(offset, b0, b1, b2, b3);
1919
- };
1920
- function BufferIterationContextImpl$1() {
1921
- }
1922
- protoOf(BufferIterationContextImpl$1).oq = function (segment, offset) {
1923
- return get_SegmentReadContextImpl().oq(segment, offset);
1924
- };
1925
- var properties_initialized_UnsafeBufferOperations_kt_2xfgoc;
1926
- function _init_properties_UnsafeBufferOperations_kt__xw75gy() {
1927
- if (!properties_initialized_UnsafeBufferOperations_kt_2xfgoc) {
1928
- properties_initialized_UnsafeBufferOperations_kt_2xfgoc = true;
1929
- SegmentReadContextImpl = new SegmentReadContextImpl$1();
1930
- SegmentWriteContextImpl = new SegmentWriteContextImpl$1();
1931
- BufferIterationContextImpl = new BufferIterationContextImpl$1();
1932
- }
1933
- }
1934
- function IOException_init_$Init$($this) {
1935
- Exception_init_$Init$($this);
1936
- IOException.call($this);
1937
- return $this;
1938
- }
1939
- function IOException_init_$Create$() {
1940
- var tmp = IOException_init_$Init$(objectCreate(protoOf(IOException)));
1941
- captureStack(tmp, IOException_init_$Create$);
1942
- return tmp;
1943
- }
1944
- function IOException_init_$Init$_0(message, $this) {
1945
- Exception_init_$Init$_0(message, $this);
1946
- IOException.call($this);
1947
- return $this;
1948
- }
1949
- function IOException_init_$Create$_0(message) {
1950
- var tmp = IOException_init_$Init$_0(message, objectCreate(protoOf(IOException)));
1951
- captureStack(tmp, IOException_init_$Create$_0);
1952
- return tmp;
1953
- }
1954
- function IOException_init_$Init$_1(message, cause, $this) {
1955
- Exception_init_$Init$_1(message, cause, $this);
1956
- IOException.call($this);
1957
- return $this;
1958
- }
1959
- function IOException_init_$Create$_1(message, cause) {
1960
- var tmp = IOException_init_$Init$_1(message, cause, objectCreate(protoOf(IOException)));
1961
- captureStack(tmp, IOException_init_$Create$_1);
1962
- return tmp;
1963
- }
1964
- function IOException() {
1965
- captureStack(this, IOException);
1966
- }
1967
- function EOFException_init_$Init$($this) {
1968
- IOException_init_$Init$($this);
1969
- EOFException.call($this);
1970
- return $this;
1971
- }
1972
- function EOFException_init_$Create$() {
1973
- var tmp = EOFException_init_$Init$(objectCreate(protoOf(EOFException)));
1974
- captureStack(tmp, EOFException_init_$Create$);
1975
- return tmp;
1976
- }
1977
- function EOFException_init_$Init$_0(message, $this) {
1978
- IOException_init_$Init$_0(message, $this);
1979
- EOFException.call($this);
1980
- return $this;
1981
- }
1982
- function EOFException_init_$Create$_0(message) {
1983
- var tmp = EOFException_init_$Init$_0(message, objectCreate(protoOf(EOFException)));
1984
- captureStack(tmp, EOFException_init_$Create$_0);
1985
- return tmp;
1986
- }
1987
- function EOFException() {
1988
- captureStack(this, EOFException);
1989
- }
1990
- function SegmentPool() {
1991
- this.xp_1 = 0;
1992
- this.yp_1 = 0;
1993
- }
1994
- protoOf(SegmentPool).zp = function () {
1995
- return Companion_instance.cr();
1996
- };
1997
- protoOf(SegmentPool).pq = function (segment) {
1998
- };
1999
- protoOf(SegmentPool).er = function () {
2000
- return AlwaysSharedCopyTracker_getInstance();
2001
- };
2002
- var SegmentPool_instance;
2003
- function SegmentPool_getInstance() {
2004
- return SegmentPool_instance;
2005
- }
2006
- //region block: post-declaration
2007
- protoOf(Buffer).dq = write$default;
2008
- //endregion
2009
- //region block: init
2010
- Companion_instance = new Companion();
2011
- UnsafeBufferOperations_instance = new UnsafeBufferOperations();
2012
- SegmentPool_instance = new SegmentPool();
2013
- //endregion
2014
- //region block: exports
2015
- _.$_$ = _.$_$ || {};
2016
- _.$_$.a = EOFException_init_$Create$_0;
2017
- _.$_$.b = IOException_init_$Init$_0;
2018
- _.$_$.c = IOException_init_$Create$_0;
2019
- _.$_$.d = IOException_init_$Init$_1;
2020
- _.$_$.e = IOException_init_$Create$_1;
2021
- _.$_$.f = Buffer;
2022
- _.$_$.g = IOException;
2023
- _.$_$.h = Source;
2024
- _.$_$.i = indexOf_1;
2025
- _.$_$.j = readByteArray_0;
2026
- _.$_$.k = readByteArray;
2027
- _.$_$.l = readByteString;
2028
- _.$_$.m = readString_0;
2029
- _.$_$.n = readString;
2030
- _.$_$.o = writeString;
2031
- //endregion
2032
- return _;
2033
- }));
2034
-
2035
- //# sourceMappingURL=kotlinx-io-kotlinx-io-core.js.map