UNPKG

@earth-app/shovel

Version:

Kotlin Multiplatform Web Scraping Framework

1,367 lines (1,341 loc) 107 kB
(function (factory) { if (typeof define === 'function' && define.amd) define(['exports', './kotlin-kotlin-stdlib.js', './kotlinx-coroutines-core.js', './kotlinx-io-kotlinx-io-core.js', './kotlinx-atomicfu.js', './kotlinx-io-kotlinx-io-bytestring.js'], factory); else if (typeof exports === 'object') factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./kotlinx-coroutines-core.js'), require('./kotlinx-io-kotlinx-io-core.js'), require('./kotlinx-atomicfu.js'), require('./kotlinx-io-kotlinx-io-bytestring.js')); else { if (typeof globalThis['kotlin-kotlin-stdlib'] === 'undefined') { throw new Error("Error loading module 'ktor-ktor-io'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to 'ktor-ktor-io'."); } if (typeof globalThis['kotlinx-coroutines-core'] === 'undefined') { throw new Error("Error loading module 'ktor-ktor-io'. Its dependency 'kotlinx-coroutines-core' was not found. Please, check whether 'kotlinx-coroutines-core' is loaded prior to 'ktor-ktor-io'."); } if (typeof globalThis['kotlinx-io-kotlinx-io-core'] === 'undefined') { throw new Error("Error loading module 'ktor-ktor-io'. Its dependency 'kotlinx-io-kotlinx-io-core' was not found. Please, check whether 'kotlinx-io-kotlinx-io-core' is loaded prior to 'ktor-ktor-io'."); } if (typeof globalThis['kotlinx-atomicfu'] === 'undefined') { throw new Error("Error loading module 'ktor-ktor-io'. Its dependency 'kotlinx-atomicfu' was not found. Please, check whether 'kotlinx-atomicfu' is loaded prior to 'ktor-ktor-io'."); } if (typeof globalThis['kotlinx-io-kotlinx-io-bytestring'] === 'undefined') { throw new Error("Error loading module 'ktor-ktor-io'. Its dependency 'kotlinx-io-kotlinx-io-bytestring' was not found. Please, check whether 'kotlinx-io-kotlinx-io-bytestring' is loaded prior to 'ktor-ktor-io'."); } globalThis['ktor-ktor-io'] = factory(typeof globalThis['ktor-ktor-io'] === 'undefined' ? {} : globalThis['ktor-ktor-io'], globalThis['kotlin-kotlin-stdlib'], globalThis['kotlinx-coroutines-core'], globalThis['kotlinx-io-kotlinx-io-core'], globalThis['kotlinx-atomicfu'], globalThis['kotlinx-io-kotlinx-io-bytestring']); } }(function (_, kotlin_kotlin, kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core, kotlin_org_jetbrains_kotlinx_kotlinx_io_core, kotlin_org_jetbrains_kotlinx_atomicfu, kotlin_org_jetbrains_kotlinx_kotlinx_io_bytestring) { 'use strict'; //region block: imports var Companion_instance = kotlin_kotlin.$_$.u2; var Unit_instance = kotlin_kotlin.$_$.v2; var _Result___init__impl__xyqfz8 = kotlin_kotlin.$_$.j2; var protoOf = kotlin_kotlin.$_$.j8; var initMetadataForCompanion = kotlin_kotlin.$_$.u7; var initMetadataForObject = kotlin_kotlin.$_$.z7; var toString = kotlin_kotlin.$_$.pc; var hashCode = kotlin_kotlin.$_$.s7; var equals = kotlin_kotlin.$_$.m7; var initMetadataForClass = kotlin_kotlin.$_$.t7; var createFailure = kotlin_kotlin.$_$.hc; var Result = kotlin_kotlin.$_$.zb; var initMetadataForInterface = kotlin_kotlin.$_$.x7; var toString_0 = kotlin_kotlin.$_$.gb; var newThrowable = kotlin_kotlin.$_$.f8; var stackTraceToString = kotlin_kotlin.$_$.oc; var VOID = kotlin_kotlin.$_$.b; var isInterface = kotlin_kotlin.$_$.d8; var CoroutineImpl = kotlin_kotlin.$_$.h6; var fromInt = kotlin_kotlin.$_$.s6; var compare = kotlin_kotlin.$_$.o6; var numberToLong = kotlin_kotlin.$_$.v6; var add = kotlin_kotlin.$_$.m6; var intercepted = kotlin_kotlin.$_$.u5; var CancellableContinuationImpl = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.m; var noWhenBranchMatchedException = kotlin_kotlin.$_$.mc; var returnIfSuspended = kotlin_kotlin.$_$.g; var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.r5; var Long = kotlin_kotlin.$_$.wb; var initMetadataForCoroutine = kotlin_kotlin.$_$.v7; var Buffer = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.f; var atomic$ref$1 = kotlin_org_jetbrains_kotlinx_atomicfu.$_$.d; var convertToInt = kotlin_kotlin.$_$.p6; var IllegalStateException = kotlin_kotlin.$_$.ub; var IllegalStateException_init_$Init$ = kotlin_kotlin.$_$.m1; var captureStack = kotlin_kotlin.$_$.d7; var IOException_init_$Create$ = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.c; var decodeToString = kotlin_org_jetbrains_kotlinx_kotlinx_io_bytestring.$_$.d; var replace = kotlin_kotlin.$_$.ma; var indexOf = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.i; var THROW_CCE = kotlin_kotlin.$_$.bc; var equalsLong = kotlin_kotlin.$_$.r6; var get_ONE = kotlin_kotlin.$_$.l6; var toString_1 = kotlin_kotlin.$_$.m8; var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.i1; var subtract = kotlin_kotlin.$_$.y6; var EOFException_init_$Create$ = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.a; var readString = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.o; var closeFinally = kotlin_kotlin.$_$.gc; var readByteString = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.l; var EmptyCoroutineContext_getInstance = kotlin_kotlin.$_$.q2; var CoroutineScope = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.t; var launch = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.c1; var startCoroutineCancellable = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.l; var Continuation = kotlin_kotlin.$_$.b6; var initMetadataForFunctionReference = kotlin_kotlin.$_$.w7; var get_job = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.b1; var Job = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.u; var cancel = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.a1; var initMetadataForLambda = kotlin_kotlin.$_$.y7; var CancellationException_init_$Create$ = kotlin_kotlin.$_$.s; var CancellationException = kotlin_kotlin.$_$.q5; var CopyableThrowable = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.q; var readString_0 = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.m; var IOException = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.g; var IOException_init_$Init$ = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.d; var ArrayList_init_$Create$ = kotlin_kotlin.$_$.j; var listOf = kotlin_kotlin.$_$.o4; var IOException_init_$Create$_0 = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.e; var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.w; var charSequenceLength = kotlin_kotlin.$_$.i7; var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.l1; var readByteArray = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.j; var readString_1 = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.n; var encodeToByteArray = kotlin_kotlin.$_$.q9; var writeString = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.p; var AutoCloseable = kotlin_kotlin.$_$.lb; var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.b2; var replace_0 = kotlin_kotlin.$_$.na; var getStringHashCode = kotlin_kotlin.$_$.r7; var IOException_init_$Init$_0 = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.b; var charSequenceSubSequence = kotlin_kotlin.$_$.j7; var readByteArray_0 = kotlin_org_jetbrains_kotlinx_kotlinx_io_core.$_$.k; var isCharSequence = kotlin_kotlin.$_$.b8; var trim = kotlin_kotlin.$_$.jb; var toByte = kotlin_kotlin.$_$.k8; var decodeToString_0 = kotlin_kotlin.$_$.o9; var setOf = kotlin_kotlin.$_$.y4; var Dispatchers_getInstance = kotlin_org_jetbrains_kotlinx_kotlinx_coroutines_core.$_$.d; var charSequenceGet = kotlin_kotlin.$_$.h7; var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.h2; //endregion //region block: pre-declaration initMetadataForCompanion(Companion); initMetadataForObject(Empty, 'Empty'); initMetadataForClass(Closed, 'Closed'); function resume() { return this.n18().s8(Companion_getInstance().k18_1); } function resume_0(throwable) { var tmp = this.n18(); var tmp_0; if (throwable == null) { tmp_0 = null; } else { // Inline function 'kotlin.let' call // Inline function 'kotlin.Companion.failure' call var tmp$ret$2 = _Result___init__impl__xyqfz8(createFailure(throwable)); tmp_0 = new Result(tmp$ret$2); } var tmp1_elvis_lhs = tmp_0; return tmp.s8(tmp1_elvis_lhs == null ? Companion_getInstance().k18_1 : tmp1_elvis_lhs.bl_1); } initMetadataForInterface(Task, 'Task'); initMetadataForClass(Read, 'Read', VOID, VOID, [Task]); initMetadataForClass(Write, 'Write', VOID, VOID, [Task]); initMetadataForCoroutine($awaitContentCOROUTINE$, CoroutineImpl); initMetadataForCoroutine($flushCOROUTINE$, CoroutineImpl); initMetadataForCoroutine($flushAndCloseCOROUTINE$, CoroutineImpl); function awaitContent$default(min, $completion, $super) { min = min === VOID ? 1 : min; return $super === VOID ? this.u1a(min, $completion) : $super.u1a.call(this, min, $completion); } initMetadataForInterface(ByteReadChannel_1, 'ByteReadChannel', VOID, VOID, VOID, [1]); function get_autoFlush() { return false; } initMetadataForInterface(ByteWriteChannel, 'ByteWriteChannel', VOID, VOID, VOID, [0]); initMetadataForClass(ByteChannel, 'ByteChannel', ByteChannel, VOID, [ByteReadChannel_1, ByteWriteChannel], [1, 0]); initMetadataForClass(ConcurrentIOException, 'ConcurrentIOException', VOID, IllegalStateException); initMetadataForCoroutine($findNextCOROUTINE$, CoroutineImpl); initMetadataForCoroutine($advanceToNextPotentialMatchCOROUTINE$, CoroutineImpl); initMetadataForCoroutine($checkFullMatchCOROUTINE$, CoroutineImpl); initMetadataForClass(ByteChannelScanner, 'ByteChannelScanner', VOID, VOID, VOID, [1, 0]); initMetadataForClass(ByteReadChannel$Companion$Empty$1, VOID, VOID, VOID, [ByteReadChannel_1], [1]); initMetadataForCompanion(Companion_0); initMetadataForCoroutine($readRemainingCOROUTINE$, CoroutineImpl); initMetadataForCoroutine($discardCOROUTINE$, CoroutineImpl); initMetadataForCoroutine($readAvailableCOROUTINE$, CoroutineImpl); initMetadataForCoroutine($toByteArrayCOROUTINE$, CoroutineImpl); initMetadataForCoroutine($copyToCOROUTINE$, CoroutineImpl); initMetadataForCoroutine($skipIfFoundCOROUTINE$, CoroutineImpl); initMetadataForCoroutine($readPacketCOROUTINE$, CoroutineImpl); initMetadataForCoroutine($readUTF8LineToCOROUTINE$, CoroutineImpl); initMetadataForCoroutine($readBufferCOROUTINE$, CoroutineImpl); initMetadataForCoroutine($peekCOROUTINE$, CoroutineImpl); initMetadataForCoroutine($flushIfNeededCOROUTINE$, CoroutineImpl); initMetadataForClass(WriterJob, 'WriterJob'); initMetadataForClass(WriterScope, 'WriterScope', VOID, VOID, [CoroutineScope]); initMetadataForClass(NO_CALLBACK$1, VOID, VOID, VOID, [Continuation]); initMetadataForFunctionReference(ByteWriteChannel$flushAndClose$ref, VOID, VOID, [0]); initMetadataForLambda(writer$slambda, CoroutineImpl, VOID, [1]); initMetadataForClass(CloseToken, 'CloseToken'); initMetadataForCoroutine($awaitContentCOROUTINE$_0, CoroutineImpl); initMetadataForClass(CountedByteReadChannel, 'CountedByteReadChannel', VOID, VOID, [ByteReadChannel_1], [1]); initMetadataForClass(ClosedByteChannelException, 'ClosedByteChannelException', ClosedByteChannelException, IOException); initMetadataForClass(ClosedReadChannelException, 'ClosedReadChannelException', ClosedReadChannelException, ClosedByteChannelException); initMetadataForClass(ClosedWriteChannelException, 'ClosedWriteChannelException', ClosedWriteChannelException, ClosedByteChannelException); initMetadataForCompanion(Companion_1); initMetadataForClass(LineEndingMode, 'LineEndingMode'); initMetadataForClass(SourceByteReadChannel, 'SourceByteReadChannel', VOID, VOID, [ByteReadChannel_1], [1]); initMetadataForClass(MalformedInputException, 'MalformedInputException', VOID, IOException); initMetadataForClass(TooLongLineException, 'TooLongLineException', VOID, MalformedInputException); function close() { this.ip(); } initMetadataForInterface(ObjectPool, 'ObjectPool', VOID, VOID, [AutoCloseable]); initMetadataForClass(DefaultPool, 'DefaultPool', VOID, VOID, [ObjectPool]); initMetadataForClass(ByteArrayPool$1, VOID, VOID, DefaultPool); initMetadataForClass(NoPoolImpl, 'NoPoolImpl', VOID, VOID, [ObjectPool]); initMetadataForCompanion(Companion_2); initMetadataForClass(Charset, 'Charset'); initMetadataForObject(Charsets, 'Charsets'); initMetadataForClass(CharsetDecoder, 'CharsetDecoder'); initMetadataForClass(CharsetEncoder, 'CharsetEncoder'); initMetadataForClass(CharsetImpl, 'CharsetImpl', VOID, Charset); initMetadataForClass(CharsetEncoderImpl, 'CharsetEncoderImpl', VOID, CharsetEncoder); initMetadataForClass(CharsetDecoderImpl, 'CharsetDecoderImpl', VOID, CharsetDecoder); initMetadataForClass(toKtor$1); initMetadataForClass(TextDecoderFallback, 'TextDecoderFallback'); //endregion function Companion() { Companion_instance_0 = this; this.j18_1 = new Closed(null); var tmp = this; // Inline function 'kotlin.Companion.success' call tmp.k18_1 = _Result___init__impl__xyqfz8(Unit_instance); } var Companion_instance_0; function Companion_getInstance() { if (Companion_instance_0 == null) new Companion(); return Companion_instance_0; } function Empty() { } protoOf(Empty).toString = function () { return 'Empty'; }; protoOf(Empty).hashCode = function () { return -231472095; }; protoOf(Empty).equals = function (other) { if (this === other) return true; if (!(other instanceof Empty)) return false; return true; }; var Empty_instance; function Empty_getInstance() { return Empty_instance; } function Closed(cause) { this.l18_1 = cause; } protoOf(Closed).toString = function () { return 'Closed(cause=' + toString(this.l18_1) + ')'; }; protoOf(Closed).hashCode = function () { return this.l18_1 == null ? 0 : hashCode(this.l18_1); }; protoOf(Closed).equals = function (other) { if (this === other) return true; if (!(other instanceof Closed)) return false; if (!equals(this.l18_1, other.l18_1)) return false; return true; }; function Task() { } function Read(continuation) { this.r18_1 = continuation; this.s18_1 = null; if (get_DEVELOPMENT_MODE()) { var tmp = this; // Inline function 'kotlin.also' call var this_0 = newThrowable('ReadTask 0x' + toString_0(hashCode(this.r18_1), 16)); stackTraceToString(this_0); tmp.s18_1 = this_0; } } protoOf(Read).n18 = function () { return this.r18_1; }; protoOf(Read).m18 = function () { return this.s18_1; }; protoOf(Read).o18 = function () { return 'read'; }; function Write(continuation) { this.t18_1 = continuation; this.u18_1 = null; if (get_DEVELOPMENT_MODE()) { var tmp = this; // Inline function 'kotlin.also' call var this_0 = newThrowable('WriteTask 0x' + toString_0(hashCode(this.t18_1), 16)); stackTraceToString(this_0); tmp.u18_1 = this_0; } } protoOf(Write).n18 = function () { return this.t18_1; }; protoOf(Write).m18 = function () { return this.u18_1; }; protoOf(Write).o18 = function () { return 'write'; }; function moveFlushToReadBuffer($this) { // Inline function 'io.ktor.utils.io.locks.synchronized' call $this.y18_1; $this.w18_1.p16($this.a19_1); $this.x18_1 = 0; // Inline function 'io.ktor.utils.io.ByteChannel.resumeSlot' call var current = $this.z18_1.kotlinx$atomicfu$value; var tmp; if (current instanceof Write) { tmp = $this.z18_1.atomicfu$compareAndSet(current, Empty_instance); } else { tmp = false; } if (tmp) { current.p18(); } } function closeSlot($this, cause) { var closeContinuation = !(cause == null) ? new Closed(cause) : Companion_getInstance().j18_1; var continuation = $this.z18_1.atomicfu$getAndSet(closeContinuation); if (isInterface(continuation, Task)) { continuation.q18(cause); } } function ClosedReadChannelException$_init_$ref_ix0089() { var l = function (p0) { return new ClosedReadChannelException(p0); }; l.callableName = '<init>'; return l; } function ClosedWriteChannelException$_init_$ref_ef15ty() { var l = function (p0) { return new ClosedWriteChannelException(p0); }; l.callableName = '<init>'; return l; } function $awaitContentCOROUTINE$(_this__u8e3s4, min, resultContinuation) { CoroutineImpl.call(this, resultContinuation); this.l19_1 = _this__u8e3s4; this.m19_1 = min; } protoOf($awaitContentCOROUTINE$).p8 = function () { var suspendResult = this.j8_1; $sm: do try { var tmp = this.h8_1; switch (tmp) { case 0: this.i8_1 = 4; rethrowCloseCauseIfNeeded(this.l19_1); if (compare(this.l19_1.a19_1.a1(), fromInt(this.m19_1)) >= 0) return true; this.n19_1 = this.l19_1; this.h8_1 = 1; continue $sm; case 1: if (!(compare(add(numberToLong(this.l19_1.x18_1), this.l19_1.a19_1.a1()), fromInt(this.m19_1)) < 0 && this.l19_1.c19_1.kotlinx$atomicfu$value == null)) { this.h8_1 = 3; continue $sm; } this.h8_1 = 2; var cancellable = new CancellableContinuationImpl(intercepted(this), 1); cancellable.lq(); var tmp0 = this.n19_1; var tmp2 = new Read(cancellable); l$ret$1: do { var previous = tmp0.z18_1.kotlinx$atomicfu$value; if (!(previous instanceof Closed)) { if (!tmp0.z18_1.atomicfu$compareAndSet(previous, tmp2)) { tmp2.p18(); break l$ret$1; } } if (previous instanceof Read) { previous.q18(new ConcurrentIOException(tmp2.o18(), previous.m18())); } else { if (isInterface(previous, Task)) { previous.p18(); } else { if (previous instanceof Closed) { tmp2.q18(previous.l18_1); break l$ret$1; } else { if (!equals(previous, Empty_instance)) { noWhenBranchMatchedException(); } } } } if (!(compare(add(numberToLong(this.l19_1.x18_1), this.l19_1.a19_1.a1()), fromInt(this.m19_1)) < 0 && this.l19_1.c19_1.kotlinx$atomicfu$value == null)) { var current = tmp0.z18_1.kotlinx$atomicfu$value; var tmp_0; if (current instanceof Read) { tmp_0 = tmp0.z18_1.atomicfu$compareAndSet(current, Empty_instance); } else { tmp_0 = false; } if (tmp_0) { current.p18(); } } } while (false); suspendResult = returnIfSuspended(cancellable.tq(), this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; case 2: this.h8_1 = 1; continue $sm; case 3: if (compare(this.l19_1.a19_1.a1(), new Long(1048576, 0)) < 0) { moveFlushToReadBuffer(this.l19_1); } return compare(this.l19_1.a19_1.a1(), fromInt(this.m19_1)) >= 0; case 4: throw this.k8_1; } } catch ($p) { var e = $p; if (this.i8_1 === 4) { throw e; } else { this.h8_1 = this.i8_1; this.k8_1 = e; } } while (true); }; function $flushCOROUTINE$(_this__u8e3s4, resultContinuation) { CoroutineImpl.call(this, resultContinuation); this.w19_1 = _this__u8e3s4; } protoOf($flushCOROUTINE$).p8 = function () { var suspendResult = this.j8_1; $sm: do try { var tmp = this.h8_1; switch (tmp) { case 0: this.i8_1 = 4; rethrowCloseCauseIfNeeded(this.w19_1); this.w19_1.y19(); if (this.w19_1.x18_1 < 1048576) return Unit_instance; this.x19_1 = this.w19_1; this.h8_1 = 1; continue $sm; case 1: if (!(this.w19_1.x18_1 >= 1048576 && this.w19_1.c19_1.kotlinx$atomicfu$value == null)) { this.h8_1 = 3; continue $sm; } this.h8_1 = 2; var cancellable = new CancellableContinuationImpl(intercepted(this), 1); cancellable.lq(); var tmp0 = this.x19_1; var tmp2 = new Write(cancellable); l$ret$1: do { var previous = tmp0.z18_1.kotlinx$atomicfu$value; if (!(previous instanceof Closed)) { if (!tmp0.z18_1.atomicfu$compareAndSet(previous, tmp2)) { tmp2.p18(); break l$ret$1; } } if (previous instanceof Write) { previous.q18(new ConcurrentIOException(tmp2.o18(), previous.m18())); } else { if (isInterface(previous, Task)) { previous.p18(); } else { if (previous instanceof Closed) { tmp2.q18(previous.l18_1); break l$ret$1; } else { if (!equals(previous, Empty_instance)) { noWhenBranchMatchedException(); } } } } if (!(this.w19_1.x18_1 >= 1048576 && this.w19_1.c19_1.kotlinx$atomicfu$value == null)) { var current = tmp0.z18_1.kotlinx$atomicfu$value; var tmp_0; if (current instanceof Write) { tmp_0 = tmp0.z18_1.atomicfu$compareAndSet(current, Empty_instance); } else { tmp_0 = false; } if (tmp_0) { current.p18(); } } } while (false); suspendResult = returnIfSuspended(cancellable.tq(), this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; case 2: this.h8_1 = 1; continue $sm; case 3: return Unit_instance; case 4: throw this.k8_1; } } catch ($p) { var e = $p; if (this.i8_1 === 4) { throw e; } else { this.h8_1 = this.i8_1; this.k8_1 = e; } } while (true); }; function $flushAndCloseCOROUTINE$(_this__u8e3s4, resultContinuation) { CoroutineImpl.call(this, resultContinuation); this.h1a_1 = _this__u8e3s4; } protoOf($flushAndCloseCOROUTINE$).p8 = function () { var suspendResult = this.j8_1; $sm: do try { var tmp = this.h8_1; switch (tmp) { case 0: this.i8_1 = 4; var this_0 = this.h1a_1; this.i8_1 = 2; this.j1a_1 = Companion_instance; this.h8_1 = 1; suspendResult = this_0.k1a(this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; case 1: var tmp_0 = this; this.j1a_1; tmp_0.i1a_1 = _Result___init__impl__xyqfz8(Unit_instance); this.i8_1 = 4; this.h8_1 = 3; continue $sm; case 2: this.i8_1 = 4; var tmp_1 = this.k8_1; if (tmp_1 instanceof Error) { var e = this.k8_1; var tmp_2 = this; tmp_2.i1a_1 = _Result___init__impl__xyqfz8(createFailure(e)); this.h8_1 = 3; continue $sm; } else { throw this.k8_1; } case 3: this.i8_1 = 4; if (!this.h1a_1.c19_1.atomicfu$compareAndSet(null, get_CLOSED())) return Unit_instance; closeSlot(this.h1a_1, null); return Unit_instance; case 4: throw this.k8_1; } } catch ($p) { var e_0 = $p; if (this.i8_1 === 4) { throw e_0; } else { this.h8_1 = this.i8_1; this.k8_1 = e_0; } } while (true); }; function ByteChannel(autoFlush) { autoFlush = autoFlush === VOID ? false : autoFlush; this.v18_1 = autoFlush; this.w18_1 = new Buffer(); this.x18_1 = 0; this.y18_1 = new Object(); this.z18_1 = atomic$ref$1(Empty_instance); this.a19_1 = new Buffer(); this.b19_1 = new Buffer(); this.c19_1 = atomic$ref$1(null); } protoOf(ByteChannel).l1a = function () { return this.v18_1; }; protoOf(ByteChannel).m1a = function () { var tmp0_safe_receiver = this.c19_1.kotlinx$atomicfu$value; if (tmp0_safe_receiver == null) null; else { tmp0_safe_receiver.o1a(ClosedReadChannelException$_init_$ref_ix0089()); } if (this.a19_1.m15()) { moveFlushToReadBuffer(this); } return this.a19_1; }; protoOf(ByteChannel).p1a = function () { if (this.q1a()) { var tmp0_safe_receiver = this.c19_1.kotlinx$atomicfu$value; var tmp; if (tmp0_safe_receiver == null) { tmp = null; } else { tmp = tmp0_safe_receiver.o1a(ClosedWriteChannelException$_init_$ref_ef15ty()); } if (tmp == null) throw new ClosedWriteChannelException(); } return this.b19_1; }; protoOf(ByteChannel).r1a = function () { var tmp0_safe_receiver = this.c19_1.kotlinx$atomicfu$value; return tmp0_safe_receiver == null ? null : tmp0_safe_receiver.s1a(); }; protoOf(ByteChannel).q1a = function () { return !(this.c19_1.kotlinx$atomicfu$value == null); }; protoOf(ByteChannel).t1a = function () { return !(this.r1a() == null) || (this.q1a() && this.x18_1 === 0 && this.a19_1.m15()); }; protoOf(ByteChannel).u1a = function (min, $completion) { var tmp = new $awaitContentCOROUTINE$(this, min, $completion); tmp.j8_1 = Unit_instance; tmp.k8_1 = null; return tmp.p8(); }; protoOf(ByteChannel).k1a = function ($completion) { var tmp = new $flushCOROUTINE$(this, $completion); tmp.j8_1 = Unit_instance; tmp.k8_1 = null; return tmp.p8(); }; protoOf(ByteChannel).y19 = function () { if (this.b19_1.m15()) return Unit_instance; // Inline function 'io.ktor.utils.io.locks.synchronized' call this.y18_1; var count = convertToInt(this.b19_1.a1()); this.w18_1.d17(this.b19_1); this.x18_1 = this.x18_1 + count | 0; // Inline function 'io.ktor.utils.io.ByteChannel.resumeSlot' call var current = this.z18_1.kotlinx$atomicfu$value; var tmp; if (current instanceof Read) { tmp = this.z18_1.atomicfu$compareAndSet(current, Empty_instance); } else { tmp = false; } if (tmp) { current.p18(); } }; protoOf(ByteChannel).w3 = function () { this.y19(); if (!this.c19_1.atomicfu$compareAndSet(null, get_CLOSED())) return Unit_instance; closeSlot(this, null); }; protoOf(ByteChannel).w1a = function ($completion) { var tmp = new $flushAndCloseCOROUTINE$(this, $completion); tmp.j8_1 = Unit_instance; tmp.k8_1 = null; return tmp.p8(); }; protoOf(ByteChannel).x1a = function (cause) { if (!(this.c19_1.kotlinx$atomicfu$value == null)) return Unit_instance; var closedToken = new CloseToken(cause); this.c19_1.atomicfu$compareAndSet(null, closedToken); var wrappedCause = closedToken.s1a(); closeSlot(this, wrappedCause); }; protoOf(ByteChannel).toString = function () { return 'ByteChannel[' + hashCode(this) + ']'; }; function ConcurrentIOException(taskName, cause) { cause = cause === VOID ? null : cause; IllegalStateException_init_$Init$('Concurrent ' + taskName + ' attempts', cause, this); captureStack(this, ConcurrentIOException); } function ByteReadChannel(content, offset, length) { offset = offset === VOID ? 0 : offset; length = length === VOID ? content.length : length; // Inline function 'kotlin.also' call var this_0 = new Buffer(); this_0.v16(content, offset, offset + length | 0); var source = this_0; return ByteReadChannel_0(source); } function ByteReadChannel_0(source) { return new SourceByteReadChannel(source); } function buildPartialMatchTable($this) { var table = new Int32Array($this.z1a_1.a1()); var j = 0; var inductionVariable = 1; var last = $this.z1a_1.a1(); if (inductionVariable < last) do { var i = inductionVariable; inductionVariable = inductionVariable + 1 | 0; while (j > 0 && !($this.z1a_1.b1(i) === $this.z1a_1.b1(j))) { j = table[j - 1 | 0]; } if ($this.z1a_1.b1(i) === $this.z1a_1.b1(j)) { j = j + 1 | 0; } table[i] = j; } while (inductionVariable < last); return table; } function advanceToNextPotentialMatch($this, $completion) { var tmp = new $advanceToNextPotentialMatchCOROUTINE$($this, $completion); tmp.j8_1 = Unit_instance; tmp.k8_1 = null; return tmp.p8(); } function checkFullMatch($this, $completion) { var tmp = new $checkFullMatchCOROUTINE$($this, $completion); tmp.j8_1 = Unit_instance; tmp.k8_1 = null; return tmp.p8(); } function checkBounds($this, extra) { if (compare(add($this.f1b_1, extra), $this.b1b_1) > 0) { throw IOException_init_$Create$('Limit of ' + $this.b1b_1.toString() + ' bytes exceeded ' + ('while searching for "' + toSingleLineString($this, $this.z1a_1) + '"')); } } function toSingleLineString($this, _this__u8e3s4) { return replace(decodeToString(_this__u8e3s4), '\n', '\\n'); } function $findNextCOROUTINE$(_this__u8e3s4, ignoreMissing, resultContinuation) { CoroutineImpl.call(this, resultContinuation); this.k1c_1 = _this__u8e3s4; this.l1c_1 = ignoreMissing; } protoOf($findNextCOROUTINE$).p8 = function () { var suspendResult = this.j8_1; $sm: do try { var tmp = this.h8_1; switch (tmp) { case 0: this.i8_1 = 9; this.k1c_1.f1b_1 = new Long(0, 0); this.h8_1 = 1; continue $sm; case 1: if (!this.k1c_1.c1b_1.m15()) { this.m1c_1 = true; this.h8_1 = 3; continue $sm; } else { this.h8_1 = 2; suspendResult = this.k1c_1.y1a_1.v1a(VOID, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; } case 2: this.m1c_1 = suspendResult; this.h8_1 = 3; continue $sm; case 3: if (!this.m1c_1) { this.h8_1 = 7; continue $sm; } this.h8_1 = 4; suspendResult = advanceToNextPotentialMatch(this.k1c_1, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; case 4: this.h8_1 = 5; suspendResult = checkFullMatch(this.k1c_1, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; case 5: if (suspendResult) { return this.k1c_1.f1b_1; } else { this.h8_1 = 6; continue $sm; } case 6: this.h8_1 = 1; continue $sm; case 7: if (!this.l1c_1) { throw IOException_init_$Create$('Expected "' + toSingleLineString(this.k1c_1, this.k1c_1.z1a_1) + '" but encountered end of input'); } this.k1c_1.f1b_1 = add(this.k1c_1.f1b_1, this.k1c_1.e1b_1.p16(this.k1c_1.a1b_1.p1a())); this.h8_1 = 8; suspendResult = this.k1c_1.a1b_1.k1a(this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; case 8: return this.k1c_1.f1b_1; case 9: throw this.k8_1; } } catch ($p) { var e = $p; if (this.i8_1 === 9) { throw e; } else { this.h8_1 = this.i8_1; this.k8_1 = e; } } while (true); }; function $advanceToNextPotentialMatchCOROUTINE$(_this__u8e3s4, resultContinuation) { CoroutineImpl.call(this, resultContinuation); this.p1b_1 = _this__u8e3s4; } protoOf($advanceToNextPotentialMatchCOROUTINE$).p8 = function () { var suspendResult = this.j8_1; $sm: do try { var tmp = this.h8_1; switch (tmp) { case 0: this.i8_1 = 8; this.h8_1 = 1; continue $sm; case 1: if (!this.p1b_1.c1b_1.m15()) { this.q1b_1 = true; this.h8_1 = 3; continue $sm; } else { this.h8_1 = 2; suspendResult = this.p1b_1.y1a_1.v1a(VOID, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; } case 2: this.q1b_1 = suspendResult; this.h8_1 = 3; continue $sm; case 3: if (!this.q1b_1) { this.h8_1 = 7; continue $sm; } var nextMatch = indexOf(this.p1b_1.c1b_1, this.p1b_1.z1a_1.b1(0)); if (equalsLong(nextMatch, new Long(-1, -1))) { var tmp_0 = this.p1b_1.c1b_1; checkBounds(this.p1b_1, (tmp_0 instanceof Buffer ? tmp_0 : THROW_CCE()).a1()); this.p1b_1.f1b_1 = add(this.p1b_1.f1b_1, this.p1b_1.c1b_1.p16(this.p1b_1.a1b_1.p1a())); this.h8_1 = 5; suspendResult = flushIfNeeded(this.p1b_1.a1b_1, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; } else { checkBounds(this.p1b_1, nextMatch); var tmp_1 = this.p1b_1; var tmp_2 = this.p1b_1.f1b_1; var tmp_3 = this.p1b_1.a1b_1.p1a(); tmp_1.f1b_1 = add(tmp_2, this.p1b_1.c1b_1.m16(tmp_3 instanceof Buffer ? tmp_3 : THROW_CCE(), nextMatch)); this.h8_1 = 4; suspendResult = flushIfNeeded(this.p1b_1.a1b_1, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; } case 4: return Unit_instance; case 5: this.h8_1 = 6; continue $sm; case 6: this.h8_1 = 1; continue $sm; case 7: return Unit_instance; case 8: throw this.k8_1; } } catch ($p) { var e = $p; if (this.i8_1 === 8) { throw e; } else { this.h8_1 = this.i8_1; this.k8_1 = e; } } while (true); }; function $checkFullMatchCOROUTINE$(_this__u8e3s4, resultContinuation) { CoroutineImpl.call(this, resultContinuation); this.z1b_1 = _this__u8e3s4; } protoOf($checkFullMatchCOROUTINE$).p8 = function () { var suspendResult = this.j8_1; $sm: do try { var tmp = this.h8_1; switch (tmp) { case 0: this.i8_1 = 8; this.h8_1 = 1; continue $sm; case 1: if (!this.z1b_1.c1b_1.m15()) { this.b1c_1 = true; this.h8_1 = 3; continue $sm; } else { this.h8_1 = 2; suspendResult = this.z1b_1.y1a_1.v1a(VOID, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; } case 2: this.b1c_1 = suspendResult; this.h8_1 = 3; continue $sm; case 3: if (!this.b1c_1) { this.h8_1 = 7; continue $sm; } this.a1c_1 = this.z1b_1.c1b_1.p15(); if (this.z1b_1.g1b_1 > 0 && !(this.a1c_1 === this.z1b_1.z1a_1.b1(this.z1b_1.g1b_1))) { var oldMatchIndex = this.z1b_1.g1b_1; while (this.z1b_1.g1b_1 > 0 && !(this.a1c_1 === this.z1b_1.z1a_1.b1(this.z1b_1.g1b_1))) { this.z1b_1.g1b_1 = this.z1b_1.d1b_1[this.z1b_1.g1b_1 - 1 | 0]; } var retained = fromInt(oldMatchIndex - this.z1b_1.g1b_1 | 0); checkBounds(this.z1b_1, retained); var tmp_0 = this.z1b_1; var tmp_1 = this.z1b_1.f1b_1; var tmp_2 = this.z1b_1.a1b_1.p1a(); tmp_0.f1b_1 = add(tmp_1, this.z1b_1.e1b_1.m16(tmp_2 instanceof Buffer ? tmp_2 : THROW_CCE(), retained)); if (this.z1b_1.g1b_1 === 0 && !(this.a1c_1 === this.z1b_1.z1a_1.b1(this.z1b_1.g1b_1))) { this.h8_1 = 6; suspendResult = writeByte(this.z1b_1.a1b_1, this.a1c_1, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; } else { this.h8_1 = 4; continue $sm; } } else { this.h8_1 = 5; continue $sm; } case 4: this.h8_1 = 5; continue $sm; case 5: this.z1b_1.g1b_1 = this.z1b_1.g1b_1 + 1 | 0; if (this.z1b_1.g1b_1 === this.z1b_1.z1a_1.a1()) { return true; } this.z1b_1.e1b_1.e17(this.a1c_1); this.h8_1 = 1; continue $sm; case 6: var _unary__edvuaz = this.z1b_1.f1b_1; this.z1b_1.f1b_1 = add(_unary__edvuaz, get_ONE()); return false; case 7: return false; case 8: throw this.k8_1; } } catch ($p) { var e = $p; if (this.i8_1 === 8) { throw e; } else { this.h8_1 = this.i8_1; this.k8_1 = e; } } while (true); }; function ByteChannelScanner(channel, matchString, writeChannel, limit) { limit = limit === VOID ? new Long(-1, 2147483647) : limit; this.y1a_1 = channel; this.z1a_1 = matchString; this.a1b_1 = writeChannel; this.b1b_1 = limit; // Inline function 'kotlin.require' call if (!(this.z1a_1.a1() > 0)) { var message = 'Empty match string not permitted for scanning'; throw IllegalArgumentException_init_$Create$(toString_1(message)); } this.c1b_1 = this.y1a_1.m1a(); this.d1b_1 = buildPartialMatchTable(this); this.e1b_1 = new Buffer(); this.f1b_1 = new Long(0, 0); this.g1b_1 = 0; } protoOf(ByteChannelScanner).n1c = function (ignoreMissing, $completion) { var tmp = new $findNextCOROUTINE$(this, ignoreMissing, $completion); tmp.j8_1 = Unit_instance; tmp.k8_1 = null; return tmp.p8(); }; function ByteReadChannel$Companion$Empty$1() { this.o1c_1 = null; this.p1c_1 = new Buffer(); } protoOf(ByteReadChannel$Companion$Empty$1).r1a = function () { return this.o1c_1; }; protoOf(ByteReadChannel$Companion$Empty$1).t1a = function () { return true; }; protoOf(ByteReadChannel$Companion$Empty$1).m1a = function () { return this.p1c_1; }; protoOf(ByteReadChannel$Companion$Empty$1).u1a = function (min, $completion) { return false; }; protoOf(ByteReadChannel$Companion$Empty$1).x1a = function (cause) { }; function Companion_0() { Companion_instance_1 = this; var tmp = this; tmp.q1c_1 = new ByteReadChannel$Companion$Empty$1(); } var Companion_instance_1; function Companion_getInstance_0() { if (Companion_instance_1 == null) new Companion_0(); return Companion_instance_1; } function ByteReadChannel_1() { } function cancel_0(_this__u8e3s4) { _this__u8e3s4.x1a(IOException_init_$Create$('Channel was cancelled')); } function readRemaining(_this__u8e3s4, $completion) { var tmp = new $readRemainingCOROUTINE$(_this__u8e3s4, $completion); tmp.j8_1 = Unit_instance; tmp.k8_1 = null; return tmp.p8(); } function discard(_this__u8e3s4, max, $completion) { max = max === VOID ? new Long(-1, 2147483647) : max; var tmp = new $discardCOROUTINE$(_this__u8e3s4, max, $completion); tmp.j8_1 = Unit_instance; tmp.k8_1 = null; return tmp.p8(); } function readAvailable(_this__u8e3s4, buffer, offset, length, $completion) { offset = offset === VOID ? 0 : offset; length = length === VOID ? buffer.length - offset | 0 : length; var tmp = new $readAvailableCOROUTINE$(_this__u8e3s4, buffer, offset, length, $completion); tmp.j8_1 = Unit_instance; tmp.k8_1 = null; return tmp.p8(); } function toByteArray(_this__u8e3s4, $completion) { var tmp = new $toByteArrayCOROUTINE$(_this__u8e3s4, $completion); tmp.j8_1 = Unit_instance; tmp.k8_1 = null; return tmp.p8(); } function copyTo(_this__u8e3s4, channel, limit, $completion) { var tmp = new $copyToCOROUTINE$(_this__u8e3s4, channel, limit, $completion); tmp.j8_1 = Unit_instance; tmp.k8_1 = null; return tmp.p8(); } function skipIfFound(_this__u8e3s4, byteString, $completion) { var tmp = new $skipIfFoundCOROUTINE$(_this__u8e3s4, byteString, $completion); tmp.j8_1 = Unit_instance; tmp.k8_1 = null; return tmp.p8(); } function readPacket(_this__u8e3s4, packet, $completion) { var tmp = new $readPacketCOROUTINE$(_this__u8e3s4, packet, $completion); tmp.j8_1 = Unit_instance; tmp.k8_1 = null; return tmp.p8(); } function readUntil(_this__u8e3s4, matchString, writeChannel, limit, ignoreMissing, $completion) { limit = limit === VOID ? new Long(-1, 2147483647) : limit; ignoreMissing = ignoreMissing === VOID ? false : ignoreMissing; return (new ByteChannelScanner(_this__u8e3s4, matchString, writeChannel, limit)).n1c(ignoreMissing, $completion); } function readUTF8LineTo(_this__u8e3s4, out, max, lineEnding, $completion) { max = max === VOID ? 2147483647 : max; lineEnding = lineEnding === VOID ? Companion_getInstance_1().s1f_1 : lineEnding; var tmp = new $readUTF8LineToCOROUTINE$(_this__u8e3s4, out, max, lineEnding, $completion); tmp.j8_1 = Unit_instance; tmp.k8_1 = null; return tmp.p8(); } function rethrowCloseCauseIfNeeded(_this__u8e3s4) { var tmp0_safe_receiver = _this__u8e3s4.r1a(); if (tmp0_safe_receiver == null) null; else { // Inline function 'kotlin.let' call throw tmp0_safe_receiver; } } function rethrowCloseCauseIfNeeded_0(_this__u8e3s4) { var tmp0_safe_receiver = _this__u8e3s4.r1a(); if (tmp0_safe_receiver == null) null; else { // Inline function 'kotlin.let' call throw tmp0_safe_receiver; } } function get_availableForRead(_this__u8e3s4) { return convertToInt(_this__u8e3s4.m1a().l15().a1()); } function readBuffer(_this__u8e3s4, $completion) { var tmp = new $readBufferCOROUTINE$(_this__u8e3s4, $completion); tmp.j8_1 = Unit_instance; tmp.k8_1 = null; return tmp.p8(); } function peek(_this__u8e3s4, count, $completion) { var tmp = new $peekCOROUTINE$(_this__u8e3s4, count, $completion); tmp.j8_1 = Unit_instance; tmp.k8_1 = null; return tmp.p8(); } function rethrowCloseCauseIfNeeded_1(_this__u8e3s4) { var tmp0_safe_receiver = _this__u8e3s4.r1a(); if (tmp0_safe_receiver == null) null; else { // Inline function 'kotlin.let' call throw tmp0_safe_receiver; } } function readUTF8LineTo$checkLineEndingAllowed($lineEnding, lineEndingToCheck) { if (!LineEndingMode__contains_impl_q5pr68($lineEnding, lineEndingToCheck)) { throw IOException_init_$Create$('Unexpected line ending ' + LineEndingMode__toString_impl_j4h76r(lineEndingToCheck) + ', while expected ' + LineEndingMode__toString_impl_j4h76r($lineEnding)); } } function $readRemainingCOROUTINE$(_this__u8e3s4, resultContinuation) { CoroutineImpl.call(this, resultContinuation); this.z1c_1 = _this__u8e3s4; } protoOf($readRemainingCOROUTINE$).p8 = function () { var suspendResult = this.j8_1; $sm: do try { var tmp = this.h8_1; switch (tmp) { case 0: this.i8_1 = 4; this.a1d_1 = BytePacketBuilder(); this.h8_1 = 1; continue $sm; case 1: if (!!this.z1c_1.t1a()) { this.h8_1 = 3; continue $sm; } this.a1d_1.d17(this.z1c_1.m1a()); this.h8_1 = 2; suspendResult = this.z1c_1.v1a(VOID, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; case 2: this.h8_1 = 1; continue $sm; case 3: rethrowCloseCauseIfNeeded_0(this.z1c_1); return this.a1d_1.l15(); case 4: throw this.k8_1; } } catch ($p) { var e = $p; if (this.i8_1 === 4) { throw e; } else { this.h8_1 = this.i8_1; this.k8_1 = e; } } while (true); }; function $discardCOROUTINE$(_this__u8e3s4, max, resultContinuation) { CoroutineImpl.call(this, resultContinuation); this.j1d_1 = _this__u8e3s4; this.k1d_1 = max; } protoOf($discardCOROUTINE$).p8 = function () { var suspendResult = this.j8_1; $sm: do try { var tmp = this.h8_1; switch (tmp) { case 0: this.i8_1 = 5; this.l1d_1 = this.k1d_1; this.h8_1 = 1; continue $sm; case 1: if (!(compare(this.l1d_1, new Long(0, 0)) > 0 && !this.j1d_1.t1a())) { this.h8_1 = 4; continue $sm; } if (get_availableForRead(this.j1d_1) === 0) { this.h8_1 = 2; suspendResult = this.j1d_1.v1a(VOID, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; } else { this.h8_1 = 3; continue $sm; } case 2: this.h8_1 = 3; continue $sm; case 3: var tmp0 = this.l1d_1; var b = get_remaining(this.j1d_1.m1a()); var count = compare(tmp0, b) <= 0 ? tmp0 : b; discard_0(this.j1d_1.m1a(), count); this.l1d_1 = subtract(this.l1d_1, count); this.h8_1 = 1; continue $sm; case 4: return subtract(this.k1d_1, this.l1d_1); case 5: throw this.k8_1; } } catch ($p) { var e = $p; if (this.i8_1 === 5) { throw e; } else { this.h8_1 = this.i8_1; this.k8_1 = e; } } while (true); }; function $readAvailableCOROUTINE$(_this__u8e3s4, buffer, offset, length, resultContinuation) { CoroutineImpl.call(this, resultContinuation); this.u1d_1 = _this__u8e3s4; this.v1d_1 = buffer; this.w1d_1 = offset; this.x1d_1 = length; } protoOf($readAvailableCOROUTINE$).p8 = function () { var suspendResult = this.j8_1; $sm: do try { var tmp = this.h8_1; switch (tmp) { case 0: this.i8_1 = 3; if (this.u1d_1.t1a()) return -1; if (this.u1d_1.m1a().m15()) { this.h8_1 = 1; suspendResult = this.u1d_1.v1a(VOID, this); if (suspendResult === get_COROUTINE_SUSPENDED()) { return suspendResult; } continue $sm; } else { this.h8_1 = 2; continue $sm; } case 1: this.h8_1 = 2; continue $sm; case 2: if (this.u1d_1.t1a()) return -1; return readAvailable_0(this.u1d_1.m1a(), this.v1d_1, this.w1d_1, this.x1d_1); case 3: throw this.k8_1; } } catch ($p) { var e = $p; if (this.i8_1 === 3) { throw e; } else { this.h8_1 = this.i8_1; this.k8_1 = e; } } while (true); }; function $toByteArrayCOROUTINE$(_this__u8e3s4, resultContinuation) { CoroutineImpl.call(this, resultContinuation); this.g1e_1 = _this__u8e3s4; } protoOf($toByteArrayCOROUTINE$).p8 = function () { var suspendResult = this.j8_1; $sm: do try { var tmp = this.h8_1; switch (tmp) { case 0: this.i8_1 = 2; this.h8_1 = 1; suspendResult = readBuffe