@xiuper/mpp-core 0.0.2

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 (173) hide show
  1. package/Kotlin-DateTime-library-kotlinx-datetime.js +7836 -0
  2. package/Kotlin-DateTime-library-kotlinx-datetime.js.map +1 -0
  3. package/Kotlin-Immutable-Collections-kotlinx-collections-immutable.js +1241 -0
  4. package/Kotlin-Immutable-Collections-kotlinx-collections-immutable.js.map +1 -0
  5. package/Xiuper-mpp-codegraph.js +1471 -0
  6. package/Xiuper-mpp-codegraph.js.map +1 -0
  7. package/annotations.js +15 -0
  8. package/annotations.js.map +1 -0
  9. package/autodev-mpp-core.d.ts +1312 -0
  10. package/autodev-mpp-core.js +86483 -0
  11. package/autodev-mpp-core.js.map +1 -0
  12. package/kaml.js +3387 -0
  13. package/kaml.js.map +1 -0
  14. package/koog-agents-agents-core.js +22927 -0
  15. package/koog-agents-agents-core.js.map +1 -0
  16. package/koog-agents-agents-ext.js +15 -0
  17. package/koog-agents-agents-ext.js.map +1 -0
  18. package/koog-agents-agents-features-agents-features-event-handler.js +15 -0
  19. package/koog-agents-agents-features-agents-features-event-handler.js.map +1 -0
  20. package/koog-agents-agents-features-agents-features-memory.js +15 -0
  21. package/koog-agents-agents-features-agents-features-memory.js.map +1 -0
  22. package/koog-agents-agents-features-agents-features-opentelemetry.js +15 -0
  23. package/koog-agents-agents-features-agents-features-opentelemetry.js.map +1 -0
  24. package/koog-agents-agents-features-agents-features-snapshot.js +15 -0
  25. package/koog-agents-agents-features-agents-features-snapshot.js.map +1 -0
  26. package/koog-agents-agents-features-agents-features-tokenizer.js +15 -0
  27. package/koog-agents-agents-features-agents-features-tokenizer.js.map +1 -0
  28. package/koog-agents-agents-features-agents-features-trace.js +15 -0
  29. package/koog-agents-agents-features-agents-features-trace.js.map +1 -0
  30. package/koog-agents-agents-mcp.js +15 -0
  31. package/koog-agents-agents-mcp.js.map +1 -0
  32. package/koog-agents-agents-tools.js +322 -0
  33. package/koog-agents-agents-tools.js.map +1 -0
  34. package/koog-agents-agents-utils.js +232 -0
  35. package/koog-agents-agents-utils.js.map +1 -0
  36. package/koog-embeddings-embeddings-base.js +15 -0
  37. package/koog-embeddings-embeddings-base.js.map +1 -0
  38. package/koog-embeddings-embeddings-llm.js +15 -0
  39. package/koog-embeddings-embeddings-llm.js.map +1 -0
  40. package/koog-http-client-http-client-core.js +57 -0
  41. package/koog-http-client-http-client-core.js.map +1 -0
  42. package/koog-http-client-http-client-ktor.js +703 -0
  43. package/koog-http-client-http-client-ktor.js.map +1 -0
  44. package/koog-koog-agents.js +15 -0
  45. package/koog-koog-agents.js.map +1 -0
  46. package/koog-prompt-prompt-cache-prompt-cache-files.js +15 -0
  47. package/koog-prompt-prompt-cache-prompt-cache-files.js.map +1 -0
  48. package/koog-prompt-prompt-cache-prompt-cache-model.js +15 -0
  49. package/koog-prompt-prompt-cache-prompt-cache-model.js.map +1 -0
  50. package/koog-prompt-prompt-cache-prompt-cache-redis.js +15 -0
  51. package/koog-prompt-prompt-cache-prompt-cache-redis.js.map +1 -0
  52. package/koog-prompt-prompt-executor-prompt-executor-cached.js +15 -0
  53. package/koog-prompt-prompt-executor-prompt-executor-cached.js.map +1 -0
  54. package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-anthropic-client.js +4991 -0
  55. package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-anthropic-client.js.map +1 -0
  56. package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-bedrock-client.js +15 -0
  57. package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-bedrock-client.js.map +1 -0
  58. package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-dashscope-client.js +15 -0
  59. package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-dashscope-client.js.map +1 -0
  60. package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-deepseek-client.js +1249 -0
  61. package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-deepseek-client.js.map +1 -0
  62. package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-google-client.js +4675 -0
  63. package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-google-client.js.map +1 -0
  64. package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-mistralai-client.js +15 -0
  65. package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-mistralai-client.js.map +1 -0
  66. package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client.js +2343 -0
  67. package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-ollama-client.js.map +1 -0
  68. package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-openai-client-base.js +6613 -0
  69. package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-openai-client-base.js.map +1 -0
  70. package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-openai-client.js +19901 -0
  71. package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-openai-client.js.map +1 -0
  72. package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-openrouter-client.js +2313 -0
  73. package/koog-prompt-prompt-executor-prompt-executor-clients-prompt-executor-openrouter-client.js.map +1 -0
  74. package/koog-prompt-prompt-executor-prompt-executor-clients.js +222 -0
  75. package/koog-prompt-prompt-executor-prompt-executor-clients.js.map +1 -0
  76. package/koog-prompt-prompt-executor-prompt-executor-llms-all.js +70 -0
  77. package/koog-prompt-prompt-executor-prompt-executor-llms-all.js.map +1 -0
  78. package/koog-prompt-prompt-executor-prompt-executor-llms.js +134 -0
  79. package/koog-prompt-prompt-executor-prompt-executor-llms.js.map +1 -0
  80. package/koog-prompt-prompt-executor-prompt-executor-model.js +42 -0
  81. package/koog-prompt-prompt-executor-prompt-executor-model.js.map +1 -0
  82. package/koog-prompt-prompt-llm.js +1710 -0
  83. package/koog-prompt-prompt-llm.js.map +1 -0
  84. package/koog-prompt-prompt-markdown.js +122 -0
  85. package/koog-prompt-prompt-markdown.js.map +1 -0
  86. package/koog-prompt-prompt-model.js +5848 -0
  87. package/koog-prompt-prompt-model.js.map +1 -0
  88. package/koog-prompt-prompt-structure.js +1513 -0
  89. package/koog-prompt-prompt-structure.js.map +1 -0
  90. package/koog-prompt-prompt-tokenizer.js +15 -0
  91. package/koog-prompt-prompt-tokenizer.js.map +1 -0
  92. package/koog-prompt-prompt-xml.js +15 -0
  93. package/koog-prompt-prompt-xml.js.map +1 -0
  94. package/koog-rag-rag-base.js +15 -0
  95. package/koog-rag-rag-base.js.map +1 -0
  96. package/koog-rag-vector-storage.js +15 -0
  97. package/koog-rag-vector-storage.js.map +1 -0
  98. package/koog-utils.js +63 -0
  99. package/koog-utils.js.map +1 -0
  100. package/kotlin-kotlin-stdlib.js +18965 -0
  101. package/kotlin-kotlin-stdlib.js.map +1 -0
  102. package/kotlin-logging.js +509 -0
  103. package/kotlin-logging.js.map +1 -0
  104. package/kotlin-sdk-kotlin-sdk-client.js +1340 -0
  105. package/kotlin-sdk-kotlin-sdk-client.js.map +1 -0
  106. package/kotlin-sdk-kotlin-sdk-core.js +15195 -0
  107. package/kotlin-sdk-kotlin-sdk-core.js.map +1 -0
  108. package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js +15 -0
  109. package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js.map +1 -0
  110. package/kotlinx-atomicfu.js +259 -0
  111. package/kotlinx-atomicfu.js.map +1 -0
  112. package/kotlinx-coroutines-core.js +13742 -0
  113. package/kotlinx-coroutines-core.js.map +1 -0
  114. package/kotlinx-io-kotlinx-io-bytestring.js +214 -0
  115. package/kotlinx-io-kotlinx-io-bytestring.js.map +1 -0
  116. package/kotlinx-io-kotlinx-io-core.js +2892 -0
  117. package/kotlinx-io-kotlinx-io-core.js.map +1 -0
  118. package/kotlinx-serialization-kotlinx-serialization-core.js +6563 -0
  119. package/kotlinx-serialization-kotlinx-serialization-core.js.map +1 -0
  120. package/kotlinx-serialization-kotlinx-serialization-json-io.js +15 -0
  121. package/kotlinx-serialization-kotlinx-serialization-json-io.js.map +1 -0
  122. package/kotlinx-serialization-kotlinx-serialization-json.js +5927 -0
  123. package/kotlinx-serialization-kotlinx-serialization-json.js.map +1 -0
  124. package/ktor-ktor-client-content-negotiation.js +775 -0
  125. package/ktor-ktor-client-content-negotiation.js.map +1 -0
  126. package/ktor-ktor-client-core.js +11110 -0
  127. package/ktor-ktor-client-core.js.map +1 -0
  128. package/ktor-ktor-client-logging.js +15 -0
  129. package/ktor-ktor-client-logging.js.map +1 -0
  130. package/ktor-ktor-events.js +126 -0
  131. package/ktor-ktor-events.js.map +1 -0
  132. package/ktor-ktor-http-cio.js +4257 -0
  133. package/ktor-ktor-http-cio.js.map +1 -0
  134. package/ktor-ktor-http.js +3671 -0
  135. package/ktor-ktor-http.js.map +1 -0
  136. package/ktor-ktor-io.js +4114 -0
  137. package/ktor-ktor-io.js.map +1 -0
  138. package/ktor-ktor-network.js +1399 -0
  139. package/ktor-ktor-network.js.map +1 -0
  140. package/ktor-ktor-serialization-kotlinx-json.js +67 -0
  141. package/ktor-ktor-serialization-kotlinx-json.js.map +1 -0
  142. package/ktor-ktor-serialization-kotlinx.js +881 -0
  143. package/ktor-ktor-serialization-kotlinx.js.map +1 -0
  144. package/ktor-ktor-serialization.js +388 -0
  145. package/ktor-ktor-serialization.js.map +1 -0
  146. package/ktor-ktor-server-cio.js +3735 -0
  147. package/ktor-ktor-server-cio.js.map +1 -0
  148. package/ktor-ktor-server-core.js +8696 -0
  149. package/ktor-ktor-server-core.js.map +1 -0
  150. package/ktor-ktor-server-sse.js +668 -0
  151. package/ktor-ktor-server-sse.js.map +1 -0
  152. package/ktor-ktor-server-websockets.js +15 -0
  153. package/ktor-ktor-server-websockets.js.map +1 -0
  154. package/ktor-ktor-sse.js +161 -0
  155. package/ktor-ktor-sse.js.map +1 -0
  156. package/ktor-ktor-utils.js +3589 -0
  157. package/ktor-ktor-utils.js.map +1 -0
  158. package/ktor-ktor-websocket-serialization.js +15 -0
  159. package/ktor-ktor-websocket-serialization.js.map +1 -0
  160. package/ktor-ktor-websockets.js +450 -0
  161. package/ktor-ktor-websockets.js.map +1 -0
  162. package/markdown.js +5174 -0
  163. package/markdown.js.map +1 -0
  164. package/okio-parent-okio.js +2628 -0
  165. package/okio-parent-okio.js.map +1 -0
  166. package/package.json +18 -0
  167. package/snakeyaml-engine-kmp.js +7079 -0
  168. package/snakeyaml-engine-kmp.js.map +1 -0
  169. package/urlencoder-urlencoder-lib.js +322 -0
  170. package/urlencoder-urlencoder-lib.js.map +1 -0
  171. package/xiuper-mpp-core.d.ts +1312 -0
  172. package/xiuper-mpp-core.js +86483 -0
  173. package/xiuper-mpp-core.js.map +1 -0
