(function (_, kotlin_kotlin, kotlin_io_ktor_ktor_io, kotlin_io_ktor_ktor_utils) { 'use strict'; //region block: imports var imul = Math.imul; var VOID = kotlin_kotlin.$_$.f; var StringBuilder_init_$Create$ = kotlin_kotlin.$_$.f1; var Charsets_getInstance = kotlin_io_ktor_ktor_io.$_$.f; var encode = kotlin_io_ktor_ktor_io.$_$.k; var Unit_instance = kotlin_kotlin.$_$.m5; var prepareReadFirstHead = kotlin_io_ktor_ktor_io.$_$.n; var prepareReadNextHead = kotlin_io_ktor_ktor_io.$_$.o; var completeReadHead = kotlin_io_ktor_ktor_io.$_$.m; var charArray = kotlin_kotlin.$_$.mb; var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.u2; var concatToString = kotlin_kotlin.$_$.ye; var charSequenceGet = kotlin_kotlin.$_$.nb; var toString = kotlin_kotlin.$_$.jd; var Char = kotlin_kotlin.$_$.ai; var isSurrogate = kotlin_kotlin.$_$.uf; var Char__plus_impl_qi7pgj = kotlin_kotlin.$_$.z2; var Char__minus_impl_a2frrh = kotlin_kotlin.$_$.y2; var StringBuilder_init_$Create$_0 = kotlin_kotlin.$_$.e1; var charSequenceLength = kotlin_kotlin.$_$.ob; var charSequenceSubSequence = kotlin_kotlin.$_$.pb; var toString_0 = kotlin_kotlin.$_$.c3; var toByte = kotlin_kotlin.$_$.gd; var String_0 = kotlin_io_ktor_ktor_io.$_$.s; var Exception = kotlin_kotlin.$_$.hi; var Exception_init_$Init$ = kotlin_kotlin.$_$.m1; var captureStack = kotlin_kotlin.$_$.kb; var protoOf = kotlin_kotlin.$_$.ed; var classMeta = kotlin_kotlin.$_$.qb; var setMetadataFor = kotlin_kotlin.$_$.fd; var Char__minus_impl_a2frrh_0 = kotlin_kotlin.$_$.x2; var numberToChar = kotlin_kotlin.$_$.xc; var Char__rangeTo_impl_tkncvp = kotlin_kotlin.$_$.a3; var plus = kotlin_kotlin.$_$.d9; var plus_0 = kotlin_kotlin.$_$.e9; var collectionSizeOrDefault = kotlin_kotlin.$_$.p6; var ArrayList_init_$Create$ = kotlin_kotlin.$_$.l; var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.b3; var toSet = kotlin_kotlin.$_$.fa; var setOf = kotlin_kotlin.$_$.p9; var plus_1 = kotlin_kotlin.$_$.a9; var listOf = kotlin_kotlin.$_$.p8; var emptyList = kotlin_kotlin.$_$.n7; var objectCreate = kotlin_kotlin.$_$.cd; var equals = kotlin_kotlin.$_$.if; var Collection = kotlin_kotlin.$_$.p5; var isInterface = kotlin_kotlin.$_$.mc; var isBlank = kotlin_kotlin.$_$.of; var last = kotlin_kotlin.$_$.l8; var indexOf = kotlin_kotlin.$_$.nf; var THROW_CCE = kotlin_kotlin.$_$.si; var isCharSequence = kotlin_kotlin.$_$.ic; var trim = kotlin_kotlin.$_$.uh; var contains = kotlin_kotlin.$_$.bf; var objectMeta = kotlin_kotlin.$_$.dd; var plus_2 = kotlin_kotlin.$_$.f9; var equals_0 = kotlin_kotlin.$_$.ub; var getStringHashCode = kotlin_kotlin.$_$.bc; var hashCode = kotlin_kotlin.$_$.cc; var Companion_instance = kotlin_io_ktor_ktor_io.$_$.e; var IllegalArgumentException = kotlin_kotlin.$_$.ii; var get_name = kotlin_io_ktor_ktor_io.$_$.l; var get_lastIndex = kotlin_kotlin.$_$.i8; var last_0 = kotlin_kotlin.$_$.ag; var first = kotlin_kotlin.$_$.kf; var get_lastIndex_0 = kotlin_kotlin.$_$.xf; var StringValuesBuilderImpl = kotlin_io_ktor_ktor_utils.$_$.q; var emptySet = kotlin_kotlin.$_$.p7; var get = kotlin_io_ktor_ktor_utils.$_$.p; var forEach = kotlin_io_ktor_ktor_utils.$_$.o; var StringValues = kotlin_io_ktor_ktor_utils.$_$.s; var StringValuesImpl = kotlin_io_ktor_ktor_utils.$_$.r; var emptyMap = kotlin_kotlin.$_$.o7; var toDoubleOrNull = kotlin_kotlin.$_$.bh; var LazyThreadSafetyMode_NONE_getInstance = kotlin_kotlin.$_$.h; var lazy = kotlin_kotlin.$_$.pj; var to = kotlin_kotlin.$_$.yj; var sortedWith = kotlin_kotlin.$_$.t9; var Comparator = kotlin_kotlin.$_$.ci; var ArrayList_init_$Create$_0 = kotlin_kotlin.$_$.m; var compareValues = kotlin_kotlin.$_$.ka; var asList = kotlin_kotlin.$_$.i6; var Char__compareTo_impl_ypi4mb = kotlin_kotlin.$_$.w2; var IllegalArgumentException_init_$Init$ = kotlin_kotlin.$_$.t1; var toLong = kotlin_kotlin.$_$.ih; var mapCapacity = kotlin_kotlin.$_$.q8; var coerceAtLeast = kotlin_kotlin.$_$.rd; var LinkedHashMap_init_$Create$ = kotlin_kotlin.$_$.u; var Comparable = kotlin_kotlin.$_$.bi; var interfaceMeta = kotlin_kotlin.$_$.dc; var isWhitespace = kotlin_kotlin.$_$.vf; var startsWith = kotlin_kotlin.$_$.mg; var charArrayOf = kotlin_kotlin.$_$.lb; var split = kotlin_kotlin.$_$.jg; var toMutableList = kotlin_kotlin.$_$.ca; var first_0 = kotlin_kotlin.$_$.u7; var joinToString = kotlin_kotlin.$_$.e8; var toList = kotlin_kotlin.$_$.z9; var addAll = kotlin_kotlin.$_$.f6; var drop = kotlin_kotlin.$_$.l7; var dropLast = kotlin_kotlin.$_$.k7; var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.u1; var toCharArray = kotlin_io_ktor_ktor_utils.$_$.z; var indexOfAny = kotlin_kotlin.$_$.lf; var IllegalStateException = kotlin_kotlin.$_$.ji; var IllegalStateException_init_$Init$ = kotlin_kotlin.$_$.b2; var indexOf_0 = kotlin_kotlin.$_$.mf; var toInt = kotlin_kotlin.$_$.fh; var listOf_0 = kotlin_kotlin.$_$.o8; var toLowerCasePreservingASCIIRules = kotlin_io_ktor_ktor_utils.$_$.a1; var isLowerCase = kotlin_io_ktor_ktor_utils.$_$.w; var appendAll = kotlin_io_ktor_ktor_utils.$_$.t; var startsWith_0 = kotlin_kotlin.$_$.lg; var joinTo = kotlin_kotlin.$_$.g8; var toString_1 = kotlin_kotlin.$_$.xj; var lazy_0 = kotlin_kotlin.$_$.qj; var getKClassFromExpression = kotlin_kotlin.$_$.d; var KProperty1 = kotlin_kotlin.$_$.fe; var getPropertyCallableRef = kotlin_kotlin.$_$.ac; var toLong_0 = kotlin_kotlin.$_$.hd; var encodeToByteArray = kotlin_kotlin.$_$.ff; var encodeToByteArray_0 = kotlin_io_ktor_ktor_io.$_$.j; var take = kotlin_kotlin.$_$.vg; var PlatformUtils_getInstance = kotlin_io_ktor_ktor_utils.$_$.c; var get_platform = kotlin_io_ktor_ktor_utils.$_$.x; //endregion //region block: pre-declaration setMetadataFor(URLDecodeException, 'URLDecodeException', classMeta, Exception); setMetadataFor(Companion, 'Companion', objectMeta); setMetadataFor(Application, 'Application', objectMeta); setMetadataFor(Text, 'Text', objectMeta); setMetadataFor(HeaderValueWithParameters, 'HeaderValueWithParameters', classMeta); setMetadataFor(ContentType, 'ContentType', classMeta, HeaderValueWithParameters); setMetadataFor(BadContentTypeFormatException, 'BadContentTypeFormatException', classMeta, Exception); setMetadataFor(Companion_0, 'Companion', objectMeta); setMetadataFor(Companion_1, 'Companion', objectMeta); setMetadataFor(HeadersBuilder, 'HeadersBuilder', classMeta, StringValuesBuilderImpl, VOID, HeadersBuilder); setMetadataFor(EmptyHeaders, 'EmptyHeaders', objectMeta, VOID, [StringValues]); setMetadataFor(HeadersImpl, 'HeadersImpl', classMeta, StringValuesImpl, [StringValues, StringValuesImpl], HeadersImpl); setMetadataFor(HeaderValueParam, 'HeaderValueParam', classMeta); setMetadataFor(HeaderValue, 'HeaderValue', classMeta); setMetadataFor(sam$kotlin_Comparator$0, 'sam$kotlin_Comparator$0', classMeta, VOID, [Comparator]); setMetadataFor(HttpHeaders, 'HttpHeaders', objectMeta); setMetadataFor(IllegalHeaderNameException, 'IllegalHeaderNameException', classMeta, IllegalArgumentException); setMetadataFor(IllegalHeaderValueException, 'IllegalHeaderValueException', classMeta, IllegalArgumentException); setMetadataFor(UnsafeHeaderException, 'UnsafeHeaderException', classMeta, IllegalArgumentException); setMetadataFor(Companion_2, 'Companion', objectMeta); setMetadataFor(HttpMethod, 'HttpMethod', classMeta); setMetadataFor(Companion_3, 'Companion', objectMeta); setMetadataFor(HttpProtocolVersion, 'HttpProtocolVersion', classMeta); setMetadataFor(Companion_4, 'Companion', objectMeta); setMetadataFor(HttpStatusCode, 'HttpStatusCode', classMeta, VOID, [Comparable]); setMetadataFor(Companion_5, 'Companion', objectMeta); setMetadataFor(Parameters, 'Parameters', interfaceMeta, VOID, [StringValues]); setMetadataFor(EmptyParameters, 'EmptyParameters', objectMeta, VOID, [Parameters]); setMetadataFor(ParametersBuilderImpl, 'ParametersBuilderImpl', classMeta, StringValuesBuilderImpl, VOID, ParametersBuilderImpl); setMetadataFor(ParametersImpl, 'ParametersImpl', classMeta, StringValuesImpl, [Parameters, StringValuesImpl], ParametersImpl); setMetadataFor(Companion_6, 'Companion', objectMeta); setMetadataFor(URLBuilder, 'URLBuilder', classMeta, VOID, VOID, URLBuilder); setMetadataFor(URLParserException, 'URLParserException', classMeta, IllegalStateException); setMetadataFor(Companion_7, 'Companion', objectMeta); setMetadataFor(URLProtocol, 'URLProtocol', classMeta); setMetadataFor(Companion_8, 'Companion', objectMeta); setMetadataFor(Url_0, 'Url', classMeta); setMetadataFor(UrlDecodedParametersBuilder, 'UrlDecodedParametersBuilder', classMeta); setMetadataFor(OutgoingContent, 'OutgoingContent', classMeta); setMetadataFor(ByteArrayContent_0, 'ByteArrayContent', classMeta, OutgoingContent); setMetadataFor(ByteArrayContent, 'ByteArrayContent', classMeta, ByteArrayContent_0); setMetadataFor(NoContent, 'NoContent', classMeta, OutgoingContent); setMetadataFor(ReadChannelContent, 'ReadChannelContent', classMeta, OutgoingContent); setMetadataFor(WriteChannelContent, 'WriteChannelContent', classMeta, OutgoingContent, VOID, VOID, VOID, VOID, [1]); setMetadataFor(ProtocolUpgrade, 'ProtocolUpgrade', classMeta, OutgoingContent, VOID, VOID, VOID, VOID, [4]); setMetadataFor(NullBody, 'NullBody', objectMeta); setMetadataFor(TextContent, 'TextContent', classMeta, ByteArrayContent_0); //endregion function get_URL_ALPHABET() { _init_properties_Codecs_kt__fudxxf(); return URL_ALPHABET; } var URL_ALPHABET; function get_URL_ALPHABET_CHARS() { _init_properties_Codecs_kt__fudxxf(); return URL_ALPHABET_CHARS; } var URL_ALPHABET_CHARS; function get_HEX_ALPHABET() { _init_properties_Codecs_kt__fudxxf(); return HEX_ALPHABET; } var HEX_ALPHABET; function get_URL_PROTOCOL_PART() { _init_properties_Codecs_kt__fudxxf(); return URL_PROTOCOL_PART; } var URL_PROTOCOL_PART; function get_VALID_PATH_PART() { _init_properties_Codecs_kt__fudxxf(); return VALID_PATH_PART; } var VALID_PATH_PART; var ATTRIBUTE_CHARACTERS; function get_SPECIAL_SYMBOLS() { _init_properties_Codecs_kt__fudxxf(); return SPECIAL_SYMBOLS; } var SPECIAL_SYMBOLS; function encodeURLParameter(_this__u8e3s4, spaceToPlus) { spaceToPlus = spaceToPlus === VOID ? false : spaceToPlus; _init_properties_Codecs_kt__fudxxf(); // Inline function 'kotlin.text.buildString' call // Inline function 'kotlin.contracts.contract' call // Inline function 'kotlin.apply' call var this_0 = StringBuilder_init_$Create$(); // Inline function 'kotlin.contracts.contract' call // Inline function 'io.ktor.http.encodeURLParameter.' call var content = encode(Charsets_getInstance().j2i_1.n2i(), _this__u8e3s4); forEach_0(content, encodeURLParameter$lambda(this_0, spaceToPlus)); return this_0.toString(); } function decodeURLPart(_this__u8e3s4, start, end, charset) { start = start === VOID ? 0 : start; end = end === VOID ? _this__u8e3s4.length : end; charset = charset === VOID ? Charsets_getInstance().j2i_1 : charset; _init_properties_Codecs_kt__fudxxf(); return decodeScan(_this__u8e3s4, start, end, false, charset); } function encodeURLQueryComponent(_this__u8e3s4, encodeFull, spaceToPlus, charset) { encodeFull = encodeFull === VOID ? false : encodeFull; spaceToPlus = spaceToPlus === VOID ? false : spaceToPlus; charset = charset === VOID ? Charsets_getInstance().j2i_1 : charset; _init_properties_Codecs_kt__fudxxf(); // Inline function 'kotlin.text.buildString' call // Inline function 'kotlin.contracts.contract' call // Inline function 'kotlin.apply' call var this_0 = StringBuilder_init_$Create$(); // Inline function 'kotlin.contracts.contract' call // Inline function 'io.ktor.http.encodeURLQueryComponent.' call var content = encode(charset.n2i(), _this__u8e3s4); forEach_0(content, encodeURLQueryComponent$lambda(spaceToPlus, this_0, encodeFull)); return this_0.toString(); } function decodeURLQueryComponent(_this__u8e3s4, start, end, plusIsSpace, charset) { start = start === VOID ? 0 : start; end = end === VOID ? _this__u8e3s4.length : end; plusIsSpace = plusIsSpace === VOID ? false : plusIsSpace; charset = charset === VOID ? Charsets_getInstance().j2i_1 : charset; _init_properties_Codecs_kt__fudxxf(); return decodeScan(_this__u8e3s4, start, end, plusIsSpace, charset); } function encodeURLPathPart(_this__u8e3s4) { _init_properties_Codecs_kt__fudxxf(); return encodeURLPath(_this__u8e3s4, true); } function forEach_0(_this__u8e3s4, block) { _init_properties_Codecs_kt__fudxxf(); $l$block: { // Inline function 'io.ktor.utils.io.core.takeWhile' call var release = true; var tmp0_elvis_lhs = prepareReadFirstHead(_this__u8e3s4, 1); var tmp; if (tmp0_elvis_lhs == null) { break $l$block; } else { tmp = tmp0_elvis_lhs; } var current = tmp; try { $l$loop_1: do { // Inline function 'io.ktor.http.forEach.' call var buffer = current; $l$loop: while (true) { // Inline function 'io.ktor.utils.io.core.canRead' call if (!(buffer.a2a_1 > buffer.z29_1)) { break $l$loop; } block(buffer.o2f()); } if (!true) { break $l$loop_1; } release = false; var tmp1_elvis_lhs = prepareReadNextHead(_this__u8e3s4, current); var tmp_0; if (tmp1_elvis_lhs == null) { break $l$loop_1; } else { tmp_0 = tmp1_elvis_lhs; } var next = tmp_0; current = next; release = true; } while (true); }finally { if (release) { completeReadHead(_this__u8e3s4, current); } } } } function percentEncode(_this__u8e3s4) { _init_properties_Codecs_kt__fudxxf(); var code = _this__u8e3s4 & 255; var array = charArray(3); array[0] = _Char___init__impl__6a9atx(37); array[1] = hexDigitToChar(code >> 4); array[2] = hexDigitToChar(code & 15); return concatToString(array); } function decodeScan(_this__u8e3s4, start, end, plusIsSpace, charset) { _init_properties_Codecs_kt__fudxxf(); var inductionVariable = start; if (inductionVariable < end) do { var index = inductionVariable; inductionVariable = inductionVariable + 1 | 0; var ch = charSequenceGet(_this__u8e3s4, index); if (ch === _Char___init__impl__6a9atx(37) ? true : plusIsSpace ? ch === _Char___init__impl__6a9atx(43) : false) { return decodeImpl(_this__u8e3s4, start, end, index, plusIsSpace, charset); } } while (inductionVariable < end); var tmp; if (start === 0 ? end === _this__u8e3s4.length : false) { tmp = toString(_this__u8e3s4); } else { // Inline function 'kotlin.text.substring' call // Inline function 'kotlin.js.asDynamic' call tmp = _this__u8e3s4.substring(start, end); } return tmp; } function encodeURLPath(_this__u8e3s4, encodeSlash) { _init_properties_Codecs_kt__fudxxf(); // Inline function 'kotlin.text.buildString' call // Inline function 'kotlin.contracts.contract' call // Inline function 'kotlin.apply' call var this_0 = StringBuilder_init_$Create$(); // Inline function 'kotlin.contracts.contract' call // Inline function 'io.ktor.http.encodeURLPath.' call var charset = Charsets_getInstance().j2i_1; var index = 0; $l$loop_0: while (index < _this__u8e3s4.length) { var current = charSequenceGet(_this__u8e3s4, index); if (((!encodeSlash ? current === _Char___init__impl__6a9atx(47) : false) ? true : get_URL_ALPHABET_CHARS().b1(new Char(current))) ? true : get_VALID_PATH_PART().b1(new Char(current))) { this_0.z5(current); index = index + 1 | 0; continue $l$loop_0; } if (((current === _Char___init__impl__6a9atx(37) ? (index + 2 | 0) < _this__u8e3s4.length : false) ? get_HEX_ALPHABET().b1(new Char(charSequenceGet(_this__u8e3s4, index + 1 | 0))) : false) ? get_HEX_ALPHABET().b1(new Char(charSequenceGet(_this__u8e3s4, index + 2 | 0))) : false) { this_0.z5(current); this_0.z5(charSequenceGet(_this__u8e3s4, index + 1 | 0)); this_0.z5(charSequenceGet(_this__u8e3s4, index + 2 | 0)); index = index + 3 | 0; continue $l$loop_0; } var symbolSize = isSurrogate(current) ? 2 : 1; var tmp = encode(charset.n2i(), _this__u8e3s4, index, index + symbolSize | 0); forEach_0(tmp, encodeURLPath$lambda(this_0)); index = index + symbolSize | 0; } return this_0.toString(); } function hexDigitToChar(digit) { _init_properties_Codecs_kt__fudxxf(); return (0 <= digit ? digit <= 9 : false) ? Char__plus_impl_qi7pgj(_Char___init__impl__6a9atx(48), digit) : Char__minus_impl_a2frrh(Char__plus_impl_qi7pgj(_Char___init__impl__6a9atx(65), digit), 10); } function decodeImpl(_this__u8e3s4, start, end, prefixEnd, plusIsSpace, charset) { _init_properties_Codecs_kt__fudxxf(); var length = end - start | 0; var sbSize = length > 255 ? length / 3 | 0 : length; var sb = StringBuilder_init_$Create$_0(sbSize); if (prefixEnd > start) { sb.s8(_this__u8e3s4, start, prefixEnd); } var index = prefixEnd; var bytes = null; while (index < end) { var c = charSequenceGet(_this__u8e3s4, index); if (plusIsSpace ? c === _Char___init__impl__6a9atx(43) : false) { sb.z5(_Char___init__impl__6a9atx(32)); index = index + 1 | 0; } else if (c === _Char___init__impl__6a9atx(37)) { if (bytes == null) { bytes = new Int8Array((end - index | 0) / 3 | 0); } var count = 0; while (index < end ? charSequenceGet(_this__u8e3s4, index) === _Char___init__impl__6a9atx(37) : false) { if ((index + 2 | 0) >= end) { // Inline function 'kotlin.text.substring' call var startIndex = index; var endIndex = charSequenceLength(_this__u8e3s4); var tmp$ret$0 = toString(charSequenceSubSequence(_this__u8e3s4, startIndex, endIndex)); throw new URLDecodeException('Incomplete trailing HEX escape: ' + tmp$ret$0 + ', in ' + _this__u8e3s4 + ' at ' + index); } var digit1 = charToHexDigit(charSequenceGet(_this__u8e3s4, index + 1 | 0)); var digit2 = charToHexDigit(charSequenceGet(_this__u8e3s4, index + 2 | 0)); if (digit1 === -1 ? true : digit2 === -1) { throw new URLDecodeException('Wrong HEX escape: %' + toString_0(charSequenceGet(_this__u8e3s4, index + 1 | 0)) + toString_0(charSequenceGet(_this__u8e3s4, index + 2 | 0)) + ', in ' + _this__u8e3s4 + ', at ' + index); } var tmp = bytes; var tmp1 = count; count = tmp1 + 1 | 0; tmp[tmp1] = toByte(imul(digit1, 16) + digit2 | 0); index = index + 3 | 0; } sb.y5(String_0(bytes, 0, count, charset)); } else { sb.z5(c); index = index + 1 | 0; } } return sb.toString(); } function URLDecodeException(message) { Exception_init_$Init$(message, this); captureStack(this, URLDecodeException); } function charToHexDigit(c2) { _init_properties_Codecs_kt__fudxxf(); return (_Char___init__impl__6a9atx(48) <= c2 ? c2 <= _Char___init__impl__6a9atx(57) : false) ? Char__minus_impl_a2frrh_0(c2, _Char___init__impl__6a9atx(48)) : (_Char___init__impl__6a9atx(65) <= c2 ? c2 <= _Char___init__impl__6a9atx(70) : false) ? Char__minus_impl_a2frrh_0(c2, _Char___init__impl__6a9atx(65)) + 10 | 0 : (_Char___init__impl__6a9atx(97) <= c2 ? c2 <= _Char___init__impl__6a9atx(102) : false) ? Char__minus_impl_a2frrh_0(c2, _Char___init__impl__6a9atx(97)) + 10 | 0 : -1; } function encodeURLParameterValue(_this__u8e3s4) { _init_properties_Codecs_kt__fudxxf(); return encodeURLParameter(_this__u8e3s4, true); } function encodeURLParameter$lambda($$this$buildString, $spaceToPlus) { return function (it) { var tmp; if (get_URL_ALPHABET().b1(it) ? true : get_SPECIAL_SYMBOLS().b1(it)) { $$this$buildString.z5(numberToChar(it)); tmp = Unit_instance; } else if ($spaceToPlus ? it === 32 : false) { $$this$buildString.z5(_Char___init__impl__6a9atx(43)); tmp = Unit_instance; } else { $$this$buildString.y5(percentEncode(it)); tmp = Unit_instance; } return Unit_instance; }; } function encodeURLQueryComponent$lambda($spaceToPlus, $$this$buildString, $encodeFull) { return function (it) { var tmp; if (it === 32) { var tmp_0; if ($spaceToPlus) { $$this$buildString.z5(_Char___init__impl__6a9atx(43)); tmp_0 = Unit_instance; } else { $$this$buildString.y5('%20'); tmp_0 = Unit_instance; } tmp = tmp_0; } else if (get_URL_ALPHABET().b1(it) ? true : !$encodeFull ? get_URL_PROTOCOL_PART().b1(it) : false) { $$this$buildString.z5(numberToChar(it)); tmp = Unit_instance; } else { $$this$buildString.y5(percentEncode(it)); tmp = Unit_instance; } return Unit_instance; }; } function encodeURLPath$lambda($$this$buildString) { return function (it) { $$this$buildString.y5(percentEncode(it)); return Unit_instance; }; } var properties_initialized_Codecs_kt_hkj9s1; function _init_properties_Codecs_kt__fudxxf() { if (!properties_initialized_Codecs_kt_hkj9s1) { properties_initialized_Codecs_kt_hkj9s1 = true; // Inline function 'kotlin.collections.map' call var this_0 = plus_0(plus(Char__rangeTo_impl_tkncvp(_Char___init__impl__6a9atx(97), _Char___init__impl__6a9atx(122)), Char__rangeTo_impl_tkncvp(_Char___init__impl__6a9atx(65), _Char___init__impl__6a9atx(90))), Char__rangeTo_impl_tkncvp(_Char___init__impl__6a9atx(48), _Char___init__impl__6a9atx(57))); // Inline function 'kotlin.collections.mapTo' call var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10)); var tmp0_iterator = this_0.w(); while (tmp0_iterator.f()) { var item = tmp0_iterator.e().sb_1; // Inline function 'io.ktor.http.URL_ALPHABET.' call // Inline function 'kotlin.code' call var tmp$ret$0 = Char__toInt_impl_vasixd(item); var tmp$ret$1 = toByte(tmp$ret$0); destination.j1(tmp$ret$1); } URL_ALPHABET = toSet(destination); URL_ALPHABET_CHARS = toSet(plus_0(plus(Char__rangeTo_impl_tkncvp(_Char___init__impl__6a9atx(97), _Char___init__impl__6a9atx(122)), Char__rangeTo_impl_tkncvp(_Char___init__impl__6a9atx(65), _Char___init__impl__6a9atx(90))), Char__rangeTo_impl_tkncvp(_Char___init__impl__6a9atx(48), _Char___init__impl__6a9atx(57)))); HEX_ALPHABET = toSet(plus_0(plus(Char__rangeTo_impl_tkncvp(_Char___init__impl__6a9atx(97), _Char___init__impl__6a9atx(102)), Char__rangeTo_impl_tkncvp(_Char___init__impl__6a9atx(65), _Char___init__impl__6a9atx(70))), Char__rangeTo_impl_tkncvp(_Char___init__impl__6a9atx(48), _Char___init__impl__6a9atx(57)))); // Inline function 'kotlin.collections.map' call var this_1 = setOf([new Char(_Char___init__impl__6a9atx(58)), new Char(_Char___init__impl__6a9atx(47)), new Char(_Char___init__impl__6a9atx(63)), new Char(_Char___init__impl__6a9atx(35)), new Char(_Char___init__impl__6a9atx(91)), new Char(_Char___init__impl__6a9atx(93)), new Char(_Char___init__impl__6a9atx(64)), new Char(_Char___init__impl__6a9atx(33)), new Char(_Char___init__impl__6a9atx(36)), new Char(_Char___init__impl__6a9atx(38)), new Char(_Char___init__impl__6a9atx(39)), new Char(_Char___init__impl__6a9atx(40)), new Char(_Char___init__impl__6a9atx(41)), new Char(_Char___init__impl__6a9atx(42)), new Char(_Char___init__impl__6a9atx(44)), new Char(_Char___init__impl__6a9atx(59)), new Char(_Char___init__impl__6a9atx(61)), new Char(_Char___init__impl__6a9atx(45)), new Char(_Char___init__impl__6a9atx(46)), new Char(_Char___init__impl__6a9atx(95)), new Char(_Char___init__impl__6a9atx(126)), new Char(_Char___init__impl__6a9atx(43))]); // Inline function 'kotlin.collections.mapTo' call var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(this_1, 10)); var tmp0_iterator_0 = this_1.w(); while (tmp0_iterator_0.f()) { var item_0 = tmp0_iterator_0.e().sb_1; // Inline function 'io.ktor.http.URL_PROTOCOL_PART.' call // Inline function 'kotlin.code' call var tmp$ret$0_0 = Char__toInt_impl_vasixd(item_0); var tmp$ret$1_0 = toByte(tmp$ret$0_0); destination_0.j1(tmp$ret$1_0); } URL_PROTOCOL_PART = destination_0; VALID_PATH_PART = setOf([new Char(_Char___init__impl__6a9atx(58)), new Char(_Char___init__impl__6a9atx(64)), new Char(_Char___init__impl__6a9atx(33)), new Char(_Char___init__impl__6a9atx(36)), new Char(_Char___init__impl__6a9atx(38)), new Char(_Char___init__impl__6a9atx(39)), new Char(_Char___init__impl__6a9atx(40)), new Char(_Char___init__impl__6a9atx(41)), new Char(_Char___init__impl__6a9atx(42)), new Char(_Char___init__impl__6a9atx(43)), new Char(_Char___init__impl__6a9atx(44)), new Char(_Char___init__impl__6a9atx(59)), new Char(_Char___init__impl__6a9atx(61)), new Char(_Char___init__impl__6a9atx(45)), new Char(_Char___init__impl__6a9atx(46)), new Char(_Char___init__impl__6a9atx(95)), new Char(_Char___init__impl__6a9atx(126))]); ATTRIBUTE_CHARACTERS = plus_1(get_URL_ALPHABET_CHARS(), setOf([new Char(_Char___init__impl__6a9atx(33)), new Char(_Char___init__impl__6a9atx(35)), new Char(_Char___init__impl__6a9atx(36)), new Char(_Char___init__impl__6a9atx(38)), new Char(_Char___init__impl__6a9atx(43)), new Char(_Char___init__impl__6a9atx(45)), new Char(_Char___init__impl__6a9atx(46)), new Char(_Char___init__impl__6a9atx(94)), new Char(_Char___init__impl__6a9atx(95)), new Char(_Char___init__impl__6a9atx(96)), new Char(_Char___init__impl__6a9atx(124)), new Char(_Char___init__impl__6a9atx(126))])); // Inline function 'kotlin.collections.map' call var this_2 = listOf([new Char(_Char___init__impl__6a9atx(45)), new Char(_Char___init__impl__6a9atx(46)), new Char(_Char___init__impl__6a9atx(95)), new Char(_Char___init__impl__6a9atx(126))]); // Inline function 'kotlin.collections.mapTo' call var destination_1 = ArrayList_init_$Create$(collectionSizeOrDefault(this_2, 10)); var tmp0_iterator_1 = this_2.w(); while (tmp0_iterator_1.f()) { var item_1 = tmp0_iterator_1.e().sb_1; // Inline function 'io.ktor.http.SPECIAL_SYMBOLS.' call // Inline function 'kotlin.code' call var tmp$ret$0_1 = Char__toInt_impl_vasixd(item_1); var tmp$ret$1_1 = toByte(tmp$ret$0_1); destination_1.j1(tmp$ret$1_1); } SPECIAL_SYMBOLS = destination_1; } } function ContentType_init_$Init$(contentType, contentSubtype, parameters, $this) { parameters = parameters === VOID ? emptyList() : parameters; ContentType.call($this, contentType, contentSubtype, contentType + '/' + contentSubtype, parameters); return $this; } function ContentType_init_$Create$(contentType, contentSubtype, parameters) { return ContentType_init_$Init$(contentType, contentSubtype, parameters, objectCreate(protoOf(ContentType))); } function hasParameter($this, name, value) { var tmp; switch ($this.t2r_1.u()) { case 0: tmp = false; break; case 1: // Inline function 'kotlin.let' call // Inline function 'kotlin.contracts.contract' call // Inline function 'io.ktor.http.ContentType.hasParameter.' call var it = $this.t2r_1.v(0); tmp = equals(it.u2r_1, name, true) ? equals(it.v2r_1, value, true) : false; break; default: var tmp$ret$2; $l$block_0: { // Inline function 'kotlin.collections.any' call var this_0 = $this.t2r_1; var tmp_0; if (isInterface(this_0, Collection)) { tmp_0 = this_0.d1(); } else { tmp_0 = false; } if (tmp_0) { tmp$ret$2 = false; break $l$block_0; } var tmp0_iterator = this_0.w(); while (tmp0_iterator.f()) { var element = tmp0_iterator.e(); // Inline function 'io.ktor.http.ContentType.hasParameter.' call if (equals(element.u2r_1, name, true) ? equals(element.v2r_1, value, true) : false) { tmp$ret$2 = true; break $l$block_0; } } tmp$ret$2 = false; } tmp = tmp$ret$2; break; } return tmp; } function Companion() { Companion_instance_0 = this; this.x2r_1 = ContentType_init_$Create$('*', '*'); } protoOf(Companion).y2r = function (value) { if (isBlank(value)) return this.x2r_1; // Inline function 'io.ktor.http.Companion.parse' call var headerValue = last(parseHeaderValue(value)); // Inline function 'io.ktor.http.Companion.parse.' call var parts = headerValue.z2r_1; var parameters = headerValue.a2s_1; var slash = indexOf(parts, _Char___init__impl__6a9atx(47)); if (slash === -1) { // Inline function 'kotlin.text.trim' call if (toString(trim(isCharSequence(parts) ? parts : THROW_CCE())) === '*') return Companion_getInstance().x2r_1; throw new BadContentTypeFormatException(value); } // Inline function 'kotlin.text.trim' call // Inline function 'kotlin.text.substring' call // Inline function 'kotlin.js.asDynamic' call var this_0 = parts.substring(0, slash); var type = toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE())); // Inline function 'kotlin.text.isEmpty' call if (charSequenceLength(type) === 0) { throw new BadContentTypeFormatException(value); } // Inline function 'kotlin.text.trim' call // Inline function 'kotlin.text.substring' call var startIndex = slash + 1 | 0; // Inline function 'kotlin.js.asDynamic' call var this_1 = parts.substring(startIndex); var subtype = toString(trim(isCharSequence(this_1) ? this_1 : THROW_CCE())); if (contains(type, _Char___init__impl__6a9atx(32)) ? true : contains(subtype, _Char___init__impl__6a9atx(32))) { throw new BadContentTypeFormatException(value); } var tmp; // Inline function 'kotlin.text.isEmpty' call if (charSequenceLength(subtype) === 0) { tmp = true; } else { tmp = contains(subtype, _Char___init__impl__6a9atx(47)); } if (tmp) { throw new BadContentTypeFormatException(value); } return ContentType_init_$Create$(type, subtype, parameters); }; var Companion_instance_0; function Companion_getInstance() { if (Companion_instance_0 == null) new Companion(); return Companion_instance_0; } function Application() { Application_instance = this; this.c2s_1 = ContentType_init_$Create$('application', '*'); this.d2s_1 = ContentType_init_$Create$('application', 'atom+xml'); this.e2s_1 = ContentType_init_$Create$('application', 'cbor'); this.f2s_1 = ContentType_init_$Create$('application', 'json'); this.g2s_1 = ContentType_init_$Create$('application', 'hal+json'); this.h2s_1 = ContentType_init_$Create$('application', 'javascript'); this.i2s_1 = ContentType_init_$Create$('application', 'octet-stream'); this.j2s_1 = ContentType_init_$Create$('application', 'rss+xml'); this.k2s_1 = ContentType_init_$Create$('application', 'xml'); this.l2s_1 = ContentType_init_$Create$('application', 'xml-dtd'); this.m2s_1 = ContentType_init_$Create$('application', 'zip'); this.n2s_1 = ContentType_init_$Create$('application', 'gzip'); this.o2s_1 = ContentType_init_$Create$('application', 'x-www-form-urlencoded'); this.p2s_1 = ContentType_init_$Create$('application', 'pdf'); this.q2s_1 = ContentType_init_$Create$('application', 'vnd.openxmlformats-officedocument.spreadsheetml.sheet'); this.r2s_1 = ContentType_init_$Create$('application', 'vnd.openxmlformats-officedocument.wordprocessingml.document'); this.s2s_1 = ContentType_init_$Create$('application', 'vnd.openxmlformats-officedocument.presentationml.presentation'); this.t2s_1 = ContentType_init_$Create$('application', 'protobuf'); this.u2s_1 = ContentType_init_$Create$('application', 'wasm'); this.v2s_1 = ContentType_init_$Create$('application', 'problem+json'); this.w2s_1 = ContentType_init_$Create$('application', 'problem+xml'); } var Application_instance; function Application_getInstance() { if (Application_instance == null) new Application(); return Application_instance; } function Text() { Text_instance = this; this.x2s_1 = ContentType_init_$Create$('text', '*'); this.y2s_1 = ContentType_init_$Create$('text', 'plain'); this.z2s_1 = ContentType_init_$Create$('text', 'css'); this.a2t_1 = ContentType_init_$Create$('text', 'csv'); this.b2t_1 = ContentType_init_$Create$('text', 'html'); this.c2t_1 = ContentType_init_$Create$('text', 'javascript'); this.d2t_1 = ContentType_init_$Create$('text', 'vcard'); this.e2t_1 = ContentType_init_$Create$('text', 'xml'); this.f2t_1 = ContentType_init_$Create$('text', 'event-stream'); } var Text_instance; function Text_getInstance() { if (Text_instance == null) new Text(); return Text_instance; } function ContentType(contentType, contentSubtype, existingContent, parameters) { Companion_getInstance(); parameters = parameters === VOID ? emptyList() : parameters; HeaderValueWithParameters.call(this, existingContent, parameters); this.i2t_1 = contentType; this.j2t_1 = contentSubtype; } protoOf(ContentType).k2t = function (name, value) { if (hasParameter(this, name, value)) return this; return new ContentType(this.i2t_1, this.j2t_1, this.s2r_1, plus_2(this.t2r_1, HeaderValueParam_init_$Create$(name, value))); }; protoOf(ContentType).l2t = function () { return this.t2r_1.d1() ? this : ContentType_init_$Create$(this.i2t_1, this.j2t_1); }; protoOf(ContentType).m2t = function (pattern) { if (!(pattern.i2t_1 === '*') ? !equals(pattern.i2t_1, this.i2t_1, true) : false) { return false; } if (!(pattern.j2t_1 === '*') ? !equals(pattern.j2t_1, this.j2t_1, true) : false) { return false; } var tmp0_iterator = pattern.t2r_1.w(); while (tmp0_iterator.f()) { var tmp1_loop_parameter = tmp0_iterator.e(); var patternName = tmp1_loop_parameter.y6(); var patternValue = tmp1_loop_parameter.z6(); var tmp; if (patternName === '*') { var tmp_0; if (patternValue === '*') { tmp_0 = true; } else { var tmp$ret$0; $l$block_0: { // Inline function 'kotlin.collections.any' call var this_0 = this.t2r_1; var tmp_1; if (isInterface(this_0, Collection)) { tmp_1 = this_0.d1(); } else { tmp_1 = false; } if (tmp_1) { tmp$ret$0 = false; break $l$block_0; } var tmp0_iterator_0 = this_0.w(); while (tmp0_iterator_0.f()) { var element = tmp0_iterator_0.e(); // Inline function 'io.ktor.http.ContentType.match.' call if (equals(element.v2r_1, patternValue, true)) { tmp$ret$0 = true; break $l$block_0; } } tmp$ret$0 = false; } tmp_0 = tmp$ret$0; } tmp = tmp_0; } else { var value = this.n2t(patternName); tmp = patternValue === '*' ? !(value == null) : equals(value, patternValue, true); } var matches = tmp; if (!matches) { return false; } } return true; }; protoOf(ContentType).equals = function (other) { var tmp; var tmp_0; var tmp_1; if (other instanceof ContentType) { tmp_1 = equals(this.i2t_1, other.i2t_1, true); } else { tmp_1 = false; } if (tmp_1) { tmp_0 = equals(this.j2t_1, other.j2t_1, true); } else { tmp_0 = false; } if (tmp_0) { tmp = equals_0(this.t2r_1, other.t2r_1); } else { tmp = false; } return tmp; }; protoOf(ContentType).hashCode = function () { // Inline function 'kotlin.text.lowercase' call // Inline function 'kotlin.js.asDynamic' call var tmp$ret$1 = this.i2t_1.toLowerCase(); var result = getStringHashCode(tmp$ret$1); var tmp = result; var tmp_0 = imul(31, result); // Inline function 'kotlin.text.lowercase' call // Inline function 'kotlin.js.asDynamic' call var tmp$ret$3 = this.j2t_1.toLowerCase(); result = tmp + (tmp_0 + getStringHashCode(tmp$ret$3) | 0) | 0; result = result + imul(31, hashCode(this.t2r_1)) | 0; return result; }; function BadContentTypeFormatException(value) { Exception_init_$Init$('Bad Content-Type format: ' + value, this); captureStack(this, BadContentTypeFormatException); } function charset(_this__u8e3s4) { var tmp0_safe_receiver = _this__u8e3s4.n2t('charset'); var tmp; if (tmp0_safe_receiver == null) { tmp = null; } else { // Inline function 'kotlin.let' call // Inline function 'kotlin.contracts.contract' call // Inline function 'io.ktor.http.charset.' call var tmp_0; try { tmp_0 = Companion_instance.l2l(tmp0_safe_receiver); } catch ($p) { var tmp_1; if ($p instanceof IllegalArgumentException) { var exception = $p; tmp_1 = null; } else { throw $p; } tmp_0 = tmp_1; } tmp = tmp_0; } return tmp; } function withCharset(_this__u8e3s4, charset) { return _this__u8e3s4.k2t('charset', get_name(charset)); } function withCharsetIfNeeded(_this__u8e3s4, charset) { var tmp; // Inline function 'kotlin.text.lowercase' call // Inline function 'kotlin.js.asDynamic' call if (!(_this__u8e3s4.i2t_1.toLowerCase() === 'text')) { tmp = _this__u8e3s4; } else { tmp = _this__u8e3s4.k2t('charset', get_name(charset)); } return tmp; } function get_HeaderFieldValueSeparators() { _init_properties_HeaderValueWithParameters_kt__z6luvy(); return HeaderFieldValueSeparators; } var HeaderFieldValueSeparators; function Companion_0() { } var Companion_instance_1; function Companion_getInstance_0() { return Companion_instance_1; } function HeaderValueWithParameters(content, parameters) { parameters = parameters === VOID ? emptyList() : parameters; this.s2r_1 = content; this.t2r_1 = parameters; } protoOf(HeaderValueWithParameters).n2t = function (name) { var inductionVariable = 0; var last = get_lastIndex(this.t2r_1); if (inductionVariable <= last) do { var index = inductionVariable; inductionVariable = inductionVariable + 1 | 0; var parameter = this.t2r_1.v(index); if (equals(parameter.u2r_1, name, true)) { return parameter.v2r_1; } } while (!(index === last)); return null; }; protoOf(HeaderValueWithParameters).toString = function () { var tmp; if (this.t2r_1.d1()) { tmp = this.s2r_1; } else { var tmp_0 = this.s2r_1.length; // Inline function 'kotlin.collections.sumOf' call var sum = 0; var tmp0_iterator = this.t2r_1.w(); while (tmp0_iterator.f()) { var element = tmp0_iterator.e(); var tmp_1 = sum; // Inline function 'io.ktor.http.HeaderValueWithParameters.toString.' call sum = tmp_1 + ((element.u2r_1.length + element.v2r_1.length | 0) + 3 | 0) | 0; } var size = tmp_0 + sum | 0; // Inline function 'kotlin.apply' call var this_0 = StringBuilder_init_$Create$_0(size); // Inline function 'kotlin.contracts.contract' call // Inline function 'io.ktor.http.HeaderValueWithParameters.toString.' call this_0.y5(this.s2r_1); var inductionVariable = 0; var last = get_lastIndex(this.t2r_1); if (inductionVariable <= last) do { var index = inductionVariable; inductionVariable = inductionVariable + 1 | 0; var element_0 = this.t2r_1.v(index); this_0.y5('; '); this_0.y5(element_0.u2r_1); this_0.y5('='); // Inline function 'io.ktor.http.escapeIfNeededTo' call var this_1 = element_0.v2r_1; if (needQuotes$accessor$vynnj(this_1)) { this_0.y5(quote(this_1)); } else { this_0.y5(this_1); } } while (!(index === last)); tmp = this_0.toString(); } return tmp; }; function needQuotes(_this__u8e3s4) { _init_properties_HeaderValueWithParameters_kt__z6luvy(); // Inline function 'kotlin.text.isEmpty' call if (charSequenceLength(_this__u8e3s4) === 0) return true; if (isQuoted(_this__u8e3s4)) return false; var inductionVariable = 0; var last = _this__u8e3s4.length; if (inductionVariable < last) do { var index = inductionVariable; inductionVariable = inductionVariable + 1 | 0; if (get_HeaderFieldValueSeparators().b1(new Char(charSequenceGet(_this__u8e3s4, index)))) return true; } while (inductionVariable < last); return false; } function quote(_this__u8e3s4) { _init_properties_HeaderValueWithParameters_kt__z6luvy(); // Inline function 'kotlin.text.buildString' call // Inline function 'kotlin.contracts.contract' call // Inline function 'kotlin.apply' call var this_0 = StringBuilder_init_$Create$(); // Inline function 'kotlin.contracts.contract' call // Inline function 'io.ktor.http.quote.' call quoteTo(_this__u8e3s4, this_0); return this_0.toString(); } function isQuoted(_this__u8e3s4) { _init_properties_HeaderValueWithParameters_kt__z6luvy(); if (_this__u8e3s4.length < 2) { return false; } if (!(first(_this__u8e3s4) === _Char___init__impl__6a9atx(34)) ? true : !(last_0(_this__u8e3s4) === _Char___init__impl__6a9atx(34))) { return false; } var startIndex = 1; $l$loop: do { var index = indexOf(_this__u8e3s4, _Char___init__impl__6a9atx(34), startIndex); if (index === get_lastIndex_0(_this__u8e3s4)) { break $l$loop; } var slashesCount = 0; var slashIndex = index - 1 | 0; while (charSequenceGet(_this__u8e3s4, slashIndex) === _Char___init__impl__6a9atx(92)) { slashesCount = slashesCount + 1 | 0; slashIndex = slashIndex - 1 | 0; } if ((slashesCount % 2 | 0) === 0) { return false; } startIndex = index + 1 | 0; } while (startIndex < _this__u8e3s4.length); return true; } function quoteTo(_this__u8e3s4, out) { _init_properties_HeaderValueWithParameters_kt__z6luvy(); out.y5('"'); var inductionVariable = 0; var last = _this__u8e3s4.length; if (inductionVariable < last) do { var i = inductionVariable; inductionVariable = inductionVariable + 1 | 0; var ch = charSequenceGet(_this__u8e3s4, i); if (ch === _Char___init__impl__6a9atx(92)) { out.y5('\\\\'); } else if (ch === _Char___init__impl__6a9atx(10)) { out.y5('\\n'); } else if (ch === _Char___init__impl__6a9atx(13)) { out.y5('\\r'); } else if (ch === _Char___init__impl__6a9atx(9)) { out.y5('\\t'); } else if (ch === _Char___init__impl__6a9atx(34)) { out.y5('\\"'); } else { out.z5(ch); } } while (inductionVariable < last); out.y5('"'); } function needQuotes$accessor$vynnj(_this__u8e3s4) { _init_properties_HeaderValueWithParameters_kt__z6luvy(); return needQuotes(_this__u8e3s4); } var properties_initialized_HeaderValueWithParameters_kt_yu5xg; function _init_properties_HeaderValueWithParameters_kt__z6luvy() { if (!properties_initialized_HeaderValueWithParameters_kt_yu5xg) { properties_initialized_HeaderValueWithParameters_kt_yu5xg = true; HeaderFieldValueSeparators = setOf([new Char(_Char___init__impl__6a9atx(40)), new Char(_Char___init__impl__6a9atx(41)), new Char(_Char___init__impl__6a9atx(60)), new Char(_Char___init__impl__6a9atx(62)), new Char(_Char___init__impl__6a9atx(64)), new Char(_Char___init__impl__6a9atx(44)), new Char(_Char___init__impl__6a9atx(59)), new Char(_Char___init__impl__6a9atx(58)), new Char(_Char___init__impl__6a9atx(92)), new Char(_Char___init__impl__6a9atx(34)), new Char(_Char___init__impl__6a9atx(47)), new Char(_Char___init__impl__6a9atx(91)), new Char(_Char___init__impl__6a9atx(93)), new Char(_Char___init__impl__6a9atx(63)), new Char(_Char___init__impl__6a9atx(61)), new Char(_Char___init__impl__6a9atx(123)), new Char(_Char___init__impl__6a9atx(125)), new Char(_Char___init__impl__6a9atx(32)), new Char(_Char___init__impl__6a9atx(9)), new Char(_Char___init__impl__6a9atx(10)), new Char(_Char___init__impl__6a9atx(13))]); } } function Companion_1() { Companion_instance_2 = this; this.o2t_1 = EmptyHeaders_instance; } var Companion_instance_2; function Companion_getInstance_1() { if (Companion_instance_2 == null) new Companion_1(); return Companion_instance_2; } function HeadersBuilder(size) { size = size === VOID ? 8 : size; StringValuesBuilderImpl.call(this, true, size); } protoOf(HeadersBuilder).f3 = function () { return new HeadersImpl(this.c2o_1); }; protoOf(HeadersBuilder).d2o = function (name) { protoOf(StringValuesBuilderImpl).d2o.call(this, name); HttpHeaders_getInstance().n2x(name); }; protoOf(HeadersBuilder).h2o = function (value) { protoOf(StringValuesBuilderImpl).h2o.call(this, value); HttpHeaders_getInstance().o2x(value); }; function EmptyHeaders() { } protoOf(EmptyHeaders).w2n = function () { return true; }; protoOf(EmptyHeaders).x2n = function (name) { return null; }; protoOf(EmptyHeaders).y2n = function () { return emptySet(); }; protoOf(EmptyHeaders).z2n = function () { return emptySet(); }; protoOf(EmptyHeaders).toString = function () { return 'Headers ' + this.z2n(); }; var EmptyHeaders_instance; function EmptyHeaders_getInstance() { return EmptyHeaders_instance; } function HeadersImpl(values) { values = values === VOID ? emptyMap() : values; StringValuesImpl.call(this, true, values); } protoOf(HeadersImpl).toString = function () { return 'Headers ' + this.z2n(); }; function HeaderValueParam_init_$Init$(name, value, $this) { HeaderValueParam.call($this, name, value, false); return $this; } function HeaderValueParam_init_$Create$(name, value) { return HeaderValueParam_init_$Init$(name, value, objectCreate(protoOf(HeaderValueParam))); } function HeaderValueParam(name, value, escapeValue) { this.u2r_1 = name; this.v2r_1 = value; this.w2r_1 = escapeValue; } protoOf(HeaderValueParam).equals = function (other) { var tmp; var tmp_0; if (other instanceof HeaderValueParam) { tmp_0 = equals(other.u2r_1, this.u2r_1, true); } else { tmp_0 = false; } if (tmp_0) { tmp = equals(other.v2r_1, this.v2r_1, true); } else { tmp = false; } return tmp; }; protoOf(HeaderValueParam).hashCode = function () { // Inline function 'kotlin.text.lowercase' call // Inline function 'kotlin.js.asDynamic' call var tmp$ret$1 = this.u2r_1.toLowerCase(); var result = getStringHashCode(tmp$ret$1); var tmp = result; var tmp_0 = imul(31, result); // Inline function 'kotlin.text.lowercase' call // Inline function 'kotlin.js.asDynamic' call var tmp$ret$3 = this.v2r_1.toLowerCase(); result = tmp + (tmp_0 + getStringHashCode(tmp$ret$3) | 0) | 0; return result; }; protoOf(HeaderValueParam).y6 = function () { return this.u2r_1; }; protoOf(HeaderValueParam).z6 = function () { return this.v2r_1; }; protoOf(HeaderValueParam).toString = function () { return 'HeaderValueParam(name=' + this.u2r_1 + ', value=' + this.v2r_1 + ', escapeValue=' + this.w2r_1 + ')'; }; function HeaderValue(value, params) { params = params === VOID ? emptyList() : params; this.z2r_1 = value; this.a2s_1 = params; var tmp = this; var tmp$ret$1; $l$block: { // Inline function 'kotlin.collections.firstOrNull' call var tmp0_iterator = this.a2s_1.w(); while (tmp0_iterator.f()) { var element = tmp0_iterator.e(); // Inline function 'io.ktor.http.HeaderValue.quality.' call if (element.u2r_1 === 'q') { tmp$ret$1 = element; break $l$block; } } tmp$ret$1 = null; } var tmp0_safe_receiver = tmp$ret$1; var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.v2r_1; var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : toDoubleOrNull(tmp1_safe_receiver); var tmp_0; if (tmp2_safe_receiver == null) { tmp_0 = null; } else { // Inline function 'kotlin.takeIf' call // Inline function 'kotlin.contracts.contract' call var tmp_1; // Inline function 'io.ktor.http.HeaderValue.quality.' call if (0.0 <= tmp2_safe_receiver ? tmp2_safe_receiver <= 1.0 : false) { tmp_1 = tmp2_safe_receiver; } else { tmp_1 = null; } tmp_0 = tmp_1; } var tmp3_elvis_lhs = tmp_0; tmp.b2s_1 = tmp3_elvis_lhs == null ? 1.0 : tmp3_elvis_lhs; } protoOf(HeaderValue).y6 = function () { return this.z2r_1; }; protoOf(HeaderValue).toString = function () { return 'HeaderValue(value=' + this.z2r_1 + ', params=' + this.a2s_1 + ')'; }; protoOf(HeaderValue).hashCode = function () { var result = getStringHashCode(this.z2r_1); result = imul(result, 31) + hashCode(this.a2s_1) | 0; return result; }; protoOf(HeaderValue).equals = function (other) { if (this === other) return true; if (!(other instanceof HeaderValue)) return false; var tmp0_other_with_cast = other instanceof HeaderValue ? other : THROW_CCE(); if (!(this.z2r_1 === tmp0_other_with_cast.z2r_1)) return false; if (!equals_0(this.a2s_1, tmp0_other_with_cast.a2s_1)) return false; return true; }; function parseHeaderValue(text) { return parseHeaderValue_0(text, false); } function parseHeaderValue_0(text, parametersOnly) { if (text == null) { return emptyList(); } var position = 0; var tmp = LazyThreadSafetyMode_NONE_getInstance(); var items = lazy(tmp, parseHeaderValue$lambda); while (position <= get_lastIndex_0(text)) { position = parseHeaderValueItem(text, position, items, parametersOnly); } return valueOrEmpty(items); } function parseHeaderValueItem(text, start, items, parametersOnly) { var position = start; var tmp = LazyThreadSafetyMode_NONE_getInstance(); var parameters = lazy(tmp, parseHeaderValueItem$lambda); var valueEnd = parametersOnly ? position : null; while (position <= get_lastIndex_0(text)) { var tmp0_subject = charSequenceGet(text, position); if (tmp0_subject === _Char___init__impl__6a9atx(44)) { var tmp_0 = items.t2(); var tmp1_elvis_lhs = valueEnd; tmp_0.j1(new HeaderValue(subtrim(text, start, tmp1_elvis_lhs == null ? position : tmp1_elvis_lhs), valueOrEmpty(parameters))); return position + 1 | 0; } else if (tmp0_subject === _Char___init__impl__6a9atx(59)) { if (valueEnd == null) valueEnd = position; position = parseHeaderValueParameter(text, position + 1 | 0, parameters); } else { var tmp_1; if (parametersOnly) { tmp_1 = parseHeaderValueParameter(text, position, parameters); } else { tmp_1 = position + 1 | 0; } position = tmp_1; } } var tmp_2 = items.t2(); var tmp2_elvis_lhs = valueEnd; tmp_2.j1(new HeaderValue(subtrim(text, start, tmp2_elvis_lhs == null ? position : tmp2_elvis_lhs), valueOrEmpty(parameters))); return position; } function valueOrEmpty(_this__u8e3s4) { return _this__u8e3s4.hn() ? _this__u8e3s4.t2() : emptyList(); } function subtrim(_this__u8e3s4, start, end) { // Inline function 'kotlin.text.trim' call // Inline function 'kotlin.text.substring' call // Inline function 'kotlin.js.asDynamic' call var this_0 = _this__u8e3s4.substring(start, end); return toString(trim(isCharSequence(this_0) ? this_0 : THROW_CCE())); } function parseHeaderValueParameter(text, start, parameters) { var position = start; while (position <= get_lastIndex_0(text)) { var tmp0_subject = charSequenceGet(text, position); if (tmp0_subject === _Char___init__impl__6a9atx(61)) { var tmp1_container = parseHeaderValueParameterValue(text, position + 1 | 0); var paramEnd = tmp1_container.y6(); var paramValue = tmp1_container.z6(); parseHeaderValueParameter$addParam(parameters, text, start, position, paramValue); return paramEnd; } else if (tmp0_subject === _Char___init__impl__6a9atx(59) ? true : tmp0_subject === _Char___init__impl__6a9atx(44)) { parseHeaderValueParameter$addParam(parameters, text, start, position, ''); return position; } else { position = position + 1 | 0; } } parseHeaderValueParameter$addParam(parameters, text, start, position, ''); return position; } function parseHeaderValueParameterValue(value, start) { if (value.length === start) { return to(start, ''); } var position = start; if (charSequenceGet(value, start) === _Char___init__impl__6a9atx(34)) { return parseHeaderValueParameterValueQuoted(value, position + 1 | 0); } while (position <= get_lastIndex_0(value)) { var tmp0_subject = charSequenceGet(value, position); if (tmp0_subject === _Char___init__impl__6a9atx(59) ? true : tmp0_subject === _Char___init__impl__6a9atx(44)) return to(position, subtrim(value, start, position)); else { position = position + 1 | 0; } } return to(position, subtrim(value, start, position)); } function parseHeaderValueParameterValueQuoted(value, start) { var position = start; var builder = StringBuilder_init_$Create$(); loop: while (position <= get_lastIndex_0(value)) { var currentChar = charSequenceGet(value, position); if (currentChar === _Char___init__impl__6a9atx(34) ? nextIsSemicolonOrEnd(value, position) : false) { return to(position + 1 | 0, builder.toString()); } else if (currentChar === _Char___init__impl__6a9atx(92) ? position < (get_lastIndex_0(value) - 2 | 0) : false) { builder.z5(charSequenceGet(value, position + 1 | 0)); position = position + 2 | 0; continue loop; } builder.z5(currentChar); position = position + 1 | 0; } var tmp = position; // Inline function 'kotlin.text.plus' call var this_0 = _Char___init__impl__6a9atx(34); var other = builder.toString(); var tmp$ret$0 = toString_0(this_0) + other; return to(tmp, tmp$ret$0); } function nextIsSemicolonOrEnd(_this__u8e3s4, start) { var position = start + 1 | 0; loop: while (position < _this__u8e3s4.length ? charSequenceGet(_this__u8e3s4, position) === _Char___init__impl__6a9atx(32) : false) { position = position + 1 | 0; } return position === _this__u8e3s4.length ? true : charSequenceGet(_this__u8e3s4, position) === _Char___init__impl__6a9atx(59); } function parseAndSortHeader(header) { // Inline function 'kotlin.collections.sortedByDescending' call var this_0 = parseHeaderValue(header); // Inline function 'kotlin.comparisons.compareByDescending' call var tmp = parseAndSortHeader$lambda; var tmp$ret$0 = new sam$kotlin_Comparator$0(tmp); return sortedWith(this_0, tmp$ret$0); } function sam$kotlin_Comparator$0(function_0) { this.p2x_1 = function_0; } protoOf(sam$kotlin_Comparator$0).qa = function (a, b) { return this.p2x_1(a, b); }; protoOf(sam$kotlin_Comparator$0).compare = function (a, b) { return this.qa(a, b); }; function parseHeaderValueParameter$addParam($parameters, text, start, end, value) { var name = subtrim(text, start, end); // Inline function 'kotlin.text.isEmpty' call if (charSequenceLength(name) === 0) { return Unit_instance; } $parameters.t2().j1(HeaderValueParam_init_$Create$(name, value)); } function parseHeaderValue$lambda() { // Inline function 'kotlin.collections.arrayListOf' call return ArrayList_init_$Create$_0(); } function parseHeaderValueItem$lambda() { // Inline function 'kotlin.collections.arrayListOf' call return ArrayList_init_$Create$_0(); } function parseAndSortHeader$lambda(a, b) { // Inline function 'kotlin.comparisons.compareValuesBy' call // Inline function 'io.ktor.http.parseAndSortHeader.' call var tmp = b.b2s_1; // Inline function 'io.ktor.http.parseAndSortHeader.' call var tmp$ret$1 = a.b2s_1; return compareValues(tmp, tmp$ret$1); } function HttpHeaders() { HttpHeaders_instance = this; this.r2t_1 = 'Accept'; this.s2t_1 = 'Accept-Charset'; this.t2t_1 = 'Accept-Encoding'; this.u2t_1 = 'Accept-Language'; this.v2t_1 = 'Accept-Ranges'; this.w2t_1 = 'Age'; this.x2t_1 = 'Allow'; this.y2t_1 = 'ALPN'; this.z2t_1 = 'Authentication-Info'; this.a2u_1 = 'Authorization'; this.b2u_1 = 'Cache-Control'; this.c2u_1 = 'Connection'; this.d2u_1 = 'Content-Disposition'; this.e2u_1 = 'Content-Encoding'; this.f2u_1 = 'Content-Language'; this.g2u_1 = 'Content-Length'; this.h2u_1 = 'Content-Location'; this.i2u_1 = 'Content-Range'; this.j2u_1 = 'Content-Type'; this.k2u_1 = 'Cookie'; this.l2u_1 = 'DASL'; this.m2u_1 = 'Date'; this.n2u_1 = 'DAV'; this.o2u_1 = 'Depth'; this.p2u_1 = 'Destination'; this.q2u_1 = 'ETag'; this.r2u_1 = 'Expect'; this.s2u_1 = 'Expires'; this.t2u_1 = 'From'; this.u2u_1 = 'Forwarded'; this.v2u_1 = 'Host'; this.w2u_1 = 'HTTP2-Settings'; this.x2u_1 = 'If'; this.y2u_1 = 'If-Match'; this.z2u_1 = 'If-Modified-Since'; this.a2v_1 = 'If-None-Match'; this.b2v_1 = 'If-Range'; this.c2v_1 = 'If-Schedule-Tag-Match'; this.d2v_1 = 'If-Unmodified-Since'; this.e2v_1 = 'Last-Modified'; this.f2v_1 = 'Location'; this.g2v_1 = 'Lock-Token'; this.h2v_1 = 'Link'; this.i2v_1 = 'Max-Forwards'; this.j2v_1 = 'MIME-Version'; this.k2v_1 = 'Ordering-Type'; this.l2v_1 = 'Origin'; this.m2v_1 = 'Overwrite'; this.n2v_1 = 'Position'; this.o2v_1 = 'Pragma'; this.p2v_1 = 'Prefer'; this.q2v_1 = 'Preference-Applied'; this.r2v_1 = 'Proxy-Authenticate'; this.s2v_1 = 'Proxy-Authentication-Info'; this.t2v_1 = 'Proxy-Authorization'; this.u2v_1 = 'Public-Key-Pins'; this.v2v_1 = 'Public-Key-Pins-Report-Only'; this.w2v_1 = 'Range'; this.x2v_1 = 'Referer'; this.y2v_1 = 'Retry-After'; this.z2v_1 = 'Schedule-Reply'; this.a2w_1 = 'Schedule-Tag'; this.b2w_1 = 'Sec-WebSocket-Accept'; this.c2w_1 = 'Sec-WebSocket-Extensions'; this.d2w_1 = 'Sec-WebSocket-Key'; this.e2w_1 = 'Sec-WebSocket-Protocol'; this.f2w_1 = 'Sec-WebSocket-Version'; this.g2w_1 = 'Server'; this.h2w_1 = 'Set-Cookie'; this.i2w_1 = 'SLUG'; this.j2w_1 = 'Strict-Transport-Security'; this.k2w_1 = 'TE'; this.l2w_1 = 'Timeout'; this.m2w_1 = 'Trailer'; this.n2w_1 = 'Transfer-Encoding'; this.o2w_1 = 'Upgrade'; this.p2w_1 = 'User-Agent'; this.q2w_1 = 'Vary'; this.r2w_1 = 'Via'; this.s2w_1 = 'Warning'; this.t2w_1 = 'WWW-Authenticate'; this.u2w_1 = 'Access-Control-Allow-Origin'; this.v2w_1 = 'Access-Control-Allow-Methods'; this.w2w_1 = 'Access-Control-Allow-Credentials'; this.x2w_1 = 'Access-Control-Allow-Headers'; this.y2w_1 = 'Access-Control-Request-Method'; this.z2w_1 = 'Access-Control-Request-Headers'; this.a2x_1 = 'Access-Control-Expose-Headers'; this.b2x_1 = 'Access-Control-Max-Age'; this.c2x_1 = 'X-Http-Method-Override'; this.d2x_1 = 'X-Forwarded-Host'; this.e2x_1 = 'X-Forwarded-Server'; this.f2x_1 = 'X-Forwarded-Proto'; this.g2x_1 = 'X-Forwarded-For'; this.h2x_1 = 'X-Forwarded-Port'; this.i2x_1 = 'X-Request-ID'; this.j2x_1 = 'X-Correlation-ID'; this.k2x_1 = 'X-Total-Count'; var tmp = this; // Inline function 'kotlin.arrayOf' call // Inline function 'kotlin.js.unsafeCast' call // Inline function 'kotlin.js.asDynamic' call tmp.l2x_1 = [this.n2w_1, this.o2w_1]; this.m2x_1 = asList(this.l2x_1); } protoOf(HttpHeaders).n2x = function (name) { // Inline function 'kotlin.text.forEachIndexed' call var index = 0; var inductionVariable = 0; while (inductionVariable < charSequenceLength(name)) { var item = charSequenceGet(name, inductionVariable); inductionVariable = inductionVariable + 1 | 0; // Inline function 'io.ktor.http.HttpHeaders.checkHeaderName.' call var tmp1 = index; index = tmp1 + 1 | 0; if (Char__compareTo_impl_ypi4mb(item, _Char___init__impl__6a9atx(32)) <= 0 ? true : isDelimiter(item)) { throw new IllegalHeaderNameException(name, tmp1); } } }; protoOf(HttpHeaders).o2x = function (value) { // Inline function 'kotlin.text.forEachIndexed' call var index = 0; var inductionVariable = 0; while (inductionVariable < charSequenceLength(value)) { var item = charSequenceGet(value, inductionVariable); inductionVariable = inductionVariable + 1 | 0; // Inline function 'io.ktor.http.HttpHeaders.checkHeaderValue.' call var tmp1 = index; index = tmp1 + 1 | 0; if (Char__compareTo_impl_ypi4mb(item, _Char___init__impl__6a9atx(32)) < 0 ? !(item === _Char___init__impl__6a9atx(9)) : false) { throw new IllegalHeaderValueException(value, tmp1); } } }; var HttpHeaders_instance; function HttpHeaders_getInstance() { if (HttpHeaders_instance == null) new HttpHeaders(); return HttpHeaders_instance; } function isDelimiter(ch) { return contains('"(),/:;<=>?@[\\]{}', ch); } function IllegalHeaderNameException(headerName, position) { var tmp = "Header name '" + headerName + "' contains illegal character '" + toString_0(charSequenceGet(headerName, position)) + "'"; // Inline function 'kotlin.code' call var this_0 = charSequenceGet(headerName, position); var tmp$ret$0 = Char__toInt_impl_vasixd(this_0); IllegalArgumentException_init_$Init$(tmp + (' (code ' + (tmp$ret$0 & 255) + ')'), this); captureStack(this, IllegalHeaderNameException); this.q2x_1 = headerName; this.r2x_1 = position; } function IllegalHeaderValueException(headerValue, position) { var tmp = "Header value '" + headerValue + "' contains illegal character '" + toString_0(charSequenceGet(headerValue, position)) + "'"; // Inline function 'kotlin.code' call var this_0 = charSequenceGet(headerValue, position); var tmp$ret$0 = Char__toInt_impl_vasixd(this_0); IllegalArgumentException_init_$Init$(tmp + (' (code ' + (tmp$ret$0 & 255) + ')'), this); captureStack(this, IllegalHeaderValueException); this.s2x_1 = headerValue; this.t2x_1 = position; } function UnsafeHeaderException(header) { IllegalArgumentException_init_$Init$('Header(s) ' + header + ' are controlled by the engine and ' + 'cannot be set explicitly', this); captureStack(this, UnsafeHeaderException); } function contentType(_this__u8e3s4) { var tmp0_safe_receiver = _this__u8e3s4.u2x().ca(HttpHeaders_getInstance().j2u_1); var tmp; if (tmp0_safe_receiver == null) { tmp = null; } else { // Inline function 'kotlin.let' call // Inline function 'kotlin.contracts.contract' call // Inline function 'io.ktor.http.contentType.' call tmp = Companion_getInstance().y2r(tmp0_safe_receiver); } return tmp; } function contentLength(_this__u8e3s4) { var tmp0_safe_receiver = _this__u8e3s4.u2x().ca(HttpHeaders_getInstance().g2u_1); return tmp0_safe_receiver == null ? null : toLong(tmp0_safe_receiver); } function charset_0(_this__u8e3s4) { var tmp0_safe_receiver = contentType_1(_this__u8e3s4); return tmp0_safe_receiver == null ? null : charset(tmp0_safe_receiver); } function contentType_0(_this__u8e3s4, type) { return _this__u8e3s4.u2x().g2o(HttpHeaders_getInstance().j2u_1, type.toString()); } function contentType_1(_this__u8e3s4) { var tmp0_safe_receiver = _this__u8e3s4.u2x().ca(HttpHeaders_getInstance().j2u_1); var tmp; if (tmp0_safe_receiver == null) { tmp = null; } else { // Inline function 'kotlin.let' call // Inline function 'kotlin.contracts.contract' call // Inline function 'io.ktor.http.contentType.' call tmp = Companion_getInstance().y2r(tmp0_safe_receiver); } return tmp; } function Companion_2() { Companion_instance_3 = this; this.v2x_1 = new HttpMethod('GET'); this.w2x_1 = new HttpMethod('POST'); this.x2x_1 = new HttpMethod('PUT'); this.y2x_1 = new HttpMethod('PATCH'); this.z2x_1 = new HttpMethod('DELETE'); this.a2y_1 = new HttpMethod('HEAD'); this.b2y_1 = new HttpMethod('OPTIONS'); this.c2y_1 = listOf([this.v2x_1, this.w2x_1, this.x2x_1, this.y2x_1, this.z2x_1, this.a2y_1, this.b2y_1]); } var Companion_instance_3; function Companion_getInstance_2() { if (Companion_instance_3 == null) new Companion_2(); return Companion_instance_3; } function HttpMethod(value) { Companion_getInstance_2(); this.d2y_1 = value; } protoOf(HttpMethod).toString = function () { return 'HttpMethod(value=' + this.d2y_1 + ')'; }; protoOf(HttpMethod).hashCode = function () { return getStringHashCode(this.d2y_1); }; protoOf(HttpMethod).equals = function (other) { if (this === other) return true; if (!(other instanceof HttpMethod)) return false; var tmp0_other_with_cast = other instanceof HttpMethod ? other : THROW_CCE(); if (!(this.d2y_1 === tmp0_other_with_cast.d2y_1)) return false; return true; }; function Companion_3() { Companion_instance_4 = this; this.e2y_1 = new HttpProtocolVersion('HTTP', 2, 0); this.f2y_1 = new HttpProtocolVersion('HTTP', 1, 1); this.g2y_1 = new HttpProtocolVersion('HTTP', 1, 0); this.h2y_1 = new HttpProtocolVersion('SPDY', 3, 0); this.i2y_1 = new HttpProtocolVersion('QUIC', 1, 0); } var Companion_instance_4; function Companion_getInstance_3() { if (Companion_instance_4 == null) new Companion_3(); return Companion_instance_4; } function HttpProtocolVersion(name, major, minor) { Companion_getInstance_3(); this.j2y_1 = name; this.k2y_1 = major; this.l2y_1 = minor; } protoOf(HttpProtocolVersion).toString = function () { return this.j2y_1 + '/' + this.k2y_1 + '.' + this.l2y_1; }; protoOf(HttpProtocolVersion).hashCode = function () { var result = getStringHashCode(this.j2y_1); result = imul(result, 31) + this.k2y_1 | 0; result = imul(result, 31) + this.l2y_1 | 0; return result; }; protoOf(HttpProtocolVersion).equals = function (other) { if (this === other) return true; if (!(other instanceof HttpProtocolVersion)) return false; var tmp0_other_with_cast = other instanceof HttpProtocolVersion ? other : THROW_CCE(); if (!(this.j2y_1 === tmp0_other_with_cast.j2y_1)) return false; if (!(this.k2y_1 === tmp0_other_with_cast.k2y_1)) return false; if (!(this.l2y_1 === tmp0_other_with_cast.l2y_1)) return false; return true; }; function Companion_4() { Companion_instance_5 = this; this.m2y_1 = new HttpStatusCode(100, 'Continue'); this.n2y_1 = new HttpStatusCode(101, 'Switching Protocols'); this.o2y_1 = new HttpStatusCode(102, 'Processing'); this.p2y_1 = new HttpStatusCode(200, 'OK'); this.q2y_1 = new HttpStatusCode(201, 'Created'); this.r2y_1 = new HttpStatusCode(202, 'Accepted'); this.s2y_1 = new HttpStatusCode(203, 'Non-Authoritative Information'); this.t2y_1 = new HttpStatusCode(204, 'No Content'); this.u2y_1 = new HttpStatusCode(205, 'Reset Content'); this.v2y_1 = new HttpStatusCode(206, 'Partial Content'); this.w2y_1 = new HttpStatusCode(207, 'Multi-Status'); this.x2y_1 = new HttpStatusCode(300, 'Multiple Choices'); this.y2y_1 = new HttpStatusCode(301, 'Moved Permanently'); this.z2y_1 = new HttpStatusCode(302, 'Found'); this.a2z_1 = new HttpStatusCode(303, 'See Other'); this.b2z_1 = new HttpStatusCode(304, 'Not Modified'); this.c2z_1 = new HttpStatusCode(305, 'Use Proxy'); this.d2z_1 = new HttpStatusCode(306, 'Switch Proxy'); this.e2z_1 = new HttpStatusCode(307, 'Temporary Redirect'); this.f2z_1 = new HttpStatusCode(308, 'Permanent Redirect'); this.g2z_1 = new HttpStatusCode(400, 'Bad Request'); this.h2z_1 = new HttpStatusCode(401, 'Unauthorized'); this.i2z_1 = new HttpStatusCode(402, 'Payment Required'); this.j2z_1 = new HttpStatusCode(403, 'Forbidden'); this.k2z_1 = new HttpStatusCode(404, 'Not Found'); this.l2z_1 = new HttpStatusCode(405, 'Method Not Allowed'); this.m2z_1 = new HttpStatusCode(406, 'Not Acceptable'); this.n2z_1 = new HttpStatusCode(407, 'Proxy Authentication Required'); this.o2z_1 = new HttpStatusCode(408, 'Request Timeout'); this.p2z_1 = new HttpStatusCode(409, 'Conflict'); this.q2z_1 = new HttpStatusCode(410, 'Gone'); this.r2z_1 = new HttpStatusCode(411, 'Length Required'); this.s2z_1 = new HttpStatusCode(412, 'Precondition Failed'); this.t2z_1 = new HttpStatusCode(413, 'Payload Too Large'); this.u2z_1 = new HttpStatusCode(414, 'Request-URI Too Long'); this.v2z_1 = new HttpStatusCode(415, 'Unsupported Media Type'); this.w2z_1 = new HttpStatusCode(416, 'Requested Range Not Satisfiable'); this.x2z_1 = new HttpStatusCode(417, 'Expectation Failed'); this.y2z_1 = new HttpStatusCode(422, 'Unprocessable Entity'); this.z2z_1 = new HttpStatusCode(423, 'Locked'); this.a30_1 = new HttpStatusCode(424, 'Failed Dependency'); this.b30_1 = new HttpStatusCode(425, 'Too Early'); this.c30_1 = new HttpStatusCode(426, 'Upgrade Required'); this.d30_1 = new HttpStatusCode(429, 'Too Many Requests'); this.e30_1 = new HttpStatusCode(431, 'Request Header Fields Too Large'); this.f30_1 = new HttpStatusCode(500, 'Internal Server Error'); this.g30_1 = new HttpStatusCode(501, 'Not Implemented'); this.h30_1 = new HttpStatusCode(502, 'Bad Gateway'); this.i30_1 = new HttpStatusCode(503, 'Service Unavailable'); this.j30_1 = new HttpStatusCode(504, 'Gateway Timeout'); this.k30_1 = new HttpStatusCode(505, 'HTTP Version Not Supported'); this.l30_1 = new HttpStatusCode(506, 'Variant Also Negotiates'); this.m30_1 = new HttpStatusCode(507, 'Insufficient Storage'); this.n30_1 = allStatusCodes(); var tmp = this; // Inline function 'kotlin.collections.associateBy' call var this_0 = this.n30_1; var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16); // Inline function 'kotlin.collections.associateByTo' call var destination = LinkedHashMap_init_$Create$(capacity); var tmp0_iterator = this_0.w(); while (tmp0_iterator.f()) { var element = tmp0_iterator.e(); // Inline function 'io.ktor.http.Companion.statusCodesMap.' call var tmp$ret$0 = element.p30_1; destination.s(tmp$ret$0, element); } tmp.o30_1 = destination; } var Companion_instance_5; function Companion_getInstance_4() { if (Companion_instance_5 == null) new Companion_4(); return Companion_instance_5; } function HttpStatusCode(value, description) { Companion_getInstance_4(); this.p30_1 = value; this.q30_1 = description; } protoOf(HttpStatusCode).toString = function () { return '' + this.p30_1 + ' ' + this.q30_1; }; protoOf(HttpStatusCode).equals = function (other) { var tmp; if (other instanceof HttpStatusCode) { tmp = other.p30_1 === this.p30_1; } else { tmp = false; } return tmp; }; protoOf(HttpStatusCode).hashCode = function () { return this.p30_1; }; protoOf(HttpStatusCode).r30 = function (other) { return this.p30_1 - other.p30_1 | 0; }; protoOf(HttpStatusCode).d = function (other) { return this.r30(other instanceof HttpStatusCode ? other : THROW_CCE()); }; function allStatusCodes() { return listOf([Companion_getInstance_4().m2y_1, Companion_getInstance_4().n2y_1, Companion_getInstance_4().o2y_1, Companion_getInstance_4().p2y_1, Companion_getInstance_4().q2y_1, Companion_getInstance_4().r2y_1, Companion_getInstance_4().s2y_1, Companion_getInstance_4().t2y_1, Companion_getInstance_4().u2y_1, Companion_getInstance_4().v2y_1, Companion_getInstance_4().w2y_1, Companion_getInstance_4().x2y_1, Companion_getInstance_4().y2y_1, Companion_getInstance_4().z2y_1, Companion_getInstance_4().a2z_1, Companion_getInstance_4().b2z_1, Companion_getInstance_4().c2z_1, Companion_getInstance_4().d2z_1, Companion_getInstance_4().e2z_1, Companion_getInstance_4().f2z_1, Companion_getInstance_4().g2z_1, Companion_getInstance_4().h2z_1, Companion_getInstance_4().i2z_1, Companion_getInstance_4().j2z_1, Companion_getInstance_4().k2z_1, Companion_getInstance_4().l2z_1, Companion_getInstance_4().m2z_1, Companion_getInstance_4().n2z_1, Companion_getInstance_4().o2z_1, Companion_getInstance_4().p2z_1, Companion_getInstance_4().q2z_1, Companion_getInstance_4().r2z_1, Companion_getInstance_4().s2z_1, Companion_getInstance_4().t2z_1, Companion_getInstance_4().u2z_1, Companion_getInstance_4().v2z_1, Companion_getInstance_4().w2z_1, Companion_getInstance_4().x2z_1, Companion_getInstance_4().y2z_1, Companion_getInstance_4().z2z_1, Companion_getInstance_4().a30_1, Companion_getInstance_4().b30_1, Companion_getInstance_4().c30_1, Companion_getInstance_4().d30_1, Companion_getInstance_4().e30_1, Companion_getInstance_4().f30_1, Companion_getInstance_4().g30_1, Companion_getInstance_4().h30_1, Companion_getInstance_4().i30_1, Companion_getInstance_4().j30_1, Companion_getInstance_4().k30_1, Companion_getInstance_4().l30_1, Companion_getInstance_4().m30_1]); } function isSuccess(_this__u8e3s4) { var containsArg = _this__u8e3s4.p30_1; return 200 <= containsArg ? containsArg < 300 : false; } function Companion_5() { Companion_instance_6 = this; this.s30_1 = EmptyParameters_instance; } var Companion_instance_6; function Companion_getInstance_5() { if (Companion_instance_6 == null) new Companion_5(); return Companion_instance_6; } function Parameters() { } function ParametersBuilder(size) { size = size === VOID ? 8 : size; return new ParametersBuilderImpl(size); } function EmptyParameters() { } protoOf(EmptyParameters).w2n = function () { return true; }; protoOf(EmptyParameters).x2n = function (name) { return null; }; protoOf(EmptyParameters).y2n = function () { return emptySet(); }; protoOf(EmptyParameters).z2n = function () { return emptySet(); }; protoOf(EmptyParameters).d1 = function () { return true; }; protoOf(EmptyParameters).toString = function () { return 'Parameters ' + this.z2n(); }; protoOf(EmptyParameters).equals = function (other) { var tmp; if (!(other == null) ? isInterface(other, Parameters) : false) { tmp = other.d1(); } else { tmp = false; } return tmp; }; var EmptyParameters_instance; function EmptyParameters_getInstance() { return EmptyParameters_instance; } function ParametersBuilderImpl(size) { size = size === VOID ? 8 : size; StringValuesBuilderImpl.call(this, true, size); } protoOf(ParametersBuilderImpl).f3 = function () { return new ParametersImpl(this.c2o_1); }; function ParametersImpl(values) { values = values === VOID ? emptyMap() : values; StringValuesImpl.call(this, true, values); } protoOf(ParametersImpl).toString = function () { return 'Parameters ' + this.z2n(); }; function parseQueryString(query, startIndex, limit, decode) { startIndex = startIndex === VOID ? 0 : startIndex; limit = limit === VOID ? 1000 : limit; decode = decode === VOID ? true : decode; var tmp; if (startIndex > get_lastIndex_0(query)) { tmp = Companion_getInstance_5().s30_1; } else { // Inline function 'io.ktor.http.Companion.build' call Companion_getInstance_5(); // Inline function 'kotlin.apply' call var this_0 = ParametersBuilder(); // Inline function 'kotlin.contracts.contract' call // Inline function 'io.ktor.http.parseQueryString.' call parse(this_0, query, startIndex, limit, decode); tmp = this_0.f3(); } return tmp; } function parse(_this__u8e3s4, query, startIndex, limit, decode) { var count = 0; var nameIndex = startIndex; var equalIndex = -1; var inductionVariable = startIndex; var last = get_lastIndex_0(query); if (inductionVariable <= last) do { var index = inductionVariable; inductionVariable = inductionVariable + 1 | 0; if (count === limit) { return Unit_instance; } var tmp1_subject = charSequenceGet(query, index); if (tmp1_subject === _Char___init__impl__6a9atx(38)) { appendParam(_this__u8e3s4, query, nameIndex, equalIndex, index, decode); nameIndex = index + 1 | 0; equalIndex = -1; count = count + 1 | 0; } else if (tmp1_subject === _Char___init__impl__6a9atx(61)) { if (equalIndex === -1) { equalIndex = index; } } } while (!(index === last)); if (count === limit) { return Unit_instance; } appendParam(_this__u8e3s4, query, nameIndex, equalIndex, query.length, decode); } function appendParam(_this__u8e3s4, query, nameIndex, equalIndex, endIndex, decode) { if (equalIndex === -1) { var spaceNameIndex = trimStart(nameIndex, endIndex, query); var spaceEndIndex = trimEnd(spaceNameIndex, endIndex, query); if (spaceEndIndex > spaceNameIndex) { var tmp; if (decode) { tmp = decodeURLQueryComponent(query, spaceNameIndex, spaceEndIndex); } else { // Inline function 'kotlin.text.substring' call // Inline function 'kotlin.js.asDynamic' call tmp = query.substring(spaceNameIndex, spaceEndIndex); } var name = tmp; _this__u8e3s4.e2o(name, emptyList()); } return Unit_instance; } var spaceNameIndex_0 = trimStart(nameIndex, equalIndex, query); var spaceEqualIndex = trimEnd(spaceNameIndex_0, equalIndex, query); if (spaceEqualIndex > spaceNameIndex_0) { var tmp_0; if (decode) { tmp_0 = decodeURLQueryComponent(query, spaceNameIndex_0, spaceEqualIndex); } else { // Inline function 'kotlin.text.substring' call // Inline function 'kotlin.js.asDynamic' call tmp_0 = query.substring(spaceNameIndex_0, spaceEqualIndex); } var name_0 = tmp_0; var spaceValueIndex = trimStart(equalIndex + 1 | 0, endIndex, query); var spaceEndIndex_0 = trimEnd(spaceValueIndex, endIndex, query); var tmp_1; if (decode) { tmp_1 = decodeURLQueryComponent(query, spaceValueIndex, spaceEndIndex_0, true); } else { // Inline function 'kotlin.text.substring' call // Inline function 'kotlin.js.asDynamic' call tmp_1 = query.substring(spaceValueIndex, spaceEndIndex_0); } var value = tmp_1; _this__u8e3s4.i2o(name_0, value); } } function trimStart(start, end, query) { var spaceIndex = start; while (spaceIndex < end ? isWhitespace(charSequenceGet(query, spaceIndex)) : false) { spaceIndex = spaceIndex + 1 | 0; } return spaceIndex; } function trimEnd(start, end, text) { var spaceIndex = end; while (spaceIndex > start ? isWhitespace(charSequenceGet(text, spaceIndex - 1 | 0)) : false) { spaceIndex = spaceIndex - 1 | 0; } return spaceIndex; } function applyOrigin($this) { var tmp; // Inline function 'kotlin.text.isNotEmpty' call var this_0 = $this.w30_1; if (charSequenceLength(this_0) > 0) { tmp = true; } else { tmp = $this.v30_1.f31_1 === 'file'; } if (tmp) return Unit_instance; $this.w30_1 = Companion_getInstance_6().x31_1.i31_1; if ($this.v30_1.equals(Companion_getInstance_7().y31_1)) $this.v30_1 = Companion_getInstance_6().x31_1.h31_1; if ($this.x30_1 === 0) $this.x30_1 = Companion_getInstance_6().x31_1.j31_1; } function Companion_6() { Companion_instance_7 = this; this.x31_1 = Url(get_origin(this)); } var Companion_instance_7; function Companion_getInstance_6() { if (Companion_instance_7 == null) new Companion_6(); return Companion_instance_7; } function URLBuilder(protocol, host, port, user, password, pathSegments, parameters, fragment, trailingQuery) { Companion_getInstance_6(); protocol = protocol === VOID ? Companion_getInstance_7().y31_1 : protocol; host = host === VOID ? '' : host; port = port === VOID ? 0 : port; user = user === VOID ? null : user; password = password === VOID ? null : password; pathSegments = pathSegments === VOID ? emptyList() : pathSegments; parameters = parameters === VOID ? Companion_getInstance_5().s30_1 : parameters; fragment = fragment === VOID ? '' : fragment; trailingQuery = trailingQuery === VOID ? false : trailingQuery; this.v30_1 = protocol; this.w30_1 = host; this.x30_1 = port; this.y30_1 = trailingQuery; var tmp = this; tmp.z30_1 = user == null ? null : encodeURLParameter(user); var tmp_0 = this; tmp_0.a31_1 = password == null ? null : encodeURLParameter(password); this.b31_1 = encodeURLQueryComponent(fragment); var tmp_1 = this; // Inline function 'kotlin.collections.map' call // Inline function 'kotlin.collections.mapTo' call var destination = ArrayList_init_$Create$(collectionSizeOrDefault(pathSegments, 10)); var tmp0_iterator = pathSegments.w(); while (tmp0_iterator.f()) { var item = tmp0_iterator.e(); // Inline function 'io.ktor.http.URLBuilder.encodedPathSegments.' call var tmp$ret$0 = encodeURLPathPart(item); destination.j1(tmp$ret$0); } tmp_1.c31_1 = destination; this.d31_1 = encodeParameters(parameters); this.e31_1 = new UrlDecodedParametersBuilder(this.d31_1); } protoOf(URLBuilder).e32 = function (value) { var tmp = this; tmp.z30_1 = value == null ? null : encodeURLParameter(value); }; protoOf(URLBuilder).f32 = function () { var tmp0_safe_receiver = this.z30_1; return tmp0_safe_receiver == null ? null : decodeURLPart(tmp0_safe_receiver); }; protoOf(URLBuilder).g32 = function () { var tmp0_safe_receiver = this.a31_1; return tmp0_safe_receiver == null ? null : decodeURLPart(tmp0_safe_receiver); }; protoOf(URLBuilder).h32 = function () { return decodeURLQueryComponent(this.b31_1); }; protoOf(URLBuilder).i32 = function () { // Inline function 'kotlin.collections.map' call var this_0 = this.c31_1; // Inline function 'kotlin.collections.mapTo' call var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10)); var tmp0_iterator = this_0.w(); while (tmp0_iterator.f()) { var item = tmp0_iterator.e(); // Inline function 'io.ktor.http.URLBuilder..' call var tmp$ret$0 = decodeURLPart(item); destination.j1(tmp$ret$0); } return destination; }; protoOf(URLBuilder).j32 = function (value) { this.d31_1 = value; this.e31_1 = new UrlDecodedParametersBuilder(value); }; protoOf(URLBuilder).k32 = function () { applyOrigin(this); return appendTo(this, StringBuilder_init_$Create$_0(256)).toString(); }; protoOf(URLBuilder).toString = function () { return appendTo(this, StringBuilder_init_$Create$_0(256)).toString(); }; protoOf(URLBuilder).f3 = function () { applyOrigin(this); return new Url_0(this.v30_1, this.w30_1, this.x30_1, this.i32(), this.e31_1.f3(), this.h32(), this.f32(), this.g32(), this.y30_1, this.k32()); }; function get_authority(_this__u8e3s4) { // Inline function 'kotlin.text.buildString' call // Inline function 'kotlin.contracts.contract' call // Inline function 'kotlin.apply' call var this_0 = StringBuilder_init_$Create$(); // Inline function 'kotlin.contracts.contract' call // Inline function 'io.ktor.http..' call this_0.y5(get_encodedUserAndPassword(_this__u8e3s4)); this_0.y5(_this__u8e3s4.w30_1); if (!(_this__u8e3s4.x30_1 === 0) ? !(_this__u8e3s4.x30_1 === _this__u8e3s4.v30_1.g31_1) : false) { this_0.y5(':'); this_0.y5(_this__u8e3s4.x30_1.toString()); } return this_0.toString(); } function get_DEFAULT_PORT() { return DEFAULT_PORT; } var DEFAULT_PORT; function appendTo(_this__u8e3s4, out) { out.r8(_this__u8e3s4.v30_1.f31_1); var tmp0_subject = _this__u8e3s4.v30_1.f31_1; if (tmp0_subject === 'file') { appendFile(out, _this__u8e3s4.w30_1, get_encodedPath(_this__u8e3s4)); return out; } else if (tmp0_subject === 'mailto') { appendMailto(out, get_encodedUserAndPassword(_this__u8e3s4), _this__u8e3s4.w30_1); return out; } out.r8('://'); out.r8(get_authority(_this__u8e3s4)); appendUrlFullPath(out, get_encodedPath(_this__u8e3s4), _this__u8e3s4.d31_1, _this__u8e3s4.y30_1); // Inline function 'kotlin.text.isNotEmpty' call var this_0 = _this__u8e3s4.b31_1; if (charSequenceLength(this_0) > 0) { out.z5(_Char___init__impl__6a9atx(35)); out.r8(_this__u8e3s4.b31_1); } return out; } function get_encodedUserAndPassword(_this__u8e3s4) { // Inline function 'kotlin.text.buildString' call // Inline function 'kotlin.contracts.contract' call // Inline function 'kotlin.apply' call var this_0 = StringBuilder_init_$Create$(); // Inline function 'kotlin.contracts.contract' call // Inline function 'io.ktor.http..' call appendUserAndPassword(this_0, _this__u8e3s4.z30_1, _this__u8e3s4.a31_1); return this_0.toString(); } function appendFile(_this__u8e3s4, host, encodedPath) { _this__u8e3s4.r8('://'); _this__u8e3s4.r8(host); if (!startsWith(encodedPath, _Char___init__impl__6a9atx(47))) { _this__u8e3s4.z5(_Char___init__impl__6a9atx(47)); } _this__u8e3s4.r8(encodedPath); } function set_encodedPath(_this__u8e3s4, value) { _this__u8e3s4.c31_1 = isBlank(value) ? emptyList() : value === '/' ? get_ROOT_PATH() : toMutableList(split(value, charArrayOf([_Char___init__impl__6a9atx(47)]))); } function get_encodedPath(_this__u8e3s4) { return joinPath(_this__u8e3s4.c31_1); } function appendMailto(_this__u8e3s4, encodedUser, host) { _this__u8e3s4.r8(':'); _this__u8e3s4.r8(encodedUser); _this__u8e3s4.r8(host); } function joinPath(_this__u8e3s4) { if (_this__u8e3s4.d1()) return ''; if (_this__u8e3s4.u() === 1) { // Inline function 'kotlin.text.isEmpty' call var this_0 = first_0(_this__u8e3s4); if (charSequenceLength(this_0) === 0) return '/'; return first_0(_this__u8e3s4); } return joinToString(_this__u8e3s4, '/'); } function appendPathSegments(_this__u8e3s4, components, encodeSlash) { encodeSlash = encodeSlash === VOID ? false : encodeSlash; return appendPathSegments_0(_this__u8e3s4, toList(components), encodeSlash); } function appendPathSegments_0(_this__u8e3s4, segments, encodeSlash) { encodeSlash = encodeSlash === VOID ? false : encodeSlash; var tmp; if (!encodeSlash) { // Inline function 'kotlin.collections.flatMap' call // Inline function 'kotlin.collections.flatMapTo' call var destination = ArrayList_init_$Create$_0(); var tmp0_iterator = segments.w(); while (tmp0_iterator.f()) { var element = tmp0_iterator.e(); // Inline function 'io.ktor.http.appendPathSegments.' call var list = split(element, charArrayOf([_Char___init__impl__6a9atx(47)])); addAll(destination, list); } tmp = destination; } else { tmp = segments; } var pathSegments = tmp; // Inline function 'kotlin.collections.map' call // Inline function 'kotlin.collections.mapTo' call var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(pathSegments, 10)); var tmp0_iterator_0 = pathSegments.w(); while (tmp0_iterator_0.f()) { var item = tmp0_iterator_0.e(); // Inline function 'io.ktor.http.appendPathSegments.' call var tmp$ret$3 = encodeURLPathPart(item); destination_0.j1(tmp$ret$3); } var encodedSegments = destination_0; appendEncodedPathSegments(_this__u8e3s4, encodedSegments); return _this__u8e3s4; } function appendEncodedPathSegments(_this__u8e3s4, segments) { var tmp; var tmp_0; if (_this__u8e3s4.c31_1.u() > 1) { // Inline function 'kotlin.text.isEmpty' call var this_0 = last(_this__u8e3s4.c31_1); tmp_0 = charSequenceLength(this_0) === 0; } else { tmp_0 = false; } if (tmp_0) { // Inline function 'kotlin.collections.isNotEmpty' call tmp = !segments.d1(); } else { tmp = false; } var endsWithSlash = tmp; var tmp_1; var tmp_2; if (segments.u() > 1) { // Inline function 'kotlin.text.isEmpty' call var this_1 = first_0(segments); tmp_2 = charSequenceLength(this_1) === 0; } else { tmp_2 = false; } if (tmp_2) { // Inline function 'kotlin.collections.isNotEmpty' call tmp_1 = !_this__u8e3s4.c31_1.d1(); } else { tmp_1 = false; } var startWithSlash = tmp_1; _this__u8e3s4.c31_1 = (endsWithSlash ? startWithSlash : false) ? plus_0(dropLast(_this__u8e3s4.c31_1, 1), drop(segments, 1)) : endsWithSlash ? plus_0(dropLast(_this__u8e3s4.c31_1, 1), segments) : startWithSlash ? plus_0(_this__u8e3s4.c31_1, drop(segments, 1)) : plus_0(_this__u8e3s4.c31_1, segments); return _this__u8e3s4; } function get_ROOT_PATH() { _init_properties_URLParser_kt__sf11to(); return ROOT_PATH; } var ROOT_PATH; function takeFrom(_this__u8e3s4, urlString) { _init_properties_URLParser_kt__sf11to(); if (isBlank(urlString)) return _this__u8e3s4; var tmp; try { tmp = takeFromUnsafe(_this__u8e3s4, urlString); } catch ($p) { var tmp_0; if ($p instanceof Error) { var cause = $p; throw new URLParserException(urlString, cause); } else { throw $p; } } return tmp; } function takeFromUnsafe(_this__u8e3s4, urlString) { _init_properties_URLParser_kt__sf11to(); var tmp$ret$1; $l$block: { // Inline function 'kotlin.text.indexOfFirst' call var inductionVariable = 0; var last = charSequenceLength(urlString) - 1 | 0; if (inductionVariable <= last) do { var index = inductionVariable; inductionVariable = inductionVariable + 1 | 0; // Inline function 'io.ktor.http.takeFromUnsafe.' call var it = charSequenceGet(urlString, index); if (!isWhitespace(it)) { tmp$ret$1 = index; break $l$block; } } while (inductionVariable <= last); tmp$ret$1 = -1; } var startIndex = tmp$ret$1; var tmp$ret$3; $l$block_0: { // Inline function 'kotlin.text.indexOfLast' call var inductionVariable_0 = charSequenceLength(urlString) - 1 | 0; if (0 <= inductionVariable_0) do { var index_0 = inductionVariable_0; inductionVariable_0 = inductionVariable_0 + -1 | 0; // Inline function 'io.ktor.http.takeFromUnsafe.' call var it_0 = charSequenceGet(urlString, index_0); if (!isWhitespace(it_0)) { tmp$ret$3 = index_0; break $l$block_0; } } while (0 <= inductionVariable_0); tmp$ret$3 = -1; } var endIndex = tmp$ret$3 + 1 | 0; var schemeLength = findScheme(urlString, startIndex, endIndex); if (schemeLength > 0) { // Inline function 'kotlin.text.substring' call var startIndex_0 = startIndex; var endIndex_0 = startIndex + schemeLength | 0; // Inline function 'kotlin.js.asDynamic' call var scheme = urlString.substring(startIndex_0, endIndex_0); _this__u8e3s4.v30_1 = Companion_getInstance_7().l32(scheme); startIndex = startIndex + (schemeLength + 1 | 0) | 0; } var slashCount = count(urlString, startIndex, endIndex, _Char___init__impl__6a9atx(47)); startIndex = startIndex + slashCount | 0; if (_this__u8e3s4.v30_1.f31_1 === 'file') { parseFile(_this__u8e3s4, urlString, startIndex, endIndex, slashCount); return _this__u8e3s4; } if (_this__u8e3s4.v30_1.f31_1 === 'mailto') { // Inline function 'kotlin.require' call // Inline function 'kotlin.contracts.contract' call // Inline function 'kotlin.require' call // Inline function 'kotlin.contracts.contract' call if (!(slashCount === 0)) { // Inline function 'kotlin.require.' call var message = 'Failed requirement.'; throw IllegalArgumentException_init_$Create$(toString(message)); } parseMailto(_this__u8e3s4, urlString, startIndex, endIndex); return _this__u8e3s4; } if (slashCount >= 2) { loop: while (true) { // Inline function 'kotlin.takeIf' call var this_0 = indexOfAny(urlString, toCharArray('@/\\?#'), startIndex); // Inline function 'kotlin.contracts.contract' call var tmp; // Inline function 'io.ktor.http.takeFromUnsafe.' call if (this_0 > 0) { tmp = this_0; } else { tmp = null; } var tmp0_elvis_lhs = tmp; var delimiter = tmp0_elvis_lhs == null ? endIndex : tmp0_elvis_lhs; if (delimiter < endIndex ? charSequenceGet(urlString, delimiter) === _Char___init__impl__6a9atx(64) : false) { var passwordIndex = indexOfColonInHostPort(urlString, startIndex, delimiter); if (!(passwordIndex === -1)) { var tmp_0 = _this__u8e3s4; // Inline function 'kotlin.text.substring' call var startIndex_1 = startIndex; // Inline function 'kotlin.js.asDynamic' call tmp_0.z30_1 = urlString.substring(startIndex_1, passwordIndex); var tmp_1 = _this__u8e3s4; // Inline function 'kotlin.text.substring' call var startIndex_2 = passwordIndex + 1 | 0; // Inline function 'kotlin.js.asDynamic' call tmp_1.a31_1 = urlString.substring(startIndex_2, delimiter); } else { var tmp_2 = _this__u8e3s4; // Inline function 'kotlin.text.substring' call var startIndex_3 = startIndex; // Inline function 'kotlin.js.asDynamic' call tmp_2.z30_1 = urlString.substring(startIndex_3, delimiter); } startIndex = delimiter + 1 | 0; } else { fillHost(_this__u8e3s4, urlString, startIndex, delimiter); startIndex = delimiter; break loop; } } } if (startIndex >= endIndex) { _this__u8e3s4.c31_1 = charSequenceGet(urlString, endIndex - 1 | 0) === _Char___init__impl__6a9atx(47) ? get_ROOT_PATH() : emptyList(); return _this__u8e3s4; } var tmp_3 = _this__u8e3s4; var tmp_4; if (slashCount === 0) { tmp_4 = dropLast(_this__u8e3s4.c31_1, 1); } else { tmp_4 = emptyList(); } tmp_3.c31_1 = tmp_4; // Inline function 'kotlin.takeIf' call var this_1 = indexOfAny(urlString, toCharArray('?#'), startIndex); // Inline function 'kotlin.contracts.contract' call var tmp_5; // Inline function 'io.ktor.http.takeFromUnsafe.' call if (this_1 > 0) { tmp_5 = this_1; } else { tmp_5 = null; } var tmp1_elvis_lhs = tmp_5; var pathEnd = tmp1_elvis_lhs == null ? endIndex : tmp1_elvis_lhs; if (pathEnd > startIndex) { // Inline function 'kotlin.text.substring' call var startIndex_4 = startIndex; // Inline function 'kotlin.js.asDynamic' call var rawPath = urlString.substring(startIndex_4, pathEnd); var tmp_6; var tmp_7; if (_this__u8e3s4.c31_1.u() === 1) { // Inline function 'kotlin.text.isEmpty' call var this_2 = first_0(_this__u8e3s4.c31_1); tmp_7 = charSequenceLength(this_2) === 0; } else { tmp_7 = false; } if (tmp_7) { tmp_6 = emptyList(); } else { tmp_6 = _this__u8e3s4.c31_1; } var basePath = tmp_6; var rawChunks = rawPath === '/' ? get_ROOT_PATH() : split(rawPath, charArrayOf([_Char___init__impl__6a9atx(47)])); var relativePath = plus_0(slashCount === 1 ? get_ROOT_PATH() : emptyList(), rawChunks); _this__u8e3s4.c31_1 = plus_0(basePath, relativePath); startIndex = pathEnd; } if (startIndex < endIndex ? charSequenceGet(urlString, startIndex) === _Char___init__impl__6a9atx(63) : false) { startIndex = parseQuery(_this__u8e3s4, urlString, startIndex, endIndex); } parseFragment(_this__u8e3s4, urlString, startIndex, endIndex); return _this__u8e3s4; } function URLParserException(urlString, cause) { IllegalStateException_init_$Init$('Fail to parse url: ' + urlString, cause, this); captureStack(this, URLParserException); } function findScheme(urlString, startIndex, endIndex) { _init_properties_URLParser_kt__sf11to(); var current = startIndex; var incorrectSchemePosition = -1; var firstChar = charSequenceGet(urlString, current); if (!(_Char___init__impl__6a9atx(97) <= firstChar ? firstChar <= _Char___init__impl__6a9atx(122) : false) ? !(_Char___init__impl__6a9atx(65) <= firstChar ? firstChar <= _Char___init__impl__6a9atx(90) : false) : false) { incorrectSchemePosition = current; } while (current < endIndex) { var char = charSequenceGet(urlString, current); if (char === _Char___init__impl__6a9atx(58)) { if (!(incorrectSchemePosition === -1)) { throw IllegalArgumentException_init_$Create$('Illegal character in scheme at position ' + incorrectSchemePosition); } return current - startIndex | 0; } if ((char === _Char___init__impl__6a9atx(47) ? true : char === _Char___init__impl__6a9atx(63)) ? true : char === _Char___init__impl__6a9atx(35)) return -1; if ((((((incorrectSchemePosition === -1 ? !(_Char___init__impl__6a9atx(97) <= char ? char <= _Char___init__impl__6a9atx(122) : false) : false) ? !(_Char___init__impl__6a9atx(65) <= char ? char <= _Char___init__impl__6a9atx(90) : false) : false) ? !(_Char___init__impl__6a9atx(48) <= char ? char <= _Char___init__impl__6a9atx(57) : false) : false) ? !(char === _Char___init__impl__6a9atx(46)) : false) ? !(char === _Char___init__impl__6a9atx(43)) : false) ? !(char === _Char___init__impl__6a9atx(45)) : false) { incorrectSchemePosition = current; } current = current + 1 | 0; } return -1; } function count(urlString, startIndex, endIndex, char) { _init_properties_URLParser_kt__sf11to(); var result = 0; $l$loop: while ((startIndex + result | 0) < endIndex && charSequenceGet(urlString, startIndex + result | 0) === char) { result = result + 1 | 0; } return result; } function parseFile(_this__u8e3s4, urlString, startIndex, endIndex, slashCount) { _init_properties_URLParser_kt__sf11to(); switch (slashCount) { case 2: var nextSlash = indexOf(urlString, _Char___init__impl__6a9atx(47), startIndex); if (nextSlash === -1 ? true : nextSlash === endIndex) { var tmp = _this__u8e3s4; // Inline function 'kotlin.text.substring' call // Inline function 'kotlin.js.asDynamic' call tmp.w30_1 = urlString.substring(startIndex, endIndex); return Unit_instance; } var tmp_0 = _this__u8e3s4; // Inline function 'kotlin.text.substring' call // Inline function 'kotlin.js.asDynamic' call tmp_0.w30_1 = urlString.substring(startIndex, nextSlash); // Inline function 'kotlin.text.substring' call // Inline function 'kotlin.js.asDynamic' call var tmp$ret$5 = urlString.substring(nextSlash, endIndex); set_encodedPath(_this__u8e3s4, tmp$ret$5); break; case 3: _this__u8e3s4.w30_1 = ''; // Inline function 'kotlin.text.substring' call // Inline function 'kotlin.js.asDynamic' call var tmp$ret$7 = urlString.substring(startIndex, endIndex); set_encodedPath(_this__u8e3s4, '/' + tmp$ret$7); break; default: throw IllegalArgumentException_init_$Create$('Invalid file url: ' + urlString); } } function parseMailto(_this__u8e3s4, urlString, startIndex, endIndex) { _init_properties_URLParser_kt__sf11to(); var delimiter = indexOf_0(urlString, '@', startIndex); if (delimiter === -1) { throw IllegalArgumentException_init_$Create$('Invalid mailto url: ' + urlString + ", it should contain '@'."); } // Inline function 'kotlin.text.substring' call // Inline function 'kotlin.js.asDynamic' call var tmp$ret$1 = urlString.substring(startIndex, delimiter); _this__u8e3s4.e32(decodeURLPart(tmp$ret$1)); var tmp = _this__u8e3s4; // Inline function 'kotlin.text.substring' call var startIndex_0 = delimiter + 1 | 0; // Inline function 'kotlin.js.asDynamic' call tmp.w30_1 = urlString.substring(startIndex_0, endIndex); } function indexOfColonInHostPort(_this__u8e3s4, startIndex, endIndex) { _init_properties_URLParser_kt__sf11to(); var skip = false; var inductionVariable = startIndex; if (inductionVariable < endIndex) do { var index = inductionVariable; inductionVariable = inductionVariable + 1 | 0; var tmp1_subject = charSequenceGet(_this__u8e3s4, index); if (tmp1_subject === _Char___init__impl__6a9atx(91)) skip = true; else if (tmp1_subject === _Char___init__impl__6a9atx(93)) skip = false; else if (tmp1_subject === _Char___init__impl__6a9atx(58)) if (!skip) return index; } while (inductionVariable < endIndex); return -1; } function fillHost(_this__u8e3s4, urlString, startIndex, endIndex) { _init_properties_URLParser_kt__sf11to(); // Inline function 'kotlin.takeIf' call var this_0 = indexOfColonInHostPort(urlString, startIndex, endIndex); // Inline function 'kotlin.contracts.contract' call var tmp; // Inline function 'io.ktor.http.fillHost.' call if (this_0 > 0) { tmp = this_0; } else { tmp = null; } var tmp0_elvis_lhs = tmp; var colonIndex = tmp0_elvis_lhs == null ? endIndex : tmp0_elvis_lhs; var tmp_0 = _this__u8e3s4; // Inline function 'kotlin.text.substring' call // Inline function 'kotlin.js.asDynamic' call tmp_0.w30_1 = urlString.substring(startIndex, colonIndex); if ((colonIndex + 1 | 0) < endIndex) { var tmp_1 = _this__u8e3s4; // Inline function 'kotlin.text.substring' call var startIndex_0 = colonIndex + 1 | 0; // Inline function 'kotlin.js.asDynamic' call var tmp$ret$5 = urlString.substring(startIndex_0, endIndex); tmp_1.x30_1 = toInt(tmp$ret$5); } else { _this__u8e3s4.x30_1 = get_DEFAULT_PORT(); } } function parseQuery(_this__u8e3s4, urlString, startIndex, endIndex) { _init_properties_URLParser_kt__sf11to(); if ((startIndex + 1 | 0) === endIndex) { _this__u8e3s4.y30_1 = true; return endIndex; } // Inline function 'kotlin.takeIf' call var this_0 = indexOf(urlString, _Char___init__impl__6a9atx(35), startIndex + 1 | 0); // Inline function 'kotlin.contracts.contract' call var tmp; // Inline function 'io.ktor.http.parseQuery.' call if (this_0 > 0) { tmp = this_0; } else { tmp = null; } var tmp0_elvis_lhs = tmp; var fragmentStart = tmp0_elvis_lhs == null ? endIndex : tmp0_elvis_lhs; // Inline function 'kotlin.text.substring' call var startIndex_0 = startIndex + 1 | 0; // Inline function 'kotlin.js.asDynamic' call var tmp$ret$3 = urlString.substring(startIndex_0, fragmentStart); var rawParameters = parseQueryString(tmp$ret$3, VOID, VOID, false); rawParameters.a2o(parseQuery$lambda(_this__u8e3s4)); return fragmentStart; } function parseFragment(_this__u8e3s4, urlString, startIndex, endIndex) { _init_properties_URLParser_kt__sf11to(); if (startIndex < endIndex ? charSequenceGet(urlString, startIndex) === _Char___init__impl__6a9atx(35) : false) { var tmp = _this__u8e3s4; // Inline function 'kotlin.text.substring' call var startIndex_0 = startIndex + 1 | 0; // Inline function 'kotlin.js.asDynamic' call tmp.b31_1 = urlString.substring(startIndex_0, endIndex); } } function parseQuery$lambda($this_parseQuery) { return function (key, values) { $this_parseQuery.d31_1.e2o(key, values); return Unit_instance; }; } var properties_initialized_URLParser_kt_hd1g6a; function _init_properties_URLParser_kt__sf11to() { if (!properties_initialized_URLParser_kt_hd1g6a) { properties_initialized_URLParser_kt_hd1g6a = true; ROOT_PATH = listOf_0(''); } } function isWebsocket(_this__u8e3s4) { return _this__u8e3s4.f31_1 === 'ws' ? true : _this__u8e3s4.f31_1 === 'wss'; } function Companion_7() { Companion_instance_8 = this; this.y31_1 = new URLProtocol('http', 80); this.z31_1 = new URLProtocol('https', 443); this.a32_1 = new URLProtocol('ws', 80); this.b32_1 = new URLProtocol('wss', 443); this.c32_1 = new URLProtocol('socks', 1080); var tmp = this; // Inline function 'kotlin.collections.associateBy' call var this_0 = listOf([this.y31_1, this.z31_1, this.a32_1, this.b32_1, this.c32_1]); var capacity = coerceAtLeast(mapCapacity(collectionSizeOrDefault(this_0, 10)), 16); // Inline function 'kotlin.collections.associateByTo' call var destination = LinkedHashMap_init_$Create$(capacity); var tmp0_iterator = this_0.w(); while (tmp0_iterator.f()) { var element = tmp0_iterator.e(); // Inline function 'io.ktor.http.Companion.byName.' call var tmp$ret$0 = element.f31_1; destination.s(tmp$ret$0, element); } tmp.d32_1 = destination; } protoOf(Companion_7).l32 = function (name) { // Inline function 'kotlin.let' call // Inline function 'kotlin.contracts.contract' call // Inline function 'io.ktor.http.Companion.createOrDefault.' call var it = toLowerCasePreservingASCIIRules(name); var tmp0_elvis_lhs = Companion_getInstance_7().d32_1.q(it); return tmp0_elvis_lhs == null ? new URLProtocol(it, get_DEFAULT_PORT()) : tmp0_elvis_lhs; }; var Companion_instance_8; function Companion_getInstance_7() { if (Companion_instance_8 == null) new Companion_7(); return Companion_instance_8; } function URLProtocol(name, defaultPort) { Companion_getInstance_7(); this.f31_1 = name; this.g31_1 = defaultPort; // Inline function 'kotlin.require' call var tmp$ret$1; $l$block: { // Inline function 'kotlin.text.all' call var indexedObject = this.f31_1; var inductionVariable = 0; while (inductionVariable < charSequenceLength(indexedObject)) { var element = charSequenceGet(indexedObject, inductionVariable); inductionVariable = inductionVariable + 1 | 0; // Inline function 'io.ktor.http.URLProtocol.' call if (!isLowerCase(element)) { tmp$ret$1 = false; break $l$block; } } tmp$ret$1 = true; } // Inline function 'kotlin.contracts.contract' call if (!tmp$ret$1) { // Inline function 'io.ktor.http.URLProtocol.' call var message = 'All characters should be lower case'; throw IllegalArgumentException_init_$Create$(toString(message)); } } protoOf(URLProtocol).toString = function () { return 'URLProtocol(name=' + this.f31_1 + ', defaultPort=' + this.g31_1 + ')'; }; protoOf(URLProtocol).hashCode = function () { var result = getStringHashCode(this.f31_1); result = imul(result, 31) + this.g31_1 | 0; return result; }; protoOf(URLProtocol).equals = function (other) { if (this === other) return true; if (!(other instanceof URLProtocol)) return false; var tmp0_other_with_cast = other instanceof URLProtocol ? other : THROW_CCE(); if (!(this.f31_1 === tmp0_other_with_cast.f31_1)) return false; if (!(this.g31_1 === tmp0_other_with_cast.g31_1)) return false; return true; }; function isSecure(_this__u8e3s4) { return _this__u8e3s4.f31_1 === 'https' ? true : _this__u8e3s4.f31_1 === 'wss'; } function takeFrom_0(_this__u8e3s4, url) { _this__u8e3s4.v30_1 = url.v30_1; _this__u8e3s4.w30_1 = url.w30_1; _this__u8e3s4.x30_1 = url.x30_1; _this__u8e3s4.c31_1 = url.c31_1; _this__u8e3s4.z30_1 = url.z30_1; _this__u8e3s4.a31_1 = url.a31_1; // Inline function 'kotlin.apply' call var this_0 = ParametersBuilder(); // Inline function 'kotlin.contracts.contract' call // Inline function 'io.ktor.http.takeFrom.' call appendAll(this_0, url.d31_1); _this__u8e3s4.j32(this_0); _this__u8e3s4.b31_1 = url.b31_1; _this__u8e3s4.y30_1 = url.y30_1; return _this__u8e3s4; } function Url(urlString) { return URLBuilder_0(urlString).f3(); } function appendUrlFullPath(_this__u8e3s4, encodedPath, encodedQueryParameters, trailingQuery) { var tmp; // Inline function 'kotlin.text.isNotBlank' call if (!isBlank(encodedPath)) { tmp = !startsWith_0(encodedPath, '/'); } else { tmp = false; } if (tmp) { _this__u8e3s4.z5(_Char___init__impl__6a9atx(47)); } _this__u8e3s4.r8(encodedPath); if (!encodedQueryParameters.d1() ? true : trailingQuery) { _this__u8e3s4.r8('?'); } // Inline function 'kotlin.collections.flatMap' call // Inline function 'kotlin.collections.flatMapTo' call var this_0 = encodedQueryParameters.z2n(); var destination = ArrayList_init_$Create$_0(); var tmp0_iterator = this_0.w(); while (tmp0_iterator.f()) { var element = tmp0_iterator.e(); // Inline function 'io.ktor.http.appendUrlFullPath.' call // Inline function 'kotlin.collections.component1' call var key = element.s2(); // Inline function 'kotlin.collections.component2' call var value = element.t2(); var tmp_0; if (value.d1()) { tmp_0 = listOf_0(to(key, null)); } else { // Inline function 'kotlin.collections.map' call // Inline function 'kotlin.collections.mapTo' call var destination_0 = ArrayList_init_$Create$(collectionSizeOrDefault(value, 10)); var tmp0_iterator_0 = value.w(); while (tmp0_iterator_0.f()) { var item = tmp0_iterator_0.e(); // Inline function 'io.ktor.http.appendUrlFullPath..' call var tmp$ret$3 = to(key, item); destination_0.j1(tmp$ret$3); } tmp_0 = destination_0; } var list = tmp_0; addAll(destination, list); } var tmp_1 = destination; joinTo(tmp_1, _this__u8e3s4, '&', VOID, VOID, VOID, VOID, appendUrlFullPath$lambda); } function appendUserAndPassword(_this__u8e3s4, encodedUser, encodedPassword) { if (encodedUser == null) { return Unit_instance; } _this__u8e3s4.y5(encodedUser); if (!(encodedPassword == null)) { _this__u8e3s4.z5(_Char___init__impl__6a9atx(58)); _this__u8e3s4.y5(encodedPassword); } _this__u8e3s4.y5('@'); } function get_hostWithPort(_this__u8e3s4) { return _this__u8e3s4.i31_1 + ':' + _this__u8e3s4.m32(); } function URLBuilder_0(urlString) { return takeFrom(new URLBuilder(), urlString); } function appendUrlFullPath$lambda(it) { var key = it.w6_1; var tmp; if (it.x6_1 == null) { tmp = key; } else { var value = toString_1(it.x6_1); tmp = key + '=' + value; } return tmp; } function Companion_8() { } var Companion_instance_9; function Companion_getInstance_8() { return Companion_instance_9; } function Url$encodedPath$delegate$lambda(this$0) { return function () { var tmp; if (this$0.k31_1.d1()) { return ''; } var pathStartIndex = indexOf(this$0.q31_1, _Char___init__impl__6a9atx(47), this$0.h31_1.f31_1.length + 3 | 0); var tmp_0; if (pathStartIndex === -1) { return ''; } // Inline function 'kotlin.charArrayOf' call var tmp$ret$0 = charArrayOf([_Char___init__impl__6a9atx(63), _Char___init__impl__6a9atx(35)]); var pathEndIndex = indexOfAny(this$0.q31_1, tmp$ret$0, pathStartIndex); var tmp_1; if (pathEndIndex === -1) { // Inline function 'kotlin.text.substring' call // Inline function 'kotlin.js.asDynamic' call return this$0.q31_1.substring(pathStartIndex); } // Inline function 'kotlin.text.substring' call // Inline function 'kotlin.js.asDynamic' call return this$0.q31_1.substring(pathStartIndex, pathEndIndex); }; } function Url$encodedQuery$delegate$lambda(this$0) { return function () { var queryStart = indexOf(this$0.q31_1, _Char___init__impl__6a9atx(63)) + 1 | 0; var tmp; if (queryStart === 0) { return ''; } var queryEnd = indexOf(this$0.q31_1, _Char___init__impl__6a9atx(35), queryStart); var tmp_0; if (queryEnd === -1) { // Inline function 'kotlin.text.substring' call // Inline function 'kotlin.js.asDynamic' call return this$0.q31_1.substring(queryStart); } // Inline function 'kotlin.text.substring' call // Inline function 'kotlin.js.asDynamic' call return this$0.q31_1.substring(queryStart, queryEnd); }; } function Url$encodedPathAndQuery$delegate$lambda(this$0) { return function () { var pathStart = indexOf(this$0.q31_1, _Char___init__impl__6a9atx(47), this$0.h31_1.f31_1.length + 3 | 0); var tmp; if (pathStart === -1) { return ''; } var queryEnd = indexOf(this$0.q31_1, _Char___init__impl__6a9atx(35), pathStart); var tmp_0; if (queryEnd === -1) { // Inline function 'kotlin.text.substring' call // Inline function 'kotlin.js.asDynamic' call return this$0.q31_1.substring(pathStart); } // Inline function 'kotlin.text.substring' call // Inline function 'kotlin.js.asDynamic' call return this$0.q31_1.substring(pathStart, queryEnd); }; } function Url$encodedUser$delegate$lambda(this$0) { return function () { var tmp; if (this$0.n31_1 == null) { return null; } var tmp_0; // Inline function 'kotlin.text.isEmpty' call var this_0 = this$0.n31_1; if (charSequenceLength(this_0) === 0) { return ''; } var usernameStart = this$0.h31_1.f31_1.length + 3 | 0; // Inline function 'kotlin.charArrayOf' call var tmp$ret$1 = charArrayOf([_Char___init__impl__6a9atx(58), _Char___init__impl__6a9atx(64)]); var usernameEnd = indexOfAny(this$0.q31_1, tmp$ret$1, usernameStart); // Inline function 'kotlin.text.substring' call // Inline function 'kotlin.js.asDynamic' call return this$0.q31_1.substring(usernameStart, usernameEnd); }; } function Url$encodedPassword$delegate$lambda(this$0) { return function () { var tmp; if (this$0.o31_1 == null) { return null; } var tmp_0; // Inline function 'kotlin.text.isEmpty' call var this_0 = this$0.o31_1; if (charSequenceLength(this_0) === 0) { return ''; } var passwordStart = indexOf(this$0.q31_1, _Char___init__impl__6a9atx(58), this$0.h31_1.f31_1.length + 3 | 0) + 1 | 0; var passwordEnd = indexOf(this$0.q31_1, _Char___init__impl__6a9atx(64)); // Inline function 'kotlin.text.substring' call // Inline function 'kotlin.js.asDynamic' call return this$0.q31_1.substring(passwordStart, passwordEnd); }; } function Url$encodedFragment$delegate$lambda(this$0) { return function () { var fragmentStart = indexOf(this$0.q31_1, _Char___init__impl__6a9atx(35)) + 1 | 0; var tmp; if (fragmentStart === 0) { return ''; } // Inline function 'kotlin.text.substring' call // Inline function 'kotlin.js.asDynamic' call return this$0.q31_1.substring(fragmentStart); }; } function Url_0(protocol, host, specifiedPort, pathSegments, parameters, fragment, user, password, trailingQuery, urlString) { this.h31_1 = protocol; this.i31_1 = host; this.j31_1 = specifiedPort; this.k31_1 = pathSegments; this.l31_1 = parameters; this.m31_1 = fragment; this.n31_1 = user; this.o31_1 = password; this.p31_1 = trailingQuery; this.q31_1 = urlString; // Inline function 'kotlin.require' call var tmp; var containsArg = this.j31_1; if (0 <= containsArg ? containsArg <= 65535 : false) { tmp = true; } else { tmp = this.j31_1 === get_DEFAULT_PORT(); } // Inline function 'kotlin.contracts.contract' call if (!tmp) { // Inline function 'io.ktor.http.Url.' call var message = 'port must be between 0 and 65535, or ' + get_DEFAULT_PORT() + ' if not set'; throw IllegalArgumentException_init_$Create$(toString(message)); } var tmp_0 = this; tmp_0.r31_1 = lazy_0(Url$encodedPath$delegate$lambda(this)); var tmp_1 = this; tmp_1.s31_1 = lazy_0(Url$encodedQuery$delegate$lambda(this)); var tmp_2 = this; tmp_2.t31_1 = lazy_0(Url$encodedPathAndQuery$delegate$lambda(this)); var tmp_3 = this; tmp_3.u31_1 = lazy_0(Url$encodedUser$delegate$lambda(this)); var tmp_4 = this; tmp_4.v31_1 = lazy_0(Url$encodedPassword$delegate$lambda(this)); var tmp_5 = this; tmp_5.w31_1 = lazy_0(Url$encodedFragment$delegate$lambda(this)); } protoOf(Url_0).m32 = function () { // Inline function 'kotlin.takeUnless' call var this_0 = this.j31_1; // Inline function 'kotlin.contracts.contract' call var tmp; // Inline function 'io.ktor.http.Url..' call if (!(this_0 === get_DEFAULT_PORT())) { tmp = this_0; } else { tmp = null; } var tmp0_elvis_lhs = tmp; return tmp0_elvis_lhs == null ? this.h31_1.g31_1 : tmp0_elvis_lhs; }; protoOf(Url_0).n32 = function () { // Inline function 'kotlin.getValue' call var this_0 = this.u31_1; encodedUser$factory(); return this_0.t2(); }; protoOf(Url_0).o32 = function () { // Inline function 'kotlin.getValue' call var this_0 = this.v31_1; encodedPassword$factory(); return this_0.t2(); }; protoOf(Url_0).toString = function () { return this.q31_1; }; protoOf(Url_0).equals = function (other) { if (this === other) return true; if (other == null ? true : !getKClassFromExpression(this).equals(getKClassFromExpression(other))) return false; if (!(other instanceof Url_0)) THROW_CCE(); if (!(this.q31_1 === other.q31_1)) return false; return true; }; protoOf(Url_0).hashCode = function () { return getStringHashCode(this.q31_1); }; function get_authority_0(_this__u8e3s4) { // Inline function 'kotlin.text.buildString' call // Inline function 'kotlin.contracts.contract' call // Inline function 'kotlin.apply' call var this_0 = StringBuilder_init_$Create$(); // Inline function 'kotlin.contracts.contract' call // Inline function 'io.ktor.http..' call this_0.y5(get_encodedUserAndPassword_0(_this__u8e3s4)); if (_this__u8e3s4.j31_1 === get_DEFAULT_PORT() ? true : _this__u8e3s4.j31_1 === _this__u8e3s4.h31_1.g31_1) { this_0.y5(_this__u8e3s4.i31_1); } else { this_0.y5(get_hostWithPort(_this__u8e3s4)); } return this_0.toString(); } function get_encodedUserAndPassword_0(_this__u8e3s4) { // Inline function 'kotlin.text.buildString' call // Inline function 'kotlin.contracts.contract' call // Inline function 'kotlin.apply' call var this_0 = StringBuilder_init_$Create$(); // Inline function 'kotlin.contracts.contract' call // Inline function 'io.ktor.http..' call appendUserAndPassword(this_0, _this__u8e3s4.n32(), _this__u8e3s4.o32()); return this_0.toString(); } function encodedUser$factory() { return getPropertyCallableRef('encodedUser', 1, KProperty1, function (receiver) { return receiver.n32(); }, null); } function encodedPassword$factory() { return getPropertyCallableRef('encodedPassword', 1, KProperty1, function (receiver) { return receiver.o32(); }, null); } function UrlDecodedParametersBuilder(encodedParametersBuilder) { this.p32_1 = encodedParametersBuilder; this.q32_1 = this.p32_1.w2n(); } protoOf(UrlDecodedParametersBuilder).f3 = function () { return decodeParameters(this.p32_1); }; protoOf(UrlDecodedParametersBuilder).w2n = function () { return this.q32_1; }; protoOf(UrlDecodedParametersBuilder).x2n = function (name) { var tmp0_safe_receiver = this.p32_1.x2n(encodeURLParameter(name)); var tmp; if (tmp0_safe_receiver == null) { tmp = null; } else { // Inline function 'kotlin.collections.map' call // Inline function 'kotlin.collections.mapTo' call var destination = ArrayList_init_$Create$(collectionSizeOrDefault(tmp0_safe_receiver, 10)); var tmp0_iterator = tmp0_safe_receiver.w(); while (tmp0_iterator.f()) { var item = tmp0_iterator.e(); // Inline function 'io.ktor.http.UrlDecodedParametersBuilder.getAll.' call var tmp$ret$0 = decodeURLQueryComponent(item, VOID, VOID, true); destination.j1(tmp$ret$0); } tmp = destination; } return tmp; }; protoOf(UrlDecodedParametersBuilder).y2n = function () { // Inline function 'kotlin.collections.map' call var this_0 = this.p32_1.y2n(); // Inline function 'kotlin.collections.mapTo' call var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10)); var tmp0_iterator = this_0.w(); while (tmp0_iterator.f()) { var item = tmp0_iterator.e(); // Inline function 'io.ktor.http.UrlDecodedParametersBuilder.names.' call var tmp$ret$0 = decodeURLQueryComponent(item); destination.j1(tmp$ret$0); } return toSet(destination); }; protoOf(UrlDecodedParametersBuilder).d1 = function () { return this.p32_1.d1(); }; protoOf(UrlDecodedParametersBuilder).z2n = function () { return decodeParameters(this.p32_1).z2n(); }; protoOf(UrlDecodedParametersBuilder).i2o = function (name, value) { return this.p32_1.i2o(encodeURLParameter(name), encodeURLParameterValue(value)); }; protoOf(UrlDecodedParametersBuilder).e2o = function (name, values) { var tmp = encodeURLParameter(name); // Inline function 'kotlin.collections.map' call // Inline function 'kotlin.collections.mapTo' call var destination = ArrayList_init_$Create$(collectionSizeOrDefault(values, 10)); var tmp0_iterator = values.w(); while (tmp0_iterator.f()) { var item = tmp0_iterator.e(); // Inline function 'io.ktor.http.UrlDecodedParametersBuilder.appendAll.' call var tmp$ret$0 = encodeURLParameterValue(item); destination.j1(tmp$ret$0); } return this.p32_1.e2o(tmp, destination); }; protoOf(UrlDecodedParametersBuilder).o1 = function () { return this.p32_1.o1(); }; function encodeParameters(parameters) { // Inline function 'kotlin.apply' call var this_0 = ParametersBuilder(); // Inline function 'kotlin.contracts.contract' call // Inline function 'io.ktor.http.encodeParameters.' call appendAllEncoded(this_0, parameters); return this_0; } function decodeParameters(parameters) { // Inline function 'kotlin.apply' call var this_0 = ParametersBuilder(); // Inline function 'kotlin.contracts.contract' call // Inline function 'io.ktor.http.decodeParameters.' call appendAllDecoded(this_0, parameters); return this_0.f3(); } function appendAllEncoded(_this__u8e3s4, parameters) { // Inline function 'kotlin.collections.forEach' call var tmp0_iterator = parameters.y2n().w(); while (tmp0_iterator.f()) { var element = tmp0_iterator.e(); // Inline function 'io.ktor.http.appendAllEncoded.' call var tmp0_elvis_lhs = parameters.x2n(element); var values = tmp0_elvis_lhs == null ? emptyList() : tmp0_elvis_lhs; var tmp = encodeURLParameter(element); // Inline function 'kotlin.collections.map' call // Inline function 'kotlin.collections.mapTo' call var destination = ArrayList_init_$Create$(collectionSizeOrDefault(values, 10)); var tmp0_iterator_0 = values.w(); while (tmp0_iterator_0.f()) { var item = tmp0_iterator_0.e(); // Inline function 'io.ktor.http.appendAllEncoded..' call var tmp$ret$0 = encodeURLParameterValue(item); destination.j1(tmp$ret$0); } _this__u8e3s4.e2o(tmp, destination); } } function appendAllDecoded(_this__u8e3s4, parameters) { // Inline function 'kotlin.collections.forEach' call var tmp0_iterator = parameters.y2n().w(); while (tmp0_iterator.f()) { var element = tmp0_iterator.e(); // Inline function 'io.ktor.http.appendAllDecoded.' call var tmp0_elvis_lhs = parameters.x2n(element); var values = tmp0_elvis_lhs == null ? emptyList() : tmp0_elvis_lhs; var tmp = decodeURLQueryComponent(element); // Inline function 'kotlin.collections.map' call // Inline function 'kotlin.collections.mapTo' call var destination = ArrayList_init_$Create$(collectionSizeOrDefault(values, 10)); var tmp0_iterator_0 = values.w(); while (tmp0_iterator_0.f()) { var item = tmp0_iterator_0.e(); // Inline function 'io.ktor.http.appendAllDecoded..' call var tmp$ret$0 = decodeURLQueryComponent(item, VOID, VOID, true); destination.j1(tmp$ret$0); } _this__u8e3s4.e2o(tmp, destination); } } function ByteArrayContent(bytes, contentType, status) { contentType = contentType === VOID ? null : contentType; status = status === VOID ? null : status; ByteArrayContent_0.call(this); this.s32_1 = bytes; this.t32_1 = contentType; this.u32_1 = status; } protoOf(ByteArrayContent).v32 = function () { return this.t32_1; }; protoOf(ByteArrayContent).w32 = function () { return toLong_0(this.s32_1.length); }; protoOf(ByteArrayContent).x32 = function () { return this.s32_1; }; function NoContent() { OutgoingContent.call(this); } function ReadChannelContent() { OutgoingContent.call(this); } function WriteChannelContent() { } function ByteArrayContent_0() { OutgoingContent.call(this); } function ProtocolUpgrade() { } function OutgoingContent() { this.y32_1 = null; } protoOf(OutgoingContent).v32 = function () { return null; }; protoOf(OutgoingContent).w32 = function () { return null; }; protoOf(OutgoingContent).u2x = function () { return Companion_getInstance_1().o2t_1; }; function NullBody() { } var NullBody_instance; function NullBody_getInstance() { return NullBody_instance; } function TextContent(text, contentType, status) { status = status === VOID ? null : status; ByteArrayContent_0.call(this); this.f33_1 = text; this.g33_1 = contentType; this.h33_1 = status; var tmp = this; var tmp$ret$0; $l$block: { // Inline function 'io.ktor.utils.io.core.toByteArray' call var this_0 = this.f33_1; var tmp0_elvis_lhs = charset(this.g33_1); var charset_0 = tmp0_elvis_lhs == null ? Charsets_getInstance().j2i_1 : tmp0_elvis_lhs; if (charset_0.equals(Charsets_getInstance().j2i_1)) { tmp$ret$0 = encodeToByteArray(this_0); break $l$block; } tmp$ret$0 = encodeToByteArray_0(charset_0.n2i(), this_0, 0, this_0.length); } tmp.i33_1 = tmp$ret$0; } protoOf(TextContent).v32 = function () { return this.g33_1; }; protoOf(TextContent).w32 = function () { return toLong_0(this.i33_1.length); }; protoOf(TextContent).x32 = function () { return this.i33_1; }; protoOf(TextContent).toString = function () { return 'TextContent[' + this.g33_1 + '] "' + take(this.f33_1, 30) + '"'; }; function get_origin(_this__u8e3s4) { var tmp; if (get_platform(PlatformUtils_getInstance()).ab_1 === 2) { var tmp_0 = function () { var tmpLocation = null; if (typeof window !== 'undefined') { tmpLocation = window.location; } else if (typeof self !== 'undefined') { tmpLocation = self.location; } var origin = ''; if (tmpLocation) { origin = tmpLocation.origin; } return origin && origin != 'null' ? origin : 'http://localhost'; }(); tmp = (!(tmp_0 == null) ? typeof tmp_0 === 'string' : false) ? tmp_0 : THROW_CCE(); } else { tmp = 'http://localhost'; } return tmp; } //region block: post-declaration protoOf(EmptyHeaders).ca = get; protoOf(EmptyHeaders).a2o = forEach; protoOf(EmptyParameters).a2o = forEach; //endregion //region block: init Companion_instance_1 = new Companion_0(); EmptyHeaders_instance = new EmptyHeaders(); EmptyParameters_instance = new EmptyParameters(); DEFAULT_PORT = 0; Companion_instance_9 = new Companion_8(); NullBody_instance = new NullBody(); //endregion //region block: exports _.$_$ = _.$_$ || {}; _.$_$.a = NullBody_instance; _.$_$.b = Application_getInstance; _.$_$.c = Companion_getInstance; _.$_$.d = Text_getInstance; _.$_$.e = Companion_getInstance_1; _.$_$.f = HttpHeaders_getInstance; _.$_$.g = Companion_getInstance_2; _.$_$.h = Companion_getInstance_3; _.$_$.i = Companion_getInstance_4; _.$_$.j = ByteArrayContent; _.$_$.k = ByteArrayContent_0; _.$_$.l = NoContent; _.$_$.m = ProtocolUpgrade; _.$_$.n = ReadChannelContent; _.$_$.o = WriteChannelContent; _.$_$.p = OutgoingContent; _.$_$.q = TextContent; _.$_$.r = HeadersBuilder; _.$_$.s = HttpStatusCode; _.$_$.t = URLBuilder; _.$_$.u = UnsafeHeaderException; _.$_$.v = appendPathSegments; _.$_$.w = get_authority; _.$_$.x = get_authority_0; _.$_$.y = charset_0; _.$_$.z = charset; _.$_$.a1 = contentLength; _.$_$.b1 = contentType; _.$_$.c1 = contentType_0; _.$_$.d1 = contentType_1; _.$_$.e1 = get_encodedPath; _.$_$.f1 = set_encodedPath; _.$_$.g1 = isSecure; _.$_$.h1 = isSuccess; _.$_$.i1 = isWebsocket; _.$_$.j1 = parseAndSortHeader; _.$_$.k1 = takeFrom_0; _.$_$.l1 = takeFrom; _.$_$.m1 = withCharsetIfNeeded; _.$_$.n1 = withCharset; //endregion return _; }(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./ktor-ktor-io.js'), require('./ktor-ktor-utils.js'))); //# sourceMappingURL=ktor-ktor-http.js.map