@tuprolog/2p-full 2.0.4 → 2.0.9

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 (70) hide show
  1. package/2p-bdd.js +172 -172
  2. package/2p-bdd.js.map +1 -1
  3. package/2p-core.js +3593 -3366
  4. package/2p-core.js.map +1 -1
  5. package/2p-datalog.js.map +1 -1
  6. package/2p-dsl-core.js.map +1 -1
  7. package/2p-dsl-solve.js.map +1 -1
  8. package/2p-dsl-theory.js.map +1 -1
  9. package/2p-dsl-unify.js.map +1 -1
  10. package/2p-full.js +17 -4
  11. package/2p-full.js.map +1 -1
  12. package/2p-gui-plp.js.map +1 -1
  13. package/2p-gui.js.map +1 -1
  14. package/2p-ide-web.js.map +1 -1
  15. package/2p-io-lib.js +3489 -5
  16. package/2p-io-lib.js.map +1 -1
  17. package/2p-oop-lib.js +3382 -5
  18. package/2p-oop-lib.js.map +1 -1
  19. package/2p-parser-core.js +616 -5
  20. package/2p-parser-core.js.map +1 -1
  21. package/2p-parser-impl.js +5636 -5
  22. package/2p-parser-impl.js.map +1 -1
  23. package/2p-parser-theory.js +278 -5
  24. package/2p-parser-theory.js.map +1 -1
  25. package/2p-repl.js +533 -5
  26. package/2p-repl.js.map +1 -1
  27. package/2p-serialize-core.js.map +1 -1
  28. package/2p-serialize-theory.js.map +1 -1
  29. package/2p-solve-classic.js +1050 -1050
  30. package/2p-solve-classic.js.map +1 -1
  31. package/2p-solve-concurrent.js.map +1 -1
  32. package/2p-solve-plp.js +3 -3
  33. package/2p-solve-plp.js.map +1 -1
  34. package/2p-solve-problog.js +1450 -1444
  35. package/2p-solve-problog.js.map +1 -1
  36. package/2p-solve-streams.js +1033 -1033
  37. package/2p-solve-streams.js.map +1 -1
  38. package/2p-solve.js +5581 -4491
  39. package/2p-solve.js.map +1 -1
  40. package/2p-test-dsl.js.map +1 -1
  41. package/2p-theory.js +1725 -1725
  42. package/2p-theory.js.map +1 -1
  43. package/2p-unify.js +375 -375
  44. package/2p-unify.js.map +1 -1
  45. package/2p-utils.js +546 -493
  46. package/2p-utils.js.map +1 -1
  47. package/clikt-clikt-mordant.js +311 -5
  48. package/clikt-clikt-mordant.js.map +1 -1
  49. package/clikt-clikt.js +6672 -5
  50. package/clikt-clikt.js.map +1 -1
  51. package/colormath-root-colormath.js +1654 -5
  52. package/colormath-root-colormath.js.map +1 -1
  53. package/kotlin-kotlin-stdlib.js +5402 -2599
  54. package/kotlin-kotlin-stdlib.js.map +1 -1
  55. package/kotlin-kotlin-test.js.map +1 -1
  56. package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js.map +1 -1
  57. package/kotlinx-atomicfu.js.map +1 -1
  58. package/kotlinx-coroutines-core.js.map +1 -1
  59. package/kotlinx-serialization-kotlinx-serialization-core.js.map +1 -1
  60. package/kotlinx-serialization-kotlinx-serialization-json.js.map +1 -1
  61. package/kt-math.js +1622 -1614
  62. package/kt-math.js.map +1 -1
  63. package/mordant-mordant-omnibus.js.map +1 -1
  64. package/mordant-mordant.js +10375 -5
  65. package/mordant-mordant.js.map +1 -1
  66. package/okio-parent-okio-nodefilesystem.js +201 -5
  67. package/okio-parent-okio-nodefilesystem.js.map +1 -1
  68. package/okio-parent-okio.js +3863 -5
  69. package/okio-parent-okio.js.map +1 -1
  70. package/package.json +4 -4