@@ -0,0 +1,2892 @@
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.$_$.o2;
20
+ var Long = kotlin_kotlin.$_$.sk;
21
+ var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.e2;
22
+ var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.j3;
23
+ var charArrayOf = kotlin_kotlin.$_$.ed;
24
+ var protoOf = kotlin_kotlin.$_$.we;
25
+ var toString = kotlin_kotlin.$_$.af;
26
+ var Unit_instance = kotlin_kotlin.$_$.h6;
27
+ var toShort = kotlin_kotlin.$_$.ze;
28
+ var ensureNotNull = kotlin_kotlin.$_$.sl;
29
+ var toLong = kotlin_kotlin.$_$.ye;
30
+ var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.o1;
31
+ var initMetadataForClass = kotlin_kotlin.$_$.ud;
32
+ var VOID = kotlin_kotlin.$_$.h;
33
+ var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.j2;
34
+ var UnsafeByteStringOperations_instance = kotlin_org_jetbrains_kotlinx_kotlinx_io_bytestring.$_$.b;
35
+ var AutoCloseable = kotlin_kotlin.$_$.fk;
36
+ var objectCreate = kotlin_kotlin.$_$.ve;
37
+ var initMetadataForCompanion = kotlin_kotlin.$_$.vd;
38
+ var arrayCopy = kotlin_kotlin.$_$.d7;
39
+ var toByte = kotlin_kotlin.$_$.xe;
40
+ var IllegalArgumentException_init_$Create$_0 = kotlin_kotlin.$_$.c2;
41
+ var initMetadataForObject = kotlin_kotlin.$_$.ae;
42
+ var initMetadataForInterface = kotlin_kotlin.$_$.yd;
43
+ var charCodeAt = kotlin_kotlin.$_$.gd;
44
+ var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.q3;
45
+ var StringBuilder_init_$Create$_0 = kotlin_kotlin.$_$.p1;
46
+ var charSequenceLength = kotlin_kotlin.$_$.id;
47
+ var endsWith = kotlin_kotlin.$_$.tg;
48
+ var startsWith = kotlin_kotlin.$_$.ji;
49
+ var substring = kotlin_kotlin.$_$.wi;
50
+ var charArray = kotlin_kotlin.$_$.fd;
51
+ var numberToChar = kotlin_kotlin.$_$.se;
52
+ var concatToString = kotlin_kotlin.$_$.jg;
53
+ var Exception_init_$Init$ = kotlin_kotlin.$_$.w1;
54
+ var captureStack = kotlin_kotlin.$_$.dd;
55
+ var Exception_init_$Init$_0 = kotlin_kotlin.$_$.y1;
56
+ var Exception_init_$Init$_1 = kotlin_kotlin.$_$.a2;
57
+ var Exception = kotlin_kotlin.$_$.ok;
58
+ var KProperty0 = kotlin_kotlin.$_$.sf;
59
+ var getPropertyCallableRef = kotlin_kotlin.$_$.rd;
60
+ var UnsupportedOperationException_init_$Create$ = kotlin_kotlin.$_$.c3;
61
+ var lazy = kotlin_kotlin.$_$.yl;
62
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.t;
63
+ var asReversed = kotlin_kotlin.$_$.f7;
64
+ var contains = kotlin_kotlin.$_$.lg;
65
+ var getStringHashCode = kotlin_kotlin.$_$.sd;
66
+ var Char = kotlin_kotlin.$_$.hk;
67
+ //endregion
68
+ //region block: pre-declaration
69
+ initMetadataForInterface(Source, 'Source', VOID, VOID, [AutoCloseable]);
70
+ function write$default(source, startIndex, endIndex, $super) {
71
+ startIndex = startIndex === VOID ? 0 : startIndex;
72
+ endIndex = endIndex === VOID ? source.length : endIndex;
73
+ var tmp;
74
+ if ($super === VOID) {
75
+ this.a3c(source, startIndex, endIndex);
76
+ tmp = Unit_instance;
77
+ } else {
78
+ tmp = $super.a3c.call(this, source, startIndex, endIndex);
79
+ }
80
+ return tmp;
81
+ }
82
+ initMetadataForInterface(Sink, 'Sink', VOID, VOID, [AutoCloseable]);
83
+ initMetadataForClass(Buffer, 'Buffer', Buffer, VOID, [Source, Sink]);
84
+ initMetadataForClass(PeekSource, 'PeekSource', VOID, VOID, [AutoCloseable]);
85
+ initMetadataForClass(RealSink, 'RealSink', VOID, VOID, [Sink]);
86
+ initMetadataForClass(RealSource, 'RealSource', VOID, VOID, [Source]);
87
+ initMetadataForCompanion(Companion);
88
+ initMetadataForClass(Segment, 'Segment');
89
+ initMetadataForClass(SegmentCopyTracker, 'SegmentCopyTracker');
90
+ initMetadataForObject(AlwaysSharedCopyTracker, 'AlwaysSharedCopyTracker', VOID, SegmentCopyTracker);
91
+ function delete$default(path, mustExist, $super) {
92
+ mustExist = mustExist === VOID ? true : mustExist;
93
+ var tmp;
94
+ if ($super === VOID) {
95
+ this.t3d(path, mustExist);
96
+ tmp = Unit_instance;
97
+ } else {
98
+ tmp = $super.t3d.call(this, path, mustExist);
99
+ }
100
+ return tmp;
101
+ }
102
+ function createDirectories$default(path, mustCreate, $super) {
103
+ mustCreate = mustCreate === VOID ? false : mustCreate;
104
+ var tmp;
105
+ if ($super === VOID) {
106
+ this.v3d(path, mustCreate);
107
+ tmp = Unit_instance;
108
+ } else {
109
+ tmp = $super.v3d.call(this, path, mustCreate);
110
+ }
111
+ return tmp;
112
+ }
113
+ function sink$default(path, append, $super) {
114
+ append = append === VOID ? false : append;
115
+ return $super === VOID ? this.y3d(path, append) : $super.y3d.call(this, path, append);
116
+ }
117
+ initMetadataForInterface(FileSystem, 'FileSystem');
118
+ initMetadataForClass(SystemFileSystemImpl, 'SystemFileSystemImpl', VOID, VOID, [FileSystem]);
119
+ initMetadataForClass(FileMetadata, 'FileMetadata', FileMetadata);
120
+ initMetadataForObject(UnsafeBufferOperations, 'UnsafeBufferOperations');
121
+ initMetadataForClass(SegmentReadContextImpl$1);
122
+ initMetadataForClass(SegmentWriteContextImpl$1);
123
+ initMetadataForClass(BufferIterationContextImpl$1);
124
+ initMetadataForClass(IOException, 'IOException', IOException_init_$Create$, Exception);
125
+ initMetadataForClass(EOFException, 'EOFException', EOFException_init_$Create$, IOException);
126
+ initMetadataForObject(SegmentPool, 'SegmentPool');
127
+ initMetadataForClass(FileNotFoundException, 'FileNotFoundException', VOID, IOException);
128
+ initMetadataForClass(SystemFileSystem$1, VOID, VOID, SystemFileSystemImpl);
129
+ initMetadataForClass(Path_1, 'Path');
130
+ initMetadataForClass(FileSource, 'FileSource', VOID, VOID, [AutoCloseable]);
131
+ initMetadataForClass(FileSink, 'FileSink', VOID, VOID, [AutoCloseable]);
132
+ //endregion
133
+ function get_HEX_DIGIT_CHARS() {
134
+ _init_properties__Util_kt__g8tcl9();
135
+ return HEX_DIGIT_CHARS;
136
+ }
137
+ var HEX_DIGIT_CHARS;
138
+ function checkBounds(size, startIndex, endIndex) {
139
+ _init_properties__Util_kt__g8tcl9();
140
+ if (startIndex.j1(new Long(0, 0)) < 0 || endIndex.j1(size) > 0) {
141
+ throw IndexOutOfBoundsException_init_$Create$('startIndex (' + startIndex.toString() + ') and endIndex (' + endIndex.toString() + ') are not within the range [0..size(' + size.toString() + '))');
142
+ }
143
+ if (startIndex.j1(endIndex) > 0) {
144
+ throw IllegalArgumentException_init_$Create$('startIndex (' + startIndex.toString() + ') > endIndex (' + endIndex.toString() + ')');
145
+ }
146
+ }
147
+ function checkOffsetAndCount(size, offset, byteCount) {
148
+ _init_properties__Util_kt__g8tcl9();
149
+ if (offset.j1(new Long(0, 0)) < 0 || offset.j1(size) > 0 || size.c3(offset).j1(byteCount) < 0 || byteCount.j1(new Long(0, 0)) < 0) {
150
+ throw IllegalArgumentException_init_$Create$('offset (' + offset.toString() + ') and byteCount (' + byteCount.toString() + ') are not within the range [0..size(' + size.toString() + '))');
151
+ }
152
+ }
153
+ var properties_initialized__Util_kt_67kc5b;
154
+ function _init_properties__Util_kt__g8tcl9() {
155
+ if (!properties_initialized__Util_kt_67kc5b) {
156
+ properties_initialized__Util_kt_67kc5b = true;
157
+ // Inline function 'kotlin.charArrayOf' call
158
+ 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)]);
159
+ }
160
+ }
161
+ function throwEof($this, byteCount) {
162
+ throw EOFException_init_$Create$_0("Buffer doesn't contain required number of bytes (size: " + $this.s().toString() + ', required: ' + byteCount.toString() + ')');
163
+ }
164
+ function Buffer() {
165
+ this.n3a_1 = null;
166
+ this.o3a_1 = null;
167
+ this.p3a_1 = new Long(0, 0);
168
+ }
169
+ protoOf(Buffer).s = function () {
170
+ return this.p3a_1;
171
+ };
172
+ protoOf(Buffer).q3a = function () {
173
+ return this;
174
+ };
175
+ protoOf(Buffer).r3a = function () {
176
+ return this.s().equals(new Long(0, 0));
177
+ };
178
+ protoOf(Buffer).s3a = function (byteCount) {
179
+ // Inline function 'kotlin.require' call
180
+ if (!(byteCount.j1(new Long(0, 0)) >= 0)) {
181
+ var message = 'byteCount: ' + byteCount.toString();
182
+ throw IllegalArgumentException_init_$Create$(toString(message));
183
+ }
184
+ if (this.s().j1(byteCount) < 0) {
185
+ throw EOFException_init_$Create$_0("Buffer doesn't contain required number of bytes (size: " + this.s().toString() + ', required: ' + byteCount.toString() + ')');
186
+ }
187
+ };
188
+ protoOf(Buffer).t3a = function (byteCount) {
189
+ // Inline function 'kotlin.require' call
190
+ if (!(byteCount.j1(new Long(0, 0)) >= 0)) {
191
+ var message = 'byteCount: ' + byteCount.toString() + ' < 0';
192
+ throw IllegalArgumentException_init_$Create$(toString(message));
193
+ }
194
+ return this.s().j1(byteCount) >= 0;
195
+ };
196
+ protoOf(Buffer).u3a = function () {
197
+ var tmp0_elvis_lhs = this.n3a_1;
198
+ var tmp;
199
+ if (tmp0_elvis_lhs == null) {
200
+ throwEof(this, new Long(1, 0));
201
+ } else {
202
+ tmp = tmp0_elvis_lhs;
203
+ }
204
+ var segment = tmp;
205
+ var segmentSize = segment.s();
206
+ if (segmentSize === 0) {
207
+ this.c3b();
208
+ return this.u3a();
209
+ }
210
+ var v = segment.d3b();
211
+ this.p3a_1 = this.p3a_1.c3(new Long(1, 0));
212
+ if (segmentSize === 1) {
213
+ this.c3b();
214
+ }
215
+ return v;
216
+ };
217
+ protoOf(Buffer).e3b = function () {
218
+ var tmp0_elvis_lhs = this.n3a_1;
219
+ var tmp;
220
+ if (tmp0_elvis_lhs == null) {
221
+ throwEof(this, new Long(2, 0));
222
+ } else {
223
+ tmp = tmp0_elvis_lhs;
224
+ }
225
+ var segment = tmp;
226
+ var segmentSize = segment.s();
227
+ if (segmentSize < 2) {
228
+ this.s3a(new Long(2, 0));
229
+ if (segmentSize === 0) {
230
+ this.c3b();
231
+ return this.e3b();
232
+ }
233
+ // Inline function 'kotlinx.io.and' call
234
+ var tmp_0 = (this.u3a() & 255) << 8;
235
+ // Inline function 'kotlinx.io.and' call
236
+ var tmp$ret$1 = this.u3a() & 255;
237
+ return toShort(tmp_0 | tmp$ret$1);
238
+ }
239
+ var v = segment.f3b();
240
+ this.p3a_1 = this.p3a_1.c3(new Long(2, 0));
241
+ if (segmentSize === 2) {
242
+ this.c3b();
243
+ }
244
+ return v;
245
+ };
246
+ protoOf(Buffer).g3b = function () {
247
+ return Unit_instance;
248
+ };
249
+ protoOf(Buffer).h3b = function (out, startIndex, endIndex) {
250
+ checkBounds(this.s(), startIndex, endIndex);
251
+ if (startIndex.equals(endIndex))
252
+ return Unit_instance;
253
+ var currentOffset = startIndex;
254
+ var remainingByteCount = endIndex.c3(startIndex);
255
+ out.p3a_1 = out.p3a_1.b3(remainingByteCount);
256
+ var s = this.n3a_1;
257
+ while (currentOffset.j1(toLong(ensureNotNull(s).x3a_1 - s.w3a_1 | 0)) >= 0) {
258
+ currentOffset = currentOffset.c3(toLong(s.x3a_1 - s.w3a_1 | 0));
259
+ s = s.a3b_1;
260
+ }
261
+ while (remainingByteCount.j1(new Long(0, 0)) > 0) {
262
+ var copy = ensureNotNull(s).i3b();
263
+ copy.w3a_1 = copy.w3a_1 + currentOffset.l1() | 0;
264
+ var tmp = copy;
265
+ var tmp0 = copy.w3a_1 + remainingByteCount.l1() | 0;
266
+ // Inline function 'kotlin.comparisons.minOf' call
267
+ var b = copy.x3a_1;
268
+ tmp.x3a_1 = Math.min(tmp0, b);
269
+ // Inline function 'kotlinx.io.Buffer.pushSegment' call
270
+ if (out.n3a_1 == null) {
271
+ out.n3a_1 = copy;
272
+ out.o3a_1 = copy;
273
+ } else if (false) {
274
+ out.o3a_1 = ensureNotNull(out.o3a_1).j3b(copy).k3b();
275
+ if (ensureNotNull(out.o3a_1).b3b_1 == null) {
276
+ out.n3a_1 = out.o3a_1;
277
+ }
278
+ } else {
279
+ out.o3a_1 = ensureNotNull(out.o3a_1).j3b(copy);
280
+ }
281
+ remainingByteCount = remainingByteCount.c3(toLong(copy.x3a_1 - copy.w3a_1 | 0));
282
+ currentOffset = new Long(0, 0);
283
+ s = s.a3b_1;
284
+ }
285
+ };
286
+ protoOf(Buffer).l3b = function () {
287
+ var result = this.s();
288
+ if (result.equals(new Long(0, 0)))
289
+ return new Long(0, 0);
290
+ var tail = ensureNotNull(this.o3a_1);
291
+ if (tail.x3a_1 < 8192 && tail.z3a_1) {
292
+ result = result.c3(toLong(tail.x3a_1 - tail.w3a_1 | 0));
293
+ }
294
+ return result;
295
+ };
296
+ protoOf(Buffer).m3b = function (position) {
297
+ if (position.j1(new Long(0, 0)) < 0 || position.j1(this.s()) >= 0) {
298
+ throw IndexOutOfBoundsException_init_$Create$('position (' + position.toString() + ') is not within the range [0..size(' + this.s().toString() + '))');
299
+ }
300
+ if (position.equals(new Long(0, 0))) {
301
+ return ensureNotNull(this.n3a_1).n3b(0);
302
+ }
303
+ // Inline function 'kotlinx.io.seek' call
304
+ if (this.n3a_1 == null) {
305
+ var offset = new Long(-1, -1);
306
+ return ensureNotNull(null).n3b(position.c3(offset).l1());
307
+ }
308
+ if (this.s().c3(position).j1(position) < 0) {
309
+ var s = this.o3a_1;
310
+ var offset_0 = this.s();
311
+ $l$loop: while (!(s == null) && offset_0.j1(position) > 0) {
312
+ offset_0 = offset_0.c3(toLong(s.x3a_1 - s.w3a_1 | 0));
313
+ if (offset_0.j1(position) <= 0)
314
+ break $l$loop;
315
+ s = s.b3b_1;
316
+ }
317
+ var tmp0 = s;
318
+ var offset_1 = offset_0;
319
+ return ensureNotNull(tmp0).n3b(position.c3(offset_1).l1());
320
+ } else {
321
+ var s_0 = this.n3a_1;
322
+ var offset_2 = new Long(0, 0);
323
+ $l$loop_0: while (!(s_0 == null)) {
324
+ var tmp0_0 = offset_2;
325
+ // Inline function 'kotlin.Long.plus' call
326
+ var other = s_0.x3a_1 - s_0.w3a_1 | 0;
327
+ var nextOffset = tmp0_0.b3(toLong(other));
328
+ if (nextOffset.j1(position) > 0)
329
+ break $l$loop_0;
330
+ s_0 = s_0.a3b_1;
331
+ offset_2 = nextOffset;
332
+ }
333
+ var tmp0_1 = s_0;
334
+ var offset_3 = offset_2;
335
+ return ensureNotNull(tmp0_1).n3b(position.c3(offset_3).l1());
336
+ }
337
+ };
338
+ protoOf(Buffer).n2 = function () {
339
+ return this.o3b(this.s());
340
+ };
341
+ protoOf(Buffer).o3b = function (byteCount) {
342
+ // Inline function 'kotlinx.io.checkByteCount' call
343
+ // Inline function 'kotlin.require' call
344
+ if (!(byteCount.j1(new Long(0, 0)) >= 0)) {
345
+ var message = 'byteCount (' + byteCount.toString() + ') < 0';
346
+ throw IllegalArgumentException_init_$Create$(toString(message));
347
+ }
348
+ var remainingByteCount = byteCount;
349
+ while (remainingByteCount.j1(new Long(0, 0)) > 0) {
350
+ var tmp0_elvis_lhs = this.n3a_1;
351
+ var tmp;
352
+ if (tmp0_elvis_lhs == null) {
353
+ throw EOFException_init_$Create$_0('Buffer exhausted before skipping ' + byteCount.toString() + ' bytes.');
354
+ } else {
355
+ tmp = tmp0_elvis_lhs;
356
+ }
357
+ var head = tmp;
358
+ var tmp0 = remainingByteCount;
359
+ // Inline function 'kotlinx.io.minOf' call
360
+ var b = head.x3a_1 - head.w3a_1 | 0;
361
+ // Inline function 'kotlin.comparisons.minOf' call
362
+ var b_0 = toLong(b);
363
+ var toSkip = (tmp0.j1(b_0) <= 0 ? tmp0 : b_0).l1();
364
+ this.p3a_1 = this.p3a_1.c3(toLong(toSkip));
365
+ remainingByteCount = remainingByteCount.c3(toLong(toSkip));
366
+ head.w3a_1 = head.w3a_1 + toSkip | 0;
367
+ if (head.w3a_1 === head.x3a_1) {
368
+ this.c3b();
369
+ }
370
+ }
371
+ };
372
+ protoOf(Buffer).p3b = function (sink, startIndex, endIndex) {
373
+ // Inline function 'kotlinx.io.checkBounds' call
374
+ var size = sink.length;
375
+ checkBounds(toLong(size), toLong(startIndex), toLong(endIndex));
376
+ var tmp0_elvis_lhs = this.n3a_1;
377
+ var tmp;
378
+ if (tmp0_elvis_lhs == null) {
379
+ return -1;
380
+ } else {
381
+ tmp = tmp0_elvis_lhs;
382
+ }
383
+ var s = tmp;
384
+ var tmp0 = endIndex - startIndex | 0;
385
+ // Inline function 'kotlin.comparisons.minOf' call
386
+ var b = s.s();
387
+ var toCopy = Math.min(tmp0, b);
388
+ s.q3b(sink, startIndex, startIndex + toCopy | 0);
389
+ this.p3a_1 = this.p3a_1.c3(toLong(toCopy));
390
+ if (isEmpty(s)) {
391
+ this.c3b();
392
+ }
393
+ return toCopy;
394
+ };
395
+ protoOf(Buffer).r3b = function (sink, byteCount) {
396
+ // Inline function 'kotlinx.io.checkByteCount' call
397
+ // Inline function 'kotlin.require' call
398
+ if (!(byteCount.j1(new Long(0, 0)) >= 0)) {
399
+ var message = 'byteCount (' + byteCount.toString() + ') < 0';
400
+ throw IllegalArgumentException_init_$Create$(toString(message));
401
+ }
402
+ if (this.s().equals(new Long(0, 0)))
403
+ return new Long(-1, -1);
404
+ var bytesWritten = byteCount.j1(this.s()) > 0 ? this.s() : byteCount;
405
+ sink.s3b(this, bytesWritten);
406
+ return bytesWritten;
407
+ };
408
+ protoOf(Buffer).t3b = function (sink, byteCount) {
409
+ // Inline function 'kotlinx.io.checkByteCount' call
410
+ // Inline function 'kotlin.require' call
411
+ if (!(byteCount.j1(new Long(0, 0)) >= 0)) {
412
+ var message = 'byteCount (' + byteCount.toString() + ') < 0';
413
+ throw IllegalArgumentException_init_$Create$(toString(message));
414
+ }
415
+ if (this.s().j1(byteCount) < 0) {
416
+ sink.s3b(this, this.s());
417
+ throw EOFException_init_$Create$_0('Buffer exhausted before writing ' + byteCount.toString() + ' bytes. Only ' + this.s().toString() + ' bytes were written.');
418
+ }
419
+ sink.s3b(this, byteCount);
420
+ };
421
+ protoOf(Buffer).u3b = function (sink) {
422
+ var byteCount = this.s();
423
+ if (byteCount.j1(new Long(0, 0)) > 0) {
424
+ sink.s3b(this, byteCount);
425
+ }
426
+ return byteCount;
427
+ };
428
+ protoOf(Buffer).v3b = function () {
429
+ return buffered(new PeekSource(this));
430
+ };
431
+ protoOf(Buffer).w3b = function (minimumCapacity) {
432
+ // Inline function 'kotlin.require' call
433
+ if (!(minimumCapacity >= 1 && minimumCapacity <= 8192)) {
434
+ var message = 'unexpected capacity (' + minimumCapacity + '), should be in range [1, 8192]';
435
+ throw IllegalArgumentException_init_$Create$(toString(message));
436
+ }
437
+ if (this.o3a_1 == null) {
438
+ var result = SegmentPool_instance.z3b();
439
+ this.n3a_1 = result;
440
+ this.o3a_1 = result;
441
+ return result;
442
+ }
443
+ var t = ensureNotNull(this.o3a_1);
444
+ if ((t.x3a_1 + minimumCapacity | 0) > 8192 || !t.z3a_1) {
445
+ var newTail = t.j3b(SegmentPool_instance.z3b());
446
+ this.o3a_1 = newTail;
447
+ return newTail;
448
+ }
449
+ return t;
450
+ };
451
+ protoOf(Buffer).a3c = function (source, startIndex, endIndex) {
452
+ // Inline function 'kotlinx.io.checkBounds' call
453
+ var size = source.length;
454
+ checkBounds(toLong(size), toLong(startIndex), toLong(endIndex));
455
+ var currentOffset = startIndex;
456
+ while (currentOffset < endIndex) {
457
+ var tail = this.w3b(1);
458
+ var tmp0 = endIndex - currentOffset | 0;
459
+ // Inline function 'kotlin.comparisons.minOf' call
460
+ var b = tail.b3c();
461
+ var toCopy = Math.min(tmp0, b);
462
+ tail.c3c(source, currentOffset, currentOffset + toCopy | 0);
463
+ currentOffset = currentOffset + toCopy | 0;
464
+ }
465
+ var tmp = this;
466
+ var tmp0_0 = this.p3a_1;
467
+ // Inline function 'kotlin.Long.plus' call
468
+ var other = endIndex - startIndex | 0;
469
+ tmp.p3a_1 = tmp0_0.b3(toLong(other));
470
+ };
471
+ protoOf(Buffer).e3c = function (source, byteCount) {
472
+ // Inline function 'kotlinx.io.checkByteCount' call
473
+ // Inline function 'kotlin.require' call
474
+ if (!(byteCount.j1(new Long(0, 0)) >= 0)) {
475
+ var message = 'byteCount (' + byteCount.toString() + ') < 0';
476
+ throw IllegalArgumentException_init_$Create$(toString(message));
477
+ }
478
+ var remainingByteCount = byteCount;
479
+ while (remainingByteCount.j1(new Long(0, 0)) > 0) {
480
+ var read = source.r3b(this, remainingByteCount);
481
+ if (read.equals(new Long(-1, -1))) {
482
+ throw EOFException_init_$Create$_0('Source exhausted before reading ' + byteCount.toString() + ' bytes. ' + ('Only ' + byteCount.c3(remainingByteCount).toString() + ' were read.'));
483
+ }
484
+ remainingByteCount = remainingByteCount.c3(read);
485
+ }
486
+ };
487
+ protoOf(Buffer).s3b = function (source, byteCount) {
488
+ // Inline function 'kotlin.require' call
489
+ if (!!(source === this)) {
490
+ var message = 'source == this';
491
+ throw IllegalArgumentException_init_$Create$(toString(message));
492
+ }
493
+ checkOffsetAndCount(source.p3a_1, new Long(0, 0), byteCount);
494
+ var remainingByteCount = byteCount;
495
+ while (remainingByteCount.j1(new Long(0, 0)) > 0) {
496
+ if (remainingByteCount.j1(toLong(ensureNotNull(source.n3a_1).s())) < 0) {
497
+ var tail = this.o3a_1;
498
+ var tmp;
499
+ if (!(tail == null) && tail.z3a_1) {
500
+ var tmp0 = remainingByteCount;
501
+ // Inline function 'kotlin.Long.plus' call
502
+ var other = tail.x3a_1;
503
+ var tmp0_0 = tmp0.b3(toLong(other));
504
+ // Inline function 'kotlin.Long.minus' call
505
+ var other_0 = tail.f3c() ? 0 : tail.w3a_1;
506
+ tmp = tmp0_0.c3(toLong(other_0)).j1(new Long(8192, 0)) <= 0;
507
+ } else {
508
+ tmp = false;
509
+ }
510
+ if (tmp) {
511
+ ensureNotNull(source.n3a_1).h3c(tail, remainingByteCount.l1());
512
+ source.p3a_1 = source.p3a_1.c3(remainingByteCount);
513
+ this.p3a_1 = this.p3a_1.b3(remainingByteCount);
514
+ return Unit_instance;
515
+ } else {
516
+ source.n3a_1 = ensureNotNull(source.n3a_1).g3c(remainingByteCount.l1());
517
+ }
518
+ }
519
+ var segmentToMove = ensureNotNull(source.n3a_1);
520
+ var movedByteCount = toLong(segmentToMove.s());
521
+ source.n3a_1 = segmentToMove.i3c();
522
+ if (source.n3a_1 == null) {
523
+ source.o3a_1 = null;
524
+ }
525
+ // Inline function 'kotlinx.io.Buffer.pushSegment' call
526
+ if (this.n3a_1 == null) {
527
+ this.n3a_1 = segmentToMove;
528
+ this.o3a_1 = segmentToMove;
529
+ } else if (true) {
530
+ this.o3a_1 = ensureNotNull(this.o3a_1).j3b(segmentToMove).k3b();
531
+ if (ensureNotNull(this.o3a_1).b3b_1 == null) {
532
+ this.n3a_1 = this.o3a_1;
533
+ }
534
+ } else {
535
+ this.o3a_1 = ensureNotNull(this.o3a_1).j3b(segmentToMove);
536
+ }
537
+ source.p3a_1 = source.p3a_1.c3(movedByteCount);
538
+ this.p3a_1 = this.p3a_1.b3(movedByteCount);
539
+ remainingByteCount = remainingByteCount.c3(movedByteCount);
540
+ }
541
+ };
542
+ protoOf(Buffer).j3c = function (source) {
543
+ var totalBytesRead = new Long(0, 0);
544
+ $l$loop: while (true) {
545
+ var readCount = source.r3b(this, new Long(8192, 0));
546
+ if (readCount.equals(new Long(-1, -1)))
547
+ break $l$loop;
548
+ totalBytesRead = totalBytesRead.b3(readCount);
549
+ }
550
+ return totalBytesRead;
551
+ };
552
+ protoOf(Buffer).k3c = function (byte) {
553
+ this.w3b(1).l3c(byte);
554
+ this.p3a_1 = this.p3a_1.b3(new Long(1, 0));
555
+ };
556
+ protoOf(Buffer).m3c = function (short) {
557
+ this.w3b(2).n3c(short);
558
+ this.p3a_1 = this.p3a_1.b3(new Long(2, 0));
559
+ };
560
+ protoOf(Buffer).u4 = function () {
561
+ return Unit_instance;
562
+ };
563
+ protoOf(Buffer).toString = function () {
564
+ if (this.s().equals(new Long(0, 0)))
565
+ return 'Buffer(size=0)';
566
+ var maxPrintableBytes = 64;
567
+ // Inline function 'kotlinx.io.minOf' call
568
+ var b = this.s();
569
+ // Inline function 'kotlin.comparisons.minOf' call
570
+ var a = toLong(maxPrintableBytes);
571
+ var len = (a.j1(b) <= 0 ? a : b).l1();
572
+ var builder = StringBuilder_init_$Create$(imul(len, 2) + (this.s().j1(toLong(maxPrintableBytes)) > 0 ? 1 : 0) | 0);
573
+ var bytesWritten = 0;
574
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.forEachSegment' call
575
+ var curr = this.n3a_1;
576
+ while (!(curr == null)) {
577
+ var tmp0 = get_SegmentReadContextImpl();
578
+ var segment = curr;
579
+ var idx = 0;
580
+ while (bytesWritten < len && idx < segment.s()) {
581
+ var _unary__edvuaz = idx;
582
+ idx = _unary__edvuaz + 1 | 0;
583
+ var b_0 = tmp0.o3c(segment, _unary__edvuaz);
584
+ bytesWritten = bytesWritten + 1 | 0;
585
+ var tmp = get_HEX_DIGIT_CHARS();
586
+ // Inline function 'kotlinx.io.shr' call
587
+ var tmp$ret$2 = b_0 >> 4;
588
+ var tmp_0 = builder.a9(tmp[tmp$ret$2 & 15]);
589
+ var tmp_1 = get_HEX_DIGIT_CHARS();
590
+ // Inline function 'kotlinx.io.and' call
591
+ var tmp$ret$3 = b_0 & 15;
592
+ tmp_0.a9(tmp_1[tmp$ret$3]);
593
+ }
594
+ curr = curr.a3b_1;
595
+ }
596
+ if (this.s().j1(toLong(maxPrintableBytes)) > 0) {
597
+ builder.a9(_Char___init__impl__6a9atx(8230));
598
+ }
599
+ return 'Buffer(size=' + this.s().toString() + ' hex=' + builder.toString() + ')';
600
+ };
601
+ protoOf(Buffer).c3b = function () {
602
+ var oldHead = ensureNotNull(this.n3a_1);
603
+ var nextHead = oldHead.a3b_1;
604
+ this.n3a_1 = nextHead;
605
+ if (nextHead == null) {
606
+ this.o3a_1 = null;
607
+ } else {
608
+ nextHead.b3b_1 = null;
609
+ }
610
+ oldHead.a3b_1 = null;
611
+ SegmentPool_instance.p3c(oldHead);
612
+ };
613
+ protoOf(Buffer).q3c = function () {
614
+ var oldTail = ensureNotNull(this.o3a_1);
615
+ var newTail = oldTail.b3b_1;
616
+ this.o3a_1 = newTail;
617
+ if (newTail == null) {
618
+ this.n3a_1 = null;
619
+ } else {
620
+ newTail.a3b_1 = null;
621
+ }
622
+ oldTail.b3b_1 = null;
623
+ SegmentPool_instance.p3c(oldTail);
624
+ };
625
+ function indexOf(_this__u8e3s4, byte, startIndex, endIndex) {
626
+ startIndex = startIndex === VOID ? new Long(0, 0) : startIndex;
627
+ endIndex = endIndex === VOID ? _this__u8e3s4.s() : endIndex;
628
+ // Inline function 'kotlin.comparisons.minOf' call
629
+ var b = _this__u8e3s4.s();
630
+ var endOffset = endIndex.j1(b) <= 0 ? endIndex : b;
631
+ checkBounds(_this__u8e3s4.s(), startIndex, endOffset);
632
+ if (startIndex.equals(endOffset))
633
+ return new Long(-1, -1);
634
+ // Inline function 'kotlinx.io.seek' call
635
+ if (_this__u8e3s4.n3a_1 == null) {
636
+ var o = new Long(-1, -1);
637
+ if (o.equals(new Long(-1, -1))) {
638
+ return new Long(-1, -1);
639
+ }
640
+ var segment = null;
641
+ var offset = o;
642
+ do {
643
+ // Inline function 'kotlin.check' call
644
+ if (!(endOffset.j1(offset) > 0)) {
645
+ throw IllegalStateException_init_$Create$('Check failed.');
646
+ }
647
+ ensureNotNull(segment);
648
+ var tmp = segment;
649
+ // Inline function 'kotlin.comparisons.maxOf' call
650
+ var a = startIndex.c3(offset).l1();
651
+ var tmp_0 = Math.max(a, 0);
652
+ var tmp0 = segment.s();
653
+ // Inline function 'kotlin.comparisons.minOf' call
654
+ var b_0 = endOffset.c3(offset).l1();
655
+ var tmp$ret$3 = Math.min(tmp0, b_0);
656
+ var idx = indexOf_0(tmp, byte, tmp_0, tmp$ret$3);
657
+ if (!(idx === -1)) {
658
+ return offset.b3(toLong(idx));
659
+ }
660
+ var tmp0_0 = offset;
661
+ // Inline function 'kotlin.Long.plus' call
662
+ var other = segment.s();
663
+ offset = tmp0_0.b3(toLong(other));
664
+ segment = segment.a3b_1;
665
+ }
666
+ while (!(segment == null) && offset.j1(endOffset) < 0);
667
+ return new Long(-1, -1);
668
+ }
669
+ if (_this__u8e3s4.s().c3(startIndex).j1(startIndex) < 0) {
670
+ var s = _this__u8e3s4.o3a_1;
671
+ var offset_0 = _this__u8e3s4.s();
672
+ $l$loop: while (!(s == null) && offset_0.j1(startIndex) > 0) {
673
+ offset_0 = offset_0.c3(toLong(s.x3a_1 - s.w3a_1 | 0));
674
+ if (offset_0.j1(startIndex) <= 0)
675
+ break $l$loop;
676
+ s = s.b3b_1;
677
+ }
678
+ var tmp0_1 = s;
679
+ var o_0 = offset_0;
680
+ if (o_0.equals(new Long(-1, -1))) {
681
+ return new Long(-1, -1);
682
+ }
683
+ var segment_0 = tmp0_1;
684
+ var offset_1 = o_0;
685
+ do {
686
+ // Inline function 'kotlin.check' call
687
+ if (!(endOffset.j1(offset_1) > 0)) {
688
+ throw IllegalStateException_init_$Create$('Check failed.');
689
+ }
690
+ ensureNotNull(segment_0);
691
+ var tmp_1 = segment_0;
692
+ // Inline function 'kotlin.comparisons.maxOf' call
693
+ var a_0 = startIndex.c3(offset_1).l1();
694
+ var tmp_2 = Math.max(a_0, 0);
695
+ var tmp0_2 = segment_0.s();
696
+ // Inline function 'kotlin.comparisons.minOf' call
697
+ var b_1 = endOffset.c3(offset_1).l1();
698
+ var tmp$ret$8 = Math.min(tmp0_2, b_1);
699
+ var idx_0 = indexOf_0(tmp_1, byte, tmp_2, tmp$ret$8);
700
+ if (!(idx_0 === -1)) {
701
+ return offset_1.b3(toLong(idx_0));
702
+ }
703
+ var tmp0_3 = offset_1;
704
+ // Inline function 'kotlin.Long.plus' call
705
+ var other_0 = segment_0.s();
706
+ offset_1 = tmp0_3.b3(toLong(other_0));
707
+ segment_0 = segment_0.a3b_1;
708
+ }
709
+ while (!(segment_0 == null) && offset_1.j1(endOffset) < 0);
710
+ return new Long(-1, -1);
711
+ } else {
712
+ var s_0 = _this__u8e3s4.n3a_1;
713
+ var offset_2 = new Long(0, 0);
714
+ $l$loop_0: while (!(s_0 == null)) {
715
+ var tmp0_4 = offset_2;
716
+ // Inline function 'kotlin.Long.plus' call
717
+ var other_1 = s_0.x3a_1 - s_0.w3a_1 | 0;
718
+ var nextOffset = tmp0_4.b3(toLong(other_1));
719
+ if (nextOffset.j1(startIndex) > 0)
720
+ break $l$loop_0;
721
+ s_0 = s_0.a3b_1;
722
+ offset_2 = nextOffset;
723
+ }
724
+ var tmp0_5 = s_0;
725
+ var o_1 = offset_2;
726
+ if (o_1.equals(new Long(-1, -1))) {
727
+ return new Long(-1, -1);
728
+ }
729
+ var segment_1 = tmp0_5;
730
+ var offset_3 = o_1;
731
+ do {
732
+ // Inline function 'kotlin.check' call
733
+ if (!(endOffset.j1(offset_3) > 0)) {
734
+ throw IllegalStateException_init_$Create$('Check failed.');
735
+ }
736
+ ensureNotNull(segment_1);
737
+ var tmp_3 = segment_1;
738
+ // Inline function 'kotlin.comparisons.maxOf' call
739
+ var a_1 = startIndex.c3(offset_3).l1();
740
+ var tmp_4 = Math.max(a_1, 0);
741
+ var tmp0_6 = segment_1.s();
742
+ // Inline function 'kotlin.comparisons.minOf' call
743
+ var b_2 = endOffset.c3(offset_3).l1();
744
+ var tmp$ret$13 = Math.min(tmp0_6, b_2);
745
+ var idx_1 = indexOf_0(tmp_3, byte, tmp_4, tmp$ret$13);
746
+ if (!(idx_1 === -1)) {
747
+ return offset_3.b3(toLong(idx_1));
748
+ }
749
+ var tmp0_7 = offset_3;
750
+ // Inline function 'kotlin.Long.plus' call
751
+ var other_2 = segment_1.s();
752
+ offset_3 = tmp0_7.b3(toLong(other_2));
753
+ segment_1 = segment_1.a3b_1;
754
+ }
755
+ while (!(segment_1 == null) && offset_3.j1(endOffset) < 0);
756
+ return new Long(-1, -1);
757
+ }
758
+ }
759
+ function readByteString(_this__u8e3s4, byteCount) {
760
+ return UnsafeByteStringOperations_instance.m3a(readByteArray_0(_this__u8e3s4, byteCount));
761
+ }
762
+ function buffered(_this__u8e3s4) {
763
+ return new RealSource(_this__u8e3s4);
764
+ }
765
+ function buffered_0(_this__u8e3s4) {
766
+ return new RealSink(_this__u8e3s4);
767
+ }
768
+ function PeekSource(upstream) {
769
+ this.r3c_1 = upstream;
770
+ this.s3c_1 = this.r3c_1.q3a();
771
+ this.t3c_1 = this.s3c_1.n3a_1;
772
+ var tmp = this;
773
+ var tmp0_safe_receiver = this.s3c_1.n3a_1;
774
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.w3a_1;
775
+ tmp.u3c_1 = tmp1_elvis_lhs == null ? -1 : tmp1_elvis_lhs;
776
+ this.v3c_1 = false;
777
+ this.w3c_1 = new Long(0, 0);
778
+ }
779
+ protoOf(PeekSource).r3b = function (sink, byteCount) {
780
+ // Inline function 'kotlin.check' call
781
+ if (!!this.v3c_1) {
782
+ var message = 'Source is closed.';
783
+ throw IllegalStateException_init_$Create$(toString(message));
784
+ }
785
+ // Inline function 'kotlinx.io.checkByteCount' call
786
+ // Inline function 'kotlin.require' call
787
+ if (!(byteCount.j1(new Long(0, 0)) >= 0)) {
788
+ var message_0 = 'byteCount (' + byteCount.toString() + ') < 0';
789
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
790
+ }
791
+ // Inline function 'kotlin.check' call
792
+ if (!(this.t3c_1 == null || (this.t3c_1 === this.s3c_1.n3a_1 && this.u3c_1 === ensureNotNull(this.s3c_1.n3a_1).w3a_1))) {
793
+ var message_1 = 'Peek source is invalid because upstream source was used';
794
+ throw IllegalStateException_init_$Create$(toString(message_1));
795
+ }
796
+ if (byteCount.equals(new Long(0, 0)))
797
+ return new Long(0, 0);
798
+ // Inline function 'kotlin.Long.plus' call
799
+ var tmp$ret$7 = this.w3c_1.b3(toLong(1));
800
+ if (!this.r3c_1.t3a(tmp$ret$7))
801
+ return new Long(-1, -1);
802
+ if (this.t3c_1 == null && !(this.s3c_1.n3a_1 == null)) {
803
+ this.t3c_1 = this.s3c_1.n3a_1;
804
+ this.u3c_1 = ensureNotNull(this.s3c_1.n3a_1).w3a_1;
805
+ }
806
+ // Inline function 'kotlin.comparisons.minOf' call
807
+ var b = this.s3c_1.s().c3(this.w3c_1);
808
+ var toCopy = byteCount.j1(b) <= 0 ? byteCount : b;
809
+ this.s3c_1.h3b(sink, this.w3c_1, this.w3c_1.b3(toCopy));
810
+ this.w3c_1 = this.w3c_1.b3(toCopy);
811
+ return toCopy;
812
+ };
813
+ protoOf(PeekSource).u4 = function () {
814
+ this.v3c_1 = true;
815
+ };
816
+ function RealSink(sink) {
817
+ this.x3c_1 = sink;
818
+ this.y3c_1 = false;
819
+ this.z3c_1 = new Buffer();
820
+ }
821
+ protoOf(RealSink).q3a = function () {
822
+ return this.z3c_1;
823
+ };
824
+ protoOf(RealSink).s3b = function (source, byteCount) {
825
+ // Inline function 'kotlinx.io.RealSink.checkNotClosed' call
826
+ // Inline function 'kotlin.check' call
827
+ if (!!this.y3c_1) {
828
+ var message = 'Sink is closed.';
829
+ throw IllegalStateException_init_$Create$(toString(message));
830
+ }
831
+ // Inline function 'kotlin.require' call
832
+ if (!(byteCount.j1(new Long(0, 0)) >= 0)) {
833
+ var message_0 = 'byteCount: ' + byteCount.toString();
834
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
835
+ }
836
+ this.z3c_1.s3b(source, byteCount);
837
+ this.g3b();
838
+ };
839
+ protoOf(RealSink).a3c = function (source, startIndex, endIndex) {
840
+ // Inline function 'kotlinx.io.RealSink.checkNotClosed' call
841
+ // Inline function 'kotlin.check' call
842
+ if (!!this.y3c_1) {
843
+ var message = 'Sink is closed.';
844
+ throw IllegalStateException_init_$Create$(toString(message));
845
+ }
846
+ // Inline function 'kotlinx.io.checkBounds' call
847
+ var size = source.length;
848
+ checkBounds(toLong(size), toLong(startIndex), toLong(endIndex));
849
+ this.z3c_1.a3c(source, startIndex, endIndex);
850
+ this.g3b();
851
+ };
852
+ protoOf(RealSink).j3c = function (source) {
853
+ // Inline function 'kotlinx.io.RealSink.checkNotClosed' call
854
+ // Inline function 'kotlin.check' call
855
+ if (!!this.y3c_1) {
856
+ var message = 'Sink is closed.';
857
+ throw IllegalStateException_init_$Create$(toString(message));
858
+ }
859
+ var totalBytesRead = new Long(0, 0);
860
+ $l$loop: while (true) {
861
+ var readCount = source.r3b(this.z3c_1, new Long(8192, 0));
862
+ if (readCount.equals(new Long(-1, -1)))
863
+ break $l$loop;
864
+ totalBytesRead = totalBytesRead.b3(readCount);
865
+ this.g3b();
866
+ }
867
+ return totalBytesRead;
868
+ };
869
+ protoOf(RealSink).e3c = function (source, byteCount) {
870
+ // Inline function 'kotlinx.io.RealSink.checkNotClosed' call
871
+ // Inline function 'kotlin.check' call
872
+ if (!!this.y3c_1) {
873
+ var message = 'Sink is closed.';
874
+ throw IllegalStateException_init_$Create$(toString(message));
875
+ }
876
+ // Inline function 'kotlin.require' call
877
+ if (!(byteCount.j1(new Long(0, 0)) >= 0)) {
878
+ var message_0 = 'byteCount: ' + byteCount.toString();
879
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
880
+ }
881
+ var remainingByteCount = byteCount;
882
+ while (remainingByteCount.j1(new Long(0, 0)) > 0) {
883
+ var read = source.r3b(this.z3c_1, remainingByteCount);
884
+ if (read.equals(new Long(-1, -1))) {
885
+ var bytesRead = byteCount.c3(remainingByteCount);
886
+ throw EOFException_init_$Create$_0('Source exhausted before reading ' + byteCount.toString() + ' bytes from it (number of bytes read: ' + bytesRead.toString() + ').');
887
+ }
888
+ remainingByteCount = remainingByteCount.c3(read);
889
+ this.g3b();
890
+ }
891
+ };
892
+ protoOf(RealSink).k3c = function (byte) {
893
+ // Inline function 'kotlinx.io.RealSink.checkNotClosed' call
894
+ // Inline function 'kotlin.check' call
895
+ if (!!this.y3c_1) {
896
+ var message = 'Sink is closed.';
897
+ throw IllegalStateException_init_$Create$(toString(message));
898
+ }
899
+ this.z3c_1.k3c(byte);
900
+ this.g3b();
901
+ };
902
+ protoOf(RealSink).m3c = function (short) {
903
+ // Inline function 'kotlinx.io.RealSink.checkNotClosed' call
904
+ // Inline function 'kotlin.check' call
905
+ if (!!this.y3c_1) {
906
+ var message = 'Sink is closed.';
907
+ throw IllegalStateException_init_$Create$(toString(message));
908
+ }
909
+ this.z3c_1.m3c(short);
910
+ this.g3b();
911
+ };
912
+ protoOf(RealSink).g3b = function () {
913
+ // Inline function 'kotlinx.io.RealSink.checkNotClosed' call
914
+ // Inline function 'kotlin.check' call
915
+ if (!!this.y3c_1) {
916
+ var message = 'Sink is closed.';
917
+ throw IllegalStateException_init_$Create$(toString(message));
918
+ }
919
+ var byteCount = this.z3c_1.l3b();
920
+ if (byteCount.j1(new Long(0, 0)) > 0) {
921
+ this.x3c_1.s3b(this.z3c_1, byteCount);
922
+ }
923
+ };
924
+ protoOf(RealSink).u4 = function () {
925
+ if (this.y3c_1)
926
+ return Unit_instance;
927
+ var thrown = null;
928
+ try {
929
+ if (this.z3c_1.s().j1(new Long(0, 0)) > 0) {
930
+ this.x3c_1.s3b(this.z3c_1, this.z3c_1.s());
931
+ }
932
+ } catch ($p) {
933
+ if ($p instanceof Error) {
934
+ var e = $p;
935
+ thrown = e;
936
+ } else {
937
+ throw $p;
938
+ }
939
+ }
940
+ try {
941
+ this.x3c_1.u4();
942
+ } catch ($p) {
943
+ if ($p instanceof Error) {
944
+ var e_0 = $p;
945
+ if (thrown == null)
946
+ thrown = e_0;
947
+ } else {
948
+ throw $p;
949
+ }
950
+ }
951
+ this.y3c_1 = true;
952
+ if (!(thrown == null))
953
+ throw thrown;
954
+ };
955
+ protoOf(RealSink).toString = function () {
956
+ return 'buffered(' + toString(this.x3c_1) + ')';
957
+ };
958
+ function RealSource(source) {
959
+ this.a3d_1 = source;
960
+ this.b3d_1 = false;
961
+ this.c3d_1 = new Buffer();
962
+ }
963
+ protoOf(RealSource).q3a = function () {
964
+ return this.c3d_1;
965
+ };
966
+ protoOf(RealSource).r3b = function (sink, byteCount) {
967
+ // Inline function 'kotlinx.io.RealSource.checkNotClosed' call
968
+ // Inline function 'kotlin.check' call
969
+ if (!!this.b3d_1) {
970
+ var message = 'Source is closed.';
971
+ throw IllegalStateException_init_$Create$(toString(message));
972
+ }
973
+ // Inline function 'kotlin.require' call
974
+ if (!(byteCount.j1(new Long(0, 0)) >= 0)) {
975
+ var message_0 = 'byteCount: ' + byteCount.toString();
976
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
977
+ }
978
+ if (this.c3d_1.s().equals(new Long(0, 0))) {
979
+ var read = this.a3d_1.r3b(this.c3d_1, new Long(8192, 0));
980
+ if (read.equals(new Long(-1, -1)))
981
+ return new Long(-1, -1);
982
+ }
983
+ // Inline function 'kotlin.comparisons.minOf' call
984
+ var b = this.c3d_1.s();
985
+ var toRead = byteCount.j1(b) <= 0 ? byteCount : b;
986
+ return this.c3d_1.r3b(sink, toRead);
987
+ };
988
+ protoOf(RealSource).r3a = function () {
989
+ // Inline function 'kotlinx.io.RealSource.checkNotClosed' call
990
+ // Inline function 'kotlin.check' call
991
+ if (!!this.b3d_1) {
992
+ var message = 'Source is closed.';
993
+ throw IllegalStateException_init_$Create$(toString(message));
994
+ }
995
+ return this.c3d_1.r3a() && this.a3d_1.r3b(this.c3d_1, new Long(8192, 0)).equals(new Long(-1, -1));
996
+ };
997
+ protoOf(RealSource).s3a = function (byteCount) {
998
+ if (!this.t3a(byteCount))
999
+ throw EOFException_init_$Create$_0("Source doesn't contain required number of bytes (" + byteCount.toString() + ').');
1000
+ };
1001
+ protoOf(RealSource).t3a = function (byteCount) {
1002
+ // Inline function 'kotlinx.io.RealSource.checkNotClosed' call
1003
+ // Inline function 'kotlin.check' call
1004
+ if (!!this.b3d_1) {
1005
+ var message = 'Source is closed.';
1006
+ throw IllegalStateException_init_$Create$(toString(message));
1007
+ }
1008
+ // Inline function 'kotlin.require' call
1009
+ if (!(byteCount.j1(new Long(0, 0)) >= 0)) {
1010
+ var message_0 = 'byteCount: ' + byteCount.toString();
1011
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
1012
+ }
1013
+ while (this.c3d_1.s().j1(byteCount) < 0) {
1014
+ if (this.a3d_1.r3b(this.c3d_1, new Long(8192, 0)).equals(new Long(-1, -1)))
1015
+ return false;
1016
+ }
1017
+ return true;
1018
+ };
1019
+ protoOf(RealSource).u3a = function () {
1020
+ this.s3a(new Long(1, 0));
1021
+ return this.c3d_1.u3a();
1022
+ };
1023
+ protoOf(RealSource).p3b = function (sink, startIndex, endIndex) {
1024
+ // Inline function 'kotlinx.io.checkBounds' call
1025
+ var size = sink.length;
1026
+ checkBounds(toLong(size), toLong(startIndex), toLong(endIndex));
1027
+ if (this.c3d_1.s().equals(new Long(0, 0))) {
1028
+ var read = this.a3d_1.r3b(this.c3d_1, new Long(8192, 0));
1029
+ if (read.equals(new Long(-1, -1)))
1030
+ return -1;
1031
+ }
1032
+ var tmp0 = endIndex - startIndex | 0;
1033
+ // Inline function 'kotlinx.io.minOf' call
1034
+ var b = this.c3d_1.s();
1035
+ // Inline function 'kotlin.comparisons.minOf' call
1036
+ var a = toLong(tmp0);
1037
+ var toRead = (a.j1(b) <= 0 ? a : b).l1();
1038
+ return this.c3d_1.p3b(sink, startIndex, startIndex + toRead | 0);
1039
+ };
1040
+ protoOf(RealSource).t3b = function (sink, byteCount) {
1041
+ try {
1042
+ this.s3a(byteCount);
1043
+ } catch ($p) {
1044
+ if ($p instanceof EOFException) {
1045
+ var e = $p;
1046
+ sink.s3b(this.c3d_1, this.c3d_1.s());
1047
+ throw e;
1048
+ } else {
1049
+ throw $p;
1050
+ }
1051
+ }
1052
+ this.c3d_1.t3b(sink, byteCount);
1053
+ };
1054
+ protoOf(RealSource).u3b = function (sink) {
1055
+ var totalBytesWritten = new Long(0, 0);
1056
+ while (!this.a3d_1.r3b(this.c3d_1, new Long(8192, 0)).equals(new Long(-1, -1))) {
1057
+ var emitByteCount = this.c3d_1.l3b();
1058
+ if (emitByteCount.j1(new Long(0, 0)) > 0) {
1059
+ totalBytesWritten = totalBytesWritten.b3(emitByteCount);
1060
+ sink.s3b(this.c3d_1, emitByteCount);
1061
+ }
1062
+ }
1063
+ if (this.c3d_1.s().j1(new Long(0, 0)) > 0) {
1064
+ totalBytesWritten = totalBytesWritten.b3(this.c3d_1.s());
1065
+ sink.s3b(this.c3d_1, this.c3d_1.s());
1066
+ }
1067
+ return totalBytesWritten;
1068
+ };
1069
+ protoOf(RealSource).e3b = function () {
1070
+ this.s3a(new Long(2, 0));
1071
+ return this.c3d_1.e3b();
1072
+ };
1073
+ protoOf(RealSource).v3b = function () {
1074
+ // Inline function 'kotlinx.io.RealSource.checkNotClosed' call
1075
+ // Inline function 'kotlin.check' call
1076
+ if (!!this.b3d_1) {
1077
+ var message = 'Source is closed.';
1078
+ throw IllegalStateException_init_$Create$(toString(message));
1079
+ }
1080
+ return buffered(new PeekSource(this));
1081
+ };
1082
+ protoOf(RealSource).u4 = function () {
1083
+ if (this.b3d_1)
1084
+ return Unit_instance;
1085
+ this.b3d_1 = true;
1086
+ this.a3d_1.u4();
1087
+ this.c3d_1.n2();
1088
+ };
1089
+ protoOf(RealSource).toString = function () {
1090
+ return 'buffered(' + toString(this.a3d_1) + ')';
1091
+ };
1092
+ function Segment_init_$Init$($this) {
1093
+ Segment.call($this);
1094
+ $this.v3a_1 = new Int8Array(8192);
1095
+ $this.z3a_1 = true;
1096
+ $this.y3a_1 = null;
1097
+ return $this;
1098
+ }
1099
+ function Segment_init_$Create$() {
1100
+ return Segment_init_$Init$(objectCreate(protoOf(Segment)));
1101
+ }
1102
+ function Segment_init_$Init$_0(data, pos, limit, shareToken, owner, $this) {
1103
+ Segment.call($this);
1104
+ $this.v3a_1 = data;
1105
+ $this.w3a_1 = pos;
1106
+ $this.x3a_1 = limit;
1107
+ $this.y3a_1 = shareToken;
1108
+ $this.z3a_1 = owner;
1109
+ return $this;
1110
+ }
1111
+ function Segment_init_$Create$_0(data, pos, limit, shareToken, owner) {
1112
+ return Segment_init_$Init$_0(data, pos, limit, shareToken, owner, objectCreate(protoOf(Segment)));
1113
+ }
1114
+ function Companion() {
1115
+ this.d3d_1 = 8192;
1116
+ this.e3d_1 = 1024;
1117
+ }
1118
+ protoOf(Companion).f3d = function () {
1119
+ return Segment_init_$Create$();
1120
+ };
1121
+ var Companion_instance;
1122
+ function Companion_getInstance() {
1123
+ return Companion_instance;
1124
+ }
1125
+ protoOf(Segment).f3c = function () {
1126
+ var tmp0_safe_receiver = this.y3a_1;
1127
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.g3d();
1128
+ return tmp1_elvis_lhs == null ? false : tmp1_elvis_lhs;
1129
+ };
1130
+ protoOf(Segment).i3b = function () {
1131
+ var tmp0_elvis_lhs = this.y3a_1;
1132
+ var tmp;
1133
+ if (tmp0_elvis_lhs == null) {
1134
+ // Inline function 'kotlin.also' call
1135
+ var this_0 = SegmentPool_instance.h3d();
1136
+ this.y3a_1 = this_0;
1137
+ tmp = this_0;
1138
+ } else {
1139
+ tmp = tmp0_elvis_lhs;
1140
+ }
1141
+ var t = tmp;
1142
+ var tmp_0 = this.w3a_1;
1143
+ var tmp_1 = this.x3a_1;
1144
+ // Inline function 'kotlin.also' call
1145
+ t.i3d();
1146
+ return Segment_init_$Create$_0(this.v3a_1, tmp_0, tmp_1, t, false);
1147
+ };
1148
+ protoOf(Segment).i3c = function () {
1149
+ var result = this.a3b_1;
1150
+ if (!(this.b3b_1 == null)) {
1151
+ ensureNotNull(this.b3b_1).a3b_1 = this.a3b_1;
1152
+ }
1153
+ if (!(this.a3b_1 == null)) {
1154
+ ensureNotNull(this.a3b_1).b3b_1 = this.b3b_1;
1155
+ }
1156
+ this.a3b_1 = null;
1157
+ this.b3b_1 = null;
1158
+ return result;
1159
+ };
1160
+ protoOf(Segment).j3b = function (segment) {
1161
+ segment.b3b_1 = this;
1162
+ segment.a3b_1 = this.a3b_1;
1163
+ if (!(this.a3b_1 == null)) {
1164
+ ensureNotNull(this.a3b_1).b3b_1 = segment;
1165
+ }
1166
+ this.a3b_1 = segment;
1167
+ return segment;
1168
+ };
1169
+ protoOf(Segment).g3c = function (byteCount) {
1170
+ // Inline function 'kotlin.require' call
1171
+ if (!(byteCount > 0 && byteCount <= (this.x3a_1 - this.w3a_1 | 0))) {
1172
+ var message = 'byteCount out of range';
1173
+ throw IllegalArgumentException_init_$Create$(toString(message));
1174
+ }
1175
+ var prefix;
1176
+ if (byteCount >= 1024) {
1177
+ prefix = this.i3b();
1178
+ } else {
1179
+ prefix = SegmentPool_instance.z3b();
1180
+ var tmp0 = this.v3a_1;
1181
+ var tmp2 = prefix.v3a_1;
1182
+ var tmp4 = this.w3a_1;
1183
+ // Inline function 'kotlin.collections.copyInto' call
1184
+ var endIndex = this.w3a_1 + byteCount | 0;
1185
+ // Inline function 'kotlin.js.unsafeCast' call
1186
+ // Inline function 'kotlin.js.asDynamic' call
1187
+ var tmp = tmp0;
1188
+ // Inline function 'kotlin.js.unsafeCast' call
1189
+ // Inline function 'kotlin.js.asDynamic' call
1190
+ arrayCopy(tmp, tmp2, 0, tmp4, endIndex);
1191
+ }
1192
+ prefix.x3a_1 = prefix.w3a_1 + byteCount | 0;
1193
+ this.w3a_1 = this.w3a_1 + byteCount | 0;
1194
+ if (!(this.b3b_1 == null)) {
1195
+ ensureNotNull(this.b3b_1).j3b(prefix);
1196
+ } else {
1197
+ prefix.a3b_1 = this;
1198
+ this.b3b_1 = prefix;
1199
+ }
1200
+ return prefix;
1201
+ };
1202
+ protoOf(Segment).k3b = function () {
1203
+ // Inline function 'kotlin.check' call
1204
+ if (!!(this.b3b_1 == null)) {
1205
+ var message = 'cannot compact';
1206
+ throw IllegalStateException_init_$Create$(toString(message));
1207
+ }
1208
+ if (!ensureNotNull(this.b3b_1).z3a_1)
1209
+ return this;
1210
+ var byteCount = this.x3a_1 - this.w3a_1 | 0;
1211
+ var availableByteCount = (8192 - ensureNotNull(this.b3b_1).x3a_1 | 0) + (ensureNotNull(this.b3b_1).f3c() ? 0 : ensureNotNull(this.b3b_1).w3a_1) | 0;
1212
+ if (byteCount > availableByteCount)
1213
+ return this;
1214
+ var predecessor = this.b3b_1;
1215
+ this.h3c(ensureNotNull(predecessor), byteCount);
1216
+ var successor = this.i3c();
1217
+ // Inline function 'kotlin.check' call
1218
+ if (!(successor == null)) {
1219
+ throw IllegalStateException_init_$Create$('Check failed.');
1220
+ }
1221
+ SegmentPool_instance.p3c(this);
1222
+ return predecessor;
1223
+ };
1224
+ protoOf(Segment).l3c = function (byte) {
1225
+ var _unary__edvuaz = this.x3a_1;
1226
+ this.x3a_1 = _unary__edvuaz + 1 | 0;
1227
+ this.v3a_1[_unary__edvuaz] = byte;
1228
+ };
1229
+ protoOf(Segment).n3c = function (short) {
1230
+ var data = this.v3a_1;
1231
+ var limit = this.x3a_1;
1232
+ var _unary__edvuaz = limit;
1233
+ limit = _unary__edvuaz + 1 | 0;
1234
+ data[_unary__edvuaz] = toByte((short >>> 8 | 0) & 255);
1235
+ var _unary__edvuaz_0 = limit;
1236
+ limit = _unary__edvuaz_0 + 1 | 0;
1237
+ data[_unary__edvuaz_0] = toByte(short & 255);
1238
+ this.x3a_1 = limit;
1239
+ };
1240
+ protoOf(Segment).d3b = function () {
1241
+ var _unary__edvuaz = this.w3a_1;
1242
+ this.w3a_1 = _unary__edvuaz + 1 | 0;
1243
+ return this.v3a_1[_unary__edvuaz];
1244
+ };
1245
+ protoOf(Segment).f3b = function () {
1246
+ var data = this.v3a_1;
1247
+ var pos = this.w3a_1;
1248
+ var _unary__edvuaz = pos;
1249
+ pos = _unary__edvuaz + 1 | 0;
1250
+ // Inline function 'kotlinx.io.and' call
1251
+ var tmp = (data[_unary__edvuaz] & 255) << 8;
1252
+ var _unary__edvuaz_0 = pos;
1253
+ pos = _unary__edvuaz_0 + 1 | 0;
1254
+ // Inline function 'kotlinx.io.and' call
1255
+ var tmp$ret$1 = data[_unary__edvuaz_0] & 255;
1256
+ var s = toShort(tmp | tmp$ret$1);
1257
+ this.w3a_1 = pos;
1258
+ return s;
1259
+ };
1260
+ protoOf(Segment).h3c = function (sink, byteCount) {
1261
+ // Inline function 'kotlin.check' call
1262
+ if (!sink.z3a_1) {
1263
+ var message = 'only owner can write';
1264
+ throw IllegalStateException_init_$Create$(toString(message));
1265
+ }
1266
+ if ((sink.x3a_1 + byteCount | 0) > 8192) {
1267
+ if (sink.f3c())
1268
+ throw IllegalArgumentException_init_$Create$_0();
1269
+ if (((sink.x3a_1 + byteCount | 0) - sink.w3a_1 | 0) > 8192)
1270
+ throw IllegalArgumentException_init_$Create$_0();
1271
+ var tmp0 = sink.v3a_1;
1272
+ var tmp2 = sink.v3a_1;
1273
+ var tmp4 = sink.w3a_1;
1274
+ // Inline function 'kotlin.collections.copyInto' call
1275
+ var endIndex = sink.x3a_1;
1276
+ // Inline function 'kotlin.js.unsafeCast' call
1277
+ // Inline function 'kotlin.js.asDynamic' call
1278
+ var tmp = tmp0;
1279
+ // Inline function 'kotlin.js.unsafeCast' call
1280
+ // Inline function 'kotlin.js.asDynamic' call
1281
+ arrayCopy(tmp, tmp2, 0, tmp4, endIndex);
1282
+ sink.x3a_1 = sink.x3a_1 - sink.w3a_1 | 0;
1283
+ sink.w3a_1 = 0;
1284
+ }
1285
+ var tmp0_0 = this.v3a_1;
1286
+ var tmp2_0 = sink.v3a_1;
1287
+ var tmp4_0 = sink.x3a_1;
1288
+ var tmp6 = this.w3a_1;
1289
+ // Inline function 'kotlin.collections.copyInto' call
1290
+ var endIndex_0 = this.w3a_1 + byteCount | 0;
1291
+ // Inline function 'kotlin.js.unsafeCast' call
1292
+ // Inline function 'kotlin.js.asDynamic' call
1293
+ var tmp_0 = tmp0_0;
1294
+ // Inline function 'kotlin.js.unsafeCast' call
1295
+ // Inline function 'kotlin.js.asDynamic' call
1296
+ arrayCopy(tmp_0, tmp2_0, tmp4_0, tmp6, endIndex_0);
1297
+ sink.x3a_1 = sink.x3a_1 + byteCount | 0;
1298
+ this.w3a_1 = this.w3a_1 + byteCount | 0;
1299
+ };
1300
+ protoOf(Segment).q3b = function (dst, dstStartOffset, dstEndOffset) {
1301
+ var len = dstEndOffset - dstStartOffset | 0;
1302
+ var tmp0 = this.v3a_1;
1303
+ var tmp6 = this.w3a_1;
1304
+ // Inline function 'kotlin.collections.copyInto' call
1305
+ var endIndex = this.w3a_1 + len | 0;
1306
+ // Inline function 'kotlin.js.unsafeCast' call
1307
+ // Inline function 'kotlin.js.asDynamic' call
1308
+ var tmp = tmp0;
1309
+ // Inline function 'kotlin.js.unsafeCast' call
1310
+ // Inline function 'kotlin.js.asDynamic' call
1311
+ arrayCopy(tmp, dst, dstStartOffset, tmp6, endIndex);
1312
+ this.w3a_1 = this.w3a_1 + len | 0;
1313
+ };
1314
+ protoOf(Segment).c3c = function (src, srcStartOffset, srcEndOffset) {
1315
+ var tmp2 = this.v3a_1;
1316
+ // Inline function 'kotlin.collections.copyInto' call
1317
+ var destinationOffset = this.x3a_1;
1318
+ // Inline function 'kotlin.js.unsafeCast' call
1319
+ // Inline function 'kotlin.js.asDynamic' call
1320
+ var tmp = src;
1321
+ // Inline function 'kotlin.js.unsafeCast' call
1322
+ // Inline function 'kotlin.js.asDynamic' call
1323
+ arrayCopy(tmp, tmp2, destinationOffset, srcStartOffset, srcEndOffset);
1324
+ this.x3a_1 = this.x3a_1 + (srcEndOffset - srcStartOffset | 0) | 0;
1325
+ };
1326
+ protoOf(Segment).s = function () {
1327
+ return this.x3a_1 - this.w3a_1 | 0;
1328
+ };
1329
+ protoOf(Segment).b3c = function () {
1330
+ return this.v3a_1.length - this.x3a_1 | 0;
1331
+ };
1332
+ protoOf(Segment).j3d = function (readOnly) {
1333
+ return this.v3a_1;
1334
+ };
1335
+ protoOf(Segment).n3b = function (index) {
1336
+ return this.v3a_1[this.w3a_1 + index | 0];
1337
+ };
1338
+ protoOf(Segment).k3d = function (index, value) {
1339
+ this.v3a_1[this.x3a_1 + index | 0] = value;
1340
+ };
1341
+ protoOf(Segment).l3d = function (index, b0, b1) {
1342
+ var d = this.v3a_1;
1343
+ var l = this.x3a_1;
1344
+ d[l + index | 0] = b0;
1345
+ d[(l + index | 0) + 1 | 0] = b1;
1346
+ };
1347
+ protoOf(Segment).m3d = function (index, b0, b1, b2) {
1348
+ var d = this.v3a_1;
1349
+ var l = this.x3a_1;
1350
+ d[l + index | 0] = b0;
1351
+ d[(l + index | 0) + 1 | 0] = b1;
1352
+ d[(l + index | 0) + 2 | 0] = b2;
1353
+ };
1354
+ protoOf(Segment).n3d = function (index, b0, b1, b2, b3) {
1355
+ var d = this.v3a_1;
1356
+ var l = this.x3a_1;
1357
+ d[l + index | 0] = b0;
1358
+ d[(l + index | 0) + 1 | 0] = b1;
1359
+ d[(l + index | 0) + 2 | 0] = b2;
1360
+ d[(l + index | 0) + 3 | 0] = b3;
1361
+ };
1362
+ function Segment() {
1363
+ this.w3a_1 = 0;
1364
+ this.x3a_1 = 0;
1365
+ this.y3a_1 = null;
1366
+ this.z3a_1 = false;
1367
+ this.a3b_1 = null;
1368
+ this.b3b_1 = null;
1369
+ }
1370
+ function SegmentCopyTracker() {
1371
+ }
1372
+ function isEmpty(_this__u8e3s4) {
1373
+ return _this__u8e3s4.s() === 0;
1374
+ }
1375
+ function AlwaysSharedCopyTracker() {
1376
+ AlwaysSharedCopyTracker_instance = this;
1377
+ SegmentCopyTracker.call(this);
1378
+ }
1379
+ protoOf(AlwaysSharedCopyTracker).g3d = function () {
1380
+ return true;
1381
+ };
1382
+ protoOf(AlwaysSharedCopyTracker).i3d = function () {
1383
+ return Unit_instance;
1384
+ };
1385
+ var AlwaysSharedCopyTracker_instance;
1386
+ function AlwaysSharedCopyTracker_getInstance() {
1387
+ if (AlwaysSharedCopyTracker_instance == null)
1388
+ new AlwaysSharedCopyTracker();
1389
+ return AlwaysSharedCopyTracker_instance;
1390
+ }
1391
+ function indexOf_0(_this__u8e3s4, byte, startOffset, endOffset) {
1392
+ // Inline function 'kotlin.require' call
1393
+ if (!(0 <= startOffset ? startOffset < _this__u8e3s4.s() : false)) {
1394
+ var message = '' + startOffset;
1395
+ throw IllegalArgumentException_init_$Create$(toString(message));
1396
+ }
1397
+ // Inline function 'kotlin.require' call
1398
+ if (!(startOffset <= endOffset ? endOffset <= _this__u8e3s4.s() : false)) {
1399
+ var message_0 = '' + endOffset;
1400
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
1401
+ }
1402
+ var p = _this__u8e3s4.w3a_1;
1403
+ var data = _this__u8e3s4.j3d(true);
1404
+ var inductionVariable = startOffset;
1405
+ if (inductionVariable < endOffset)
1406
+ do {
1407
+ var idx = inductionVariable;
1408
+ inductionVariable = inductionVariable + 1 | 0;
1409
+ if (data[p + idx | 0] === byte) {
1410
+ return idx;
1411
+ }
1412
+ }
1413
+ while (inductionVariable < endOffset);
1414
+ return -1;
1415
+ }
1416
+ function Sink() {
1417
+ }
1418
+ function Source() {
1419
+ }
1420
+ function readByteArray(_this__u8e3s4) {
1421
+ return readByteArrayImpl(_this__u8e3s4, -1);
1422
+ }
1423
+ function readByteArrayImpl(_this__u8e3s4, size) {
1424
+ var arraySize = size;
1425
+ if (size === -1) {
1426
+ var fetchSize = new Long(2147483647, 0);
1427
+ while (_this__u8e3s4.q3a().s().j1(new Long(2147483647, 0)) < 0 && _this__u8e3s4.t3a(fetchSize)) {
1428
+ // Inline function 'kotlin.Long.times' call
1429
+ fetchSize = fetchSize.d3(toLong(2));
1430
+ }
1431
+ // Inline function 'kotlin.check' call
1432
+ if (!(_this__u8e3s4.q3a().s().j1(new Long(2147483647, 0)) < 0)) {
1433
+ var message = "Can't create an array of size " + _this__u8e3s4.q3a().s().toString();
1434
+ throw IllegalStateException_init_$Create$(toString(message));
1435
+ }
1436
+ arraySize = _this__u8e3s4.q3a().s().l1();
1437
+ } else {
1438
+ _this__u8e3s4.s3a(toLong(size));
1439
+ }
1440
+ var array = new Int8Array(arraySize);
1441
+ readTo(_this__u8e3s4.q3a(), array);
1442
+ return array;
1443
+ }
1444
+ function readTo(_this__u8e3s4, sink, startIndex, endIndex) {
1445
+ startIndex = startIndex === VOID ? 0 : startIndex;
1446
+ endIndex = endIndex === VOID ? sink.length : endIndex;
1447
+ // Inline function 'kotlinx.io.checkBounds' call
1448
+ var size = sink.length;
1449
+ checkBounds(toLong(size), toLong(startIndex), toLong(endIndex));
1450
+ var offset = startIndex;
1451
+ while (offset < endIndex) {
1452
+ var bytesRead = _this__u8e3s4.p3b(sink, offset, endIndex);
1453
+ if (bytesRead === -1) {
1454
+ throw EOFException_init_$Create$_0('Source exhausted before reading ' + (endIndex - startIndex | 0) + ' bytes. ' + ('Only ' + bytesRead + ' bytes were read.'));
1455
+ }
1456
+ offset = offset + bytesRead | 0;
1457
+ }
1458
+ }
1459
+ function readByteArray_0(_this__u8e3s4, byteCount) {
1460
+ // Inline function 'kotlinx.io.checkByteCount' call
1461
+ var byteCount_0 = toLong(byteCount);
1462
+ // Inline function 'kotlin.require' call
1463
+ if (!(byteCount_0.j1(new Long(0, 0)) >= 0)) {
1464
+ var message = 'byteCount (' + byteCount_0.toString() + ') < 0';
1465
+ throw IllegalArgumentException_init_$Create$(toString(message));
1466
+ }
1467
+ return readByteArrayImpl(_this__u8e3s4, byteCount);
1468
+ }
1469
+ function indexOf_1(_this__u8e3s4, byte, startIndex, endIndex) {
1470
+ startIndex = startIndex === VOID ? new Long(0, 0) : startIndex;
1471
+ endIndex = endIndex === VOID ? new Long(-1, 2147483647) : endIndex;
1472
+ // Inline function 'kotlin.require' call
1473
+ if (!((new Long(0, 0)).j1(startIndex) <= 0 ? startIndex.j1(endIndex) <= 0 : false)) {
1474
+ var tmp;
1475
+ if (endIndex.j1(new Long(0, 0)) < 0) {
1476
+ tmp = 'startIndex (' + startIndex.toString() + ') and endIndex (' + endIndex.toString() + ') should be non negative';
1477
+ } else {
1478
+ tmp = 'startIndex (' + startIndex.toString() + ') is not within the range [0..endIndex(' + endIndex.toString() + '))';
1479
+ }
1480
+ var message = tmp;
1481
+ throw IllegalArgumentException_init_$Create$(toString(message));
1482
+ }
1483
+ if (startIndex.equals(endIndex))
1484
+ return new Long(-1, -1);
1485
+ var offset = startIndex;
1486
+ $l$loop: while (true) {
1487
+ var tmp_0;
1488
+ if (offset.j1(endIndex) < 0) {
1489
+ // Inline function 'kotlin.Long.plus' call
1490
+ var tmp$ret$2 = offset.b3(toLong(1));
1491
+ tmp_0 = _this__u8e3s4.t3a(tmp$ret$2);
1492
+ } else {
1493
+ tmp_0 = false;
1494
+ }
1495
+ if (!tmp_0) {
1496
+ break $l$loop;
1497
+ }
1498
+ var tmp_1 = _this__u8e3s4.q3a();
1499
+ var tmp_2 = offset;
1500
+ // Inline function 'kotlin.comparisons.minOf' call
1501
+ var b = _this__u8e3s4.q3a().s();
1502
+ var tmp$ret$3 = endIndex.j1(b) <= 0 ? endIndex : b;
1503
+ var idx = indexOf(tmp_1, byte, tmp_2, tmp$ret$3);
1504
+ if (!idx.equals(new Long(-1, -1))) {
1505
+ return idx;
1506
+ }
1507
+ offset = _this__u8e3s4.q3a().s();
1508
+ }
1509
+ return new Long(-1, -1);
1510
+ }
1511
+ function readString(_this__u8e3s4) {
1512
+ _this__u8e3s4.t3a(new Long(-1, 2147483647));
1513
+ return commonReadUtf8(_this__u8e3s4.q3a(), _this__u8e3s4.q3a().s());
1514
+ }
1515
+ function writeString(_this__u8e3s4, string, startIndex, endIndex) {
1516
+ startIndex = startIndex === VOID ? 0 : startIndex;
1517
+ endIndex = endIndex === VOID ? string.length : endIndex;
1518
+ // Inline function 'kotlinx.io.checkBounds' call
1519
+ var size = string.length;
1520
+ checkBounds(toLong(size), toLong(startIndex), toLong(endIndex));
1521
+ // Inline function 'kotlinx.io.writeToInternalBuffer' call
1522
+ // Inline function 'kotlinx.io.commonWriteUtf8' call
1523
+ var this_0 = _this__u8e3s4.q3a();
1524
+ var i = startIndex;
1525
+ while (i < endIndex) {
1526
+ var p0 = i;
1527
+ // Inline function 'kotlin.code' call
1528
+ var this_1 = charCodeAt(string, p0);
1529
+ var c = Char__toInt_impl_vasixd(this_1);
1530
+ if (c < 128) {
1531
+ $l$block_0: {
1532
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
1533
+ var tail = this_0.w3b(1);
1534
+ var ctx = get_SegmentWriteContextImpl();
1535
+ var segmentOffset = -i | 0;
1536
+ // Inline function 'kotlin.comparisons.minOf' call
1537
+ var b = i + tail.b3c() | 0;
1538
+ var runLimit = Math.min(endIndex, b);
1539
+ var _unary__edvuaz = i;
1540
+ i = _unary__edvuaz + 1 | 0;
1541
+ ctx.r3d(tail, segmentOffset + _unary__edvuaz | 0, toByte(c));
1542
+ $l$loop: while (i < runLimit) {
1543
+ var p0_0 = i;
1544
+ // Inline function 'kotlin.code' call
1545
+ var this_2 = charCodeAt(string, p0_0);
1546
+ c = Char__toInt_impl_vasixd(this_2);
1547
+ if (c >= 128)
1548
+ break $l$loop;
1549
+ var _unary__edvuaz_0 = i;
1550
+ i = _unary__edvuaz_0 + 1 | 0;
1551
+ ctx.r3d(tail, segmentOffset + _unary__edvuaz_0 | 0, toByte(c));
1552
+ }
1553
+ var bytesWritten = i + segmentOffset | 0;
1554
+ if (bytesWritten === 1) {
1555
+ tail.x3a_1 = tail.x3a_1 + bytesWritten | 0;
1556
+ var tmp = this_0;
1557
+ // Inline function 'kotlin.Long.plus' call
1558
+ tmp.p3a_1 = this_0.p3a_1.b3(toLong(bytesWritten));
1559
+ break $l$block_0;
1560
+ }
1561
+ // Inline function 'kotlin.check' call
1562
+ if (!(0 <= bytesWritten ? bytesWritten <= tail.b3c() : false)) {
1563
+ var message = 'Invalid number of bytes written: ' + bytesWritten + '. Should be in 0..' + tail.b3c();
1564
+ throw IllegalStateException_init_$Create$(toString(message));
1565
+ }
1566
+ if (!(bytesWritten === 0)) {
1567
+ tail.x3a_1 = tail.x3a_1 + bytesWritten | 0;
1568
+ var tmp_0 = this_0;
1569
+ // Inline function 'kotlin.Long.plus' call
1570
+ tmp_0.p3a_1 = this_0.p3a_1.b3(toLong(bytesWritten));
1571
+ break $l$block_0;
1572
+ }
1573
+ if (isEmpty(tail)) {
1574
+ this_0.q3c();
1575
+ }
1576
+ }
1577
+ } else if (c < 2048) {
1578
+ $l$block_2: {
1579
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
1580
+ var tail_0 = this_0.w3b(2);
1581
+ get_SegmentWriteContextImpl().q3d(tail_0, 0, toByte(c >> 6 | 192), toByte(c & 63 | 128));
1582
+ var bytesWritten_0 = 2;
1583
+ if (bytesWritten_0 === 2) {
1584
+ tail_0.x3a_1 = tail_0.x3a_1 + bytesWritten_0 | 0;
1585
+ var tmp_1 = this_0;
1586
+ // Inline function 'kotlin.Long.plus' call
1587
+ tmp_1.p3a_1 = this_0.p3a_1.b3(toLong(bytesWritten_0));
1588
+ break $l$block_2;
1589
+ }
1590
+ // Inline function 'kotlin.check' call
1591
+ if (!(0 <= bytesWritten_0 ? bytesWritten_0 <= tail_0.b3c() : false)) {
1592
+ var message_0 = 'Invalid number of bytes written: ' + bytesWritten_0 + '. Should be in 0..' + tail_0.b3c();
1593
+ throw IllegalStateException_init_$Create$(toString(message_0));
1594
+ }
1595
+ if (!(bytesWritten_0 === 0)) {
1596
+ tail_0.x3a_1 = tail_0.x3a_1 + bytesWritten_0 | 0;
1597
+ var tmp_2 = this_0;
1598
+ // Inline function 'kotlin.Long.plus' call
1599
+ tmp_2.p3a_1 = this_0.p3a_1.b3(toLong(bytesWritten_0));
1600
+ break $l$block_2;
1601
+ }
1602
+ if (isEmpty(tail_0)) {
1603
+ this_0.q3c();
1604
+ }
1605
+ }
1606
+ i = i + 1 | 0;
1607
+ } else if (c < 55296 || c > 57343) {
1608
+ $l$block_4: {
1609
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
1610
+ var tail_1 = this_0.w3b(3);
1611
+ get_SegmentWriteContextImpl().p3d(tail_1, 0, toByte(c >> 12 | 224), toByte(c >> 6 & 63 | 128), toByte(c & 63 | 128));
1612
+ var bytesWritten_1 = 3;
1613
+ if (bytesWritten_1 === 3) {
1614
+ tail_1.x3a_1 = tail_1.x3a_1 + bytesWritten_1 | 0;
1615
+ var tmp_3 = this_0;
1616
+ // Inline function 'kotlin.Long.plus' call
1617
+ tmp_3.p3a_1 = this_0.p3a_1.b3(toLong(bytesWritten_1));
1618
+ break $l$block_4;
1619
+ }
1620
+ // Inline function 'kotlin.check' call
1621
+ if (!(0 <= bytesWritten_1 ? bytesWritten_1 <= tail_1.b3c() : false)) {
1622
+ var message_1 = 'Invalid number of bytes written: ' + bytesWritten_1 + '. Should be in 0..' + tail_1.b3c();
1623
+ throw IllegalStateException_init_$Create$(toString(message_1));
1624
+ }
1625
+ if (!(bytesWritten_1 === 0)) {
1626
+ tail_1.x3a_1 = tail_1.x3a_1 + bytesWritten_1 | 0;
1627
+ var tmp_4 = this_0;
1628
+ // Inline function 'kotlin.Long.plus' call
1629
+ tmp_4.p3a_1 = this_0.p3a_1.b3(toLong(bytesWritten_1));
1630
+ break $l$block_4;
1631
+ }
1632
+ if (isEmpty(tail_1)) {
1633
+ this_0.q3c();
1634
+ }
1635
+ }
1636
+ i = i + 1 | 0;
1637
+ } else {
1638
+ var tmp_5;
1639
+ if ((i + 1 | 0) < endIndex) {
1640
+ var p0_1 = i + 1 | 0;
1641
+ // Inline function 'kotlin.code' call
1642
+ var this_3 = charCodeAt(string, p0_1);
1643
+ tmp_5 = Char__toInt_impl_vasixd(this_3);
1644
+ } else {
1645
+ tmp_5 = 0;
1646
+ }
1647
+ var low = tmp_5;
1648
+ if (c > 56319 || !(56320 <= low ? low <= 57343 : false)) {
1649
+ // Inline function 'kotlin.code' call
1650
+ var this_4 = _Char___init__impl__6a9atx(63);
1651
+ var tmp$ret$26 = Char__toInt_impl_vasixd(this_4);
1652
+ this_0.k3c(toByte(tmp$ret$26));
1653
+ i = i + 1 | 0;
1654
+ } else {
1655
+ var codePoint = 65536 + ((c & 1023) << 10 | low & 1023) | 0;
1656
+ $l$block_6: {
1657
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.writeToTail' call
1658
+ var tail_2 = this_0.w3b(4);
1659
+ get_SegmentWriteContextImpl().o3d(tail_2, 0, toByte(codePoint >> 18 | 240), toByte(codePoint >> 12 & 63 | 128), toByte(codePoint >> 6 & 63 | 128), toByte(codePoint & 63 | 128));
1660
+ var bytesWritten_2 = 4;
1661
+ if (bytesWritten_2 === 4) {
1662
+ tail_2.x3a_1 = tail_2.x3a_1 + bytesWritten_2 | 0;
1663
+ var tmp_6 = this_0;
1664
+ // Inline function 'kotlin.Long.plus' call
1665
+ tmp_6.p3a_1 = this_0.p3a_1.b3(toLong(bytesWritten_2));
1666
+ break $l$block_6;
1667
+ }
1668
+ // Inline function 'kotlin.check' call
1669
+ if (!(0 <= bytesWritten_2 ? bytesWritten_2 <= tail_2.b3c() : false)) {
1670
+ var message_2 = 'Invalid number of bytes written: ' + bytesWritten_2 + '. Should be in 0..' + tail_2.b3c();
1671
+ throw IllegalStateException_init_$Create$(toString(message_2));
1672
+ }
1673
+ if (!(bytesWritten_2 === 0)) {
1674
+ tail_2.x3a_1 = tail_2.x3a_1 + bytesWritten_2 | 0;
1675
+ var tmp_7 = this_0;
1676
+ // Inline function 'kotlin.Long.plus' call
1677
+ tmp_7.p3a_1 = this_0.p3a_1.b3(toLong(bytesWritten_2));
1678
+ break $l$block_6;
1679
+ }
1680
+ if (isEmpty(tail_2)) {
1681
+ this_0.q3c();
1682
+ }
1683
+ }
1684
+ i = i + 2 | 0;
1685
+ }
1686
+ }
1687
+ }
1688
+ _this__u8e3s4.g3b();
1689
+ }
1690
+ function commonReadUtf8(_this__u8e3s4, byteCount) {
1691
+ if (byteCount.equals(new Long(0, 0)))
1692
+ return '';
1693
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.forEachSegment' call
1694
+ var curr = _this__u8e3s4.n3a_1;
1695
+ while (!(curr == null)) {
1696
+ get_SegmentReadContextImpl();
1697
+ if (toLong(curr.s()).j1(byteCount) >= 0) {
1698
+ var result = '';
1699
+ // Inline function 'kotlinx.io.unsafe.withData' call
1700
+ var tmp0 = curr.j3d(true);
1701
+ var tmp2 = curr.w3a_1;
1702
+ var tmp0_0 = curr.x3a_1;
1703
+ // Inline function 'kotlin.math.min' call
1704
+ var b = tmp2 + byteCount.l1() | 0;
1705
+ var tmp$ret$0 = Math.min(tmp0_0, b);
1706
+ result = commonToUtf8String(tmp0, tmp2, tmp$ret$0);
1707
+ _this__u8e3s4.o3b(byteCount);
1708
+ return result;
1709
+ }
1710
+ return commonToUtf8String(readByteArray_0(_this__u8e3s4, byteCount.l1()));
1711
+ }
1712
+ // Inline function 'kotlin.error' call
1713
+ var message = 'Unreacheable';
1714
+ throw IllegalStateException_init_$Create$(toString(message));
1715
+ }
1716
+ function readString_0(_this__u8e3s4, byteCount) {
1717
+ _this__u8e3s4.s3a(byteCount);
1718
+ return commonReadUtf8(_this__u8e3s4.q3a(), byteCount);
1719
+ }
1720
+ function readString_1(_this__u8e3s4) {
1721
+ return commonReadUtf8(_this__u8e3s4, _this__u8e3s4.s());
1722
+ }
1723
+ function FileSystem() {
1724
+ }
1725
+ function SystemFileSystemImpl() {
1726
+ }
1727
+ function FileMetadata(isRegularFile, isDirectory, size) {
1728
+ isRegularFile = isRegularFile === VOID ? false : isRegularFile;
1729
+ isDirectory = isDirectory === VOID ? false : isDirectory;
1730
+ size = size === VOID ? new Long(0, 0) : size;
1731
+ this.d3e_1 = isRegularFile;
1732
+ this.e3e_1 = isDirectory;
1733
+ this.f3e_1 = size;
1734
+ }
1735
+ function Path(base, parts) {
1736
+ return Path_0(base.toString(), parts.slice());
1737
+ }
1738
+ function removeTrailingSeparators(path, isWindows_) {
1739
+ isWindows_ = isWindows_ === VOID ? get_isWindows() : isWindows_;
1740
+ if (isWindows_) {
1741
+ var tmp;
1742
+ if (path.length > 1) {
1743
+ var tmp_0;
1744
+ if (charCodeAt(path, 1) === _Char___init__impl__6a9atx(58)) {
1745
+ tmp_0 = 3;
1746
+ } else if (isUnc(path)) {
1747
+ tmp_0 = 2;
1748
+ } else {
1749
+ tmp_0 = 1;
1750
+ }
1751
+ tmp = tmp_0;
1752
+ } else {
1753
+ tmp = 1;
1754
+ }
1755
+ var limit = tmp;
1756
+ return removeTrailingSeparatorsWindows(limit, path);
1757
+ }
1758
+ return removeTrailingSeparatorsUnix(path);
1759
+ }
1760
+ function Path_0(base, parts) {
1761
+ // Inline function 'kotlin.text.buildString' call
1762
+ // Inline function 'kotlin.apply' call
1763
+ var this_0 = StringBuilder_init_$Create$_0();
1764
+ this_0.z8(base);
1765
+ // Inline function 'kotlin.collections.forEach' call
1766
+ var inductionVariable = 0;
1767
+ var last = parts.length;
1768
+ while (inductionVariable < last) {
1769
+ var element = parts[inductionVariable];
1770
+ inductionVariable = inductionVariable + 1 | 0;
1771
+ var tmp;
1772
+ // Inline function 'kotlin.text.isNotEmpty' call
1773
+ if (charSequenceLength(this_0) > 0) {
1774
+ tmp = !endsWith(this_0, get_SystemPathSeparator());
1775
+ } else {
1776
+ tmp = false;
1777
+ }
1778
+ if (tmp) {
1779
+ this_0.a9(get_SystemPathSeparator());
1780
+ }
1781
+ this_0.z8(element);
1782
+ }
1783
+ var tmp$ret$5 = this_0.toString();
1784
+ return Path_2(tmp$ret$5);
1785
+ }
1786
+ function isUnc(path) {
1787
+ if (path.length < 2)
1788
+ return false;
1789
+ if (startsWith(path, '\\\\'))
1790
+ return true;
1791
+ if (startsWith(path, '//'))
1792
+ return true;
1793
+ return false;
1794
+ }
1795
+ function removeTrailingSeparatorsWindows(suffixLength, path) {
1796
+ // Inline function 'kotlin.require' call
1797
+ // Inline function 'kotlin.require' call
1798
+ if (!(suffixLength >= 1)) {
1799
+ var message = 'Failed requirement.';
1800
+ throw IllegalArgumentException_init_$Create$(toString(message));
1801
+ }
1802
+ var idx = path.length;
1803
+ $l$loop: while (idx > suffixLength) {
1804
+ var c = charCodeAt(path, idx - 1 | 0);
1805
+ if (!(c === _Char___init__impl__6a9atx(92)) && !(c === _Char___init__impl__6a9atx(47)))
1806
+ break $l$loop;
1807
+ idx = idx - 1 | 0;
1808
+ }
1809
+ return substring(path, 0, idx);
1810
+ }
1811
+ function removeTrailingSeparatorsUnix(path) {
1812
+ var idx = path.length;
1813
+ while (idx > 1 && charCodeAt(path, idx - 1 | 0) === _Char___init__impl__6a9atx(47)) {
1814
+ idx = idx - 1 | 0;
1815
+ }
1816
+ return substring(path, 0, idx);
1817
+ }
1818
+ function commonToUtf8String(_this__u8e3s4, beginIndex, endIndex) {
1819
+ beginIndex = beginIndex === VOID ? 0 : beginIndex;
1820
+ endIndex = endIndex === VOID ? _this__u8e3s4.length : endIndex;
1821
+ if (beginIndex < 0 || endIndex > _this__u8e3s4.length || beginIndex > endIndex) {
1822
+ throw IndexOutOfBoundsException_init_$Create$('size=' + _this__u8e3s4.length + ' beginIndex=' + beginIndex + ' endIndex=' + endIndex);
1823
+ }
1824
+ var chars = charArray(endIndex - beginIndex | 0);
1825
+ var length = 0;
1826
+ // Inline function 'kotlinx.io.internal.processUtf16Chars' call
1827
+ var index = beginIndex;
1828
+ while (index < endIndex) {
1829
+ var b0 = _this__u8e3s4[index];
1830
+ if (b0 >= 0) {
1831
+ var c = numberToChar(b0);
1832
+ var _unary__edvuaz = length;
1833
+ length = _unary__edvuaz + 1 | 0;
1834
+ chars[_unary__edvuaz] = c;
1835
+ index = index + 1 | 0;
1836
+ while (index < endIndex && _this__u8e3s4[index] >= 0) {
1837
+ var _unary__edvuaz_0 = index;
1838
+ index = _unary__edvuaz_0 + 1 | 0;
1839
+ var c_0 = numberToChar(_this__u8e3s4[_unary__edvuaz_0]);
1840
+ var _unary__edvuaz_1 = length;
1841
+ length = _unary__edvuaz_1 + 1 | 0;
1842
+ chars[_unary__edvuaz_1] = c_0;
1843
+ }
1844
+ } else {
1845
+ // Inline function 'kotlinx.io.shr' call
1846
+ if (b0 >> 5 === -2) {
1847
+ var tmp = index;
1848
+ var tmp2 = index;
1849
+ var tmp$ret$5;
1850
+ $l$block_0: {
1851
+ // Inline function 'kotlinx.io.internal.process2Utf8Bytes' call
1852
+ if (endIndex <= (tmp2 + 1 | 0)) {
1853
+ var c_1 = numberToChar(65533);
1854
+ var _unary__edvuaz_2 = length;
1855
+ length = _unary__edvuaz_2 + 1 | 0;
1856
+ chars[_unary__edvuaz_2] = c_1;
1857
+ tmp$ret$5 = 1;
1858
+ break $l$block_0;
1859
+ }
1860
+ var b0_0 = _this__u8e3s4[tmp2];
1861
+ var b1 = _this__u8e3s4[tmp2 + 1 | 0];
1862
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1863
+ // Inline function 'kotlinx.io.and' call
1864
+ if (!((b1 & 192) === 128)) {
1865
+ var c_2 = numberToChar(65533);
1866
+ var _unary__edvuaz_3 = length;
1867
+ length = _unary__edvuaz_3 + 1 | 0;
1868
+ chars[_unary__edvuaz_3] = c_2;
1869
+ tmp$ret$5 = 1;
1870
+ break $l$block_0;
1871
+ }
1872
+ var codePoint = 3968 ^ b1 ^ b0_0 << 6;
1873
+ if (codePoint < 128) {
1874
+ var c_3 = numberToChar(65533);
1875
+ var _unary__edvuaz_4 = length;
1876
+ length = _unary__edvuaz_4 + 1 | 0;
1877
+ chars[_unary__edvuaz_4] = c_3;
1878
+ } else {
1879
+ var c_4 = numberToChar(codePoint);
1880
+ var _unary__edvuaz_5 = length;
1881
+ length = _unary__edvuaz_5 + 1 | 0;
1882
+ chars[_unary__edvuaz_5] = c_4;
1883
+ }
1884
+ tmp$ret$5 = 2;
1885
+ }
1886
+ index = tmp + tmp$ret$5 | 0;
1887
+ } else {
1888
+ // Inline function 'kotlinx.io.shr' call
1889
+ if (b0 >> 4 === -2) {
1890
+ var tmp_0 = index;
1891
+ var tmp2_0 = index;
1892
+ var tmp$ret$19;
1893
+ $l$block_4: {
1894
+ // Inline function 'kotlinx.io.internal.process3Utf8Bytes' call
1895
+ if (endIndex <= (tmp2_0 + 2 | 0)) {
1896
+ var c_5 = numberToChar(65533);
1897
+ var _unary__edvuaz_6 = length;
1898
+ length = _unary__edvuaz_6 + 1 | 0;
1899
+ chars[_unary__edvuaz_6] = c_5;
1900
+ var tmp_1;
1901
+ if (endIndex <= (tmp2_0 + 1 | 0)) {
1902
+ tmp_1 = true;
1903
+ } else {
1904
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1905
+ // Inline function 'kotlinx.io.and' call
1906
+ tmp_1 = !((_this__u8e3s4[tmp2_0 + 1 | 0] & 192) === 128);
1907
+ }
1908
+ if (tmp_1) {
1909
+ tmp$ret$19 = 1;
1910
+ break $l$block_4;
1911
+ } else {
1912
+ tmp$ret$19 = 2;
1913
+ break $l$block_4;
1914
+ }
1915
+ }
1916
+ var b0_1 = _this__u8e3s4[tmp2_0];
1917
+ var b1_0 = _this__u8e3s4[tmp2_0 + 1 | 0];
1918
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1919
+ // Inline function 'kotlinx.io.and' call
1920
+ if (!((b1_0 & 192) === 128)) {
1921
+ var c_6 = numberToChar(65533);
1922
+ var _unary__edvuaz_7 = length;
1923
+ length = _unary__edvuaz_7 + 1 | 0;
1924
+ chars[_unary__edvuaz_7] = c_6;
1925
+ tmp$ret$19 = 1;
1926
+ break $l$block_4;
1927
+ }
1928
+ var b2 = _this__u8e3s4[tmp2_0 + 2 | 0];
1929
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1930
+ // Inline function 'kotlinx.io.and' call
1931
+ if (!((b2 & 192) === 128)) {
1932
+ var c_7 = numberToChar(65533);
1933
+ var _unary__edvuaz_8 = length;
1934
+ length = _unary__edvuaz_8 + 1 | 0;
1935
+ chars[_unary__edvuaz_8] = c_7;
1936
+ tmp$ret$19 = 2;
1937
+ break $l$block_4;
1938
+ }
1939
+ var codePoint_0 = -123008 ^ b2 ^ b1_0 << 6 ^ b0_1 << 12;
1940
+ if (codePoint_0 < 2048) {
1941
+ var c_8 = numberToChar(65533);
1942
+ var _unary__edvuaz_9 = length;
1943
+ length = _unary__edvuaz_9 + 1 | 0;
1944
+ chars[_unary__edvuaz_9] = c_8;
1945
+ } else if (55296 <= codePoint_0 ? codePoint_0 <= 57343 : false) {
1946
+ var c_9 = numberToChar(65533);
1947
+ var _unary__edvuaz_10 = length;
1948
+ length = _unary__edvuaz_10 + 1 | 0;
1949
+ chars[_unary__edvuaz_10] = c_9;
1950
+ } else {
1951
+ var c_10 = numberToChar(codePoint_0);
1952
+ var _unary__edvuaz_11 = length;
1953
+ length = _unary__edvuaz_11 + 1 | 0;
1954
+ chars[_unary__edvuaz_11] = c_10;
1955
+ }
1956
+ tmp$ret$19 = 3;
1957
+ }
1958
+ index = tmp_0 + tmp$ret$19 | 0;
1959
+ } else {
1960
+ // Inline function 'kotlinx.io.shr' call
1961
+ if (b0 >> 3 === -2) {
1962
+ var tmp_2 = index;
1963
+ var tmp2_1 = index;
1964
+ var tmp$ret$41;
1965
+ $l$block_10: {
1966
+ // Inline function 'kotlinx.io.internal.process4Utf8Bytes' call
1967
+ if (endIndex <= (tmp2_1 + 3 | 0)) {
1968
+ if (!(65533 === 65533)) {
1969
+ var c_11 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
1970
+ var _unary__edvuaz_12 = length;
1971
+ length = _unary__edvuaz_12 + 1 | 0;
1972
+ chars[_unary__edvuaz_12] = c_11;
1973
+ var c_12 = numberToChar((65533 & 1023) + 56320 | 0);
1974
+ var _unary__edvuaz_13 = length;
1975
+ length = _unary__edvuaz_13 + 1 | 0;
1976
+ chars[_unary__edvuaz_13] = c_12;
1977
+ } else {
1978
+ var c_13 = _Char___init__impl__6a9atx(65533);
1979
+ var _unary__edvuaz_14 = length;
1980
+ length = _unary__edvuaz_14 + 1 | 0;
1981
+ chars[_unary__edvuaz_14] = c_13;
1982
+ }
1983
+ var tmp_3;
1984
+ if (endIndex <= (tmp2_1 + 1 | 0)) {
1985
+ tmp_3 = true;
1986
+ } else {
1987
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
1988
+ // Inline function 'kotlinx.io.and' call
1989
+ tmp_3 = !((_this__u8e3s4[tmp2_1 + 1 | 0] & 192) === 128);
1990
+ }
1991
+ if (tmp_3) {
1992
+ tmp$ret$41 = 1;
1993
+ break $l$block_10;
1994
+ } else {
1995
+ var tmp_4;
1996
+ if (endIndex <= (tmp2_1 + 2 | 0)) {
1997
+ tmp_4 = true;
1998
+ } else {
1999
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
2000
+ // Inline function 'kotlinx.io.and' call
2001
+ tmp_4 = !((_this__u8e3s4[tmp2_1 + 2 | 0] & 192) === 128);
2002
+ }
2003
+ if (tmp_4) {
2004
+ tmp$ret$41 = 2;
2005
+ break $l$block_10;
2006
+ } else {
2007
+ tmp$ret$41 = 3;
2008
+ break $l$block_10;
2009
+ }
2010
+ }
2011
+ }
2012
+ var b0_2 = _this__u8e3s4[tmp2_1];
2013
+ var b1_1 = _this__u8e3s4[tmp2_1 + 1 | 0];
2014
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
2015
+ // Inline function 'kotlinx.io.and' call
2016
+ if (!((b1_1 & 192) === 128)) {
2017
+ if (!(65533 === 65533)) {
2018
+ var c_14 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
2019
+ var _unary__edvuaz_15 = length;
2020
+ length = _unary__edvuaz_15 + 1 | 0;
2021
+ chars[_unary__edvuaz_15] = c_14;
2022
+ var c_15 = numberToChar((65533 & 1023) + 56320 | 0);
2023
+ var _unary__edvuaz_16 = length;
2024
+ length = _unary__edvuaz_16 + 1 | 0;
2025
+ chars[_unary__edvuaz_16] = c_15;
2026
+ } else {
2027
+ var c_16 = _Char___init__impl__6a9atx(65533);
2028
+ var _unary__edvuaz_17 = length;
2029
+ length = _unary__edvuaz_17 + 1 | 0;
2030
+ chars[_unary__edvuaz_17] = c_16;
2031
+ }
2032
+ tmp$ret$41 = 1;
2033
+ break $l$block_10;
2034
+ }
2035
+ var b2_0 = _this__u8e3s4[tmp2_1 + 2 | 0];
2036
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
2037
+ // Inline function 'kotlinx.io.and' call
2038
+ if (!((b2_0 & 192) === 128)) {
2039
+ if (!(65533 === 65533)) {
2040
+ var c_17 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
2041
+ var _unary__edvuaz_18 = length;
2042
+ length = _unary__edvuaz_18 + 1 | 0;
2043
+ chars[_unary__edvuaz_18] = c_17;
2044
+ var c_18 = numberToChar((65533 & 1023) + 56320 | 0);
2045
+ var _unary__edvuaz_19 = length;
2046
+ length = _unary__edvuaz_19 + 1 | 0;
2047
+ chars[_unary__edvuaz_19] = c_18;
2048
+ } else {
2049
+ var c_19 = _Char___init__impl__6a9atx(65533);
2050
+ var _unary__edvuaz_20 = length;
2051
+ length = _unary__edvuaz_20 + 1 | 0;
2052
+ chars[_unary__edvuaz_20] = c_19;
2053
+ }
2054
+ tmp$ret$41 = 2;
2055
+ break $l$block_10;
2056
+ }
2057
+ var b3 = _this__u8e3s4[tmp2_1 + 3 | 0];
2058
+ // Inline function 'kotlinx.io.internal.isUtf8Continuation' call
2059
+ // Inline function 'kotlinx.io.and' call
2060
+ if (!((b3 & 192) === 128)) {
2061
+ if (!(65533 === 65533)) {
2062
+ var c_20 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
2063
+ var _unary__edvuaz_21 = length;
2064
+ length = _unary__edvuaz_21 + 1 | 0;
2065
+ chars[_unary__edvuaz_21] = c_20;
2066
+ var c_21 = numberToChar((65533 & 1023) + 56320 | 0);
2067
+ var _unary__edvuaz_22 = length;
2068
+ length = _unary__edvuaz_22 + 1 | 0;
2069
+ chars[_unary__edvuaz_22] = c_21;
2070
+ } else {
2071
+ var c_22 = _Char___init__impl__6a9atx(65533);
2072
+ var _unary__edvuaz_23 = length;
2073
+ length = _unary__edvuaz_23 + 1 | 0;
2074
+ chars[_unary__edvuaz_23] = c_22;
2075
+ }
2076
+ tmp$ret$41 = 3;
2077
+ break $l$block_10;
2078
+ }
2079
+ var codePoint_1 = 3678080 ^ b3 ^ b2_0 << 6 ^ b1_1 << 12 ^ b0_2 << 18;
2080
+ if (codePoint_1 > 1114111) {
2081
+ if (!(65533 === 65533)) {
2082
+ var c_23 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
2083
+ var _unary__edvuaz_24 = length;
2084
+ length = _unary__edvuaz_24 + 1 | 0;
2085
+ chars[_unary__edvuaz_24] = c_23;
2086
+ var c_24 = numberToChar((65533 & 1023) + 56320 | 0);
2087
+ var _unary__edvuaz_25 = length;
2088
+ length = _unary__edvuaz_25 + 1 | 0;
2089
+ chars[_unary__edvuaz_25] = c_24;
2090
+ } else {
2091
+ var c_25 = _Char___init__impl__6a9atx(65533);
2092
+ var _unary__edvuaz_26 = length;
2093
+ length = _unary__edvuaz_26 + 1 | 0;
2094
+ chars[_unary__edvuaz_26] = c_25;
2095
+ }
2096
+ } else if (55296 <= codePoint_1 ? codePoint_1 <= 57343 : false) {
2097
+ if (!(65533 === 65533)) {
2098
+ var c_26 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
2099
+ var _unary__edvuaz_27 = length;
2100
+ length = _unary__edvuaz_27 + 1 | 0;
2101
+ chars[_unary__edvuaz_27] = c_26;
2102
+ var c_27 = numberToChar((65533 & 1023) + 56320 | 0);
2103
+ var _unary__edvuaz_28 = length;
2104
+ length = _unary__edvuaz_28 + 1 | 0;
2105
+ chars[_unary__edvuaz_28] = c_27;
2106
+ } else {
2107
+ var c_28 = _Char___init__impl__6a9atx(65533);
2108
+ var _unary__edvuaz_29 = length;
2109
+ length = _unary__edvuaz_29 + 1 | 0;
2110
+ chars[_unary__edvuaz_29] = c_28;
2111
+ }
2112
+ } else if (codePoint_1 < 65536) {
2113
+ if (!(65533 === 65533)) {
2114
+ var c_29 = numberToChar((65533 >>> 10 | 0) + 55232 | 0);
2115
+ var _unary__edvuaz_30 = length;
2116
+ length = _unary__edvuaz_30 + 1 | 0;
2117
+ chars[_unary__edvuaz_30] = c_29;
2118
+ var c_30 = numberToChar((65533 & 1023) + 56320 | 0);
2119
+ var _unary__edvuaz_31 = length;
2120
+ length = _unary__edvuaz_31 + 1 | 0;
2121
+ chars[_unary__edvuaz_31] = c_30;
2122
+ } else {
2123
+ var c_31 = _Char___init__impl__6a9atx(65533);
2124
+ var _unary__edvuaz_32 = length;
2125
+ length = _unary__edvuaz_32 + 1 | 0;
2126
+ chars[_unary__edvuaz_32] = c_31;
2127
+ }
2128
+ } else {
2129
+ if (!(codePoint_1 === 65533)) {
2130
+ var c_32 = numberToChar((codePoint_1 >>> 10 | 0) + 55232 | 0);
2131
+ var _unary__edvuaz_33 = length;
2132
+ length = _unary__edvuaz_33 + 1 | 0;
2133
+ chars[_unary__edvuaz_33] = c_32;
2134
+ var c_33 = numberToChar((codePoint_1 & 1023) + 56320 | 0);
2135
+ var _unary__edvuaz_34 = length;
2136
+ length = _unary__edvuaz_34 + 1 | 0;
2137
+ chars[_unary__edvuaz_34] = c_33;
2138
+ } else {
2139
+ var c_34 = _Char___init__impl__6a9atx(65533);
2140
+ var _unary__edvuaz_35 = length;
2141
+ length = _unary__edvuaz_35 + 1 | 0;
2142
+ chars[_unary__edvuaz_35] = c_34;
2143
+ }
2144
+ }
2145
+ tmp$ret$41 = 4;
2146
+ }
2147
+ index = tmp_2 + tmp$ret$41 | 0;
2148
+ } else {
2149
+ var c_35 = _Char___init__impl__6a9atx(65533);
2150
+ var _unary__edvuaz_36 = length;
2151
+ length = _unary__edvuaz_36 + 1 | 0;
2152
+ chars[_unary__edvuaz_36] = c_35;
2153
+ index = index + 1 | 0;
2154
+ }
2155
+ }
2156
+ }
2157
+ }
2158
+ }
2159
+ return concatToString(chars, 0, length);
2160
+ }
2161
+ function get_SegmentReadContextImpl() {
2162
+ _init_properties_UnsafeBufferOperations_kt__xw75gy();
2163
+ return SegmentReadContextImpl;
2164
+ }
2165
+ var SegmentReadContextImpl;
2166
+ function get_SegmentWriteContextImpl() {
2167
+ _init_properties_UnsafeBufferOperations_kt__xw75gy();
2168
+ return SegmentWriteContextImpl;
2169
+ }
2170
+ var SegmentWriteContextImpl;
2171
+ var BufferIterationContextImpl;
2172
+ function UnsafeBufferOperations() {
2173
+ }
2174
+ var UnsafeBufferOperations_instance;
2175
+ function UnsafeBufferOperations_getInstance() {
2176
+ return UnsafeBufferOperations_instance;
2177
+ }
2178
+ function SegmentReadContextImpl$1() {
2179
+ }
2180
+ protoOf(SegmentReadContextImpl$1).o3c = function (segment, offset) {
2181
+ return segment.n3b(offset);
2182
+ };
2183
+ function SegmentWriteContextImpl$1() {
2184
+ }
2185
+ protoOf(SegmentWriteContextImpl$1).r3d = function (segment, offset, value) {
2186
+ segment.k3d(offset, value);
2187
+ };
2188
+ protoOf(SegmentWriteContextImpl$1).q3d = function (segment, offset, b0, b1) {
2189
+ segment.l3d(offset, b0, b1);
2190
+ };
2191
+ protoOf(SegmentWriteContextImpl$1).p3d = function (segment, offset, b0, b1, b2) {
2192
+ segment.m3d(offset, b0, b1, b2);
2193
+ };
2194
+ protoOf(SegmentWriteContextImpl$1).o3d = function (segment, offset, b0, b1, b2, b3) {
2195
+ segment.n3d(offset, b0, b1, b2, b3);
2196
+ };
2197
+ function BufferIterationContextImpl$1() {
2198
+ }
2199
+ protoOf(BufferIterationContextImpl$1).o3c = function (segment, offset) {
2200
+ return get_SegmentReadContextImpl().o3c(segment, offset);
2201
+ };
2202
+ var properties_initialized_UnsafeBufferOperations_kt_2xfgoc;
2203
+ function _init_properties_UnsafeBufferOperations_kt__xw75gy() {
2204
+ if (!properties_initialized_UnsafeBufferOperations_kt_2xfgoc) {
2205
+ properties_initialized_UnsafeBufferOperations_kt_2xfgoc = true;
2206
+ SegmentReadContextImpl = new SegmentReadContextImpl$1();
2207
+ SegmentWriteContextImpl = new SegmentWriteContextImpl$1();
2208
+ BufferIterationContextImpl = new BufferIterationContextImpl$1();
2209
+ }
2210
+ }
2211
+ function withCaughtException(block) {
2212
+ try {
2213
+ block();
2214
+ return null;
2215
+ } catch ($p) {
2216
+ if ($p instanceof Error) {
2217
+ var t = $p;
2218
+ return t;
2219
+ } else {
2220
+ throw $p;
2221
+ }
2222
+ }
2223
+ }
2224
+ function IOException_init_$Init$($this) {
2225
+ Exception_init_$Init$($this);
2226
+ IOException.call($this);
2227
+ return $this;
2228
+ }
2229
+ function IOException_init_$Create$() {
2230
+ var tmp = IOException_init_$Init$(objectCreate(protoOf(IOException)));
2231
+ captureStack(tmp, IOException_init_$Create$);
2232
+ return tmp;
2233
+ }
2234
+ function IOException_init_$Init$_0(message, $this) {
2235
+ Exception_init_$Init$_0(message, $this);
2236
+ IOException.call($this);
2237
+ return $this;
2238
+ }
2239
+ function IOException_init_$Create$_0(message) {
2240
+ var tmp = IOException_init_$Init$_0(message, objectCreate(protoOf(IOException)));
2241
+ captureStack(tmp, IOException_init_$Create$_0);
2242
+ return tmp;
2243
+ }
2244
+ function IOException_init_$Init$_1(message, cause, $this) {
2245
+ Exception_init_$Init$_1(message, cause, $this);
2246
+ IOException.call($this);
2247
+ return $this;
2248
+ }
2249
+ function IOException_init_$Create$_1(message, cause) {
2250
+ var tmp = IOException_init_$Init$_1(message, cause, objectCreate(protoOf(IOException)));
2251
+ captureStack(tmp, IOException_init_$Create$_1);
2252
+ return tmp;
2253
+ }
2254
+ function IOException() {
2255
+ captureStack(this, IOException);
2256
+ }
2257
+ function EOFException_init_$Init$($this) {
2258
+ IOException_init_$Init$($this);
2259
+ EOFException.call($this);
2260
+ return $this;
2261
+ }
2262
+ function EOFException_init_$Create$() {
2263
+ var tmp = EOFException_init_$Init$(objectCreate(protoOf(EOFException)));
2264
+ captureStack(tmp, EOFException_init_$Create$);
2265
+ return tmp;
2266
+ }
2267
+ function EOFException_init_$Init$_0(message, $this) {
2268
+ IOException_init_$Init$_0(message, $this);
2269
+ EOFException.call($this);
2270
+ return $this;
2271
+ }
2272
+ function EOFException_init_$Create$_0(message) {
2273
+ var tmp = EOFException_init_$Init$_0(message, objectCreate(protoOf(EOFException)));
2274
+ captureStack(tmp, EOFException_init_$Create$_0);
2275
+ return tmp;
2276
+ }
2277
+ function EOFException() {
2278
+ captureStack(this, EOFException);
2279
+ }
2280
+ function SegmentPool() {
2281
+ this.x3b_1 = 0;
2282
+ this.y3b_1 = 0;
2283
+ }
2284
+ protoOf(SegmentPool).z3b = function () {
2285
+ return Companion_instance.f3d();
2286
+ };
2287
+ protoOf(SegmentPool).p3c = function (segment) {
2288
+ };
2289
+ protoOf(SegmentPool).h3d = function () {
2290
+ return AlwaysSharedCopyTracker_getInstance();
2291
+ };
2292
+ var SegmentPool_instance;
2293
+ function SegmentPool_getInstance() {
2294
+ return SegmentPool_instance;
2295
+ }
2296
+ function get_path() {
2297
+ _init_properties_nodeModulesJs_kt__ngjjzw();
2298
+ var tmp0 = path$delegate;
2299
+ var tmp = KProperty0;
2300
+ // Inline function 'kotlin.getValue' call
2301
+ getPropertyCallableRef('path', 0, tmp, _get_path_$ref_hpvpv9(), null);
2302
+ return tmp0.b1();
2303
+ }
2304
+ var path$delegate;
2305
+ function get_fs() {
2306
+ _init_properties_nodeModulesJs_kt__ngjjzw();
2307
+ var tmp0 = fs$delegate;
2308
+ var tmp = KProperty0;
2309
+ // Inline function 'kotlin.getValue' call
2310
+ getPropertyCallableRef('fs', 0, tmp, _get_fs_$ref_rnlob1(), null);
2311
+ return tmp0.b1();
2312
+ }
2313
+ var fs$delegate;
2314
+ function get_os() {
2315
+ _init_properties_nodeModulesJs_kt__ngjjzw();
2316
+ var tmp0 = os$delegate;
2317
+ var tmp = KProperty0;
2318
+ // Inline function 'kotlin.getValue' call
2319
+ getPropertyCallableRef('os', 0, tmp, _get_os_$ref_hoy4d2(), null);
2320
+ return tmp0.b1();
2321
+ }
2322
+ var os$delegate;
2323
+ function get_buffer() {
2324
+ _init_properties_nodeModulesJs_kt__ngjjzw();
2325
+ var tmp0 = buffer$delegate;
2326
+ var tmp = KProperty0;
2327
+ // Inline function 'kotlin.getValue' call
2328
+ getPropertyCallableRef('buffer', 0, tmp, _get_buffer_$ref_mc964a(), null);
2329
+ return tmp0.b1();
2330
+ }
2331
+ var buffer$delegate;
2332
+ function path$delegate$lambda() {
2333
+ _init_properties_nodeModulesJs_kt__ngjjzw();
2334
+ var tmp;
2335
+ try {
2336
+ tmp = eval('require')('path');
2337
+ } catch ($p) {
2338
+ var tmp_0;
2339
+ if ($p instanceof Error) {
2340
+ var e = $p;
2341
+ throw UnsupportedOperationException_init_$Create$("Module 'path' could not be imported", e);
2342
+ } else {
2343
+ throw $p;
2344
+ }
2345
+ }
2346
+ return tmp;
2347
+ }
2348
+ function _get_path_$ref_hpvpv9() {
2349
+ return function () {
2350
+ return get_path();
2351
+ };
2352
+ }
2353
+ function fs$delegate$lambda() {
2354
+ _init_properties_nodeModulesJs_kt__ngjjzw();
2355
+ var tmp;
2356
+ try {
2357
+ tmp = eval('require')('fs');
2358
+ } catch ($p) {
2359
+ var tmp_0;
2360
+ if ($p instanceof Error) {
2361
+ var e = $p;
2362
+ throw UnsupportedOperationException_init_$Create$("Module 'fs' could not be imported", e);
2363
+ } else {
2364
+ throw $p;
2365
+ }
2366
+ }
2367
+ return tmp;
2368
+ }
2369
+ function _get_fs_$ref_rnlob1() {
2370
+ return function () {
2371
+ return get_fs();
2372
+ };
2373
+ }
2374
+ function os$delegate$lambda() {
2375
+ _init_properties_nodeModulesJs_kt__ngjjzw();
2376
+ var tmp;
2377
+ try {
2378
+ tmp = eval('require')('os');
2379
+ } catch ($p) {
2380
+ var tmp_0;
2381
+ if ($p instanceof Error) {
2382
+ var e = $p;
2383
+ throw UnsupportedOperationException_init_$Create$("Module 'os' could not be imported", e);
2384
+ } else {
2385
+ throw $p;
2386
+ }
2387
+ }
2388
+ return tmp;
2389
+ }
2390
+ function _get_os_$ref_hoy4d2() {
2391
+ return function () {
2392
+ return get_os();
2393
+ };
2394
+ }
2395
+ function buffer$delegate$lambda() {
2396
+ _init_properties_nodeModulesJs_kt__ngjjzw();
2397
+ var tmp;
2398
+ try {
2399
+ tmp = eval('require')('buffer');
2400
+ } catch ($p) {
2401
+ var tmp_0;
2402
+ if ($p instanceof Error) {
2403
+ var e = $p;
2404
+ throw UnsupportedOperationException_init_$Create$("Module 'buffer' could not be imported", e);
2405
+ } else {
2406
+ throw $p;
2407
+ }
2408
+ }
2409
+ return tmp;
2410
+ }
2411
+ function _get_buffer_$ref_mc964a() {
2412
+ return function () {
2413
+ return get_buffer();
2414
+ };
2415
+ }
2416
+ var properties_initialized_nodeModulesJs_kt_oooz8e;
2417
+ function _init_properties_nodeModulesJs_kt__ngjjzw() {
2418
+ if (!properties_initialized_nodeModulesJs_kt_oooz8e) {
2419
+ properties_initialized_nodeModulesJs_kt_oooz8e = true;
2420
+ path$delegate = lazy(path$delegate$lambda);
2421
+ fs$delegate = lazy(fs$delegate$lambda);
2422
+ os$delegate = lazy(os$delegate$lambda);
2423
+ buffer$delegate = lazy(buffer$delegate$lambda);
2424
+ }
2425
+ }
2426
+ function get_SystemFileSystem() {
2427
+ _init_properties_FileSystemNodeJs_kt__m4c3u();
2428
+ return SystemFileSystem;
2429
+ }
2430
+ var SystemFileSystem;
2431
+ function get_isWindows() {
2432
+ _init_properties_FileSystemNodeJs_kt__m4c3u();
2433
+ return isWindows;
2434
+ }
2435
+ var isWindows;
2436
+ function FileNotFoundException(message) {
2437
+ IOException_init_$Init$_0(message, this);
2438
+ captureStack(this, FileNotFoundException);
2439
+ }
2440
+ function SystemFileSystem$o$delete$lambda($path) {
2441
+ return function () {
2442
+ var tmp0_elvis_lhs = get_fs().statSync($path.g3e_1);
2443
+ var tmp;
2444
+ if (tmp0_elvis_lhs == null) {
2445
+ throw new FileNotFoundException('File does not exist: ' + $path.toString());
2446
+ } else {
2447
+ tmp = tmp0_elvis_lhs;
2448
+ }
2449
+ var stats = tmp;
2450
+ var tmp_0;
2451
+ if (stats.isDirectory()) {
2452
+ get_fs().rmdirSync($path.g3e_1);
2453
+ tmp_0 = Unit_instance;
2454
+ } else {
2455
+ get_fs().rmSync($path.g3e_1);
2456
+ tmp_0 = Unit_instance;
2457
+ }
2458
+ return Unit_instance;
2459
+ };
2460
+ }
2461
+ function SystemFileSystem$o$metadataOrNull$lambda($path, $metadata) {
2462
+ return function () {
2463
+ var tmp0_elvis_lhs = get_fs().statSync($path.g3e_1);
2464
+ var tmp;
2465
+ if (tmp0_elvis_lhs == null) {
2466
+ return Unit_instance;
2467
+ } else {
2468
+ tmp = tmp0_elvis_lhs;
2469
+ }
2470
+ var stat = tmp;
2471
+ var mode = stat.mode;
2472
+ var isFile = (mode & get_fs().constants.S_IFMT) === get_fs().constants.S_IFREG;
2473
+ $metadata._v = new FileMetadata(isFile, (mode & get_fs().constants.S_IFMT) === get_fs().constants.S_IFDIR, isFile ? toLong(stat.size) : new Long(-1, -1));
2474
+ return Unit_instance;
2475
+ };
2476
+ }
2477
+ function SystemFileSystem$1() {
2478
+ SystemFileSystemImpl.call(this);
2479
+ }
2480
+ protoOf(SystemFileSystem$1).s3d = function (path) {
2481
+ return get_fs().existsSync(path.g3e_1);
2482
+ };
2483
+ protoOf(SystemFileSystem$1).t3d = function (path, mustExist) {
2484
+ if (!this.s3d(path)) {
2485
+ if (mustExist) {
2486
+ throw new FileNotFoundException('File does not exist: ' + path.toString());
2487
+ }
2488
+ return Unit_instance;
2489
+ }
2490
+ var tmp0_safe_receiver = withCaughtException(SystemFileSystem$o$delete$lambda(path));
2491
+ if (tmp0_safe_receiver == null)
2492
+ null;
2493
+ else {
2494
+ // Inline function 'kotlin.also' call
2495
+ throw IOException_init_$Create$_1('Delete failed for ' + path.toString(), tmp0_safe_receiver);
2496
+ }
2497
+ };
2498
+ protoOf(SystemFileSystem$1).v3d = function (path, mustCreate) {
2499
+ var metadata = this.a3e(path);
2500
+ if (!(metadata == null)) {
2501
+ if (mustCreate) {
2502
+ throw IOException_init_$Create$_0('Path already exists: ' + path.toString());
2503
+ }
2504
+ if (metadata.d3e_1) {
2505
+ throw IOException_init_$Create$_0("Path already exists and it's a file: " + path.toString());
2506
+ }
2507
+ return Unit_instance;
2508
+ }
2509
+ // Inline function 'kotlin.collections.arrayListOf' call
2510
+ var parts = ArrayList_init_$Create$();
2511
+ var p = path;
2512
+ while (!(p == null) && !this.s3d(p)) {
2513
+ parts.h(p.toString());
2514
+ p = p.t1w();
2515
+ }
2516
+ // Inline function 'kotlin.collections.forEach' call
2517
+ var _iterator__ex2g4s = asReversed(parts).p();
2518
+ while (_iterator__ex2g4s.q()) {
2519
+ var element = _iterator__ex2g4s.r();
2520
+ get_fs().mkdirSync(element);
2521
+ }
2522
+ };
2523
+ protoOf(SystemFileSystem$1).a3e = function (path) {
2524
+ if (!this.s3d(path))
2525
+ return null;
2526
+ var metadata = {_v: null};
2527
+ var tmp0_safe_receiver = withCaughtException(SystemFileSystem$o$metadataOrNull$lambda(path, metadata));
2528
+ if (tmp0_safe_receiver == null)
2529
+ null;
2530
+ else {
2531
+ // Inline function 'kotlin.also' call
2532
+ throw IOException_init_$Create$_1('Stat failed for ' + path.toString(), tmp0_safe_receiver);
2533
+ }
2534
+ return metadata._v;
2535
+ };
2536
+ protoOf(SystemFileSystem$1).x3d = function (path) {
2537
+ return new FileSource(path);
2538
+ };
2539
+ protoOf(SystemFileSystem$1).y3d = function (path, append) {
2540
+ return new FileSink(path, append);
2541
+ };
2542
+ protoOf(SystemFileSystem$1).b3e = function (path) {
2543
+ if (!this.s3d(path))
2544
+ throw new FileNotFoundException(path.g3e_1);
2545
+ return Path_2(get_fs().realpathSync.native(path.g3e_1));
2546
+ };
2547
+ protoOf(SystemFileSystem$1).c3e = function (directory) {
2548
+ var tmp0_elvis_lhs = this.a3e(directory);
2549
+ var tmp;
2550
+ if (tmp0_elvis_lhs == null) {
2551
+ throw new FileNotFoundException(directory.g3e_1);
2552
+ } else {
2553
+ tmp = tmp0_elvis_lhs;
2554
+ }
2555
+ var metadata = tmp;
2556
+ if (!metadata.e3e_1)
2557
+ throw IOException_init_$Create$_0('Not a directory: ' + directory.g3e_1);
2558
+ var tmp1_elvis_lhs = get_fs().opendirSync(directory.g3e_1);
2559
+ var tmp_0;
2560
+ if (tmp1_elvis_lhs == null) {
2561
+ throw IOException_init_$Create$_0('Unable to read directory: ' + directory.g3e_1);
2562
+ } else {
2563
+ tmp_0 = tmp1_elvis_lhs;
2564
+ }
2565
+ var dir = tmp_0;
2566
+ try {
2567
+ // Inline function 'kotlin.collections.buildList' call
2568
+ // Inline function 'kotlin.collections.buildListInternal' call
2569
+ // Inline function 'kotlin.apply' call
2570
+ var this_0 = ArrayList_init_$Create$();
2571
+ var child = dir.readSync();
2572
+ while (!(child == null)) {
2573
+ this_0.h(Path(directory, [child.name]));
2574
+ child = dir.readSync();
2575
+ }
2576
+ return this_0.e4();
2577
+ }finally {
2578
+ dir.closeSync();
2579
+ }
2580
+ };
2581
+ var properties_initialized_FileSystemNodeJs_kt_vmmd20;
2582
+ function _init_properties_FileSystemNodeJs_kt__m4c3u() {
2583
+ if (!properties_initialized_FileSystemNodeJs_kt_vmmd20) {
2584
+ properties_initialized_FileSystemNodeJs_kt_vmmd20 = true;
2585
+ SystemFileSystem = new SystemFileSystem$1();
2586
+ isWindows = get_os().platform() === 'win32';
2587
+ }
2588
+ }
2589
+ function get_SystemPathSeparator() {
2590
+ _init_properties_PathsNodeJs_kt__bvvvsp();
2591
+ var tmp0 = SystemPathSeparator$delegate;
2592
+ var tmp = KProperty0;
2593
+ // Inline function 'kotlin.getValue' call
2594
+ getPropertyCallableRef('SystemPathSeparator', 0, tmp, _get_SystemPathSeparator_$ref_lvdbpt(), null);
2595
+ return tmp0.b1().t1_1;
2596
+ }
2597
+ var SystemPathSeparator$delegate;
2598
+ function Path_1(rawPath, any) {
2599
+ this.g3e_1 = removeTrailingSeparators(rawPath);
2600
+ }
2601
+ protoOf(Path_1).t1w = function () {
2602
+ // Inline function 'kotlin.text.isEmpty' call
2603
+ var this_0 = this.g3e_1;
2604
+ if (charSequenceLength(this_0) === 0)
2605
+ return null;
2606
+ if (get_isWindows()) {
2607
+ if (!contains(this.g3e_1, _Char___init__impl__6a9atx(47)) && !contains(this.g3e_1, _Char___init__impl__6a9atx(92))) {
2608
+ return null;
2609
+ }
2610
+ } else if (!contains(this.g3e_1, get_SystemPathSeparator())) {
2611
+ return null;
2612
+ }
2613
+ var p = get_path().dirname(this.g3e_1);
2614
+ var tmp;
2615
+ // Inline function 'kotlin.text.isEmpty' call
2616
+ if (charSequenceLength(p) === 0) {
2617
+ tmp = null;
2618
+ } else {
2619
+ if (p === this.g3e_1) {
2620
+ tmp = null;
2621
+ } else {
2622
+ tmp = Path_2(p);
2623
+ }
2624
+ }
2625
+ return tmp;
2626
+ };
2627
+ protoOf(Path_1).h3e = function () {
2628
+ // Inline function 'kotlin.text.isEmpty' call
2629
+ var this_0 = this.g3e_1;
2630
+ if (charSequenceLength(this_0) === 0)
2631
+ return '';
2632
+ var p = get_path().basename(this.g3e_1);
2633
+ var tmp;
2634
+ // Inline function 'kotlin.text.isEmpty' call
2635
+ if (charSequenceLength(p) === 0) {
2636
+ tmp = '';
2637
+ } else {
2638
+ tmp = p;
2639
+ }
2640
+ return tmp;
2641
+ };
2642
+ protoOf(Path_1).toString = function () {
2643
+ return this.g3e_1;
2644
+ };
2645
+ protoOf(Path_1).equals = function (other) {
2646
+ if (this === other)
2647
+ return true;
2648
+ if (!(other instanceof Path_1))
2649
+ return false;
2650
+ return this.g3e_1 === other.g3e_1;
2651
+ };
2652
+ protoOf(Path_1).hashCode = function () {
2653
+ return getStringHashCode(this.g3e_1);
2654
+ };
2655
+ function open($this, path) {
2656
+ if (!get_fs().existsSync(path.g3e_1)) {
2657
+ throw new FileNotFoundException('File does not exist: ' + path.g3e_1);
2658
+ }
2659
+ var fd = {_v: -1};
2660
+ var tmp0_safe_receiver = withCaughtException(FileSource$open$lambda(fd, path));
2661
+ if (tmp0_safe_receiver == null)
2662
+ null;
2663
+ else {
2664
+ // Inline function 'kotlin.also' call
2665
+ throw IOException_init_$Create$_1('Failed to open a file ' + path.g3e_1 + '.', tmp0_safe_receiver);
2666
+ }
2667
+ if (fd._v < 0)
2668
+ throw IOException_init_$Create$_0('Failed to open a file ' + path.g3e_1 + '.');
2669
+ return fd._v;
2670
+ }
2671
+ function FileSource$open$lambda($fd, $path) {
2672
+ return function () {
2673
+ $fd._v = get_fs().openSync($path.g3e_1, 'r');
2674
+ return Unit_instance;
2675
+ };
2676
+ }
2677
+ function FileSource$readAtMostTo$lambda(this$0) {
2678
+ return function () {
2679
+ this$0.j3e_1 = get_fs().readFileSync(this$0.m3e_1, null);
2680
+ return Unit_instance;
2681
+ };
2682
+ }
2683
+ function FileSource(path) {
2684
+ this.i3e_1 = path;
2685
+ this.j3e_1 = null;
2686
+ this.k3e_1 = false;
2687
+ this.l3e_1 = 0;
2688
+ this.m3e_1 = open(this, this.i3e_1);
2689
+ }
2690
+ protoOf(FileSource).r3b = function (sink, byteCount) {
2691
+ // Inline function 'kotlin.check' call
2692
+ if (!!this.k3e_1) {
2693
+ var message = 'Source is closed.';
2694
+ throw IllegalStateException_init_$Create$(toString(message));
2695
+ }
2696
+ if (byteCount.equals(new Long(0, 0))) {
2697
+ return new Long(0, 0);
2698
+ }
2699
+ if (this.j3e_1 === null) {
2700
+ var tmp0_safe_receiver = withCaughtException(FileSource$readAtMostTo$lambda(this));
2701
+ if (tmp0_safe_receiver == null)
2702
+ null;
2703
+ else {
2704
+ // Inline function 'kotlin.also' call
2705
+ throw IOException_init_$Create$_1('Failed to read data from ' + this.i3e_1.g3e_1, tmp0_safe_receiver);
2706
+ }
2707
+ }
2708
+ var len = ensureNotNull(this.j3e_1).length;
2709
+ if (this.l3e_1 >= len) {
2710
+ return new Long(-1, -1);
2711
+ }
2712
+ // Inline function 'kotlinx.io.minOf' call
2713
+ var b = len - this.l3e_1 | 0;
2714
+ // Inline function 'kotlin.comparisons.minOf' call
2715
+ var b_0 = toLong(b);
2716
+ var bytesToRead = byteCount.j1(b_0) <= 0 ? byteCount : b_0;
2717
+ var inductionVariable = new Long(0, 0);
2718
+ if (inductionVariable.j1(bytesToRead) < 0)
2719
+ do {
2720
+ var i = inductionVariable;
2721
+ inductionVariable = inductionVariable.b3(new Long(1, 0));
2722
+ var tmp = ensureNotNull(this.j3e_1);
2723
+ var _unary__edvuaz = this.l3e_1;
2724
+ this.l3e_1 = _unary__edvuaz + 1 | 0;
2725
+ sink.k3c(tmp.readInt8(_unary__edvuaz));
2726
+ }
2727
+ while (inductionVariable.j1(bytesToRead) < 0);
2728
+ return bytesToRead;
2729
+ };
2730
+ protoOf(FileSource).u4 = function () {
2731
+ if (!this.k3e_1) {
2732
+ this.k3e_1 = true;
2733
+ get_fs().closeSync(this.m3e_1);
2734
+ }
2735
+ };
2736
+ function open_0($this, path, append) {
2737
+ var flags = append ? 'a' : 'w';
2738
+ var fd = {_v: -1};
2739
+ var tmp0_safe_receiver = withCaughtException(FileSink$open$lambda(fd, path, flags));
2740
+ if (tmp0_safe_receiver == null)
2741
+ null;
2742
+ else {
2743
+ // Inline function 'kotlin.also' call
2744
+ throw IOException_init_$Create$_1('Failed to open a file ' + path.g3e_1 + '.', tmp0_safe_receiver);
2745
+ }
2746
+ if (fd._v < 0)
2747
+ throw IOException_init_$Create$_0('Failed to open a file ' + path.g3e_1 + '.');
2748
+ return fd._v;
2749
+ }
2750
+ function FileSink$open$lambda($fd, $path, $flags) {
2751
+ return function () {
2752
+ $fd._v = get_fs().openSync($path.g3e_1, $flags);
2753
+ return Unit_instance;
2754
+ };
2755
+ }
2756
+ function FileSink$write$lambda(this$0, $buf) {
2757
+ return function () {
2758
+ get_fs().writeFileSync(this$0.o3e_1, $buf);
2759
+ return Unit_instance;
2760
+ };
2761
+ }
2762
+ function FileSink(path, append) {
2763
+ this.n3e_1 = false;
2764
+ this.o3e_1 = open_0(this, path, append);
2765
+ }
2766
+ protoOf(FileSink).s3b = function (source, byteCount) {
2767
+ // Inline function 'kotlin.check' call
2768
+ if (!!this.n3e_1) {
2769
+ var message = 'Sink is closed.';
2770
+ throw IllegalStateException_init_$Create$(toString(message));
2771
+ }
2772
+ if (byteCount.equals(new Long(0, 0))) {
2773
+ return Unit_instance;
2774
+ }
2775
+ // Inline function 'kotlin.comparisons.minOf' call
2776
+ var b = source.s();
2777
+ var remainingBytes = byteCount.j1(b) <= 0 ? byteCount : b;
2778
+ while (remainingBytes.j1(new Long(0, 0)) > 0) {
2779
+ var segmentBytes = 0;
2780
+ // Inline function 'kotlinx.io.unsafe.UnsafeBufferOperations.readFromHead' call
2781
+ // Inline function 'kotlin.require' call
2782
+ if (!!source.r3a()) {
2783
+ var message_0 = 'Buffer is empty';
2784
+ throw IllegalArgumentException_init_$Create$(toString(message_0));
2785
+ }
2786
+ var head = ensureNotNull(source.n3a_1);
2787
+ var tmp0 = head.j3d(true);
2788
+ var tmp2 = head.w3a_1;
2789
+ segmentBytes = head.x3a_1 - tmp2 | 0;
2790
+ var buf = get_buffer().Buffer.allocUnsafe(segmentBytes);
2791
+ var inductionVariable = 0;
2792
+ var last = segmentBytes;
2793
+ if (inductionVariable < last)
2794
+ do {
2795
+ var offset = inductionVariable;
2796
+ inductionVariable = inductionVariable + 1 | 0;
2797
+ buf.writeInt8(tmp0[tmp2 + offset | 0], offset);
2798
+ }
2799
+ while (inductionVariable < last);
2800
+ var tmp0_safe_receiver = withCaughtException(FileSink$write$lambda(this, buf));
2801
+ if (tmp0_safe_receiver == null)
2802
+ null;
2803
+ else {
2804
+ // Inline function 'kotlin.also' call
2805
+ throw IOException_init_$Create$_1('Write failed', tmp0_safe_receiver);
2806
+ }
2807
+ var bytesRead = segmentBytes;
2808
+ if (!(bytesRead === 0)) {
2809
+ if (bytesRead < 0)
2810
+ throw IllegalStateException_init_$Create$('Returned negative read bytes count');
2811
+ if (bytesRead > head.s())
2812
+ throw IllegalStateException_init_$Create$('Returned too many bytes');
2813
+ source.o3b(toLong(bytesRead));
2814
+ }
2815
+ var tmp0_0 = remainingBytes;
2816
+ // Inline function 'kotlin.Long.minus' call
2817
+ var other = segmentBytes;
2818
+ remainingBytes = tmp0_0.c3(toLong(other));
2819
+ }
2820
+ };
2821
+ protoOf(FileSink).u4 = function () {
2822
+ if (!this.n3e_1) {
2823
+ this.n3e_1 = true;
2824
+ get_fs().closeSync(this.o3e_1);
2825
+ }
2826
+ };
2827
+ function Path_2(path) {
2828
+ _init_properties_PathsNodeJs_kt__bvvvsp();
2829
+ return new Path_1(path, null);
2830
+ }
2831
+ function SystemPathSeparator$delegate$lambda() {
2832
+ _init_properties_PathsNodeJs_kt__bvvvsp();
2833
+ var sep = get_path().sep;
2834
+ // Inline function 'kotlin.check' call
2835
+ if (!(sep.length === 1)) {
2836
+ throw IllegalStateException_init_$Create$('Check failed.');
2837
+ }
2838
+ return new Char(charCodeAt(sep, 0));
2839
+ }
2840
+ function _get_SystemPathSeparator_$ref_lvdbpt() {
2841
+ return function () {
2842
+ return new Char(get_SystemPathSeparator());
2843
+ };
2844
+ }
2845
+ var properties_initialized_PathsNodeJs_kt_2u5gc7;
2846
+ function _init_properties_PathsNodeJs_kt__bvvvsp() {
2847
+ if (!properties_initialized_PathsNodeJs_kt_2u5gc7) {
2848
+ properties_initialized_PathsNodeJs_kt_2u5gc7 = true;
2849
+ SystemPathSeparator$delegate = lazy(SystemPathSeparator$delegate$lambda);
2850
+ }
2851
+ }
2852
+ //region block: post-declaration
2853
+ protoOf(Buffer).d3c = write$default;
2854
+ protoOf(RealSink).d3c = write$default;
2855
+ protoOf(SystemFileSystemImpl).u3d = delete$default;
2856
+ protoOf(SystemFileSystemImpl).w3d = createDirectories$default;
2857
+ protoOf(SystemFileSystemImpl).z3d = sink$default;
2858
+ //endregion
2859
+ //region block: init
2860
+ Companion_instance = new Companion();
2861
+ UnsafeBufferOperations_instance = new UnsafeBufferOperations();
2862
+ SegmentPool_instance = new SegmentPool();
2863
+ //endregion
2864
+ //region block: exports
2865
+ _.$_$ = _.$_$ || {};
2866
+ _.$_$.a = EOFException_init_$Create$_0;
2867
+ _.$_$.b = IOException_init_$Init$_0;
2868
+ _.$_$.c = IOException_init_$Create$_0;
2869
+ _.$_$.d = IOException_init_$Init$_1;
2870
+ _.$_$.e = IOException_init_$Create$_1;
2871
+ _.$_$.f = UnsafeBufferOperations_instance;
2872
+ _.$_$.g = Path_0;
2873
+ _.$_$.h = Path_2;
2874
+ _.$_$.i = get_SystemFileSystem;
2875
+ _.$_$.j = Buffer;
2876
+ _.$_$.k = IOException;
2877
+ _.$_$.l = Source;
2878
+ _.$_$.m = buffered_0;
2879
+ _.$_$.n = buffered;
2880
+ _.$_$.o = indexOf_1;
2881
+ _.$_$.p = readByteArray_0;
2882
+ _.$_$.q = readByteArray;
2883
+ _.$_$.r = readByteString;
2884
+ _.$_$.s = readString;
2885
+ _.$_$.t = readString_0;
2886
+ _.$_$.u = readString_1;
2887
+ _.$_$.v = writeString;
2888
+ //endregion
2889
+ return _;
2890
+ }));
2891
+
2892
+ //# sourceMappingURL=kotlinx-io-kotlinx-io-core.js.map