package/2p-io-lib.js CHANGED
@@ -1,13 +1,3497 @@
1
1
  (function (factory) {
2
2
  if (typeof define === 'function' && define.amd)
3
- define(['exports'], factory);
3
+ define(['exports', './kotlin-kotlin-stdlib.js', './2p-parser-impl.js', './2p-solve.js', './2p-parser-core.js', './2p-core.js', './2p-parser-theory.js', './2p-theory.js', './okio-parent-okio.js', './okio-parent-okio-nodefilesystem.js'], factory);
4
4
  else if (typeof exports === 'object')
5
- factory(module.exports);
6
- else
7
- globalThis['2p-io-lib'] = factory(typeof globalThis['2p-io-lib'] === 'undefined' ? {} : globalThis['2p-io-lib']);
8
- }(function (_) {
5
+ factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./2p-parser-impl.js'), require('./2p-solve.js'), require('./2p-parser-core.js'), require('./2p-core.js'), require('./2p-parser-theory.js'), require('./2p-theory.js'), require('./okio-parent-okio.js'), require('./okio-parent-okio-nodefilesystem.js'));
6
+ else {
7
+ if (typeof globalThis['kotlin-kotlin-stdlib'] === 'undefined') {
8
+ throw new Error("Error loading module '2p-io-lib'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to '2p-io-lib'.");
9
+ }
10
+ if (typeof globalThis['2p-parser-impl'] === 'undefined') {
11
+ throw new Error("Error loading module '2p-io-lib'. Its dependency '2p-parser-impl' was not found. Please, check whether '2p-parser-impl' is loaded prior to '2p-io-lib'.");
12
+ }
13
+ if (typeof globalThis['2p-solve'] === 'undefined') {
14
+ throw new Error("Error loading module '2p-io-lib'. Its dependency '2p-solve' was not found. Please, check whether '2p-solve' is loaded prior to '2p-io-lib'.");
15
+ }
16
+ if (typeof globalThis['2p-parser-core'] === 'undefined') {
17
+ throw new Error("Error loading module '2p-io-lib'. Its dependency '2p-parser-core' was not found. Please, check whether '2p-parser-core' is loaded prior to '2p-io-lib'.");
18
+ }
19
+ if (typeof globalThis['2p-core'] === 'undefined') {
20
+ throw new Error("Error loading module '2p-io-lib'. Its dependency '2p-core' was not found. Please, check whether '2p-core' is loaded prior to '2p-io-lib'.");
21
+ }
22
+ if (typeof globalThis['2p-parser-theory'] === 'undefined') {
23
+ throw new Error("Error loading module '2p-io-lib'. Its dependency '2p-parser-theory' was not found. Please, check whether '2p-parser-theory' is loaded prior to '2p-io-lib'.");
24
+ }
25
+ if (typeof globalThis['2p-theory'] === 'undefined') {
26
+ throw new Error("Error loading module '2p-io-lib'. Its dependency '2p-theory' was not found. Please, check whether '2p-theory' is loaded prior to '2p-io-lib'.");
27
+ }
28
+ if (typeof globalThis['okio-parent-okio'] === 'undefined') {
29
+ throw new Error("Error loading module '2p-io-lib'. Its dependency 'okio-parent-okio' was not found. Please, check whether 'okio-parent-okio' is loaded prior to '2p-io-lib'.");
30
+ }
31
+ if (typeof globalThis['okio-parent-okio-nodefilesystem'] === 'undefined') {
32
+ throw new Error("Error loading module '2p-io-lib'. Its dependency 'okio-parent-okio-nodefilesystem' was not found. Please, check whether 'okio-parent-okio-nodefilesystem' is loaded prior to '2p-io-lib'.");
33
+ }
34
+ globalThis['2p-io-lib'] = factory(typeof globalThis['2p-io-lib'] === 'undefined' ? {} : globalThis['2p-io-lib'], globalThis['kotlin-kotlin-stdlib'], globalThis['2p-parser-impl'], globalThis['2p-solve'], globalThis['2p-parser-core'], globalThis['2p-core'], globalThis['2p-parser-theory'], globalThis['2p-theory'], globalThis['okio-parent-okio'], globalThis['okio-parent-okio-nodefilesystem']);
35
+ }
36
+ }(function (_, kotlin_kotlin, kotlin_it_unibo_tuprolog_parser_impl, kotlin_it_unibo_tuprolog_solve, kotlin_it_unibo_tuprolog_parser_core, kotlin_it_unibo_tuprolog_core, kotlin_it_unibo_tuprolog_parser_theory, kotlin_it_unibo_tuprolog_theory, kotlin_com_squareup_okio_okio, kotlin_com_squareup_okio_okio_nodefilesystem) {
9
37
  'use strict';
38
+ //region block: imports
39
+ var VOID = kotlin_kotlin.$_$.b;
40
+ var buildParserFor = kotlin_it_unibo_tuprolog_parser_impl.$_$.v;
41
+ var Companion_instance = kotlin_it_unibo_tuprolog_solve.$_$.r;
42
+ var Unit_instance = kotlin_kotlin.$_$.r;
43
+ var protoOf = kotlin_kotlin.$_$.r8;
44
+ var equals = kotlin_kotlin.$_$.s7;
45
+ var FunctionAdapter = kotlin_kotlin.$_$.f7;
46
+ var isInterface = kotlin_kotlin.$_$.j8;
47
+ var TextChunkSource = kotlin_it_unibo_tuprolog_parser_impl.$_$.t;
48
+ var hashCode = kotlin_kotlin.$_$.z7;
49
+ var initMetadataForClass = kotlin_kotlin.$_$.a8;
50
+ var CoroutineImpl = kotlin_kotlin.$_$.i6;
51
+ var THROW_CCE = kotlin_kotlin.$_$.ge;
52
+ var SequenceScope = kotlin_kotlin.$_$.t9;
53
+ var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.h6;
54
+ var toParseException = kotlin_it_unibo_tuprolog_parser_core.$_$.h;
55
+ var PrologSyntaxException = kotlin_it_unibo_tuprolog_parser_impl.$_$.j;
56
+ var initMetadataForLambda = kotlin_kotlin.$_$.e8;
57
+ var constructCallableReference = kotlin_kotlin.$_$.q7;
58
+ var toOperatorTable = kotlin_it_unibo_tuprolog_parser_core.$_$.g;
59
+ var Companion_instance_0 = kotlin_it_unibo_tuprolog_core.$_$.w;
60
+ var PrologTermParserVisitor = kotlin_it_unibo_tuprolog_parser_core.$_$.b;
61
+ var sequence = kotlin_kotlin.$_$.db;
62
+ var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.w;
63
+ var AbstractLibrary = kotlin_it_unibo_tuprolog_solve.$_$.v2;
64
+ var Companion_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.j1;
65
+ var listOf = kotlin_kotlin.$_$.g4;
66
+ var collectionSizeOrDefault = kotlin_kotlin.$_$.w2;
67
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.t;
68
+ var to = kotlin_kotlin.$_$.we;
69
+ var initMetadataForObject = kotlin_kotlin.$_$.f8;
70
+ var Companion_instance_1 = kotlin_kotlin.$_$.p;
71
+ var asSequence = kotlin_kotlin.$_$.r2;
72
+ var map = kotlin_kotlin.$_$.ua;
73
+ var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_core.$_$.m;
74
+ var toSet = kotlin_kotlin.$_$.lb;
75
+ var initMetadataForCompanion = kotlin_kotlin.$_$.b8;
76
+ var THROW_IAE = kotlin_kotlin.$_$.he;
77
+ var enumEntries = kotlin_kotlin.$_$.j6;
78
+ var Enum = kotlin_kotlin.$_$.wd;
79
+ var toString = kotlin_kotlin.$_$.u8;
80
+ var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.j1;
81
+ var startsWith = kotlin_kotlin.$_$.xc;
82
+ var initMetadataForInterface = kotlin_kotlin.$_$.d8;
83
+ var AbstractOutputChannel = kotlin_it_unibo_tuprolog_solve.$_$.m2;
84
+ var AbstractInputChannel = kotlin_it_unibo_tuprolog_solve.$_$.l2;
85
+ var ArrayDeque_init_$Create$ = kotlin_kotlin.$_$.s;
86
+ var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.c;
87
+ var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.g;
88
+ var numberToChar = kotlin_kotlin.$_$.n8;
89
+ var Char = kotlin_kotlin.$_$.sd;
90
+ var toString_0 = kotlin_kotlin.$_$.h;
91
+ var TuPrologException_init_$Init$ = kotlin_it_unibo_tuprolog_core.$_$.g1;
92
+ var objectCreate = kotlin_kotlin.$_$.q8;
93
+ var captureStack = kotlin_kotlin.$_$.i7;
94
+ var TuPrologException_init_$Init$_0 = kotlin_it_unibo_tuprolog_core.$_$.i1;
95
+ var TuPrologException = kotlin_it_unibo_tuprolog_core.$_$.l1;
96
+ var Companion_instance_2 = kotlin_it_unibo_tuprolog_solve.$_$.c1;
97
+ var Companion_instance_3 = kotlin_it_unibo_tuprolog_solve.$_$.d1;
98
+ var Expected_URL_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.q;
99
+ var Predicative = kotlin_it_unibo_tuprolog_solve.$_$.b3;
100
+ var Predicative_0 = kotlin_it_unibo_tuprolog_solve.$_$.n3;
101
+ var NonBacktrackable = kotlin_it_unibo_tuprolog_solve.$_$.y2;
102
+ var Companion_getInstance_1 = kotlin_it_unibo_tuprolog_solve.$_$.l1;
103
+ var InputChannel = kotlin_it_unibo_tuprolog_solve.$_$.n2;
104
+ var OutputChannel = kotlin_it_unibo_tuprolog_solve.$_$.o2;
105
+ var NonBacktrackable_0 = kotlin_it_unibo_tuprolog_solve.$_$.m3;
106
+ var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.n1;
107
+ var IllegalStateException = kotlin_kotlin.$_$.zd;
108
+ var Atom = kotlin_it_unibo_tuprolog_core.$_$.o1;
109
+ var KProperty1 = kotlin_kotlin.$_$.s9;
110
+ var getPropertyCallableRef = kotlin_kotlin.$_$.x7;
111
+ var sequenceOf = kotlin_kotlin.$_$.bb;
112
+ var flatMap = kotlin_kotlin.$_$.ja;
113
+ var Companion_getInstance_2 = kotlin_it_unibo_tuprolog_core.$_$.x;
114
+ var Companion_getInstance_3 = kotlin_it_unibo_tuprolog_core.$_$.c1;
115
+ var Companion_getInstance_4 = kotlin_it_unibo_tuprolog_core.$_$.a1;
116
+ var Companion_instance_4 = kotlin_it_unibo_tuprolog_core.$_$.s;
117
+ var filter = kotlin_kotlin.$_$.ga;
118
+ var Sequence = kotlin_kotlin.$_$.u9;
119
+ var firstOrNull = kotlin_kotlin.$_$.ha;
120
+ var Companion_getInstance_5 = kotlin_it_unibo_tuprolog_core.$_$.y;
121
+ var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.u;
122
+ var asSequence_0 = kotlin_kotlin.$_$.q2;
123
+ var addAll = kotlin_kotlin.$_$.i2;
124
+ var toList = kotlin_kotlin.$_$.r5;
125
+ var Struct = kotlin_it_unibo_tuprolog_core.$_$.z1;
126
+ var Companion_instance_5 = kotlin_it_unibo_tuprolog_solve.$_$.t;
127
+ var filterNot = kotlin_kotlin.$_$.fa;
128
+ var Truth = kotlin_it_unibo_tuprolog_core.$_$.z2;
129
+ var lazy = kotlin_kotlin.$_$.pe;
130
+ var Companion_instance_6 = kotlin_it_unibo_tuprolog_solve.$_$.w;
131
+ var Expected_STREAM_PROPERTY_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.e;
132
+ var Expected_WRITE_OPTION_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.g;
133
+ var Expected_READ_OPTION_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.b;
134
+ var List = kotlin_it_unibo_tuprolog_core.$_$.v1;
135
+ var Var = kotlin_it_unibo_tuprolog_core.$_$.b3;
136
+ var FuncFormat_LITERAL_getInstance = kotlin_it_unibo_tuprolog_core.$_$.d;
137
+ var FuncFormat_QUOTED_IF_NECESSARY_getInstance = kotlin_it_unibo_tuprolog_core.$_$.e;
138
+ var OpFormat_EXPRESSIONS_getInstance = kotlin_it_unibo_tuprolog_core.$_$.f;
139
+ var OpFormat_IGNORE_OPERATORS_getInstance = kotlin_it_unibo_tuprolog_core.$_$.g;
140
+ var Companion_instance_7 = kotlin_it_unibo_tuprolog_core.$_$.z;
141
+ var VarFormat_UNDERSCORE_getInstance = kotlin_it_unibo_tuprolog_core.$_$.h;
142
+ var Expected_SOURCE_SINK_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.c;
143
+ var Expected_IO_MODE_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.a;
144
+ var Companion_instance_8 = kotlin_it_unibo_tuprolog_solve.$_$.x;
145
+ var Expected_STREAM_OR_ALIAS_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.d;
146
+ var Expected_IN_CHARACTER_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.m;
147
+ var Companion_instance_9 = kotlin_it_unibo_tuprolog_solve.$_$.a1;
148
+ var Limit_CHARACTER_CODE_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.i;
149
+ var Companion_getInstance_6 = kotlin_it_unibo_tuprolog_core.$_$.r;
150
+ var Integer = kotlin_it_unibo_tuprolog_core.$_$.u1;
151
+ var KtMap = kotlin_kotlin.$_$.f2;
152
+ var Expected_STREAM_TYPE_getInstance = kotlin_it_unibo_tuprolog_solve.$_$.f;
153
+ var format = kotlin_it_unibo_tuprolog_core.$_$.c3;
154
+ var charCodeAt = kotlin_kotlin.$_$.l7;
155
+ var emptyList = kotlin_kotlin.$_$.j3;
156
+ var get_lastIndex = kotlin_kotlin.$_$.x3;
157
+ var toList_0 = kotlin_kotlin.$_$.jb;
158
+ var last = kotlin_kotlin.$_$.a4;
159
+ var Companion_instance_10 = kotlin_it_unibo_tuprolog_solve.$_$.b1;
160
+ var ParseException = kotlin_it_unibo_tuprolog_parser_core.$_$.a;
161
+ var emptySet = kotlin_kotlin.$_$.l3;
162
+ var noWhenBranchMatchedException = kotlin_kotlin.$_$.qe;
163
+ var NonBacktrackable_1 = kotlin_it_unibo_tuprolog_solve.$_$.h3;
164
+ var NonBacktrackable_2 = kotlin_it_unibo_tuprolog_solve.$_$.d3;
165
+ var Companion_instance_11 = kotlin_it_unibo_tuprolog_parser_theory.$_$.a;
166
+ var Companion_instance_12 = kotlin_it_unibo_tuprolog_theory.$_$.b;
167
+ var Companion_instance_13 = kotlin_it_unibo_tuprolog_theory.$_$.a;
168
+ var charSequenceLength = kotlin_kotlin.$_$.n7;
169
+ var titlecase = kotlin_kotlin.$_$.ed;
170
+ var isLowerCase = kotlin_kotlin.$_$.gc;
171
+ var substring = kotlin_kotlin.$_$.bd;
172
+ var BinaryRelation = kotlin_it_unibo_tuprolog_solve.$_$.a3;
173
+ var distinct = kotlin_kotlin.$_$.aa;
174
+ var removeSuffix = kotlin_kotlin.$_$.pc;
175
+ var toIntOrNull = kotlin_kotlin.$_$.id;
176
+ var removePrefix = kotlin_kotlin.$_$.nc;
177
+ var buffer = kotlin_com_squareup_okio_okio.$_$.g;
178
+ var addSuppressed = kotlin_kotlin.$_$.je;
179
+ var IOException = kotlin_com_squareup_okio_okio.$_$.f;
180
+ var getStringHashCode = kotlin_kotlin.$_$.y7;
181
+ var KProperty0 = kotlin_kotlin.$_$.r9;
182
+ var Info_getInstance = kotlin_it_unibo_tuprolog_core.$_$.e1;
183
+ var Platform_BROWSER_getInstance = kotlin_it_unibo_tuprolog_core.$_$.i;
184
+ var Companion_getInstance_7 = kotlin_com_squareup_okio_okio.$_$.a;
185
+ var buffer_0 = kotlin_com_squareup_okio_okio.$_$.h;
186
+ var NodeJsFileSystem_getInstance = kotlin_com_squareup_okio_okio_nodefilesystem.$_$.a;
187
+ //endregion
10
188
  //region block: pre-declaration
189
+ initMetadataForClass(sam$it_unibo_tuprolog_parser_TextChunkSource$0, 'sam$it_unibo_tuprolog_parser_TextChunkSource$0', VOID, VOID, [TextChunkSource, FunctionAdapter]);
190
+ initMetadataForLambda(asTermChannel$lambda$slambda, CoroutineImpl, VOID, [1]);
191
+ initMetadataForObject(IOLib, 'IOLib', VOID, AbstractLibrary);
192
+ initMetadataForCompanion(Companion);
193
+ initMetadataForClass(IOMode, 'IOMode', VOID, Enum);
194
+ initMetadataForObject(LocalFileSystem, 'LocalFileSystem');
195
+ initMetadataForCompanion(Companion_0);
196
+ function resolve(child) {
197
+ return Companion_instance_15.remote_trw82g_k$(this.get_protocol_mv93kx_k$(), this.get_host_wonf8x_k$(), this.get_port_wosj4a_k$(), this.get_path_wos8ry_k$() + '/' + child, this.get_query_ixn1y7_k$());
198
+ }
199
+ function div(child) {
200
+ return this.resolve(child);
201
+ }
202
+ function get_isFile() {
203
+ return this.get_protocol_mv93kx_k$() === 'file';
204
+ }
205
+ function get_isHttp() {
206
+ return startsWith(this.get_protocol_mv93kx_k$(), 'http');
207
+ }
208
+ initMetadataForInterface(Url, 'Url');
209
+ initMetadataForClass(SinkOutputChannel, 'SinkOutputChannel', VOID, AbstractOutputChannel);
210
+ initMetadataForClass(SourceInputChannel, 'SourceInputChannel', VOID, AbstractInputChannel);
211
+ initMetadataForClass(IOException_0, 'IOException', VOID, TuPrologException);
212
+ initMetadataForClass(InvalidUrlException, 'InvalidUrlException', VOID, TuPrologException);
213
+ initMetadataForObject(AtEndOfStream0, 'AtEndOfStream0', VOID, Predicative);
214
+ initMetadataForObject(AtEndOfStream1, 'AtEndOfStream1', VOID, Predicative_0);
215
+ initMetadataForObject(CharConversion, 'CharConversion', VOID, NonBacktrackable);
216
+ initMetadataForObject(Close1, 'Close1', VOID, NonBacktrackable_0);
217
+ initMetadataForObject(Close2, 'Close2', VOID, NonBacktrackable);
218
+ initMetadataForObject(Consult, 'Consult', VOID, NonBacktrackable_0);
219
+ initMetadataForObject(CurrentCharConversion, 'CurrentCharConversion', VOID, NonBacktrackable);
220
+ initMetadataForObject(CurrentInput, 'CurrentInput', VOID, NonBacktrackable_0);
221
+ initMetadataForObject(CurrentOutput, 'CurrentOutput', VOID, NonBacktrackable_0);
222
+ initMetadataForObject(FlushOutput, 'FlushOutput', VOID, NonBacktrackable_0);
223
+ initMetadataForObject(GetByte1, 'GetByte1', VOID, NonBacktrackable_0);
224
+ initMetadataForObject(GetByte2, 'GetByte2', VOID, NonBacktrackable);
225
+ initMetadataForObject(GetChar1, 'GetChar1', VOID, NonBacktrackable_0);
226
+ initMetadataForObject(GetChar2, 'GetChar2', VOID, NonBacktrackable);
227
+ initMetadataForObject(GetCode1, 'GetCode1', VOID, NonBacktrackable_0);
228
+ initMetadataForObject(GetCode2, 'GetCode2', VOID, NonBacktrackable);
229
+ initMetadataForLambda(IOPrimitiveUtils$propertiesOf$slambda, CoroutineImpl, VOID, [1]);
230
+ initMetadataForObject(IOPrimitiveUtils, 'IOPrimitiveUtils');
231
+ initMetadataForObject(Nl1, 'Nl1', VOID, NonBacktrackable_0);
232
+ initMetadataForObject(Open3, 'Open3', VOID, NonBacktrackable_1);
233
+ initMetadataForObject(Open4, 'Open4', VOID, NonBacktrackable_2);
234
+ initMetadataForObject(PeekByte1, 'PeekByte1', VOID, NonBacktrackable_0);
235
+ initMetadataForObject(PeekByte2, 'PeekByte2', VOID, NonBacktrackable);
236
+ initMetadataForObject(PeekChar1, 'PeekChar1', VOID, NonBacktrackable_0);
237
+ initMetadataForObject(PeekChar2, 'PeekChar2', VOID, NonBacktrackable);
238
+ initMetadataForObject(PeekCode1, 'PeekCode1', VOID, NonBacktrackable_0);
239
+ initMetadataForObject(PeekCode2, 'PeekCode2', VOID, NonBacktrackable);
240
+ initMetadataForObject(PutByte1, 'PutByte1', VOID, NonBacktrackable_0);
241
+ initMetadataForObject(PutByte2, 'PutByte2', VOID, NonBacktrackable);
242
+ initMetadataForObject(PutChar1, 'PutChar1', VOID, NonBacktrackable_0);
243
+ initMetadataForObject(PutChar2, 'PutChar2', VOID, NonBacktrackable);
244
+ initMetadataForObject(PutCode1, 'PutCode1', VOID, NonBacktrackable_0);
245
+ initMetadataForObject(PutCode2, 'PutCode2', VOID, NonBacktrackable);
246
+ initMetadataForObject(Read1, 'Read1', VOID, NonBacktrackable_0);
247
+ initMetadataForObject(Read2, 'Read2', VOID, NonBacktrackable);
248
+ initMetadataForObject(ReadTerm2, 'ReadTerm2', VOID, NonBacktrackable);
249
+ initMetadataForObject(ReadTerm3, 'ReadTerm3', VOID, NonBacktrackable_1);
250
+ initMetadataForObject(SetInput, 'SetInput', VOID, NonBacktrackable_0);
251
+ initMetadataForObject(SetOutput, 'SetOutput', VOID, NonBacktrackable_0);
252
+ initMetadataForObject(SetTheory, 'SetTheory', VOID, NonBacktrackable_0);
253
+ initMetadataForObject(StreamProperty, 'StreamProperty', VOID, BinaryRelation);
254
+ initMetadataForObject(Write2, 'Write2', VOID, NonBacktrackable);
255
+ initMetadataForObject(WriteCanonical1, 'WriteCanonical1', VOID, NonBacktrackable_0);
256
+ initMetadataForObject(WriteCanonical2, 'WriteCanonical2', VOID, NonBacktrackable);
257
+ initMetadataForObject(WriteEq1, 'WriteEq1', VOID, NonBacktrackable_0);
258
+ initMetadataForObject(WriteEq2, 'WriteEq2', VOID, NonBacktrackable);
259
+ initMetadataForObject(WriteTerm2, 'WriteTerm2', VOID, NonBacktrackable);
260
+ initMetadataForObject(WriteTerm3, 'WriteTerm3', VOID, NonBacktrackable_1);
261
+ initMetadataForClass(JsUrl, 'JsUrl', VOID, VOID, [Url]);
262
+ //endregion
263
+ function get_cache() {
264
+ _init_properties_ChannelUtils_kt__fqios2();
265
+ return cache;
266
+ }
267
+ var cache;
268
+ function asTermChannel(_this__u8e3s4, operators) {
269
+ _init_properties_ChannelUtils_kt__fqios2();
270
+ // Inline function 'kotlin.collections.getOrPut' call
271
+ var this_0 = get_cache();
272
+ var value = this_0.get_wei43m_k$(_this__u8e3s4);
273
+ var tmp;
274
+ if (value == null) {
275
+ var tmp_0 = asTermChannel$lambda(_this__u8e3s4);
276
+ var tmp_1 = new sam$it_unibo_tuprolog_parser_TextChunkSource$0(tmp_0);
277
+ var termIterator = buildParserFor(tmp_1, VOID, VOID, asTermChannel$lambda_0(operators)).iterator_jk1svi_k$();
278
+ var tmp_2 = Companion_instance;
279
+ var tmp_3 = asTermChannel$lambda_1(termIterator);
280
+ var answer = tmp_2.ofWithAvailabilityChecker(tmp_3, Iterator$hasNext$ref(termIterator));
281
+ this_0.put_4fpzoq_k$(_this__u8e3s4, answer);
282
+ tmp = answer;
283
+ } else {
284
+ tmp = value;
285
+ }
286
+ return tmp;
287
+ }
288
+ function sam$it_unibo_tuprolog_parser_TextChunkSource$0(function_0) {
289
+ this.function_1 = function_0;
290
+ }
291
+ protoOf(sam$it_unibo_tuprolog_parser_TextChunkSource$0).readChunk_iuijk9_k$ = function () {
292
+ return this.function_1();
293
+ };
294
+ protoOf(sam$it_unibo_tuprolog_parser_TextChunkSource$0).getFunctionDelegate_jtodtf_k$ = function () {
295
+ return this.function_1;
296
+ };
297
+ protoOf(sam$it_unibo_tuprolog_parser_TextChunkSource$0).equals = function (other) {
298
+ var tmp;
299
+ if (!(other == null) ? isInterface(other, TextChunkSource) : false) {
300
+ var tmp_0;
301
+ if (!(other == null) ? isInterface(other, FunctionAdapter) : false) {
302
+ tmp_0 = equals(this.getFunctionDelegate_jtodtf_k$(), other.getFunctionDelegate_jtodtf_k$());
303
+ } else {
304
+ tmp_0 = false;
305
+ }
306
+ tmp = tmp_0;
307
+ } else {
308
+ tmp = false;
309
+ }
310
+ return tmp;
311
+ };
312
+ protoOf(sam$it_unibo_tuprolog_parser_TextChunkSource$0).hashCode = function () {
313
+ return hashCode(this.getFunctionDelegate_jtodtf_k$());
314
+ };
315
+ function asTermChannel$lambda($this_asTermChannel) {
316
+ return function () {
317
+ return $this_asTermChannel.read();
318
+ };
319
+ }
320
+ function asTermChannel$lambda$slambda($session, $visitor, $lexedSource, resultContinuation) {
321
+ this.$session_1 = $session;
322
+ this.$visitor_1 = $visitor;
323
+ this.$lexedSource_1 = $lexedSource;
324
+ CoroutineImpl.call(this, resultContinuation);
325
+ }
326
+ protoOf(asTermChannel$lambda$slambda).invoke_bdtqt8_k$ = function ($this$sequence, $completion) {
327
+ var tmp = this.create_scrz7k_k$($this$sequence, $completion);
328
+ tmp.result_1 = Unit_instance;
329
+ tmp.exception_1 = null;
330
+ return tmp.doResume_5yljmg_k$();
331
+ };
332
+ protoOf(asTermChannel$lambda$slambda).invoke_qns8j1_k$ = function (p1, $completion) {
333
+ return this.invoke_bdtqt8_k$(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $completion);
334
+ };
335
+ protoOf(asTermChannel$lambda$slambda).doResume_5yljmg_k$ = function () {
336
+ var suspendResult = this.result_1;
337
+ $sm: do
338
+ try {
339
+ var tmp = this.state_1;
340
+ switch (tmp) {
341
+ case 0:
342
+ this.exceptionState_1 = 6;
343
+ this.exceptionState_1 = 5;
344
+ this.term0__1 = this.$session_1.parseNextTerm_als6oi_k$();
345
+ this.state_1 = 1;
346
+ continue $sm;
347
+ case 1:
348
+ if (!!(this.term0__1 == null)) {
349
+ this.state_1 = 3;
350
+ continue $sm;
351
+ }
352
+
353
+ this.state_1 = 2;
354
+ suspendResult = this.$this$sequence_1.yield_3xhcex_k$(this.term0__1.root_1.accept_crnher_k$(this.$visitor_1), this);
355
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
356
+ return suspendResult;
357
+ }
358
+
359
+ continue $sm;
360
+ case 2:
361
+ this.term0__1 = this.$session_1.parseNextTerm_als6oi_k$();
362
+ this.state_1 = 1;
363
+ continue $sm;
364
+ case 3:
365
+ this.exceptionState_1 = 6;
366
+ this.state_1 = 4;
367
+ continue $sm;
368
+ case 4:
369
+ this.exceptionState_1 = 6;
370
+ return Unit_instance;
371
+ case 5:
372
+ this.exceptionState_1 = 6;
373
+ var tmp_0 = this.exception_1;
374
+ if (tmp_0 instanceof PrologSyntaxException) {
375
+ var e = this.exception_1;
376
+ var it = this.$lexedSource_1.get_source_jl0x7o_k$();
377
+ var tmp0_elvis_lhs = it.get_id_kntnx8_k$();
378
+ var input = tmp0_elvis_lhs == null ? it.text$default_f8ergi_k$() : tmp0_elvis_lhs;
379
+ throw toParseException(e, input);
380
+ } else {
381
+ throw this.exception_1;
382
+ }
383
+
384
+ case 6:
385
+ throw this.exception_1;
386
+ }
387
+ } catch ($p) {
388
+ var e_0 = $p;
389
+ if (this.exceptionState_1 === 6) {
390
+ throw e_0;
391
+ } else {
392
+ this.state_1 = this.exceptionState_1;
393
+ this.exception_1 = e_0;
394
+ }
395
+ }
396
+ while (true);
397
+ };
398
+ protoOf(asTermChannel$lambda$slambda).create_scrz7k_k$ = function ($this$sequence, completion) {
399
+ var i = new asTermChannel$lambda$slambda(this.$session_1, this.$visitor_1, this.$lexedSource_1, completion);
400
+ i.$this$sequence_1 = $this$sequence;
401
+ return i;
402
+ };
403
+ function asTermChannel$lambda$slambda_0($session, $visitor, $lexedSource, resultContinuation) {
404
+ var i = new asTermChannel$lambda$slambda($session, $visitor, $lexedSource, resultContinuation);
405
+ return constructCallableReference(function ($this$sequence, $completion) {
406
+ return i.invoke_bdtqt8_k$($this$sequence, $completion);
407
+ }, 1);
408
+ }
409
+ function asTermChannel$lambda_0($operators) {
410
+ return function (parser, lexedSource) {
411
+ var session = parser.openSession_4uoqee_k$(lexedSource, toOperatorTable($operators));
412
+ var visitor = new PrologTermParserVisitor(Companion_instance_0.empty());
413
+ return sequence(asTermChannel$lambda$slambda_0(session, visitor, lexedSource, null));
414
+ };
415
+ }
416
+ function asTermChannel$lambda_1($termIterator) {
417
+ return function () {
418
+ return $termIterator.hasNext_bitz1p_k$() ? $termIterator.next_20eer_k$() : null;
419
+ };
420
+ }
421
+ function Iterator$hasNext$ref(p0) {
422
+ return constructCallableReference(function () {
423
+ return p0.hasNext_bitz1p_k$();
424
+ }, 0, 0, 111, 'hasNext', [p0]);
425
+ }
426
+ var properties_initialized_ChannelUtils_kt_an3chc;
427
+ function _init_properties_ChannelUtils_kt__fqios2() {
428
+ if (!properties_initialized_ChannelUtils_kt_an3chc) {
429
+ properties_initialized_ChannelUtils_kt_an3chc = true;
430
+ // Inline function 'kotlin.collections.mutableMapOf' call
431
+ cache = LinkedHashMap_init_$Create$();
432
+ }
433
+ }
434
+ function IOLib() {
435
+ IOLib_instance = this;
436
+ AbstractLibrary.call(this);
437
+ }
438
+ protoOf(IOLib).get_alias_iooo4n_k$ = function () {
439
+ return 'prolog.io';
440
+ };
441
+ protoOf(IOLib).get_primitives_xl08ol_k$ = function () {
442
+ var tmp = Companion_getInstance();
443
+ // Inline function 'kotlin.collections.map' call
444
+ var this_0 = listOf([AtEndOfStream0_getInstance(), AtEndOfStream1_getInstance(), CharConversion_getInstance(), Close1_getInstance(), Close2_getInstance(), Consult_getInstance(), CurrentCharConversion_getInstance(), CurrentInput_getInstance(), CurrentOutput_getInstance(), FlushOutput_getInstance(), GetByte1_getInstance(), GetByte2_getInstance(), GetChar1_getInstance(), GetChar2_getInstance(), GetCode1_getInstance(), GetCode2_getInstance(), Nl1_getInstance(), Open3_getInstance(), Open4_getInstance(), PeekByte1_getInstance(), PeekByte2_getInstance(), PeekChar1_getInstance(), PeekChar2_getInstance(), PeekCode1_getInstance(), PeekCode2_getInstance(), PutByte1_getInstance(), PutByte2_getInstance(), PutChar1_getInstance(), PutChar2_getInstance(), PutCode1_getInstance(), PutCode2_getInstance(), Read1_getInstance(), Read2_getInstance(), ReadTerm2_getInstance(), ReadTerm3_getInstance(), SetInput_getInstance(), SetOutput_getInstance(), SetTheory_getInstance(), StreamProperty_getInstance(), Write2_getInstance(), WriteCanonical1_getInstance(), WriteCanonical2_getInstance(), WriteEq1_getInstance(), WriteEq2_getInstance(), WriteTerm2_getInstance(), WriteTerm3_getInstance()]);
445
+ // Inline function 'kotlin.collections.mapTo' call
446
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
447
+ var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
448
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
449
+ var item = _iterator__ex2g4s.next_20eer_k$();
450
+ // Inline function 'it.unibo.tuprolog.solve.AbstractWrapper.descriptionPair' call
451
+ var tmp$ret$2 = to(item.signature, item.get_wrappedImplementation_qo1fgy_k$());
452
+ destination.add_utx5q5_k$(tmp$ret$2);
453
+ }
454
+ return tmp.iterableToMapEnsuringNoDuplicates(destination);
455
+ };
456
+ var IOLib_instance;
457
+ function IOLib_getInstance() {
458
+ if (IOLib_instance == null)
459
+ new IOLib();
460
+ return IOLib_instance;
461
+ }
462
+ function IOMode$Companion$atomValues$lambda(it) {
463
+ // Inline function 'kotlin.text.lowercase' call
464
+ // Inline function 'kotlin.js.asDynamic' call
465
+ return it.name_1.toLowerCase();
466
+ }
467
+ function Atom$Companion$of$ref(p0) {
468
+ return constructCallableReference(function (p0_0) {
469
+ return p0.of(p0_0);
470
+ }, 1, 0, 112, 'of', [p0]);
471
+ }
472
+ var static_init_called;
473
+ function static_init() {
474
+ if (static_init_called)
475
+ return Unit_instance;
476
+ static_init_called = true;
477
+ IOMode_READ_instance = new IOMode('READ', 0);
478
+ IOMode_WRITE_instance = new IOMode('WRITE', 1);
479
+ IOMode_APPEND_instance = new IOMode('APPEND', 2);
480
+ if (Companion_instance_14 == null) {
481
+ Companion_instance_1;
482
+ new Companion();
483
+ }
484
+ }
485
+ var IOMode_READ_instance;
486
+ var IOMode_WRITE_instance;
487
+ var IOMode_APPEND_instance;
488
+ function Companion() {
489
+ Companion_instance_14 = this;
490
+ var tmp = this;
491
+ var tmp_0 = asSequence(get_entries());
492
+ var tmp_1 = map(tmp_0, IOMode$Companion$atomValues$lambda);
493
+ tmp.atomValues_1 = toSet(map(tmp_1, Atom$Companion$of$ref(Companion_getInstance_0())));
494
+ }
495
+ var Companion_instance_14;
496
+ function Companion_getInstance_8() {
497
+ static_init();
498
+ return Companion_instance_14;
499
+ }
500
+ function values() {
501
+ static_init();
502
+ return [IOMode_READ_getInstance(), IOMode_WRITE_getInstance(), IOMode_APPEND_getInstance()];
503
+ }
504
+ function valueOf(value) {
505
+ static_init();
506
+ switch (value) {
507
+ case 'READ':
508
+ return IOMode_READ_getInstance();
509
+ case 'WRITE':
510
+ return IOMode_WRITE_getInstance();
511
+ case 'APPEND':
512
+ return IOMode_APPEND_getInstance();
513
+ default:
514
+ THROW_IAE('No enum constant it.unibo.tuprolog.solve.libs.io.IOMode.' + value);
515
+ break;
516
+ }
517
+ }
518
+ function get_entries() {
519
+ static_init();
520
+ if ($ENTRIES == null)
521
+ $ENTRIES = enumEntries(values());
522
+ return $ENTRIES;
523
+ }
524
+ var $ENTRIES;
525
+ function IOMode(name, ordinal) {
526
+ Enum.call(this, name, ordinal);
527
+ }
528
+ function IOMode_READ_getInstance() {
529
+ static_init();
530
+ return IOMode_READ_instance;
531
+ }
532
+ function IOMode_WRITE_getInstance() {
533
+ static_init();
534
+ return IOMode_WRITE_instance;
535
+ }
536
+ function IOMode_APPEND_getInstance() {
537
+ static_init();
538
+ return IOMode_APPEND_instance;
539
+ }
540
+ function LocalFileSystem() {
541
+ LocalFileSystem_instance = this;
542
+ this.fileSystem_1 = get_platformFileSystem();
543
+ }
544
+ protoOf(LocalFileSystem).source_an8jm4_k$ = function (path) {
545
+ return this.fileSystem_1.source_an8jm4_k$(path);
546
+ };
547
+ protoOf(LocalFileSystem).sink_eq8qvr_k$ = function (path, mustCreate) {
548
+ return this.fileSystem_1.sink_eq8qvr_k$(path, mustCreate);
549
+ };
550
+ protoOf(LocalFileSystem).sink$default_9jt55n_k$ = function (path, mustCreate, $super) {
551
+ mustCreate = mustCreate === VOID ? false : mustCreate;
552
+ return $super === VOID ? this.sink_eq8qvr_k$(path, mustCreate) : $super.sink_eq8qvr_k$.call(this, path, mustCreate);
553
+ };
554
+ protoOf(LocalFileSystem).appendingSink_15lg9d_k$ = function (path, mustExist) {
555
+ return this.fileSystem_1.appendingSink_15lg9d_k$(path, mustExist);
556
+ };
557
+ protoOf(LocalFileSystem).appendingSink$default_r7oz7x_k$ = function (path, mustExist, $super) {
558
+ mustExist = mustExist === VOID ? false : mustExist;
559
+ return $super === VOID ? this.appendingSink_15lg9d_k$(path, mustExist) : $super.appendingSink_15lg9d_k$.call(this, path, mustExist);
560
+ };
561
+ var LocalFileSystem_instance;
562
+ function LocalFileSystem_getInstance() {
563
+ if (LocalFileSystem_instance == null)
564
+ new LocalFileSystem();
565
+ return LocalFileSystem_instance;
566
+ }
567
+ function str($this, $receiver, transformation) {
568
+ var tmp;
569
+ if (transformation === VOID) {
570
+ tmp = Url$Companion$str$lambda;
571
+ } else {
572
+ tmp = transformation;
573
+ }
574
+ transformation = tmp;
575
+ return $receiver == null ? '' : transformation($receiver);
576
+ }
577
+ function Url$Companion$str$lambda(it) {
578
+ return toString(it);
579
+ }
580
+ function Url$Companion$toString$lambda(it) {
581
+ return ':' + it;
582
+ }
583
+ function Url$Companion$toString$lambda_0(it) {
584
+ return '?' + it;
585
+ }
586
+ function Companion_0() {
587
+ }
588
+ protoOf(Companion_0).ensureValidPort_jpr8aq_k$ = function (_this__u8e3s4) {
589
+ var tmp;
590
+ if (_this__u8e3s4 < 0) {
591
+ throw IllegalArgumentException_init_$Create$('Invalid port: ' + _this__u8e3s4);
592
+ } else {
593
+ tmp = _this__u8e3s4;
594
+ }
595
+ return tmp;
596
+ };
597
+ protoOf(Companion_0).file = function (path) {
598
+ return fileUrl(path);
599
+ };
600
+ protoOf(Companion_0).remote_trw82g_k$ = function (protocol, host, port, path, query) {
601
+ return remoteUrl(protocol, host, port, path, query);
602
+ };
603
+ protoOf(Companion_0).remote = function (protocol, host, port, path, query, $super) {
604
+ host = host === VOID ? '' : host;
605
+ port = port === VOID ? null : port;
606
+ path = path === VOID ? '' : path;
607
+ query = query === VOID ? null : query;
608
+ return $super === VOID ? this.remote_trw82g_k$(protocol, host, port, path, query) : $super.remote_trw82g_k$.call(this, protocol, host, port, path, query);
609
+ };
610
+ protoOf(Companion_0).http_jibilo_k$ = function (host, port, path, query) {
611
+ return this.remote_trw82g_k$('http', host, port, path, query);
612
+ };
613
+ protoOf(Companion_0).http = function (host, port, path, query, $super) {
614
+ host = host === VOID ? '' : host;
615
+ port = port === VOID ? null : port;
616
+ path = path === VOID ? '' : path;
617
+ query = query === VOID ? null : query;
618
+ return $super === VOID ? this.http_jibilo_k$(host, port, path, query) : $super.http_jibilo_k$.call(this, host, port, path, query);
619
+ };
620
+ protoOf(Companion_0).https_tzmq33_k$ = function (host, port, path, query) {
621
+ return this.remote_trw82g_k$('https', host, port, path, query);
622
+ };
623
+ protoOf(Companion_0).https = function (host, port, path, query, $super) {
624
+ host = host === VOID ? '' : host;
625
+ port = port === VOID ? null : port;
626
+ path = path === VOID ? '' : path;
627
+ query = query === VOID ? null : query;
628
+ return $super === VOID ? this.https_tzmq33_k$(host, port, path, query) : $super.https_tzmq33_k$.call(this, host, port, path, query);
629
+ };
630
+ protoOf(Companion_0).of = function (string) {
631
+ var tmp;
632
+ try {
633
+ tmp = parseUrl(string);
634
+ } catch ($p) {
635
+ var tmp_0;
636
+ if ($p instanceof InvalidUrlException) {
637
+ var e = $p;
638
+ var tmp_1;
639
+ try {
640
+ tmp_1 = parseUrl('file://' + string);
641
+ } catch ($p_0) {
642
+ var tmp_2;
643
+ if ($p_0 instanceof InvalidUrlException) {
644
+ var _unused_var__etf5q3 = $p_0;
645
+ throw e;
646
+ } else {
647
+ throw $p_0;
648
+ }
649
+ }
650
+ tmp_0 = tmp_1;
651
+ } else {
652
+ throw $p;
653
+ }
654
+ tmp = tmp_0;
655
+ }
656
+ return tmp;
657
+ };
658
+ protoOf(Companion_0).toString_t652pn_k$ = function (protocol, host, port, path, query) {
659
+ var tmp = port == null ? null : this.ensureValidPort_jpr8aq_k$(port);
660
+ var tmp_0 = str(this, tmp, Url$Companion$toString$lambda);
661
+ return protocol + '://' + host + tmp_0 + path + str(this, query, Url$Companion$toString$lambda_0);
662
+ };
663
+ var Companion_instance_15;
664
+ function Companion_getInstance_9() {
665
+ return Companion_instance_15;
666
+ }
667
+ function Url() {
668
+ }
669
+ function SinkOutputChannel(sink) {
670
+ AbstractOutputChannel.call(this);
671
+ this.sink_1 = sink;
672
+ }
673
+ protoOf(SinkOutputChannel).writeActually_mdrlf4_k$ = function (value) {
674
+ this.sink_1.writeUtf8_9rv3au_k$(value);
675
+ };
676
+ protoOf(SinkOutputChannel).writeActually_q9kb6k_k$ = function (value) {
677
+ return this.writeActually_mdrlf4_k$(typeof value === 'string' ? value : THROW_CCE());
678
+ };
679
+ protoOf(SinkOutputChannel).flushActually_p3e2un_k$ = function () {
680
+ this.sink_1.flush_shahbo_k$();
681
+ };
682
+ protoOf(SinkOutputChannel).close_yn9xrc_k$ = function () {
683
+ this.sink_1.close_yn9xrc_k$();
684
+ protoOf(AbstractOutputChannel).close_yn9xrc_k$.call(this);
685
+ };
686
+ protoOf(SinkOutputChannel).close = function () {
687
+ return this.close_yn9xrc_k$();
688
+ };
689
+ function SourceInputChannel(source) {
690
+ AbstractInputChannel.call(this);
691
+ this.source_1 = source;
692
+ this.pendingChars_1 = ArrayDeque_init_$Create$();
693
+ }
694
+ protoOf(SourceInputChannel).readActually_jvvtqp_k$ = function () {
695
+ if (this.pendingChars_1.isEmpty_y1axqb_k$()) {
696
+ if (this.source_1.exhausted_p1jt55_k$())
697
+ return null;
698
+ var codePoint = this.source_1.readUtf8CodePoint_brmg90_k$();
699
+ // Inline function 'kotlin.code' call
700
+ var this_0 = _Char___init__impl__6a9atx(65535);
701
+ if (codePoint > Char__toInt_impl_vasixd(this_0)) {
702
+ var offset = codePoint - 65536 | 0;
703
+ this.pendingChars_1.addLast_gaaijb_k$(new Char(numberToChar((offset >> 10) + 55296 | 0)));
704
+ this.pendingChars_1.addLast_gaaijb_k$(new Char(numberToChar((offset & 1023) + 56320 | 0)));
705
+ } else {
706
+ this.pendingChars_1.addLast_gaaijb_k$(new Char(numberToChar(codePoint)));
707
+ }
708
+ }
709
+ return toString_0(this.pendingChars_1.removeFirst_58pi0k_k$().value_1);
710
+ };
711
+ protoOf(SourceInputChannel).close_yn9xrc_k$ = function () {
712
+ this.source_1.close_yn9xrc_k$();
713
+ protoOf(AbstractInputChannel).close_yn9xrc_k$.call(this);
714
+ };
715
+ protoOf(SourceInputChannel).close = function () {
716
+ return this.close_yn9xrc_k$();
717
+ };
718
+ function IOException_init_$Init$(message, $this) {
719
+ TuPrologException_init_$Init$(message, $this);
720
+ IOException_0.call($this);
721
+ return $this;
722
+ }
723
+ function IOException_init_$Create$(message) {
724
+ var tmp = IOException_init_$Init$(message, objectCreate(protoOf(IOException_0)));
725
+ captureStack(tmp, IOException_init_$Create$);
726
+ return tmp;
727
+ }
728
+ function IOException_init_$Init$_0(message, cause, $this) {
729
+ TuPrologException_init_$Init$_0(message, cause, $this);
730
+ IOException_0.call($this);
731
+ return $this;
732
+ }
733
+ function IOException_init_$Create$_0(message, cause) {
734
+ var tmp = IOException_init_$Init$_0(message, cause, objectCreate(protoOf(IOException_0)));
735
+ captureStack(tmp, IOException_init_$Create$_0);
736
+ return tmp;
737
+ }
738
+ protoOf(IOException_0).toLogicError_33irru_k$ = function (context) {
739
+ return Companion_instance_2.forUncaughtKtException(context, this);
740
+ };
741
+ function IOException_0() {
742
+ captureStack(this, IOException_0);
743
+ }
744
+ function InvalidUrlException_init_$Init$(message, $this) {
745
+ TuPrologException_init_$Init$(message, $this);
746
+ InvalidUrlException.call($this);
747
+ return $this;
748
+ }
749
+ function InvalidUrlException_init_$Create$(message) {
750
+ var tmp = InvalidUrlException_init_$Init$(message, objectCreate(protoOf(InvalidUrlException)));
751
+ captureStack(tmp, InvalidUrlException_init_$Create$);
752
+ return tmp;
753
+ }
754
+ function InvalidUrlException_init_$Init$_0(message, cause, $this) {
755
+ TuPrologException_init_$Init$_0(message, cause, $this);
756
+ InvalidUrlException.call($this);
757
+ return $this;
758
+ }
759
+ function InvalidUrlException_init_$Create$_0(message, cause) {
760
+ var tmp = InvalidUrlException_init_$Init$_0(message, cause, objectCreate(protoOf(InvalidUrlException)));
761
+ captureStack(tmp, InvalidUrlException_init_$Create$_0);
762
+ return tmp;
763
+ }
764
+ protoOf(InvalidUrlException).toLogicError_rnao5t_k$ = function (context, signature, culprit, index) {
765
+ return Companion_instance_3.forArgument_54essq_k$(context, signature, Expected_URL_getInstance(), culprit, index);
766
+ };
767
+ function InvalidUrlException() {
768
+ captureStack(this, InvalidUrlException);
769
+ }
770
+ function AtEndOfStream0() {
771
+ AtEndOfStream0_instance = this;
772
+ Predicative.call(this, 'at_end_of_stream');
773
+ }
774
+ protoOf(AtEndOfStream0).compute_yf4j3j_k$ = function (_this__u8e3s4) {
775
+ // Inline function 'kotlin.let' call
776
+ var it = IOPrimitiveUtils_getInstance().get_currentInputChannel_31908p_k$(_this__u8e3s4);
777
+ return it.get_isClosed_rx8ttr_k$() || it.get_isOver_ew3p5z_k$();
778
+ };
779
+ protoOf(AtEndOfStream0).compute_5y3u8_k$ = function (_this__u8e3s4) {
780
+ return this.compute_yf4j3j_k$(_this__u8e3s4);
781
+ };
782
+ var AtEndOfStream0_instance;
783
+ function AtEndOfStream0_getInstance() {
784
+ if (AtEndOfStream0_instance == null)
785
+ new AtEndOfStream0();
786
+ return AtEndOfStream0_instance;
787
+ }
788
+ function AtEndOfStream1() {
789
+ AtEndOfStream1_instance = this;
790
+ Predicative_0.call(this, 'at_end_of_stream');
791
+ }
792
+ protoOf(AtEndOfStream1).compute_2uabro_k$ = function (_this__u8e3s4, first) {
793
+ // Inline function 'kotlin.let' call
794
+ var it = IOPrimitiveUtils_getInstance().ensuringArgumentIsInputChannel_w9cvb1_k$(_this__u8e3s4, 0);
795
+ return it.get_isClosed_rx8ttr_k$() || it.get_isOver_ew3p5z_k$();
796
+ };
797
+ protoOf(AtEndOfStream1).compute_gi1set_k$ = function (_this__u8e3s4, first) {
798
+ return this.compute_2uabro_k$(_this__u8e3s4, first);
799
+ };
800
+ var AtEndOfStream1_instance;
801
+ function AtEndOfStream1_getInstance() {
802
+ if (AtEndOfStream1_instance == null)
803
+ new AtEndOfStream1();
804
+ return AtEndOfStream1_instance;
805
+ }
806
+ function CharConversion() {
807
+ CharConversion_instance = this;
808
+ NonBacktrackable.call(this, 'char_conversion');
809
+ }
810
+ protoOf(CharConversion).computeOne_sdv9lb_k$ = function (_this__u8e3s4, first, second) {
811
+ return Companion_getInstance_1().notSupported$default_bmg7vb_k$(_this__u8e3s4);
812
+ };
813
+ protoOf(CharConversion).computeOne_d8jipq_k$ = function (_this__u8e3s4, first, second) {
814
+ return this.computeOne_sdv9lb_k$(_this__u8e3s4, first, second);
815
+ };
816
+ var CharConversion_instance;
817
+ function CharConversion_getInstance() {
818
+ if (CharConversion_instance == null)
819
+ new CharConversion();
820
+ return CharConversion_instance;
821
+ }
822
+ function Close1$computeOne$lambda($this_computeOne, $channel) {
823
+ return function ($this$replySuccess) {
824
+ var tmp = $this_computeOne.context.get_inputChannels_uyf05t_k$();
825
+ $this$replySuccess.closeInputChannels_jg17ii_k$(tmp.aliasesOf(isInterface($channel, InputChannel) ? $channel : THROW_CCE()));
826
+ return Unit_instance;
827
+ };
828
+ }
829
+ function Close1$computeOne$lambda_0($this_computeOne, $channel) {
830
+ return function ($this$replySuccess) {
831
+ var tmp = $this_computeOne.context.get_outputChannels_ffvoca_k$();
832
+ $this$replySuccess.closeOutputChannels_26vixp_k$(tmp.aliasesOf(isInterface($channel, OutputChannel) ? $channel : THROW_CCE()));
833
+ return Unit_instance;
834
+ };
835
+ }
836
+ function Close1() {
837
+ Close1_instance = this;
838
+ NonBacktrackable_0.call(this, 'close');
839
+ }
840
+ protoOf(Close1).computeOne_6dkmes_k$ = function (_this__u8e3s4, first) {
841
+ var channel = IOPrimitiveUtils_getInstance().ensuringArgumentIsChannel_ed79nb_k$(_this__u8e3s4, 0);
842
+ try {
843
+ channel.close();
844
+ var tmp;
845
+ if (isInterface(channel, InputChannel)) {
846
+ tmp = _this__u8e3s4.replySuccessBuildingSideEffects(VOID, VOID, Close1$computeOne$lambda(_this__u8e3s4, channel));
847
+ } else {
848
+ if (isInterface(channel, OutputChannel)) {
849
+ tmp = _this__u8e3s4.replySuccessBuildingSideEffects(VOID, VOID, Close1$computeOne$lambda_0(_this__u8e3s4, channel));
850
+ } else {
851
+ throw IllegalStateException_init_$Create$('This should never happen');
852
+ }
853
+ }
854
+ return tmp;
855
+ } catch ($p) {
856
+ if ($p instanceof IllegalStateException) {
857
+ var _unused_var__etf5q3 = $p;
858
+ return _this__u8e3s4.replyFail(VOID, []);
859
+ } else {
860
+ throw $p;
861
+ }
862
+ }
863
+ };
864
+ protoOf(Close1).computeOne_2tedul_k$ = function (_this__u8e3s4, first) {
865
+ return this.computeOne_6dkmes_k$(_this__u8e3s4, first);
866
+ };
867
+ var Close1_instance;
868
+ function Close1_getInstance() {
869
+ if (Close1_instance == null)
870
+ new Close1();
871
+ return Close1_instance;
872
+ }
873
+ function Close2() {
874
+ Close2_instance = this;
875
+ NonBacktrackable.call(this, 'close');
876
+ }
877
+ protoOf(Close2).computeOne_sdv9lb_k$ = function (_this__u8e3s4, first, second) {
878
+ return Companion_getInstance_1().notSupported$default_bmg7vb_k$(_this__u8e3s4);
879
+ };
880
+ protoOf(Close2).computeOne_d8jipq_k$ = function (_this__u8e3s4, first, second) {
881
+ return this.computeOne_sdv9lb_k$(_this__u8e3s4, first, second);
882
+ };
883
+ var Close2_instance;
884
+ function Close2_getInstance() {
885
+ if (Close2_instance == null)
886
+ new Close2();
887
+ return Close2_instance;
888
+ }
889
+ function Consult() {
890
+ Consult_instance = this;
891
+ NonBacktrackable_0.call(this, 'consult');
892
+ }
893
+ protoOf(Consult).computeOne_6dkmes_k$ = function (_this__u8e3s4, first) {
894
+ Companion_getInstance_1().ensuringArgumentIsInstantiated_dpjvac_k$(_this__u8e3s4, 0);
895
+ Companion_getInstance_1().ensuringArgumentIsAtom_5kuj97_k$(_this__u8e3s4, 0);
896
+ var urlString = (isInterface(first, Atom) ? first : THROW_CCE()).get_value_j01efc_k$();
897
+ try {
898
+ var url = Companion_instance_15.of(urlString);
899
+ var text = url.readAsText();
900
+ return SetTheory_getInstance().setTheory$default_wxmulc_k$(_this__u8e3s4, text);
901
+ } catch ($p) {
902
+ if ($p instanceof InvalidUrlException) {
903
+ var e = $p;
904
+ throw e.toLogicError_rnao5t_k$(_this__u8e3s4.context, _this__u8e3s4.signature, first, 0);
905
+ } else {
906
+ if ($p instanceof IOException_0) {
907
+ var e_0 = $p;
908
+ throw e_0.toLogicError_33irru_k$(_this__u8e3s4.context);
909
+ } else {
910
+ throw $p;
911
+ }
912
+ }
913
+ }
914
+ };
915
+ protoOf(Consult).computeOne_2tedul_k$ = function (_this__u8e3s4, first) {
916
+ return this.computeOne_6dkmes_k$(_this__u8e3s4, first);
917
+ };
918
+ var Consult_instance;
919
+ function Consult_getInstance() {
920
+ if (Consult_instance == null)
921
+ new Consult();
922
+ return Consult_instance;
923
+ }
924
+ function CurrentCharConversion() {
925
+ CurrentCharConversion_instance = this;
926
+ NonBacktrackable.call(this, 'current_char_conversion');
927
+ }
928
+ protoOf(CurrentCharConversion).computeOne_sdv9lb_k$ = function (_this__u8e3s4, first, second) {
929
+ return Companion_getInstance_1().notSupported$default_bmg7vb_k$(_this__u8e3s4);
930
+ };
931
+ protoOf(CurrentCharConversion).computeOne_d8jipq_k$ = function (_this__u8e3s4, first, second) {
932
+ return this.computeOne_sdv9lb_k$(_this__u8e3s4, first, second);
933
+ };
934
+ var CurrentCharConversion_instance;
935
+ function CurrentCharConversion_getInstance() {
936
+ if (CurrentCharConversion_instance == null)
937
+ new CurrentCharConversion();
938
+ return CurrentCharConversion_instance;
939
+ }
940
+ function CurrentInput() {
941
+ CurrentInput_instance = this;
942
+ NonBacktrackable_0.call(this, 'current_input');
943
+ }
944
+ protoOf(CurrentInput).computeOne_6dkmes_k$ = function (_this__u8e3s4, first) {
945
+ var channel = IOPrimitiveUtils_getInstance().ensuringArgumentIsVarOrStream_l86imo_k$(_this__u8e3s4, 0);
946
+ // Inline function 'kotlin.let' call
947
+ var it = _this__u8e3s4.context.get_inputChannels_uyf05t_k$();
948
+ var tmp0_elvis_lhs = it.get_current_jwi6j4_k$();
949
+ var currentChannel = tmp0_elvis_lhs == null ? it.get_stdIn_iypyf3_k$() : tmp0_elvis_lhs;
950
+ return channel == null ? _this__u8e3s4.replyWith(Companion_getInstance_1().mgu_jyyt35_k$(_this__u8e3s4, first, currentChannel.get_streamTerm_v3iy6t_k$()), VOID, []) : equals(channel, currentChannel) ? _this__u8e3s4.replySuccess(VOID, VOID, []) : _this__u8e3s4.replyFail(VOID, []);
951
+ };
952
+ protoOf(CurrentInput).computeOne_2tedul_k$ = function (_this__u8e3s4, first) {
953
+ return this.computeOne_6dkmes_k$(_this__u8e3s4, first);
954
+ };
955
+ var CurrentInput_instance;
956
+ function CurrentInput_getInstance() {
957
+ if (CurrentInput_instance == null)
958
+ new CurrentInput();
959
+ return CurrentInput_instance;
960
+ }
961
+ function CurrentOutput() {
962
+ CurrentOutput_instance = this;
963
+ NonBacktrackable_0.call(this, 'current_output');
964
+ }
965
+ protoOf(CurrentOutput).computeOne_6dkmes_k$ = function (_this__u8e3s4, first) {
966
+ var channel = IOPrimitiveUtils_getInstance().ensuringArgumentIsVarOrStream_l86imo_k$(_this__u8e3s4, 0);
967
+ // Inline function 'kotlin.let' call
968
+ var it = _this__u8e3s4.context.get_outputChannels_ffvoca_k$();
969
+ var tmp0_elvis_lhs = it.get_current_jwi6j4_k$();
970
+ var currentChannel = tmp0_elvis_lhs == null ? it.get_stdOut_jngbw4_k$() : tmp0_elvis_lhs;
971
+ return channel == null ? _this__u8e3s4.replyWith(Companion_getInstance_1().mgu_jyyt35_k$(_this__u8e3s4, first, currentChannel.get_streamTerm_v3iy6t_k$()), VOID, []) : equals(channel, currentChannel) ? _this__u8e3s4.replySuccess(VOID, VOID, []) : _this__u8e3s4.replyFail(VOID, []);
972
+ };
973
+ protoOf(CurrentOutput).computeOne_2tedul_k$ = function (_this__u8e3s4, first) {
974
+ return this.computeOne_6dkmes_k$(_this__u8e3s4, first);
975
+ };
976
+ var CurrentOutput_instance;
977
+ function CurrentOutput_getInstance() {
978
+ if (CurrentOutput_instance == null)
979
+ new CurrentOutput();
980
+ return CurrentOutput_instance;
981
+ }
982
+ function FlushOutput() {
983
+ FlushOutput_instance = this;
984
+ NonBacktrackable_0.call(this, 'flush_output');
985
+ }
986
+ protoOf(FlushOutput).computeOne_6dkmes_k$ = function (_this__u8e3s4, first) {
987
+ var channel = IOPrimitiveUtils_getInstance().ensuringArgumentIsOutputChannel_kmdrtk_k$(_this__u8e3s4, 0);
988
+ var tmp;
989
+ try {
990
+ channel.flush();
991
+ tmp = _this__u8e3s4.replySuccess(VOID, VOID, []);
992
+ } catch ($p) {
993
+ var tmp_0;
994
+ if ($p instanceof IllegalStateException) {
995
+ var _unused_var__etf5q3 = $p;
996
+ tmp_0 = _this__u8e3s4.replyFail(VOID, []);
997
+ } else {
998
+ throw $p;
999
+ }
1000
+ tmp = tmp_0;
1001
+ }
1002
+ return tmp;
1003
+ };
1004
+ protoOf(FlushOutput).computeOne_2tedul_k$ = function (_this__u8e3s4, first) {
1005
+ return this.computeOne_6dkmes_k$(_this__u8e3s4, first);
1006
+ };
1007
+ var FlushOutput_instance;
1008
+ function FlushOutput_getInstance() {
1009
+ if (FlushOutput_instance == null)
1010
+ new FlushOutput();
1011
+ return FlushOutput_instance;
1012
+ }
1013
+ function GetByte1() {
1014
+ GetByte1_instance = this;
1015
+ NonBacktrackable_0.call(this, 'get_byte');
1016
+ }
1017
+ protoOf(GetByte1).computeOne_6dkmes_k$ = function (_this__u8e3s4, first) {
1018
+ return Companion_getInstance_1().notSupported$default_bmg7vb_k$(_this__u8e3s4);
1019
+ };
1020
+ protoOf(GetByte1).computeOne_2tedul_k$ = function (_this__u8e3s4, first) {
1021
+ return this.computeOne_6dkmes_k$(_this__u8e3s4, first);
1022
+ };
1023
+ var GetByte1_instance;
1024
+ function GetByte1_getInstance() {
1025
+ if (GetByte1_instance == null)
1026
+ new GetByte1();
1027
+ return GetByte1_instance;
1028
+ }
1029
+ function GetByte2() {
1030
+ GetByte2_instance = this;
1031
+ NonBacktrackable.call(this, 'get_byte');
1032
+ }
1033
+ protoOf(GetByte2).computeOne_sdv9lb_k$ = function (_this__u8e3s4, first, second) {
1034
+ return Companion_getInstance_1().notSupported$default_bmg7vb_k$(_this__u8e3s4);
1035
+ };
1036
+ protoOf(GetByte2).computeOne_d8jipq_k$ = function (_this__u8e3s4, first, second) {
1037
+ return this.computeOne_sdv9lb_k$(_this__u8e3s4, first, second);
1038
+ };
1039
+ var GetByte2_instance;
1040
+ function GetByte2_getInstance() {
1041
+ if (GetByte2_instance == null)
1042
+ new GetByte2();
1043
+ return GetByte2_instance;
1044
+ }
1045
+ function GetChar1() {
1046
+ GetChar1_instance = this;
1047
+ NonBacktrackable_0.call(this, 'get_char');
1048
+ }
1049
+ protoOf(GetChar1).computeOne_6dkmes_k$ = function (_this__u8e3s4, first) {
1050
+ IOPrimitiveUtils_getInstance().ensuringArgumentIsVarOrChar_zdzofu_k$(_this__u8e3s4, 0);
1051
+ return IOPrimitiveUtils_getInstance().readCharAndReply_szx3md_k$(_this__u8e3s4, IOPrimitiveUtils_getInstance().get_currentInputChannel_31908p_k$(_this__u8e3s4), first);
1052
+ };
1053
+ protoOf(GetChar1).computeOne_2tedul_k$ = function (_this__u8e3s4, first) {
1054
+ return this.computeOne_6dkmes_k$(_this__u8e3s4, first);
1055
+ };
1056
+ var GetChar1_instance;
1057
+ function GetChar1_getInstance() {
1058
+ if (GetChar1_instance == null)
1059
+ new GetChar1();
1060
+ return GetChar1_instance;
1061
+ }
1062
+ function GetChar2() {
1063
+ GetChar2_instance = this;
1064
+ NonBacktrackable.call(this, 'get_char');
1065
+ }
1066
+ protoOf(GetChar2).computeOne_sdv9lb_k$ = function (_this__u8e3s4, first, second) {
1067
+ var channel = IOPrimitiveUtils_getInstance().ensuringArgumentIsInputChannel_w9cvb1_k$(_this__u8e3s4, 0);
1068
+ IOPrimitiveUtils_getInstance().ensuringArgumentIsVarOrChar_zdzofu_k$(_this__u8e3s4, 1);
1069
+ return IOPrimitiveUtils_getInstance().readCharAndReply_szx3md_k$(_this__u8e3s4, channel, second);
1070
+ };
1071
+ protoOf(GetChar2).computeOne_d8jipq_k$ = function (_this__u8e3s4, first, second) {
1072
+ return this.computeOne_sdv9lb_k$(_this__u8e3s4, first, second);
1073
+ };
1074
+ var GetChar2_instance;
1075
+ function GetChar2_getInstance() {
1076
+ if (GetChar2_instance == null)
1077
+ new GetChar2();
1078
+ return GetChar2_instance;
1079
+ }
1080
+ function GetCode1() {
1081
+ GetCode1_instance = this;
1082
+ NonBacktrackable_0.call(this, 'get_code');
1083
+ }
1084
+ protoOf(GetCode1).computeOne_6dkmes_k$ = function (_this__u8e3s4, first) {
1085
+ IOPrimitiveUtils_getInstance().ensuringArgumentIsVarOrCharCode_tmh0sz_k$(_this__u8e3s4, 0);
1086
+ return IOPrimitiveUtils_getInstance().readCodeAndReply_m7r1zg_k$(_this__u8e3s4, IOPrimitiveUtils_getInstance().get_currentInputChannel_31908p_k$(_this__u8e3s4), first);
1087
+ };
1088
+ protoOf(GetCode1).computeOne_2tedul_k$ = function (_this__u8e3s4, first) {
1089
+ return this.computeOne_6dkmes_k$(_this__u8e3s4, first);
1090
+ };
1091
+ var GetCode1_instance;
1092
+ function GetCode1_getInstance() {
1093
+ if (GetCode1_instance == null)
1094
+ new GetCode1();
1095
+ return GetCode1_instance;
1096
+ }
1097
+ function GetCode2() {
1098
+ GetCode2_instance = this;
1099
+ NonBacktrackable.call(this, 'get_code');
1100
+ }
1101
+ protoOf(GetCode2).computeOne_sdv9lb_k$ = function (_this__u8e3s4, first, second) {
1102
+ var channel = IOPrimitiveUtils_getInstance().ensuringArgumentIsInputChannel_w9cvb1_k$(_this__u8e3s4, 0);
1103
+ IOPrimitiveUtils_getInstance().ensuringArgumentIsVarOrCharCode_tmh0sz_k$(_this__u8e3s4, 1);
1104
+ return IOPrimitiveUtils_getInstance().readCodeAndReply_m7r1zg_k$(_this__u8e3s4, channel, second);
1105
+ };
1106
+ protoOf(GetCode2).computeOne_d8jipq_k$ = function (_this__u8e3s4, first, second) {
1107
+ return this.computeOne_sdv9lb_k$(_this__u8e3s4, first, second);
1108
+ };
1109
+ var GetCode2_instance;
1110
+ function GetCode2_getInstance() {
1111
+ if (GetCode2_instance == null)
1112
+ new GetCode2();
1113
+ return GetCode2_instance;
1114
+ }
1115
+ function IOPrimitiveUtils$propertiesOf$slambda$lambda(it) {
1116
+ return it === '$current';
1117
+ }
1118
+ function IOPrimitiveUtils$alias$ref(p0) {
1119
+ return constructCallableReference(function (p0_0) {
1120
+ var tmp0 = p0;
1121
+ return alias(tmp0, p0_0);
1122
+ }, 1, 0, 113, 'alias', [p0]);
1123
+ }
1124
+ function IOPrimitiveUtils$propertiesOf$slambda$lambda_0(it) {
1125
+ return it === '$current';
1126
+ }
1127
+ function _get_INPUT_STREAM_TERM_PATTERN__5fd8p6($this) {
1128
+ var tmp0 = $this.INPUT_STREAM_TERM_PATTERN$delegate_1;
1129
+ var tmp = KProperty1;
1130
+ // Inline function 'kotlin.getValue' call
1131
+ getPropertyCallableRef('INPUT_STREAM_TERM_PATTERN', 1, tmp, IOPrimitiveUtils$_get_INPUT_STREAM_TERM_PATTERN_$ref_59oxnp(), null);
1132
+ return tmp0.get_value_j01efc_k$();
1133
+ }
1134
+ function _get_OUTPUT_STREAM_TERM_PATTERN__4vocxf($this) {
1135
+ var tmp0 = $this.OUTPUT_STREAM_TERM_PATTERN$delegate_1;
1136
+ var tmp = KProperty1;
1137
+ // Inline function 'kotlin.getValue' call
1138
+ getPropertyCallableRef('OUTPUT_STREAM_TERM_PATTERN', 1, tmp, IOPrimitiveUtils$_get_OUTPUT_STREAM_TERM_PATTERN_$ref_kcdkmo(), null);
1139
+ return tmp0.get_value_j01efc_k$();
1140
+ }
1141
+ function _get_PROPERTY_TYPE_PATTERN__5nq864($this) {
1142
+ var tmp0 = $this.PROPERTY_TYPE_PATTERN$delegate_1;
1143
+ var tmp = KProperty1;
1144
+ // Inline function 'kotlin.getValue' call
1145
+ getPropertyCallableRef('PROPERTY_TYPE_PATTERN', 1, tmp, IOPrimitiveUtils$_get_PROPERTY_TYPE_PATTERN_$ref_qcyh3d(), null);
1146
+ return tmp0.get_value_j01efc_k$();
1147
+ }
1148
+ function _get_PROPERTY_REPOSITION_PATTERN__lznuii($this) {
1149
+ var tmp0 = $this.PROPERTY_REPOSITION_PATTERN$delegate_1;
1150
+ var tmp = KProperty1;
1151
+ // Inline function 'kotlin.getValue' call
1152
+ getPropertyCallableRef('PROPERTY_REPOSITION_PATTERN', 1, tmp, IOPrimitiveUtils$_get_PROPERTY_REPOSITION_PATTERN_$ref_uil93p(), null);
1153
+ return tmp0.get_value_j01efc_k$();
1154
+ }
1155
+ function _get_PROPERTY_EOF_ACTION_PATTERN__8k2shv($this) {
1156
+ var tmp0 = $this.PROPERTY_EOF_ACTION_PATTERN$delegate_1;
1157
+ var tmp = KProperty1;
1158
+ // Inline function 'kotlin.getValue' call
1159
+ getPropertyCallableRef('PROPERTY_EOF_ACTION_PATTERN', 1, tmp, IOPrimitiveUtils$_get_PROPERTY_EOF_ACTION_PATTERN_$ref_bt8ai0(), null);
1160
+ return tmp0.get_value_j01efc_k$();
1161
+ }
1162
+ function _get_PROPERTY_ALIAS_PATTERN__wipd2s($this) {
1163
+ var tmp0 = $this.PROPERTY_ALIAS_PATTERN$delegate_1;
1164
+ var tmp = KProperty1;
1165
+ // Inline function 'kotlin.getValue' call
1166
+ getPropertyCallableRef('PROPERTY_ALIAS_PATTERN', 1, tmp, IOPrimitiveUtils$_get_PROPERTY_ALIAS_PATTERN_$ref_qs5lfb(), null);
1167
+ return tmp0.get_value_j01efc_k$();
1168
+ }
1169
+ function _get_PROPERTY_INPUT__z2zr91($this) {
1170
+ var tmp0 = $this.PROPERTY_INPUT$delegate_1;
1171
+ var tmp = KProperty1;
1172
+ // Inline function 'kotlin.getValue' call
1173
+ getPropertyCallableRef('PROPERTY_INPUT', 1, tmp, IOPrimitiveUtils$_get_PROPERTY_INPUT_$ref_hltzoy(), null);
1174
+ return tmp0.get_value_j01efc_k$();
1175
+ }
1176
+ function _get_PROPERTY_OUTPUT__1pem9m($this) {
1177
+ var tmp0 = $this.PROPERTY_OUTPUT$delegate_1;
1178
+ var tmp = KProperty1;
1179
+ // Inline function 'kotlin.getValue' call
1180
+ getPropertyCallableRef('PROPERTY_OUTPUT', 1, tmp, IOPrimitiveUtils$_get_PROPERTY_OUTPUT_$ref_9ccgyp(), null);
1181
+ return tmp0.get_value_j01efc_k$();
1182
+ }
1183
+ function _get_PROPERTY_TYPE_TEXT__9rpcwt($this) {
1184
+ var tmp0 = $this.PROPERTY_TYPE_TEXT$delegate_1;
1185
+ var tmp = KProperty1;
1186
+ // Inline function 'kotlin.getValue' call
1187
+ getPropertyCallableRef('PROPERTY_TYPE_TEXT', 1, tmp, IOPrimitiveUtils$_get_PROPERTY_TYPE_TEXT_$ref_47hbty(), null);
1188
+ return tmp0.get_value_j01efc_k$();
1189
+ }
1190
+ function _get_PROPERTY_REPOSITION_FALSE__i73t3b($this) {
1191
+ var tmp0 = $this.PROPERTY_REPOSITION_FALSE$delegate_1;
1192
+ var tmp = KProperty1;
1193
+ // Inline function 'kotlin.getValue' call
1194
+ getPropertyCallableRef('PROPERTY_REPOSITION_FALSE', 1, tmp, IOPrimitiveUtils$_get_PROPERTY_REPOSITION_FALSE_$ref_jx0m6(), null);
1195
+ return tmp0.get_value_j01efc_k$();
1196
+ }
1197
+ function _get_PROPERTY_EOF_ACTION_EOF_CODE__he3pvl($this) {
1198
+ var tmp0 = $this.PROPERTY_EOF_ACTION_EOF_CODE$delegate_1;
1199
+ var tmp = KProperty1;
1200
+ // Inline function 'kotlin.getValue' call
1201
+ getPropertyCallableRef('PROPERTY_EOF_ACTION_EOF_CODE', 1, tmp, IOPrimitiveUtils$_get_PROPERTY_EOF_ACTION_EOF_CODE_$ref_1cwy66(), null);
1202
+ return tmp0.get_value_j01efc_k$();
1203
+ }
1204
+ function _get_OPTION_QUOTED_PATTERN__n2ri42($this) {
1205
+ var tmp0 = $this.OPTION_QUOTED_PATTERN$delegate_1;
1206
+ var tmp = KProperty1;
1207
+ // Inline function 'kotlin.getValue' call
1208
+ getPropertyCallableRef('OPTION_QUOTED_PATTERN', 1, tmp, IOPrimitiveUtils$_get_OPTION_QUOTED_PATTERN_$ref_nxjfbr(), null);
1209
+ return tmp0.get_value_j01efc_k$();
1210
+ }
1211
+ function _get_OPTION_NUMBER_VARS_PATTERN__p98ste($this) {
1212
+ var tmp0 = $this.OPTION_NUMBER_VARS_PATTERN$delegate_1;
1213
+ var tmp = KProperty1;
1214
+ // Inline function 'kotlin.getValue' call
1215
+ getPropertyCallableRef('OPTION_NUMBER_VARS_PATTERN', 1, tmp, IOPrimitiveUtils$_get_OPTION_NUMBER_VARS_PATTERN_$ref_pdk9ph(), null);
1216
+ return tmp0.get_value_j01efc_k$();
1217
+ }
1218
+ function _get_OPTION_IGNORE_OPS_PATTERN__cpse4v($this) {
1219
+ var tmp0 = $this.OPTION_IGNORE_OPS_PATTERN$delegate_1;
1220
+ var tmp = KProperty1;
1221
+ // Inline function 'kotlin.getValue' call
1222
+ getPropertyCallableRef('OPTION_IGNORE_OPS_PATTERN', 1, tmp, IOPrimitiveUtils$_get_OPTION_IGNORE_OPS_PATTERN_$ref_vvsa9g(), null);
1223
+ return tmp0.get_value_j01efc_k$();
1224
+ }
1225
+ function _get_INFO_VARIABLES_PATTERN__bhp1h0($this) {
1226
+ var tmp0 = $this.INFO_VARIABLES_PATTERN$delegate_1;
1227
+ var tmp = KProperty1;
1228
+ // Inline function 'kotlin.getValue' call
1229
+ getPropertyCallableRef('INFO_VARIABLES_PATTERN', 1, tmp, IOPrimitiveUtils$_get_INFO_VARIABLES_PATTERN_$ref_ih2rd5(), null);
1230
+ return tmp0.get_value_j01efc_k$();
1231
+ }
1232
+ function _get_INFO_VARIABLE_NAMES_PATTERN__j3oaom($this) {
1233
+ var tmp0 = $this.INFO_VARIABLE_NAMES_PATTERN$delegate_1;
1234
+ var tmp = KProperty1;
1235
+ // Inline function 'kotlin.getValue' call
1236
+ getPropertyCallableRef('INFO_VARIABLE_NAMES_PATTERN', 1, tmp, IOPrimitiveUtils$_get_INFO_VARIABLE_NAMES_PATTERN_$ref_lzmk91(), null);
1237
+ return tmp0.get_value_j01efc_k$();
1238
+ }
1239
+ function _get_INFO_SINGLETONS_PATTERN__y21s87($this) {
1240
+ var tmp0 = $this.INFO_SINGLETONS_PATTERN$delegate_1;
1241
+ var tmp = KProperty1;
1242
+ // Inline function 'kotlin.getValue' call
1243
+ getPropertyCallableRef('INFO_SINGLETONS_PATTERN', 1, tmp, IOPrimitiveUtils$_get_INFO_SINGLETONS_PATTERN_$ref_8msi4i(), null);
1244
+ return tmp0.get_value_j01efc_k$();
1245
+ }
1246
+ function _get_validPropertiesPattern__7s1t06($this) {
1247
+ return sequenceOf([_get_PROPERTY_INPUT__z2zr91($this), _get_PROPERTY_OUTPUT__1pem9m($this), _get_PROPERTY_ALIAS_PATTERN__wipd2s($this), _get_PROPERTY_TYPE_PATTERN__5nq864($this), _get_PROPERTY_EOF_ACTION_PATTERN__8k2shv($this), _get_PROPERTY_REPOSITION_PATTERN__lznuii($this)]);
1248
+ }
1249
+ function _get_validOptionsPattern__akhsd9($this) {
1250
+ var tmp = IOPrimitiveUtils$quoted$ref($this);
1251
+ var tmp_0 = IOPrimitiveUtils$ignoreOps$ref($this);
1252
+ var tmp_1 = sequenceOf([tmp, tmp_0, IOPrimitiveUtils$numberVars$ref($this)]);
1253
+ return flatMap(tmp_1, IOPrimitiveUtils$_get_validOptionsPattern_$lambda_r088xw);
1254
+ }
1255
+ function _get_validInfoPattern__dtwgth($this) {
1256
+ return sequenceOf([_get_INFO_VARIABLES_PATTERN__bhp1h0($this), _get_INFO_VARIABLE_NAMES_PATTERN__j3oaom($this), _get_INFO_SINGLETONS_PATTERN__y21s87($this)]);
1257
+ }
1258
+ function _get_supportedPropertiesPattern__x8u7bw($this) {
1259
+ return sequenceOf([_get_PROPERTY_INPUT__z2zr91($this), _get_PROPERTY_OUTPUT__1pem9m($this), _get_PROPERTY_ALIAS_PATTERN__wipd2s($this), _get_PROPERTY_TYPE_TEXT__9rpcwt($this), _get_PROPERTY_EOF_ACTION_EOF_CODE__he3pvl($this), _get_PROPERTY_REPOSITION_FALSE__i73t3b($this)]);
1260
+ }
1261
+ function alias($this, alias) {
1262
+ alias = alias === VOID ? null : alias;
1263
+ var tmp = Companion_getInstance_2();
1264
+ var tmp_0;
1265
+ if (alias == null) {
1266
+ tmp_0 = null;
1267
+ } else {
1268
+ // Inline function 'kotlin.let' call
1269
+ tmp_0 = Companion_getInstance_0().of(alias);
1270
+ }
1271
+ var tmp1_elvis_lhs = tmp_0;
1272
+ return tmp.of('alias', [tmp1_elvis_lhs == null ? Companion_getInstance_3().anonymous() : tmp1_elvis_lhs]);
1273
+ }
1274
+ function quoted($this, value) {
1275
+ value = value === VOID ? null : value;
1276
+ var tmp = Companion_getInstance_2();
1277
+ var tmp_0;
1278
+ if (value == null) {
1279
+ tmp_0 = null;
1280
+ } else {
1281
+ // Inline function 'kotlin.let' call
1282
+ tmp_0 = Companion_getInstance_4().of(value);
1283
+ }
1284
+ var tmp1_elvis_lhs = tmp_0;
1285
+ return tmp.of('quoted', [tmp1_elvis_lhs == null ? Companion_getInstance_3().anonymous() : tmp1_elvis_lhs]);
1286
+ }
1287
+ function ignoreOps($this, value) {
1288
+ value = value === VOID ? null : value;
1289
+ var tmp = Companion_getInstance_2();
1290
+ var tmp_0;
1291
+ if (value == null) {
1292
+ tmp_0 = null;
1293
+ } else {
1294
+ // Inline function 'kotlin.let' call
1295
+ tmp_0 = Companion_getInstance_4().of(value);
1296
+ }
1297
+ var tmp1_elvis_lhs = tmp_0;
1298
+ return tmp.of('ignore_ops', [tmp1_elvis_lhs == null ? Companion_getInstance_3().anonymous() : tmp1_elvis_lhs]);
1299
+ }
1300
+ function numberVars($this, value) {
1301
+ value = value === VOID ? null : value;
1302
+ var tmp = Companion_getInstance_2();
1303
+ var tmp_0;
1304
+ if (value == null) {
1305
+ tmp_0 = null;
1306
+ } else {
1307
+ // Inline function 'kotlin.let' call
1308
+ tmp_0 = Companion_getInstance_4().of(value);
1309
+ }
1310
+ var tmp1_elvis_lhs = tmp_0;
1311
+ return tmp.of('numbervars', [tmp1_elvis_lhs == null ? Companion_getInstance_3().anonymous() : tmp1_elvis_lhs]);
1312
+ }
1313
+ function variables($this, variables) {
1314
+ variables = variables === VOID ? null : variables;
1315
+ var tmp = Companion_getInstance_2();
1316
+ var tmp_0;
1317
+ if (variables == null) {
1318
+ tmp_0 = null;
1319
+ } else {
1320
+ // Inline function 'kotlin.let' call
1321
+ tmp_0 = Companion_instance_4.ofList(variables);
1322
+ }
1323
+ var tmp1_elvis_lhs = tmp_0;
1324
+ return tmp.of('variables', [tmp1_elvis_lhs == null ? Companion_getInstance_3().anonymous() : tmp1_elvis_lhs]);
1325
+ }
1326
+ function vn($this, functor, vNames) {
1327
+ vNames = vNames === VOID ? null : vNames;
1328
+ var tmp = Companion_getInstance_2();
1329
+ var tmp_0;
1330
+ if (vNames == null) {
1331
+ tmp_0 = null;
1332
+ } else {
1333
+ // Inline function 'kotlin.collections.map' call
1334
+ // Inline function 'kotlin.collections.mapTo' call
1335
+ var destination = ArrayList_init_$Create$(collectionSizeOrDefault(vNames, 10));
1336
+ var _iterator__ex2g4s = vNames.iterator_jk1svi_k$();
1337
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
1338
+ var item = _iterator__ex2g4s.next_20eer_k$();
1339
+ var a = item.component1_7eebsc_k$();
1340
+ var v = item.component2_7eebsb_k$();
1341
+ var tmp$ret$2 = Companion_getInstance_2().of('=', [a, v]);
1342
+ destination.add_utx5q5_k$(tmp$ret$2);
1343
+ }
1344
+ tmp_0 = destination;
1345
+ }
1346
+ var tmp1_safe_receiver = tmp_0;
1347
+ var tmp_1;
1348
+ if (tmp1_safe_receiver == null) {
1349
+ tmp_1 = null;
1350
+ } else {
1351
+ // Inline function 'kotlin.let' call
1352
+ tmp_1 = Companion_instance_4.ofList(tmp1_safe_receiver);
1353
+ }
1354
+ var tmp2_elvis_lhs = tmp_1;
1355
+ return tmp.of(functor, [tmp2_elvis_lhs == null ? Companion_getInstance_3().anonymous() : tmp2_elvis_lhs]);
1356
+ }
1357
+ function variableNames($this, vNames) {
1358
+ vNames = vNames === VOID ? null : vNames;
1359
+ return vn($this, 'variable_names', vNames);
1360
+ }
1361
+ function singletons($this, vNames) {
1362
+ vNames = vNames === VOID ? null : vNames;
1363
+ return vn($this, 'singletons', vNames);
1364
+ }
1365
+ function getOption($this, $receiver, unificator, pattern) {
1366
+ // Inline function 'kotlin.sequences.filterIsInstance' call
1367
+ var this_0 = asSequence($receiver);
1368
+ var tmp = filter(this_0, IOPrimitiveUtils$getOption$lambda);
1369
+ var tmp_0 = isInterface(tmp, Sequence) ? tmp : THROW_CCE();
1370
+ var tmp_1 = filter(tmp_0, IOPrimitiveUtils$getOption$lambda_0(unificator, pattern));
1371
+ // Inline function 'kotlin.sequences.filterIsInstance' call
1372
+ var this_1 = map(tmp_1, IOPrimitiveUtils$getOption$lambda_1);
1373
+ var tmp_2 = filter(this_1, IOPrimitiveUtils$getOption$lambda_2);
1374
+ var tmp_3 = isInterface(tmp_2, Sequence) ? tmp_2 : THROW_CCE();
1375
+ var tmp0_elvis_lhs = firstOrNull(map(tmp_3, IOPrimitiveUtils$getOption$lambda_3));
1376
+ return tmp0_elvis_lhs == null ? false : tmp0_elvis_lhs;
1377
+ }
1378
+ function getInfo($this, $receiver, unificator, pattern, value) {
1379
+ // Inline function 'kotlin.sequences.filterIsInstance' call
1380
+ var this_0 = asSequence($receiver);
1381
+ var tmp = filter(this_0, IOPrimitiveUtils$getInfo$lambda);
1382
+ var tmp0 = isInterface(tmp, Sequence) ? tmp : THROW_CCE();
1383
+ var tmp$ret$1;
1384
+ $l$block: {
1385
+ // Inline function 'kotlin.sequences.firstOrNull' call
1386
+ var _iterator__ex2g4s = tmp0.iterator_jk1svi_k$();
1387
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
1388
+ var element = _iterator__ex2g4s.next_20eer_k$();
1389
+ if (unificator.match(pattern, element)) {
1390
+ tmp$ret$1 = element;
1391
+ break $l$block;
1392
+ }
1393
+ }
1394
+ tmp$ret$1 = null;
1395
+ }
1396
+ var tmp0_safe_receiver = tmp$ret$1;
1397
+ var tmp_0;
1398
+ if (tmp0_safe_receiver == null) {
1399
+ tmp_0 = null;
1400
+ } else {
1401
+ // Inline function 'kotlin.let' call
1402
+ tmp_0 = unificator.mgu(tmp0_safe_receiver, value);
1403
+ }
1404
+ var tmp1_elvis_lhs = tmp_0;
1405
+ return tmp1_elvis_lhs == null ? Companion_getInstance_5().empty() : tmp1_elvis_lhs;
1406
+ }
1407
+ function _get_singletons__bihqrn($this, $receiver) {
1408
+ // Inline function 'kotlin.sequences.groupBy' call
1409
+ var tmp0 = $receiver.get_variables_75f0zy_k$();
1410
+ // Inline function 'kotlin.sequences.groupByTo' call
1411
+ var destination = LinkedHashMap_init_$Create$();
1412
+ var _iterator__ex2g4s = tmp0.iterator_jk1svi_k$();
1413
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
1414
+ var element = _iterator__ex2g4s.next_20eer_k$();
1415
+ var key = element;
1416
+ // Inline function 'kotlin.collections.getOrPut' call
1417
+ var value = destination.get_wei43m_k$(key);
1418
+ var tmp;
1419
+ if (value == null) {
1420
+ var answer = ArrayList_init_$Create$_0();
1421
+ destination.put_4fpzoq_k$(key, answer);
1422
+ tmp = answer;
1423
+ } else {
1424
+ tmp = value;
1425
+ }
1426
+ var list = tmp;
1427
+ list.add_utx5q5_k$(element);
1428
+ }
1429
+ var tmp_0 = asSequence_0(destination);
1430
+ var tmp_1 = filter(tmp_0, IOPrimitiveUtils$_get_singletons_$lambda_kke618);
1431
+ return toSet(map(tmp_1, IOPrimitiveUtils$_get_singletons_$lambda_kke618_0));
1432
+ }
1433
+ function toAssignments($this, $receiver) {
1434
+ return toAssignments_0($this, asSequence($receiver));
1435
+ }
1436
+ function toAssignments_0($this, $receiver) {
1437
+ // Inline function 'kotlin.sequences.groupBy' call
1438
+ // Inline function 'kotlin.sequences.groupByTo' call
1439
+ var destination = LinkedHashMap_init_$Create$();
1440
+ var _iterator__ex2g4s = $receiver.iterator_jk1svi_k$();
1441
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
1442
+ var element = _iterator__ex2g4s.next_20eer_k$();
1443
+ var key = Companion_getInstance_0().of(element.get_name_woqyms_k$());
1444
+ // Inline function 'kotlin.collections.getOrPut' call
1445
+ var value = destination.get_wei43m_k$(key);
1446
+ var tmp;
1447
+ if (value == null) {
1448
+ var answer = ArrayList_init_$Create$_0();
1449
+ destination.put_4fpzoq_k$(key, answer);
1450
+ tmp = answer;
1451
+ } else {
1452
+ tmp = value;
1453
+ }
1454
+ var list = tmp;
1455
+ list.add_utx5q5_k$(element);
1456
+ }
1457
+ // Inline function 'kotlin.collections.flatMap' call
1458
+ // Inline function 'kotlin.collections.flatMapTo' call
1459
+ var destination_0 = ArrayList_init_$Create$_0();
1460
+ // Inline function 'kotlin.collections.iterator' call
1461
+ var _iterator__ex2g4s_0 = destination.get_entries_p20ztl_k$().iterator_jk1svi_k$();
1462
+ while (_iterator__ex2g4s_0.hasNext_bitz1p_k$()) {
1463
+ var element_0 = _iterator__ex2g4s_0.next_20eer_k$();
1464
+ // Inline function 'kotlin.collections.component1' call
1465
+ var n = element_0.get_key_18j28a_k$();
1466
+ // Inline function 'kotlin.collections.component2' call
1467
+ var vs = element_0.get_value_j01efc_k$();
1468
+ var tmp_0 = asSequence(vs);
1469
+ var list_0 = map(tmp_0, IOPrimitiveUtils$toAssignments$lambda(n));
1470
+ addAll(destination_0, list_0);
1471
+ }
1472
+ return toList(destination_0);
1473
+ }
1474
+ function _get_alias__jw26bj($this, $receiver) {
1475
+ var tmp0_safe_receiver = (!($receiver == null) ? isInterface($receiver, Struct) : false) ? $receiver : null;
1476
+ var tmp = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.getArgAt(0);
1477
+ var tmp1_safe_receiver = (!(tmp == null) ? isInterface(tmp, Atom) : false) ? tmp : null;
1478
+ return tmp1_safe_receiver == null ? null : tmp1_safe_receiver.get_value_j01efc_k$();
1479
+ }
1480
+ function replyOpeningStream($this, $receiver, channel, third, alias) {
1481
+ alias = alias === VOID ? null : alias;
1482
+ var streamTerm = channel.get_streamTerm_v3iy6t_k$();
1483
+ var tmp = Companion_getInstance_1().mgu_jyyt35_k$($receiver, third, streamTerm);
1484
+ return $receiver.replyWithBuildingSideEffects(tmp, VOID, IOPrimitiveUtils$replyOpeningStream$lambda(alias, channel));
1485
+ }
1486
+ function replyOpeningStream_0($this, $receiver, channel, third, alias) {
1487
+ alias = alias === VOID ? null : alias;
1488
+ var streamTerm = channel.get_streamTerm_v3iy6t_k$();
1489
+ var tmp = Companion_getInstance_1().mgu_jyyt35_k$($receiver, third, streamTerm);
1490
+ return $receiver.replyWithBuildingSideEffects(tmp, VOID, IOPrimitiveUtils$replyOpeningStream$lambda_0(alias, channel));
1491
+ }
1492
+ function IOPrimitiveUtils$INPUT_STREAM_TERM_PATTERN$delegate$lambda() {
1493
+ return Companion_instance.streamTerm();
1494
+ }
1495
+ function IOPrimitiveUtils$_get_INPUT_STREAM_TERM_PATTERN_$ref_59oxnp() {
1496
+ return constructCallableReference(function (p0) {
1497
+ return _get_INPUT_STREAM_TERM_PATTERN__5fd8p6(p0);
1498
+ }, 1, 0, 114);
1499
+ }
1500
+ function IOPrimitiveUtils$OUTPUT_STREAM_TERM_PATTERN$delegate$lambda() {
1501
+ return Companion_instance_5.streamTerm();
1502
+ }
1503
+ function IOPrimitiveUtils$_get_OUTPUT_STREAM_TERM_PATTERN_$ref_kcdkmo() {
1504
+ return constructCallableReference(function (p0) {
1505
+ return _get_OUTPUT_STREAM_TERM_PATTERN__4vocxf(p0);
1506
+ }, 1, 0, 115);
1507
+ }
1508
+ function IOPrimitiveUtils$PROPERTY_TYPE_PATTERN$delegate$lambda() {
1509
+ return Companion_getInstance_2().of('type', [Companion_getInstance_3().anonymous()]);
1510
+ }
1511
+ function IOPrimitiveUtils$_get_PROPERTY_TYPE_PATTERN_$ref_qcyh3d() {
1512
+ return constructCallableReference(function (p0) {
1513
+ return _get_PROPERTY_TYPE_PATTERN__5nq864(p0);
1514
+ }, 1, 0, 116);
1515
+ }
1516
+ function IOPrimitiveUtils$PROPERTY_REPOSITION_PATTERN$delegate$lambda() {
1517
+ return Companion_getInstance_2().of('reposition', [Companion_getInstance_3().anonymous()]);
1518
+ }
1519
+ function IOPrimitiveUtils$_get_PROPERTY_REPOSITION_PATTERN_$ref_uil93p() {
1520
+ return constructCallableReference(function (p0) {
1521
+ return _get_PROPERTY_REPOSITION_PATTERN__lznuii(p0);
1522
+ }, 1, 0, 117);
1523
+ }
1524
+ function IOPrimitiveUtils$PROPERTY_EOF_ACTION_PATTERN$delegate$lambda() {
1525
+ return Companion_getInstance_2().of('eof_action', [Companion_getInstance_3().anonymous()]);
1526
+ }
1527
+ function IOPrimitiveUtils$_get_PROPERTY_EOF_ACTION_PATTERN_$ref_bt8ai0() {
1528
+ return constructCallableReference(function (p0) {
1529
+ return _get_PROPERTY_EOF_ACTION_PATTERN__8k2shv(p0);
1530
+ }, 1, 0, 118);
1531
+ }
1532
+ function IOPrimitiveUtils$PROPERTY_ALIAS_PATTERN$delegate$lambda() {
1533
+ return alias(IOPrimitiveUtils_getInstance());
1534
+ }
1535
+ function IOPrimitiveUtils$_get_PROPERTY_ALIAS_PATTERN_$ref_qs5lfb() {
1536
+ return constructCallableReference(function (p0) {
1537
+ return _get_PROPERTY_ALIAS_PATTERN__wipd2s(p0);
1538
+ }, 1, 0, 119);
1539
+ }
1540
+ function IOPrimitiveUtils$PROPERTY_INPUT$delegate$lambda() {
1541
+ return Companion_getInstance_0().of('input');
1542
+ }
1543
+ function IOPrimitiveUtils$_get_PROPERTY_INPUT_$ref_hltzoy() {
1544
+ return constructCallableReference(function (p0) {
1545
+ return _get_PROPERTY_INPUT__z2zr91(p0);
1546
+ }, 1, 0, 120);
1547
+ }
1548
+ function IOPrimitiveUtils$PROPERTY_OUTPUT$delegate$lambda() {
1549
+ return Companion_getInstance_0().of('output');
1550
+ }
1551
+ function IOPrimitiveUtils$_get_PROPERTY_OUTPUT_$ref_9ccgyp() {
1552
+ return constructCallableReference(function (p0) {
1553
+ return _get_PROPERTY_OUTPUT__1pem9m(p0);
1554
+ }, 1, 0, 121);
1555
+ }
1556
+ function IOPrimitiveUtils$PROPERTY_TYPE_TEXT$delegate$lambda() {
1557
+ return Companion_getInstance_2().of('type', [Companion_getInstance_0().of('text')]);
1558
+ }
1559
+ function IOPrimitiveUtils$_get_PROPERTY_TYPE_TEXT_$ref_47hbty() {
1560
+ return constructCallableReference(function (p0) {
1561
+ return _get_PROPERTY_TYPE_TEXT__9rpcwt(p0);
1562
+ }, 1, 0, 122);
1563
+ }
1564
+ function IOPrimitiveUtils$PROPERTY_REPOSITION_FALSE$delegate$lambda() {
1565
+ return Companion_getInstance_2().of('reposition', [Companion_getInstance_4().FALSE_1]);
1566
+ }
1567
+ function IOPrimitiveUtils$_get_PROPERTY_REPOSITION_FALSE_$ref_jx0m6() {
1568
+ return constructCallableReference(function (p0) {
1569
+ return _get_PROPERTY_REPOSITION_FALSE__i73t3b(p0);
1570
+ }, 1, 0, 123);
1571
+ }
1572
+ function IOPrimitiveUtils$PROPERTY_EOF_ACTION_EOF_CODE$delegate$lambda() {
1573
+ return Companion_getInstance_2().of('eof_action', [Companion_getInstance_0().of('eof_code')]);
1574
+ }
1575
+ function IOPrimitiveUtils$_get_PROPERTY_EOF_ACTION_EOF_CODE_$ref_1cwy66() {
1576
+ return constructCallableReference(function (p0) {
1577
+ return _get_PROPERTY_EOF_ACTION_EOF_CODE__he3pvl(p0);
1578
+ }, 1, 0, 124);
1579
+ }
1580
+ function IOPrimitiveUtils$OPTION_QUOTED_PATTERN$delegate$lambda() {
1581
+ return quoted(IOPrimitiveUtils_getInstance());
1582
+ }
1583
+ function IOPrimitiveUtils$_get_OPTION_QUOTED_PATTERN_$ref_nxjfbr() {
1584
+ return constructCallableReference(function (p0) {
1585
+ return _get_OPTION_QUOTED_PATTERN__n2ri42(p0);
1586
+ }, 1, 0, 125);
1587
+ }
1588
+ function IOPrimitiveUtils$OPTION_NUMBER_VARS_PATTERN$delegate$lambda() {
1589
+ return numberVars(IOPrimitiveUtils_getInstance());
1590
+ }
1591
+ function IOPrimitiveUtils$_get_OPTION_NUMBER_VARS_PATTERN_$ref_pdk9ph() {
1592
+ return constructCallableReference(function (p0) {
1593
+ return _get_OPTION_NUMBER_VARS_PATTERN__p98ste(p0);
1594
+ }, 1, 0, 126);
1595
+ }
1596
+ function IOPrimitiveUtils$OPTION_IGNORE_OPS_PATTERN$delegate$lambda() {
1597
+ return ignoreOps(IOPrimitiveUtils_getInstance());
1598
+ }
1599
+ function IOPrimitiveUtils$_get_OPTION_IGNORE_OPS_PATTERN_$ref_vvsa9g() {
1600
+ return constructCallableReference(function (p0) {
1601
+ return _get_OPTION_IGNORE_OPS_PATTERN__cpse4v(p0);
1602
+ }, 1, 0, 127);
1603
+ }
1604
+ function IOPrimitiveUtils$INFO_VARIABLES_PATTERN$delegate$lambda() {
1605
+ return variables(IOPrimitiveUtils_getInstance());
1606
+ }
1607
+ function IOPrimitiveUtils$_get_INFO_VARIABLES_PATTERN_$ref_ih2rd5() {
1608
+ return constructCallableReference(function (p0) {
1609
+ return _get_INFO_VARIABLES_PATTERN__bhp1h0(p0);
1610
+ }, 1, 0, 128);
1611
+ }
1612
+ function IOPrimitiveUtils$INFO_VARIABLE_NAMES_PATTERN$delegate$lambda() {
1613
+ return variableNames(IOPrimitiveUtils_getInstance());
1614
+ }
1615
+ function IOPrimitiveUtils$_get_INFO_VARIABLE_NAMES_PATTERN_$ref_lzmk91() {
1616
+ return constructCallableReference(function (p0) {
1617
+ return _get_INFO_VARIABLE_NAMES_PATTERN__j3oaom(p0);
1618
+ }, 1, 0, 129);
1619
+ }
1620
+ function IOPrimitiveUtils$INFO_SINGLETONS_PATTERN$delegate$lambda() {
1621
+ return singletons(IOPrimitiveUtils_getInstance());
1622
+ }
1623
+ function IOPrimitiveUtils$_get_INFO_SINGLETONS_PATTERN_$ref_8msi4i() {
1624
+ return constructCallableReference(function (p0) {
1625
+ return _get_INFO_SINGLETONS_PATTERN__y21s87(p0);
1626
+ }, 1, 0, 130);
1627
+ }
1628
+ function IOPrimitiveUtils$quoted$ref(p0) {
1629
+ return constructCallableReference(function (p0_0) {
1630
+ var tmp0 = p0;
1631
+ return quoted(tmp0, p0_0);
1632
+ }, 1, 0, 131, 'quoted', [p0]);
1633
+ }
1634
+ function IOPrimitiveUtils$ignoreOps$ref(p0) {
1635
+ return constructCallableReference(function (p0_0) {
1636
+ var tmp0 = p0;
1637
+ return ignoreOps(tmp0, p0_0);
1638
+ }, 1, 0, 132, 'ignoreOps', [p0]);
1639
+ }
1640
+ function IOPrimitiveUtils$numberVars$ref(p0) {
1641
+ return constructCallableReference(function (p0_0) {
1642
+ var tmp0 = p0;
1643
+ return numberVars(tmp0, p0_0);
1644
+ }, 1, 0, 133, 'numberVars', [p0]);
1645
+ }
1646
+ function IOPrimitiveUtils$_get_validOptionsPattern_$lambda_r088xw(it) {
1647
+ return map(sequenceOf([true, false]), it);
1648
+ }
1649
+ function IOPrimitiveUtils$propertiesOf$slambda($channel, $this_propertiesOf, resultContinuation) {
1650
+ this.$channel_1 = $channel;
1651
+ this.$this_propertiesOf_1 = $this_propertiesOf;
1652
+ CoroutineImpl.call(this, resultContinuation);
1653
+ }
1654
+ protoOf(IOPrimitiveUtils$propertiesOf$slambda).invoke_cg3yit_k$ = function ($this$sequence, $completion) {
1655
+ var tmp = this.create_5hkj7b_k$($this$sequence, $completion);
1656
+ tmp.result_1 = Unit_instance;
1657
+ tmp.exception_1 = null;
1658
+ return tmp.doResume_5yljmg_k$();
1659
+ };
1660
+ protoOf(IOPrimitiveUtils$propertiesOf$slambda).invoke_qns8j1_k$ = function (p1, $completion) {
1661
+ return this.invoke_cg3yit_k$(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $completion);
1662
+ };
1663
+ protoOf(IOPrimitiveUtils$propertiesOf$slambda).doResume_5yljmg_k$ = function () {
1664
+ var suspendResult = this.result_1;
1665
+ $sm: do
1666
+ try {
1667
+ var tmp = this.state_1;
1668
+ switch (tmp) {
1669
+ case 0:
1670
+ this.exceptionState_1 = 7;
1671
+ var tmp0_subject = this.$channel_1;
1672
+ if (isInterface(tmp0_subject, InputChannel)) {
1673
+ this.state_1 = 3;
1674
+ suspendResult = this.$this$sequence_1.yield_3xhcex_k$(_get_PROPERTY_INPUT__z2zr91(IOPrimitiveUtils_getInstance()), this);
1675
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1676
+ return suspendResult;
1677
+ }
1678
+ continue $sm;
1679
+ } else {
1680
+ if (isInterface(tmp0_subject, OutputChannel)) {
1681
+ this.state_1 = 1;
1682
+ suspendResult = this.$this$sequence_1.yield_3xhcex_k$(_get_PROPERTY_OUTPUT__1pem9m(IOPrimitiveUtils_getInstance()), this);
1683
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1684
+ return suspendResult;
1685
+ }
1686
+ continue $sm;
1687
+ } else {
1688
+ this.state_1 = 5;
1689
+ continue $sm;
1690
+ }
1691
+ }
1692
+
1693
+ case 1:
1694
+ this.state_1 = 2;
1695
+ var tmp_0 = this.$this_propertiesOf_1.context.get_outputChannels_ffvoca_k$();
1696
+ var tmp_1 = this.$channel_1;
1697
+ var tmp_2 = tmp_0.aliasesOf(isInterface(tmp_1, OutputChannel) ? tmp_1 : THROW_CCE());
1698
+ var tmp_3 = filterNot(tmp_2, IOPrimitiveUtils$propertiesOf$slambda$lambda_0);
1699
+ suspendResult = this.$this$sequence_1.yieldAll_h63j2x_k$(map(tmp_3, IOPrimitiveUtils$alias$ref(IOPrimitiveUtils_getInstance())), this);
1700
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1701
+ return suspendResult;
1702
+ }
1703
+
1704
+ continue $sm;
1705
+ case 2:
1706
+ this.state_1 = 5;
1707
+ continue $sm;
1708
+ case 3:
1709
+ this.state_1 = 4;
1710
+ var tmp_4 = this.$this_propertiesOf_1.context.get_inputChannels_uyf05t_k$();
1711
+ var tmp_5 = this.$channel_1;
1712
+ var tmp_6 = tmp_4.aliasesOf(isInterface(tmp_5, InputChannel) ? tmp_5 : THROW_CCE());
1713
+ var tmp_7 = filterNot(tmp_6, IOPrimitiveUtils$propertiesOf$slambda$lambda);
1714
+ suspendResult = this.$this$sequence_1.yieldAll_h63j2x_k$(map(tmp_7, IOPrimitiveUtils$alias$ref(IOPrimitiveUtils_getInstance())), this);
1715
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1716
+ return suspendResult;
1717
+ }
1718
+
1719
+ continue $sm;
1720
+ case 4:
1721
+ this.state_1 = 5;
1722
+ continue $sm;
1723
+ case 5:
1724
+ this.state_1 = 6;
1725
+ suspendResult = this.$this$sequence_1.yield_3xhcex_k$(_get_PROPERTY_TYPE_TEXT__9rpcwt(IOPrimitiveUtils_getInstance()), this);
1726
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
1727
+ return suspendResult;
1728
+ }
1729
+
1730
+ continue $sm;
1731
+ case 6:
1732
+ return Unit_instance;
1733
+ case 7:
1734
+ throw this.exception_1;
1735
+ }
1736
+ } catch ($p) {
1737
+ var e = $p;
1738
+ if (this.exceptionState_1 === 7) {
1739
+ throw e;
1740
+ } else {
1741
+ this.state_1 = this.exceptionState_1;
1742
+ this.exception_1 = e;
1743
+ }
1744
+ }
1745
+ while (true);
1746
+ };
1747
+ protoOf(IOPrimitiveUtils$propertiesOf$slambda).create_5hkj7b_k$ = function ($this$sequence, completion) {
1748
+ var i = new IOPrimitiveUtils$propertiesOf$slambda(this.$channel_1, this.$this_propertiesOf_1, completion);
1749
+ i.$this$sequence_1 = $this$sequence;
1750
+ return i;
1751
+ };
1752
+ function IOPrimitiveUtils$propertiesOf$slambda_0($channel, $this_propertiesOf, resultContinuation) {
1753
+ var i = new IOPrimitiveUtils$propertiesOf$slambda($channel, $this_propertiesOf, resultContinuation);
1754
+ return constructCallableReference(function ($this$sequence, $completion) {
1755
+ return i.invoke_cg3yit_k$($this$sequence, $completion);
1756
+ }, 1);
1757
+ }
1758
+ function IOPrimitiveUtils$getOption$lambda(it) {
1759
+ return !(it == null) ? isInterface(it, Struct) : false;
1760
+ }
1761
+ function IOPrimitiveUtils$getOption$lambda_0($unificator, $pattern) {
1762
+ return function (it) {
1763
+ return $unificator.match($pattern, it);
1764
+ };
1765
+ }
1766
+ function IOPrimitiveUtils$getOption$lambda_1(it) {
1767
+ return it.get(0);
1768
+ }
1769
+ function IOPrimitiveUtils$getOption$lambda_2(it) {
1770
+ return !(it == null) ? isInterface(it, Truth) : false;
1771
+ }
1772
+ function IOPrimitiveUtils$getOption$lambda_3(it) {
1773
+ return it.get_isTrue_ew6ti9_k$();
1774
+ }
1775
+ function IOPrimitiveUtils$getInfo$lambda(it) {
1776
+ return !(it == null) ? isInterface(it, Struct) : false;
1777
+ }
1778
+ function IOPrimitiveUtils$_get_singletons_$lambda_kke618(it) {
1779
+ return it.get_value_j01efc_k$().get_size_woubt6_k$() === 1;
1780
+ }
1781
+ function IOPrimitiveUtils$_get_singletons_$lambda_kke618_0(it) {
1782
+ return it.get_key_18j28a_k$();
1783
+ }
1784
+ function IOPrimitiveUtils$toAssignments$lambda($n) {
1785
+ return function (it) {
1786
+ return to($n, it);
1787
+ };
1788
+ }
1789
+ function IOPrimitiveUtils$open$lambda($this_open) {
1790
+ return function (it) {
1791
+ return IOPrimitiveUtils_getInstance().ensureTermIsValidProperty_oi9oag_k$($this_open, it);
1792
+ };
1793
+ }
1794
+ function IOPrimitiveUtils$open$lambda_0($this_open) {
1795
+ return function (it) {
1796
+ return IOPrimitiveUtils_getInstance().ensureTermIsSupportedProperty_mx21q2_k$($this_open, it);
1797
+ };
1798
+ }
1799
+ function IOPrimitiveUtils$replyOpeningStream$lambda($alias, $channel) {
1800
+ return function ($this$replyWith) {
1801
+ var tmp0_elvis_lhs = $alias;
1802
+ $this$replyWith.openOutputChannel_sa5jps_k$(tmp0_elvis_lhs == null ? 'output_channel' + $channel.get_streamTerm_v3iy6t_k$().get(1).toString() : tmp0_elvis_lhs, $channel);
1803
+ return Unit_instance;
1804
+ };
1805
+ }
1806
+ function IOPrimitiveUtils$replyOpeningStream$lambda_0($alias, $channel) {
1807
+ return function ($this$replyWith) {
1808
+ var tmp0_elvis_lhs = $alias;
1809
+ $this$replyWith.openInputChannel_g5b2w6_k$(tmp0_elvis_lhs == null ? 'input_channel' + $channel.get_streamTerm_v3iy6t_k$().get(1).toString() : tmp0_elvis_lhs, $channel);
1810
+ return Unit_instance;
1811
+ };
1812
+ }
1813
+ function IOPrimitiveUtils() {
1814
+ IOPrimitiveUtils_instance = this;
1815
+ var tmp = this;
1816
+ tmp.INPUT_STREAM_TERM_PATTERN$delegate_1 = lazy(IOPrimitiveUtils$INPUT_STREAM_TERM_PATTERN$delegate$lambda);
1817
+ var tmp_0 = this;
1818
+ tmp_0.OUTPUT_STREAM_TERM_PATTERN$delegate_1 = lazy(IOPrimitiveUtils$OUTPUT_STREAM_TERM_PATTERN$delegate$lambda);
1819
+ var tmp_1 = this;
1820
+ tmp_1.PROPERTY_TYPE_PATTERN$delegate_1 = lazy(IOPrimitiveUtils$PROPERTY_TYPE_PATTERN$delegate$lambda);
1821
+ var tmp_2 = this;
1822
+ tmp_2.PROPERTY_REPOSITION_PATTERN$delegate_1 = lazy(IOPrimitiveUtils$PROPERTY_REPOSITION_PATTERN$delegate$lambda);
1823
+ var tmp_3 = this;
1824
+ tmp_3.PROPERTY_EOF_ACTION_PATTERN$delegate_1 = lazy(IOPrimitiveUtils$PROPERTY_EOF_ACTION_PATTERN$delegate$lambda);
1825
+ var tmp_4 = this;
1826
+ tmp_4.PROPERTY_ALIAS_PATTERN$delegate_1 = lazy(IOPrimitiveUtils$PROPERTY_ALIAS_PATTERN$delegate$lambda);
1827
+ var tmp_5 = this;
1828
+ tmp_5.PROPERTY_INPUT$delegate_1 = lazy(IOPrimitiveUtils$PROPERTY_INPUT$delegate$lambda);
1829
+ var tmp_6 = this;
1830
+ tmp_6.PROPERTY_OUTPUT$delegate_1 = lazy(IOPrimitiveUtils$PROPERTY_OUTPUT$delegate$lambda);
1831
+ var tmp_7 = this;
1832
+ tmp_7.PROPERTY_TYPE_TEXT$delegate_1 = lazy(IOPrimitiveUtils$PROPERTY_TYPE_TEXT$delegate$lambda);
1833
+ var tmp_8 = this;
1834
+ tmp_8.PROPERTY_REPOSITION_FALSE$delegate_1 = lazy(IOPrimitiveUtils$PROPERTY_REPOSITION_FALSE$delegate$lambda);
1835
+ var tmp_9 = this;
1836
+ tmp_9.PROPERTY_EOF_ACTION_EOF_CODE$delegate_1 = lazy(IOPrimitiveUtils$PROPERTY_EOF_ACTION_EOF_CODE$delegate$lambda);
1837
+ var tmp_10 = this;
1838
+ tmp_10.OPTION_QUOTED_PATTERN$delegate_1 = lazy(IOPrimitiveUtils$OPTION_QUOTED_PATTERN$delegate$lambda);
1839
+ var tmp_11 = this;
1840
+ tmp_11.OPTION_NUMBER_VARS_PATTERN$delegate_1 = lazy(IOPrimitiveUtils$OPTION_NUMBER_VARS_PATTERN$delegate$lambda);
1841
+ var tmp_12 = this;
1842
+ tmp_12.OPTION_IGNORE_OPS_PATTERN$delegate_1 = lazy(IOPrimitiveUtils$OPTION_IGNORE_OPS_PATTERN$delegate$lambda);
1843
+ var tmp_13 = this;
1844
+ tmp_13.INFO_VARIABLES_PATTERN$delegate_1 = lazy(IOPrimitiveUtils$INFO_VARIABLES_PATTERN$delegate$lambda);
1845
+ var tmp_14 = this;
1846
+ tmp_14.INFO_VARIABLE_NAMES_PATTERN$delegate_1 = lazy(IOPrimitiveUtils$INFO_VARIABLE_NAMES_PATTERN$delegate$lambda);
1847
+ var tmp_15 = this;
1848
+ tmp_15.INFO_SINGLETONS_PATTERN$delegate_1 = lazy(IOPrimitiveUtils$INFO_SINGLETONS_PATTERN$delegate$lambda);
1849
+ }
1850
+ protoOf(IOPrimitiveUtils).propertiesOf_hpcm76_k$ = function (_this__u8e3s4, channel) {
1851
+ return sequence(IOPrimitiveUtils$propertiesOf$slambda_0(channel, _this__u8e3s4, null));
1852
+ };
1853
+ protoOf(IOPrimitiveUtils).get_currentInputChannel_31908p_k$ = function (_this__u8e3s4) {
1854
+ // Inline function 'kotlin.let' call
1855
+ var it = _this__u8e3s4.context.get_inputChannels_uyf05t_k$();
1856
+ var tmp0_elvis_lhs = it.get_current_jwi6j4_k$();
1857
+ return tmp0_elvis_lhs == null ? it.get_stdIn_iypyf3_k$() : tmp0_elvis_lhs;
1858
+ };
1859
+ protoOf(IOPrimitiveUtils).get_currentOutputChannel_jl8tcy_k$ = function (_this__u8e3s4) {
1860
+ // Inline function 'kotlin.let' call
1861
+ var it = _this__u8e3s4.context.get_outputChannels_ffvoca_k$();
1862
+ var tmp0_elvis_lhs = it.get_current_jwi6j4_k$();
1863
+ return tmp0_elvis_lhs == null ? it.get_stdOut_jngbw4_k$() : tmp0_elvis_lhs;
1864
+ };
1865
+ protoOf(IOPrimitiveUtils).ensureTermIsValidProperty_oi9oag_k$ = function (_this__u8e3s4, term) {
1866
+ var tmp;
1867
+ var tmp0 = _get_validPropertiesPattern__7s1t06(this);
1868
+ var tmp$ret$0;
1869
+ $l$block: {
1870
+ // Inline function 'kotlin.sequences.any' call
1871
+ var _iterator__ex2g4s = tmp0.iterator_jk1svi_k$();
1872
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
1873
+ var element = _iterator__ex2g4s.next_20eer_k$();
1874
+ if (Companion_getInstance_1().match_tf8j11_k$(_this__u8e3s4, term, element)) {
1875
+ tmp$ret$0 = true;
1876
+ break $l$block;
1877
+ }
1878
+ }
1879
+ tmp$ret$0 = false;
1880
+ }
1881
+ if (tmp$ret$0) {
1882
+ tmp = term;
1883
+ } else {
1884
+ throw Companion_instance_6.forTerm(_this__u8e3s4.context, Expected_STREAM_PROPERTY_getInstance(), term);
1885
+ }
1886
+ return tmp;
1887
+ };
1888
+ protoOf(IOPrimitiveUtils).ensureTermIsSupportedProperty_mx21q2_k$ = function (_this__u8e3s4, term) {
1889
+ var tmp;
1890
+ var tmp0 = _get_supportedPropertiesPattern__x8u7bw(this);
1891
+ var tmp$ret$0;
1892
+ $l$block: {
1893
+ // Inline function 'kotlin.sequences.any' call
1894
+ var _iterator__ex2g4s = tmp0.iterator_jk1svi_k$();
1895
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
1896
+ var element = _iterator__ex2g4s.next_20eer_k$();
1897
+ if (Companion_getInstance_1().match_tf8j11_k$(_this__u8e3s4, term, element)) {
1898
+ tmp$ret$0 = true;
1899
+ break $l$block;
1900
+ }
1901
+ }
1902
+ tmp$ret$0 = false;
1903
+ }
1904
+ if (tmp$ret$0) {
1905
+ tmp = term;
1906
+ } else {
1907
+ throw Companion_instance_2.forUncaughtKtException(_this__u8e3s4.context, IllegalStateException_init_$Create$('unsupported option ' + term.toString()));
1908
+ }
1909
+ return tmp;
1910
+ };
1911
+ protoOf(IOPrimitiveUtils).ensureTermIsValidOption_h5jq8o_k$ = function (_this__u8e3s4, term) {
1912
+ var tmp;
1913
+ var tmp0 = _get_validOptionsPattern__akhsd9(this);
1914
+ var tmp$ret$0;
1915
+ $l$block: {
1916
+ // Inline function 'kotlin.sequences.any' call
1917
+ var _iterator__ex2g4s = tmp0.iterator_jk1svi_k$();
1918
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
1919
+ var element = _iterator__ex2g4s.next_20eer_k$();
1920
+ if (Companion_getInstance_1().match_tf8j11_k$(_this__u8e3s4, term, element)) {
1921
+ tmp$ret$0 = true;
1922
+ break $l$block;
1923
+ }
1924
+ }
1925
+ tmp$ret$0 = false;
1926
+ }
1927
+ if (tmp$ret$0) {
1928
+ tmp = term;
1929
+ } else {
1930
+ throw Companion_instance_6.forTerm(_this__u8e3s4.context, Expected_WRITE_OPTION_getInstance(), term);
1931
+ }
1932
+ return tmp;
1933
+ };
1934
+ protoOf(IOPrimitiveUtils).ensureTermIsValidInfo_3ox2in_k$ = function (_this__u8e3s4, term) {
1935
+ var tmp;
1936
+ var tmp0 = _get_validInfoPattern__dtwgth(this);
1937
+ var tmp$ret$0;
1938
+ $l$block: {
1939
+ // Inline function 'kotlin.sequences.any' call
1940
+ var _iterator__ex2g4s = tmp0.iterator_jk1svi_k$();
1941
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
1942
+ var element = _iterator__ex2g4s.next_20eer_k$();
1943
+ if (Companion_getInstance_1().match_tf8j11_k$(_this__u8e3s4, term, element)) {
1944
+ tmp$ret$0 = true;
1945
+ break $l$block;
1946
+ }
1947
+ }
1948
+ tmp$ret$0 = false;
1949
+ }
1950
+ if (tmp$ret$0) {
1951
+ tmp = term;
1952
+ } else {
1953
+ throw Companion_instance_6.forTerm(_this__u8e3s4.context, Expected_READ_OPTION_getInstance(), term);
1954
+ }
1955
+ return tmp;
1956
+ };
1957
+ protoOf(IOPrimitiveUtils).ensuringArgumentIsValidOptionList_bsr8l1_k$ = function (_this__u8e3s4, index) {
1958
+ Companion_getInstance_1().ensuringArgumentIsList_n20mbc_k$(_this__u8e3s4, index);
1959
+ var tmp = _this__u8e3s4.arguments.get_c1px32_k$(index);
1960
+ var list = isInterface(tmp, List) ? tmp : THROW_CCE();
1961
+ var _iterator__ex2g4s = list.toSequence_lzjcyk_k$().iterator_jk1svi_k$();
1962
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
1963
+ var term = _iterator__ex2g4s.next_20eer_k$();
1964
+ this.ensureTermIsValidOption_h5jq8o_k$(_this__u8e3s4, term);
1965
+ }
1966
+ return _this__u8e3s4;
1967
+ };
1968
+ protoOf(IOPrimitiveUtils).ensuringArgumentIsValidInfoList_2j0pim_k$ = function (_this__u8e3s4, index) {
1969
+ var list = _this__u8e3s4.arguments.get_c1px32_k$(index);
1970
+ var tmp;
1971
+ if (isInterface(list, Var)) {
1972
+ tmp = null;
1973
+ } else {
1974
+ Companion_getInstance_1().ensuringArgumentIsList_n20mbc_k$(_this__u8e3s4, index);
1975
+ var listOfInfo = (isInterface(list, List) ? list : THROW_CCE()).toList();
1976
+ var _iterator__ex2g4s = listOfInfo.iterator_jk1svi_k$();
1977
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
1978
+ var term = _iterator__ex2g4s.next_20eer_k$();
1979
+ this.ensureTermIsValidInfo_3ox2in_k$(_this__u8e3s4, term);
1980
+ }
1981
+ tmp = listOfInfo;
1982
+ }
1983
+ return tmp;
1984
+ };
1985
+ protoOf(IOPrimitiveUtils).ensuringArgumentIsFormatter_5l8dg0_k$ = function (_this__u8e3s4, index) {
1986
+ this.ensuringArgumentIsValidOptionList_bsr8l1_k$(_this__u8e3s4, index);
1987
+ var tmp = _this__u8e3s4.arguments.get_c1px32_k$(index);
1988
+ var optionList = (isInterface(tmp, List) ? tmp : THROW_CCE()).toList();
1989
+ var tmp_0;
1990
+ if (getOption(this, optionList, _this__u8e3s4.context.get_unificator_xw6v3j_k$(), _get_OPTION_QUOTED_PATTERN__n2ri42(this))) {
1991
+ tmp_0 = FuncFormat_QUOTED_IF_NECESSARY_getInstance();
1992
+ } else {
1993
+ tmp_0 = FuncFormat_LITERAL_getInstance();
1994
+ }
1995
+ var funcFormat = tmp_0;
1996
+ var tmp_1;
1997
+ if (getOption(this, optionList, _this__u8e3s4.context.get_unificator_xw6v3j_k$(), _get_OPTION_IGNORE_OPS_PATTERN__cpse4v(this))) {
1998
+ tmp_1 = OpFormat_IGNORE_OPERATORS_getInstance();
1999
+ } else {
2000
+ tmp_1 = OpFormat_EXPRESSIONS_getInstance();
2001
+ }
2002
+ var opFormat = tmp_1;
2003
+ var numberVars = getOption(this, optionList, _this__u8e3s4.context.get_unificator_xw6v3j_k$(), _get_OPTION_NUMBER_VARS_PATTERN__p98ste(this));
2004
+ return Companion_instance_7.of(VarFormat_UNDERSCORE_getInstance(), opFormat, funcFormat, numberVars, _this__u8e3s4.context.get_operators_z0nmfu_k$());
2005
+ };
2006
+ protoOf(IOPrimitiveUtils).ensuringArgumentIsStreamProperty_6yg2an_k$ = function (_this__u8e3s4, index) {
2007
+ var term = _this__u8e3s4.arguments.get_c1px32_k$(index);
2008
+ if (isInterface(term, Var))
2009
+ return _this__u8e3s4;
2010
+ else {
2011
+ if (isInterface(term, Struct)) {
2012
+ var tmp0 = sequenceOf([_get_PROPERTY_INPUT__z2zr91(this), _get_PROPERTY_OUTPUT__1pem9m(this), _get_PROPERTY_ALIAS_PATTERN__wipd2s(this)]);
2013
+ var tmp$ret$0;
2014
+ $l$block: {
2015
+ // Inline function 'kotlin.sequences.any' call
2016
+ var _iterator__ex2g4s = tmp0.iterator_jk1svi_k$();
2017
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
2018
+ var element = _iterator__ex2g4s.next_20eer_k$();
2019
+ if (Companion_getInstance_1().match_tf8j11_k$(_this__u8e3s4, term, element)) {
2020
+ tmp$ret$0 = true;
2021
+ break $l$block;
2022
+ }
2023
+ }
2024
+ tmp$ret$0 = false;
2025
+ }
2026
+ if (tmp$ret$0) {
2027
+ return _this__u8e3s4;
2028
+ }
2029
+ }
2030
+ }
2031
+ throw Companion_instance_6.forArgument_kfchnw_k$(_this__u8e3s4.context, _this__u8e3s4.signature, Expected_STREAM_PROPERTY_getInstance(), term, index);
2032
+ };
2033
+ protoOf(IOPrimitiveUtils).ensuringArgumentIsUrl_7mlsff_k$ = function (_this__u8e3s4, index) {
2034
+ Companion_getInstance_1().ensuringArgumentIsInstantiated_dpjvac_k$(_this__u8e3s4, index);
2035
+ var term = _this__u8e3s4.arguments.get_c1px32_k$(index);
2036
+ var error = Companion_instance_6.forArgument_kfchnw_k$(_this__u8e3s4.context, _this__u8e3s4.signature, Expected_SOURCE_SINK_getInstance(), term, index);
2037
+ if (!isInterface(term, Atom)) {
2038
+ throw error;
2039
+ }
2040
+ try {
2041
+ return Companion_instance_15.of(term.get_value_j01efc_k$());
2042
+ } catch ($p) {
2043
+ if ($p instanceof InvalidUrlException) {
2044
+ var _unused_var__etf5q3 = $p;
2045
+ throw error;
2046
+ } else {
2047
+ throw $p;
2048
+ }
2049
+ }
2050
+ };
2051
+ protoOf(IOPrimitiveUtils).ensuringArgumentIsIOMode_v61n1v_k$ = function (_this__u8e3s4, index) {
2052
+ Companion_getInstance_1().ensuringArgumentIsInstantiated_dpjvac_k$(_this__u8e3s4, index);
2053
+ Companion_getInstance_1().ensuringArgumentIsAtom_5kuj97_k$(_this__u8e3s4, index);
2054
+ var tmp = _this__u8e3s4.arguments.get_c1px32_k$(index);
2055
+ var term = isInterface(tmp, Atom) ? tmp : THROW_CCE();
2056
+ if (!Companion_getInstance_8().atomValues_1.contains_aljjnj_k$(term)) {
2057
+ throw Companion_instance_6.forArgument_kfchnw_k$(_this__u8e3s4.context, _this__u8e3s4.signature, Expected_IO_MODE_getInstance(), term, index);
2058
+ }
2059
+ // Inline function 'kotlin.text.uppercase' call
2060
+ // Inline function 'kotlin.js.asDynamic' call
2061
+ var tmp$ret$0 = term.get_value_j01efc_k$().toUpperCase();
2062
+ return valueOf(tmp$ret$0);
2063
+ };
2064
+ protoOf(IOPrimitiveUtils).ensuringArgumentIsVarOrStream_l86imo_k$ = function (_this__u8e3s4, index) {
2065
+ var term = _this__u8e3s4.arguments.get_c1px32_k$(index);
2066
+ if (isInterface(term, Var))
2067
+ return null;
2068
+ else {
2069
+ if (isInterface(term, Struct))
2070
+ if (Companion_getInstance_1().match_tf8j11_k$(_this__u8e3s4, term, _get_OUTPUT_STREAM_TERM_PATTERN__4vocxf(this))) {
2071
+ var tmp1_elvis_lhs = firstOrNull(_this__u8e3s4.context.get_outputChannels_ffvoca_k$().findByTerm(term));
2072
+ var tmp;
2073
+ if (tmp1_elvis_lhs == null) {
2074
+ throw Companion_instance_8.forStream(_this__u8e3s4.context, term);
2075
+ } else {
2076
+ tmp = tmp1_elvis_lhs;
2077
+ }
2078
+ return tmp;
2079
+ } else if (Companion_getInstance_1().match_tf8j11_k$(_this__u8e3s4, term, _get_INPUT_STREAM_TERM_PATTERN__5fd8p6(this))) {
2080
+ var tmp2_elvis_lhs = firstOrNull(_this__u8e3s4.context.get_inputChannels_uyf05t_k$().findByTerm(term));
2081
+ var tmp_0;
2082
+ if (tmp2_elvis_lhs == null) {
2083
+ throw Companion_instance_8.forStream(_this__u8e3s4.context, term);
2084
+ } else {
2085
+ tmp_0 = tmp2_elvis_lhs;
2086
+ }
2087
+ return tmp_0;
2088
+ }
2089
+ }
2090
+ throw Companion_instance_6.forArgument_kfchnw_k$(_this__u8e3s4.context, _this__u8e3s4.signature, Expected_STREAM_OR_ALIAS_getInstance(), term, index);
2091
+ };
2092
+ protoOf(IOPrimitiveUtils).ensuringArgumentIsVarOrChar_zdzofu_k$ = function (_this__u8e3s4, index) {
2093
+ var arg = _this__u8e3s4.arguments.get_c1px32_k$(index);
2094
+ var tmp;
2095
+ if (isInterface(arg, Var)) {
2096
+ tmp = _this__u8e3s4;
2097
+ } else {
2098
+ if (isInterface(arg, Atom)) {
2099
+ var tmp_0;
2100
+ if (arg.get_value_j01efc_k$() === 'end_of_file') {
2101
+ tmp_0 = _this__u8e3s4;
2102
+ } else if (arg.get_value_j01efc_k$().length === 1) {
2103
+ tmp_0 = _this__u8e3s4;
2104
+ } else {
2105
+ throw Companion_instance_3.forArgument_54essq_k$(_this__u8e3s4.context, _this__u8e3s4.signature, Expected_IN_CHARACTER_getInstance(), arg, index);
2106
+ }
2107
+ tmp = tmp_0;
2108
+ } else {
2109
+ throw Companion_instance_3.forArgument_54essq_k$(_this__u8e3s4.context, _this__u8e3s4.signature, Expected_IN_CHARACTER_getInstance(), arg, index);
2110
+ }
2111
+ }
2112
+ return tmp;
2113
+ };
2114
+ protoOf(IOPrimitiveUtils).ensuringArgumentIsVarOrCharCode_tmh0sz_k$ = function (_this__u8e3s4, index) {
2115
+ var term = _this__u8e3s4.arguments.get_c1px32_k$(index);
2116
+ var tmp;
2117
+ if (isInterface(term, Var)) {
2118
+ tmp = _this__u8e3s4;
2119
+ } else {
2120
+ if (!isInterface(term, Integer)) {
2121
+ tmp = Companion_getInstance_1().ensuringArgumentIsInteger_boj9pg_k$(_this__u8e3s4, index);
2122
+ } else {
2123
+ if (term.equals(Companion_getInstance_6().MINUS_ONE_1)) {
2124
+ tmp = _this__u8e3s4;
2125
+ } else {
2126
+ if (Companion_getInstance_1().isCharacterCode_a1ooqa_k$(term)) {
2127
+ throw Companion_instance_9.of(_this__u8e3s4.context, _this__u8e3s4.signature, Limit_CHARACTER_CODE_getInstance());
2128
+ } else {
2129
+ tmp = _this__u8e3s4;
2130
+ }
2131
+ }
2132
+ }
2133
+ }
2134
+ return tmp;
2135
+ };
2136
+ protoOf(IOPrimitiveUtils).ensuringArgumentIsChannel_ed79nb_k$ = function (_this__u8e3s4, index) {
2137
+ Companion_getInstance_1().ensuringArgumentIsInstantiated_dpjvac_k$(_this__u8e3s4, index);
2138
+ Companion_getInstance_1().ensuringArgumentIsStruct_lk4yyp_k$(_this__u8e3s4, index);
2139
+ var tmp = _this__u8e3s4.arguments.get_c1px32_k$(index);
2140
+ var term = isInterface(tmp, Struct) ? tmp : THROW_CCE();
2141
+ var tmp_0;
2142
+ if (isInterface(term, Atom)) {
2143
+ var tmp0 = sequenceOf([_this__u8e3s4.context.get_inputChannels_uyf05t_k$(), _this__u8e3s4.context.get_outputChannels_ffvoca_k$()]);
2144
+ var tmp$ret$0;
2145
+ $l$block: {
2146
+ // Inline function 'kotlin.sequences.firstOrNull' call
2147
+ var _iterator__ex2g4s = tmp0.iterator_jk1svi_k$();
2148
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
2149
+ var element = _iterator__ex2g4s.next_20eer_k$();
2150
+ // Inline function 'kotlin.collections.contains' call
2151
+ // Inline function 'kotlin.collections.containsKey' call
2152
+ var key = term.get_value_j01efc_k$();
2153
+ if ((isInterface(element, KtMap) ? element : THROW_CCE()).containsKey_aw81wo_k$(key)) {
2154
+ tmp$ret$0 = element;
2155
+ break $l$block;
2156
+ }
2157
+ }
2158
+ tmp$ret$0 = null;
2159
+ }
2160
+ var tmp0_safe_receiver = tmp$ret$0;
2161
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.get_wei43m_k$(term.get_value_j01efc_k$());
2162
+ var tmp_1;
2163
+ if (tmp1_elvis_lhs == null) {
2164
+ throw Companion_instance_8.forSourceSink(_this__u8e3s4.context, term);
2165
+ } else {
2166
+ tmp_1 = tmp1_elvis_lhs;
2167
+ }
2168
+ tmp_0 = tmp_1;
2169
+ } else {
2170
+ if (Companion_getInstance_1().match_tf8j11_k$(_this__u8e3s4, term, _get_OUTPUT_STREAM_TERM_PATTERN__4vocxf(this))) {
2171
+ var tmp2_elvis_lhs = firstOrNull(_this__u8e3s4.context.get_outputChannels_ffvoca_k$().findByTerm(term));
2172
+ var tmp_2;
2173
+ if (tmp2_elvis_lhs == null) {
2174
+ throw Companion_instance_8.forStream(_this__u8e3s4.context, term);
2175
+ } else {
2176
+ tmp_2 = tmp2_elvis_lhs;
2177
+ }
2178
+ tmp_0 = tmp_2;
2179
+ } else {
2180
+ if (Companion_getInstance_1().match_tf8j11_k$(_this__u8e3s4, term, _get_INPUT_STREAM_TERM_PATTERN__5fd8p6(this))) {
2181
+ var tmp3_elvis_lhs = firstOrNull(_this__u8e3s4.context.get_inputChannels_uyf05t_k$().findByTerm(term));
2182
+ var tmp_3;
2183
+ if (tmp3_elvis_lhs == null) {
2184
+ throw Companion_instance_8.forStream(_this__u8e3s4.context, term);
2185
+ } else {
2186
+ tmp_3 = tmp3_elvis_lhs;
2187
+ }
2188
+ tmp_0 = tmp_3;
2189
+ } else {
2190
+ throw Companion_instance_6.forArgument_kfchnw_k$(_this__u8e3s4.context, _this__u8e3s4.signature, Expected_STREAM_OR_ALIAS_getInstance(), term, index);
2191
+ }
2192
+ }
2193
+ }
2194
+ return tmp_0;
2195
+ };
2196
+ protoOf(IOPrimitiveUtils).ensuringArgumentIsInputChannel_w9cvb1_k$ = function (_this__u8e3s4, index) {
2197
+ var channel = this.ensuringArgumentIsChannel_ed79nb_k$(_this__u8e3s4, index);
2198
+ var tmp;
2199
+ if (isInterface(channel, InputChannel)) {
2200
+ tmp = channel;
2201
+ } else {
2202
+ throw Companion_instance_6.forArgument_kfchnw_k$(_this__u8e3s4.context, _this__u8e3s4.signature, Expected_STREAM_TYPE_getInstance(), _this__u8e3s4.arguments.get_c1px32_k$(index), index);
2203
+ }
2204
+ return tmp;
2205
+ };
2206
+ protoOf(IOPrimitiveUtils).ensuringArgumentIsOutputChannel_kmdrtk_k$ = function (_this__u8e3s4, index) {
2207
+ var channel = this.ensuringArgumentIsChannel_ed79nb_k$(_this__u8e3s4, index);
2208
+ var tmp;
2209
+ if (isInterface(channel, OutputChannel)) {
2210
+ tmp = channel;
2211
+ } else {
2212
+ throw Companion_instance_6.forArgument_kfchnw_k$(_this__u8e3s4.context, _this__u8e3s4.signature, Expected_STREAM_TYPE_getInstance(), _this__u8e3s4.arguments.get_c1px32_k$(index), index);
2213
+ }
2214
+ return tmp;
2215
+ };
2216
+ protoOf(IOPrimitiveUtils).writeTermAndReply_wyva0k_k$ = function (_this__u8e3s4, channel, term, formatter) {
2217
+ var tmp;
2218
+ try {
2219
+ channel.write(format(term, formatter));
2220
+ tmp = _this__u8e3s4.replySuccess(VOID, VOID, []);
2221
+ } catch ($p) {
2222
+ var tmp_0;
2223
+ if ($p instanceof IllegalStateException) {
2224
+ var _unused_var__etf5q3 = $p;
2225
+ tmp_0 = _this__u8e3s4.replyFail(VOID, []);
2226
+ } else {
2227
+ throw $p;
2228
+ }
2229
+ tmp = tmp_0;
2230
+ }
2231
+ return tmp;
2232
+ };
2233
+ protoOf(IOPrimitiveUtils).writeCodeAndReply_pk9m0p_k$ = function (_this__u8e3s4, channel, arg) {
2234
+ var tmp;
2235
+ try {
2236
+ channel.write(toString_0(arg.get_intValue_mlvnn9_k$().toChar()));
2237
+ tmp = _this__u8e3s4.replySuccess(VOID, VOID, []);
2238
+ } catch ($p) {
2239
+ var tmp_0;
2240
+ if ($p instanceof IllegalStateException) {
2241
+ var _unused_var__etf5q3 = $p;
2242
+ tmp_0 = _this__u8e3s4.replyFail(VOID, []);
2243
+ } else {
2244
+ throw $p;
2245
+ }
2246
+ tmp = tmp_0;
2247
+ }
2248
+ return tmp;
2249
+ };
2250
+ protoOf(IOPrimitiveUtils).writeCharAndReply_7fanoe_k$ = function (_this__u8e3s4, channel, arg) {
2251
+ var tmp;
2252
+ try {
2253
+ channel.write(arg.get_value_j01efc_k$());
2254
+ tmp = _this__u8e3s4.replySuccess(VOID, VOID, []);
2255
+ } catch ($p) {
2256
+ var tmp_0;
2257
+ if ($p instanceof IllegalStateException) {
2258
+ var _unused_var__etf5q3 = $p;
2259
+ tmp_0 = _this__u8e3s4.replyFail(VOID, []);
2260
+ } else {
2261
+ throw $p;
2262
+ }
2263
+ tmp = tmp_0;
2264
+ }
2265
+ return tmp;
2266
+ };
2267
+ protoOf(IOPrimitiveUtils).peekCodeAndReply_y06qz3_k$ = function (_this__u8e3s4, channel, arg) {
2268
+ var tmp;
2269
+ try {
2270
+ var tmp0_safe_receiver = channel.peek();
2271
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : charCodeAt(tmp0_safe_receiver, 0);
2272
+ var tmp_0;
2273
+ var tmp_1 = tmp1_safe_receiver;
2274
+ if ((tmp_1 == null ? null : new Char(tmp_1)) == null) {
2275
+ tmp_0 = null;
2276
+ } else {
2277
+ // Inline function 'kotlin.code' call
2278
+ tmp_0 = Char__toInt_impl_vasixd(tmp1_safe_receiver);
2279
+ }
2280
+ var tmp2_elvis_lhs = tmp_0;
2281
+ var code = tmp2_elvis_lhs == null ? -1 : tmp2_elvis_lhs;
2282
+ tmp = _this__u8e3s4.replyWith(Companion_getInstance_1().mgu_jyyt35_k$(_this__u8e3s4, arg, Companion_getInstance_6().ofInt(code)), VOID, []);
2283
+ } catch ($p) {
2284
+ var tmp_2;
2285
+ if ($p instanceof IllegalStateException) {
2286
+ var _unused_var__etf5q3 = $p;
2287
+ tmp_2 = _this__u8e3s4.replyFail(VOID, []);
2288
+ } else {
2289
+ throw $p;
2290
+ }
2291
+ tmp = tmp_2;
2292
+ }
2293
+ return tmp;
2294
+ };
2295
+ protoOf(IOPrimitiveUtils).peekCharAndReply_r80pc6_k$ = function (_this__u8e3s4, channel, arg) {
2296
+ var tmp;
2297
+ try {
2298
+ var tmp0_elvis_lhs = channel.peek();
2299
+ var char = tmp0_elvis_lhs == null ? 'end_of_file' : tmp0_elvis_lhs;
2300
+ tmp = _this__u8e3s4.replyWith(Companion_getInstance_1().mgu_jyyt35_k$(_this__u8e3s4, arg, Companion_getInstance_0().of(char)), VOID, []);
2301
+ } catch ($p) {
2302
+ var tmp_0;
2303
+ if ($p instanceof IllegalStateException) {
2304
+ var _unused_var__etf5q3 = $p;
2305
+ tmp_0 = _this__u8e3s4.replyFail(VOID, []);
2306
+ } else {
2307
+ throw $p;
2308
+ }
2309
+ tmp = tmp_0;
2310
+ }
2311
+ return tmp;
2312
+ };
2313
+ protoOf(IOPrimitiveUtils).readCodeAndReply_m7r1zg_k$ = function (_this__u8e3s4, channel, arg) {
2314
+ var tmp;
2315
+ try {
2316
+ var tmp0_safe_receiver = channel.read();
2317
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : charCodeAt(tmp0_safe_receiver, 0);
2318
+ var tmp_0;
2319
+ var tmp_1 = tmp1_safe_receiver;
2320
+ if ((tmp_1 == null ? null : new Char(tmp_1)) == null) {
2321
+ tmp_0 = null;
2322
+ } else {
2323
+ // Inline function 'kotlin.code' call
2324
+ tmp_0 = Char__toInt_impl_vasixd(tmp1_safe_receiver);
2325
+ }
2326
+ var tmp2_elvis_lhs = tmp_0;
2327
+ var code = tmp2_elvis_lhs == null ? -1 : tmp2_elvis_lhs;
2328
+ tmp = _this__u8e3s4.replyWith(Companion_getInstance_1().mgu_jyyt35_k$(_this__u8e3s4, arg, Companion_getInstance_6().ofInt(code)), VOID, []);
2329
+ } catch ($p) {
2330
+ var tmp_2;
2331
+ if ($p instanceof IllegalStateException) {
2332
+ var _unused_var__etf5q3 = $p;
2333
+ tmp_2 = _this__u8e3s4.replyFail(VOID, []);
2334
+ } else {
2335
+ throw $p;
2336
+ }
2337
+ tmp = tmp_2;
2338
+ }
2339
+ return tmp;
2340
+ };
2341
+ protoOf(IOPrimitiveUtils).readCharAndReply_szx3md_k$ = function (_this__u8e3s4, channel, arg) {
2342
+ var tmp;
2343
+ try {
2344
+ var tmp0_elvis_lhs = channel.read();
2345
+ var char = tmp0_elvis_lhs == null ? 'end_of_file' : tmp0_elvis_lhs;
2346
+ tmp = _this__u8e3s4.replyWith(Companion_getInstance_1().mgu_jyyt35_k$(_this__u8e3s4, arg, Companion_getInstance_0().of(char)), VOID, []);
2347
+ } catch ($p) {
2348
+ var tmp_0;
2349
+ if ($p instanceof IllegalStateException) {
2350
+ var _unused_var__etf5q3 = $p;
2351
+ tmp_0 = _this__u8e3s4.replyFail(VOID, []);
2352
+ } else {
2353
+ throw $p;
2354
+ }
2355
+ tmp = tmp_0;
2356
+ }
2357
+ return tmp;
2358
+ };
2359
+ protoOf(IOPrimitiveUtils).readTermAndReply_11biz4_k$ = function (_this__u8e3s4, channel, arg, lastIsInfoList) {
2360
+ try {
2361
+ var termsChannel = asTermChannel(channel, _this__u8e3s4.context.get_operators_z0nmfu_k$());
2362
+ var tmp;
2363
+ if (lastIsInfoList) {
2364
+ tmp = this.ensuringArgumentIsValidInfoList_2j0pim_k$(_this__u8e3s4, get_lastIndex(_this__u8e3s4.arguments));
2365
+ } else {
2366
+ tmp = emptyList();
2367
+ }
2368
+ var infoList = tmp;
2369
+ if (!termsChannel.get_available_3mf9b4_k$())
2370
+ return _this__u8e3s4.replyFail(VOID, []);
2371
+ var read = termsChannel.read();
2372
+ var tmp_0;
2373
+ if (read == null) {
2374
+ tmp_0 = _this__u8e3s4.replyFail(VOID, []);
2375
+ } else {
2376
+ var variables_0 = variables(this, toList_0(read.get_variables_75f0zy_k$()));
2377
+ var variableNames_0 = variableNames(this, toAssignments_0(this, read.get_variables_75f0zy_k$()));
2378
+ var singletons_0 = singletons(this, toAssignments(this, _get_singletons__bihqrn(this, read)));
2379
+ var tmp_1;
2380
+ if (infoList == null) {
2381
+ tmp_1 = null;
2382
+ } else {
2383
+ // Inline function 'kotlin.let' call
2384
+ var u = _this__u8e3s4.context.get_unificator_xw6v3j_k$();
2385
+ tmp_1 = getInfo(IOPrimitiveUtils_getInstance(), infoList, u, _get_INFO_SINGLETONS_PATTERN__y21s87(IOPrimitiveUtils_getInstance()), singletons_0).plus(getInfo(IOPrimitiveUtils_getInstance(), infoList, u, _get_INFO_VARIABLES_PATTERN__bhp1h0(IOPrimitiveUtils_getInstance()), variables_0)).plus(getInfo(IOPrimitiveUtils_getInstance(), infoList, u, _get_INFO_VARIABLE_NAMES_PATTERN__j3oaom(IOPrimitiveUtils_getInstance()), variableNames_0));
2386
+ }
2387
+ var tmp1_elvis_lhs = tmp_1;
2388
+ var info = tmp1_elvis_lhs == null ? Companion_getInstance_1().mgu_jyyt35_k$(_this__u8e3s4, last(_this__u8e3s4.arguments), Companion_instance_4.of([variables_0, variableNames_0, singletons_0])) : tmp1_elvis_lhs;
2389
+ tmp_0 = _this__u8e3s4.replyWith(Companion_getInstance_1().mgu_jyyt35_k$(_this__u8e3s4, arg, read).plus(info), VOID, []);
2390
+ }
2391
+ return tmp_0;
2392
+ } catch ($p) {
2393
+ if ($p instanceof IllegalStateException) {
2394
+ var e = $p;
2395
+ throw Companion_instance_2.forUncaughtKtException(_this__u8e3s4.context, e);
2396
+ } else {
2397
+ if ($p instanceof ParseException) {
2398
+ var e_0 = $p;
2399
+ var tmp_2 = Companion_instance_10;
2400
+ var tmp_3 = channel.get_streamTerm_v3iy6t_k$().toString();
2401
+ var tmp_4 = e_0.line;
2402
+ var tmp_5 = e_0.column;
2403
+ var tmp2_elvis_lhs = e_0.message;
2404
+ throw tmp_2.whileParsingTerm(_this__u8e3s4.context, tmp_3, tmp_4, tmp_5, tmp2_elvis_lhs == null ? '<no details provided>' : tmp2_elvis_lhs);
2405
+ } else {
2406
+ throw $p;
2407
+ }
2408
+ }
2409
+ }
2410
+ };
2411
+ protoOf(IOPrimitiveUtils).readTermAndReply$default_yi3mi7_k$ = function (_this__u8e3s4, channel, arg, lastIsInfoList, $super) {
2412
+ lastIsInfoList = lastIsInfoList === VOID ? false : lastIsInfoList;
2413
+ return $super === VOID ? this.readTermAndReply_11biz4_k$(_this__u8e3s4, channel, arg, lastIsInfoList) : $super.readTermAndReply_11biz4_k$.call(this, _this__u8e3s4, channel, arg, lastIsInfoList);
2414
+ };
2415
+ protoOf(IOPrimitiveUtils).open_28mql5_k$ = function (_this__u8e3s4, third) {
2416
+ var url = this.ensuringArgumentIsUrl_7mlsff_k$(_this__u8e3s4, 0);
2417
+ var mode = this.ensuringArgumentIsIOMode_v61n1v_k$(_this__u8e3s4, 1);
2418
+ Companion_getInstance_1().ensuringArgumentIsVariable_9sv3x6_k$(_this__u8e3s4, 2);
2419
+ var tmp;
2420
+ if (_this__u8e3s4.arguments.get_size_woubt6_k$() >= 4) {
2421
+ Companion_getInstance_1().ensuringArgumentIsList_n20mbc_k$(_this__u8e3s4, 3);
2422
+ var tmp_0 = _this__u8e3s4.arguments.get_c1px32_k$(3);
2423
+ var tmp_1 = (isInterface(tmp_0, List) ? tmp_0 : THROW_CCE()).toSequence_lzjcyk_k$();
2424
+ var tmp_2 = map(tmp_1, IOPrimitiveUtils$open$lambda(_this__u8e3s4));
2425
+ tmp = toSet(map(tmp_2, IOPrimitiveUtils$open$lambda_0(_this__u8e3s4)));
2426
+ } else {
2427
+ tmp = emptySet();
2428
+ }
2429
+ var options = tmp;
2430
+ var tmp$ret$0;
2431
+ $l$block: {
2432
+ // Inline function 'kotlin.collections.firstOrNull' call
2433
+ var _iterator__ex2g4s = options.iterator_jk1svi_k$();
2434
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
2435
+ var element = _iterator__ex2g4s.next_20eer_k$();
2436
+ if (Companion_getInstance_1().match_tf8j11_k$(_this__u8e3s4, _get_PROPERTY_ALIAS_PATTERN__wipd2s(IOPrimitiveUtils_getInstance()), element)) {
2437
+ tmp$ret$0 = element;
2438
+ break $l$block;
2439
+ }
2440
+ }
2441
+ tmp$ret$0 = null;
2442
+ }
2443
+ var tmp0_safe_receiver = tmp$ret$0;
2444
+ var alias = tmp0_safe_receiver == null ? null : _get_alias__jw26bj(this, tmp0_safe_receiver);
2445
+ var tmp_3;
2446
+ switch (mode.ordinal_1) {
2447
+ case 0:
2448
+ tmp_3 = replyOpeningStream_0(this, _this__u8e3s4, openInputChannel(url), third, alias);
2449
+ break;
2450
+ case 1:
2451
+ tmp_3 = replyOpeningStream(this, _this__u8e3s4, openOutputChannel(url, false), third, alias);
2452
+ break;
2453
+ case 2:
2454
+ tmp_3 = replyOpeningStream(this, _this__u8e3s4, openOutputChannel(url, true), third, alias);
2455
+ break;
2456
+ default:
2457
+ noWhenBranchMatchedException();
2458
+ break;
2459
+ }
2460
+ return tmp_3;
2461
+ };
2462
+ var IOPrimitiveUtils_instance;
2463
+ function IOPrimitiveUtils_getInstance() {
2464
+ if (IOPrimitiveUtils_instance == null)
2465
+ new IOPrimitiveUtils();
2466
+ return IOPrimitiveUtils_instance;
2467
+ }
2468
+ function Nl1() {
2469
+ Nl1_instance = this;
2470
+ NonBacktrackable_0.call(this, 'nl');
2471
+ }
2472
+ protoOf(Nl1).computeOne_6dkmes_k$ = function (_this__u8e3s4, first) {
2473
+ var channel = IOPrimitiveUtils_getInstance().ensuringArgumentIsOutputChannel_kmdrtk_k$(_this__u8e3s4, 0);
2474
+ var tmp;
2475
+ try {
2476
+ channel.write('\n');
2477
+ tmp = _this__u8e3s4.replySuccess(VOID, VOID, []);
2478
+ } catch ($p) {
2479
+ var tmp_0;
2480
+ if ($p instanceof IllegalStateException) {
2481
+ var _unused_var__etf5q3 = $p;
2482
+ tmp_0 = _this__u8e3s4.replyFail(VOID, []);
2483
+ } else {
2484
+ throw $p;
2485
+ }
2486
+ tmp = tmp_0;
2487
+ }
2488
+ return tmp;
2489
+ };
2490
+ protoOf(Nl1).computeOne_2tedul_k$ = function (_this__u8e3s4, first) {
2491
+ return this.computeOne_6dkmes_k$(_this__u8e3s4, first);
2492
+ };
2493
+ var Nl1_instance;
2494
+ function Nl1_getInstance() {
2495
+ if (Nl1_instance == null)
2496
+ new Nl1();
2497
+ return Nl1_instance;
2498
+ }
2499
+ function Open3() {
2500
+ Open3_instance = this;
2501
+ NonBacktrackable_1.call(this, 'open');
2502
+ }
2503
+ protoOf(Open3).computeOne_oq9h0q_k$ = function (_this__u8e3s4, first, second, third) {
2504
+ return IOPrimitiveUtils_getInstance().open_28mql5_k$(_this__u8e3s4, third);
2505
+ };
2506
+ protoOf(Open3).computeOne_bappeh_k$ = function (_this__u8e3s4, first, second, third) {
2507
+ return this.computeOne_oq9h0q_k$(_this__u8e3s4, first, second, third);
2508
+ };
2509
+ var Open3_instance;
2510
+ function Open3_getInstance() {
2511
+ if (Open3_instance == null)
2512
+ new Open3();
2513
+ return Open3_instance;
2514
+ }
2515
+ function Open4() {
2516
+ Open4_instance = this;
2517
+ NonBacktrackable_2.call(this, 'open');
2518
+ }
2519
+ protoOf(Open4).computeOne_q4u7r9_k$ = function (_this__u8e3s4, first, second, third, fourth) {
2520
+ return IOPrimitiveUtils_getInstance().open_28mql5_k$(_this__u8e3s4, third);
2521
+ };
2522
+ protoOf(Open4).computeOne_iyz53g_k$ = function (_this__u8e3s4, first, second, third, fourth) {
2523
+ return this.computeOne_q4u7r9_k$(_this__u8e3s4, first, second, third, fourth);
2524
+ };
2525
+ var Open4_instance;
2526
+ function Open4_getInstance() {
2527
+ if (Open4_instance == null)
2528
+ new Open4();
2529
+ return Open4_instance;
2530
+ }
2531
+ function PeekByte1() {
2532
+ PeekByte1_instance = this;
2533
+ NonBacktrackable_0.call(this, 'peek_byte');
2534
+ }
2535
+ protoOf(PeekByte1).computeOne_6dkmes_k$ = function (_this__u8e3s4, first) {
2536
+ return Companion_getInstance_1().notSupported$default_bmg7vb_k$(_this__u8e3s4);
2537
+ };
2538
+ protoOf(PeekByte1).computeOne_2tedul_k$ = function (_this__u8e3s4, first) {
2539
+ return this.computeOne_6dkmes_k$(_this__u8e3s4, first);
2540
+ };
2541
+ var PeekByte1_instance;
2542
+ function PeekByte1_getInstance() {
2543
+ if (PeekByte1_instance == null)
2544
+ new PeekByte1();
2545
+ return PeekByte1_instance;
2546
+ }
2547
+ function PeekByte2() {
2548
+ PeekByte2_instance = this;
2549
+ NonBacktrackable.call(this, 'peek_byte');
2550
+ }
2551
+ protoOf(PeekByte2).computeOne_sdv9lb_k$ = function (_this__u8e3s4, first, second) {
2552
+ return Companion_getInstance_1().notSupported$default_bmg7vb_k$(_this__u8e3s4);
2553
+ };
2554
+ protoOf(PeekByte2).computeOne_d8jipq_k$ = function (_this__u8e3s4, first, second) {
2555
+ return this.computeOne_sdv9lb_k$(_this__u8e3s4, first, second);
2556
+ };
2557
+ var PeekByte2_instance;
2558
+ function PeekByte2_getInstance() {
2559
+ if (PeekByte2_instance == null)
2560
+ new PeekByte2();
2561
+ return PeekByte2_instance;
2562
+ }
2563
+ function PeekChar1() {
2564
+ PeekChar1_instance = this;
2565
+ NonBacktrackable_0.call(this, 'peek_char');
2566
+ }
2567
+ protoOf(PeekChar1).computeOne_6dkmes_k$ = function (_this__u8e3s4, first) {
2568
+ IOPrimitiveUtils_getInstance().ensuringArgumentIsVarOrChar_zdzofu_k$(_this__u8e3s4, 0);
2569
+ return IOPrimitiveUtils_getInstance().peekCharAndReply_r80pc6_k$(_this__u8e3s4, IOPrimitiveUtils_getInstance().get_currentInputChannel_31908p_k$(_this__u8e3s4), first);
2570
+ };
2571
+ protoOf(PeekChar1).computeOne_2tedul_k$ = function (_this__u8e3s4, first) {
2572
+ return this.computeOne_6dkmes_k$(_this__u8e3s4, first);
2573
+ };
2574
+ var PeekChar1_instance;
2575
+ function PeekChar1_getInstance() {
2576
+ if (PeekChar1_instance == null)
2577
+ new PeekChar1();
2578
+ return PeekChar1_instance;
2579
+ }
2580
+ function PeekChar2() {
2581
+ PeekChar2_instance = this;
2582
+ NonBacktrackable.call(this, 'peek_char');
2583
+ }
2584
+ protoOf(PeekChar2).computeOne_sdv9lb_k$ = function (_this__u8e3s4, first, second) {
2585
+ var channel = IOPrimitiveUtils_getInstance().ensuringArgumentIsInputChannel_w9cvb1_k$(_this__u8e3s4, 0);
2586
+ IOPrimitiveUtils_getInstance().ensuringArgumentIsVarOrChar_zdzofu_k$(_this__u8e3s4, 1);
2587
+ return IOPrimitiveUtils_getInstance().peekCharAndReply_r80pc6_k$(_this__u8e3s4, channel, second);
2588
+ };
2589
+ protoOf(PeekChar2).computeOne_d8jipq_k$ = function (_this__u8e3s4, first, second) {
2590
+ return this.computeOne_sdv9lb_k$(_this__u8e3s4, first, second);
2591
+ };
2592
+ var PeekChar2_instance;
2593
+ function PeekChar2_getInstance() {
2594
+ if (PeekChar2_instance == null)
2595
+ new PeekChar2();
2596
+ return PeekChar2_instance;
2597
+ }
2598
+ function PeekCode1() {
2599
+ PeekCode1_instance = this;
2600
+ NonBacktrackable_0.call(this, 'peek_code');
2601
+ }
2602
+ protoOf(PeekCode1).computeOne_6dkmes_k$ = function (_this__u8e3s4, first) {
2603
+ IOPrimitiveUtils_getInstance().ensuringArgumentIsVarOrCharCode_tmh0sz_k$(_this__u8e3s4, 0);
2604
+ return IOPrimitiveUtils_getInstance().peekCodeAndReply_y06qz3_k$(_this__u8e3s4, IOPrimitiveUtils_getInstance().get_currentInputChannel_31908p_k$(_this__u8e3s4), first);
2605
+ };
2606
+ protoOf(PeekCode1).computeOne_2tedul_k$ = function (_this__u8e3s4, first) {
2607
+ return this.computeOne_6dkmes_k$(_this__u8e3s4, first);
2608
+ };
2609
+ var PeekCode1_instance;
2610
+ function PeekCode1_getInstance() {
2611
+ if (PeekCode1_instance == null)
2612
+ new PeekCode1();
2613
+ return PeekCode1_instance;
2614
+ }
2615
+ function PeekCode2() {
2616
+ PeekCode2_instance = this;
2617
+ NonBacktrackable.call(this, 'peek_code');
2618
+ }
2619
+ protoOf(PeekCode2).computeOne_sdv9lb_k$ = function (_this__u8e3s4, first, second) {
2620
+ var channel = IOPrimitiveUtils_getInstance().ensuringArgumentIsInputChannel_w9cvb1_k$(_this__u8e3s4, 0);
2621
+ IOPrimitiveUtils_getInstance().ensuringArgumentIsVarOrCharCode_tmh0sz_k$(_this__u8e3s4, 1);
2622
+ return IOPrimitiveUtils_getInstance().peekCodeAndReply_y06qz3_k$(_this__u8e3s4, channel, second);
2623
+ };
2624
+ protoOf(PeekCode2).computeOne_d8jipq_k$ = function (_this__u8e3s4, first, second) {
2625
+ return this.computeOne_sdv9lb_k$(_this__u8e3s4, first, second);
2626
+ };
2627
+ var PeekCode2_instance;
2628
+ function PeekCode2_getInstance() {
2629
+ if (PeekCode2_instance == null)
2630
+ new PeekCode2();
2631
+ return PeekCode2_instance;
2632
+ }
2633
+ function PutByte1() {
2634
+ PutByte1_instance = this;
2635
+ NonBacktrackable_0.call(this, 'put_byte');
2636
+ }
2637
+ protoOf(PutByte1).computeOne_6dkmes_k$ = function (_this__u8e3s4, first) {
2638
+ return Companion_getInstance_1().notSupported$default_bmg7vb_k$(_this__u8e3s4);
2639
+ };
2640
+ protoOf(PutByte1).computeOne_2tedul_k$ = function (_this__u8e3s4, first) {
2641
+ return this.computeOne_6dkmes_k$(_this__u8e3s4, first);
2642
+ };
2643
+ var PutByte1_instance;
2644
+ function PutByte1_getInstance() {
2645
+ if (PutByte1_instance == null)
2646
+ new PutByte1();
2647
+ return PutByte1_instance;
2648
+ }
2649
+ function PutByte2() {
2650
+ PutByte2_instance = this;
2651
+ NonBacktrackable.call(this, 'put_byte');
2652
+ }
2653
+ protoOf(PutByte2).computeOne_sdv9lb_k$ = function (_this__u8e3s4, first, second) {
2654
+ return Companion_getInstance_1().notSupported$default_bmg7vb_k$(_this__u8e3s4);
2655
+ };
2656
+ protoOf(PutByte2).computeOne_d8jipq_k$ = function (_this__u8e3s4, first, second) {
2657
+ return this.computeOne_sdv9lb_k$(_this__u8e3s4, first, second);
2658
+ };
2659
+ var PutByte2_instance;
2660
+ function PutByte2_getInstance() {
2661
+ if (PutByte2_instance == null)
2662
+ new PutByte2();
2663
+ return PutByte2_instance;
2664
+ }
2665
+ function PutChar1() {
2666
+ PutChar1_instance = this;
2667
+ NonBacktrackable_0.call(this, 'put_char');
2668
+ }
2669
+ protoOf(PutChar1).computeOne_6dkmes_k$ = function (_this__u8e3s4, first) {
2670
+ Companion_getInstance_1().ensuringArgumentIsChar_t2ym2o_k$(_this__u8e3s4, 0);
2671
+ var tmp = IOPrimitiveUtils_getInstance();
2672
+ var tmp_0 = IOPrimitiveUtils_getInstance().get_currentOutputChannel_jl8tcy_k$(_this__u8e3s4);
2673
+ return tmp.writeCharAndReply_7fanoe_k$(_this__u8e3s4, tmp_0, isInterface(first, Atom) ? first : THROW_CCE());
2674
+ };
2675
+ protoOf(PutChar1).computeOne_2tedul_k$ = function (_this__u8e3s4, first) {
2676
+ return this.computeOne_6dkmes_k$(_this__u8e3s4, first);
2677
+ };
2678
+ var PutChar1_instance;
2679
+ function PutChar1_getInstance() {
2680
+ if (PutChar1_instance == null)
2681
+ new PutChar1();
2682
+ return PutChar1_instance;
2683
+ }
2684
+ function PutChar2() {
2685
+ PutChar2_instance = this;
2686
+ NonBacktrackable.call(this, 'put_char');
2687
+ }
2688
+ protoOf(PutChar2).computeOne_sdv9lb_k$ = function (_this__u8e3s4, first, second) {
2689
+ var channel = IOPrimitiveUtils_getInstance().ensuringArgumentIsOutputChannel_kmdrtk_k$(_this__u8e3s4, 0);
2690
+ Companion_getInstance_1().ensuringArgumentIsChar_t2ym2o_k$(_this__u8e3s4, 1);
2691
+ var tmp = IOPrimitiveUtils_getInstance();
2692
+ return tmp.writeCharAndReply_7fanoe_k$(_this__u8e3s4, channel, isInterface(second, Atom) ? second : THROW_CCE());
2693
+ };
2694
+ protoOf(PutChar2).computeOne_d8jipq_k$ = function (_this__u8e3s4, first, second) {
2695
+ return this.computeOne_sdv9lb_k$(_this__u8e3s4, first, second);
2696
+ };
2697
+ var PutChar2_instance;
2698
+ function PutChar2_getInstance() {
2699
+ if (PutChar2_instance == null)
2700
+ new PutChar2();
2701
+ return PutChar2_instance;
2702
+ }
2703
+ function PutCode1() {
2704
+ PutCode1_instance = this;
2705
+ NonBacktrackable_0.call(this, 'put_code');
2706
+ }
2707
+ protoOf(PutCode1).computeOne_6dkmes_k$ = function (_this__u8e3s4, first) {
2708
+ Companion_getInstance_1().ensuringArgumentIsCharCode_64rreb_k$(_this__u8e3s4, 0);
2709
+ var tmp = IOPrimitiveUtils_getInstance();
2710
+ var tmp_0 = IOPrimitiveUtils_getInstance().get_currentOutputChannel_jl8tcy_k$(_this__u8e3s4);
2711
+ return tmp.writeCodeAndReply_pk9m0p_k$(_this__u8e3s4, tmp_0, isInterface(first, Integer) ? first : THROW_CCE());
2712
+ };
2713
+ protoOf(PutCode1).computeOne_2tedul_k$ = function (_this__u8e3s4, first) {
2714
+ return this.computeOne_6dkmes_k$(_this__u8e3s4, first);
2715
+ };
2716
+ var PutCode1_instance;
2717
+ function PutCode1_getInstance() {
2718
+ if (PutCode1_instance == null)
2719
+ new PutCode1();
2720
+ return PutCode1_instance;
2721
+ }
2722
+ function PutCode2() {
2723
+ PutCode2_instance = this;
2724
+ NonBacktrackable.call(this, 'put_code');
2725
+ }
2726
+ protoOf(PutCode2).computeOne_sdv9lb_k$ = function (_this__u8e3s4, first, second) {
2727
+ var channel = IOPrimitiveUtils_getInstance().ensuringArgumentIsOutputChannel_kmdrtk_k$(_this__u8e3s4, 0);
2728
+ Companion_getInstance_1().ensuringArgumentIsCharCode_64rreb_k$(_this__u8e3s4, 1);
2729
+ var tmp = IOPrimitiveUtils_getInstance();
2730
+ return tmp.writeCodeAndReply_pk9m0p_k$(_this__u8e3s4, channel, isInterface(second, Integer) ? second : THROW_CCE());
2731
+ };
2732
+ protoOf(PutCode2).computeOne_d8jipq_k$ = function (_this__u8e3s4, first, second) {
2733
+ return this.computeOne_sdv9lb_k$(_this__u8e3s4, first, second);
2734
+ };
2735
+ var PutCode2_instance;
2736
+ function PutCode2_getInstance() {
2737
+ if (PutCode2_instance == null)
2738
+ new PutCode2();
2739
+ return PutCode2_instance;
2740
+ }
2741
+ function Read1() {
2742
+ Read1_instance = this;
2743
+ NonBacktrackable_0.call(this, 'read');
2744
+ }
2745
+ protoOf(Read1).computeOne_6dkmes_k$ = function (_this__u8e3s4, first) {
2746
+ return IOPrimitiveUtils_getInstance().readTermAndReply$default_yi3mi7_k$(_this__u8e3s4, IOPrimitiveUtils_getInstance().get_currentInputChannel_31908p_k$(_this__u8e3s4), first);
2747
+ };
2748
+ protoOf(Read1).computeOne_2tedul_k$ = function (_this__u8e3s4, first) {
2749
+ return this.computeOne_6dkmes_k$(_this__u8e3s4, first);
2750
+ };
2751
+ var Read1_instance;
2752
+ function Read1_getInstance() {
2753
+ if (Read1_instance == null)
2754
+ new Read1();
2755
+ return Read1_instance;
2756
+ }
2757
+ function Read2() {
2758
+ Read2_instance = this;
2759
+ NonBacktrackable.call(this, 'read');
2760
+ }
2761
+ protoOf(Read2).computeOne_sdv9lb_k$ = function (_this__u8e3s4, first, second) {
2762
+ var channel = IOPrimitiveUtils_getInstance().ensuringArgumentIsInputChannel_w9cvb1_k$(_this__u8e3s4, 0);
2763
+ return IOPrimitiveUtils_getInstance().readTermAndReply$default_yi3mi7_k$(_this__u8e3s4, channel, second);
2764
+ };
2765
+ protoOf(Read2).computeOne_d8jipq_k$ = function (_this__u8e3s4, first, second) {
2766
+ return this.computeOne_sdv9lb_k$(_this__u8e3s4, first, second);
2767
+ };
2768
+ var Read2_instance;
2769
+ function Read2_getInstance() {
2770
+ if (Read2_instance == null)
2771
+ new Read2();
2772
+ return Read2_instance;
2773
+ }
2774
+ function ReadTerm2() {
2775
+ ReadTerm2_instance = this;
2776
+ NonBacktrackable.call(this, 'read_term');
2777
+ }
2778
+ protoOf(ReadTerm2).computeOne_sdv9lb_k$ = function (_this__u8e3s4, first, second) {
2779
+ return IOPrimitiveUtils_getInstance().readTermAndReply_11biz4_k$(_this__u8e3s4, IOPrimitiveUtils_getInstance().get_currentInputChannel_31908p_k$(_this__u8e3s4), first, true);
2780
+ };
2781
+ protoOf(ReadTerm2).computeOne_d8jipq_k$ = function (_this__u8e3s4, first, second) {
2782
+ return this.computeOne_sdv9lb_k$(_this__u8e3s4, first, second);
2783
+ };
2784
+ var ReadTerm2_instance;
2785
+ function ReadTerm2_getInstance() {
2786
+ if (ReadTerm2_instance == null)
2787
+ new ReadTerm2();
2788
+ return ReadTerm2_instance;
2789
+ }
2790
+ function ReadTerm3() {
2791
+ ReadTerm3_instance = this;
2792
+ NonBacktrackable_1.call(this, 'read_term');
2793
+ }
2794
+ protoOf(ReadTerm3).computeOne_oq9h0q_k$ = function (_this__u8e3s4, first, second, third) {
2795
+ var channel = IOPrimitiveUtils_getInstance().ensuringArgumentIsInputChannel_w9cvb1_k$(_this__u8e3s4, 0);
2796
+ return IOPrimitiveUtils_getInstance().readTermAndReply_11biz4_k$(_this__u8e3s4, channel, second, true);
2797
+ };
2798
+ protoOf(ReadTerm3).computeOne_bappeh_k$ = function (_this__u8e3s4, first, second, third) {
2799
+ return this.computeOne_oq9h0q_k$(_this__u8e3s4, first, second, third);
2800
+ };
2801
+ var ReadTerm3_instance;
2802
+ function ReadTerm3_getInstance() {
2803
+ if (ReadTerm3_instance == null)
2804
+ new ReadTerm3();
2805
+ return ReadTerm3_instance;
2806
+ }
2807
+ function SetInput$computeOne$lambda($this_computeOne, $channel) {
2808
+ return function ($this$replySuccess) {
2809
+ $this$replySuccess.resetInputChannels_dps5fb_k$($this_computeOne.context.get_inputChannels_uyf05t_k$().setCurrentChannel($channel));
2810
+ return Unit_instance;
2811
+ };
2812
+ }
2813
+ function SetInput() {
2814
+ SetInput_instance = this;
2815
+ NonBacktrackable_0.call(this, 'set_input');
2816
+ }
2817
+ protoOf(SetInput).computeOne_6dkmes_k$ = function (_this__u8e3s4, first) {
2818
+ var channel = IOPrimitiveUtils_getInstance().ensuringArgumentIsInputChannel_w9cvb1_k$(_this__u8e3s4, 0);
2819
+ return _this__u8e3s4.replySuccessBuildingSideEffects(VOID, VOID, SetInput$computeOne$lambda(_this__u8e3s4, channel));
2820
+ };
2821
+ protoOf(SetInput).computeOne_2tedul_k$ = function (_this__u8e3s4, first) {
2822
+ return this.computeOne_6dkmes_k$(_this__u8e3s4, first);
2823
+ };
2824
+ var SetInput_instance;
2825
+ function SetInput_getInstance() {
2826
+ if (SetInput_instance == null)
2827
+ new SetInput();
2828
+ return SetInput_instance;
2829
+ }
2830
+ function SetOutput$computeOne$lambda($this_computeOne, $channel) {
2831
+ return function ($this$replySuccess) {
2832
+ $this$replySuccess.resetOutputChannels_rs5zo3_k$($this_computeOne.context.get_outputChannels_ffvoca_k$().setCurrentChannel($channel));
2833
+ return Unit_instance;
2834
+ };
2835
+ }
2836
+ function SetOutput() {
2837
+ SetOutput_instance = this;
2838
+ NonBacktrackable_0.call(this, 'set_output');
2839
+ }
2840
+ protoOf(SetOutput).computeOne_6dkmes_k$ = function (_this__u8e3s4, first) {
2841
+ var channel = IOPrimitiveUtils_getInstance().ensuringArgumentIsOutputChannel_kmdrtk_k$(_this__u8e3s4, 0);
2842
+ return _this__u8e3s4.replySuccessBuildingSideEffects(VOID, VOID, SetOutput$computeOne$lambda(_this__u8e3s4, channel));
2843
+ };
2844
+ protoOf(SetOutput).computeOne_2tedul_k$ = function (_this__u8e3s4, first) {
2845
+ return this.computeOne_6dkmes_k$(_this__u8e3s4, first);
2846
+ };
2847
+ var SetOutput_instance;
2848
+ function SetOutput_getInstance() {
2849
+ if (SetOutput_instance == null)
2850
+ new SetOutput();
2851
+ return SetOutput_instance;
2852
+ }
2853
+ function SetTheory$setTheory$lambda($append, $solver) {
2854
+ return function ($this$replySuccess) {
2855
+ if ($append) {
2856
+ $this$replySuccess.addStaticClauses$default_ip7ihf_k$($solver.get_staticKb_a01l1u_k$());
2857
+ $this$replySuccess.addDynamicClauses$default_sr6lwk_k$($solver.get_dynamicKb_wvqg8j_k$());
2858
+ } else {
2859
+ $this$replySuccess.resetStaticKb_cogn56_k$($solver.get_staticKb_a01l1u_k$());
2860
+ $this$replySuccess.resetDynamicKb_skyfvb_k$($solver.get_dynamicKb_wvqg8j_k$());
2861
+ }
2862
+ $this$replySuccess.setOperators_3gc6gs_k$($solver.get_operators_z0nmfu_k$());
2863
+ $this$replySuccess.setFlags_k0bh7g_k$($solver.get_flags_irfhb2_k$());
2864
+ return Unit_instance;
2865
+ };
2866
+ }
2867
+ function SetTheory() {
2868
+ SetTheory_instance = this;
2869
+ NonBacktrackable_0.call(this, 'set_theory');
2870
+ }
2871
+ protoOf(SetTheory).computeOne_6dkmes_k$ = function (_this__u8e3s4, first) {
2872
+ Companion_getInstance_1().ensuringArgumentIsAtom_5kuj97_k$(_this__u8e3s4, 0);
2873
+ return this.setTheory_ratc22_k$(_this__u8e3s4, first.castTo_8vzplt_k$().get_value_j01efc_k$(), false);
2874
+ };
2875
+ protoOf(SetTheory).computeOne_2tedul_k$ = function (_this__u8e3s4, first) {
2876
+ return this.computeOne_6dkmes_k$(_this__u8e3s4, first);
2877
+ };
2878
+ protoOf(SetTheory).setTheory_ratc22_k$ = function (_this__u8e3s4, text, append) {
2879
+ try {
2880
+ var theory = Companion_instance_11.withOperatorSet(_this__u8e3s4.context.get_operators_z0nmfu_k$()).parseTheoryWithDefaultUnificator(text);
2881
+ var solver = _this__u8e3s4.context.createMutableSolver(VOID, VOID, VOID, Companion_instance_12.empty(_this__u8e3s4.context.get_unificator_xw6v3j_k$()), Companion_instance_13.empty(_this__u8e3s4.context.get_unificator_xw6v3j_k$()));
2882
+ solver.loadStaticKb(theory);
2883
+ return _this__u8e3s4.replySuccessBuildingSideEffects(VOID, VOID, SetTheory$setTheory$lambda(append, solver));
2884
+ } catch ($p) {
2885
+ if ($p instanceof ParseException) {
2886
+ var e = $p;
2887
+ var tmp = Companion_instance_10;
2888
+ var tmp_0 = e.clauseIndex;
2889
+ var tmp_1 = e.line;
2890
+ var tmp_2 = e.column;
2891
+ var tmp0_safe_receiver = e.message;
2892
+ var tmp_3;
2893
+ if (tmp0_safe_receiver == null) {
2894
+ tmp_3 = null;
2895
+ } else {
2896
+ // Inline function 'kotlin.text.replaceFirstChar' call
2897
+ var tmp_4;
2898
+ // Inline function 'kotlin.text.isNotEmpty' call
2899
+ if (charSequenceLength(tmp0_safe_receiver) > 0) {
2900
+ var it = charCodeAt(tmp0_safe_receiver, 0);
2901
+ var tmp$ret$2 = isLowerCase(it) ? titlecase(it) : toString_0(it);
2902
+ tmp_4 = toString(tmp$ret$2) + substring(tmp0_safe_receiver, 1);
2903
+ } else {
2904
+ tmp_4 = tmp0_safe_receiver;
2905
+ }
2906
+ tmp_3 = tmp_4;
2907
+ }
2908
+ var tmp1_elvis_lhs = tmp_3;
2909
+ throw tmp.whileParsingClauses(_this__u8e3s4.context, text, tmp_0, tmp_1, tmp_2, tmp1_elvis_lhs == null ? '<no detail provided>' : tmp1_elvis_lhs);
2910
+ } else {
2911
+ throw $p;
2912
+ }
2913
+ }
2914
+ };
2915
+ protoOf(SetTheory).setTheory$default_wxmulc_k$ = function (_this__u8e3s4, text, append, $super) {
2916
+ append = append === VOID ? true : append;
2917
+ return $super === VOID ? this.setTheory_ratc22_k$(_this__u8e3s4, text, append) : $super.setTheory_ratc22_k$.call(this, _this__u8e3s4, text, append);
2918
+ };
2919
+ var SetTheory_instance;
2920
+ function SetTheory_getInstance() {
2921
+ if (SetTheory_instance == null)
2922
+ new SetTheory();
2923
+ return SetTheory_instance;
2924
+ }
2925
+ function StreamProperty$computeAll$lambda(it) {
2926
+ return asSequence(it.get_values_ksazhn_k$());
2927
+ }
2928
+ function StreamProperty$computeAll$lambda_0($this_computeAll) {
2929
+ return function (it) {
2930
+ return to(it.get_streamTerm_v3iy6t_k$(), IOPrimitiveUtils_getInstance().propertiesOf_hpcm76_k$($this_computeAll, it));
2931
+ };
2932
+ }
2933
+ function StreamProperty$computeAll$lambda_1(_destruct__k2r9zo) {
2934
+ var streamTerm = _destruct__k2r9zo.component1_7eebsc_k$();
2935
+ var properties = _destruct__k2r9zo.component2_7eebsb_k$();
2936
+ return map(properties, StreamProperty$computeAll$lambda$lambda(streamTerm));
2937
+ }
2938
+ function StreamProperty$computeAll$lambda$lambda($streamTerm) {
2939
+ return function (it) {
2940
+ return to($streamTerm, it);
2941
+ };
2942
+ }
2943
+ function StreamProperty$computeAll$lambda_2($this_computeAll, $first, $second) {
2944
+ return function (_destruct__k2r9zo) {
2945
+ var streamTerm = _destruct__k2r9zo.component1_7eebsc_k$();
2946
+ var property = _destruct__k2r9zo.component2_7eebsb_k$();
2947
+ return Companion_getInstance_1().mgu_jyyt35_k$($this_computeAll, $first, streamTerm).plus(Companion_getInstance_1().mgu_jyyt35_k$($this_computeAll, $second, property));
2948
+ };
2949
+ }
2950
+ function StreamProperty$computeAll$lambda_3(it) {
2951
+ return it.get_isSuccess_vybsc0_k$();
2952
+ }
2953
+ function StreamProperty$computeAll$lambda_4($this_computeAll) {
2954
+ return function (it) {
2955
+ return $this_computeAll.replyWith(it, VOID, []);
2956
+ };
2957
+ }
2958
+ function StreamProperty() {
2959
+ StreamProperty_instance = this;
2960
+ BinaryRelation.call(this, 'stream_property');
2961
+ }
2962
+ protoOf(StreamProperty).computeAll_3ok8b8_k$ = function (_this__u8e3s4, first, second) {
2963
+ IOPrimitiveUtils_getInstance().ensuringArgumentIsVarOrStream_l86imo_k$(_this__u8e3s4, 0);
2964
+ IOPrimitiveUtils_getInstance().ensuringArgumentIsStreamProperty_6yg2an_k$(_this__u8e3s4, 1);
2965
+ var tmp = sequenceOf([_this__u8e3s4.context.get_inputChannels_uyf05t_k$(), _this__u8e3s4.context.get_outputChannels_ffvoca_k$()]);
2966
+ var tmp_0 = distinct(flatMap(tmp, StreamProperty$computeAll$lambda));
2967
+ var tmp_1 = map(tmp_0, StreamProperty$computeAll$lambda_0(_this__u8e3s4));
2968
+ var tmp_2 = flatMap(tmp_1, StreamProperty$computeAll$lambda_1);
2969
+ var tmp_3 = map(tmp_2, StreamProperty$computeAll$lambda_2(_this__u8e3s4, first, second));
2970
+ var tmp_4 = filter(tmp_3, StreamProperty$computeAll$lambda_3);
2971
+ return map(tmp_4, StreamProperty$computeAll$lambda_4(_this__u8e3s4));
2972
+ };
2973
+ protoOf(StreamProperty).computeAll_i7sbzb_k$ = function (_this__u8e3s4, first, second) {
2974
+ return this.computeAll_3ok8b8_k$(_this__u8e3s4, first, second);
2975
+ };
2976
+ var StreamProperty_instance;
2977
+ function StreamProperty_getInstance() {
2978
+ if (StreamProperty_instance == null)
2979
+ new StreamProperty();
2980
+ return StreamProperty_instance;
2981
+ }
2982
+ function Write2() {
2983
+ Write2_instance = this;
2984
+ NonBacktrackable.call(this, 'write');
2985
+ }
2986
+ protoOf(Write2).computeOne_sdv9lb_k$ = function (_this__u8e3s4, first, second) {
2987
+ var channel = IOPrimitiveUtils_getInstance().ensuringArgumentIsOutputChannel_kmdrtk_k$(_this__u8e3s4, 0);
2988
+ return IOPrimitiveUtils_getInstance().writeTermAndReply_wyva0k_k$(_this__u8e3s4, channel, second, Companion_instance_7.default(_this__u8e3s4.context.get_operators_z0nmfu_k$()));
2989
+ };
2990
+ protoOf(Write2).computeOne_d8jipq_k$ = function (_this__u8e3s4, first, second) {
2991
+ return this.computeOne_sdv9lb_k$(_this__u8e3s4, first, second);
2992
+ };
2993
+ var Write2_instance;
2994
+ function Write2_getInstance() {
2995
+ if (Write2_instance == null)
2996
+ new Write2();
2997
+ return Write2_instance;
2998
+ }
2999
+ function WriteCanonical1() {
3000
+ WriteCanonical1_instance = this;
3001
+ NonBacktrackable_0.call(this, 'write_canonical');
3002
+ }
3003
+ protoOf(WriteCanonical1).computeOne_6dkmes_k$ = function (_this__u8e3s4, first) {
3004
+ return IOPrimitiveUtils_getInstance().writeTermAndReply_wyva0k_k$(_this__u8e3s4, IOPrimitiveUtils_getInstance().get_currentOutputChannel_jl8tcy_k$(_this__u8e3s4), first, Companion_instance_7.canonical());
3005
+ };
3006
+ protoOf(WriteCanonical1).computeOne_2tedul_k$ = function (_this__u8e3s4, first) {
3007
+ return this.computeOne_6dkmes_k$(_this__u8e3s4, first);
3008
+ };
3009
+ var WriteCanonical1_instance;
3010
+ function WriteCanonical1_getInstance() {
3011
+ if (WriteCanonical1_instance == null)
3012
+ new WriteCanonical1();
3013
+ return WriteCanonical1_instance;
3014
+ }
3015
+ function WriteCanonical2() {
3016
+ WriteCanonical2_instance = this;
3017
+ NonBacktrackable.call(this, 'write_canonical');
3018
+ }
3019
+ protoOf(WriteCanonical2).computeOne_sdv9lb_k$ = function (_this__u8e3s4, first, second) {
3020
+ var channel = IOPrimitiveUtils_getInstance().ensuringArgumentIsOutputChannel_kmdrtk_k$(_this__u8e3s4, 0);
3021
+ return IOPrimitiveUtils_getInstance().writeTermAndReply_wyva0k_k$(_this__u8e3s4, channel, second, Companion_instance_7.canonical());
3022
+ };
3023
+ protoOf(WriteCanonical2).computeOne_d8jipq_k$ = function (_this__u8e3s4, first, second) {
3024
+ return this.computeOne_sdv9lb_k$(_this__u8e3s4, first, second);
3025
+ };
3026
+ var WriteCanonical2_instance;
3027
+ function WriteCanonical2_getInstance() {
3028
+ if (WriteCanonical2_instance == null)
3029
+ new WriteCanonical2();
3030
+ return WriteCanonical2_instance;
3031
+ }
3032
+ function WriteEq1() {
3033
+ WriteEq1_instance = this;
3034
+ NonBacktrackable_0.call(this, 'writeq');
3035
+ }
3036
+ protoOf(WriteEq1).computeOne_6dkmes_k$ = function (_this__u8e3s4, first) {
3037
+ return IOPrimitiveUtils_getInstance().writeTermAndReply_wyva0k_k$(_this__u8e3s4, IOPrimitiveUtils_getInstance().get_currentOutputChannel_jl8tcy_k$(_this__u8e3s4), first, Companion_instance_7.readable());
3038
+ };
3039
+ protoOf(WriteEq1).computeOne_2tedul_k$ = function (_this__u8e3s4, first) {
3040
+ return this.computeOne_6dkmes_k$(_this__u8e3s4, first);
3041
+ };
3042
+ var WriteEq1_instance;
3043
+ function WriteEq1_getInstance() {
3044
+ if (WriteEq1_instance == null)
3045
+ new WriteEq1();
3046
+ return WriteEq1_instance;
3047
+ }
3048
+ function WriteEq2() {
3049
+ WriteEq2_instance = this;
3050
+ NonBacktrackable.call(this, 'writeq');
3051
+ }
3052
+ protoOf(WriteEq2).computeOne_sdv9lb_k$ = function (_this__u8e3s4, first, second) {
3053
+ var channel = IOPrimitiveUtils_getInstance().ensuringArgumentIsOutputChannel_kmdrtk_k$(_this__u8e3s4, 0);
3054
+ return IOPrimitiveUtils_getInstance().writeTermAndReply_wyva0k_k$(_this__u8e3s4, channel, second, Companion_instance_7.readable());
3055
+ };
3056
+ protoOf(WriteEq2).computeOne_d8jipq_k$ = function (_this__u8e3s4, first, second) {
3057
+ return this.computeOne_sdv9lb_k$(_this__u8e3s4, first, second);
3058
+ };
3059
+ var WriteEq2_instance;
3060
+ function WriteEq2_getInstance() {
3061
+ if (WriteEq2_instance == null)
3062
+ new WriteEq2();
3063
+ return WriteEq2_instance;
3064
+ }
3065
+ function WriteTerm2() {
3066
+ WriteTerm2_instance = this;
3067
+ NonBacktrackable.call(this, 'write_term');
3068
+ }
3069
+ protoOf(WriteTerm2).computeOne_sdv9lb_k$ = function (_this__u8e3s4, first, second) {
3070
+ var formatter = IOPrimitiveUtils_getInstance().ensuringArgumentIsFormatter_5l8dg0_k$(_this__u8e3s4, 1);
3071
+ return IOPrimitiveUtils_getInstance().writeTermAndReply_wyva0k_k$(_this__u8e3s4, IOPrimitiveUtils_getInstance().get_currentOutputChannel_jl8tcy_k$(_this__u8e3s4), first, formatter);
3072
+ };
3073
+ protoOf(WriteTerm2).computeOne_d8jipq_k$ = function (_this__u8e3s4, first, second) {
3074
+ return this.computeOne_sdv9lb_k$(_this__u8e3s4, first, second);
3075
+ };
3076
+ var WriteTerm2_instance;
3077
+ function WriteTerm2_getInstance() {
3078
+ if (WriteTerm2_instance == null)
3079
+ new WriteTerm2();
3080
+ return WriteTerm2_instance;
3081
+ }
3082
+ function WriteTerm3() {
3083
+ WriteTerm3_instance = this;
3084
+ NonBacktrackable_1.call(this, 'write_term');
3085
+ }
3086
+ protoOf(WriteTerm3).computeOne_oq9h0q_k$ = function (_this__u8e3s4, first, second, third) {
3087
+ var channel = IOPrimitiveUtils_getInstance().ensuringArgumentIsOutputChannel_kmdrtk_k$(_this__u8e3s4, 0);
3088
+ var formatter = IOPrimitiveUtils_getInstance().ensuringArgumentIsFormatter_5l8dg0_k$(_this__u8e3s4, 2);
3089
+ return IOPrimitiveUtils_getInstance().writeTermAndReply_wyva0k_k$(_this__u8e3s4, channel, second, formatter);
3090
+ };
3091
+ protoOf(WriteTerm3).computeOne_bappeh_k$ = function (_this__u8e3s4, first, second, third) {
3092
+ return this.computeOne_oq9h0q_k$(_this__u8e3s4, first, second, third);
3093
+ };
3094
+ var WriteTerm3_instance;
3095
+ function WriteTerm3_getInstance() {
3096
+ if (WriteTerm3_instance == null)
3097
+ new WriteTerm3();
3098
+ return WriteTerm3_instance;
3099
+ }
3100
+ function JsUrl_init_$Init$(url, $this) {
3101
+ JsUrl.call($this);
3102
+ var tmp;
3103
+ try {
3104
+ tmp = new URL(url);
3105
+ } catch ($p) {
3106
+ var tmp_0;
3107
+ if ($p instanceof Error) {
3108
+ var e = $p;
3109
+ throw InvalidUrlException_init_$Create$_0('Invalid URL: ' + url, e);
3110
+ } else {
3111
+ throw $p;
3112
+ }
3113
+ }
3114
+ var parsed = tmp;
3115
+ if (removeSuffix(parsed.protocol, ':').length === 1) {
3116
+ throw InvalidUrlException_init_$Create$('Invalid URL: ' + url);
3117
+ }
3118
+ $this.protocol_1 = removeSuffix(parsed.protocol, ':');
3119
+ $this.host_1 = parsed.hostname;
3120
+ $this.path_1 = parsed.pathname;
3121
+ $this.port_1 = toIntOrNull(parsed.port);
3122
+ var tmp_1 = $this;
3123
+ // Inline function 'kotlin.text.ifEmpty' call
3124
+ var this_0 = removePrefix(parsed.search, '?');
3125
+ var tmp_2;
3126
+ // Inline function 'kotlin.text.isEmpty' call
3127
+ if (charSequenceLength(this_0) === 0) {
3128
+ tmp_2 = null;
3129
+ } else {
3130
+ tmp_2 = this_0;
3131
+ }
3132
+ tmp_1.query_1 = tmp_2;
3133
+ $this.url_1 = url;
3134
+ return $this;
3135
+ }
3136
+ function JsUrl_init_$Create$(url) {
3137
+ return JsUrl_init_$Init$(url, objectCreate(protoOf(JsUrl)));
3138
+ }
3139
+ function JsUrl_init_$Init$_0(protocol, host, port, path, query, $this) {
3140
+ host = host === VOID ? '' : host;
3141
+ port = port === VOID ? null : port;
3142
+ path = path === VOID ? '' : path;
3143
+ query = query === VOID ? null : query;
3144
+ JsUrl.call($this);
3145
+ $this.protocol_1 = protocol;
3146
+ $this.host_1 = host;
3147
+ $this.port_1 = port;
3148
+ $this.path_1 = path;
3149
+ $this.query_1 = query;
3150
+ $this.url_1 = Companion_instance_15.toString_t652pn_k$(protocol, host, port, path, query);
3151
+ return $this;
3152
+ }
3153
+ function JsUrl_init_$Create$_0(protocol, host, port, path, query) {
3154
+ return JsUrl_init_$Init$_0(protocol, host, port, path, query, objectCreate(protoOf(JsUrl)));
3155
+ }
3156
+ function readLocalFile($this, action) {
3157
+ var tmp;
3158
+ try {
3159
+ // Inline function 'okio.use' call
3160
+ var this_0 = buffer(LocalFileSystem_getInstance().source_an8jm4_k$(toLocalPath($this)));
3161
+ var thrown = null;
3162
+ var tmp_0;
3163
+ try {
3164
+ tmp_0 = action(this_0);
3165
+ } catch ($p) {
3166
+ var tmp_1;
3167
+ if ($p instanceof Error) {
3168
+ var t = $p;
3169
+ thrown = t;
3170
+ tmp_1 = null;
3171
+ } else {
3172
+ throw $p;
3173
+ }
3174
+ tmp_0 = tmp_1;
3175
+ }
3176
+ finally {
3177
+ try {
3178
+ if (this_0 == null)
3179
+ null;
3180
+ else {
3181
+ this_0.close_yn9xrc_k$();
3182
+ }
3183
+ } catch ($p_0) {
3184
+ if ($p_0 instanceof Error) {
3185
+ var t_0 = $p_0;
3186
+ if (thrown == null) {
3187
+ thrown = t_0;
3188
+ } else {
3189
+ addSuppressed(thrown, t_0);
3190
+ }
3191
+ } else {
3192
+ throw $p_0;
3193
+ }
3194
+ }
3195
+ }
3196
+ var result = tmp_0;
3197
+ if (!(thrown == null))
3198
+ throw thrown;
3199
+ tmp = result;
3200
+ } catch ($p_1) {
3201
+ var tmp_2;
3202
+ if ($p_1 instanceof IOException) {
3203
+ var e = $p_1;
3204
+ throw IOException_init_$Create$_0(e.message, e);
3205
+ } else {
3206
+ throw $p_1;
3207
+ }
3208
+ }
3209
+ return tmp;
3210
+ }
3211
+ function JsUrl$readAsText$lambda(it) {
3212
+ return it.readUtf8_echivt_k$();
3213
+ }
3214
+ function JsUrl$readAsByteArray$lambda(it) {
3215
+ return it.readByteArray_52wnjv_k$();
3216
+ }
3217
+ protoOf(JsUrl).get_protocol_mv93kx_k$ = function () {
3218
+ return this.protocol_1;
3219
+ };
3220
+ protoOf(JsUrl).get_host_wonf8x_k$ = function () {
3221
+ return this.host_1;
3222
+ };
3223
+ protoOf(JsUrl).get_path_wos8ry_k$ = function () {
3224
+ return this.path_1;
3225
+ };
3226
+ protoOf(JsUrl).get_port_wosj4a_k$ = function () {
3227
+ return this.port_1;
3228
+ };
3229
+ protoOf(JsUrl).get_query_ixn1y7_k$ = function () {
3230
+ return this.query_1;
3231
+ };
3232
+ protoOf(JsUrl).readAsText_gtp5qj_k$ = function () {
3233
+ var tmp;
3234
+ if (this.get_isFile_evxosv_k$() && get_isNode()) {
3235
+ tmp = readLocalFile(this, JsUrl$readAsText$lambda);
3236
+ } else if (this.get_isFile_evxosv_k$()) {
3237
+ tmp = readText(this.path_1);
3238
+ } else {
3239
+ tmp = fetch(this.url_1, 'UTF-8');
3240
+ }
3241
+ return tmp;
3242
+ };
3243
+ protoOf(JsUrl).readAsText = function () {
3244
+ return this.readAsText_gtp5qj_k$();
3245
+ };
3246
+ protoOf(JsUrl).readAsByteArray_26c90p_k$ = function () {
3247
+ var tmp;
3248
+ if (this.get_isFile_evxosv_k$() && get_isNode()) {
3249
+ tmp = readLocalFile(this, JsUrl$readAsByteArray$lambda);
3250
+ } else if (this.get_isFile_evxosv_k$()) {
3251
+ tmp = readBin(this.path_1);
3252
+ } else {
3253
+ tmp = toByteArray(fetch(this.url_1));
3254
+ }
3255
+ return tmp;
3256
+ };
3257
+ protoOf(JsUrl).readAsByteArray = function () {
3258
+ return this.readAsByteArray_26c90p_k$();
3259
+ };
3260
+ protoOf(JsUrl).equals = function (other) {
3261
+ if (this === other)
3262
+ return true;
3263
+ if (other == null || !(this.constructor == other.constructor))
3264
+ return false;
3265
+ if (!(other instanceof JsUrl))
3266
+ THROW_CCE();
3267
+ if (!(this.url_1 === other.url_1))
3268
+ return false;
3269
+ return true;
3270
+ };
3271
+ protoOf(JsUrl).hashCode = function () {
3272
+ return getStringHashCode(this.url_1);
3273
+ };
3274
+ protoOf(JsUrl).toString = function () {
3275
+ return this.url_1;
3276
+ };
3277
+ function JsUrl() {
3278
+ }
3279
+ function get_REQUEST() {
3280
+ _init_properties_RemoteAndBrowserIO_kt__6j78jn();
3281
+ var tmp0 = REQUEST$delegate;
3282
+ var tmp = KProperty0;
3283
+ // Inline function 'kotlin.getValue' call
3284
+ getPropertyCallableRef('REQUEST', 0, tmp, _get_REQUEST_$ref_g5y4c1(), null);
3285
+ return tmp0.get_value_j01efc_k$();
3286
+ }
3287
+ var REQUEST$delegate;
3288
+ function get_isNode() {
3289
+ _init_properties_RemoteAndBrowserIO_kt__6j78jn();
3290
+ return !Info_getInstance().get_PLATFORM_c55ni4_k$().equals(Platform_BROWSER_getInstance());
3291
+ }
3292
+ function readText(path) {
3293
+ _init_properties_RemoteAndBrowserIO_kt__6j78jn();
3294
+ // Inline function 'kotlin.js.unsafeCast' call
3295
+ var tmp0_elvis_lhs = window.localStorage.getItem(path);
3296
+ var tmp;
3297
+ if (tmp0_elvis_lhs == null) {
3298
+ throw IOException_init_$Create$('No such entry in window.localStorage: ' + path);
3299
+ } else {
3300
+ tmp = tmp0_elvis_lhs;
3301
+ }
3302
+ return tmp;
3303
+ }
3304
+ function fetch(url, encoding) {
3305
+ encoding = encoding === VOID ? null : encoding;
3306
+ _init_properties_RemoteAndBrowserIO_kt__6j78jn();
3307
+ try {
3308
+ var response = get_REQUEST()('GET', url, {});
3309
+ // Inline function 'kotlin.js.unsafeCast' call
3310
+ return response.getBody(encoding);
3311
+ } catch ($p) {
3312
+ if ($p instanceof Error) {
3313
+ var e = $p;
3314
+ throw IOException_init_$Create$_0(e.message, e);
3315
+ } else {
3316
+ throw $p;
3317
+ }
3318
+ }
3319
+ }
3320
+ function readBin(path) {
3321
+ _init_properties_RemoteAndBrowserIO_kt__6j78jn();
3322
+ // Inline function 'kotlin.js.unsafeCast' call
3323
+ var tmp0_safe_receiver = window.localStorage.getItem(path);
3324
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : toByteArray(tmp0_safe_receiver);
3325
+ var tmp;
3326
+ if (tmp1_elvis_lhs == null) {
3327
+ throw IOException_init_$Create$('No such entry in window.localStorage: ' + path);
3328
+ } else {
3329
+ tmp = tmp1_elvis_lhs;
3330
+ }
3331
+ return tmp;
3332
+ }
3333
+ function toByteArray(_this__u8e3s4) {
3334
+ _init_properties_RemoteAndBrowserIO_kt__6j78jn();
3335
+ return toByteArray_0(toUInt8Array(_this__u8e3s4));
3336
+ }
3337
+ function toByteArray_0(_this__u8e3s4) {
3338
+ _init_properties_RemoteAndBrowserIO_kt__6j78jn();
3339
+ var tmp = 0;
3340
+ var tmp_0 = _this__u8e3s4.length;
3341
+ var tmp_1 = new Int8Array(tmp_0);
3342
+ while (tmp < tmp_0) {
3343
+ var tmp_2 = tmp;
3344
+ // Inline function 'org.khronos.webgl.get' call
3345
+ // Inline function 'kotlin.js.asDynamic' call
3346
+ tmp_1[tmp_2] = _this__u8e3s4[tmp_2];
3347
+ tmp = tmp + 1 | 0;
3348
+ }
3349
+ return tmp_1;
3350
+ }
3351
+ function toUInt8Array(_this__u8e3s4) {
3352
+ _init_properties_RemoteAndBrowserIO_kt__6j78jn();
3353
+ return new Uint8Array(_this__u8e3s4);
3354
+ }
3355
+ function REQUEST$delegate$lambda() {
3356
+ _init_properties_RemoteAndBrowserIO_kt__6j78jn();
3357
+ return require('sync-request');
3358
+ }
3359
+ function _get_REQUEST_$ref_g5y4c1() {
3360
+ return constructCallableReference(function () {
3361
+ return get_REQUEST();
3362
+ }, 0, 0, 134);
3363
+ }
3364
+ var properties_initialized_RemoteAndBrowserIO_kt_w2uybl;
3365
+ function _init_properties_RemoteAndBrowserIO_kt__6j78jn() {
3366
+ if (!properties_initialized_RemoteAndBrowserIO_kt_w2uybl) {
3367
+ properties_initialized_RemoteAndBrowserIO_kt_w2uybl = true;
3368
+ REQUEST$delegate = lazy(REQUEST$delegate$lambda);
3369
+ }
3370
+ }
3371
+ function get_platformFileSystem() {
3372
+ _init_properties_UrlUtilsJs_kt__dw3tit();
3373
+ return platformFileSystem;
3374
+ }
3375
+ var platformFileSystem;
3376
+ function get_FILE_URL_TO_PATH() {
3377
+ _init_properties_UrlUtilsJs_kt__dw3tit();
3378
+ var tmp0 = FILE_URL_TO_PATH$delegate;
3379
+ var tmp = KProperty0;
3380
+ // Inline function 'kotlin.getValue' call
3381
+ getPropertyCallableRef('FILE_URL_TO_PATH', 0, tmp, _get_FILE_URL_TO_PATH_$ref_kwvzgc(), null);
3382
+ return tmp0.get_value_j01efc_k$();
3383
+ }
3384
+ var FILE_URL_TO_PATH$delegate;
3385
+ function openInputChannel(_this__u8e3s4) {
3386
+ _init_properties_UrlUtilsJs_kt__dw3tit();
3387
+ var tmp;
3388
+ if (_this__u8e3s4.get_isFile_evxosv_k$() && get_isNode()) {
3389
+ tmp = wrappingIOException(openInputChannel$lambda(_this__u8e3s4));
3390
+ } else {
3391
+ tmp = Companion_instance.ofString(_this__u8e3s4.readAsText());
3392
+ }
3393
+ return tmp;
3394
+ }
3395
+ function openOutputChannel(_this__u8e3s4, append) {
3396
+ append = append === VOID ? false : append;
3397
+ _init_properties_UrlUtilsJs_kt__dw3tit();
3398
+ if (!_this__u8e3s4.get_isFile_evxosv_k$() || !get_isNode()) {
3399
+ throw IOException_init_$Create$('Writing not supported for ' + toString(_this__u8e3s4));
3400
+ }
3401
+ var path = toLocalPath(_this__u8e3s4);
3402
+ return wrappingIOException(openOutputChannel$lambda(append, path));
3403
+ }
3404
+ function fileUrl(path) {
3405
+ _init_properties_UrlUtilsJs_kt__dw3tit();
3406
+ return JsUrl_init_$Create$_0('file', VOID, VOID, path);
3407
+ }
3408
+ function remoteUrl(protocol, host, port, path, query) {
3409
+ host = host === VOID ? '' : host;
3410
+ port = port === VOID ? null : port;
3411
+ path = path === VOID ? '' : path;
3412
+ query = query === VOID ? null : query;
3413
+ _init_properties_UrlUtilsJs_kt__dw3tit();
3414
+ return JsUrl_init_$Create$_0(protocol, host, port, path, query);
3415
+ }
3416
+ function parseUrl(string) {
3417
+ _init_properties_UrlUtilsJs_kt__dw3tit();
3418
+ return JsUrl_init_$Create$(string);
3419
+ }
3420
+ function wrappingIOException(action) {
3421
+ _init_properties_UrlUtilsJs_kt__dw3tit();
3422
+ var tmp;
3423
+ try {
3424
+ tmp = action();
3425
+ } catch ($p) {
3426
+ var tmp_0;
3427
+ if ($p instanceof IOException) {
3428
+ var e = $p;
3429
+ throw IOException_init_$Create$_0(e.message, e);
3430
+ } else {
3431
+ throw $p;
3432
+ }
3433
+ }
3434
+ return tmp;
3435
+ }
3436
+ function toLocalPath(_this__u8e3s4) {
3437
+ _init_properties_UrlUtilsJs_kt__dw3tit();
3438
+ var tmp;
3439
+ try {
3440
+ var tmp_0 = Companion_getInstance_7();
3441
+ var tmp_1 = get_FILE_URL_TO_PATH()(toString(_this__u8e3s4));
3442
+ tmp = tmp_0.toPath$default_vs59ry_k$((!(tmp_1 == null) ? typeof tmp_1 === 'string' : false) ? tmp_1 : THROW_CCE());
3443
+ } catch ($p) {
3444
+ var tmp_2;
3445
+ if ($p instanceof Error) {
3446
+ var _unused_var__etf5q3 = $p;
3447
+ tmp_2 = Companion_getInstance_7().toPath$default_vs59ry_k$(_this__u8e3s4.get_path_wos8ry_k$());
3448
+ } else {
3449
+ throw $p;
3450
+ }
3451
+ tmp = tmp_2;
3452
+ }
3453
+ return tmp;
3454
+ }
3455
+ function FILE_URL_TO_PATH$delegate$lambda() {
3456
+ _init_properties_UrlUtilsJs_kt__dw3tit();
3457
+ return eval('require')('url').fileURLToPath;
3458
+ }
3459
+ function _get_FILE_URL_TO_PATH_$ref_kwvzgc() {
3460
+ return constructCallableReference(function () {
3461
+ return get_FILE_URL_TO_PATH();
3462
+ }, 0, 0, 135);
3463
+ }
3464
+ function openInputChannel$lambda($this_openInputChannel) {
3465
+ return function () {
3466
+ return new SourceInputChannel(buffer(LocalFileSystem_getInstance().source_an8jm4_k$(toLocalPath($this_openInputChannel))));
3467
+ };
3468
+ }
3469
+ function openOutputChannel$lambda($append, $path) {
3470
+ return function () {
3471
+ var sink = $append ? LocalFileSystem_getInstance().appendingSink$default_r7oz7x_k$($path) : LocalFileSystem_getInstance().sink$default_9jt55n_k$($path);
3472
+ return new SinkOutputChannel(buffer_0(sink));
3473
+ };
3474
+ }
3475
+ var properties_initialized_UrlUtilsJs_kt_66lob1;
3476
+ function _init_properties_UrlUtilsJs_kt__dw3tit() {
3477
+ if (!properties_initialized_UrlUtilsJs_kt_66lob1) {
3478
+ properties_initialized_UrlUtilsJs_kt_66lob1 = true;
3479
+ platformFileSystem = NodeJsFileSystem_getInstance();
3480
+ FILE_URL_TO_PATH$delegate = lazy(FILE_URL_TO_PATH$delegate$lambda);
3481
+ }
3482
+ }
3483
+ //region block: post-declaration
3484
+ protoOf(JsUrl).resolve = resolve;
3485
+ protoOf(JsUrl).div = div;
3486
+ protoOf(JsUrl).get_isFile_evxosv_k$ = get_isFile;
3487
+ protoOf(JsUrl).get_isHttp_evz74r_k$ = get_isHttp;
3488
+ //endregion
3489
+ //region block: init
3490
+ Companion_instance_15 = new Companion_0();
3491
+ //endregion
3492
+ //region block: exports
3493
+ _.$_$ = _.$_$ || {};
3494
+ _.$_$.a = IOLib_getInstance;
11
3495
  //endregion
12
3496
  return _;
13
3497
  }));