{"version":3,"sources":["webpack://lib-util/webpack/universalModuleDefinition","webpack://lib-util/webpack/bootstrap","webpack://lib-util/./kotlin-dce/wrapper.js","webpack://lib-util/./kotlin-dce/js/misc.js","webpack://lib-util/./kotlin-dce/js/polyfills.js","webpack://lib-util/./kotlin-dce/js/core.js","webpack://lib-util/./kotlin-dce/js/markerFunctions.js","webpack://lib-util/./kotlin-dce/js/arrayUtils.js","webpack://lib-util/./kotlin-dce/js/conversions.js","webpack://lib-util/./kotlin-dce/js/long.js","webpack://lib-util/./kotlin-dce/js/rtti.js","webpack://lib-util/./kotlin-dce/runtime/arrayUtils.kt","webpack://lib-util/./kotlin-dce/runtime/Enum.kt","webpack://lib-util/./kotlin-dce/primitiveCompanionObjects.kt","webpack://lib-util/./kotlin-dce/common/src/generated/_Arrays.kt","webpack://lib-util/./kotlin-dce/common/src/generated/_Ranges.kt","webpack://lib-util/./kotlin-dce/unsigned/src/kotlin/UByte.kt","webpack://lib-util/./kotlin-dce/unsigned/src/kotlin/UInt.kt","webpack://lib-util/./kotlin-dce/unsigned/src/kotlin/UShort.kt","webpack://lib-util/./kotlin-dce/src/kotlin/collections/Collections.kt","webpack://lib-util/./kotlin-dce/src/kotlin/collections/Maps.kt","webpack://lib-util/./kotlin-dce/src/kotlin/text/StringNumberConversions.kt","webpack://lib-util/./kotlin-dce/src/kotlin/time/Duration.kt","webpack://lib-util/./kotlin-dce/src/kotlin/collections/Sequences.kt","webpack://lib-util/./kotlin-dce/common/src/generated/_Collections.kt","webpack://lib-util/./kotlin-dce/src/kotlin/util/Preconditions.kt","webpack://lib-util/./kotlin-dce/src/kotlin/collections/Iterables.kt","webpack://lib-util/./kotlin-dce/common/src/generated/_Sequences.kt","webpack://lib-util/./kotlin-dce/common/src/generated/_Strings.kt","webpack://lib-util/./kotlin-dce/src/kotlin/text/Strings.kt","webpack://lib-util/./kotlin-dce/builtin-sources/Unit.kt","webpack://lib-util/./kotlin-dce/unsigned/src/kotlin/UnsignedUtils.kt","webpack://lib-util/./kotlin-dce/src/kotlin/builtins.kt","webpack://lib-util/./kotlin-dce/src/kotlin/coroutines/CoroutineImpl.kt","webpack://lib-util/./kotlin-dce/src/kotlin/util/Result.kt","webpack://lib-util/./kotlin-dce/src/kotlin/util/Standard.kt","webpack://lib-util/./kotlin-dce/src/kotlin/coroutines/Continuation.kt","webpack://lib-util/./kotlin-dce/src/kotlin/coroutines/intrinsics/IntrinsicsJs.kt","webpack://lib-util/./kotlin-dce/src/kotlin/exceptions.kt","webpack://lib-util/./kotlin-dce/src/kotlin/kotlin.kt","webpack://lib-util/./kotlin-dce/src/kotlin/text/numberConversions_js-v1.kt","webpack://lib-util/./kotlin-dce/js/src/generated/_ArraysJs.kt","webpack://lib-util/./kotlin-dce/js/src/generated/_ComparisonsJs.kt","webpack://lib-util/./kotlin-dce/js/src/generated/_DigitChars.kt","webpack://lib-util/./kotlin-dce/js/src/generated/_WhitespaceChars.kt","webpack://lib-util/./kotlin-dce/src/kotlin/CharCode.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/collections.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/collections/AbstractMutableCollection.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/collections/AbstractMutableList.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/collections/AbstractMutableMap.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/collections/AbstractMutableSet.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/collections/ArrayList.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/collections/ArraySorting.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/collections/EqualityComparator.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/collections/HashMap.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/collections/HashSet.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/collections/InternalHashCodeMap.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/collections/InternalStringMap.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/collections/LinkedHashMap.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/collections/LinkedHashSet.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/console.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/coroutines/SafeContinuationJs.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/exceptionUtils.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/math.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/numbers.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/random/PlatformRandom.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/reflect/KClassImpl.kt","webpack://lib-util/./kotlin-dce/src/kotlin/jsOperators.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/collections/InternalMap.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/text/string.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/reflect/KTypeImpl.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/reflect/primitives.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/reflect/reflection.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/regexp.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/text/CharacterCodingExceptionJs.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/text/StringBuilderJs.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/text/char.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/text/numberConversions.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/text/regex.kt","webpack://lib-util/./kotlin-dce/src/kotlin/text/StringBuilder.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/text/stringsCode.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/text/utf8Encoding.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/time/DurationJs.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/time/DurationUnit.kt","webpack://lib-util/./kotlin-dce/src/kotlin/collections/AbstractList.kt","webpack://lib-util/./kotlin-dce/src/kotlin/collections/AbstractCollection.kt","webpack://lib-util/./kotlin-dce/src/kotlin/collections/AbstractMap.kt","webpack://lib-util/./kotlin-dce/src/kotlin/collections/AbstractSet.kt","webpack://lib-util/./kotlin-dce/src/kotlin/collections/IndexedValue.kt","webpack://lib-util/./kotlin-dce/src/kotlin/collections/Iterators.kt","webpack://lib-util/./kotlin-dce/src/kotlin/collections/MapWithDefault.kt","webpack://lib-util/./kotlin-dce/src/kotlin/collections/MutableCollections.kt","webpack://lib-util/./kotlin-dce/src/kotlin/collections/SequenceBuilder.kt","webpack://lib-util/./kotlin-dce/src/kotlin/collections/Sets.kt","webpack://lib-util/./kotlin-dce/src/kotlin/coroutines/ContinuationInterceptor.kt","webpack://lib-util/./kotlin-dce/src/kotlin/coroutines/CoroutineContext.kt","webpack://lib-util/./kotlin-dce/src/kotlin/coroutines/CoroutineContextImpl.kt","webpack://lib-util/./kotlin-dce/src/kotlin/coroutines/intrinsics/Intrinsics.kt","webpack://lib-util/./kotlin-dce/src/kotlin/internal/progressionUtil.kt","webpack://lib-util/./kotlin-dce/src/kotlin/random/Random.kt","webpack://lib-util/./kotlin-dce/src/kotlin/random/XorWowRandom.kt","webpack://lib-util/./kotlin-dce/src/kotlin/ranges/PrimitiveRanges.kt","webpack://lib-util/./kotlin-dce/src/kotlin/ranges/ProgressionIterators.kt","webpack://lib-util/./kotlin-dce/src/kotlin/ranges/Progressions.kt","webpack://lib-util/./kotlin-dce/src/kotlin/ranges/Ranges.kt","webpack://lib-util/./kotlin-dce/src/kotlin/text/Appendable.kt","webpack://lib-util/./kotlin-dce/src/kotlin/text/Char.kt","webpack://lib-util/./kotlin-dce/src/kotlin/text/Indent.kt","webpack://lib-util/./kotlin-dce/src/kotlin/text/regex/MatchResult.kt","webpack://lib-util/./kotlin-dce/src/kotlin/ranges/Range.kt","webpack://lib-util/./kotlin-dce/src/kotlin/time/DurationUnit.kt","webpack://lib-util/./kotlin-dce/src/kotlin/util/Lazy.kt","webpack://lib-util/./kotlin-dce/src/kotlin/util/Tuples.kt","webpack://lib-util/./kotlin-dce/unsigned/src/kotlin/UByteArray.kt","webpack://lib-util/./kotlin-dce/unsigned/src/kotlin/ULong.kt","webpack://lib-util/./kotlin-dce/src/kotlin/experimental/bitwiseOperations.kt","webpack://lib-util/./kotlin-dce/unsigned/src/kotlin/UIntArray.kt","webpack://lib-util/./kotlin-dce/unsigned/src/kotlin/UIntRange.kt","webpack://lib-util/./kotlin-dce/unsigned/src/kotlin/ULongArray.kt","webpack://lib-util/./kotlin-dce/unsigned/src/kotlin/ULongRange.kt","webpack://lib-util/./kotlin-dce/unsigned/src/kotlin/UProgressionUtil.kt","webpack://lib-util/./kotlin-dce/unsigned/src/kotlin/UShortArray.kt","webpack://lib-util/./kotlin-dce/common/src/generated/_Sets.kt","webpack://lib-util/./kotlin-dce/src/kotlin/reflection_js-v1.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/coroutines/cancellation/CancellationException.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/reflect/JsClass.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/reflect/KTypeHelpers.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/throwableExtensions.kt","webpack://lib-util/./kotlin-dce/src/kotlin/comparisons/Comparisons.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/coroutines/js/internal/EmptyContinuation.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/js/js.math.kt","webpack://lib-util/../../../../../common/src/Delay.kt","webpack://lib-util/../../../../../common/src/EventLoop.common.kt","webpack://lib-util/./kotlin-dce/src/kotlin/util/HashCode.kt","webpack://lib-util/../../../../../common/src/flow/SharedFlow.kt","webpack://lib-util/../../../../../common/src/internal/LockFreeTaskQueue.kt","webpack://lib-util/../../../../../js/src/JSDispatcher.kt","webpack://lib-util/../../../../../common/src/AbstractCoroutine.kt","webpack://lib-util/../../../../../common/src/Builders.common.kt","webpack://lib-util/../../../../../common/src/CancellableContinuation.kt","webpack://lib-util/../../../../../common/src/CancellableContinuationImpl.kt","webpack://lib-util/../../../../../js/src/CoroutineContext.kt","webpack://lib-util/../../../../../atomicfu/src/commonMain/kotlin/kotlinx/atomicfu/AtomicFU.common.kt","webpack://lib-util/../../../../../common/src/CompletableDeferred.kt","webpack://lib-util/../../../../../common/src/CompletionState.kt","webpack://lib-util/../../../../../common/src/CoroutineDispatcher.kt","webpack://lib-util/../../../../../common/src/CoroutineExceptionHandler.kt","webpack://lib-util/../../../../../common/src/CoroutineName.kt","webpack://lib-util/../../../../../common/src/CoroutineScope.kt","webpack://lib-util/../../../../../common/src/CoroutineStart.kt","webpack://lib-util/../../../../../common/src/Exceptions.common.kt","webpack://lib-util/../../../../../common/src/Job.kt","webpack://lib-util/../../../../../common/src/JobSupport.kt","webpack://lib-util/../../../../../common/src/MainCoroutineDispatcher.kt","webpack://lib-util/../../../../../common/src/NonCancellable.kt","webpack://lib-util/../../../../../common/src/Supervisor.kt","webpack://lib-util/../../../../../common/src/Timeout.kt","webpack://lib-util/../../../../../common/src/Unconfined.kt","webpack://lib-util/../../../../../js/src/internal/LinkedList.kt","webpack://lib-util/../../../../../common/src/CompletionHandler.common.kt","webpack://lib-util/../../../../../js/src/internal/StackTraceRecovery.kt","webpack://lib-util/../../../../../common/src/channels/AbstractChannel.kt","webpack://lib-util/../../../../../common/src/channels/ArrayChannel.kt","webpack://lib-util/../../../../../common/src/channels/Broadcast.kt","webpack://lib-util/../../../../../common/src/channels/BufferOverflow.kt","webpack://lib-util/../../../../../common/src/channels/Channel.kt","webpack://lib-util/../../../../../common/src/internal/InlineList.kt","webpack://lib-util/../../../../../common/src/channels/ChannelCoroutine.kt","webpack://lib-util/../../../../../common/src/channels/ConflatedBroadcastChannel.kt","webpack://lib-util/../../../../../common/src/channels/ConflatedChannel.kt","webpack://lib-util/../../../../../common/src/channels/LinkedListChannel.kt","webpack://lib-util/../../../../../common/src/channels/RendezvousChannel.kt","webpack://lib-util/../../../../../common/src/flow/terminal/Collection.kt","webpack://lib-util/../../../../../common/src/flow/terminal/Count.kt","webpack://lib-util/../../../../../common/src/internal/ArrayQueue.kt","webpack://lib-util/../../../../../common/src/internal/Atomic.kt","webpack://lib-util/../../../../../common/src/internal/DispatchedContinuation.kt","webpack://lib-util/../../../../../js/src/internal/ThreadContext.kt","webpack://lib-util/../../../../../common/src/internal/DispatchedTask.kt","webpack://lib-util/../../../../../common/src/internal/LimitedDispatcher.kt","webpack://lib-util/../../../../../common/src/channels/Channels.common.kt","webpack://lib-util/../../../../../common/src/flow/FlowCollector.kt","webpack://lib-util/../../../../../common/src/flow/operators/Limit.kt","webpack://lib-util/../../../../../common/src/flow/operators/Lint.kt","webpack://lib-util/../../../../../common/src/flow/terminal/Collect.kt","webpack://lib-util/../../../../../common/src/flow/internal/FlowExceptions.common.kt","webpack://lib-util/../../../../../common/src/flow/terminal/Reduce.kt","webpack://lib-util/../../../../../common/src/internal/OnUndeliveredElement.kt","webpack://lib-util/../../../../../common/src/internal/Scopes.kt","webpack://lib-util/../../../../../common/src/internal/Symbol.kt","webpack://lib-util/../../../../../common/src/internal/SystemProps.common.kt","webpack://lib-util/../../../../../common/src/intrinsics/Cancellable.kt","webpack://lib-util/../../../../../common/src/intrinsics/Undispatched.kt","webpack://lib-util/../../../../../js/src/Runnable.kt","webpack://lib-util/../../../../../common/src/selects/Select.kt","webpack://lib-util/../../../../../common/src/selects/SelectUnbiased.kt","webpack://lib-util/../../../../../common/src/sync/Mutex.kt","webpack://lib-util/../../../../../js/src/CompletionHandler.kt","webpack://lib-util/../../../../../js/src/CoroutineExceptionHandlerImpl.kt","webpack://lib-util/../../../../../js/src/Debug.kt","webpack://lib-util/../../../../../js/src/Dispatchers.kt","webpack://lib-util/../../../../../common/src/selects/WhileSelect.kt","webpack://lib-util/../../../../../common/src/sync/Semaphore.kt","webpack://lib-util/../../../../../js/src/EventLoop.kt","webpack://lib-util/../../../../../js/src/Exceptions.kt","webpack://lib-util/../../../../../js/src/SchedulerTask.kt","webpack://lib-util/../../../../../js/src/Window.kt","webpack://lib-util/../../../../../js/src/flow/internal/FlowExceptions.kt","webpack://lib-util/../../../../../js/src/internal/Concurrent.kt","webpack://lib-util/../../../../../js/src/internal/SystemProps.kt","webpack://lib-util/../../../../../js/src/internal/ThreadLocal.kt","webpack://lib-util/../../../../../common/src/flow/StateFlow.kt","webpack://lib-util/../../../../../common/src/flow/internal/AbstractSharedFlow.kt","webpack://lib-util/../../../../../common/src/flow/internal/NullSurrogate.kt","webpack://lib-util/../../../../../common/src/flow/operators/Merge.kt","webpack://lib-util/../../../../../common/src/internal/ConcurrentLinkedList.kt","webpack://lib-util/../../../../../common/src/internal/LockFreeLinkedList.common.kt","webpack://lib-util/../../../../../atomicfu/src/commonMain/kotlin/kotlinx/atomicfu/Trace.common.kt","webpack://lib-util/../../../../../atomicfu/src/commonMain/kotlin/kotlinx/atomicfu/TraceFormat.kt","webpack://lib-util/../../../../../atomicfu/src/jsMain/kotlin/kotlinx/atomicfu/AtomicFU.kt","webpack://lib-util/../../../../../atomicfu/src/jsMain/kotlin/kotlinx/atomicfu/locks/Synchronized.kt","webpack://lib-util/../../../../../atomicfu/src/jsMain/kotlin/kotlinx/atomicfu/Trace.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/ByteChannelSequential.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/ByteReadChannel.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/charsets/Encoding.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/js/src/io/ktor/utils/io/bits/MemoryPrimitivesJs.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/core/Input.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/core/InputArrays.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/core/Buffers.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/ByteWriteChannel.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/CloseElement.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/Coroutines.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/ExceptionUtils.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/ReadSession.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/WriterSession.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/core/Output.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/core/BufferPrimitives.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/core/Buffer.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/core/Builder.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/js/src/io/ktor/utils/io/bits/MemoryJs.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/core/Packet.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/ChannelLittleEndian.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/core/BufferAppend.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/core/BufferFactory.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/bits/PrimiteArrays.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/js/src/io/ktor/utils/io/bits/MemoryFactoryJs.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/core/BytePacketBuilder.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/core/ByteReadPacket.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/core/internal/UTF8.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/core/InputPrimitives.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/core/OutputPrimitives.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/core/Strings.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/core/internal/CharArraySequence.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/core/internal/ChunkBuffer.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/core/internal/Numbers.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/core/PacketDirect.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/core/internal/EncodeResult.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/core/internal/Unsafe.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/internal/AwaitingSlot.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/internal/SequentialCopyTo.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/pool/ByteArrayPool.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/pool/Pool.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/js/src/io/ktor/utils/io/ByteChannelJS.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/ByteChannelCtor.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/js/src/io/ktor/utils/io/ByteReadChannelJs.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/bits/ByteOrder.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/js/src/io/ktor/utils/io/charsets/CharsetJS.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/js/src/io/ktor/utils/io/js/TextDecoders.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/js/src/io/ktor/utils/io/core/BufferUtilsJs.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/js/src/io/ktor/utils/io/js/Decoder.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/js/src/io/ktor/utils/io/charsets/DecodeBuffer.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/js/src/io/ktor/utils/io/charsets/ISO88591.kt","webpack://lib-util/./kotlin-dce/js/src/org.w3c/org.khronos.webgl.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/js/src/io/ktor/utils/io/core/ByteOrderJS.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/js/src/io/ktor/utils/io/core/InputArraysJS.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/js/src/io/ktor/utils/io/core/StringsJS.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/js/src/io/ktor/utils/io/errors/IOException.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/js/src/io/ktor/utils/io/js/TextDecoder.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/js/src/io/ktor/utils/io/js/TextDecoderFallback.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/js/src/io/ktor/utils/io/pool/DefaultPool.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/js/src/io/ktor/utils/io/bits/ByteOrderJs.kt","webpack://lib-util/./kotlin-dce/src/kotlin/numbers_js-v1.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/js/src/io/ktor/utils/io/core/CloseableJS.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/js/src/io/ktor/utils/io/bits/PrimitiveArraysJs.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/js/src/io/ktor/utils/io/core/PacketJS.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/js/src/io/ktor/utils/io/js/Win1252Table.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/common/src/io/ktor/util/ByteChannels.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/core/Closeable.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/common/src/io/ktor/util/HashFunction.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/common/src/io/ktor/util/Attributes.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/common/src/io/ktor/util/Base64.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/common/src/io/ktor/util/CaseInsensitiveMap.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/common/src/io/ktor/util/Charset.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/common/src/io/ktor/util/Collections.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/common/src/io/ktor/util/Crypto.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/common/src/io/ktor/util/DelegatingMutableSet.kt","webpack://lib-util/./kotlin-dce/common/src/generated/_Maps.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/common/src/io/ktor/util/StringValues.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/common/src/io/ktor/util/Text.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/common/src/io/ktor/util/cio/Channels.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/common/src/io/ktor/util/date/Date.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/common/src/io/ktor/util/date/GMTDateParser.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/common/src/io/ktor/util/debug/ContextUtils.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/common/src/io/ktor/util/debug/plugins/PluginsTrace.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/common/src/io/ktor/util/internal/LockFreeLinkedList.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/common/src/io/ktor/util/pipeline/PipelinePhase.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/common/src/io/ktor/util/pipeline/Pipeline.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/common/src/io/ktor/util/reflect/Type.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/js/src/io/ktor/util/AttributesJs.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/js/src/io/ktor/util/CollectionsJs.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/js/src/io/ktor/util/CryptoJs.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/js/src/io/ktor/util/PlatformUtilsJs.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/js/src/io/ktor/util/date/DateJs.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/js/src/io/ktor/util/debug/IntellijIdeaDebugDetectorJs.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/js/src/io/ktor/util/internal/ExceptionUtilsJs.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/js/src/io/ktor/util/reflect/TypeInfoJs.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-utils/common/src/io/ktor/util/collections/ConcurrentMap.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/build/js/node_modules/process/browser.js","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/Cookie.kt","webpack://lib-util/./kotlin-dce/src/kotlin/text/regex/RegexExtensions.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/ApplicationResponseProperties.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/Codecs.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/ContentDisposition.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/HeaderValueWithParameters.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/ContentTypes.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/DateUtils.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/FileContentType.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/Headers.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/HttpHeaderValueParser.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/HttpHeaders.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/HttpMethod.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/HttpStatusCode.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/HttpUrlEncoded.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/Mimes.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/Parameters.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/Query.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/URLBuilder.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/URLParser.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/URLProtocol.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/URLUtils.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/Url.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/UrlDecodedParametersBuilder.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/content/ByteArrayContent.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/content/CachingOptions.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/content/ChannelWriterContent.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/content/Multipart.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/content/OutgoingContent.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/content/TextContent.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/content/Versions.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/parsing/Parser.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/parsing/ParserDsl.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/parsing/Primitives.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/parsing/regex/RegexParser.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/parsing/regex/RegexParserGenerator.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/js/src/io/ktor/http/URLBuilderJs.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/websocket/Utils.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/IpParser.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-http/common/src/io/ktor/http/auth/HttpAuthHeader.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/internal/ElementMarker.kt","webpack://lib-util/./kotlin-dce/common/src/generated/_UArrays.kt","webpack://lib-util/./kotlin-dce/js/src/kotlin/reflect/AssociatedObjects.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/PolymorphicSerializer.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/SerializationExceptions.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/Serializers.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/internal/Platform.common.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/SerializersCache.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/builtins/BuiltinSerializers.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/descriptors/ContextAware.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/descriptors/SerialDescriptor.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/descriptors/SerialDescriptors.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/descriptors/SerialKinds.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/internal/PluginGeneratedSerialDescriptor.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/internal/AbstractPolymorphicSerializer.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/internal/BuiltInSerializers.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/encoding/Encoding.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/encoding/Decoding.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/internal/CollectionDescriptors.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/internal/CollectionSerializers.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/internal/InlineClassDescriptor.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/internal/NullableSerializer.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/internal/ObjectSerializer.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/internal/PrimitiveArraysSerializers.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/internal/PluginHelperInterfaces.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/internal/Primitives.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/internal/Tuples.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/internal/ValueClasses.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/modules/SerializersModule.kt","webpack://lib-util/../../../../../core/commonMain/src/kotlinx/serialization/modules/SerializersModuleBuilders.kt","webpack://lib-util/../../../../../core/jsMain/src/kotlinx/serialization/Serializers.kt","webpack://lib-util/../../../../../core/jsMain/src/kotlinx/serialization/internal/Platform.kt","webpack://lib-util/../../../../../common/src/flow/operators/Emitters.kt","webpack://lib-util/../../../../../common/src/flow/internal/SafeCollector.common.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-shared/ktor-serialization/common/src/ContentConvertException.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-shared/ktor-serialization/common/src/ContentConverter.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-shared/ktor-serialization/common/src/WebsocketContentConverter.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/lib-util/src/commonMain/kotlin/com/ustadmobile/core/db/LiveDataUtil.kt","webpack://lib-util/./kotlin/src/kotlin/text/Strings.kt","webpack://lib-util/./kotlin/js/src/kotlin/text/numberConversions.kt","webpack://lib-util/./kotlin/common/src/generated/_Collections.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/lib-util/src/commonMain/kotlin/com/ustadmobile/lib/util/RangeUtil.kt","webpack://lib-util/./kotlin/src/kotlin/collections/Collections.kt","webpack://lib-util/./kotlin/src/kotlin/util/Standard.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/lib-util/src/commonMain/kotlin/com/ustadmobile/lib/util/UmAccountUtil.kt","webpack://lib-util/../../../../../door-runtime/src/commonJvmJs/kotlin/com/ustadmobile/door/EntityInsertionAdapter.kt","webpack://lib-util/../../../../../door-runtime/src/commonMain/kotlin/com/ustadmobile/door/DoorPrimaryKeyManager.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/request/builders.kt","webpack://lib-util/../../../../../door-runtime/src/commonJvmJs/kotlin/com/ustadmobile/door/room/RoomDatabaseJdbcImplHelperCommon.kt","webpack://lib-util/../../../../../door-runtime/src/commonMain/kotlin/com/ustadmobile/door/DoorConstants.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/request/RequestBody.kt","webpack://lib-util/../../../../../door-runtime/src/commonMain/kotlin/com/ustadmobile/door/replication/ReplicationNotificationDispatcher.kt","webpack://lib-util/../../../../../door-runtime/src/commonMain/kotlin/com/ustadmobile/door/replication/ReplicationSubscriptionManager.kt","webpack://lib-util/../../../../../door-runtime/src/commonMain/kotlin/com/ustadmobile/door/DoorDatabaseRepository.kt","webpack://lib-util/../../../../../door-runtime/src/commonMain/kotlin/com/ustadmobile/door/ext/MutexExt.kt","webpack://lib-util/../../../../../door-runtime/src/jsMain/kotlin/com/ustadmobile/door/ext/DoorDatabaseExt.kt","webpack://lib-util/../../../../../door-runtime/src/commonMain/kotlin/com/ustadmobile/door/ext/HttpClientExt.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/call/HttpClientCall.kt","webpack://lib-util/../../../../../door-runtime/src/commonMain/kotlin/com/ustadmobile/door/jdbc/ext/StatementCommonExt.kt","webpack://lib-util/../../../../../door-runtime/src/commonMain/kotlin/com/ustadmobile/door/replication/DoorDatabaseRepositoryReplicationExt.kt","webpack://lib-util/../../../../../door-runtime/src/commonMain/kotlin/com/ustadmobile/door/ext/HttpRequestBuilderExt.kt","webpack://lib-util/../../../../../door-runtime/src/commonMain/kotlin/com/ustadmobile/door/ext/StringExt.kt","webpack://lib-util/../../../../../formats/json/commonMain/src/kotlinx/serialization/json/internal/lexer/AbstractJsonLexer.kt","webpack://lib-util/../../../../../formats/json/jsMain/src/kotlinx/serialization/json/internal/DynamicDecoders.kt","webpack://lib-util/../../../../../formats/json/commonMain/src/kotlinx/serialization/json/JsonElementSerializers.kt","webpack://lib-util/../../../../../formats/json/commonMain/src/kotlinx/serialization/json/internal/SchemaCache.kt","webpack://lib-util/../../../../../formats/json/commonMain/src/kotlinx/serialization/json/internal/StringOps.kt","webpack://lib-util/../../../../../formats/json/commonMain/src/kotlinx/serialization/json/internal/JsonNamesMap.kt","webpack://lib-util/../../../../../formats/json/commonMain/src/kotlinx/serialization/json/internal/StreamingJsonEncoder.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/plugins/DefaultTransform.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/plugins/HttpRequestRetry.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-shared/ktor-websocket-serialization/common/src/io/ktor/websocket/serialization/WebsocketChannelSerialization.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/plugins/websocket/WebSockets.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/call/Compatibility.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/call/SavedCall.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/engine/Utils.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/plugins/HttpClientPlugin.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/plugins/HttpTimeout.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/plugins/websocket/ClientSessions.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/plugins/websocket/WebSocketContent.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/request/ClientUpgradeContent.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/request/HttpRequest.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/request/HttpRequestPipeline.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/request/forms/FormDataContent.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/request/utils.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/statement/HttpResponse.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/statement/HttpResponsePipeline.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/request/buildersWithUrl.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/request/forms/formBuilders.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/statement/Compatibility.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/statement/HttpStatement.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/utils/Content.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/js/src/io/ktor/client/plugins/websocket/JsWebSocketSession.kt","webpack://lib-util/./kotlin-dce/js/src/org.w3c/org.w3c.dom.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/js/src/io/ktor/client/utils/ExceptionUtilsJs.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/plugins/HttpCallValidator.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/engine/HttpClientEngine.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/engine/HttpClientEngineCapability.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/plugins/BodyProgress.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/plugins/DefaultResponseValidation.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/plugins/HttpRedirect.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-client/ktor-client-core/common/src/io/ktor/client/utils/ClientEvents.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-shared/ktor-events/common/src/io/ktor/events/Events.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-shared/ktor-websockets/common/src/io/ktor/websocket/DefaultWebSocketSession.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-shared/ktor-websockets/common/src/io/ktor/websocket/RawWebSocketCommon.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-io/common/src/io/ktor/utils/io/bits/MemoryFactory.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-shared/ktor-websockets/common/src/io/ktor/websocket/CloseReason.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-shared/ktor-websockets/common/src/io/ktor/websocket/FrameCommon.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-shared/ktor-websockets/common/src/io/ktor/websocket/FrameTooBigException.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-shared/ktor-websockets/common/src/io/ktor/websocket/FrameType.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-shared/ktor-websockets/common/src/io/ktor/websocket/PingPong.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-shared/ktor-websockets/common/src/io/ktor/websocket/WebSocketExtension.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-shared/ktor-websockets/common/src/io/ktor/websocket/WebSocketExtensionHeader.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-shared/ktor-websockets/common/src/io/ktor/websocket/WebSocketSession.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/ktor-shared/ktor-websockets/js/src/io/ktor/websocket/FrameJs.kt","webpack://lib-util//home/jenkins/.jenkins/workspace/app-branded-nayestane/build/js/node_modules/spark-md5/spark-md5.js"],"names":["root","factory","exports","module","define","amd","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","Kotlin","buf","bufFloat64","bufFloat32","bufInt32","lowIndex","highIndex","_","getObjectHashCode","obj","hash","Math","random","throwMarkerError","Error","imul","a","b","isBooleanArray","Array","isArray","Int8Array","$type$","isByteArray","isShortArray","Int16Array","isCharArray","Uint16Array","isIntArray","Int32Array","isFloatArray","Float32Array","isDoubleArray","Float64Array","isLongArray","isArrayish","ArrayBuffer","isView","arrayToString","toString","String","fromCharCode","map","e","join","arrayEquals","length","equals","arrayHashCode","arr","result","hashCode","toShort","toByte","toChar","numberToInt","Long","toInt","doubleToInt","toBoxedChar","BoxedChar","unboxChar","obj1","obj2","objType","numberHashCode","Number","str","code","charCodeAt","getStringHashCode","identityHashCode","low_","low","high_","high","$metadata$","kind","simpleName","interfaces","IntCache_","fromInt","cachedObj","fromNumber","isNaN","ZERO","TWO_PWR_63_DBL_","MIN_VALUE","MAX_VALUE","negate","TWO_PWR_32_DBL_","fromBits","lowBits","highBits","fromString","radix","opt_radix","charAt","substring","indexOf","radixToPower","pow","size","min","parseInt","power","multiply","add","TWO_PWR_16_DBL_","TWO_PWR_24_DBL_","TWO_PWR_31_DBL_","TWO_PWR_48_DBL_","TWO_PWR_64_DBL_","ONE","NEG_ONE","TWO_PWR_24_","toNumber","getLowBitsUnsigned","isZero","isNegative","equalsLong","radixLong","div","rem","subtract","remDiv","digits","getHighBits","getLowBits","getNumBitsAbs","val","bit","isOdd","other","notEqualsLong","lessThan","compare","lessThanOrEqual","greaterThan","greaterThanOrEqual","thisNeg","otherNeg","not","a48","a32","a16","a00","b48","b32","b16","c48","c32","c16","c00","b00","approx","shiftRight","shiftLeft","res","max","floor","log2","ceil","log","LN2","delta","approxRes","approxRem","modulo","and","or","xor","numBits","shiftRightUnsigned","compareTo_11rb$","inc","dec","valueOf","unaryPlus","unaryMinus","inv","rangeTo","kotlin","ranges","LongRange","defineInlineFunction","fun","wrapFunction","f","apply","arguments","suspendCall","coroutineResult","coroutineReceiver","setCoroutineResult","getReifiedTypeParameterKType","compareTo","typeA","doubleCompareTo","primitiveCompareTo","ia","imulEmulated","doubleToRawBits","doubleFromBits","floatToRawBits","floatFromBits","ensureNotNull","x","throwNPE","startsWith","searchString","position","lastIndexOf","endsWith","subjectString","undefined","lastIndex","sign","trunc","NaN","taylor_2_bound","sqrt","taylor_n_bound","upper_taylor_2_bound","upper_taylor_n_bound","sinh","abs","y","exp","y1","isFinite","cosh","tanh","Infinity","asinh","acosh","atanh","log1p","x2","x3","expm1","hypot","log10","LOG10E","LOG2E","clz32","asUint","__proto__","fill","TypeError","O","len","start","relativeStart","k","end","relativeEnd","finalValue","normalizeOffset","offset","typedArraySlice","begin","constructor","subarray","arrays","TypedArray","slice","Function","self","array","callback","totalOrderComparator","sort","compareFunction","Kind","CLASS","INTERFACE","OBJECT","callGetter","thisObject","klass","propertyName","propertyDescriptor","getOwnPropertyDescriptor","getPrototypeOf","isType","proto","klassMetadata","isInheritanceFromInterface","ctor","iface","metadata","superPrototype","superConstructor","isNumber","isChar","isComparable","type","Comparable","isCharSequence","CharSequence","ordinal","initValue","MIN_HIGH_SURROGATE","MAX_LOW_SURROGATE","fillArrayVal","init","iterator","hasNext","IntRange","range","v","completion","intercepted","cause","src","index","bottom","destination","_stableSortingIsSupported","buffer","comparator","leftIndex","left","element","chainOrEntry","state","current","PrimitiveKClassImpl","kClass","jClass","char","RegExp","destinationOffset","startIndex","endIndex","pattern","replace","replacement","sb","lastStart","limit","groupIndex","newGroupIndex","ignoreCase","bytes","byteIndex","REPLACEMENT_BYTE_SEQUENCE","codePoint","stringBuilder","decimals","entry","itemIterator","cur","next","from","fromIndex","toIndex","uppercaseChar","newIndent","marginPrefix","firstNonWhitespaceIndex","padChar","chars","last","indices","strings","durationOfMillis","unit","nanos","millis","millisToNanos","intScale","message","UByte","UInt","step","ULong","uintRemainder","ulongRemainder","UShort","data","dividend","prefix","delimiter","exceptionOrNull","exception","Result","createFailure","times","arrayCopy","pool","Pool","atomic","Empty","BytePacketBuilder","initial","AwaitingSlot","remainingAll","count","availableForWrite","closed","availableForRead","isClosedForRead","delegate","tail","prepareWriteHead","dst","encodeArrayImpl","rc","afterHeadWrite","encodeCompleteImpl","sizeEstimate","input","MalformedInputException","encodeImpl","CharArraySequence","EmptyByteArray","borrow","single","writePosition","readPosition","builder","duplicate","encodeToImpl","build","release","remaining","bytesWritten","view","before","memory","byteLength","JsMath","writable","isEmpty","resume","unsafeAppend","readable","closedCause","ClosedWriteChannelException","bytesCount","beginWriteSession","session","flush","written","endOfInput","readByte","closeable","close","EOFException","newLimit","partLimit","partSize","prepareFlushedBytes","canRead","readBoolean","completeReadHead","atLeast","EXPECTED_CAPACITY","discarded","consumer","decodeUTF8LineLoopSuspend","out","it","CLOSED_SUCCESS","CloseElement","closeElement","autoFlush","coerceAtMost","desiredSize","readShort","byteOrder","ByteOrder","reverseByteOrder","readInt","readLong","readFloat","readDouble","coroutineContext","Job","ChannelScope","scope","Dispatchers","Unconfined","requestBuffer","Buffer","block","completeReadingFromBuffer","bytesRead","startReadSession","requestBufferSuspend","requestBufferFallback","endReadSession","copied","desiredSpace","requestWriteBuffer","completeWriting","writeBufferSuspend","resetForWrite","capacity","newReadPosition","discardFailed","newWritePosition","commitWrittenFailed","startGap","rewindFailed","startGapReservationFailedDueToLimit","startGapReservationFailed","endGap","endGapReservationFailedDueToCapacity","endGapReservationFailedDueToStartGap","endGapReservationFailedDueToContent","copy","getInt8","InsufficientSpaceException","setInt8","readRemaining","writeRemaining","rewindRemaining","availableSpace","maxSize","writeSize","writeBufferAppendUnreserve","DefaultPool","getInt16","getInt32","getUint32","getFloat32","getFloat64","setInt16","setInt32","source","of","Memory","dstOffset","cleanNext","prev","head","findTail","Output","Input","markNoMoreChunksAvailable","ByteReadPacket","EmptyPool","ChunkBuffer","instance","referenceCount","origin","reset","_size","copyAll","headEndExclusive","headPosition","tailRemaining","newHead","headMemory","newValue","headRemaining","skip","maxCopySize","chunkSize","available","empty","releaseAll","closeSource","chain","writeBufferAppend","nextIndex","prematureEndOfStream","byte","tryPeekByte","getCharsInternal","exactCharacters","coerceAtLeast","utf8","prepareReadFirstHead","endExclusive","codepoint","prepareReadNextHead","MalformedUTF8InputException","byteCount","lastByteCount","malformedByteCount","mask","isBmpCodePoint","isValidCodePoint","highSurrogate","lowSurrogate","malformedCodePoint","after","skipped","currentCount","currentSkipped","minSize","overrunSize","restoreStartGap","overrun","chunk1","chunk2","chunk","headSize","readShortFallback","readIntFallback","readLongFallback","readFloatFallback","readDoubleFallback","currentOffset","writeShortFallback","writeIntFallback","writeLongFallback","setFloat32","toRawBits","setFloat64","charset","UTF_8","decodeExactBytes","newDecoder","text","writeTextUtf8","newEncoder","dstLimit","characters","NoPoolImpl","oldTail","failLongToIntConversion","chainedSizeDelta","_tail","tailPosition","newTail","closeDestination","writeText","packet","foreignStolen","chunkBuffer","PACKET_MAX_COPY_SIZE","nextSize","lastSize","isExclusivelyOwned","appendSize","prependSize","writeBufferPrepend","_head","pre","positionAfter","positionBefore","csq","IndexOutOfBoundsException","newOrigin","DefaultChunkedBufferPool","dispose","to","resultPosition","resultLimit","lastCharIndex","character","index1","resultPosition1","stage1Limit","isHighSurrogate","isLowSurrogate","freeSpace","encodeUTF8Stage2","encodeUTF8Stage1","cp","builderSize","builderHead","ByteChannelJS","content","copyToSequentialImpl","ByteChannelSequentialBase","lazy","ch","TooLongLineException","totalBytes","prematureEndOfStreamUtf","continuation","complete","job","copyToTail","unwrapCancellationException","typedArray","DataView","byteOffset","set","toLowerCase","ISO_8859_1","CharsetEncoder","encodeToByteArrayImpl1","encodeISO88591","TextEncoder","dstRemaining","numChars","dropLastChar","encoder","encode","subSequence","endIndexExclusive","array1","CharsetDecoder","Decoder","charactersCopied","bufferSize","decodeOptions","decodedText","decode","decodeBufferImpl","charactersDecoded","bytesConsumed","inputLength","subView","inputRemaining","decodeExactBytesSlow","CharsetImpl","Charset","maxCharacters","DecodeBufferResult","nativeDecoder","sizeInBytes","decodeBufferImplSlow","writeIndex","failedToMapError","i8","readSize","CharsetEncoderImpl","CharsetDecoderImpl","dstIndex","srcIndex","Exception","fatal","toKtor","TextDecoder","encoding","textDecoderOptions","TextDecoderFallback","Any","trim","ENCODING_ALIASES","requestedEncoding","options","isASCII","WIN1252_TABLE","point","REPLACEMENT","decodeToString","produceInstance","idx","bits","EmptyCoroutineContext","CoroutineDispatcher","launch","context","ChannelJob","channel","launchChannel","srcOffset","checkIndices","bufferOffset","resetForRead","DefaultBufferPool","nativeOrder","setOf","allKeys","writeOffset","first","second","third","charArray","BASE64_ALPHABET","concatToString","padSize","BASE64_PAD","caseInsensitive","Entry","CaseInsensitiveMap","resultIndex","readBytes","CaseInsensitiveString","clear","entries","DelegatingMutableSet","keys","values","collectionSizeOrDefault","item","elements","delegateIterator","remove","digest","bitCount","pos","unprocessedLimit","unprocessed","consumeByteCount","nextPos","currentPosition","words","w","a2","messageLengthBits","StringValuesImpl","caseInsensitiveName","emptyMap","caseInsensitiveMap","list","newMap","addAll","seed","toLowerCasePreservingASCII","firstIndex","original","IOException","body","unmodifiable","entriesEquals","entriesHashCode","stringValues","emptySet","timestamp","seconds","minutes","hours","dayOfMonth","month","year","GMTDateBuilder","chunkStart","dateString","chunkEnd","InvalidDateStringException","at","isDebuggerConnected","PluginsTrace","withContext","debugContext","AbstractCoroutineContextElement","joinToString","eventOrder","symbol","Unit","initContextInDebugMode","concurrent","AttributesJs","IS_NODE","randomFillSync","getRandomValues","hex","Sha1","Date","date","getTime","InvalidTimestampException","getUTCDay","getUTCMonth","GMTDate","getUTCSeconds","getUTCMinutes","getUTCHours","dayOfWeek","getUTCDate","getUTCFullYear","UTC","TypeInfo","reifiedType","kType","toCharArray","cachedSetTimeout","cachedClearTimeout","process","defaultSetTimout","defaultClearTimeout","runTimeout","setTimeout","clearTimeout","currentQueue","queue","draining","queueIndex","cleanUpNextTick","concat","drainQueue","timeout","run","marker","runClearTimeout","Item","noop","nextTick","args","push","title","browser","env","argv","version","versions","on","addListener","once","off","removeListener","removeAllListeners","emit","prependListener","prependOnceListener","listeners","binding","cwd","chdir","dir","umask","ETag","entityTag","encodeFull","spaceToPlus","Charsets","forEach","URL_ALPHABET","URL_PROTOCOL_PART","encodeSlash","URL_ALPHABET_CHARS","VALID_PATH_PART","HEX_ALPHABET","isSurrogate","symbolSize","OAUTH_SYMBOLS","encodedCount","resultSize","allowedSet","hexDigitToChar","encodeURLParameter","plusIsSpace","decodeScan","decodeImpl","prefixEnd","URLDecodeException","charToHexDigit","digit1","digit2","c2","digit","parameters","emptyList","HeaderValueWithParameters","disposition","ContentDisposition","Name","encodeValue","FileNameAsterisk","ATTRIBUTE_CHARACTERS","percentEncode","encodeContentDispositionAttribute","encodedValue","newParameters","parseHeaderValue","headerValue","params","existingContent","ContentType","contentType","contentSubtype","patternName","patternValue","isBlank","parts","slash","BadContentTypeFormatException","contains","subtype","HTTP_DATE_FORMATS","GMTDateParser","format","padZero","padStart","answer","mapCapacity","IllegalArgumentException","parameter","sum","needQuotes","quote","slashesCount","slashIndex","isQuoted","HeaderFieldValueSeparators","quoteTo","StringValuesBuilderImpl","HeadersImpl","compareValues","selector","quality","parseHeaderValueItem","items","parametersOnly","valueOrEmpty","isInitialized","valueEnd","HeaderValue","subtrim","parseHeaderValueParameter","parseHeaderValueParameterValue","paramEnd","addParam","currentChar","nextIsSemicolonOrEnd","parseHeaderValueParameterValueQuoted","TransferEncoding","Upgrade","asList","IllegalHeaderNameException","IllegalHeaderValueException","headerName","HttpMethod","listOf","Get","Post","Put","Patch","Delete","Head","Options","method","HttpStatusCode","allStatusCodes","description","Continue","SwitchingProtocols","Processing","OK","Created","Accepted","NonAuthoritativeInformation","NoContent","ResetContent","PartialContent","MultiStatus","MultipleChoices","MovedPermanently","Found","SeeOther","NotModified","UseProxy","SwitchProxy","TemporaryRedirect","PermanentRedirect","BadRequest","Unauthorized","PaymentRequired","Forbidden","NotFound","MethodNotAllowed","NotAcceptable","ProxyAuthenticationRequired","RequestTimeout","Conflict","Gone","LengthRequired","PreconditionFailed","PayloadTooLarge","RequestURITooLong","UnsupportedMediaType","RequestedRangeNotSatisfiable","ExpectationFailed","UnprocessableEntity","Locked","FailedDependency","UpgradeRequired","TooManyRequests","RequestHeaderFieldTooLarge","InternalServerError","NotImplemented","BadGateway","ServiceUnavailable","GatewayTimeout","VersionNotSupported","VariantAlsoNegotiates","InsufficientStorage","formUrlEncodeTo","encodeURLParameterValue","joinTo","line","toLowerCasePreservingASCIIRules","removePrefix","extension","toContentType","mime","toList","mapNotNull","lineSequence","ParametersBuilder","ParametersBuilderImpl","ParametersImpl","query","nameIndex","equalIndex","appendParam","parse","spaceEqualIndex","decodeURLQueryComponent","spaceValueIndex","spaceNameIndex","spaceEndIndex","spaceIndex","isWhitespace","HTTP","user","password","pathSegments","fragment","encodeURLQueryComponent","encodeURLPathPart","encodeParameters","UrlDecodedParametersBuilder","encodedParameters","Url","encodedUser","encodedPassword","encodedFragment","encodedPathSegments","decodeURLPart","protocol","host","encodedPath","appendFile","appendMailto","trailingQuery","appendTo","port","buildString","specifiedPort","appendUserAndPassword","defaultPort","joinPath","ROOT_PATH","toMutableList","urlString","takeFromUnsafe","URLParserException","IllegalStateException","incorrectSchemePosition","firstChar","findScheme","schemeLength","scheme","slashCount","nextSlash","parseFile","parseMailto","indexOfAny","fillHost","indexOfColonInHostPort","passwordIndex","dropLast","pathEnd","rawPath","rawChunks","basePath","relativePath","parseQueryString","fragmentStart","parseQuery","parseFragment","colonIndex","isLowerCase","URLProtocol","HTTPS","WS","WSS","SOCKS","byName","takeFrom","URLBuilder","encodedQueryParameters","pathStartIndex","charArrayOf","pathEndIndex","queryStart","queryEnd","pathStart","usernameStart","usernameEnd","passwordStart","passwordEnd","names","appendAllDecoded","appendAllEncoded","headers","PartData","partHeaders","contentDisposition","FileName","decodeParameters","toSet","removeKeysWithNoEntries","readPart","part","OutgoingContent","encodeToByteArray","truncateToSeconds","lastModified","etag","Attributes","readFrom","endInclusive","copyTo","ByteReadChannel","writer","GlobalScope","take","requestHeaders","IfModifiedSince","modifiedSince","IfUnmodifiedSince","unmodifiedSince","dates","LastModified","toHttpDate","fromHttpToGmtDate","IfNoneMatch","IfMatch","STAR","givenNoneMatchEtags","givenMatchEtags","given","rawEntries","weak","rawEtag","Grammar","sourceGrammars","grammars","StringGrammar","grammar","SequenceGrammar","OrGrammar","AtLeastOne","RangeGrammar","RawGrammar","atLeastOne","shouldGroup","GrammarRegex","Regex","toRegex","groups","nested","regex","groupsCount","checkIndexOverflow","expression","operator","RegexParser","groupsCountRaw","group","regexRaw","PlatformUtils","IS_BROWSER","window","location","match","ParseResult","mapping","sortedWith","header","Comparator","formUrlEncode","url","appendAll","encodedQuery","CachingProperty","VersionListProperty","spec","nonce","WEBSOCKET_SERVER_ACCEPT_TAIL","sha1","groupByPairs","asSequence","buildRegexParser","IPv4address","IPv6address","loadMimes","AttributeKey","isFailure","copyOf","storage","newSize","findAssociatedObject","ContentConvertException","WebsocketContentConvertException","defaultCharset","parseAndSortHeader","HttpHeaders","AcceptCharset","JsType","typeInfoImpl","suitableCharsetOrNull","execute","response","request","attributes","instanceOf","allowDoubleReceive","DoubleReceiveException","CustomResponse","getResponseContent","HttpResponseContainer","responseData","client","responsePipeline","subject","NullBody","NoTransformationFoundException","status","trimMargin","flattenEntries","HttpClientCall","SavedHttpRequest","SavedHttpResponse","HttpResponse","requestTime","responseTime","PLUGIN_INSTALLED_LIST","plugin","SavedHttpCall","responseBody","callJob","HttpTimeout","requestTimeoutMillis","connectTimeoutMillis","socketTimeoutMillis","delay","isWebsocket","configuration","requestTimeout","INFINITE_TIMEOUT_MS","executionContext","requestPipeline","Before","timeoutMillis","ClientUpgradeContent","generateNonce","encodeBase64","HeadersBuilder","Connection","SecWebSocketKey","SecWebSocketVersion","WEBSOCKET_VERSION","suitableCharset","outgoing","incoming","receive","converter","frame","frameType","typeInfo","kotlinType","SecWebSocketAccept","websocketServerAccept","expectedAccept","serverAccept","WebSocketExtensionsConfig","REQUEST_EXTENSIONS_KEY","installed","protocols","SecWebSocketExtensions","parseWebSocketExtensions","clientExtensions","pingInterval","maxFrameSize","WebSockets","config","contentConverter","WebSocketContent","DefaultClientWebSocketSession","defaultSession","clientSession","DelegatingClientWebSocketSession","engine","supportedCapabilities","Render","Transform","ByteChannel","SupervisorJob","copyAndClose","BodyTypeAttributeKey","HttpRequestData","bodyType","putAll","ENGINE_CAPABILITIES_KEY","capability","Pipeline","State","Send","PipelinePhase","formData","withCharset","FormUrlEncoded","Random","nextInt","generateBoundary","FormData","boundary","RN_BYTES","headersBuilder","ContentLength","bodySize","provider","rawLength","PreparedPart","Receive","Parse","After","writeFully","addSuppressedInternal","readAvailable","startOffset","formParameters","Parameters","encodeInQuery","executeUnsafe","save","HttpRequestBuilder","pluginOrNull","CompletableDeferred","Channel","addEventListener","CoroutineName","Expires","EventDefinition","knownReason","negotiatedExtensions","masking","ponger","cancel","isClosedForSend","readReason","NORMAL_CLOSE","fin","rsv1","rsv2","rsv3","frameToSend","IncomingProcessorCoroutineName","closeExceptionally","OutgoingProcessorCoroutineName","processedFrame","pingIntervalMillis","interval","pinger","newPinger","FrameTooBigException","accumulator","extensions","CloseReason","maxElem","maxValue","opcode","found","frameSize","initCauseBridge","PongerCoroutineName","actorJob","PingerCoroutineName","equalsIndex","Frame","writeShort","disposableHandle","msg","getTimeMillis","withTimeoutOrNull","closeFrame","hasConflict","extensionFactory","reason","DefaultWebSocketSessionImpl","split","drop","WebSocketExtensionHeader","hex_chr","md5cycle","md5blk","md5blks","md5blk_array","md51","tmp","lo","hi","rhex","j","toUtf8","test","unescape","encodeURIComponent","hexToBinaryString","substr","SparkMD5","clamp","num","target","targetArray","sourceArray","Uint8Array","append","appendBinary","contents","_buff","_length","_hash","raw","ret","buff","_finish","getState","setState","destroy","hashBinary","returnUInt8Array","utf8Str2ArrayBuffer","md51_array"],"mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAQ,YAAcD,IAEtBD,EAAK,YAAcC,IARrB,CASGK,MAAM,WACT,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUP,QAGnC,IAAIC,EAASI,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHT,QAAS,IAUV,OANAU,EAAQH,GAAUI,KAAKV,EAAOD,QAASC,EAAQA,EAAOD,QAASM,GAG/DL,EAAOQ,GAAI,EAGJR,EAAOD,QA0Df,OArDAM,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASd,EAASe,EAAMC,GAC3CV,EAAoBW,EAAEjB,EAASe,IAClCG,OAAOC,eAAenB,EAASe,EAAM,CAAEK,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AAK,EACzBqb,EAAKrb,GAAK,IAAMgD,EAAEhD,KAAQA,EAAI,GAAM,GAIxC,GADAqb,EAAKrb,GAAK,IAAM,MAAUA,EAAI,GAAM,GAChCA,EAAI,GAEJ,IADAq+C,EAAS/nC,EAAO+E,GACXrb,EAAI,EAAGA,EAAI,GAAIA,GAAK,EACrBqb,EAAKrb,GAAK,EAelB,OATA0+C,GADAA,EAAU,EAAJj9C,GACI8C,SAAS,IAAIksC,MAAM,kBAC7BkO,EAAKn2C,SAASk2C,EAAI,GAAI,IACtBE,EAAKp2C,SAASk2C,EAAI,GAAI,KAAO,EAE7BrjC,EAAK,IAAMsjC,EACXtjC,EAAK,IAAMujC,EAEXP,EAAS/nC,EAAO+E,GAET/E,EA+bIsqC,CAAW,IAAIjB,WAAW16C,KAGrC,OAAOi7C,EAAMf,EAAkBgB,GAAOA,GAGnCd,EA1uBc9/C,I,mPrc8DzB,gD,8JDoBA,2CAPA,sC0E1BA,+C","file":"lib-util.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"lib-util\"] = factory();\n\telse\n\t\troot[\"lib-util\"] = factory();\n})(this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 9);\n","(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n define('kotlin', ['exports'], factory);\n }\n else if (typeof exports === 'object') {\n factory(module.exports);\n }\n else {\n root.kotlin = {};\n factory(root.kotlin);\n }\n}(this, function (Kotlin) {\n var _ = Kotlin;\n\n insertContent();\n}));\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. \n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\nKotlin.compareTo = function (a, b) {\n var typeA = typeof a;\n if (typeA === \"number\") {\n if (typeof b === \"number\") {\n return Kotlin.doubleCompareTo(a, b);\n }\n return Kotlin.primitiveCompareTo(a, b);\n }\n if (typeA === \"string\" || typeA === \"boolean\") {\n return Kotlin.primitiveCompareTo(a, b);\n }\n return a.compareTo_11rb$(b);\n};\n\nKotlin.primitiveCompareTo = function (a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n};\n\nKotlin.doubleCompareTo = function (a, b) {\n if (a < b) return -1;\n if (a > b) return 1;\n\n if (a === b) {\n if (a !== 0) return 0;\n\n var ia = 1 / a;\n return ia === 1 / b ? 0 : (ia < 0 ? -1 : 1);\n }\n\n return a !== a ? (b !== b ? 0 : 1) : -1\n};\n\nKotlin.charInc = function (value) {\n return Kotlin.toChar(value+1);\n};\n\nKotlin.charDec = function (value) {\n return Kotlin.toChar(value-1);\n};\n\nKotlin.imul = Math.imul || imul;\n\nKotlin.imulEmulated = imul;\n\nfunction imul(a, b) {\n return ((a & 0xffff0000) * (b & 0xffff) + (a & 0xffff) * (b | 0)) | 0;\n}\n\n(function() {\n var buf = new ArrayBuffer(8);\n var bufFloat64 = new Float64Array(buf);\n var bufFloat32 = new Float32Array(buf);\n var bufInt32 = new Int32Array(buf);\n var lowIndex = 0;\n var highIndex = 1;\n\n bufFloat64[0] = -1; // bff00000_00000000\n if (bufInt32[lowIndex] !== 0) {\n lowIndex = 1;\n highIndex = 0;\n }\n\n Kotlin.doubleToBits = function(value) {\n return Kotlin.doubleToRawBits(isNaN(value) ? NaN : value);\n };\n\n Kotlin.doubleToRawBits = function(value) {\n bufFloat64[0] = value;\n return Kotlin.Long.fromBits(bufInt32[lowIndex], bufInt32[highIndex]);\n };\n\n Kotlin.doubleFromBits = function(value) {\n bufInt32[lowIndex] = value.low_;\n bufInt32[highIndex] = value.high_;\n return bufFloat64[0];\n };\n\n Kotlin.floatToBits = function(value) {\n return Kotlin.floatToRawBits(isNaN(value) ? NaN : value);\n };\n\n Kotlin.floatToRawBits = function(value) {\n bufFloat32[0] = value;\n return bufInt32[0];\n };\n\n Kotlin.floatFromBits = function(value) {\n bufInt32[0] = value;\n return bufFloat32[0];\n };\n\n // returns zero value for number with positive sign bit and non-zero value for number with negative sign bit.\n Kotlin.doubleSignBit = function(value) {\n bufFloat64[0] = value;\n return bufInt32[highIndex] & 0x80000000;\n };\n\n Kotlin.numberHashCode = function(obj) {\n if ((obj | 0) === obj) {\n return obj | 0;\n }\n else {\n bufFloat64[0] = obj;\n return (bufInt32[highIndex] * 31 | 0) + bufInt32[lowIndex] | 0;\n }\n }\n})();\n\nKotlin.ensureNotNull = function(x) {\n return x != null ? x : Kotlin.throwNPE();\n};\n","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\nif (typeof String.prototype.startsWith === \"undefined\") {\n Object.defineProperty(String.prototype, \"startsWith\", {\n value: function (searchString, position) {\n position = position || 0;\n return this.lastIndexOf(searchString, position) === position;\n }\n });\n}\nif (typeof String.prototype.endsWith === \"undefined\") {\n Object.defineProperty(String.prototype, \"endsWith\", {\n value: function (searchString, position) {\n var subjectString = this.toString();\n if (position === undefined || position > subjectString.length) {\n position = subjectString.length;\n }\n position -= searchString.length;\n var lastIndex = subjectString.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n }\n });\n}\n// ES6 Math polyfills\nif (typeof Math.sign === \"undefined\") {\n Math.sign = function(x) {\n x = +x; // convert to a number\n if (x === 0 || isNaN(x)) {\n return Number(x);\n }\n return x > 0 ? 1 : -1;\n };\n}\nif (typeof Math.trunc === \"undefined\") {\n Math.trunc = function(x) {\n if (isNaN(x)) {\n return NaN;\n }\n if (x > 0) {\n return Math.floor(x);\n }\n return Math.ceil(x);\n };\n}\n\n(function() {\n var epsilon = 2.220446049250313E-16;\n var taylor_2_bound = Math.sqrt(epsilon);\n var taylor_n_bound = Math.sqrt(taylor_2_bound);\n var upper_taylor_2_bound = 1/taylor_2_bound;\n var upper_taylor_n_bound = 1/taylor_n_bound;\n\n if (typeof Math.sinh === \"undefined\") {\n Math.sinh = function(x) {\n if (Math.abs(x) < taylor_n_bound) {\n var result = x;\n if (Math.abs(x) > taylor_2_bound) {\n result += (x * x * x) / 6;\n }\n return result;\n } else {\n var y = Math.exp(x);\n var y1 = 1 / y;\n if (!isFinite(y)) return Math.exp(x - Math.LN2);\n if (!isFinite(y1)) return -Math.exp(-x - Math.LN2);\n return (y - y1) / 2;\n }\n };\n }\n if (typeof Math.cosh === \"undefined\") {\n Math.cosh = function(x) {\n var y = Math.exp(x);\n var y1 = 1 / y;\n if (!isFinite(y) || !isFinite(y1)) return Math.exp(Math.abs(x) - Math.LN2);\n return (y + y1) / 2;\n };\n }\n\n if (typeof Math.tanh === \"undefined\") {\n Math.tanh = function(x){\n if (Math.abs(x) < taylor_n_bound) {\n var result = x;\n if (Math.abs(x) > taylor_2_bound) {\n result -= (x * x * x) / 3;\n }\n return result;\n }\n else {\n var a = Math.exp(+x), b = Math.exp(-x);\n return a === Infinity ? 1 : b === Infinity ? -1 : (a - b) / (a + b);\n }\n };\n }\n\n // Inverse hyperbolic function implementations derived from boost special math functions,\n // Copyright Eric Ford & Hubert Holin 2001.\n\n if (typeof Math.asinh === \"undefined\") {\n var asinh = function(x) {\n if (x >= +taylor_n_bound)\n {\n if (x > upper_taylor_n_bound)\n {\n if (x > upper_taylor_2_bound)\n {\n // approximation by laurent series in 1/x at 0+ order from -1 to 0\n return Math.log(x) + Math.LN2;\n }\n else\n {\n // approximation by laurent series in 1/x at 0+ order from -1 to 1\n return Math.log(x * 2 + (1 / (x * 2)));\n }\n }\n else\n {\n return Math.log(x + Math.sqrt(x * x + 1));\n }\n }\n else if (x <= -taylor_n_bound)\n {\n return -asinh(-x);\n }\n else\n {\n // approximation by taylor series in x at 0 up to order 2\n var result = x;\n if (Math.abs(x) >= taylor_2_bound)\n {\n var x3 = x * x * x;\n // approximation by taylor series in x at 0 up to order 4\n result -= x3 / 6;\n }\n return result;\n }\n };\n Math.asinh = asinh;\n }\n if (typeof Math.acosh === \"undefined\") {\n Math.acosh = function(x) {\n if (x < 1)\n {\n return NaN;\n }\n else if (x - 1 >= taylor_n_bound)\n {\n if (x > upper_taylor_2_bound)\n {\n // approximation by laurent series in 1/x at 0+ order from -1 to 0\n return Math.log(x) + Math.LN2;\n }\n else\n {\n return Math.log(x + Math.sqrt(x * x - 1));\n }\n }\n else\n {\n var y = Math.sqrt(x - 1);\n // approximation by taylor series in y at 0 up to order 2\n var result = y;\n if (y >= taylor_2_bound)\n {\n var y3 = y * y * y;\n // approximation by taylor series in y at 0 up to order 4\n result -= y3 / 12;\n }\n\n return Math.sqrt(2) * result;\n }\n };\n }\n if (typeof Math.atanh === \"undefined\") {\n Math.atanh = function(x) {\n if (Math.abs(x) < taylor_n_bound) {\n var result = x;\n if (Math.abs(x) > taylor_2_bound) {\n result += (x * x * x) / 3;\n }\n return result;\n }\n return Math.log((1 + x) / (1 - x)) / 2;\n };\n }\n if (typeof Math.log1p === \"undefined\") {\n Math.log1p = function(x) {\n if (Math.abs(x) < taylor_n_bound) {\n var x2 = x * x;\n var x3 = x2 * x;\n var x4 = x3 * x;\n // approximation by taylor series in x at 0 up to order 4\n return (-x4 / 4 + x3 / 3 - x2 / 2 + x);\n }\n return Math.log(x + 1);\n };\n }\n if (typeof Math.expm1 === \"undefined\") {\n Math.expm1 = function(x) {\n if (Math.abs(x) < taylor_n_bound) {\n var x2 = x * x;\n var x3 = x2 * x;\n var x4 = x3 * x;\n // approximation by taylor series in x at 0 up to order 4\n return (x4 / 24 + x3 / 6 + x2 / 2 + x);\n }\n return Math.exp(x) - 1;\n };\n }\n})();\nif (typeof Math.hypot === \"undefined\") {\n Math.hypot = function() {\n var y = 0;\n var length = arguments.length;\n\n for (var i = 0; i < length; i++) {\n if (arguments[i] === Infinity || arguments[i] === -Infinity) {\n return Infinity;\n }\n y += arguments[i] * arguments[i];\n }\n return Math.sqrt(y);\n };\n}\nif (typeof Math.log10 === \"undefined\") {\n Math.log10 = function(x) {\n return Math.log(x) * Math.LOG10E;\n };\n}\nif (typeof Math.log2 === \"undefined\") {\n Math.log2 = function(x) {\n return Math.log(x) * Math.LOG2E;\n };\n}\nif (typeof Math.clz32 === \"undefined\") {\n Math.clz32 = (function(log, LN2) {\n return function(x) {\n var asUint = x >>> 0;\n if (asUint === 0) {\n return 32;\n }\n return 31 - (log(asUint) / LN2 | 0) | 0; // the \"| 0\" acts like math.floor\n };\n })(Math.log, Math.LN2);\n}\n\n// For HtmlUnit and PhantomJs\nif (typeof ArrayBuffer.isView === \"undefined\") {\n ArrayBuffer.isView = function(a) {\n return a != null && a.__proto__ != null && a.__proto__.__proto__ === Int8Array.prototype.__proto__;\n };\n}\n\nif (typeof Array.prototype.fill === \"undefined\") {\n // Polyfill from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill#Polyfill\n Object.defineProperty(Array.prototype, 'fill', {\n value: function (value) {\n\n // Steps 1-2.\n if (this == null) {\n throw new TypeError('this is null or not defined');\n }\n\n var O = Object(this);\n\n // Steps 3-5.\n var len = O.length >>> 0;\n\n // Steps 6-7.\n var start = arguments[1];\n var relativeStart = start >> 0;\n\n // Step 8.\n var k = relativeStart < 0 ?\n Math.max(len + relativeStart, 0) :\n Math.min(relativeStart, len);\n\n // Steps 9-10.\n var end = arguments[2];\n var relativeEnd = end === undefined ?\n len : end >> 0;\n\n // Step 11.\n var finalValue = relativeEnd < 0 ?\n Math.max(len + relativeEnd, 0) :\n Math.min(relativeEnd, len);\n\n // Step 12.\n while (k < finalValue) {\n O[k] = value;\n k++;\n }\n\n // Step 13.\n return O;\n }\n });\n}\n\n(function() {\n function normalizeOffset(offset, length) {\n if (offset < 0) return Math.max(0, offset + length);\n return Math.min(offset, length);\n }\n function typedArraySlice(begin, end) {\n if (typeof end === \"undefined\") {\n end = this.length;\n }\n begin = normalizeOffset(begin || 0, this.length);\n end = Math.max(begin, normalizeOffset(end, this.length));\n return new this.constructor(this.subarray(begin, end));\n }\n\n var arrays = [Int8Array, Int16Array, Uint16Array, Int32Array, Float32Array, Float64Array];\n for (var i = 0; i < arrays.length; ++i) {\n var TypedArray = arrays[i];\n if (typeof TypedArray.prototype.fill === \"undefined\") {\n Object.defineProperty(TypedArray.prototype, 'fill', {\n value: Array.prototype.fill\n });\n }\n if (typeof TypedArray.prototype.slice === \"undefined\") {\n Object.defineProperty(TypedArray.prototype, 'slice', {\n value: typedArraySlice\n });\n }\n }\n\n // Patch apply to work with TypedArrays if needed.\n try {\n (function() {}).apply(null, new Int32Array(0))\n } catch (e) {\n var apply = Function.prototype.apply;\n Object.defineProperty(Function.prototype, 'apply', {\n value: function(self, array) {\n return apply.call(this, self, [].slice.call(array));\n }\n });\n }\n\n\n // Patch map to work with TypedArrays if needed.\n for (var i = 0; i < arrays.length; ++i) {\n var TypedArray = arrays[i];\n if (typeof TypedArray.prototype.map === \"undefined\") {\n Object.defineProperty(TypedArray.prototype, 'map', {\n value: function(callback, self) {\n return [].slice.call(this).map(callback, self);\n }\n });\n }\n }\n\n // Patch sort to work with TypedArrays if needed.\n // TODO: consider to remove following function and replace it with `Kotlin.doubleCompareTo` (see misc.js)\n var totalOrderComparator = function (a, b) {\n if (a < b) return -1;\n if (a > b) return 1;\n\n if (a === b) {\n if (a !== 0) return 0;\n\n var ia = 1 / a;\n return ia === 1 / b ? 0 : (ia < 0 ? -1 : 1);\n }\n\n return a !== a ? (b !== b ? 0 : 1) : -1\n };\n\n for (var i = 0; i < arrays.length; ++i) {\n var TypedArray = arrays[i];\n if (typeof TypedArray.prototype.sort === \"undefined\") {\n Object.defineProperty(TypedArray.prototype, 'sort', {\n value: function(compareFunction) {\n return Array.prototype.sort.call(this, compareFunction || totalOrderComparator);\n }\n });\n }\n }\n})();\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. \n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\nKotlin.equals = function (obj1, obj2) {\n if (obj1 == null) {\n return obj2 == null;\n }\n\n if (obj2 == null) {\n return false;\n }\n\n if (obj1 !== obj1) {\n return obj2 !== obj2;\n }\n\n if (typeof obj1 === \"object\" && typeof obj1.equals === \"function\") {\n return obj1.equals(obj2);\n }\n\n if (typeof obj1 === \"number\" && typeof obj2 === \"number\") {\n return obj1 === obj2 && (obj1 !== 0 || 1 / obj1 === 1 / obj2)\n }\n\n return obj1 === obj2;\n};\n\nKotlin.hashCode = function (obj) {\n if (obj == null) {\n return 0;\n }\n var objType = typeof obj;\n if (\"object\" === objType) {\n return \"function\" === typeof obj.hashCode ? obj.hashCode() : getObjectHashCode(obj);\n }\n if (\"function\" === objType) {\n return getObjectHashCode(obj);\n }\n if (\"number\" === objType) {\n return Kotlin.numberHashCode(obj);\n }\n if (\"boolean\" === objType) {\n return Number(obj)\n }\n\n var str = String(obj);\n return getStringHashCode(str);\n};\n\n\nKotlin.toString = function (o) {\n if (o == null) {\n return \"null\";\n }\n else if (Kotlin.isArrayish(o)) {\n return \"[...]\";\n }\n else {\n return o.toString();\n }\n};\n\n/** @const */\nvar POW_2_32 = 4294967296;\n// TODO: consider switching to Symbol type once we are on ES6.\n/** @const */\nvar OBJECT_HASH_CODE_PROPERTY_NAME = \"kotlinHashCodeValue$\";\n\nfunction getObjectHashCode(obj) {\n if (!(OBJECT_HASH_CODE_PROPERTY_NAME in obj)) {\n var hash = (Math.random() * POW_2_32) | 0; // Make 32-bit singed integer.\n Object.defineProperty(obj, OBJECT_HASH_CODE_PROPERTY_NAME, { value: hash, enumerable: false });\n }\n return obj[OBJECT_HASH_CODE_PROPERTY_NAME];\n}\n\nfunction getStringHashCode(str) {\n var hash = 0;\n for (var i = 0; i < str.length; i++) {\n var code = str.charCodeAt(i);\n hash = (hash * 31 + code) | 0; // Keep it 32-bit.\n }\n return hash;\n}\n\nKotlin.identityHashCode = getObjectHashCode;\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. \n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n/**\n * @param {string} id\n * @param {Object} declaration\n */\nKotlin.defineModule = function (id, declaration) {\n};\n\nKotlin.defineInlineFunction = function(tag, fun) {\n return fun;\n};\n\nKotlin.wrapFunction = function(fun) {\n var f = function() {\n f = fun();\n return f.apply(this, arguments);\n };\n return function() {\n return f.apply(this, arguments);\n };\n};\n\nKotlin.isTypeOf = function(type) {\n return function (object) {\n return typeof object === type;\n }\n};\n\nKotlin.isInstanceOf = function (klass) {\n return function (object) {\n return Kotlin.isType(object, klass);\n }\n};\n\nKotlin.orNull = function (fn) {\n return function (object) {\n return object == null || fn(object);\n }\n};\n\nKotlin.andPredicate = function (a, b) {\n return function (object) {\n return a(object) && b(object);\n }\n};\n\nKotlin.kotlinModuleMetadata = function (abiVersion, moduleName, data) {\n};\n\nKotlin.suspendCall = function(value) {\n return value;\n};\n\nKotlin.coroutineResult = function(qualifier) {\n throwMarkerError();\n};\n\nKotlin.coroutineController = function(qualifier) {\n throwMarkerError();\n};\n\nKotlin.coroutineReceiver = function(qualifier) {\n throwMarkerError();\n};\n\nKotlin.setCoroutineResult = function(value, qualifier) {\n throwMarkerError();\n};\n\nKotlin.getReifiedTypeParameterKType = function(typeParameter) {\n throwMarkerError();\n};\n\nfunction throwMarkerError() {\n throw new Error(\n \"This marker function should never been called. \" +\n \"Looks like compiler did not eliminate it properly. \" +\n \"Please, report an issue if you caught this exception.\");\n}\n\nKotlin.getFunctionById = function(id, defaultValue) {\n return function() {\n return defaultValue;\n }\n};","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. \n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\nKotlin.isBooleanArray = function (a) {\n return (Array.isArray(a) || a instanceof Int8Array) && a.$type$ === \"BooleanArray\"\n};\n\nKotlin.isByteArray = function (a) {\n return a instanceof Int8Array && a.$type$ !== \"BooleanArray\"\n};\n\nKotlin.isShortArray = function (a) {\n return a instanceof Int16Array\n};\n\nKotlin.isCharArray = function (a) {\n return a instanceof Uint16Array && a.$type$ === \"CharArray\"\n};\n\nKotlin.isIntArray = function (a) {\n return a instanceof Int32Array\n};\n\nKotlin.isFloatArray = function (a) {\n return a instanceof Float32Array\n};\n\nKotlin.isDoubleArray = function (a) {\n return a instanceof Float64Array\n};\n\nKotlin.isLongArray = function (a) {\n return Array.isArray(a) && a.$type$ === \"LongArray\"\n};\n\nKotlin.isArray = function (a) {\n return Array.isArray(a) && !a.$type$;\n};\n\nKotlin.isArrayish = function (a) {\n return Array.isArray(a) || ArrayBuffer.isView(a)\n};\n\nKotlin.arrayToString = function (a) {\n if (a === null) return \"null\"\n var toString = Kotlin.isCharArray(a) ? String.fromCharCode : Kotlin.toString;\n return \"[\" + Array.prototype.map.call(a, function(e) { return toString(e); }).join(\", \") + \"]\";\n};\n\nKotlin.arrayDeepToString = function (arr) {\n return Kotlin.kotlin.collections.contentDeepToStringImpl(arr);\n};\n\nKotlin.arrayEquals = function (a, b) {\n if (a === b) {\n return true;\n }\n if (a === null || b === null || !Kotlin.isArrayish(b) || a.length !== b.length) {\n return false;\n }\n\n for (var i = 0, n = a.length; i < n; i++) {\n if (!Kotlin.equals(a[i], b[i])) {\n return false;\n }\n }\n return true;\n};\n\nKotlin.arrayDeepEquals = function (a, b) {\n return Kotlin.kotlin.collections.contentDeepEqualsImpl(a, b);\n};\n\nKotlin.arrayHashCode = function (arr) {\n if (arr === null) return 0\n var result = 1;\n for (var i = 0, n = arr.length; i < n; i++) {\n result = ((31 * result | 0) + Kotlin.hashCode(arr[i])) | 0;\n }\n return result;\n};\n\nKotlin.arrayDeepHashCode = function (arr) {\n return Kotlin.kotlin.collections.contentDeepHashCodeImpl(arr);\n};\n\nKotlin.primitiveArraySort = function (array) {\n array.sort(Kotlin.doubleCompareTo)\n};\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. \n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\nKotlin.toShort = function (a) {\n return (a & 0xFFFF) << 16 >> 16;\n};\n\nKotlin.toByte = function (a) {\n return (a & 0xFF) << 24 >> 24;\n};\n\nKotlin.toChar = function (a) {\n return a & 0xFFFF;\n};\n\nKotlin.numberToLong = function (a) {\n return a instanceof Kotlin.Long ? a : Kotlin.Long.fromNumber(a);\n};\n\nKotlin.numberToInt = function (a) {\n return a instanceof Kotlin.Long ? a.toInt() : Kotlin.doubleToInt(a);\n};\n\nKotlin.numberToShort = function (a) {\n return Kotlin.toShort(Kotlin.numberToInt(a));\n};\n\nKotlin.numberToByte = function (a) {\n return Kotlin.toByte(Kotlin.numberToInt(a));\n};\n\nKotlin.numberToDouble = function (a) {\n return +a;\n};\n\nKotlin.numberToChar = function (a) {\n return Kotlin.toChar(Kotlin.numberToInt(a));\n};\n\nKotlin.doubleToInt = function(a) {\n if (a > 2147483647) return 2147483647;\n if (a < -2147483648) return -2147483648;\n return a | 0;\n};\n\nKotlin.toBoxedChar = function (a) {\n if (a == null) return a;\n if (a instanceof Kotlin.BoxedChar) return a;\n return new Kotlin.BoxedChar(a);\n};\n\nKotlin.unboxChar = function(a) {\n if (a == null) return a;\n return Kotlin.toChar(a);\n};\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. \n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n// Copyright 2009 The Closure Library Authors. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS-IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n\n/**\n * Constructs a 64-bit two's-complement integer, given its low and high 32-bit\n * values as *signed* integers. See the from* functions below for more\n * convenient ways of constructing Longs.\n *\n * The internal representation of a long is the two given signed, 32-bit values.\n * We use 32-bit pieces because these are the size of integers on which\n * Javascript performs bit-operations. For operations like addition and\n * multiplication, we split each number into 16-bit pieces, which can easily be\n * multiplied within Javascript's floating-point representation without overflow\n * or change in sign.\n *\n * In the algorithms below, we frequently reduce the negative case to the\n * positive case by negating the input(s) and then post-processing the result.\n * Note that we must ALWAYS check specially whether those values are MIN_VALUE\n * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as\n * a positive number, it overflows back into a negative). Not handling this\n * case would often result in infinite recursion.\n *\n * @param {number} low The low (signed) 32 bits of the long.\n * @param {number} high The high (signed) 32 bits of the long.\n * @constructor\n * @final\n */\nKotlin.Long = function(low, high) {\n /**\n * @type {number}\n * @private\n */\n this.low_ = low | 0; // force into 32 signed bits.\n\n /**\n * @type {number}\n * @private\n */\n this.high_ = high | 0; // force into 32 signed bits.\n};\n\nKotlin.Long.$metadata$ = {\n kind: \"class\",\n simpleName: \"Long\",\n interfaces:[]\n};\n\n\n// NOTE: Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the\n// from* methods on which they depend.\n\n\n/**\n * A cache of the Long representations of small integer values.\n * @type {!Object}\n * @private\n */\nKotlin.Long.IntCache_ = {};\n\n\n/**\n * Returns a Long representing the given (32-bit) integer value.\n * @param {number} value The 32-bit integer in question.\n * @return {!Kotlin.Long} The corresponding Long value.\n */\nKotlin.Long.fromInt = function(value) {\n if (-128 <= value && value < 128) {\n var cachedObj = Kotlin.Long.IntCache_[value];\n if (cachedObj) {\n return cachedObj;\n }\n }\n\n var obj = new Kotlin.Long(value | 0, value < 0 ? -1 : 0);\n if (-128 <= value && value < 128) {\n Kotlin.Long.IntCache_[value] = obj;\n }\n return obj;\n};\n\n\n/**\n * Converts this number value to `Long`.\n * The fractional part, if any, is rounded down towards zero.\n * Returns zero if this `Double` value is `NaN`, `Long.MIN_VALUE` if it's less than `Long.MIN_VALUE`,\n * `Long.MAX_VALUE` if it's bigger than `Long.MAX_VALUE`.\n * @param {number} value The number in question.\n * @return {!Kotlin.Long} The corresponding Long value.\n */\nKotlin.Long.fromNumber = function(value) {\n if (isNaN(value)) {\n return Kotlin.Long.ZERO;\n } else if (value <= -Kotlin.Long.TWO_PWR_63_DBL_) {\n return Kotlin.Long.MIN_VALUE;\n } else if (value + 1 >= Kotlin.Long.TWO_PWR_63_DBL_) {\n return Kotlin.Long.MAX_VALUE;\n } else if (value < 0) {\n return Kotlin.Long.fromNumber(-value).negate();\n } else {\n return new Kotlin.Long(\n (value % Kotlin.Long.TWO_PWR_32_DBL_) | 0,\n (value / Kotlin.Long.TWO_PWR_32_DBL_) | 0);\n }\n};\n\n\n/**\n * Returns a Long representing the 64-bit integer that comes by concatenating\n * the given high and low bits. Each is assumed to use 32 bits.\n * @param {number} lowBits The low 32-bits.\n * @param {number} highBits The high 32-bits.\n * @return {!Kotlin.Long} The corresponding Long value.\n */\nKotlin.Long.fromBits = function(lowBits, highBits) {\n return new Kotlin.Long(lowBits, highBits);\n};\n\n\n/**\n * Returns a Long representation of the given string, written using the given\n * radix.\n * @param {string} str The textual representation of the Long.\n * @param {number=} opt_radix The radix in which the text is written.\n * @return {!Kotlin.Long} The corresponding Long value.\n */\nKotlin.Long.fromString = function(str, opt_radix) {\n if (str.length == 0) {\n throw Error('number format error: empty string');\n }\n\n var radix = opt_radix || 10;\n if (radix < 2 || 36 < radix) {\n throw Error('radix out of range: ' + radix);\n }\n\n if (str.charAt(0) == '-') {\n return Kotlin.Long.fromString(str.substring(1), radix).negate();\n } else if (str.indexOf('-') >= 0) {\n throw Error('number format error: interior \"-\" character: ' + str);\n }\n\n // Do several (8) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = Kotlin.Long.fromNumber(Math.pow(radix, 8));\n\n var result = Kotlin.Long.ZERO;\n for (var i = 0; i < str.length; i += 8) {\n var size = Math.min(8, str.length - i);\n var value = parseInt(str.substring(i, i + size), radix);\n if (size < 8) {\n var power = Kotlin.Long.fromNumber(Math.pow(radix, size));\n result = result.multiply(power).add(Kotlin.Long.fromNumber(value));\n } else {\n result = result.multiply(radixToPower);\n result = result.add(Kotlin.Long.fromNumber(value));\n }\n }\n return result;\n};\n\n\n// NOTE: the compiler should inline these constant values below and then remove\n// these variables, so there should be no runtime penalty for these.\n\n\n/**\n * Number used repeated below in calculations. This must appear before the\n * first call to any from* function below.\n * @type {number}\n * @private\n */\nKotlin.Long.TWO_PWR_16_DBL_ = 1 << 16;\n\n\n/**\n * @type {number}\n * @private\n */\nKotlin.Long.TWO_PWR_24_DBL_ = 1 << 24;\n\n\n/**\n * @type {number}\n * @private\n */\nKotlin.Long.TWO_PWR_32_DBL_ =\n Kotlin.Long.TWO_PWR_16_DBL_ * Kotlin.Long.TWO_PWR_16_DBL_;\n\n\n/**\n * @type {number}\n * @private\n */\nKotlin.Long.TWO_PWR_31_DBL_ =\n Kotlin.Long.TWO_PWR_32_DBL_ / 2;\n\n\n/**\n * @type {number}\n * @private\n */\nKotlin.Long.TWO_PWR_48_DBL_ =\n Kotlin.Long.TWO_PWR_32_DBL_ * Kotlin.Long.TWO_PWR_16_DBL_;\n\n\n/**\n * @type {number}\n * @private\n */\nKotlin.Long.TWO_PWR_64_DBL_ =\n Kotlin.Long.TWO_PWR_32_DBL_ * Kotlin.Long.TWO_PWR_32_DBL_;\n\n\n/**\n * @type {number}\n * @private\n */\nKotlin.Long.TWO_PWR_63_DBL_ =\n Kotlin.Long.TWO_PWR_64_DBL_ / 2;\n\n\n/** @type {!Kotlin.Long} */\nKotlin.Long.ZERO = Kotlin.Long.fromInt(0);\n\n\n/** @type {!Kotlin.Long} */\nKotlin.Long.ONE = Kotlin.Long.fromInt(1);\n\n\n/** @type {!Kotlin.Long} */\nKotlin.Long.NEG_ONE = Kotlin.Long.fromInt(-1);\n\n\n/** @type {!Kotlin.Long} */\nKotlin.Long.MAX_VALUE =\n Kotlin.Long.fromBits(0xFFFFFFFF | 0, 0x7FFFFFFF | 0);\n\n\n/** @type {!Kotlin.Long} */\nKotlin.Long.MIN_VALUE = Kotlin.Long.fromBits(0, 0x80000000 | 0);\n\n\n/**\n * @type {!Kotlin.Long}\n * @private\n */\nKotlin.Long.TWO_PWR_24_ = Kotlin.Long.fromInt(1 << 24);\n\n\n/** @return {number} The value, assuming it is a 32-bit integer. */\nKotlin.Long.prototype.toInt = function() {\n return this.low_;\n};\n\n\n/** @return {number} The closest floating-point representation to this value. */\nKotlin.Long.prototype.toNumber = function() {\n return this.high_ * Kotlin.Long.TWO_PWR_32_DBL_ +\n this.getLowBitsUnsigned();\n};\n\n/** @return {number} The 32-bit hashCode of this value. */\nKotlin.Long.prototype.hashCode = function() {\n return this.high_ ^ this.low_;\n};\n\n/**\n * @param {number=} opt_radix The radix in which the text should be written.\n * @return {string} The textual representation of this value.\n * @override\n */\nKotlin.Long.prototype.toString = function(opt_radix) {\n var radix = opt_radix || 10;\n if (radix < 2 || 36 < radix) {\n throw Error('radix out of range: ' + radix);\n }\n\n if (this.isZero()) {\n return '0';\n }\n\n if (this.isNegative()) {\n if (this.equalsLong(Kotlin.Long.MIN_VALUE)) {\n // We need to change the Long value before it can be negated, so we remove\n // the bottom-most digit in this base and then recurse to do the rest.\n var radixLong = Kotlin.Long.fromNumber(radix);\n var div = this.div(radixLong);\n var rem = div.multiply(radixLong).subtract(this);\n return div.toString(radix) + rem.toInt().toString(radix);\n } else {\n return '-' + this.negate().toString(radix);\n }\n }\n\n // Do several (5) digits each time through the loop, so as to\n // minimize the calls to the very expensive emulated div.\n var radixToPower = Kotlin.Long.fromNumber(Math.pow(radix, 5));\n\n var rem = this;\n var result = '';\n while (true) {\n var remDiv = rem.div(radixToPower);\n var intval = rem.subtract(remDiv.multiply(radixToPower)).toInt();\n var digits = intval.toString(radix);\n\n rem = remDiv;\n if (rem.isZero()) {\n return digits + result;\n } else {\n while (digits.length < 5) {\n digits = '0' + digits;\n }\n result = '' + digits + result;\n }\n }\n};\n\n\n/** @return {number} The high 32-bits as a signed value. */\nKotlin.Long.prototype.getHighBits = function() {\n return this.high_;\n};\n\n\n/** @return {number} The low 32-bits as a signed value. */\nKotlin.Long.prototype.getLowBits = function() {\n return this.low_;\n};\n\n\n/** @return {number} The low 32-bits as an unsigned value. */\nKotlin.Long.prototype.getLowBitsUnsigned = function() {\n return (this.low_ >= 0) ?\n this.low_ : Kotlin.Long.TWO_PWR_32_DBL_ + this.low_;\n};\n\n\n/**\n * @return {number} Returns the number of bits needed to represent the absolute\n * value of this Long.\n */\nKotlin.Long.prototype.getNumBitsAbs = function() {\n if (this.isNegative()) {\n if (this.equalsLong(Kotlin.Long.MIN_VALUE)) {\n return 64;\n } else {\n return this.negate().getNumBitsAbs();\n }\n } else {\n var val = this.high_ != 0 ? this.high_ : this.low_;\n for (var bit = 31; bit > 0; bit--) {\n if ((val & (1 << bit)) != 0) {\n break;\n }\n }\n return this.high_ != 0 ? bit + 33 : bit + 1;\n }\n};\n\n\n/** @return {boolean} Whether this value is zero. */\nKotlin.Long.prototype.isZero = function() {\n return this.high_ == 0 && this.low_ == 0;\n};\n\n\n/** @return {boolean} Whether this value is negative. */\nKotlin.Long.prototype.isNegative = function() {\n return this.high_ < 0;\n};\n\n\n/** @return {boolean} Whether this value is odd. */\nKotlin.Long.prototype.isOdd = function() {\n return (this.low_ & 1) == 1;\n};\n\n\n/**\n * @param {Kotlin.Long} other Long to compare against.\n * @return {boolean} Whether this Long equals the other.\n */\nKotlin.Long.prototype.equalsLong = function(other) {\n return (this.high_ == other.high_) && (this.low_ == other.low_);\n};\n\n\n/**\n * @param {Kotlin.Long} other Long to compare against.\n * @return {boolean} Whether this Long does not equal the other.\n */\nKotlin.Long.prototype.notEqualsLong = function(other) {\n return (this.high_ != other.high_) || (this.low_ != other.low_);\n};\n\n\n/**\n * @param {Kotlin.Long} other Long to compare against.\n * @return {boolean} Whether this Long is less than the other.\n */\nKotlin.Long.prototype.lessThan = function(other) {\n return this.compare(other) < 0;\n};\n\n\n/**\n * @param {Kotlin.Long} other Long to compare against.\n * @return {boolean} Whether this Long is less than or equal to the other.\n */\nKotlin.Long.prototype.lessThanOrEqual = function(other) {\n return this.compare(other) <= 0;\n};\n\n\n/**\n * @param {Kotlin.Long} other Long to compare against.\n * @return {boolean} Whether this Long is greater than the other.\n */\nKotlin.Long.prototype.greaterThan = function(other) {\n return this.compare(other) > 0;\n};\n\n\n/**\n * @param {Kotlin.Long} other Long to compare against.\n * @return {boolean} Whether this Long is greater than or equal to the other.\n */\nKotlin.Long.prototype.greaterThanOrEqual = function(other) {\n return this.compare(other) >= 0;\n};\n\n\n/**\n * Compares this Long with the given one.\n * @param {Kotlin.Long} other Long to compare against.\n * @return {number} 0 if they are the same, 1 if the this is greater, and -1\n * if the given one is greater.\n */\nKotlin.Long.prototype.compare = function(other) {\n if (this.equalsLong(other)) {\n return 0;\n }\n\n var thisNeg = this.isNegative();\n var otherNeg = other.isNegative();\n if (thisNeg && !otherNeg) {\n return -1;\n }\n if (!thisNeg && otherNeg) {\n return 1;\n }\n\n // at this point, the signs are the same, so subtraction will not overflow\n if (this.subtract(other).isNegative()) {\n return -1;\n } else {\n return 1;\n }\n};\n\n\n/** @return {!Kotlin.Long} The negation of this value. */\nKotlin.Long.prototype.negate = function() {\n if (this.equalsLong(Kotlin.Long.MIN_VALUE)) {\n return Kotlin.Long.MIN_VALUE;\n } else {\n return this.not().add(Kotlin.Long.ONE);\n }\n};\n\n\n/**\n * Returns the sum of this and the given Long.\n * @param {Kotlin.Long} other Long to add to this one.\n * @return {!Kotlin.Long} The sum of this and the given Long.\n */\nKotlin.Long.prototype.add = function(other) {\n // Divide each number into 4 chunks of 16 bits, and then sum the chunks.\n\n var a48 = this.high_ >>> 16;\n var a32 = this.high_ & 0xFFFF;\n var a16 = this.low_ >>> 16;\n var a00 = this.low_ & 0xFFFF;\n\n var b48 = other.high_ >>> 16;\n var b32 = other.high_ & 0xFFFF;\n var b16 = other.low_ >>> 16;\n var b00 = other.low_ & 0xFFFF;\n\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 + b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 + b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 + b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 + b48;\n c48 &= 0xFFFF;\n return Kotlin.Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32);\n};\n\n\n/**\n * Returns the difference of this and the given Long.\n * @param {Kotlin.Long} other Long to subtract from this.\n * @return {!Kotlin.Long} The difference of this and the given Long.\n */\nKotlin.Long.prototype.subtract = function(other) {\n return this.add(other.negate());\n};\n\n\n/**\n * Returns the product of this and the given long.\n * @param {Kotlin.Long} other Long to multiply with this.\n * @return {!Kotlin.Long} The product of this and the other.\n */\nKotlin.Long.prototype.multiply = function(other) {\n if (this.isZero()) {\n return Kotlin.Long.ZERO;\n } else if (other.isZero()) {\n return Kotlin.Long.ZERO;\n }\n\n if (this.equalsLong(Kotlin.Long.MIN_VALUE)) {\n return other.isOdd() ? Kotlin.Long.MIN_VALUE : Kotlin.Long.ZERO;\n } else if (other.equalsLong(Kotlin.Long.MIN_VALUE)) {\n return this.isOdd() ? Kotlin.Long.MIN_VALUE : Kotlin.Long.ZERO;\n }\n\n if (this.isNegative()) {\n if (other.isNegative()) {\n return this.negate().multiply(other.negate());\n } else {\n return this.negate().multiply(other).negate();\n }\n } else if (other.isNegative()) {\n return this.multiply(other.negate()).negate();\n }\n\n // If both longs are small, use float multiplication\n if (this.lessThan(Kotlin.Long.TWO_PWR_24_) &&\n other.lessThan(Kotlin.Long.TWO_PWR_24_)) {\n return Kotlin.Long.fromNumber(this.toNumber() * other.toNumber());\n }\n\n // Divide each long into 4 chunks of 16 bits, and then add up 4x4 products.\n // We can skip products that would overflow.\n\n var a48 = this.high_ >>> 16;\n var a32 = this.high_ & 0xFFFF;\n var a16 = this.low_ >>> 16;\n var a00 = this.low_ & 0xFFFF;\n\n var b48 = other.high_ >>> 16;\n var b32 = other.high_ & 0xFFFF;\n var b16 = other.low_ >>> 16;\n var b00 = other.low_ & 0xFFFF;\n\n var c48 = 0, c32 = 0, c16 = 0, c00 = 0;\n c00 += a00 * b00;\n c16 += c00 >>> 16;\n c00 &= 0xFFFF;\n c16 += a16 * b00;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c16 += a00 * b16;\n c32 += c16 >>> 16;\n c16 &= 0xFFFF;\n c32 += a32 * b00;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a16 * b16;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c32 += a00 * b32;\n c48 += c32 >>> 16;\n c32 &= 0xFFFF;\n c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;\n c48 &= 0xFFFF;\n return Kotlin.Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32);\n};\n\n\n/**\n * Returns this Long divided by the given one.\n * @param {Kotlin.Long} other Long by which to divide.\n * @return {!Kotlin.Long} This Long divided by the given one.\n */\nKotlin.Long.prototype.div = function(other) {\n if (other.isZero()) {\n throw Error('division by zero');\n } else if (this.isZero()) {\n return Kotlin.Long.ZERO;\n }\n\n if (this.equalsLong(Kotlin.Long.MIN_VALUE)) {\n if (other.equalsLong(Kotlin.Long.ONE) ||\n other.equalsLong(Kotlin.Long.NEG_ONE)) {\n return Kotlin.Long.MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE\n } else if (other.equalsLong(Kotlin.Long.MIN_VALUE)) {\n return Kotlin.Long.ONE;\n } else {\n // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.\n var halfThis = this.shiftRight(1);\n var approx = halfThis.div(other).shiftLeft(1);\n if (approx.equalsLong(Kotlin.Long.ZERO)) {\n return other.isNegative() ? Kotlin.Long.ONE : Kotlin.Long.NEG_ONE;\n } else {\n var rem = this.subtract(other.multiply(approx));\n var result = approx.add(rem.div(other));\n return result;\n }\n }\n } else if (other.equalsLong(Kotlin.Long.MIN_VALUE)) {\n return Kotlin.Long.ZERO;\n }\n\n if (this.isNegative()) {\n if (other.isNegative()) {\n return this.negate().div(other.negate());\n } else {\n return this.negate().div(other).negate();\n }\n } else if (other.isNegative()) {\n return this.div(other.negate()).negate();\n }\n\n // Repeat the following until the remainder is less than other: find a\n // floating-point that approximates remainder / other *from below*, add this\n // into the result, and subtract it from the remainder. It is critical that\n // the approximate value is less than or equal to the real value so that the\n // remainder never becomes negative.\n var res = Kotlin.Long.ZERO;\n var rem = this;\n while (rem.greaterThanOrEqual(other)) {\n // Approximate the result of division. This may be a little greater or\n // smaller than the actual value.\n var approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber()));\n\n // We will tweak the approximate result by changing it in the 48-th digit or\n // the smallest non-fractional digit, whichever is larger.\n var log2 = Math.ceil(Math.log(approx) / Math.LN2);\n var delta = (log2 <= 48) ? 1 : Math.pow(2, log2 - 48);\n\n // Decrease the approximation until it is smaller than the remainder. Note\n // that if it is too large, the product overflows and is negative.\n var approxRes = Kotlin.Long.fromNumber(approx);\n var approxRem = approxRes.multiply(other);\n while (approxRem.isNegative() || approxRem.greaterThan(rem)) {\n approx -= delta;\n approxRes = Kotlin.Long.fromNumber(approx);\n approxRem = approxRes.multiply(other);\n }\n\n // We know the answer can't be zero... and actually, zero would cause\n // infinite recursion since we would make no progress.\n if (approxRes.isZero()) {\n approxRes = Kotlin.Long.ONE;\n }\n\n res = res.add(approxRes);\n rem = rem.subtract(approxRem);\n }\n return res;\n};\n\n\n/**\n * Returns this Long modulo the given one.\n * @param {Kotlin.Long} other Long by which to mod.\n * @return {!Kotlin.Long} This Long modulo the given one.\n */\nKotlin.Long.prototype.modulo = function(other) {\n return this.subtract(this.div(other).multiply(other));\n};\n\n\n/** @return {!Kotlin.Long} The bitwise-NOT of this value. */\nKotlin.Long.prototype.not = function() {\n return Kotlin.Long.fromBits(~this.low_, ~this.high_);\n};\n\n\n/**\n * Returns the bitwise-AND of this Long and the given one.\n * @param {Kotlin.Long} other The Long with which to AND.\n * @return {!Kotlin.Long} The bitwise-AND of this and the other.\n */\nKotlin.Long.prototype.and = function(other) {\n return Kotlin.Long.fromBits(this.low_ & other.low_,\n this.high_ & other.high_);\n};\n\n\n/**\n * Returns the bitwise-OR of this Long and the given one.\n * @param {Kotlin.Long} other The Long with which to OR.\n * @return {!Kotlin.Long} The bitwise-OR of this and the other.\n */\nKotlin.Long.prototype.or = function(other) {\n return Kotlin.Long.fromBits(this.low_ | other.low_,\n this.high_ | other.high_);\n};\n\n\n/**\n * Returns the bitwise-XOR of this Long and the given one.\n * @param {Kotlin.Long} other The Long with which to XOR.\n * @return {!Kotlin.Long} The bitwise-XOR of this and the other.\n */\nKotlin.Long.prototype.xor = function(other) {\n return Kotlin.Long.fromBits(this.low_ ^ other.low_,\n this.high_ ^ other.high_);\n};\n\n\n/**\n * Returns this Long with bits shifted to the left by the given amount.\n * @param {number} numBits The number of bits by which to shift.\n * @return {!Kotlin.Long} This shifted to the left by the given amount.\n */\nKotlin.Long.prototype.shiftLeft = function(numBits) {\n numBits &= 63;\n if (numBits == 0) {\n return this;\n } else {\n var low = this.low_;\n if (numBits < 32) {\n var high = this.high_;\n return Kotlin.Long.fromBits(\n low << numBits,\n (high << numBits) | (low >>> (32 - numBits)));\n } else {\n return Kotlin.Long.fromBits(0, low << (numBits - 32));\n }\n }\n};\n\n\n/**\n * Returns this Long with bits shifted to the right by the given amount.\n * @param {number} numBits The number of bits by which to shift.\n * @return {!Kotlin.Long} This shifted to the right by the given amount.\n */\nKotlin.Long.prototype.shiftRight = function(numBits) {\n numBits &= 63;\n if (numBits == 0) {\n return this;\n } else {\n var high = this.high_;\n if (numBits < 32) {\n var low = this.low_;\n return Kotlin.Long.fromBits(\n (low >>> numBits) | (high << (32 - numBits)),\n high >> numBits);\n } else {\n return Kotlin.Long.fromBits(\n high >> (numBits - 32),\n high >= 0 ? 0 : -1);\n }\n }\n};\n\n\n/**\n * Returns this Long with bits shifted to the right by the given amount, with\n * zeros placed into the new leading bits.\n * @param {number} numBits The number of bits by which to shift.\n * @return {!Kotlin.Long} This shifted to the right by the given amount, with\n * zeros placed into the new leading bits.\n */\nKotlin.Long.prototype.shiftRightUnsigned = function(numBits) {\n numBits &= 63;\n if (numBits == 0) {\n return this;\n } else {\n var high = this.high_;\n if (numBits < 32) {\n var low = this.low_;\n return Kotlin.Long.fromBits(\n (low >>> numBits) | (high << (32 - numBits)),\n high >>> numBits);\n } else if (numBits == 32) {\n return Kotlin.Long.fromBits(high, 0);\n } else {\n return Kotlin.Long.fromBits(high >>> (numBits - 32), 0);\n }\n }\n};\n\n// Support for Kotlin\nKotlin.Long.prototype.equals = function (other) {\n return other instanceof Kotlin.Long && this.equalsLong(other);\n};\n\nKotlin.Long.prototype.compareTo_11rb$ = Kotlin.Long.prototype.compare;\n\nKotlin.Long.prototype.inc = function() {\n return this.add(Kotlin.Long.ONE);\n};\n\nKotlin.Long.prototype.dec = function() {\n return this.add(Kotlin.Long.NEG_ONE);\n};\n\nKotlin.Long.prototype.valueOf = function() {\n return this.toNumber();\n};\n\nKotlin.Long.prototype.unaryPlus = function() {\n return this;\n};\n\nKotlin.Long.prototype.unaryMinus = Kotlin.Long.prototype.negate;\nKotlin.Long.prototype.inv = Kotlin.Long.prototype.not;\n\nKotlin.Long.prototype.rangeTo = function (other) {\n return new Kotlin.kotlin.ranges.LongRange(this, other);\n};","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. \n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\nKotlin.Kind = {\n CLASS: \"class\",\n INTERFACE: \"interface\",\n OBJECT: \"object\"\n};\n\nKotlin.callGetter = function (thisObject, klass, propertyName) {\n var propertyDescriptor = Object.getOwnPropertyDescriptor(klass, propertyName);\n if (propertyDescriptor != null && propertyDescriptor.get != null) {\n return propertyDescriptor.get.call(thisObject);\n }\n\n propertyDescriptor = Object.getOwnPropertyDescriptor(thisObject, propertyName);\n if (propertyDescriptor != null && \"value\" in propertyDescriptor) {\n return thisObject[propertyName];\n }\n\n return Kotlin.callGetter(thisObject, Object.getPrototypeOf(klass), propertyName);\n};\n\nKotlin.callSetter = function (thisObject, klass, propertyName, value) {\n var propertyDescriptor = Object.getOwnPropertyDescriptor(klass, propertyName);\n if (propertyDescriptor != null && propertyDescriptor.set != null) {\n propertyDescriptor.set.call(thisObject, value);\n return;\n }\n\n propertyDescriptor = Object.getOwnPropertyDescriptor(thisObject, propertyName);\n if (propertyDescriptor != null && \"value\" in propertyDescriptor) {\n thisObject[propertyName] = value;\n return\n }\n\n Kotlin.callSetter(thisObject, Object.getPrototypeOf(klass), propertyName, value);\n};\n\nfunction isInheritanceFromInterface(ctor, iface) {\n if (ctor === iface) return true;\n\n var metadata = ctor.$metadata$;\n if (metadata != null) {\n var interfaces = metadata.interfaces;\n for (var i = 0; i < interfaces.length; i++) {\n if (isInheritanceFromInterface(interfaces[i], iface)) {\n return true;\n }\n }\n }\n\n var superPrototype = ctor.prototype != null ? Object.getPrototypeOf(ctor.prototype) : null;\n var superConstructor = superPrototype != null ? superPrototype.constructor : null;\n return superConstructor != null && isInheritanceFromInterface(superConstructor, iface);\n}\n\n/**\n *\n * @param {*} object\n * @param {Function|Object} klass\n * @returns {Boolean}\n */\nKotlin.isType = function (object, klass) {\n if (klass === Object) {\n switch (typeof object) {\n case \"string\":\n case \"number\":\n case \"boolean\":\n case \"function\":\n return true;\n default:\n return object instanceof Object;\n }\n }\n\n if (object == null || klass == null || (typeof object !== 'object' && typeof object !== 'function')) {\n return false;\n }\n\n if (typeof klass === \"function\" && object instanceof klass) {\n return true;\n }\n\n var proto = Object.getPrototypeOf(klass);\n var constructor = proto != null ? proto.constructor : null;\n if (constructor != null && \"$metadata$\" in constructor) {\n var metadata = constructor.$metadata$;\n if (metadata.kind === Kotlin.Kind.OBJECT) {\n return object === klass;\n }\n }\n\n var klassMetadata = klass.$metadata$;\n\n // In WebKit (JavaScriptCore) for some interfaces from DOM typeof returns \"object\", nevertheless they can be used in RHS of instanceof\n if (klassMetadata == null) {\n return object instanceof klass;\n }\n\n if (klassMetadata.kind === Kotlin.Kind.INTERFACE && object.constructor != null) {\n return isInheritanceFromInterface(object.constructor, klass);\n }\n\n return false;\n};\n\nKotlin.isNumber = function (a) {\n return typeof a == \"number\" || a instanceof Kotlin.Long;\n};\n\nKotlin.isChar = function (value) {\n return value instanceof Kotlin.BoxedChar\n};\n\nKotlin.isComparable = function (value) {\n var type = typeof value;\n\n return type === \"string\" ||\n type === \"boolean\" ||\n Kotlin.isNumber(value) ||\n Kotlin.isType(value, Kotlin.kotlin.Comparable);\n};\n\nKotlin.isCharSequence = function (value) {\n return typeof value === \"string\" || Kotlin.isType(value, Kotlin.kotlin.CharSequence);\n};","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n// a package is omitted to get declarations directly under the module\n\n@PublishedApi\nexternal internal fun Array(size: Int): Array\n\n@JsName(\"newArray\")\nfun newArray(size: Int, initValue: T) = fillArrayVal(Array(size), initValue)\n\n@JsName(\"newArrayF\")\ninline fun arrayWithFun(size: Int, init: (Int) -> T) = fillArrayFun(Array(size), init)\n\n@JsName(\"fillArray\")\ninline fun fillArrayFun(array: Array, init: (Int) -> T): Array {\n for (i in 0..array.size - 1) {\n array[i] = init(i)\n }\n return array\n}\n\n@JsName(\"booleanArray\")\nfun booleanArray(size: Int, init: dynamic): Array {\n val result: dynamic = Array(size)\n result.`$type$` = \"BooleanArray\"\n return when (init) {\n null, true -> fillArrayVal(result, false)\n false -> result\n else -> fillArrayFun(result, init)\n }\n}\n\n@JsName(\"booleanArrayF\")\ninline fun booleanArrayWithFun(size: Int, init: (Int) -> Boolean): Array = fillArrayFun(booleanArray(size, false), init)\n\n@JsName(\"charArray\")\n@Suppress(\"UNUSED_PARAMETER\")\nfun charArray(size: Int, init: dynamic): Array {\n val result = js(\"new Uint16Array(size)\")\n result.`$type$` = \"CharArray\"\n return when (init) {\n null, true, false -> result // For consistency\n else -> fillArrayFun(result, init)\n }\n}\n\n@JsName(\"charArrayF\")\ninline fun charArrayWithFun(size: Int, init: (Int) -> Char): Array {\n val array = charArray(size, null)\n for (i in 0..array.size - 1) {\n @Suppress(\"UNUSED_VARIABLE\") // used in js block\n val value = init(i)\n js(\"array[i] = value;\")\n }\n return array\n}\n\n@JsName(\"untypedCharArrayF\")\ninline fun untypedCharArrayWithFun(size: Int, init: (Int) -> Char): Array {\n val array = Array(size)\n for (i in 0..array.size - 1) {\n @Suppress(\"UNUSED_VARIABLE\") // used in js block\n val value = init(i)\n js(\"array[i] = value;\")\n }\n return array\n}\n\n@JsName(\"longArray\")\nfun longArray(size: Int, init: dynamic): Array {\n val result: dynamic = Array(size)\n result.`$type$` = \"LongArray\"\n return when (init) {\n null, true -> fillArrayVal(result, 0L)\n false -> result\n else -> fillArrayFun(result, init)\n }\n}\n\n@JsName(\"longArrayF\")\ninline fun longArrayWithFun(size: Int, init: (Int) -> Long): Array = fillArrayFun(longArray(size, false), init)\n\nprivate fun fillArrayVal(array: Array, initValue: T): Array {\n for (i in 0..array.size - 1) {\n array[i] = initValue\n }\n return array\n}","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin\n\npublic class Enum> : Comparable> {\n @JsName(\"name$\") private var _name: String = \"\"\n @JsName(\"ordinal$\") private var _ordinal: Int = 0\n\n val name: String\n get() = _name\n\n val ordinal: Int\n get() = _ordinal\n\n override fun compareTo(other: Enum) = ordinal.compareTo(other.ordinal)\n\n override fun equals(other: Any?) = this === other\n\n override fun hashCode(): Int = js(\"Kotlin.identityHashCode\")(this)\n\n override fun toString() = name\n\n companion object\n}","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.js.internal\n\n@JsName(\"DoubleCompanionObject\")\ninternal object DoubleCompanionObject {\n @JsName(\"MIN_VALUE\")\n const val MIN_VALUE: Double = 4.9E-324\n\n @JsName(\"MAX_VALUE\")\n const val MAX_VALUE: Double = 1.7976931348623157E308\n\n @JsName(\"POSITIVE_INFINITY\")\n @Suppress(\"DIVISION_BY_ZERO\")\n const val POSITIVE_INFINITY: Double = 1.0 / 0.0\n\n @JsName(\"NEGATIVE_INFINITY\")\n @Suppress(\"DIVISION_BY_ZERO\")\n const val NEGATIVE_INFINITY: Double = -1.0 / 0.0\n\n @JsName(\"NaN\")\n @Suppress(\"DIVISION_BY_ZERO\")\n const val NaN: Double = -(0.0 / 0.0)\n\n @JsName(\"SIZE_BYTES\")\n const val SIZE_BYTES = 8\n\n @JsName(\"SIZE_BITS\")\n const val SIZE_BITS = 64\n}\n\n@JsName(\"FloatCompanionObject\")\ninternal object FloatCompanionObject {\n @JsName(\"MIN_VALUE\")\n const val MIN_VALUE: Float = 1.4E-45F\n\n @JsName(\"MAX_VALUE\")\n const val MAX_VALUE: Float = 3.4028235E38F\n\n @JsName(\"POSITIVE_INFINITY\")\n @Suppress(\"DIVISION_BY_ZERO\")\n const val POSITIVE_INFINITY: Float = 1.0F / 0.0F\n\n @JsName(\"NEGATIVE_INFINITY\")\n @Suppress(\"DIVISION_BY_ZERO\")\n const val NEGATIVE_INFINITY: Float = -1.0F / 0.0F\n\n @JsName(\"NaN\")\n @Suppress(\"DIVISION_BY_ZERO\")\n const val NaN: Float = -(0.0F / 0.0F)\n\n @JsName(\"SIZE_BYTES\")\n const val SIZE_BYTES = 4\n\n @JsName(\"SIZE_BITS\")\n const val SIZE_BITS = 32\n}\n\n@JsName(\"IntCompanionObject\")\ninternal object IntCompanionObject {\n @JsName(\"MIN_VALUE\")\n val MIN_VALUE: Int = -2147483647 - 1\n\n @JsName(\"MAX_VALUE\")\n val MAX_VALUE: Int = 2147483647\n\n @JsName(\"SIZE_BYTES\")\n const val SIZE_BYTES = 4\n\n @JsName(\"SIZE_BITS\")\n const val SIZE_BITS = 32\n}\n\n@JsName(\"LongCompanionObject\")\ninternal object LongCompanionObject {\n @JsName(\"MIN_VALUE\")\n val MIN_VALUE: Long = js(\"Kotlin.Long.MIN_VALUE\")\n\n @JsName(\"MAX_VALUE\")\n val MAX_VALUE: Long = js(\"Kotlin.Long.MAX_VALUE\")\n\n @JsName(\"SIZE_BYTES\")\n const val SIZE_BYTES = 8\n\n @JsName(\"SIZE_BITS\")\n const val SIZE_BITS = 64\n}\n\n@JsName(\"ShortCompanionObject\")\ninternal object ShortCompanionObject {\n @JsName(\"MIN_VALUE\")\n val MIN_VALUE: Short = -32768\n\n @JsName(\"MAX_VALUE\")\n val MAX_VALUE: Short = 32767\n\n @JsName(\"SIZE_BYTES\")\n const val SIZE_BYTES = 2\n\n @JsName(\"SIZE_BITS\")\n const val SIZE_BITS = 16\n}\n\n@JsName(\"ByteCompanionObject\")\ninternal object ByteCompanionObject {\n @JsName(\"MIN_VALUE\")\n val MIN_VALUE: Byte = -128\n\n @JsName(\"MAX_VALUE\")\n val MAX_VALUE: Byte = 127\n\n @JsName(\"SIZE_BYTES\")\n const val SIZE_BYTES = 1\n\n @JsName(\"SIZE_BITS\")\n const val SIZE_BITS = 8\n}\n\n@JsName(\"CharCompanionObject\")\ninternal object CharCompanionObject {\n @JsName(\"MIN_VALUE\")\n public const val MIN_VALUE: Char = '\\u0000'\n\n @JsName(\"MAX_VALUE\")\n public const val MAX_VALUE: Char = '\\uFFFF'\n\n @JsName(\"MIN_HIGH_SURROGATE\")\n public const val MIN_HIGH_SURROGATE: Char = '\\uD800'\n\n @JsName(\"MAX_HIGH_SURROGATE\")\n public const val MAX_HIGH_SURROGATE: Char = '\\uDBFF'\n\n @JsName(\"MIN_LOW_SURROGATE\")\n public const val MIN_LOW_SURROGATE: Char = '\\uDC00'\n\n @JsName(\"MAX_LOW_SURROGATE\")\n public const val MAX_LOW_SURROGATE: Char = '\\uDFFF'\n\n @JsName(\"MIN_SURROGATE\")\n public const val MIN_SURROGATE: Char = MIN_HIGH_SURROGATE\n\n @JsName(\"MAX_SURROGATE\")\n public const val MAX_SURROGATE: Char = MAX_LOW_SURROGATE\n\n @JsName(\"SIZE_BYTES\")\n const val SIZE_BYTES = 2\n\n @JsName(\"SIZE_BITS\")\n const val SIZE_BITS = 16\n}\n\ninternal object StringCompanionObject {}\n\ninternal object BooleanCompanionObject {}\n\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"ArraysKt\")\n\npackage kotlin.collections\n\n//\n// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt\n// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib\n//\n\nimport kotlin.random.*\nimport kotlin.ranges.contains\nimport kotlin.ranges.reversed\n\n/**\n * Returns 1st *element* from the array.\n * \n * If the size of this array is less than 1, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun Array.component1(): T {\n return get(0)\n}\n\n/**\n * Returns 1st *element* from the array.\n * \n * If the size of this array is less than 1, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun ByteArray.component1(): Byte {\n return get(0)\n}\n\n/**\n * Returns 1st *element* from the array.\n * \n * If the size of this array is less than 1, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun ShortArray.component1(): Short {\n return get(0)\n}\n\n/**\n * Returns 1st *element* from the array.\n * \n * If the size of this array is less than 1, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun IntArray.component1(): Int {\n return get(0)\n}\n\n/**\n * Returns 1st *element* from the array.\n * \n * If the size of this array is less than 1, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun LongArray.component1(): Long {\n return get(0)\n}\n\n/**\n * Returns 1st *element* from the array.\n * \n * If the size of this array is less than 1, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun FloatArray.component1(): Float {\n return get(0)\n}\n\n/**\n * Returns 1st *element* from the array.\n * \n * If the size of this array is less than 1, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun DoubleArray.component1(): Double {\n return get(0)\n}\n\n/**\n * Returns 1st *element* from the array.\n * \n * If the size of this array is less than 1, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun BooleanArray.component1(): Boolean {\n return get(0)\n}\n\n/**\n * Returns 1st *element* from the array.\n * \n * If the size of this array is less than 1, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun CharArray.component1(): Char {\n return get(0)\n}\n\n/**\n * Returns 2nd *element* from the array.\n * \n * If the size of this array is less than 2, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun Array.component2(): T {\n return get(1)\n}\n\n/**\n * Returns 2nd *element* from the array.\n * \n * If the size of this array is less than 2, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun ByteArray.component2(): Byte {\n return get(1)\n}\n\n/**\n * Returns 2nd *element* from the array.\n * \n * If the size of this array is less than 2, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun ShortArray.component2(): Short {\n return get(1)\n}\n\n/**\n * Returns 2nd *element* from the array.\n * \n * If the size of this array is less than 2, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun IntArray.component2(): Int {\n return get(1)\n}\n\n/**\n * Returns 2nd *element* from the array.\n * \n * If the size of this array is less than 2, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun LongArray.component2(): Long {\n return get(1)\n}\n\n/**\n * Returns 2nd *element* from the array.\n * \n * If the size of this array is less than 2, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun FloatArray.component2(): Float {\n return get(1)\n}\n\n/**\n * Returns 2nd *element* from the array.\n * \n * If the size of this array is less than 2, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun DoubleArray.component2(): Double {\n return get(1)\n}\n\n/**\n * Returns 2nd *element* from the array.\n * \n * If the size of this array is less than 2, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun BooleanArray.component2(): Boolean {\n return get(1)\n}\n\n/**\n * Returns 2nd *element* from the array.\n * \n * If the size of this array is less than 2, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun CharArray.component2(): Char {\n return get(1)\n}\n\n/**\n * Returns 3rd *element* from the array.\n * \n * If the size of this array is less than 3, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun Array.component3(): T {\n return get(2)\n}\n\n/**\n * Returns 3rd *element* from the array.\n * \n * If the size of this array is less than 3, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun ByteArray.component3(): Byte {\n return get(2)\n}\n\n/**\n * Returns 3rd *element* from the array.\n * \n * If the size of this array is less than 3, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun ShortArray.component3(): Short {\n return get(2)\n}\n\n/**\n * Returns 3rd *element* from the array.\n * \n * If the size of this array is less than 3, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun IntArray.component3(): Int {\n return get(2)\n}\n\n/**\n * Returns 3rd *element* from the array.\n * \n * If the size of this array is less than 3, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun LongArray.component3(): Long {\n return get(2)\n}\n\n/**\n * Returns 3rd *element* from the array.\n * \n * If the size of this array is less than 3, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun FloatArray.component3(): Float {\n return get(2)\n}\n\n/**\n * Returns 3rd *element* from the array.\n * \n * If the size of this array is less than 3, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun DoubleArray.component3(): Double {\n return get(2)\n}\n\n/**\n * Returns 3rd *element* from the array.\n * \n * If the size of this array is less than 3, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun BooleanArray.component3(): Boolean {\n return get(2)\n}\n\n/**\n * Returns 3rd *element* from the array.\n * \n * If the size of this array is less than 3, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun CharArray.component3(): Char {\n return get(2)\n}\n\n/**\n * Returns 4th *element* from the array.\n * \n * If the size of this array is less than 4, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun Array.component4(): T {\n return get(3)\n}\n\n/**\n * Returns 4th *element* from the array.\n * \n * If the size of this array is less than 4, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun ByteArray.component4(): Byte {\n return get(3)\n}\n\n/**\n * Returns 4th *element* from the array.\n * \n * If the size of this array is less than 4, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun ShortArray.component4(): Short {\n return get(3)\n}\n\n/**\n * Returns 4th *element* from the array.\n * \n * If the size of this array is less than 4, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun IntArray.component4(): Int {\n return get(3)\n}\n\n/**\n * Returns 4th *element* from the array.\n * \n * If the size of this array is less than 4, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun LongArray.component4(): Long {\n return get(3)\n}\n\n/**\n * Returns 4th *element* from the array.\n * \n * If the size of this array is less than 4, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun FloatArray.component4(): Float {\n return get(3)\n}\n\n/**\n * Returns 4th *element* from the array.\n * \n * If the size of this array is less than 4, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun DoubleArray.component4(): Double {\n return get(3)\n}\n\n/**\n * Returns 4th *element* from the array.\n * \n * If the size of this array is less than 4, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun BooleanArray.component4(): Boolean {\n return get(3)\n}\n\n/**\n * Returns 4th *element* from the array.\n * \n * If the size of this array is less than 4, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun CharArray.component4(): Char {\n return get(3)\n}\n\n/**\n * Returns 5th *element* from the array.\n * \n * If the size of this array is less than 5, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun Array.component5(): T {\n return get(4)\n}\n\n/**\n * Returns 5th *element* from the array.\n * \n * If the size of this array is less than 5, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun ByteArray.component5(): Byte {\n return get(4)\n}\n\n/**\n * Returns 5th *element* from the array.\n * \n * If the size of this array is less than 5, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun ShortArray.component5(): Short {\n return get(4)\n}\n\n/**\n * Returns 5th *element* from the array.\n * \n * If the size of this array is less than 5, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun IntArray.component5(): Int {\n return get(4)\n}\n\n/**\n * Returns 5th *element* from the array.\n * \n * If the size of this array is less than 5, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun LongArray.component5(): Long {\n return get(4)\n}\n\n/**\n * Returns 5th *element* from the array.\n * \n * If the size of this array is less than 5, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun FloatArray.component5(): Float {\n return get(4)\n}\n\n/**\n * Returns 5th *element* from the array.\n * \n * If the size of this array is less than 5, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun DoubleArray.component5(): Double {\n return get(4)\n}\n\n/**\n * Returns 5th *element* from the array.\n * \n * If the size of this array is less than 5, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun BooleanArray.component5(): Boolean {\n return get(4)\n}\n\n/**\n * Returns 5th *element* from the array.\n * \n * If the size of this array is less than 5, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun CharArray.component5(): Char {\n return get(4)\n}\n\n/**\n * Returns `true` if [element] is found in the array.\n */\npublic operator fun <@kotlin.internal.OnlyInputTypes T> Array.contains(element: T): Boolean {\n return indexOf(element) >= 0\n}\n\n/**\n * Returns `true` if [element] is found in the array.\n */\npublic operator fun ByteArray.contains(element: Byte): Boolean {\n return indexOf(element) >= 0\n}\n\n/**\n * Returns `true` if [element] is found in the array.\n */\npublic operator fun ShortArray.contains(element: Short): Boolean {\n return indexOf(element) >= 0\n}\n\n/**\n * Returns `true` if [element] is found in the array.\n */\npublic operator fun IntArray.contains(element: Int): Boolean {\n return indexOf(element) >= 0\n}\n\n/**\n * Returns `true` if [element] is found in the array.\n */\npublic operator fun LongArray.contains(element: Long): Boolean {\n return indexOf(element) >= 0\n}\n\n/**\n * Returns `true` if [element] is found in the array.\n */\n@Deprecated(\"The function has unclear behavior when searching for NaN or zero values and will be removed soon. Use 'any { it == element }' instead to continue using this behavior, or '.asList().contains(element: T)' to get the same search behavior as in a list.\", ReplaceWith(\"any { it == element }\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.6\")\n@Suppress(\"DEPRECATION_ERROR\")\npublic operator fun FloatArray.contains(element: Float): Boolean {\n return indexOf(element) >= 0\n}\n\n/**\n * Returns `true` if [element] is found in the array.\n */\n@Deprecated(\"The function has unclear behavior when searching for NaN or zero values and will be removed soon. Use 'any { it == element }' instead to continue using this behavior, or '.asList().contains(element: T)' to get the same search behavior as in a list.\", ReplaceWith(\"any { it == element }\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.6\")\n@Suppress(\"DEPRECATION_ERROR\")\npublic operator fun DoubleArray.contains(element: Double): Boolean {\n return indexOf(element) >= 0\n}\n\n/**\n * Returns `true` if [element] is found in the array.\n */\npublic operator fun BooleanArray.contains(element: Boolean): Boolean {\n return indexOf(element) >= 0\n}\n\n/**\n * Returns `true` if [element] is found in the array.\n */\npublic operator fun CharArray.contains(element: Char): Boolean {\n return indexOf(element) >= 0\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic expect fun Array.elementAt(index: Int): T\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic expect fun ByteArray.elementAt(index: Int): Byte\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic expect fun ShortArray.elementAt(index: Int): Short\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic expect fun IntArray.elementAt(index: Int): Int\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic expect fun LongArray.elementAt(index: Int): Long\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic expect fun FloatArray.elementAt(index: Int): Float\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic expect fun DoubleArray.elementAt(index: Int): Double\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic expect fun BooleanArray.elementAt(index: Int): Boolean\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic expect fun CharArray.elementAt(index: Int): Char\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@kotlin.internal.InlineOnly\npublic inline fun Array.elementAtOrElse(index: Int, defaultValue: (Int) -> T): T {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Byte): Byte {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Short): Short {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Int): Int {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Long): Long {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Float): Float {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Double): Double {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Boolean): Boolean {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.elementAtOrElse(index: Int, defaultValue: (Int) -> Char): Char {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@kotlin.internal.InlineOnly\npublic inline fun Array.elementAtOrNull(index: Int): T? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.elementAtOrNull(index: Int): Byte? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.elementAtOrNull(index: Int): Short? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.elementAtOrNull(index: Int): Int? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.elementAtOrNull(index: Int): Long? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.elementAtOrNull(index: Int): Float? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.elementAtOrNull(index: Int): Double? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.elementAtOrNull(index: Int): Boolean? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.elementAtOrNull(index: Int): Char? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun Array.find(predicate: (T) -> Boolean): T? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.find(predicate: (Byte) -> Boolean): Byte? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.find(predicate: (Short) -> Boolean): Short? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.find(predicate: (Int) -> Boolean): Int? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.find(predicate: (Long) -> Boolean): Long? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.find(predicate: (Float) -> Boolean): Float? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.find(predicate: (Double) -> Boolean): Double? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.find(predicate: (Boolean) -> Boolean): Boolean? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.find(predicate: (Char) -> Boolean): Char? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun Array.findLast(predicate: (T) -> Boolean): T? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.findLast(predicate: (Byte) -> Boolean): Byte? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.findLast(predicate: (Short) -> Boolean): Short? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.findLast(predicate: (Int) -> Boolean): Int? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.findLast(predicate: (Long) -> Boolean): Long? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.findLast(predicate: (Float) -> Boolean): Float? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.findLast(predicate: (Double) -> Boolean): Double? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.findLast(predicate: (Boolean) -> Boolean): Boolean? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.findLast(predicate: (Char) -> Boolean): Char? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns first element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun Array.first(): T {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[0]\n}\n\n/**\n * Returns first element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun ByteArray.first(): Byte {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[0]\n}\n\n/**\n * Returns first element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun ShortArray.first(): Short {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[0]\n}\n\n/**\n * Returns first element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun IntArray.first(): Int {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[0]\n}\n\n/**\n * Returns first element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun LongArray.first(): Long {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[0]\n}\n\n/**\n * Returns first element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun FloatArray.first(): Float {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[0]\n}\n\n/**\n * Returns first element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun DoubleArray.first(): Double {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[0]\n}\n\n/**\n * Returns first element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun BooleanArray.first(): Boolean {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[0]\n}\n\n/**\n * Returns first element.\n * @throws [NoSuchElementException] if the array is empty.\n */\npublic fun CharArray.first(): Char {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[0]\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun Array.first(predicate: (T) -> Boolean): T {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun ByteArray.first(predicate: (Byte) -> Boolean): Byte {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun ShortArray.first(predicate: (Short) -> Boolean): Short {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun IntArray.first(predicate: (Int) -> Boolean): Int {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun LongArray.first(predicate: (Long) -> Boolean): Long {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun FloatArray.first(predicate: (Float) -> Boolean): Float {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun DoubleArray.first(predicate: (Double) -> Boolean): Double {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun BooleanArray.first(predicate: (Boolean) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun CharArray.first(predicate: (Char) -> Boolean): Char {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first non-null value produced by [transform] function being applied to elements of this array in iteration order,\n * or throws [NoSuchElementException] if no non-null value was produced.\n * \n * @sample samples.collections.Collections.Transformations.firstNotNullOf\n */\n@SinceKotlin(\"1.5\")\n@kotlin.internal.InlineOnly\npublic inline fun Array.firstNotNullOf(transform: (T) -> R?): R {\n return firstNotNullOfOrNull(transform) ?: throw NoSuchElementException(\"No element of the array was transformed to a non-null value.\")\n}\n\n/**\n * Returns the first non-null value produced by [transform] function being applied to elements of this array in iteration order,\n * or `null` if no non-null value was produced.\n * \n * @sample samples.collections.Collections.Transformations.firstNotNullOf\n */\n@SinceKotlin(\"1.5\")\n@kotlin.internal.InlineOnly\npublic inline fun Array.firstNotNullOfOrNull(transform: (T) -> R?): R? {\n for (element in this) {\n val result = transform(element)\n if (result != null) {\n return result\n }\n }\n return null\n}\n\n/**\n * Returns the first element, or `null` if the array is empty.\n */\npublic fun Array.firstOrNull(): T? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first element, or `null` if the array is empty.\n */\npublic fun ByteArray.firstOrNull(): Byte? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first element, or `null` if the array is empty.\n */\npublic fun ShortArray.firstOrNull(): Short? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first element, or `null` if the array is empty.\n */\npublic fun IntArray.firstOrNull(): Int? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first element, or `null` if the array is empty.\n */\npublic fun LongArray.firstOrNull(): Long? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first element, or `null` if the array is empty.\n */\npublic fun FloatArray.firstOrNull(): Float? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first element, or `null` if the array is empty.\n */\npublic fun DoubleArray.firstOrNull(): Double? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first element, or `null` if the array is empty.\n */\npublic fun BooleanArray.firstOrNull(): Boolean? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first element, or `null` if the array is empty.\n */\npublic fun CharArray.firstOrNull(): Char? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n */\npublic inline fun Array.firstOrNull(predicate: (T) -> Boolean): T? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n */\npublic inline fun ByteArray.firstOrNull(predicate: (Byte) -> Boolean): Byte? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n */\npublic inline fun ShortArray.firstOrNull(predicate: (Short) -> Boolean): Short? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n */\npublic inline fun IntArray.firstOrNull(predicate: (Int) -> Boolean): Int? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n */\npublic inline fun LongArray.firstOrNull(predicate: (Long) -> Boolean): Long? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n */\npublic inline fun FloatArray.firstOrNull(predicate: (Float) -> Boolean): Float? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n */\npublic inline fun DoubleArray.firstOrNull(predicate: (Double) -> Boolean): Double? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n */\npublic inline fun BooleanArray.firstOrNull(predicate: (Boolean) -> Boolean): Boolean? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n */\npublic inline fun CharArray.firstOrNull(predicate: (Char) -> Boolean): Char? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun Array.getOrElse(index: Int, defaultValue: (Int) -> T): T {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.getOrElse(index: Int, defaultValue: (Int) -> Byte): Byte {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.getOrElse(index: Int, defaultValue: (Int) -> Short): Short {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.getOrElse(index: Int, defaultValue: (Int) -> Int): Int {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.getOrElse(index: Int, defaultValue: (Int) -> Long): Long {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.getOrElse(index: Int, defaultValue: (Int) -> Float): Float {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.getOrElse(index: Int, defaultValue: (Int) -> Double): Double {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.getOrElse(index: Int, defaultValue: (Int) -> Boolean): Boolean {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.getOrElse(index: Int, defaultValue: (Int) -> Char): Char {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.getOrNull\n */\npublic fun Array.getOrNull(index: Int): T? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.getOrNull\n */\npublic fun ByteArray.getOrNull(index: Int): Byte? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.getOrNull\n */\npublic fun ShortArray.getOrNull(index: Int): Short? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.getOrNull\n */\npublic fun IntArray.getOrNull(index: Int): Int? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.getOrNull\n */\npublic fun LongArray.getOrNull(index: Int): Long? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.getOrNull\n */\npublic fun FloatArray.getOrNull(index: Int): Float? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.getOrNull\n */\npublic fun DoubleArray.getOrNull(index: Int): Double? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.getOrNull\n */\npublic fun BooleanArray.getOrNull(index: Int): Boolean? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.getOrNull\n */\npublic fun CharArray.getOrNull(index: Int): Char? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns first index of [element], or -1 if the array does not contain element.\n */\npublic fun <@kotlin.internal.OnlyInputTypes T> Array.indexOf(element: T): Int {\n if (element == null) {\n for (index in indices) {\n if (this[index] == null) {\n return index\n }\n }\n } else {\n for (index in indices) {\n if (element == this[index]) {\n return index\n }\n }\n }\n return -1\n}\n\n/**\n * Returns first index of [element], or -1 if the array does not contain element.\n */\npublic fun ByteArray.indexOf(element: Byte): Int {\n for (index in indices) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns first index of [element], or -1 if the array does not contain element.\n */\npublic fun ShortArray.indexOf(element: Short): Int {\n for (index in indices) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns first index of [element], or -1 if the array does not contain element.\n */\npublic fun IntArray.indexOf(element: Int): Int {\n for (index in indices) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns first index of [element], or -1 if the array does not contain element.\n */\npublic fun LongArray.indexOf(element: Long): Int {\n for (index in indices) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns first index of [element], or -1 if the array does not contain element.\n */\n@Deprecated(\"The function has unclear behavior when searching for NaN or zero values and will be removed soon. Use 'indexOfFirst { it == element }' instead to continue using this behavior, or '.asList().indexOf(element: T)' to get the same search behavior as in a list.\", ReplaceWith(\"indexOfFirst { it == element }\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.6\")\npublic fun FloatArray.indexOf(element: Float): Int {\n for (index in indices) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns first index of [element], or -1 if the array does not contain element.\n */\n@Deprecated(\"The function has unclear behavior when searching for NaN or zero values and will be removed soon. Use 'indexOfFirst { it == element }' instead to continue using this behavior, or '.asList().indexOf(element: T)' to get the same search behavior as in a list.\", ReplaceWith(\"indexOfFirst { it == element }\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.6\")\npublic fun DoubleArray.indexOf(element: Double): Int {\n for (index in indices) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns first index of [element], or -1 if the array does not contain element.\n */\npublic fun BooleanArray.indexOf(element: Boolean): Int {\n for (index in indices) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns first index of [element], or -1 if the array does not contain element.\n */\npublic fun CharArray.indexOf(element: Char): Int {\n for (index in indices) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun Array.indexOfFirst(predicate: (T) -> Boolean): Int {\n for (index in indices) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun ByteArray.indexOfFirst(predicate: (Byte) -> Boolean): Int {\n for (index in indices) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun ShortArray.indexOfFirst(predicate: (Short) -> Boolean): Int {\n for (index in indices) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun IntArray.indexOfFirst(predicate: (Int) -> Boolean): Int {\n for (index in indices) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun LongArray.indexOfFirst(predicate: (Long) -> Boolean): Int {\n for (index in indices) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun FloatArray.indexOfFirst(predicate: (Float) -> Boolean): Int {\n for (index in indices) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun DoubleArray.indexOfFirst(predicate: (Double) -> Boolean): Int {\n for (index in indices) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun BooleanArray.indexOfFirst(predicate: (Boolean) -> Boolean): Int {\n for (index in indices) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun CharArray.indexOfFirst(predicate: (Char) -> Boolean): Int {\n for (index in indices) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun Array.indexOfLast(predicate: (T) -> Boolean): Int {\n for (index in indices.reversed()) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun ByteArray.indexOfLast(predicate: (Byte) -> Boolean): Int {\n for (index in indices.reversed()) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun ShortArray.indexOfLast(predicate: (Short) -> Boolean): Int {\n for (index in indices.reversed()) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun IntArray.indexOfLast(predicate: (Int) -> Boolean): Int {\n for (index in indices.reversed()) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun LongArray.indexOfLast(predicate: (Long) -> Boolean): Int {\n for (index in indices.reversed()) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun FloatArray.indexOfLast(predicate: (Float) -> Boolean): Int {\n for (index in indices.reversed()) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun DoubleArray.indexOfLast(predicate: (Double) -> Boolean): Int {\n for (index in indices.reversed()) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun BooleanArray.indexOfLast(predicate: (Boolean) -> Boolean): Int {\n for (index in indices.reversed()) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element.\n */\npublic inline fun CharArray.indexOfLast(predicate: (Char) -> Boolean): Int {\n for (index in indices.reversed()) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns the last element.\n * \n * @throws NoSuchElementException if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun Array.last(): T {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[lastIndex]\n}\n\n/**\n * Returns the last element.\n * \n * @throws NoSuchElementException if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun ByteArray.last(): Byte {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[lastIndex]\n}\n\n/**\n * Returns the last element.\n * \n * @throws NoSuchElementException if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun ShortArray.last(): Short {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[lastIndex]\n}\n\n/**\n * Returns the last element.\n * \n * @throws NoSuchElementException if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun IntArray.last(): Int {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[lastIndex]\n}\n\n/**\n * Returns the last element.\n * \n * @throws NoSuchElementException if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun LongArray.last(): Long {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[lastIndex]\n}\n\n/**\n * Returns the last element.\n * \n * @throws NoSuchElementException if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun FloatArray.last(): Float {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[lastIndex]\n}\n\n/**\n * Returns the last element.\n * \n * @throws NoSuchElementException if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun DoubleArray.last(): Double {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[lastIndex]\n}\n\n/**\n * Returns the last element.\n * \n * @throws NoSuchElementException if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun BooleanArray.last(): Boolean {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[lastIndex]\n}\n\n/**\n * Returns the last element.\n * \n * @throws NoSuchElementException if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun CharArray.last(): Char {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return this[lastIndex]\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * \n * @throws NoSuchElementException if no such element is found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun Array.last(predicate: (T) -> Boolean): T {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * \n * @throws NoSuchElementException if no such element is found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun ByteArray.last(predicate: (Byte) -> Boolean): Byte {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * \n * @throws NoSuchElementException if no such element is found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun ShortArray.last(predicate: (Short) -> Boolean): Short {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * \n * @throws NoSuchElementException if no such element is found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun IntArray.last(predicate: (Int) -> Boolean): Int {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * \n * @throws NoSuchElementException if no such element is found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun LongArray.last(predicate: (Long) -> Boolean): Long {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * \n * @throws NoSuchElementException if no such element is found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun FloatArray.last(predicate: (Float) -> Boolean): Float {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * \n * @throws NoSuchElementException if no such element is found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun DoubleArray.last(predicate: (Double) -> Boolean): Double {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * \n * @throws NoSuchElementException if no such element is found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun BooleanArray.last(predicate: (Boolean) -> Boolean): Boolean {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * \n * @throws NoSuchElementException if no such element is found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun CharArray.last(predicate: (Char) -> Boolean): Char {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns last index of [element], or -1 if the array does not contain element.\n */\npublic fun <@kotlin.internal.OnlyInputTypes T> Array.lastIndexOf(element: T): Int {\n if (element == null) {\n for (index in indices.reversed()) {\n if (this[index] == null) {\n return index\n }\n }\n } else {\n for (index in indices.reversed()) {\n if (element == this[index]) {\n return index\n }\n }\n }\n return -1\n}\n\n/**\n * Returns last index of [element], or -1 if the array does not contain element.\n */\npublic fun ByteArray.lastIndexOf(element: Byte): Int {\n for (index in indices.reversed()) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns last index of [element], or -1 if the array does not contain element.\n */\npublic fun ShortArray.lastIndexOf(element: Short): Int {\n for (index in indices.reversed()) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns last index of [element], or -1 if the array does not contain element.\n */\npublic fun IntArray.lastIndexOf(element: Int): Int {\n for (index in indices.reversed()) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns last index of [element], or -1 if the array does not contain element.\n */\npublic fun LongArray.lastIndexOf(element: Long): Int {\n for (index in indices.reversed()) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns last index of [element], or -1 if the array does not contain element.\n */\n@Deprecated(\"The function has unclear behavior when searching for NaN or zero values and will be removed soon. Use 'indexOfLast { it == element }' instead to continue using this behavior, or '.asList().lastIndexOf(element: T)' to get the same search behavior as in a list.\", ReplaceWith(\"indexOfLast { it == element }\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.6\")\npublic fun FloatArray.lastIndexOf(element: Float): Int {\n for (index in indices.reversed()) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns last index of [element], or -1 if the array does not contain element.\n */\n@Deprecated(\"The function has unclear behavior when searching for NaN or zero values and will be removed soon. Use 'indexOfLast { it == element }' instead to continue using this behavior, or '.asList().lastIndexOf(element: T)' to get the same search behavior as in a list.\", ReplaceWith(\"indexOfLast { it == element }\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.6\")\npublic fun DoubleArray.lastIndexOf(element: Double): Int {\n for (index in indices.reversed()) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns last index of [element], or -1 if the array does not contain element.\n */\npublic fun BooleanArray.lastIndexOf(element: Boolean): Int {\n for (index in indices.reversed()) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns last index of [element], or -1 if the array does not contain element.\n */\npublic fun CharArray.lastIndexOf(element: Char): Int {\n for (index in indices.reversed()) {\n if (element == this[index]) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns the last element, or `null` if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun Array.lastOrNull(): T? {\n return if (isEmpty()) null else this[size - 1]\n}\n\n/**\n * Returns the last element, or `null` if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun ByteArray.lastOrNull(): Byte? {\n return if (isEmpty()) null else this[size - 1]\n}\n\n/**\n * Returns the last element, or `null` if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun ShortArray.lastOrNull(): Short? {\n return if (isEmpty()) null else this[size - 1]\n}\n\n/**\n * Returns the last element, or `null` if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun IntArray.lastOrNull(): Int? {\n return if (isEmpty()) null else this[size - 1]\n}\n\n/**\n * Returns the last element, or `null` if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun LongArray.lastOrNull(): Long? {\n return if (isEmpty()) null else this[size - 1]\n}\n\n/**\n * Returns the last element, or `null` if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun FloatArray.lastOrNull(): Float? {\n return if (isEmpty()) null else this[size - 1]\n}\n\n/**\n * Returns the last element, or `null` if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun DoubleArray.lastOrNull(): Double? {\n return if (isEmpty()) null else this[size - 1]\n}\n\n/**\n * Returns the last element, or `null` if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun BooleanArray.lastOrNull(): Boolean? {\n return if (isEmpty()) null else this[size - 1]\n}\n\n/**\n * Returns the last element, or `null` if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun CharArray.lastOrNull(): Char? {\n return if (isEmpty()) null else this[size - 1]\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun Array.lastOrNull(predicate: (T) -> Boolean): T? {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun ByteArray.lastOrNull(predicate: (Byte) -> Boolean): Byte? {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun ShortArray.lastOrNull(predicate: (Short) -> Boolean): Short? {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun IntArray.lastOrNull(predicate: (Int) -> Boolean): Int? {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun LongArray.lastOrNull(predicate: (Long) -> Boolean): Long? {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun FloatArray.lastOrNull(predicate: (Float) -> Boolean): Float? {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun DoubleArray.lastOrNull(predicate: (Double) -> Boolean): Double? {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun BooleanArray.lastOrNull(predicate: (Boolean) -> Boolean): Boolean? {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun CharArray.lastOrNull(predicate: (Char) -> Boolean): Char? {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns a random element from this array.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun Array.random(): T {\n return random(Random)\n}\n\n/**\n * Returns a random element from this array.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.random(): Byte {\n return random(Random)\n}\n\n/**\n * Returns a random element from this array.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.random(): Short {\n return random(Random)\n}\n\n/**\n * Returns a random element from this array.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.random(): Int {\n return random(Random)\n}\n\n/**\n * Returns a random element from this array.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.random(): Long {\n return random(Random)\n}\n\n/**\n * Returns a random element from this array.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.random(): Float {\n return random(Random)\n}\n\n/**\n * Returns a random element from this array.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.random(): Double {\n return random(Random)\n}\n\n/**\n * Returns a random element from this array.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.random(): Boolean {\n return random(Random)\n}\n\n/**\n * Returns a random element from this array.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.random(): Char {\n return random(Random)\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun Array.random(random: Random): T {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun ByteArray.random(random: Random): Byte {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun ShortArray.random(random: Random): Short {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun IntArray.random(random: Random): Int {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun LongArray.random(random: Random): Long {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun FloatArray.random(random: Random): Float {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun DoubleArray.random(random: Random): Double {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun BooleanArray.random(random: Random): Boolean {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun CharArray.random(random: Random): Char {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun Array.randomOrNull(): T? {\n return randomOrNull(Random)\n}\n\n/**\n * Returns a random element from this array, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.randomOrNull(): Byte? {\n return randomOrNull(Random)\n}\n\n/**\n * Returns a random element from this array, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.randomOrNull(): Short? {\n return randomOrNull(Random)\n}\n\n/**\n * Returns a random element from this array, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.randomOrNull(): Int? {\n return randomOrNull(Random)\n}\n\n/**\n * Returns a random element from this array, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.randomOrNull(): Long? {\n return randomOrNull(Random)\n}\n\n/**\n * Returns a random element from this array, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.randomOrNull(): Float? {\n return randomOrNull(Random)\n}\n\n/**\n * Returns a random element from this array, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.randomOrNull(): Double? {\n return randomOrNull(Random)\n}\n\n/**\n * Returns a random element from this array, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.randomOrNull(): Boolean? {\n return randomOrNull(Random)\n}\n\n/**\n * Returns a random element from this array, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.randomOrNull(): Char? {\n return randomOrNull(Random)\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun Array.randomOrNull(random: Random): T? {\n if (isEmpty())\n return null\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun ByteArray.randomOrNull(random: Random): Byte? {\n if (isEmpty())\n return null\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun ShortArray.randomOrNull(random: Random): Short? {\n if (isEmpty())\n return null\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun IntArray.randomOrNull(random: Random): Int? {\n if (isEmpty())\n return null\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun LongArray.randomOrNull(random: Random): Long? {\n if (isEmpty())\n return null\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun FloatArray.randomOrNull(random: Random): Float? {\n if (isEmpty())\n return null\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun DoubleArray.randomOrNull(random: Random): Double? {\n if (isEmpty())\n return null\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun BooleanArray.randomOrNull(random: Random): Boolean? {\n if (isEmpty())\n return null\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun CharArray.randomOrNull(random: Random): Char? {\n if (isEmpty())\n return null\n return get(random.nextInt(size))\n}\n\n/**\n * Returns the single element, or throws an exception if the array is empty or has more than one element.\n */\npublic fun Array.single(): T {\n return when (size) {\n 0 -> throw NoSuchElementException(\"Array is empty.\")\n 1 -> this[0]\n else -> throw IllegalArgumentException(\"Array has more than one element.\")\n }\n}\n\n/**\n * Returns the single element, or throws an exception if the array is empty or has more than one element.\n */\npublic fun ByteArray.single(): Byte {\n return when (size) {\n 0 -> throw NoSuchElementException(\"Array is empty.\")\n 1 -> this[0]\n else -> throw IllegalArgumentException(\"Array has more than one element.\")\n }\n}\n\n/**\n * Returns the single element, or throws an exception if the array is empty or has more than one element.\n */\npublic fun ShortArray.single(): Short {\n return when (size) {\n 0 -> throw NoSuchElementException(\"Array is empty.\")\n 1 -> this[0]\n else -> throw IllegalArgumentException(\"Array has more than one element.\")\n }\n}\n\n/**\n * Returns the single element, or throws an exception if the array is empty or has more than one element.\n */\npublic fun IntArray.single(): Int {\n return when (size) {\n 0 -> throw NoSuchElementException(\"Array is empty.\")\n 1 -> this[0]\n else -> throw IllegalArgumentException(\"Array has more than one element.\")\n }\n}\n\n/**\n * Returns the single element, or throws an exception if the array is empty or has more than one element.\n */\npublic fun LongArray.single(): Long {\n return when (size) {\n 0 -> throw NoSuchElementException(\"Array is empty.\")\n 1 -> this[0]\n else -> throw IllegalArgumentException(\"Array has more than one element.\")\n }\n}\n\n/**\n * Returns the single element, or throws an exception if the array is empty or has more than one element.\n */\npublic fun FloatArray.single(): Float {\n return when (size) {\n 0 -> throw NoSuchElementException(\"Array is empty.\")\n 1 -> this[0]\n else -> throw IllegalArgumentException(\"Array has more than one element.\")\n }\n}\n\n/**\n * Returns the single element, or throws an exception if the array is empty or has more than one element.\n */\npublic fun DoubleArray.single(): Double {\n return when (size) {\n 0 -> throw NoSuchElementException(\"Array is empty.\")\n 1 -> this[0]\n else -> throw IllegalArgumentException(\"Array has more than one element.\")\n }\n}\n\n/**\n * Returns the single element, or throws an exception if the array is empty or has more than one element.\n */\npublic fun BooleanArray.single(): Boolean {\n return when (size) {\n 0 -> throw NoSuchElementException(\"Array is empty.\")\n 1 -> this[0]\n else -> throw IllegalArgumentException(\"Array has more than one element.\")\n }\n}\n\n/**\n * Returns the single element, or throws an exception if the array is empty or has more than one element.\n */\npublic fun CharArray.single(): Char {\n return when (size) {\n 0 -> throw NoSuchElementException(\"Array is empty.\")\n 1 -> this[0]\n else -> throw IllegalArgumentException(\"Array has more than one element.\")\n }\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n */\npublic inline fun Array.single(predicate: (T) -> Boolean): T {\n var single: T? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Array contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as T\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n */\npublic inline fun ByteArray.single(predicate: (Byte) -> Boolean): Byte {\n var single: Byte? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Array contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as Byte\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n */\npublic inline fun ShortArray.single(predicate: (Short) -> Boolean): Short {\n var single: Short? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Array contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as Short\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n */\npublic inline fun IntArray.single(predicate: (Int) -> Boolean): Int {\n var single: Int? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Array contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as Int\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n */\npublic inline fun LongArray.single(predicate: (Long) -> Boolean): Long {\n var single: Long? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Array contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as Long\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n */\npublic inline fun FloatArray.single(predicate: (Float) -> Boolean): Float {\n var single: Float? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Array contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as Float\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n */\npublic inline fun DoubleArray.single(predicate: (Double) -> Boolean): Double {\n var single: Double? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Array contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as Double\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n */\npublic inline fun BooleanArray.single(predicate: (Boolean) -> Boolean): Boolean {\n var single: Boolean? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Array contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as Boolean\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n */\npublic inline fun CharArray.single(predicate: (Char) -> Boolean): Char {\n var single: Char? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Array contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as Char\n}\n\n/**\n * Returns single element, or `null` if the array is empty or has more than one element.\n */\npublic fun Array.singleOrNull(): T? {\n return if (size == 1) this[0] else null\n}\n\n/**\n * Returns single element, or `null` if the array is empty or has more than one element.\n */\npublic fun ByteArray.singleOrNull(): Byte? {\n return if (size == 1) this[0] else null\n}\n\n/**\n * Returns single element, or `null` if the array is empty or has more than one element.\n */\npublic fun ShortArray.singleOrNull(): Short? {\n return if (size == 1) this[0] else null\n}\n\n/**\n * Returns single element, or `null` if the array is empty or has more than one element.\n */\npublic fun IntArray.singleOrNull(): Int? {\n return if (size == 1) this[0] else null\n}\n\n/**\n * Returns single element, or `null` if the array is empty or has more than one element.\n */\npublic fun LongArray.singleOrNull(): Long? {\n return if (size == 1) this[0] else null\n}\n\n/**\n * Returns single element, or `null` if the array is empty or has more than one element.\n */\npublic fun FloatArray.singleOrNull(): Float? {\n return if (size == 1) this[0] else null\n}\n\n/**\n * Returns single element, or `null` if the array is empty or has more than one element.\n */\npublic fun DoubleArray.singleOrNull(): Double? {\n return if (size == 1) this[0] else null\n}\n\n/**\n * Returns single element, or `null` if the array is empty or has more than one element.\n */\npublic fun BooleanArray.singleOrNull(): Boolean? {\n return if (size == 1) this[0] else null\n}\n\n/**\n * Returns single element, or `null` if the array is empty or has more than one element.\n */\npublic fun CharArray.singleOrNull(): Char? {\n return if (size == 1) this[0] else null\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n */\npublic inline fun Array.singleOrNull(predicate: (T) -> Boolean): T? {\n var single: T? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n */\npublic inline fun ByteArray.singleOrNull(predicate: (Byte) -> Boolean): Byte? {\n var single: Byte? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n */\npublic inline fun ShortArray.singleOrNull(predicate: (Short) -> Boolean): Short? {\n var single: Short? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n */\npublic inline fun IntArray.singleOrNull(predicate: (Int) -> Boolean): Int? {\n var single: Int? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n */\npublic inline fun LongArray.singleOrNull(predicate: (Long) -> Boolean): Long? {\n var single: Long? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n */\npublic inline fun FloatArray.singleOrNull(predicate: (Float) -> Boolean): Float? {\n var single: Float? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n */\npublic inline fun DoubleArray.singleOrNull(predicate: (Double) -> Boolean): Double? {\n var single: Double? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n */\npublic inline fun BooleanArray.singleOrNull(predicate: (Boolean) -> Boolean): Boolean? {\n var single: Boolean? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n */\npublic inline fun CharArray.singleOrNull(predicate: (Char) -> Boolean): Char? {\n var single: Char? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns a list containing all elements except first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun Array.drop(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return takeLast((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun ByteArray.drop(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return takeLast((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun ShortArray.drop(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return takeLast((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun IntArray.drop(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return takeLast((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun LongArray.drop(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return takeLast((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun FloatArray.drop(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return takeLast((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun DoubleArray.drop(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return takeLast((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun BooleanArray.drop(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return takeLast((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun CharArray.drop(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return takeLast((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun Array.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun ByteArray.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun ShortArray.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun IntArray.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun LongArray.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun FloatArray.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun DoubleArray.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun BooleanArray.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun CharArray.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun Array.dropLastWhile(predicate: (T) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return take(index + 1)\n }\n }\n return emptyList()\n}\n\n/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun ByteArray.dropLastWhile(predicate: (Byte) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return take(index + 1)\n }\n }\n return emptyList()\n}\n\n/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun ShortArray.dropLastWhile(predicate: (Short) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return take(index + 1)\n }\n }\n return emptyList()\n}\n\n/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun IntArray.dropLastWhile(predicate: (Int) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return take(index + 1)\n }\n }\n return emptyList()\n}\n\n/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun LongArray.dropLastWhile(predicate: (Long) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return take(index + 1)\n }\n }\n return emptyList()\n}\n\n/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun FloatArray.dropLastWhile(predicate: (Float) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return take(index + 1)\n }\n }\n return emptyList()\n}\n\n/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun DoubleArray.dropLastWhile(predicate: (Double) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return take(index + 1)\n }\n }\n return emptyList()\n}\n\n/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun BooleanArray.dropLastWhile(predicate: (Boolean) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return take(index + 1)\n }\n }\n return emptyList()\n}\n\n/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun CharArray.dropLastWhile(predicate: (Char) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return take(index + 1)\n }\n }\n return emptyList()\n}\n\n/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun Array.dropWhile(predicate: (T) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun ByteArray.dropWhile(predicate: (Byte) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun ShortArray.dropWhile(predicate: (Short) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun IntArray.dropWhile(predicate: (Int) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun LongArray.dropWhile(predicate: (Long) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun FloatArray.dropWhile(predicate: (Float) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun DoubleArray.dropWhile(predicate: (Double) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun BooleanArray.dropWhile(predicate: (Boolean) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun CharArray.dropWhile(predicate: (Char) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\npublic inline fun Array.filter(predicate: (T) -> Boolean): List {\n return filterTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\npublic inline fun ByteArray.filter(predicate: (Byte) -> Boolean): List {\n return filterTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\npublic inline fun ShortArray.filter(predicate: (Short) -> Boolean): List {\n return filterTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\npublic inline fun IntArray.filter(predicate: (Int) -> Boolean): List {\n return filterTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\npublic inline fun LongArray.filter(predicate: (Long) -> Boolean): List {\n return filterTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\npublic inline fun FloatArray.filter(predicate: (Float) -> Boolean): List {\n return filterTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\npublic inline fun DoubleArray.filter(predicate: (Double) -> Boolean): List {\n return filterTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\npublic inline fun BooleanArray.filter(predicate: (Boolean) -> Boolean): List {\n return filterTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\npublic inline fun CharArray.filter(predicate: (Char) -> Boolean): List {\n return filterTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexed\n */\npublic inline fun Array.filterIndexed(predicate: (index: Int, T) -> Boolean): List {\n return filterIndexedTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexed\n */\npublic inline fun ByteArray.filterIndexed(predicate: (index: Int, Byte) -> Boolean): List {\n return filterIndexedTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexed\n */\npublic inline fun ShortArray.filterIndexed(predicate: (index: Int, Short) -> Boolean): List {\n return filterIndexedTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexed\n */\npublic inline fun IntArray.filterIndexed(predicate: (index: Int, Int) -> Boolean): List {\n return filterIndexedTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexed\n */\npublic inline fun LongArray.filterIndexed(predicate: (index: Int, Long) -> Boolean): List {\n return filterIndexedTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexed\n */\npublic inline fun FloatArray.filterIndexed(predicate: (index: Int, Float) -> Boolean): List {\n return filterIndexedTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexed\n */\npublic inline fun DoubleArray.filterIndexed(predicate: (index: Int, Double) -> Boolean): List {\n return filterIndexedTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexed\n */\npublic inline fun BooleanArray.filterIndexed(predicate: (index: Int, Boolean) -> Boolean): List {\n return filterIndexedTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexed\n */\npublic inline fun CharArray.filterIndexed(predicate: (index: Int, Char) -> Boolean): List {\n return filterIndexedTo(ArrayList(), predicate)\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexedTo\n */\npublic inline fun > Array.filterIndexedTo(destination: C, predicate: (index: Int, T) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexedTo\n */\npublic inline fun > ByteArray.filterIndexedTo(destination: C, predicate: (index: Int, Byte) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexedTo\n */\npublic inline fun > ShortArray.filterIndexedTo(destination: C, predicate: (index: Int, Short) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexedTo\n */\npublic inline fun > IntArray.filterIndexedTo(destination: C, predicate: (index: Int, Int) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexedTo\n */\npublic inline fun > LongArray.filterIndexedTo(destination: C, predicate: (index: Int, Long) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexedTo\n */\npublic inline fun > FloatArray.filterIndexedTo(destination: C, predicate: (index: Int, Float) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexedTo\n */\npublic inline fun > DoubleArray.filterIndexedTo(destination: C, predicate: (index: Int, Double) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexedTo\n */\npublic inline fun > BooleanArray.filterIndexedTo(destination: C, predicate: (index: Int, Boolean) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexedTo\n */\npublic inline fun > CharArray.filterIndexedTo(destination: C, predicate: (index: Int, Char) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Returns a list containing all elements that are instances of specified type parameter R.\n * \n * @sample samples.collections.Collections.Filtering.filterIsInstance\n */\npublic inline fun Array<*>.filterIsInstance(): List<@kotlin.internal.NoInfer R> {\n return filterIsInstanceTo(ArrayList())\n}\n\n/**\n * Appends all elements that are instances of specified type parameter R to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterIsInstanceTo\n */\npublic inline fun > Array<*>.filterIsInstanceTo(destination: C): C {\n for (element in this) if (element is R) destination.add(element)\n return destination\n}\n\n/**\n * Returns a list containing all elements not matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\npublic inline fun Array.filterNot(predicate: (T) -> Boolean): List {\n return filterNotTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing all elements not matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\npublic inline fun ByteArray.filterNot(predicate: (Byte) -> Boolean): List {\n return filterNotTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing all elements not matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\npublic inline fun ShortArray.filterNot(predicate: (Short) -> Boolean): List {\n return filterNotTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing all elements not matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\npublic inline fun IntArray.filterNot(predicate: (Int) -> Boolean): List {\n return filterNotTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing all elements not matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\npublic inline fun LongArray.filterNot(predicate: (Long) -> Boolean): List {\n return filterNotTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing all elements not matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\npublic inline fun FloatArray.filterNot(predicate: (Float) -> Boolean): List {\n return filterNotTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing all elements not matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\npublic inline fun DoubleArray.filterNot(predicate: (Double) -> Boolean): List {\n return filterNotTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing all elements not matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\npublic inline fun BooleanArray.filterNot(predicate: (Boolean) -> Boolean): List {\n return filterNotTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing all elements not matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\npublic inline fun CharArray.filterNot(predicate: (Char) -> Boolean): List {\n return filterNotTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing all elements that are not `null`.\n * \n * @sample samples.collections.Collections.Filtering.filterNotNull\n */\npublic fun Array.filterNotNull(): List {\n return filterNotNullTo(ArrayList())\n}\n\n/**\n * Appends all elements that are not `null` to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterNotNullTo\n */\npublic fun , T : Any> Array.filterNotNullTo(destination: C): C {\n for (element in this) if (element != null) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun > Array.filterNotTo(destination: C, predicate: (T) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun > ByteArray.filterNotTo(destination: C, predicate: (Byte) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun > ShortArray.filterNotTo(destination: C, predicate: (Short) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun > IntArray.filterNotTo(destination: C, predicate: (Int) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun > LongArray.filterNotTo(destination: C, predicate: (Long) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun > FloatArray.filterNotTo(destination: C, predicate: (Float) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun > DoubleArray.filterNotTo(destination: C, predicate: (Double) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun > BooleanArray.filterNotTo(destination: C, predicate: (Boolean) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun > CharArray.filterNotTo(destination: C, predicate: (Char) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun > Array.filterTo(destination: C, predicate: (T) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun > ByteArray.filterTo(destination: C, predicate: (Byte) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun > ShortArray.filterTo(destination: C, predicate: (Short) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun > IntArray.filterTo(destination: C, predicate: (Int) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun > LongArray.filterTo(destination: C, predicate: (Long) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun > FloatArray.filterTo(destination: C, predicate: (Float) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun > DoubleArray.filterTo(destination: C, predicate: (Double) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun > BooleanArray.filterTo(destination: C, predicate: (Boolean) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun > CharArray.filterTo(destination: C, predicate: (Char) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Returns a list containing elements at indices in the specified [indices] range.\n */\npublic fun Array.slice(indices: IntRange): List {\n if (indices.isEmpty()) return listOf()\n return copyOfRange(indices.start, indices.endInclusive + 1).asList()\n}\n\n/**\n * Returns a list containing elements at indices in the specified [indices] range.\n */\npublic fun ByteArray.slice(indices: IntRange): List {\n if (indices.isEmpty()) return listOf()\n return copyOfRange(indices.start, indices.endInclusive + 1).asList()\n}\n\n/**\n * Returns a list containing elements at indices in the specified [indices] range.\n */\npublic fun ShortArray.slice(indices: IntRange): List {\n if (indices.isEmpty()) return listOf()\n return copyOfRange(indices.start, indices.endInclusive + 1).asList()\n}\n\n/**\n * Returns a list containing elements at indices in the specified [indices] range.\n */\npublic fun IntArray.slice(indices: IntRange): List {\n if (indices.isEmpty()) return listOf()\n return copyOfRange(indices.start, indices.endInclusive + 1).asList()\n}\n\n/**\n * Returns a list containing elements at indices in the specified [indices] range.\n */\npublic fun LongArray.slice(indices: IntRange): List {\n if (indices.isEmpty()) return listOf()\n return copyOfRange(indices.start, indices.endInclusive + 1).asList()\n}\n\n/**\n * Returns a list containing elements at indices in the specified [indices] range.\n */\npublic fun FloatArray.slice(indices: IntRange): List {\n if (indices.isEmpty()) return listOf()\n return copyOfRange(indices.start, indices.endInclusive + 1).asList()\n}\n\n/**\n * Returns a list containing elements at indices in the specified [indices] range.\n */\npublic fun DoubleArray.slice(indices: IntRange): List {\n if (indices.isEmpty()) return listOf()\n return copyOfRange(indices.start, indices.endInclusive + 1).asList()\n}\n\n/**\n * Returns a list containing elements at indices in the specified [indices] range.\n */\npublic fun BooleanArray.slice(indices: IntRange): List {\n if (indices.isEmpty()) return listOf()\n return copyOfRange(indices.start, indices.endInclusive + 1).asList()\n}\n\n/**\n * Returns a list containing elements at indices in the specified [indices] range.\n */\npublic fun CharArray.slice(indices: IntRange): List {\n if (indices.isEmpty()) return listOf()\n return copyOfRange(indices.start, indices.endInclusive + 1).asList()\n}\n\n/**\n * Returns a list containing elements at specified [indices].\n */\npublic fun Array.slice(indices: Iterable): List {\n val size = indices.collectionSizeOrDefault(10)\n if (size == 0) return emptyList()\n val list = ArrayList(size)\n for (index in indices) {\n list.add(get(index))\n }\n return list\n}\n\n/**\n * Returns a list containing elements at specified [indices].\n */\npublic fun ByteArray.slice(indices: Iterable): List {\n val size = indices.collectionSizeOrDefault(10)\n if (size == 0) return emptyList()\n val list = ArrayList(size)\n for (index in indices) {\n list.add(get(index))\n }\n return list\n}\n\n/**\n * Returns a list containing elements at specified [indices].\n */\npublic fun ShortArray.slice(indices: Iterable): List {\n val size = indices.collectionSizeOrDefault(10)\n if (size == 0) return emptyList()\n val list = ArrayList(size)\n for (index in indices) {\n list.add(get(index))\n }\n return list\n}\n\n/**\n * Returns a list containing elements at specified [indices].\n */\npublic fun IntArray.slice(indices: Iterable): List {\n val size = indices.collectionSizeOrDefault(10)\n if (size == 0) return emptyList()\n val list = ArrayList(size)\n for (index in indices) {\n list.add(get(index))\n }\n return list\n}\n\n/**\n * Returns a list containing elements at specified [indices].\n */\npublic fun LongArray.slice(indices: Iterable): List {\n val size = indices.collectionSizeOrDefault(10)\n if (size == 0) return emptyList()\n val list = ArrayList(size)\n for (index in indices) {\n list.add(get(index))\n }\n return list\n}\n\n/**\n * Returns a list containing elements at specified [indices].\n */\npublic fun FloatArray.slice(indices: Iterable): List {\n val size = indices.collectionSizeOrDefault(10)\n if (size == 0) return emptyList()\n val list = ArrayList(size)\n for (index in indices) {\n list.add(get(index))\n }\n return list\n}\n\n/**\n * Returns a list containing elements at specified [indices].\n */\npublic fun DoubleArray.slice(indices: Iterable): List {\n val size = indices.collectionSizeOrDefault(10)\n if (size == 0) return emptyList()\n val list = ArrayList(size)\n for (index in indices) {\n list.add(get(index))\n }\n return list\n}\n\n/**\n * Returns a list containing elements at specified [indices].\n */\npublic fun BooleanArray.slice(indices: Iterable): List {\n val size = indices.collectionSizeOrDefault(10)\n if (size == 0) return emptyList()\n val list = ArrayList(size)\n for (index in indices) {\n list.add(get(index))\n }\n return list\n}\n\n/**\n * Returns a list containing elements at specified [indices].\n */\npublic fun CharArray.slice(indices: Iterable): List {\n val size = indices.collectionSizeOrDefault(10)\n if (size == 0) return emptyList()\n val list = ArrayList(size)\n for (index in indices) {\n list.add(get(index))\n }\n return list\n}\n\n/**\n * Returns an array containing elements of this array at specified [indices].\n */\npublic fun Array.sliceArray(indices: Collection): Array {\n val result = arrayOfNulls(this, indices.size)\n var targetIndex = 0\n for (sourceIndex in indices) {\n result[targetIndex++] = this[sourceIndex]\n }\n return result\n}\n\n/**\n * Returns an array containing elements of this array at specified [indices].\n */\npublic fun ByteArray.sliceArray(indices: Collection): ByteArray {\n val result = ByteArray(indices.size)\n var targetIndex = 0\n for (sourceIndex in indices) {\n result[targetIndex++] = this[sourceIndex]\n }\n return result\n}\n\n/**\n * Returns an array containing elements of this array at specified [indices].\n */\npublic fun ShortArray.sliceArray(indices: Collection): ShortArray {\n val result = ShortArray(indices.size)\n var targetIndex = 0\n for (sourceIndex in indices) {\n result[targetIndex++] = this[sourceIndex]\n }\n return result\n}\n\n/**\n * Returns an array containing elements of this array at specified [indices].\n */\npublic fun IntArray.sliceArray(indices: Collection): IntArray {\n val result = IntArray(indices.size)\n var targetIndex = 0\n for (sourceIndex in indices) {\n result[targetIndex++] = this[sourceIndex]\n }\n return result\n}\n\n/**\n * Returns an array containing elements of this array at specified [indices].\n */\npublic fun LongArray.sliceArray(indices: Collection): LongArray {\n val result = LongArray(indices.size)\n var targetIndex = 0\n for (sourceIndex in indices) {\n result[targetIndex++] = this[sourceIndex]\n }\n return result\n}\n\n/**\n * Returns an array containing elements of this array at specified [indices].\n */\npublic fun FloatArray.sliceArray(indices: Collection): FloatArray {\n val result = FloatArray(indices.size)\n var targetIndex = 0\n for (sourceIndex in indices) {\n result[targetIndex++] = this[sourceIndex]\n }\n return result\n}\n\n/**\n * Returns an array containing elements of this array at specified [indices].\n */\npublic fun DoubleArray.sliceArray(indices: Collection): DoubleArray {\n val result = DoubleArray(indices.size)\n var targetIndex = 0\n for (sourceIndex in indices) {\n result[targetIndex++] = this[sourceIndex]\n }\n return result\n}\n\n/**\n * Returns an array containing elements of this array at specified [indices].\n */\npublic fun BooleanArray.sliceArray(indices: Collection): BooleanArray {\n val result = BooleanArray(indices.size)\n var targetIndex = 0\n for (sourceIndex in indices) {\n result[targetIndex++] = this[sourceIndex]\n }\n return result\n}\n\n/**\n * Returns an array containing elements of this array at specified [indices].\n */\npublic fun CharArray.sliceArray(indices: Collection): CharArray {\n val result = CharArray(indices.size)\n var targetIndex = 0\n for (sourceIndex in indices) {\n result[targetIndex++] = this[sourceIndex]\n }\n return result\n}\n\n/**\n * Returns an array containing elements at indices in the specified [indices] range.\n */\npublic fun Array.sliceArray(indices: IntRange): Array {\n if (indices.isEmpty()) return copyOfRange(0, 0)\n return copyOfRange(indices.start, indices.endInclusive + 1)\n}\n\n/**\n * Returns an array containing elements at indices in the specified [indices] range.\n */\npublic fun ByteArray.sliceArray(indices: IntRange): ByteArray {\n if (indices.isEmpty()) return ByteArray(0)\n return copyOfRange(indices.start, indices.endInclusive + 1)\n}\n\n/**\n * Returns an array containing elements at indices in the specified [indices] range.\n */\npublic fun ShortArray.sliceArray(indices: IntRange): ShortArray {\n if (indices.isEmpty()) return ShortArray(0)\n return copyOfRange(indices.start, indices.endInclusive + 1)\n}\n\n/**\n * Returns an array containing elements at indices in the specified [indices] range.\n */\npublic fun IntArray.sliceArray(indices: IntRange): IntArray {\n if (indices.isEmpty()) return IntArray(0)\n return copyOfRange(indices.start, indices.endInclusive + 1)\n}\n\n/**\n * Returns an array containing elements at indices in the specified [indices] range.\n */\npublic fun LongArray.sliceArray(indices: IntRange): LongArray {\n if (indices.isEmpty()) return LongArray(0)\n return copyOfRange(indices.start, indices.endInclusive + 1)\n}\n\n/**\n * Returns an array containing elements at indices in the specified [indices] range.\n */\npublic fun FloatArray.sliceArray(indices: IntRange): FloatArray {\n if (indices.isEmpty()) return FloatArray(0)\n return copyOfRange(indices.start, indices.endInclusive + 1)\n}\n\n/**\n * Returns an array containing elements at indices in the specified [indices] range.\n */\npublic fun DoubleArray.sliceArray(indices: IntRange): DoubleArray {\n if (indices.isEmpty()) return DoubleArray(0)\n return copyOfRange(indices.start, indices.endInclusive + 1)\n}\n\n/**\n * Returns an array containing elements at indices in the specified [indices] range.\n */\npublic fun BooleanArray.sliceArray(indices: IntRange): BooleanArray {\n if (indices.isEmpty()) return BooleanArray(0)\n return copyOfRange(indices.start, indices.endInclusive + 1)\n}\n\n/**\n * Returns an array containing elements at indices in the specified [indices] range.\n */\npublic fun CharArray.sliceArray(indices: IntRange): CharArray {\n if (indices.isEmpty()) return CharArray(0)\n return copyOfRange(indices.start, indices.endInclusive + 1)\n}\n\n/**\n * Returns a list containing first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun Array.take(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n if (n >= size) return toList()\n if (n == 1) return listOf(this[0])\n var count = 0\n val list = ArrayList(n)\n for (item in this) {\n list.add(item)\n if (++count == n)\n break\n }\n return list\n}\n\n/**\n * Returns a list containing first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun ByteArray.take(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n if (n >= size) return toList()\n if (n == 1) return listOf(this[0])\n var count = 0\n val list = ArrayList(n)\n for (item in this) {\n list.add(item)\n if (++count == n)\n break\n }\n return list\n}\n\n/**\n * Returns a list containing first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun ShortArray.take(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n if (n >= size) return toList()\n if (n == 1) return listOf(this[0])\n var count = 0\n val list = ArrayList(n)\n for (item in this) {\n list.add(item)\n if (++count == n)\n break\n }\n return list\n}\n\n/**\n * Returns a list containing first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun IntArray.take(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n if (n >= size) return toList()\n if (n == 1) return listOf(this[0])\n var count = 0\n val list = ArrayList(n)\n for (item in this) {\n list.add(item)\n if (++count == n)\n break\n }\n return list\n}\n\n/**\n * Returns a list containing first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun LongArray.take(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n if (n >= size) return toList()\n if (n == 1) return listOf(this[0])\n var count = 0\n val list = ArrayList(n)\n for (item in this) {\n list.add(item)\n if (++count == n)\n break\n }\n return list\n}\n\n/**\n * Returns a list containing first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun FloatArray.take(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n if (n >= size) return toList()\n if (n == 1) return listOf(this[0])\n var count = 0\n val list = ArrayList(n)\n for (item in this) {\n list.add(item)\n if (++count == n)\n break\n }\n return list\n}\n\n/**\n * Returns a list containing first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun DoubleArray.take(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n if (n >= size) return toList()\n if (n == 1) return listOf(this[0])\n var count = 0\n val list = ArrayList(n)\n for (item in this) {\n list.add(item)\n if (++count == n)\n break\n }\n return list\n}\n\n/**\n * Returns a list containing first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun BooleanArray.take(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n if (n >= size) return toList()\n if (n == 1) return listOf(this[0])\n var count = 0\n val list = ArrayList(n)\n for (item in this) {\n list.add(item)\n if (++count == n)\n break\n }\n return list\n}\n\n/**\n * Returns a list containing first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun CharArray.take(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n if (n >= size) return toList()\n if (n == 1) return listOf(this[0])\n var count = 0\n val list = ArrayList(n)\n for (item in this) {\n list.add(item)\n if (++count == n)\n break\n }\n return list\n}\n\n/**\n * Returns a list containing last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun Array.takeLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n val size = size\n if (n >= size) return toList()\n if (n == 1) return listOf(this[size - 1])\n val list = ArrayList(n)\n for (index in size - n until size)\n list.add(this[index])\n return list\n}\n\n/**\n * Returns a list containing last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun ByteArray.takeLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n val size = size\n if (n >= size) return toList()\n if (n == 1) return listOf(this[size - 1])\n val list = ArrayList(n)\n for (index in size - n until size)\n list.add(this[index])\n return list\n}\n\n/**\n * Returns a list containing last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun ShortArray.takeLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n val size = size\n if (n >= size) return toList()\n if (n == 1) return listOf(this[size - 1])\n val list = ArrayList(n)\n for (index in size - n until size)\n list.add(this[index])\n return list\n}\n\n/**\n * Returns a list containing last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun IntArray.takeLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n val size = size\n if (n >= size) return toList()\n if (n == 1) return listOf(this[size - 1])\n val list = ArrayList(n)\n for (index in size - n until size)\n list.add(this[index])\n return list\n}\n\n/**\n * Returns a list containing last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun LongArray.takeLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n val size = size\n if (n >= size) return toList()\n if (n == 1) return listOf(this[size - 1])\n val list = ArrayList(n)\n for (index in size - n until size)\n list.add(this[index])\n return list\n}\n\n/**\n * Returns a list containing last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun FloatArray.takeLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n val size = size\n if (n >= size) return toList()\n if (n == 1) return listOf(this[size - 1])\n val list = ArrayList(n)\n for (index in size - n until size)\n list.add(this[index])\n return list\n}\n\n/**\n * Returns a list containing last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun DoubleArray.takeLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n val size = size\n if (n >= size) return toList()\n if (n == 1) return listOf(this[size - 1])\n val list = ArrayList(n)\n for (index in size - n until size)\n list.add(this[index])\n return list\n}\n\n/**\n * Returns a list containing last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun BooleanArray.takeLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n val size = size\n if (n >= size) return toList()\n if (n == 1) return listOf(this[size - 1])\n val list = ArrayList(n)\n for (index in size - n until size)\n list.add(this[index])\n return list\n}\n\n/**\n * Returns a list containing last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun CharArray.takeLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n val size = size\n if (n >= size) return toList()\n if (n == 1) return listOf(this[size - 1])\n val list = ArrayList(n)\n for (index in size - n until size)\n list.add(this[index])\n return list\n}\n\n/**\n * Returns a list containing last elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic inline fun Array.takeLastWhile(predicate: (T) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return drop(index + 1)\n }\n }\n return toList()\n}\n\n/**\n * Returns a list containing last elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic inline fun ByteArray.takeLastWhile(predicate: (Byte) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return drop(index + 1)\n }\n }\n return toList()\n}\n\n/**\n * Returns a list containing last elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic inline fun ShortArray.takeLastWhile(predicate: (Short) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return drop(index + 1)\n }\n }\n return toList()\n}\n\n/**\n * Returns a list containing last elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic inline fun IntArray.takeLastWhile(predicate: (Int) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return drop(index + 1)\n }\n }\n return toList()\n}\n\n/**\n * Returns a list containing last elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic inline fun LongArray.takeLastWhile(predicate: (Long) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return drop(index + 1)\n }\n }\n return toList()\n}\n\n/**\n * Returns a list containing last elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic inline fun FloatArray.takeLastWhile(predicate: (Float) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return drop(index + 1)\n }\n }\n return toList()\n}\n\n/**\n * Returns a list containing last elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic inline fun DoubleArray.takeLastWhile(predicate: (Double) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return drop(index + 1)\n }\n }\n return toList()\n}\n\n/**\n * Returns a list containing last elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic inline fun BooleanArray.takeLastWhile(predicate: (Boolean) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return drop(index + 1)\n }\n }\n return toList()\n}\n\n/**\n * Returns a list containing last elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic inline fun CharArray.takeLastWhile(predicate: (Char) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return drop(index + 1)\n }\n }\n return toList()\n}\n\n/**\n * Returns a list containing first elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic inline fun Array.takeWhile(predicate: (T) -> Boolean): List {\n val list = ArrayList()\n for (item in this) {\n if (!predicate(item))\n break\n list.add(item)\n }\n return list\n}\n\n/**\n * Returns a list containing first elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic inline fun ByteArray.takeWhile(predicate: (Byte) -> Boolean): List {\n val list = ArrayList()\n for (item in this) {\n if (!predicate(item))\n break\n list.add(item)\n }\n return list\n}\n\n/**\n * Returns a list containing first elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic inline fun ShortArray.takeWhile(predicate: (Short) -> Boolean): List {\n val list = ArrayList()\n for (item in this) {\n if (!predicate(item))\n break\n list.add(item)\n }\n return list\n}\n\n/**\n * Returns a list containing first elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic inline fun IntArray.takeWhile(predicate: (Int) -> Boolean): List {\n val list = ArrayList()\n for (item in this) {\n if (!predicate(item))\n break\n list.add(item)\n }\n return list\n}\n\n/**\n * Returns a list containing first elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic inline fun LongArray.takeWhile(predicate: (Long) -> Boolean): List {\n val list = ArrayList()\n for (item in this) {\n if (!predicate(item))\n break\n list.add(item)\n }\n return list\n}\n\n/**\n * Returns a list containing first elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic inline fun FloatArray.takeWhile(predicate: (Float) -> Boolean): List {\n val list = ArrayList()\n for (item in this) {\n if (!predicate(item))\n break\n list.add(item)\n }\n return list\n}\n\n/**\n * Returns a list containing first elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic inline fun DoubleArray.takeWhile(predicate: (Double) -> Boolean): List {\n val list = ArrayList()\n for (item in this) {\n if (!predicate(item))\n break\n list.add(item)\n }\n return list\n}\n\n/**\n * Returns a list containing first elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic inline fun BooleanArray.takeWhile(predicate: (Boolean) -> Boolean): List {\n val list = ArrayList()\n for (item in this) {\n if (!predicate(item))\n break\n list.add(item)\n }\n return list\n}\n\n/**\n * Returns a list containing first elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic inline fun CharArray.takeWhile(predicate: (Char) -> Boolean): List {\n val list = ArrayList()\n for (item in this) {\n if (!predicate(item))\n break\n list.add(item)\n }\n return list\n}\n\n/**\n * Reverses elements in the array in-place.\n */\npublic fun Array.reverse(): Unit {\n val midPoint = (size / 2) - 1\n if (midPoint < 0) return\n var reverseIndex = lastIndex\n for (index in 0..midPoint) {\n val tmp = this[index]\n this[index] = this[reverseIndex]\n this[reverseIndex] = tmp\n reverseIndex--\n }\n}\n\n/**\n * Reverses elements in the array in-place.\n */\npublic fun ByteArray.reverse(): Unit {\n val midPoint = (size / 2) - 1\n if (midPoint < 0) return\n var reverseIndex = lastIndex\n for (index in 0..midPoint) {\n val tmp = this[index]\n this[index] = this[reverseIndex]\n this[reverseIndex] = tmp\n reverseIndex--\n }\n}\n\n/**\n * Reverses elements in the array in-place.\n */\npublic fun ShortArray.reverse(): Unit {\n val midPoint = (size / 2) - 1\n if (midPoint < 0) return\n var reverseIndex = lastIndex\n for (index in 0..midPoint) {\n val tmp = this[index]\n this[index] = this[reverseIndex]\n this[reverseIndex] = tmp\n reverseIndex--\n }\n}\n\n/**\n * Reverses elements in the array in-place.\n */\npublic fun IntArray.reverse(): Unit {\n val midPoint = (size / 2) - 1\n if (midPoint < 0) return\n var reverseIndex = lastIndex\n for (index in 0..midPoint) {\n val tmp = this[index]\n this[index] = this[reverseIndex]\n this[reverseIndex] = tmp\n reverseIndex--\n }\n}\n\n/**\n * Reverses elements in the array in-place.\n */\npublic fun LongArray.reverse(): Unit {\n val midPoint = (size / 2) - 1\n if (midPoint < 0) return\n var reverseIndex = lastIndex\n for (index in 0..midPoint) {\n val tmp = this[index]\n this[index] = this[reverseIndex]\n this[reverseIndex] = tmp\n reverseIndex--\n }\n}\n\n/**\n * Reverses elements in the array in-place.\n */\npublic fun FloatArray.reverse(): Unit {\n val midPoint = (size / 2) - 1\n if (midPoint < 0) return\n var reverseIndex = lastIndex\n for (index in 0..midPoint) {\n val tmp = this[index]\n this[index] = this[reverseIndex]\n this[reverseIndex] = tmp\n reverseIndex--\n }\n}\n\n/**\n * Reverses elements in the array in-place.\n */\npublic fun DoubleArray.reverse(): Unit {\n val midPoint = (size / 2) - 1\n if (midPoint < 0) return\n var reverseIndex = lastIndex\n for (index in 0..midPoint) {\n val tmp = this[index]\n this[index] = this[reverseIndex]\n this[reverseIndex] = tmp\n reverseIndex--\n }\n}\n\n/**\n * Reverses elements in the array in-place.\n */\npublic fun BooleanArray.reverse(): Unit {\n val midPoint = (size / 2) - 1\n if (midPoint < 0) return\n var reverseIndex = lastIndex\n for (index in 0..midPoint) {\n val tmp = this[index]\n this[index] = this[reverseIndex]\n this[reverseIndex] = tmp\n reverseIndex--\n }\n}\n\n/**\n * Reverses elements in the array in-place.\n */\npublic fun CharArray.reverse(): Unit {\n val midPoint = (size / 2) - 1\n if (midPoint < 0) return\n var reverseIndex = lastIndex\n for (index in 0..midPoint) {\n val tmp = this[index]\n this[index] = this[reverseIndex]\n this[reverseIndex] = tmp\n reverseIndex--\n }\n}\n\n/**\n * Reverses elements of the array in the specified range in-place.\n * \n * @param fromIndex the start of the range (inclusive) to reverse.\n * @param toIndex the end of the range (exclusive) to reverse.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\npublic fun Array.reverse(fromIndex: Int, toIndex: Int): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n val midPoint = (fromIndex + toIndex) / 2\n if (fromIndex == midPoint) return\n var reverseIndex = toIndex - 1\n for (index in fromIndex until midPoint) {\n val tmp = this[index]\n this[index] = this[reverseIndex]\n this[reverseIndex] = tmp\n reverseIndex--\n }\n}\n\n/**\n * Reverses elements of the array in the specified range in-place.\n * \n * @param fromIndex the start of the range (inclusive) to reverse.\n * @param toIndex the end of the range (exclusive) to reverse.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\npublic fun ByteArray.reverse(fromIndex: Int, toIndex: Int): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n val midPoint = (fromIndex + toIndex) / 2\n if (fromIndex == midPoint) return\n var reverseIndex = toIndex - 1\n for (index in fromIndex until midPoint) {\n val tmp = this[index]\n this[index] = this[reverseIndex]\n this[reverseIndex] = tmp\n reverseIndex--\n }\n}\n\n/**\n * Reverses elements of the array in the specified range in-place.\n * \n * @param fromIndex the start of the range (inclusive) to reverse.\n * @param toIndex the end of the range (exclusive) to reverse.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\npublic fun ShortArray.reverse(fromIndex: Int, toIndex: Int): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n val midPoint = (fromIndex + toIndex) / 2\n if (fromIndex == midPoint) return\n var reverseIndex = toIndex - 1\n for (index in fromIndex until midPoint) {\n val tmp = this[index]\n this[index] = this[reverseIndex]\n this[reverseIndex] = tmp\n reverseIndex--\n }\n}\n\n/**\n * Reverses elements of the array in the specified range in-place.\n * \n * @param fromIndex the start of the range (inclusive) to reverse.\n * @param toIndex the end of the range (exclusive) to reverse.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\npublic fun IntArray.reverse(fromIndex: Int, toIndex: Int): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n val midPoint = (fromIndex + toIndex) / 2\n if (fromIndex == midPoint) return\n var reverseIndex = toIndex - 1\n for (index in fromIndex until midPoint) {\n val tmp = this[index]\n this[index] = this[reverseIndex]\n this[reverseIndex] = tmp\n reverseIndex--\n }\n}\n\n/**\n * Reverses elements of the array in the specified range in-place.\n * \n * @param fromIndex the start of the range (inclusive) to reverse.\n * @param toIndex the end of the range (exclusive) to reverse.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\npublic fun LongArray.reverse(fromIndex: Int, toIndex: Int): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n val midPoint = (fromIndex + toIndex) / 2\n if (fromIndex == midPoint) return\n var reverseIndex = toIndex - 1\n for (index in fromIndex until midPoint) {\n val tmp = this[index]\n this[index] = this[reverseIndex]\n this[reverseIndex] = tmp\n reverseIndex--\n }\n}\n\n/**\n * Reverses elements of the array in the specified range in-place.\n * \n * @param fromIndex the start of the range (inclusive) to reverse.\n * @param toIndex the end of the range (exclusive) to reverse.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\npublic fun FloatArray.reverse(fromIndex: Int, toIndex: Int): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n val midPoint = (fromIndex + toIndex) / 2\n if (fromIndex == midPoint) return\n var reverseIndex = toIndex - 1\n for (index in fromIndex until midPoint) {\n val tmp = this[index]\n this[index] = this[reverseIndex]\n this[reverseIndex] = tmp\n reverseIndex--\n }\n}\n\n/**\n * Reverses elements of the array in the specified range in-place.\n * \n * @param fromIndex the start of the range (inclusive) to reverse.\n * @param toIndex the end of the range (exclusive) to reverse.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\npublic fun DoubleArray.reverse(fromIndex: Int, toIndex: Int): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n val midPoint = (fromIndex + toIndex) / 2\n if (fromIndex == midPoint) return\n var reverseIndex = toIndex - 1\n for (index in fromIndex until midPoint) {\n val tmp = this[index]\n this[index] = this[reverseIndex]\n this[reverseIndex] = tmp\n reverseIndex--\n }\n}\n\n/**\n * Reverses elements of the array in the specified range in-place.\n * \n * @param fromIndex the start of the range (inclusive) to reverse.\n * @param toIndex the end of the range (exclusive) to reverse.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\npublic fun BooleanArray.reverse(fromIndex: Int, toIndex: Int): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n val midPoint = (fromIndex + toIndex) / 2\n if (fromIndex == midPoint) return\n var reverseIndex = toIndex - 1\n for (index in fromIndex until midPoint) {\n val tmp = this[index]\n this[index] = this[reverseIndex]\n this[reverseIndex] = tmp\n reverseIndex--\n }\n}\n\n/**\n * Reverses elements of the array in the specified range in-place.\n * \n * @param fromIndex the start of the range (inclusive) to reverse.\n * @param toIndex the end of the range (exclusive) to reverse.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\npublic fun CharArray.reverse(fromIndex: Int, toIndex: Int): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n val midPoint = (fromIndex + toIndex) / 2\n if (fromIndex == midPoint) return\n var reverseIndex = toIndex - 1\n for (index in fromIndex until midPoint) {\n val tmp = this[index]\n this[index] = this[reverseIndex]\n this[reverseIndex] = tmp\n reverseIndex--\n }\n}\n\n/**\n * Returns a list with elements in reversed order.\n */\npublic fun Array.reversed(): List {\n if (isEmpty()) return emptyList()\n val list = toMutableList()\n list.reverse()\n return list\n}\n\n/**\n * Returns a list with elements in reversed order.\n */\npublic fun ByteArray.reversed(): List {\n if (isEmpty()) return emptyList()\n val list = toMutableList()\n list.reverse()\n return list\n}\n\n/**\n * Returns a list with elements in reversed order.\n */\npublic fun ShortArray.reversed(): List {\n if (isEmpty()) return emptyList()\n val list = toMutableList()\n list.reverse()\n return list\n}\n\n/**\n * Returns a list with elements in reversed order.\n */\npublic fun IntArray.reversed(): List {\n if (isEmpty()) return emptyList()\n val list = toMutableList()\n list.reverse()\n return list\n}\n\n/**\n * Returns a list with elements in reversed order.\n */\npublic fun LongArray.reversed(): List {\n if (isEmpty()) return emptyList()\n val list = toMutableList()\n list.reverse()\n return list\n}\n\n/**\n * Returns a list with elements in reversed order.\n */\npublic fun FloatArray.reversed(): List {\n if (isEmpty()) return emptyList()\n val list = toMutableList()\n list.reverse()\n return list\n}\n\n/**\n * Returns a list with elements in reversed order.\n */\npublic fun DoubleArray.reversed(): List {\n if (isEmpty()) return emptyList()\n val list = toMutableList()\n list.reverse()\n return list\n}\n\n/**\n * Returns a list with elements in reversed order.\n */\npublic fun BooleanArray.reversed(): List {\n if (isEmpty()) return emptyList()\n val list = toMutableList()\n list.reverse()\n return list\n}\n\n/**\n * Returns a list with elements in reversed order.\n */\npublic fun CharArray.reversed(): List {\n if (isEmpty()) return emptyList()\n val list = toMutableList()\n list.reverse()\n return list\n}\n\n/**\n * Returns an array with elements of this array in reversed order.\n */\npublic fun Array.reversedArray(): Array {\n if (isEmpty()) return this\n val result = arrayOfNulls(this, size)\n val lastIndex = lastIndex\n for (i in 0..lastIndex)\n result[lastIndex - i] = this[i]\n return result\n}\n\n/**\n * Returns an array with elements of this array in reversed order.\n */\npublic fun ByteArray.reversedArray(): ByteArray {\n if (isEmpty()) return this\n val result = ByteArray(size)\n val lastIndex = lastIndex\n for (i in 0..lastIndex)\n result[lastIndex - i] = this[i]\n return result\n}\n\n/**\n * Returns an array with elements of this array in reversed order.\n */\npublic fun ShortArray.reversedArray(): ShortArray {\n if (isEmpty()) return this\n val result = ShortArray(size)\n val lastIndex = lastIndex\n for (i in 0..lastIndex)\n result[lastIndex - i] = this[i]\n return result\n}\n\n/**\n * Returns an array with elements of this array in reversed order.\n */\npublic fun IntArray.reversedArray(): IntArray {\n if (isEmpty()) return this\n val result = IntArray(size)\n val lastIndex = lastIndex\n for (i in 0..lastIndex)\n result[lastIndex - i] = this[i]\n return result\n}\n\n/**\n * Returns an array with elements of this array in reversed order.\n */\npublic fun LongArray.reversedArray(): LongArray {\n if (isEmpty()) return this\n val result = LongArray(size)\n val lastIndex = lastIndex\n for (i in 0..lastIndex)\n result[lastIndex - i] = this[i]\n return result\n}\n\n/**\n * Returns an array with elements of this array in reversed order.\n */\npublic fun FloatArray.reversedArray(): FloatArray {\n if (isEmpty()) return this\n val result = FloatArray(size)\n val lastIndex = lastIndex\n for (i in 0..lastIndex)\n result[lastIndex - i] = this[i]\n return result\n}\n\n/**\n * Returns an array with elements of this array in reversed order.\n */\npublic fun DoubleArray.reversedArray(): DoubleArray {\n if (isEmpty()) return this\n val result = DoubleArray(size)\n val lastIndex = lastIndex\n for (i in 0..lastIndex)\n result[lastIndex - i] = this[i]\n return result\n}\n\n/**\n * Returns an array with elements of this array in reversed order.\n */\npublic fun BooleanArray.reversedArray(): BooleanArray {\n if (isEmpty()) return this\n val result = BooleanArray(size)\n val lastIndex = lastIndex\n for (i in 0..lastIndex)\n result[lastIndex - i] = this[i]\n return result\n}\n\n/**\n * Returns an array with elements of this array in reversed order.\n */\npublic fun CharArray.reversedArray(): CharArray {\n if (isEmpty()) return this\n val result = CharArray(size)\n val lastIndex = lastIndex\n for (i in 0..lastIndex)\n result[lastIndex - i] = this[i]\n return result\n}\n\n/**\n * Randomly shuffles elements in this array in-place.\n */\n@SinceKotlin(\"1.4\")\npublic fun Array.shuffle(): Unit {\n shuffle(Random)\n}\n\n/**\n * Randomly shuffles elements in this array in-place.\n */\n@SinceKotlin(\"1.4\")\npublic fun ByteArray.shuffle(): Unit {\n shuffle(Random)\n}\n\n/**\n * Randomly shuffles elements in this array in-place.\n */\n@SinceKotlin(\"1.4\")\npublic fun ShortArray.shuffle(): Unit {\n shuffle(Random)\n}\n\n/**\n * Randomly shuffles elements in this array in-place.\n */\n@SinceKotlin(\"1.4\")\npublic fun IntArray.shuffle(): Unit {\n shuffle(Random)\n}\n\n/**\n * Randomly shuffles elements in this array in-place.\n */\n@SinceKotlin(\"1.4\")\npublic fun LongArray.shuffle(): Unit {\n shuffle(Random)\n}\n\n/**\n * Randomly shuffles elements in this array in-place.\n */\n@SinceKotlin(\"1.4\")\npublic fun FloatArray.shuffle(): Unit {\n shuffle(Random)\n}\n\n/**\n * Randomly shuffles elements in this array in-place.\n */\n@SinceKotlin(\"1.4\")\npublic fun DoubleArray.shuffle(): Unit {\n shuffle(Random)\n}\n\n/**\n * Randomly shuffles elements in this array in-place.\n */\n@SinceKotlin(\"1.4\")\npublic fun BooleanArray.shuffle(): Unit {\n shuffle(Random)\n}\n\n/**\n * Randomly shuffles elements in this array in-place.\n */\n@SinceKotlin(\"1.4\")\npublic fun CharArray.shuffle(): Unit {\n shuffle(Random)\n}\n\n/**\n * Randomly shuffles elements in this array in-place using the specified [random] instance as the source of randomness.\n * \n * See: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm\n */\n@SinceKotlin(\"1.4\")\npublic fun Array.shuffle(random: Random): Unit {\n for (i in lastIndex downTo 1) {\n val j = random.nextInt(i + 1)\n val copy = this[i]\n this[i] = this[j]\n this[j] = copy\n }\n}\n\n/**\n * Randomly shuffles elements in this array in-place using the specified [random] instance as the source of randomness.\n * \n * See: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm\n */\n@SinceKotlin(\"1.4\")\npublic fun ByteArray.shuffle(random: Random): Unit {\n for (i in lastIndex downTo 1) {\n val j = random.nextInt(i + 1)\n val copy = this[i]\n this[i] = this[j]\n this[j] = copy\n }\n}\n\n/**\n * Randomly shuffles elements in this array in-place using the specified [random] instance as the source of randomness.\n * \n * See: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm\n */\n@SinceKotlin(\"1.4\")\npublic fun ShortArray.shuffle(random: Random): Unit {\n for (i in lastIndex downTo 1) {\n val j = random.nextInt(i + 1)\n val copy = this[i]\n this[i] = this[j]\n this[j] = copy\n }\n}\n\n/**\n * Randomly shuffles elements in this array in-place using the specified [random] instance as the source of randomness.\n * \n * See: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm\n */\n@SinceKotlin(\"1.4\")\npublic fun IntArray.shuffle(random: Random): Unit {\n for (i in lastIndex downTo 1) {\n val j = random.nextInt(i + 1)\n val copy = this[i]\n this[i] = this[j]\n this[j] = copy\n }\n}\n\n/**\n * Randomly shuffles elements in this array in-place using the specified [random] instance as the source of randomness.\n * \n * See: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm\n */\n@SinceKotlin(\"1.4\")\npublic fun LongArray.shuffle(random: Random): Unit {\n for (i in lastIndex downTo 1) {\n val j = random.nextInt(i + 1)\n val copy = this[i]\n this[i] = this[j]\n this[j] = copy\n }\n}\n\n/**\n * Randomly shuffles elements in this array in-place using the specified [random] instance as the source of randomness.\n * \n * See: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm\n */\n@SinceKotlin(\"1.4\")\npublic fun FloatArray.shuffle(random: Random): Unit {\n for (i in lastIndex downTo 1) {\n val j = random.nextInt(i + 1)\n val copy = this[i]\n this[i] = this[j]\n this[j] = copy\n }\n}\n\n/**\n * Randomly shuffles elements in this array in-place using the specified [random] instance as the source of randomness.\n * \n * See: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm\n */\n@SinceKotlin(\"1.4\")\npublic fun DoubleArray.shuffle(random: Random): Unit {\n for (i in lastIndex downTo 1) {\n val j = random.nextInt(i + 1)\n val copy = this[i]\n this[i] = this[j]\n this[j] = copy\n }\n}\n\n/**\n * Randomly shuffles elements in this array in-place using the specified [random] instance as the source of randomness.\n * \n * See: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm\n */\n@SinceKotlin(\"1.4\")\npublic fun BooleanArray.shuffle(random: Random): Unit {\n for (i in lastIndex downTo 1) {\n val j = random.nextInt(i + 1)\n val copy = this[i]\n this[i] = this[j]\n this[j] = copy\n }\n}\n\n/**\n * Randomly shuffles elements in this array in-place using the specified [random] instance as the source of randomness.\n * \n * See: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm\n */\n@SinceKotlin(\"1.4\")\npublic fun CharArray.shuffle(random: Random): Unit {\n for (i in lastIndex downTo 1) {\n val j = random.nextInt(i + 1)\n val copy = this[i]\n this[i] = this[j]\n this[j] = copy\n }\n}\n\n/**\n * Sorts elements in the array in-place according to natural sort order of the value returned by specified [selector] function.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic inline fun > Array.sortBy(crossinline selector: (T) -> R?): Unit {\n if (size > 1) sortWith(compareBy(selector))\n}\n\n/**\n * Sorts elements in the array in-place descending according to natural sort order of the value returned by specified [selector] function.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic inline fun > Array.sortByDescending(crossinline selector: (T) -> R?): Unit {\n if (size > 1) sortWith(compareByDescending(selector))\n}\n\n/**\n * Sorts elements in the array in-place descending according to their natural sort order.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic fun > Array.sortDescending(): Unit {\n sortWith(reverseOrder())\n}\n\n/**\n * Sorts elements in the array in-place descending according to their natural sort order.\n */\npublic fun ByteArray.sortDescending(): Unit {\n if (size > 1) {\n sort()\n reverse()\n }\n}\n\n/**\n * Sorts elements in the array in-place descending according to their natural sort order.\n */\npublic fun ShortArray.sortDescending(): Unit {\n if (size > 1) {\n sort()\n reverse()\n }\n}\n\n/**\n * Sorts elements in the array in-place descending according to their natural sort order.\n */\npublic fun IntArray.sortDescending(): Unit {\n if (size > 1) {\n sort()\n reverse()\n }\n}\n\n/**\n * Sorts elements in the array in-place descending according to their natural sort order.\n */\npublic fun LongArray.sortDescending(): Unit {\n if (size > 1) {\n sort()\n reverse()\n }\n}\n\n/**\n * Sorts elements in the array in-place descending according to their natural sort order.\n */\npublic fun FloatArray.sortDescending(): Unit {\n if (size > 1) {\n sort()\n reverse()\n }\n}\n\n/**\n * Sorts elements in the array in-place descending according to their natural sort order.\n */\npublic fun DoubleArray.sortDescending(): Unit {\n if (size > 1) {\n sort()\n reverse()\n }\n}\n\n/**\n * Sorts elements in the array in-place descending according to their natural sort order.\n */\npublic fun CharArray.sortDescending(): Unit {\n if (size > 1) {\n sort()\n reverse()\n }\n}\n\n/**\n * Returns a list of all elements sorted according to their natural sort order.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic fun > Array.sorted(): List {\n return sortedArray().asList()\n}\n\n/**\n * Returns a list of all elements sorted according to their natural sort order.\n */\npublic fun ByteArray.sorted(): List {\n return toTypedArray().apply { sort() }.asList()\n}\n\n/**\n * Returns a list of all elements sorted according to their natural sort order.\n */\npublic fun ShortArray.sorted(): List {\n return toTypedArray().apply { sort() }.asList()\n}\n\n/**\n * Returns a list of all elements sorted according to their natural sort order.\n */\npublic fun IntArray.sorted(): List {\n return toTypedArray().apply { sort() }.asList()\n}\n\n/**\n * Returns a list of all elements sorted according to their natural sort order.\n */\npublic fun LongArray.sorted(): List {\n return toTypedArray().apply { sort() }.asList()\n}\n\n/**\n * Returns a list of all elements sorted according to their natural sort order.\n */\npublic fun FloatArray.sorted(): List {\n return toTypedArray().apply { sort() }.asList()\n}\n\n/**\n * Returns a list of all elements sorted according to their natural sort order.\n */\npublic fun DoubleArray.sorted(): List {\n return toTypedArray().apply { sort() }.asList()\n}\n\n/**\n * Returns a list of all elements sorted according to their natural sort order.\n */\npublic fun CharArray.sorted(): List {\n return toTypedArray().apply { sort() }.asList()\n}\n\n/**\n * Returns an array with all elements of this array sorted according to their natural sort order.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic fun > Array.sortedArray(): Array {\n if (isEmpty()) return this\n return this.copyOf().apply { sort() }\n}\n\n/**\n * Returns an array with all elements of this array sorted according to their natural sort order.\n */\npublic fun ByteArray.sortedArray(): ByteArray {\n if (isEmpty()) return this\n return this.copyOf().apply { sort() }\n}\n\n/**\n * Returns an array with all elements of this array sorted according to their natural sort order.\n */\npublic fun ShortArray.sortedArray(): ShortArray {\n if (isEmpty()) return this\n return this.copyOf().apply { sort() }\n}\n\n/**\n * Returns an array with all elements of this array sorted according to their natural sort order.\n */\npublic fun IntArray.sortedArray(): IntArray {\n if (isEmpty()) return this\n return this.copyOf().apply { sort() }\n}\n\n/**\n * Returns an array with all elements of this array sorted according to their natural sort order.\n */\npublic fun LongArray.sortedArray(): LongArray {\n if (isEmpty()) return this\n return this.copyOf().apply { sort() }\n}\n\n/**\n * Returns an array with all elements of this array sorted according to their natural sort order.\n */\npublic fun FloatArray.sortedArray(): FloatArray {\n if (isEmpty()) return this\n return this.copyOf().apply { sort() }\n}\n\n/**\n * Returns an array with all elements of this array sorted according to their natural sort order.\n */\npublic fun DoubleArray.sortedArray(): DoubleArray {\n if (isEmpty()) return this\n return this.copyOf().apply { sort() }\n}\n\n/**\n * Returns an array with all elements of this array sorted according to their natural sort order.\n */\npublic fun CharArray.sortedArray(): CharArray {\n if (isEmpty()) return this\n return this.copyOf().apply { sort() }\n}\n\n/**\n * Returns an array with all elements of this array sorted descending according to their natural sort order.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic fun > Array.sortedArrayDescending(): Array {\n if (isEmpty()) return this\n return this.copyOf().apply { sortWith(reverseOrder()) }\n}\n\n/**\n * Returns an array with all elements of this array sorted descending according to their natural sort order.\n */\npublic fun ByteArray.sortedArrayDescending(): ByteArray {\n if (isEmpty()) return this\n return this.copyOf().apply { sortDescending() }\n}\n\n/**\n * Returns an array with all elements of this array sorted descending according to their natural sort order.\n */\npublic fun ShortArray.sortedArrayDescending(): ShortArray {\n if (isEmpty()) return this\n return this.copyOf().apply { sortDescending() }\n}\n\n/**\n * Returns an array with all elements of this array sorted descending according to their natural sort order.\n */\npublic fun IntArray.sortedArrayDescending(): IntArray {\n if (isEmpty()) return this\n return this.copyOf().apply { sortDescending() }\n}\n\n/**\n * Returns an array with all elements of this array sorted descending according to their natural sort order.\n */\npublic fun LongArray.sortedArrayDescending(): LongArray {\n if (isEmpty()) return this\n return this.copyOf().apply { sortDescending() }\n}\n\n/**\n * Returns an array with all elements of this array sorted descending according to their natural sort order.\n */\npublic fun FloatArray.sortedArrayDescending(): FloatArray {\n if (isEmpty()) return this\n return this.copyOf().apply { sortDescending() }\n}\n\n/**\n * Returns an array with all elements of this array sorted descending according to their natural sort order.\n */\npublic fun DoubleArray.sortedArrayDescending(): DoubleArray {\n if (isEmpty()) return this\n return this.copyOf().apply { sortDescending() }\n}\n\n/**\n * Returns an array with all elements of this array sorted descending according to their natural sort order.\n */\npublic fun CharArray.sortedArrayDescending(): CharArray {\n if (isEmpty()) return this\n return this.copyOf().apply { sortDescending() }\n}\n\n/**\n * Returns an array with all elements of this array sorted according the specified [comparator].\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic fun Array.sortedArrayWith(comparator: Comparator): Array {\n if (isEmpty()) return this\n return this.copyOf().apply { sortWith(comparator) }\n}\n\n/**\n * Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n * \n * @sample samples.collections.Collections.Sorting.sortedBy\n */\npublic inline fun > Array.sortedBy(crossinline selector: (T) -> R?): List {\n return sortedWith(compareBy(selector))\n}\n\n/**\n * Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.\n * \n * @sample samples.collections.Collections.Sorting.sortedBy\n */\npublic inline fun > ByteArray.sortedBy(crossinline selector: (Byte) -> R?): List {\n return sortedWith(compareBy(selector))\n}\n\n/**\n * Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.\n * \n * @sample samples.collections.Collections.Sorting.sortedBy\n */\npublic inline fun > ShortArray.sortedBy(crossinline selector: (Short) -> R?): List {\n return sortedWith(compareBy(selector))\n}\n\n/**\n * Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.\n * \n * @sample samples.collections.Collections.Sorting.sortedBy\n */\npublic inline fun > IntArray.sortedBy(crossinline selector: (Int) -> R?): List {\n return sortedWith(compareBy(selector))\n}\n\n/**\n * Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.\n * \n * @sample samples.collections.Collections.Sorting.sortedBy\n */\npublic inline fun > LongArray.sortedBy(crossinline selector: (Long) -> R?): List {\n return sortedWith(compareBy(selector))\n}\n\n/**\n * Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.\n * \n * @sample samples.collections.Collections.Sorting.sortedBy\n */\npublic inline fun > FloatArray.sortedBy(crossinline selector: (Float) -> R?): List {\n return sortedWith(compareBy(selector))\n}\n\n/**\n * Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.\n * \n * @sample samples.collections.Collections.Sorting.sortedBy\n */\npublic inline fun > DoubleArray.sortedBy(crossinline selector: (Double) -> R?): List {\n return sortedWith(compareBy(selector))\n}\n\n/**\n * Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.\n * \n * @sample samples.collections.Collections.Sorting.sortedBy\n */\npublic inline fun > BooleanArray.sortedBy(crossinline selector: (Boolean) -> R?): List {\n return sortedWith(compareBy(selector))\n}\n\n/**\n * Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.\n * \n * @sample samples.collections.Collections.Sorting.sortedBy\n */\npublic inline fun > CharArray.sortedBy(crossinline selector: (Char) -> R?): List {\n return sortedWith(compareBy(selector))\n}\n\n/**\n * Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic inline fun > Array.sortedByDescending(crossinline selector: (T) -> R?): List {\n return sortedWith(compareByDescending(selector))\n}\n\n/**\n * Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function.\n */\npublic inline fun > ByteArray.sortedByDescending(crossinline selector: (Byte) -> R?): List {\n return sortedWith(compareByDescending(selector))\n}\n\n/**\n * Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function.\n */\npublic inline fun > ShortArray.sortedByDescending(crossinline selector: (Short) -> R?): List {\n return sortedWith(compareByDescending(selector))\n}\n\n/**\n * Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function.\n */\npublic inline fun > IntArray.sortedByDescending(crossinline selector: (Int) -> R?): List {\n return sortedWith(compareByDescending(selector))\n}\n\n/**\n * Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function.\n */\npublic inline fun > LongArray.sortedByDescending(crossinline selector: (Long) -> R?): List {\n return sortedWith(compareByDescending(selector))\n}\n\n/**\n * Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function.\n */\npublic inline fun > FloatArray.sortedByDescending(crossinline selector: (Float) -> R?): List {\n return sortedWith(compareByDescending(selector))\n}\n\n/**\n * Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function.\n */\npublic inline fun > DoubleArray.sortedByDescending(crossinline selector: (Double) -> R?): List {\n return sortedWith(compareByDescending(selector))\n}\n\n/**\n * Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function.\n */\npublic inline fun > BooleanArray.sortedByDescending(crossinline selector: (Boolean) -> R?): List {\n return sortedWith(compareByDescending(selector))\n}\n\n/**\n * Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function.\n */\npublic inline fun > CharArray.sortedByDescending(crossinline selector: (Char) -> R?): List {\n return sortedWith(compareByDescending(selector))\n}\n\n/**\n * Returns a list of all elements sorted descending according to their natural sort order.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic fun > Array.sortedDescending(): List {\n return sortedWith(reverseOrder())\n}\n\n/**\n * Returns a list of all elements sorted descending according to their natural sort order.\n */\npublic fun ByteArray.sortedDescending(): List {\n return copyOf().apply { sort() }.reversed()\n}\n\n/**\n * Returns a list of all elements sorted descending according to their natural sort order.\n */\npublic fun ShortArray.sortedDescending(): List {\n return copyOf().apply { sort() }.reversed()\n}\n\n/**\n * Returns a list of all elements sorted descending according to their natural sort order.\n */\npublic fun IntArray.sortedDescending(): List {\n return copyOf().apply { sort() }.reversed()\n}\n\n/**\n * Returns a list of all elements sorted descending according to their natural sort order.\n */\npublic fun LongArray.sortedDescending(): List {\n return copyOf().apply { sort() }.reversed()\n}\n\n/**\n * Returns a list of all elements sorted descending according to their natural sort order.\n */\npublic fun FloatArray.sortedDescending(): List {\n return copyOf().apply { sort() }.reversed()\n}\n\n/**\n * Returns a list of all elements sorted descending according to their natural sort order.\n */\npublic fun DoubleArray.sortedDescending(): List {\n return copyOf().apply { sort() }.reversed()\n}\n\n/**\n * Returns a list of all elements sorted descending according to their natural sort order.\n */\npublic fun CharArray.sortedDescending(): List {\n return copyOf().apply { sort() }.reversed()\n}\n\n/**\n * Returns a list of all elements sorted according to the specified [comparator].\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic fun Array.sortedWith(comparator: Comparator): List {\n return sortedArrayWith(comparator).asList()\n}\n\n/**\n * Returns a list of all elements sorted according to the specified [comparator].\n */\npublic fun ByteArray.sortedWith(comparator: Comparator): List {\n return toTypedArray().apply { sortWith(comparator) }.asList()\n}\n\n/**\n * Returns a list of all elements sorted according to the specified [comparator].\n */\npublic fun ShortArray.sortedWith(comparator: Comparator): List {\n return toTypedArray().apply { sortWith(comparator) }.asList()\n}\n\n/**\n * Returns a list of all elements sorted according to the specified [comparator].\n */\npublic fun IntArray.sortedWith(comparator: Comparator): List {\n return toTypedArray().apply { sortWith(comparator) }.asList()\n}\n\n/**\n * Returns a list of all elements sorted according to the specified [comparator].\n */\npublic fun LongArray.sortedWith(comparator: Comparator): List {\n return toTypedArray().apply { sortWith(comparator) }.asList()\n}\n\n/**\n * Returns a list of all elements sorted according to the specified [comparator].\n */\npublic fun FloatArray.sortedWith(comparator: Comparator): List {\n return toTypedArray().apply { sortWith(comparator) }.asList()\n}\n\n/**\n * Returns a list of all elements sorted according to the specified [comparator].\n */\npublic fun DoubleArray.sortedWith(comparator: Comparator): List {\n return toTypedArray().apply { sortWith(comparator) }.asList()\n}\n\n/**\n * Returns a list of all elements sorted according to the specified [comparator].\n */\npublic fun BooleanArray.sortedWith(comparator: Comparator): List {\n return toTypedArray().apply { sortWith(comparator) }.asList()\n}\n\n/**\n * Returns a list of all elements sorted according to the specified [comparator].\n */\npublic fun CharArray.sortedWith(comparator: Comparator): List {\n return toTypedArray().apply { sortWith(comparator) }.asList()\n}\n\n/**\n * Returns a [List] that wraps the original array.\n */\npublic expect fun Array.asList(): List\n\n/**\n * Returns a [List] that wraps the original array.\n */\npublic expect fun ByteArray.asList(): List\n\n/**\n * Returns a [List] that wraps the original array.\n */\npublic expect fun ShortArray.asList(): List\n\n/**\n * Returns a [List] that wraps the original array.\n */\npublic expect fun IntArray.asList(): List\n\n/**\n * Returns a [List] that wraps the original array.\n */\npublic expect fun LongArray.asList(): List\n\n/**\n * Returns a [List] that wraps the original array.\n */\npublic expect fun FloatArray.asList(): List\n\n/**\n * Returns a [List] that wraps the original array.\n */\npublic expect fun DoubleArray.asList(): List\n\n/**\n * Returns a [List] that wraps the original array.\n */\npublic expect fun BooleanArray.asList(): List\n\n/**\n * Returns a [List] that wraps the original array.\n */\npublic expect fun CharArray.asList(): List\n\n/**\n * Returns `true` if the two specified arrays are *deeply* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * If two corresponding elements are nested arrays, they are also compared deeply.\n * If any of arrays contains itself on any nesting level the behavior is undefined.\n * \n * The elements of other types are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.LowPriorityInOverloadResolution\npublic expect infix fun Array.contentDeepEquals(other: Array): Boolean\n\n/**\n * Returns `true` if the two specified arrays are *deeply* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The specified arrays are also considered deeply equal if both are `null`.\n * \n * If two corresponding elements are nested arrays, they are also compared deeply.\n * If any of arrays contains itself on any nesting level the behavior is undefined.\n * \n * The elements of other types are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.4\")\npublic expect infix fun Array?.contentDeepEquals(other: Array?): Boolean\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n * Nested arrays are treated as lists too.\n * \n * If any of arrays contains itself on any nesting level the behavior is undefined.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.LowPriorityInOverloadResolution\npublic expect fun Array.contentDeepHashCode(): Int\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n * Nested arrays are treated as lists too.\n * \n * If any of arrays contains itself on any nesting level the behavior is undefined.\n */\n@SinceKotlin(\"1.4\")\npublic expect fun Array?.contentDeepHashCode(): Int\n\n/**\n * Returns a string representation of the contents of this array as if it is a [List].\n * Nested arrays are treated as lists too.\n * \n * If any of arrays contains itself on any nesting level that reference\n * is rendered as `\"[...]\"` to prevent recursion.\n * \n * @sample samples.collections.Arrays.ContentOperations.contentDeepToString\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.LowPriorityInOverloadResolution\npublic expect fun Array.contentDeepToString(): String\n\n/**\n * Returns a string representation of the contents of this array as if it is a [List].\n * Nested arrays are treated as lists too.\n * \n * If any of arrays contains itself on any nesting level that reference\n * is rendered as `\"[...]\"` to prevent recursion.\n * \n * @sample samples.collections.Arrays.ContentOperations.contentDeepToString\n */\n@SinceKotlin(\"1.4\")\npublic expect fun Array?.contentDeepToString(): String\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect infix fun Array.contentEquals(other: Array): Boolean\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect infix fun ByteArray.contentEquals(other: ByteArray): Boolean\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect infix fun ShortArray.contentEquals(other: ShortArray): Boolean\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect infix fun IntArray.contentEquals(other: IntArray): Boolean\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect infix fun LongArray.contentEquals(other: LongArray): Boolean\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect infix fun FloatArray.contentEquals(other: FloatArray): Boolean\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect infix fun DoubleArray.contentEquals(other: DoubleArray): Boolean\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect infix fun BooleanArray.contentEquals(other: BooleanArray): Boolean\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect infix fun CharArray.contentEquals(other: CharArray): Boolean\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.4\")\npublic expect infix fun Array?.contentEquals(other: Array?): Boolean\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.4\")\npublic expect infix fun ByteArray?.contentEquals(other: ByteArray?): Boolean\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.4\")\npublic expect infix fun ShortArray?.contentEquals(other: ShortArray?): Boolean\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.4\")\npublic expect infix fun IntArray?.contentEquals(other: IntArray?): Boolean\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.4\")\npublic expect infix fun LongArray?.contentEquals(other: LongArray?): Boolean\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.4\")\npublic expect infix fun FloatArray?.contentEquals(other: FloatArray?): Boolean\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.4\")\npublic expect infix fun DoubleArray?.contentEquals(other: DoubleArray?): Boolean\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.4\")\npublic expect infix fun BooleanArray?.contentEquals(other: BooleanArray?): Boolean\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.4\")\npublic expect infix fun CharArray?.contentEquals(other: CharArray?): Boolean\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect fun Array.contentHashCode(): Int\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect fun ByteArray.contentHashCode(): Int\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect fun ShortArray.contentHashCode(): Int\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect fun IntArray.contentHashCode(): Int\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect fun LongArray.contentHashCode(): Int\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect fun FloatArray.contentHashCode(): Int\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect fun DoubleArray.contentHashCode(): Int\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect fun BooleanArray.contentHashCode(): Int\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect fun CharArray.contentHashCode(): Int\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.4\")\npublic expect fun Array?.contentHashCode(): Int\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.4\")\npublic expect fun ByteArray?.contentHashCode(): Int\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.4\")\npublic expect fun ShortArray?.contentHashCode(): Int\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.4\")\npublic expect fun IntArray?.contentHashCode(): Int\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.4\")\npublic expect fun LongArray?.contentHashCode(): Int\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.4\")\npublic expect fun FloatArray?.contentHashCode(): Int\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.4\")\npublic expect fun DoubleArray?.contentHashCode(): Int\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.4\")\npublic expect fun BooleanArray?.contentHashCode(): Int\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.4\")\npublic expect fun CharArray?.contentHashCode(): Int\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect fun Array.contentToString(): String\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect fun ByteArray.contentToString(): String\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect fun ShortArray.contentToString(): String\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect fun IntArray.contentToString(): String\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect fun LongArray.contentToString(): String\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect fun FloatArray.contentToString(): String\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect fun DoubleArray.contentToString(): String\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect fun BooleanArray.contentToString(): String\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic expect fun CharArray.contentToString(): String\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.4\")\npublic expect fun Array?.contentToString(): String\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.4\")\npublic expect fun ByteArray?.contentToString(): String\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.4\")\npublic expect fun ShortArray?.contentToString(): String\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.4\")\npublic expect fun IntArray?.contentToString(): String\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.4\")\npublic expect fun LongArray?.contentToString(): String\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.4\")\npublic expect fun FloatArray?.contentToString(): String\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.4\")\npublic expect fun DoubleArray?.contentToString(): String\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.4\")\npublic expect fun BooleanArray?.contentToString(): String\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.4\")\npublic expect fun CharArray?.contentToString(): String\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\npublic expect fun Array.copyInto(destination: Array, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): Array\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\npublic expect fun ByteArray.copyInto(destination: ByteArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): ByteArray\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\npublic expect fun ShortArray.copyInto(destination: ShortArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): ShortArray\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\npublic expect fun IntArray.copyInto(destination: IntArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): IntArray\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\npublic expect fun LongArray.copyInto(destination: LongArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): LongArray\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\npublic expect fun FloatArray.copyInto(destination: FloatArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): FloatArray\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\npublic expect fun DoubleArray.copyInto(destination: DoubleArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): DoubleArray\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\npublic expect fun BooleanArray.copyInto(destination: BooleanArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): BooleanArray\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\npublic expect fun CharArray.copyInto(destination: CharArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): CharArray\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\n@Suppress(\"NO_ACTUAL_FOR_EXPECT\")\npublic expect fun Array.copyOf(): Array\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\npublic expect fun ByteArray.copyOf(): ByteArray\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\npublic expect fun ShortArray.copyOf(): ShortArray\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\npublic expect fun IntArray.copyOf(): IntArray\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\npublic expect fun LongArray.copyOf(): LongArray\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\npublic expect fun FloatArray.copyOf(): FloatArray\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\npublic expect fun DoubleArray.copyOf(): DoubleArray\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\npublic expect fun BooleanArray.copyOf(): BooleanArray\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\npublic expect fun CharArray.copyOf(): CharArray\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with zero values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf\n */\npublic expect fun ByteArray.copyOf(newSize: Int): ByteArray\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with zero values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf\n */\npublic expect fun ShortArray.copyOf(newSize: Int): ShortArray\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with zero values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf\n */\npublic expect fun IntArray.copyOf(newSize: Int): IntArray\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with zero values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf\n */\npublic expect fun LongArray.copyOf(newSize: Int): LongArray\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with zero values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf\n */\npublic expect fun FloatArray.copyOf(newSize: Int): FloatArray\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with zero values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf\n */\npublic expect fun DoubleArray.copyOf(newSize: Int): DoubleArray\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with `false` values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with `false` values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf\n */\npublic expect fun BooleanArray.copyOf(newSize: Int): BooleanArray\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with null char (`\\u0000`) values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with null char (`\\u0000`) values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf\n */\npublic expect fun CharArray.copyOf(newSize: Int): CharArray\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with `null` values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with `null` values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizingCopyOf\n */\n@Suppress(\"NO_ACTUAL_FOR_EXPECT\")\npublic expect fun Array.copyOf(newSize: Int): Array\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive) to copy.\n * @param toIndex the end of the range (exclusive) to copy.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@Suppress(\"NO_ACTUAL_FOR_EXPECT\")\npublic expect fun Array.copyOfRange(fromIndex: Int, toIndex: Int): Array\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive) to copy.\n * @param toIndex the end of the range (exclusive) to copy.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\npublic expect fun ByteArray.copyOfRange(fromIndex: Int, toIndex: Int): ByteArray\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive) to copy.\n * @param toIndex the end of the range (exclusive) to copy.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\npublic expect fun ShortArray.copyOfRange(fromIndex: Int, toIndex: Int): ShortArray\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive) to copy.\n * @param toIndex the end of the range (exclusive) to copy.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\npublic expect fun IntArray.copyOfRange(fromIndex: Int, toIndex: Int): IntArray\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive) to copy.\n * @param toIndex the end of the range (exclusive) to copy.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\npublic expect fun LongArray.copyOfRange(fromIndex: Int, toIndex: Int): LongArray\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive) to copy.\n * @param toIndex the end of the range (exclusive) to copy.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\npublic expect fun FloatArray.copyOfRange(fromIndex: Int, toIndex: Int): FloatArray\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive) to copy.\n * @param toIndex the end of the range (exclusive) to copy.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\npublic expect fun DoubleArray.copyOfRange(fromIndex: Int, toIndex: Int): DoubleArray\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive) to copy.\n * @param toIndex the end of the range (exclusive) to copy.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\npublic expect fun BooleanArray.copyOfRange(fromIndex: Int, toIndex: Int): BooleanArray\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive) to copy.\n * @param toIndex the end of the range (exclusive) to copy.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\npublic expect fun CharArray.copyOfRange(fromIndex: Int, toIndex: Int): CharArray\n\n/**\n * Fills this array or its subrange with the specified [element] value.\n * \n * @param fromIndex the start of the range (inclusive) to fill, 0 by default.\n * @param toIndex the end of the range (exclusive) to fill, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\npublic expect fun Array.fill(element: T, fromIndex: Int = 0, toIndex: Int = size): Unit\n\n/**\n * Fills this array or its subrange with the specified [element] value.\n * \n * @param fromIndex the start of the range (inclusive) to fill, 0 by default.\n * @param toIndex the end of the range (exclusive) to fill, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\npublic expect fun ByteArray.fill(element: Byte, fromIndex: Int = 0, toIndex: Int = size): Unit\n\n/**\n * Fills this array or its subrange with the specified [element] value.\n * \n * @param fromIndex the start of the range (inclusive) to fill, 0 by default.\n * @param toIndex the end of the range (exclusive) to fill, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\npublic expect fun ShortArray.fill(element: Short, fromIndex: Int = 0, toIndex: Int = size): Unit\n\n/**\n * Fills this array or its subrange with the specified [element] value.\n * \n * @param fromIndex the start of the range (inclusive) to fill, 0 by default.\n * @param toIndex the end of the range (exclusive) to fill, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\npublic expect fun IntArray.fill(element: Int, fromIndex: Int = 0, toIndex: Int = size): Unit\n\n/**\n * Fills this array or its subrange with the specified [element] value.\n * \n * @param fromIndex the start of the range (inclusive) to fill, 0 by default.\n * @param toIndex the end of the range (exclusive) to fill, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\npublic expect fun LongArray.fill(element: Long, fromIndex: Int = 0, toIndex: Int = size): Unit\n\n/**\n * Fills this array or its subrange with the specified [element] value.\n * \n * @param fromIndex the start of the range (inclusive) to fill, 0 by default.\n * @param toIndex the end of the range (exclusive) to fill, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\npublic expect fun FloatArray.fill(element: Float, fromIndex: Int = 0, toIndex: Int = size): Unit\n\n/**\n * Fills this array or its subrange with the specified [element] value.\n * \n * @param fromIndex the start of the range (inclusive) to fill, 0 by default.\n * @param toIndex the end of the range (exclusive) to fill, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\npublic expect fun DoubleArray.fill(element: Double, fromIndex: Int = 0, toIndex: Int = size): Unit\n\n/**\n * Fills this array or its subrange with the specified [element] value.\n * \n * @param fromIndex the start of the range (inclusive) to fill, 0 by default.\n * @param toIndex the end of the range (exclusive) to fill, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\npublic expect fun BooleanArray.fill(element: Boolean, fromIndex: Int = 0, toIndex: Int = size): Unit\n\n/**\n * Fills this array or its subrange with the specified [element] value.\n * \n * @param fromIndex the start of the range (inclusive) to fill, 0 by default.\n * @param toIndex the end of the range (exclusive) to fill, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\npublic expect fun CharArray.fill(element: Char, fromIndex: Int = 0, toIndex: Int = size): Unit\n\n/**\n * Returns the range of valid indices for the array.\n */\npublic val Array.indices: IntRange\n get() = IntRange(0, lastIndex)\n\n/**\n * Returns the range of valid indices for the array.\n */\npublic val ByteArray.indices: IntRange\n get() = IntRange(0, lastIndex)\n\n/**\n * Returns the range of valid indices for the array.\n */\npublic val ShortArray.indices: IntRange\n get() = IntRange(0, lastIndex)\n\n/**\n * Returns the range of valid indices for the array.\n */\npublic val IntArray.indices: IntRange\n get() = IntRange(0, lastIndex)\n\n/**\n * Returns the range of valid indices for the array.\n */\npublic val LongArray.indices: IntRange\n get() = IntRange(0, lastIndex)\n\n/**\n * Returns the range of valid indices for the array.\n */\npublic val FloatArray.indices: IntRange\n get() = IntRange(0, lastIndex)\n\n/**\n * Returns the range of valid indices for the array.\n */\npublic val DoubleArray.indices: IntRange\n get() = IntRange(0, lastIndex)\n\n/**\n * Returns the range of valid indices for the array.\n */\npublic val BooleanArray.indices: IntRange\n get() = IntRange(0, lastIndex)\n\n/**\n * Returns the range of valid indices for the array.\n */\npublic val CharArray.indices: IntRange\n get() = IntRange(0, lastIndex)\n\n/**\n * Returns `true` if the array is empty.\n */\n@kotlin.internal.InlineOnly\npublic inline fun Array.isEmpty(): Boolean {\n return size == 0\n}\n\n/**\n * Returns `true` if the array is empty.\n */\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.isEmpty(): Boolean {\n return size == 0\n}\n\n/**\n * Returns `true` if the array is empty.\n */\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.isEmpty(): Boolean {\n return size == 0\n}\n\n/**\n * Returns `true` if the array is empty.\n */\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.isEmpty(): Boolean {\n return size == 0\n}\n\n/**\n * Returns `true` if the array is empty.\n */\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.isEmpty(): Boolean {\n return size == 0\n}\n\n/**\n * Returns `true` if the array is empty.\n */\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.isEmpty(): Boolean {\n return size == 0\n}\n\n/**\n * Returns `true` if the array is empty.\n */\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.isEmpty(): Boolean {\n return size == 0\n}\n\n/**\n * Returns `true` if the array is empty.\n */\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.isEmpty(): Boolean {\n return size == 0\n}\n\n/**\n * Returns `true` if the array is empty.\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.isEmpty(): Boolean {\n return size == 0\n}\n\n/**\n * Returns `true` if the array is not empty.\n */\n@kotlin.internal.InlineOnly\npublic inline fun Array.isNotEmpty(): Boolean {\n return !isEmpty()\n}\n\n/**\n * Returns `true` if the array is not empty.\n */\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.isNotEmpty(): Boolean {\n return !isEmpty()\n}\n\n/**\n * Returns `true` if the array is not empty.\n */\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.isNotEmpty(): Boolean {\n return !isEmpty()\n}\n\n/**\n * Returns `true` if the array is not empty.\n */\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.isNotEmpty(): Boolean {\n return !isEmpty()\n}\n\n/**\n * Returns `true` if the array is not empty.\n */\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.isNotEmpty(): Boolean {\n return !isEmpty()\n}\n\n/**\n * Returns `true` if the array is not empty.\n */\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.isNotEmpty(): Boolean {\n return !isEmpty()\n}\n\n/**\n * Returns `true` if the array is not empty.\n */\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.isNotEmpty(): Boolean {\n return !isEmpty()\n}\n\n/**\n * Returns `true` if the array is not empty.\n */\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.isNotEmpty(): Boolean {\n return !isEmpty()\n}\n\n/**\n * Returns `true` if the array is not empty.\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.isNotEmpty(): Boolean {\n return !isEmpty()\n}\n\n/**\n * Returns the last valid index for the array.\n */\npublic val Array.lastIndex: Int\n get() = size - 1\n\n/**\n * Returns the last valid index for the array.\n */\npublic val ByteArray.lastIndex: Int\n get() = size - 1\n\n/**\n * Returns the last valid index for the array.\n */\npublic val ShortArray.lastIndex: Int\n get() = size - 1\n\n/**\n * Returns the last valid index for the array.\n */\npublic val IntArray.lastIndex: Int\n get() = size - 1\n\n/**\n * Returns the last valid index for the array.\n */\npublic val LongArray.lastIndex: Int\n get() = size - 1\n\n/**\n * Returns the last valid index for the array.\n */\npublic val FloatArray.lastIndex: Int\n get() = size - 1\n\n/**\n * Returns the last valid index for the array.\n */\npublic val DoubleArray.lastIndex: Int\n get() = size - 1\n\n/**\n * Returns the last valid index for the array.\n */\npublic val BooleanArray.lastIndex: Int\n get() = size - 1\n\n/**\n * Returns the last valid index for the array.\n */\npublic val CharArray.lastIndex: Int\n get() = size - 1\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@Suppress(\"NO_ACTUAL_FOR_EXPECT\")\npublic expect operator fun Array.plus(element: T): Array\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\npublic expect operator fun ByteArray.plus(element: Byte): ByteArray\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\npublic expect operator fun ShortArray.plus(element: Short): ShortArray\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\npublic expect operator fun IntArray.plus(element: Int): IntArray\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\npublic expect operator fun LongArray.plus(element: Long): LongArray\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\npublic expect operator fun FloatArray.plus(element: Float): FloatArray\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\npublic expect operator fun DoubleArray.plus(element: Double): DoubleArray\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\npublic expect operator fun BooleanArray.plus(element: Boolean): BooleanArray\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\npublic expect operator fun CharArray.plus(element: Char): CharArray\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\n@Suppress(\"NO_ACTUAL_FOR_EXPECT\")\npublic expect operator fun Array.plus(elements: Collection): Array\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\npublic expect operator fun ByteArray.plus(elements: Collection): ByteArray\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\npublic expect operator fun ShortArray.plus(elements: Collection): ShortArray\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\npublic expect operator fun IntArray.plus(elements: Collection): IntArray\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\npublic expect operator fun LongArray.plus(elements: Collection): LongArray\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\npublic expect operator fun FloatArray.plus(elements: Collection): FloatArray\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\npublic expect operator fun DoubleArray.plus(elements: Collection): DoubleArray\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\npublic expect operator fun BooleanArray.plus(elements: Collection): BooleanArray\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\npublic expect operator fun CharArray.plus(elements: Collection): CharArray\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\n@Suppress(\"NO_ACTUAL_FOR_EXPECT\")\npublic expect operator fun Array.plus(elements: Array): Array\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\npublic expect operator fun ByteArray.plus(elements: ByteArray): ByteArray\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\npublic expect operator fun ShortArray.plus(elements: ShortArray): ShortArray\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\npublic expect operator fun IntArray.plus(elements: IntArray): IntArray\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\npublic expect operator fun LongArray.plus(elements: LongArray): LongArray\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\npublic expect operator fun FloatArray.plus(elements: FloatArray): FloatArray\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\npublic expect operator fun DoubleArray.plus(elements: DoubleArray): DoubleArray\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\npublic expect operator fun BooleanArray.plus(elements: BooleanArray): BooleanArray\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\npublic expect operator fun CharArray.plus(elements: CharArray): CharArray\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@Suppress(\"NO_ACTUAL_FOR_EXPECT\")\npublic expect fun Array.plusElement(element: T): Array\n\n/**\n * Sorts the array in-place.\n * \n * @sample samples.collections.Arrays.Sorting.sortArray\n */\npublic expect fun IntArray.sort(): Unit\n\n/**\n * Sorts the array in-place.\n * \n * @sample samples.collections.Arrays.Sorting.sortArray\n */\npublic expect fun LongArray.sort(): Unit\n\n/**\n * Sorts the array in-place.\n * \n * @sample samples.collections.Arrays.Sorting.sortArray\n */\npublic expect fun ByteArray.sort(): Unit\n\n/**\n * Sorts the array in-place.\n * \n * @sample samples.collections.Arrays.Sorting.sortArray\n */\npublic expect fun ShortArray.sort(): Unit\n\n/**\n * Sorts the array in-place.\n * \n * @sample samples.collections.Arrays.Sorting.sortArray\n */\npublic expect fun DoubleArray.sort(): Unit\n\n/**\n * Sorts the array in-place.\n * \n * @sample samples.collections.Arrays.Sorting.sortArray\n */\npublic expect fun FloatArray.sort(): Unit\n\n/**\n * Sorts the array in-place.\n * \n * @sample samples.collections.Arrays.Sorting.sortArray\n */\npublic expect fun CharArray.sort(): Unit\n\n/**\n * Sorts the array in-place according to the natural order of its elements.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n * \n * @sample samples.collections.Arrays.Sorting.sortArrayOfComparable\n */\npublic expect fun > Array.sort(): Unit\n\n/**\n * Sorts a range in the array in-place.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n * \n * @param fromIndex the start of the range (inclusive) to sort, 0 by default.\n * @param toIndex the end of the range (exclusive) to sort, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n * \n * @sample samples.collections.Arrays.Sorting.sortRangeOfArrayOfComparable\n */\n@SinceKotlin(\"1.4\")\npublic expect fun > Array.sort(fromIndex: Int = 0, toIndex: Int = size): Unit\n\n/**\n * Sorts a range in the array in-place.\n * \n * @param fromIndex the start of the range (inclusive) to sort, 0 by default.\n * @param toIndex the end of the range (exclusive) to sort, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n * \n * @sample samples.collections.Arrays.Sorting.sortRangeOfArray\n */\n@SinceKotlin(\"1.4\")\npublic expect fun ByteArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit\n\n/**\n * Sorts a range in the array in-place.\n * \n * @param fromIndex the start of the range (inclusive) to sort, 0 by default.\n * @param toIndex the end of the range (exclusive) to sort, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n * \n * @sample samples.collections.Arrays.Sorting.sortRangeOfArray\n */\n@SinceKotlin(\"1.4\")\npublic expect fun ShortArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit\n\n/**\n * Sorts a range in the array in-place.\n * \n * @param fromIndex the start of the range (inclusive) to sort, 0 by default.\n * @param toIndex the end of the range (exclusive) to sort, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n * \n * @sample samples.collections.Arrays.Sorting.sortRangeOfArray\n */\n@SinceKotlin(\"1.4\")\npublic expect fun IntArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit\n\n/**\n * Sorts a range in the array in-place.\n * \n * @param fromIndex the start of the range (inclusive) to sort, 0 by default.\n * @param toIndex the end of the range (exclusive) to sort, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n * \n * @sample samples.collections.Arrays.Sorting.sortRangeOfArray\n */\n@SinceKotlin(\"1.4\")\npublic expect fun LongArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit\n\n/**\n * Sorts a range in the array in-place.\n * \n * @param fromIndex the start of the range (inclusive) to sort, 0 by default.\n * @param toIndex the end of the range (exclusive) to sort, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n * \n * @sample samples.collections.Arrays.Sorting.sortRangeOfArray\n */\n@SinceKotlin(\"1.4\")\npublic expect fun FloatArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit\n\n/**\n * Sorts a range in the array in-place.\n * \n * @param fromIndex the start of the range (inclusive) to sort, 0 by default.\n * @param toIndex the end of the range (exclusive) to sort, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n * \n * @sample samples.collections.Arrays.Sorting.sortRangeOfArray\n */\n@SinceKotlin(\"1.4\")\npublic expect fun DoubleArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit\n\n/**\n * Sorts a range in the array in-place.\n * \n * @param fromIndex the start of the range (inclusive) to sort, 0 by default.\n * @param toIndex the end of the range (exclusive) to sort, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n * \n * @sample samples.collections.Arrays.Sorting.sortRangeOfArray\n */\n@SinceKotlin(\"1.4\")\npublic expect fun CharArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit\n\n/**\n * Sorts elements of the array in the specified range in-place.\n * The elements are sorted descending according to their natural sort order.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n * \n * @param fromIndex the start of the range (inclusive) to sort.\n * @param toIndex the end of the range (exclusive) to sort.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\npublic fun > Array.sortDescending(fromIndex: Int, toIndex: Int): Unit {\n sortWith(reverseOrder(), fromIndex, toIndex)\n}\n\n/**\n * Sorts elements of the array in the specified range in-place.\n * The elements are sorted descending according to their natural sort order.\n * \n * @param fromIndex the start of the range (inclusive) to sort.\n * @param toIndex the end of the range (exclusive) to sort.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\npublic fun ByteArray.sortDescending(fromIndex: Int, toIndex: Int): Unit {\n sort(fromIndex, toIndex)\n reverse(fromIndex, toIndex)\n}\n\n/**\n * Sorts elements of the array in the specified range in-place.\n * The elements are sorted descending according to their natural sort order.\n * \n * @param fromIndex the start of the range (inclusive) to sort.\n * @param toIndex the end of the range (exclusive) to sort.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\npublic fun ShortArray.sortDescending(fromIndex: Int, toIndex: Int): Unit {\n sort(fromIndex, toIndex)\n reverse(fromIndex, toIndex)\n}\n\n/**\n * Sorts elements of the array in the specified range in-place.\n * The elements are sorted descending according to their natural sort order.\n * \n * @param fromIndex the start of the range (inclusive) to sort.\n * @param toIndex the end of the range (exclusive) to sort.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\npublic fun IntArray.sortDescending(fromIndex: Int, toIndex: Int): Unit {\n sort(fromIndex, toIndex)\n reverse(fromIndex, toIndex)\n}\n\n/**\n * Sorts elements of the array in the specified range in-place.\n * The elements are sorted descending according to their natural sort order.\n * \n * @param fromIndex the start of the range (inclusive) to sort.\n * @param toIndex the end of the range (exclusive) to sort.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\npublic fun LongArray.sortDescending(fromIndex: Int, toIndex: Int): Unit {\n sort(fromIndex, toIndex)\n reverse(fromIndex, toIndex)\n}\n\n/**\n * Sorts elements of the array in the specified range in-place.\n * The elements are sorted descending according to their natural sort order.\n * \n * @param fromIndex the start of the range (inclusive) to sort.\n * @param toIndex the end of the range (exclusive) to sort.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\npublic fun FloatArray.sortDescending(fromIndex: Int, toIndex: Int): Unit {\n sort(fromIndex, toIndex)\n reverse(fromIndex, toIndex)\n}\n\n/**\n * Sorts elements of the array in the specified range in-place.\n * The elements are sorted descending according to their natural sort order.\n * \n * @param fromIndex the start of the range (inclusive) to sort.\n * @param toIndex the end of the range (exclusive) to sort.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\npublic fun DoubleArray.sortDescending(fromIndex: Int, toIndex: Int): Unit {\n sort(fromIndex, toIndex)\n reverse(fromIndex, toIndex)\n}\n\n/**\n * Sorts elements of the array in the specified range in-place.\n * The elements are sorted descending according to their natural sort order.\n * \n * @param fromIndex the start of the range (inclusive) to sort.\n * @param toIndex the end of the range (exclusive) to sort.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\npublic fun CharArray.sortDescending(fromIndex: Int, toIndex: Int): Unit {\n sort(fromIndex, toIndex)\n reverse(fromIndex, toIndex)\n}\n\n/**\n * Sorts the array in-place according to the order specified by the given [comparator].\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic expect fun Array.sortWith(comparator: Comparator): Unit\n\n/**\n * Sorts a range in the array in-place with the given [comparator].\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n * \n * @param fromIndex the start of the range (inclusive) to sort, 0 by default.\n * @param toIndex the end of the range (exclusive) to sort, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\npublic expect fun Array.sortWith(comparator: Comparator, fromIndex: Int = 0, toIndex: Int = size): Unit\n\n/**\n * Returns an array of Boolean containing all of the elements of this generic array.\n */\npublic fun Array.toBooleanArray(): BooleanArray {\n return BooleanArray(size) { index -> this[index] }\n}\n\n/**\n * Returns an array of Byte containing all of the elements of this generic array.\n */\npublic fun Array.toByteArray(): ByteArray {\n return ByteArray(size) { index -> this[index] }\n}\n\n/**\n * Returns an array of Char containing all of the elements of this generic array.\n */\npublic fun Array.toCharArray(): CharArray {\n return CharArray(size) { index -> this[index] }\n}\n\n/**\n * Returns an array of Double containing all of the elements of this generic array.\n */\npublic fun Array.toDoubleArray(): DoubleArray {\n return DoubleArray(size) { index -> this[index] }\n}\n\n/**\n * Returns an array of Float containing all of the elements of this generic array.\n */\npublic fun Array.toFloatArray(): FloatArray {\n return FloatArray(size) { index -> this[index] }\n}\n\n/**\n * Returns an array of Int containing all of the elements of this generic array.\n */\npublic fun Array.toIntArray(): IntArray {\n return IntArray(size) { index -> this[index] }\n}\n\n/**\n * Returns an array of Long containing all of the elements of this generic array.\n */\npublic fun Array.toLongArray(): LongArray {\n return LongArray(size) { index -> this[index] }\n}\n\n/**\n * Returns an array of Short containing all of the elements of this generic array.\n */\npublic fun Array.toShortArray(): ShortArray {\n return ShortArray(size) { index -> this[index] }\n}\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\npublic expect fun ByteArray.toTypedArray(): Array\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\npublic expect fun ShortArray.toTypedArray(): Array\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\npublic expect fun IntArray.toTypedArray(): Array\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\npublic expect fun LongArray.toTypedArray(): Array\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\npublic expect fun FloatArray.toTypedArray(): Array\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\npublic expect fun DoubleArray.toTypedArray(): Array\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\npublic expect fun BooleanArray.toTypedArray(): Array\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\npublic expect fun CharArray.toTypedArray(): Array\n\n/**\n * Returns a [Map] containing key-value pairs provided by [transform] function\n * applied to elements of the given array.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitives\n */\npublic inline fun Array.associate(transform: (T) -> Pair): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateTo(LinkedHashMap(capacity), transform)\n}\n\n/**\n * Returns a [Map] containing key-value pairs provided by [transform] function\n * applied to elements of the given array.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitives\n */\npublic inline fun ByteArray.associate(transform: (Byte) -> Pair): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateTo(LinkedHashMap(capacity), transform)\n}\n\n/**\n * Returns a [Map] containing key-value pairs provided by [transform] function\n * applied to elements of the given array.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitives\n */\npublic inline fun ShortArray.associate(transform: (Short) -> Pair): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateTo(LinkedHashMap(capacity), transform)\n}\n\n/**\n * Returns a [Map] containing key-value pairs provided by [transform] function\n * applied to elements of the given array.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitives\n */\npublic inline fun IntArray.associate(transform: (Int) -> Pair): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateTo(LinkedHashMap(capacity), transform)\n}\n\n/**\n * Returns a [Map] containing key-value pairs provided by [transform] function\n * applied to elements of the given array.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitives\n */\npublic inline fun LongArray.associate(transform: (Long) -> Pair): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateTo(LinkedHashMap(capacity), transform)\n}\n\n/**\n * Returns a [Map] containing key-value pairs provided by [transform] function\n * applied to elements of the given array.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitives\n */\npublic inline fun FloatArray.associate(transform: (Float) -> Pair): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateTo(LinkedHashMap(capacity), transform)\n}\n\n/**\n * Returns a [Map] containing key-value pairs provided by [transform] function\n * applied to elements of the given array.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitives\n */\npublic inline fun DoubleArray.associate(transform: (Double) -> Pair): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateTo(LinkedHashMap(capacity), transform)\n}\n\n/**\n * Returns a [Map] containing key-value pairs provided by [transform] function\n * applied to elements of the given array.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitives\n */\npublic inline fun BooleanArray.associate(transform: (Boolean) -> Pair): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateTo(LinkedHashMap(capacity), transform)\n}\n\n/**\n * Returns a [Map] containing key-value pairs provided by [transform] function\n * applied to elements of the given array.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitives\n */\npublic inline fun CharArray.associate(transform: (Char) -> Pair): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateTo(LinkedHashMap(capacity), transform)\n}\n\n/**\n * Returns a [Map] containing the elements from the given array indexed by the key\n * returned from [keySelector] function applied to each element.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesBy\n */\npublic inline fun Array.associateBy(keySelector: (T) -> K): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector)\n}\n\n/**\n * Returns a [Map] containing the elements from the given array indexed by the key\n * returned from [keySelector] function applied to each element.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesBy\n */\npublic inline fun ByteArray.associateBy(keySelector: (Byte) -> K): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector)\n}\n\n/**\n * Returns a [Map] containing the elements from the given array indexed by the key\n * returned from [keySelector] function applied to each element.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesBy\n */\npublic inline fun ShortArray.associateBy(keySelector: (Short) -> K): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector)\n}\n\n/**\n * Returns a [Map] containing the elements from the given array indexed by the key\n * returned from [keySelector] function applied to each element.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesBy\n */\npublic inline fun IntArray.associateBy(keySelector: (Int) -> K): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector)\n}\n\n/**\n * Returns a [Map] containing the elements from the given array indexed by the key\n * returned from [keySelector] function applied to each element.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesBy\n */\npublic inline fun LongArray.associateBy(keySelector: (Long) -> K): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector)\n}\n\n/**\n * Returns a [Map] containing the elements from the given array indexed by the key\n * returned from [keySelector] function applied to each element.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesBy\n */\npublic inline fun FloatArray.associateBy(keySelector: (Float) -> K): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector)\n}\n\n/**\n * Returns a [Map] containing the elements from the given array indexed by the key\n * returned from [keySelector] function applied to each element.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesBy\n */\npublic inline fun DoubleArray.associateBy(keySelector: (Double) -> K): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector)\n}\n\n/**\n * Returns a [Map] containing the elements from the given array indexed by the key\n * returned from [keySelector] function applied to each element.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesBy\n */\npublic inline fun BooleanArray.associateBy(keySelector: (Boolean) -> K): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector)\n}\n\n/**\n * Returns a [Map] containing the elements from the given array indexed by the key\n * returned from [keySelector] function applied to each element.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesBy\n */\npublic inline fun CharArray.associateBy(keySelector: (Char) -> K): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector)\n}\n\n/**\n * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByWithValueTransform\n */\npublic inline fun Array.associateBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform)\n}\n\n/**\n * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByWithValueTransform\n */\npublic inline fun ByteArray.associateBy(keySelector: (Byte) -> K, valueTransform: (Byte) -> V): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform)\n}\n\n/**\n * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByWithValueTransform\n */\npublic inline fun ShortArray.associateBy(keySelector: (Short) -> K, valueTransform: (Short) -> V): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform)\n}\n\n/**\n * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByWithValueTransform\n */\npublic inline fun IntArray.associateBy(keySelector: (Int) -> K, valueTransform: (Int) -> V): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform)\n}\n\n/**\n * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByWithValueTransform\n */\npublic inline fun LongArray.associateBy(keySelector: (Long) -> K, valueTransform: (Long) -> V): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform)\n}\n\n/**\n * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByWithValueTransform\n */\npublic inline fun FloatArray.associateBy(keySelector: (Float) -> K, valueTransform: (Float) -> V): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform)\n}\n\n/**\n * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByWithValueTransform\n */\npublic inline fun DoubleArray.associateBy(keySelector: (Double) -> K, valueTransform: (Double) -> V): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform)\n}\n\n/**\n * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByWithValueTransform\n */\npublic inline fun BooleanArray.associateBy(keySelector: (Boolean) -> K, valueTransform: (Boolean) -> V): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform)\n}\n\n/**\n * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given array.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByWithValueTransform\n */\npublic inline fun CharArray.associateBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map {\n val capacity = mapCapacity(size).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform)\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function applied to each element of the given array\n * and value is the element itself.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByTo\n */\npublic inline fun > Array.associateByTo(destination: M, keySelector: (T) -> K): M {\n for (element in this) {\n destination.put(keySelector(element), element)\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function applied to each element of the given array\n * and value is the element itself.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByTo\n */\npublic inline fun > ByteArray.associateByTo(destination: M, keySelector: (Byte) -> K): M {\n for (element in this) {\n destination.put(keySelector(element), element)\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function applied to each element of the given array\n * and value is the element itself.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByTo\n */\npublic inline fun > ShortArray.associateByTo(destination: M, keySelector: (Short) -> K): M {\n for (element in this) {\n destination.put(keySelector(element), element)\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function applied to each element of the given array\n * and value is the element itself.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByTo\n */\npublic inline fun > IntArray.associateByTo(destination: M, keySelector: (Int) -> K): M {\n for (element in this) {\n destination.put(keySelector(element), element)\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function applied to each element of the given array\n * and value is the element itself.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByTo\n */\npublic inline fun > LongArray.associateByTo(destination: M, keySelector: (Long) -> K): M {\n for (element in this) {\n destination.put(keySelector(element), element)\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function applied to each element of the given array\n * and value is the element itself.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByTo\n */\npublic inline fun > FloatArray.associateByTo(destination: M, keySelector: (Float) -> K): M {\n for (element in this) {\n destination.put(keySelector(element), element)\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function applied to each element of the given array\n * and value is the element itself.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByTo\n */\npublic inline fun > DoubleArray.associateByTo(destination: M, keySelector: (Double) -> K): M {\n for (element in this) {\n destination.put(keySelector(element), element)\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function applied to each element of the given array\n * and value is the element itself.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByTo\n */\npublic inline fun > BooleanArray.associateByTo(destination: M, keySelector: (Boolean) -> K): M {\n for (element in this) {\n destination.put(keySelector(element), element)\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function applied to each element of the given array\n * and value is the element itself.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByTo\n */\npublic inline fun > CharArray.associateByTo(destination: M, keySelector: (Char) -> K): M {\n for (element in this) {\n destination.put(keySelector(element), element)\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function and\n * and value is provided by the [valueTransform] function applied to elements of the given array.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByToWithValueTransform\n */\npublic inline fun > Array.associateByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M {\n for (element in this) {\n destination.put(keySelector(element), valueTransform(element))\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function and\n * and value is provided by the [valueTransform] function applied to elements of the given array.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByToWithValueTransform\n */\npublic inline fun > ByteArray.associateByTo(destination: M, keySelector: (Byte) -> K, valueTransform: (Byte) -> V): M {\n for (element in this) {\n destination.put(keySelector(element), valueTransform(element))\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function and\n * and value is provided by the [valueTransform] function applied to elements of the given array.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByToWithValueTransform\n */\npublic inline fun > ShortArray.associateByTo(destination: M, keySelector: (Short) -> K, valueTransform: (Short) -> V): M {\n for (element in this) {\n destination.put(keySelector(element), valueTransform(element))\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function and\n * and value is provided by the [valueTransform] function applied to elements of the given array.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByToWithValueTransform\n */\npublic inline fun > IntArray.associateByTo(destination: M, keySelector: (Int) -> K, valueTransform: (Int) -> V): M {\n for (element in this) {\n destination.put(keySelector(element), valueTransform(element))\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function and\n * and value is provided by the [valueTransform] function applied to elements of the given array.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByToWithValueTransform\n */\npublic inline fun > LongArray.associateByTo(destination: M, keySelector: (Long) -> K, valueTransform: (Long) -> V): M {\n for (element in this) {\n destination.put(keySelector(element), valueTransform(element))\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function and\n * and value is provided by the [valueTransform] function applied to elements of the given array.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByToWithValueTransform\n */\npublic inline fun > FloatArray.associateByTo(destination: M, keySelector: (Float) -> K, valueTransform: (Float) -> V): M {\n for (element in this) {\n destination.put(keySelector(element), valueTransform(element))\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function and\n * and value is provided by the [valueTransform] function applied to elements of the given array.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByToWithValueTransform\n */\npublic inline fun > DoubleArray.associateByTo(destination: M, keySelector: (Double) -> K, valueTransform: (Double) -> V): M {\n for (element in this) {\n destination.put(keySelector(element), valueTransform(element))\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function and\n * and value is provided by the [valueTransform] function applied to elements of the given array.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByToWithValueTransform\n */\npublic inline fun > BooleanArray.associateByTo(destination: M, keySelector: (Boolean) -> K, valueTransform: (Boolean) -> V): M {\n for (element in this) {\n destination.put(keySelector(element), valueTransform(element))\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function and\n * and value is provided by the [valueTransform] function applied to elements of the given array.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesByToWithValueTransform\n */\npublic inline fun > CharArray.associateByTo(destination: M, keySelector: (Char) -> K, valueTransform: (Char) -> V): M {\n for (element in this) {\n destination.put(keySelector(element), valueTransform(element))\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs\n * provided by [transform] function applied to each element of the given array.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesTo\n */\npublic inline fun > Array.associateTo(destination: M, transform: (T) -> Pair): M {\n for (element in this) {\n destination += transform(element)\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs\n * provided by [transform] function applied to each element of the given array.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesTo\n */\npublic inline fun > ByteArray.associateTo(destination: M, transform: (Byte) -> Pair): M {\n for (element in this) {\n destination += transform(element)\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs\n * provided by [transform] function applied to each element of the given array.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesTo\n */\npublic inline fun > ShortArray.associateTo(destination: M, transform: (Short) -> Pair): M {\n for (element in this) {\n destination += transform(element)\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs\n * provided by [transform] function applied to each element of the given array.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesTo\n */\npublic inline fun > IntArray.associateTo(destination: M, transform: (Int) -> Pair): M {\n for (element in this) {\n destination += transform(element)\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs\n * provided by [transform] function applied to each element of the given array.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesTo\n */\npublic inline fun > LongArray.associateTo(destination: M, transform: (Long) -> Pair): M {\n for (element in this) {\n destination += transform(element)\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs\n * provided by [transform] function applied to each element of the given array.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesTo\n */\npublic inline fun > FloatArray.associateTo(destination: M, transform: (Float) -> Pair): M {\n for (element in this) {\n destination += transform(element)\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs\n * provided by [transform] function applied to each element of the given array.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesTo\n */\npublic inline fun > DoubleArray.associateTo(destination: M, transform: (Double) -> Pair): M {\n for (element in this) {\n destination += transform(element)\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs\n * provided by [transform] function applied to each element of the given array.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesTo\n */\npublic inline fun > BooleanArray.associateTo(destination: M, transform: (Boolean) -> Pair): M {\n for (element in this) {\n destination += transform(element)\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs\n * provided by [transform] function applied to each element of the given array.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * @sample samples.collections.Arrays.Transformations.associateArrayOfPrimitivesTo\n */\npublic inline fun > CharArray.associateTo(destination: M, transform: (Char) -> Pair): M {\n for (element in this) {\n destination += transform(element)\n }\n return destination\n}\n\n/**\n * Returns a [Map] where keys are elements from the given array and values are\n * produced by the [valueSelector] function applied to each element.\n * \n * If any two elements are equal, the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Collections.Transformations.associateWith\n */\n@SinceKotlin(\"1.4\")\npublic inline fun Array.associateWith(valueSelector: (K) -> V): Map {\n val result = LinkedHashMap(mapCapacity(size).coerceAtLeast(16))\n return associateWithTo(result, valueSelector)\n}\n\n/**\n * Returns a [Map] where keys are elements from the given array and values are\n * produced by the [valueSelector] function applied to each element.\n * \n * If any two elements are equal, the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Collections.Transformations.associateWith\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.associateWith(valueSelector: (Byte) -> V): Map {\n val result = LinkedHashMap(mapCapacity(size).coerceAtLeast(16))\n return associateWithTo(result, valueSelector)\n}\n\n/**\n * Returns a [Map] where keys are elements from the given array and values are\n * produced by the [valueSelector] function applied to each element.\n * \n * If any two elements are equal, the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Collections.Transformations.associateWith\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.associateWith(valueSelector: (Short) -> V): Map {\n val result = LinkedHashMap(mapCapacity(size).coerceAtLeast(16))\n return associateWithTo(result, valueSelector)\n}\n\n/**\n * Returns a [Map] where keys are elements from the given array and values are\n * produced by the [valueSelector] function applied to each element.\n * \n * If any two elements are equal, the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Collections.Transformations.associateWith\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.associateWith(valueSelector: (Int) -> V): Map {\n val result = LinkedHashMap(mapCapacity(size).coerceAtLeast(16))\n return associateWithTo(result, valueSelector)\n}\n\n/**\n * Returns a [Map] where keys are elements from the given array and values are\n * produced by the [valueSelector] function applied to each element.\n * \n * If any two elements are equal, the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Collections.Transformations.associateWith\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.associateWith(valueSelector: (Long) -> V): Map {\n val result = LinkedHashMap(mapCapacity(size).coerceAtLeast(16))\n return associateWithTo(result, valueSelector)\n}\n\n/**\n * Returns a [Map] where keys are elements from the given array and values are\n * produced by the [valueSelector] function applied to each element.\n * \n * If any two elements are equal, the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Collections.Transformations.associateWith\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.associateWith(valueSelector: (Float) -> V): Map {\n val result = LinkedHashMap(mapCapacity(size).coerceAtLeast(16))\n return associateWithTo(result, valueSelector)\n}\n\n/**\n * Returns a [Map] where keys are elements from the given array and values are\n * produced by the [valueSelector] function applied to each element.\n * \n * If any two elements are equal, the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Collections.Transformations.associateWith\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.associateWith(valueSelector: (Double) -> V): Map {\n val result = LinkedHashMap(mapCapacity(size).coerceAtLeast(16))\n return associateWithTo(result, valueSelector)\n}\n\n/**\n * Returns a [Map] where keys are elements from the given array and values are\n * produced by the [valueSelector] function applied to each element.\n * \n * If any two elements are equal, the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Collections.Transformations.associateWith\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.associateWith(valueSelector: (Boolean) -> V): Map {\n val result = LinkedHashMap(mapCapacity(size).coerceAtLeast(16))\n return associateWithTo(result, valueSelector)\n}\n\n/**\n * Returns a [Map] where keys are elements from the given array and values are\n * produced by the [valueSelector] function applied to each element.\n * \n * If any two elements are equal, the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Collections.Transformations.associateWith\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.associateWith(valueSelector: (Char) -> V): Map {\n val result = LinkedHashMap(mapCapacity(size.coerceAtMost(128)).coerceAtLeast(16))\n return associateWithTo(result, valueSelector)\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs for each element of the given array,\n * where key is the element itself and value is provided by the [valueSelector] function applied to that key.\n * \n * If any two elements are equal, the last one overwrites the former value in the map.\n * \n * @sample samples.collections.Collections.Transformations.associateWithTo\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > Array.associateWithTo(destination: M, valueSelector: (K) -> V): M {\n for (element in this) {\n destination.put(element, valueSelector(element))\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs for each element of the given array,\n * where key is the element itself and value is provided by the [valueSelector] function applied to that key.\n * \n * If any two elements are equal, the last one overwrites the former value in the map.\n * \n * @sample samples.collections.Collections.Transformations.associateWithTo\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun > ByteArray.associateWithTo(destination: M, valueSelector: (Byte) -> V): M {\n for (element in this) {\n destination.put(element, valueSelector(element))\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs for each element of the given array,\n * where key is the element itself and value is provided by the [valueSelector] function applied to that key.\n * \n * If any two elements are equal, the last one overwrites the former value in the map.\n * \n * @sample samples.collections.Collections.Transformations.associateWithTo\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun > ShortArray.associateWithTo(destination: M, valueSelector: (Short) -> V): M {\n for (element in this) {\n destination.put(element, valueSelector(element))\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs for each element of the given array,\n * where key is the element itself and value is provided by the [valueSelector] function applied to that key.\n * \n * If any two elements are equal, the last one overwrites the former value in the map.\n * \n * @sample samples.collections.Collections.Transformations.associateWithTo\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun > IntArray.associateWithTo(destination: M, valueSelector: (Int) -> V): M {\n for (element in this) {\n destination.put(element, valueSelector(element))\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs for each element of the given array,\n * where key is the element itself and value is provided by the [valueSelector] function applied to that key.\n * \n * If any two elements are equal, the last one overwrites the former value in the map.\n * \n * @sample samples.collections.Collections.Transformations.associateWithTo\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun > LongArray.associateWithTo(destination: M, valueSelector: (Long) -> V): M {\n for (element in this) {\n destination.put(element, valueSelector(element))\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs for each element of the given array,\n * where key is the element itself and value is provided by the [valueSelector] function applied to that key.\n * \n * If any two elements are equal, the last one overwrites the former value in the map.\n * \n * @sample samples.collections.Collections.Transformations.associateWithTo\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun > FloatArray.associateWithTo(destination: M, valueSelector: (Float) -> V): M {\n for (element in this) {\n destination.put(element, valueSelector(element))\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs for each element of the given array,\n * where key is the element itself and value is provided by the [valueSelector] function applied to that key.\n * \n * If any two elements are equal, the last one overwrites the former value in the map.\n * \n * @sample samples.collections.Collections.Transformations.associateWithTo\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun > DoubleArray.associateWithTo(destination: M, valueSelector: (Double) -> V): M {\n for (element in this) {\n destination.put(element, valueSelector(element))\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs for each element of the given array,\n * where key is the element itself and value is provided by the [valueSelector] function applied to that key.\n * \n * If any two elements are equal, the last one overwrites the former value in the map.\n * \n * @sample samples.collections.Collections.Transformations.associateWithTo\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun > BooleanArray.associateWithTo(destination: M, valueSelector: (Boolean) -> V): M {\n for (element in this) {\n destination.put(element, valueSelector(element))\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs for each element of the given array,\n * where key is the element itself and value is provided by the [valueSelector] function applied to that key.\n * \n * If any two elements are equal, the last one overwrites the former value in the map.\n * \n * @sample samples.collections.Collections.Transformations.associateWithTo\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun > CharArray.associateWithTo(destination: M, valueSelector: (Char) -> V): M {\n for (element in this) {\n destination.put(element, valueSelector(element))\n }\n return destination\n}\n\n/**\n * Appends all elements to the given [destination] collection.\n */\npublic fun > Array.toCollection(destination: C): C {\n for (item in this) {\n destination.add(item)\n }\n return destination\n}\n\n/**\n * Appends all elements to the given [destination] collection.\n */\npublic fun > ByteArray.toCollection(destination: C): C {\n for (item in this) {\n destination.add(item)\n }\n return destination\n}\n\n/**\n * Appends all elements to the given [destination] collection.\n */\npublic fun > ShortArray.toCollection(destination: C): C {\n for (item in this) {\n destination.add(item)\n }\n return destination\n}\n\n/**\n * Appends all elements to the given [destination] collection.\n */\npublic fun > IntArray.toCollection(destination: C): C {\n for (item in this) {\n destination.add(item)\n }\n return destination\n}\n\n/**\n * Appends all elements to the given [destination] collection.\n */\npublic fun > LongArray.toCollection(destination: C): C {\n for (item in this) {\n destination.add(item)\n }\n return destination\n}\n\n/**\n * Appends all elements to the given [destination] collection.\n */\npublic fun > FloatArray.toCollection(destination: C): C {\n for (item in this) {\n destination.add(item)\n }\n return destination\n}\n\n/**\n * Appends all elements to the given [destination] collection.\n */\npublic fun > DoubleArray.toCollection(destination: C): C {\n for (item in this) {\n destination.add(item)\n }\n return destination\n}\n\n/**\n * Appends all elements to the given [destination] collection.\n */\npublic fun > BooleanArray.toCollection(destination: C): C {\n for (item in this) {\n destination.add(item)\n }\n return destination\n}\n\n/**\n * Appends all elements to the given [destination] collection.\n */\npublic fun > CharArray.toCollection(destination: C): C {\n for (item in this) {\n destination.add(item)\n }\n return destination\n}\n\n/**\n * Returns a new [HashSet] of all elements.\n */\npublic fun Array.toHashSet(): HashSet {\n return toCollection(HashSet(mapCapacity(size)))\n}\n\n/**\n * Returns a new [HashSet] of all elements.\n */\npublic fun ByteArray.toHashSet(): HashSet {\n return toCollection(HashSet(mapCapacity(size)))\n}\n\n/**\n * Returns a new [HashSet] of all elements.\n */\npublic fun ShortArray.toHashSet(): HashSet {\n return toCollection(HashSet(mapCapacity(size)))\n}\n\n/**\n * Returns a new [HashSet] of all elements.\n */\npublic fun IntArray.toHashSet(): HashSet {\n return toCollection(HashSet(mapCapacity(size)))\n}\n\n/**\n * Returns a new [HashSet] of all elements.\n */\npublic fun LongArray.toHashSet(): HashSet {\n return toCollection(HashSet(mapCapacity(size)))\n}\n\n/**\n * Returns a new [HashSet] of all elements.\n */\npublic fun FloatArray.toHashSet(): HashSet {\n return toCollection(HashSet(mapCapacity(size)))\n}\n\n/**\n * Returns a new [HashSet] of all elements.\n */\npublic fun DoubleArray.toHashSet(): HashSet {\n return toCollection(HashSet(mapCapacity(size)))\n}\n\n/**\n * Returns a new [HashSet] of all elements.\n */\npublic fun BooleanArray.toHashSet(): HashSet {\n return toCollection(HashSet(mapCapacity(size)))\n}\n\n/**\n * Returns a new [HashSet] of all elements.\n */\npublic fun CharArray.toHashSet(): HashSet {\n return toCollection(HashSet(mapCapacity(size.coerceAtMost(128))))\n}\n\n/**\n * Returns a [List] containing all elements.\n */\npublic fun Array.toList(): List {\n return when (size) {\n 0 -> emptyList()\n 1 -> listOf(this[0])\n else -> this.toMutableList()\n }\n}\n\n/**\n * Returns a [List] containing all elements.\n */\npublic fun ByteArray.toList(): List {\n return when (size) {\n 0 -> emptyList()\n 1 -> listOf(this[0])\n else -> this.toMutableList()\n }\n}\n\n/**\n * Returns a [List] containing all elements.\n */\npublic fun ShortArray.toList(): List {\n return when (size) {\n 0 -> emptyList()\n 1 -> listOf(this[0])\n else -> this.toMutableList()\n }\n}\n\n/**\n * Returns a [List] containing all elements.\n */\npublic fun IntArray.toList(): List {\n return when (size) {\n 0 -> emptyList()\n 1 -> listOf(this[0])\n else -> this.toMutableList()\n }\n}\n\n/**\n * Returns a [List] containing all elements.\n */\npublic fun LongArray.toList(): List {\n return when (size) {\n 0 -> emptyList()\n 1 -> listOf(this[0])\n else -> this.toMutableList()\n }\n}\n\n/**\n * Returns a [List] containing all elements.\n */\npublic fun FloatArray.toList(): List {\n return when (size) {\n 0 -> emptyList()\n 1 -> listOf(this[0])\n else -> this.toMutableList()\n }\n}\n\n/**\n * Returns a [List] containing all elements.\n */\npublic fun DoubleArray.toList(): List {\n return when (size) {\n 0 -> emptyList()\n 1 -> listOf(this[0])\n else -> this.toMutableList()\n }\n}\n\n/**\n * Returns a [List] containing all elements.\n */\npublic fun BooleanArray.toList(): List {\n return when (size) {\n 0 -> emptyList()\n 1 -> listOf(this[0])\n else -> this.toMutableList()\n }\n}\n\n/**\n * Returns a [List] containing all elements.\n */\npublic fun CharArray.toList(): List {\n return when (size) {\n 0 -> emptyList()\n 1 -> listOf(this[0])\n else -> this.toMutableList()\n }\n}\n\n/**\n * Returns a new [MutableList] filled with all elements of this array.\n */\npublic fun Array.toMutableList(): MutableList {\n return ArrayList(this.asCollection())\n}\n\n/**\n * Returns a new [MutableList] filled with all elements of this array.\n */\npublic fun ByteArray.toMutableList(): MutableList {\n val list = ArrayList(size)\n for (item in this) list.add(item)\n return list\n}\n\n/**\n * Returns a new [MutableList] filled with all elements of this array.\n */\npublic fun ShortArray.toMutableList(): MutableList {\n val list = ArrayList(size)\n for (item in this) list.add(item)\n return list\n}\n\n/**\n * Returns a new [MutableList] filled with all elements of this array.\n */\npublic fun IntArray.toMutableList(): MutableList {\n val list = ArrayList(size)\n for (item in this) list.add(item)\n return list\n}\n\n/**\n * Returns a new [MutableList] filled with all elements of this array.\n */\npublic fun LongArray.toMutableList(): MutableList {\n val list = ArrayList(size)\n for (item in this) list.add(item)\n return list\n}\n\n/**\n * Returns a new [MutableList] filled with all elements of this array.\n */\npublic fun FloatArray.toMutableList(): MutableList {\n val list = ArrayList(size)\n for (item in this) list.add(item)\n return list\n}\n\n/**\n * Returns a new [MutableList] filled with all elements of this array.\n */\npublic fun DoubleArray.toMutableList(): MutableList {\n val list = ArrayList(size)\n for (item in this) list.add(item)\n return list\n}\n\n/**\n * Returns a new [MutableList] filled with all elements of this array.\n */\npublic fun BooleanArray.toMutableList(): MutableList {\n val list = ArrayList(size)\n for (item in this) list.add(item)\n return list\n}\n\n/**\n * Returns a new [MutableList] filled with all elements of this array.\n */\npublic fun CharArray.toMutableList(): MutableList {\n val list = ArrayList(size)\n for (item in this) list.add(item)\n return list\n}\n\n/**\n * Returns a [Set] of all elements.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic fun Array.toSet(): Set {\n return when (size) {\n 0 -> emptySet()\n 1 -> setOf(this[0])\n else -> toCollection(LinkedHashSet(mapCapacity(size)))\n }\n}\n\n/**\n * Returns a [Set] of all elements.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic fun ByteArray.toSet(): Set {\n return when (size) {\n 0 -> emptySet()\n 1 -> setOf(this[0])\n else -> toCollection(LinkedHashSet(mapCapacity(size)))\n }\n}\n\n/**\n * Returns a [Set] of all elements.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic fun ShortArray.toSet(): Set {\n return when (size) {\n 0 -> emptySet()\n 1 -> setOf(this[0])\n else -> toCollection(LinkedHashSet(mapCapacity(size)))\n }\n}\n\n/**\n * Returns a [Set] of all elements.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic fun IntArray.toSet(): Set {\n return when (size) {\n 0 -> emptySet()\n 1 -> setOf(this[0])\n else -> toCollection(LinkedHashSet(mapCapacity(size)))\n }\n}\n\n/**\n * Returns a [Set] of all elements.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic fun LongArray.toSet(): Set {\n return when (size) {\n 0 -> emptySet()\n 1 -> setOf(this[0])\n else -> toCollection(LinkedHashSet(mapCapacity(size)))\n }\n}\n\n/**\n * Returns a [Set] of all elements.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic fun FloatArray.toSet(): Set {\n return when (size) {\n 0 -> emptySet()\n 1 -> setOf(this[0])\n else -> toCollection(LinkedHashSet(mapCapacity(size)))\n }\n}\n\n/**\n * Returns a [Set] of all elements.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic fun DoubleArray.toSet(): Set {\n return when (size) {\n 0 -> emptySet()\n 1 -> setOf(this[0])\n else -> toCollection(LinkedHashSet(mapCapacity(size)))\n }\n}\n\n/**\n * Returns a [Set] of all elements.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic fun BooleanArray.toSet(): Set {\n return when (size) {\n 0 -> emptySet()\n 1 -> setOf(this[0])\n else -> toCollection(LinkedHashSet(mapCapacity(size)))\n }\n}\n\n/**\n * Returns a [Set] of all elements.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic fun CharArray.toSet(): Set {\n return when (size) {\n 0 -> emptySet()\n 1 -> setOf(this[0])\n else -> toCollection(LinkedHashSet(mapCapacity(size.coerceAtMost(128))))\n }\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMap\n */\npublic inline fun Array.flatMap(transform: (T) -> Iterable): List {\n return flatMapTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMap\n */\npublic inline fun ByteArray.flatMap(transform: (Byte) -> Iterable): List {\n return flatMapTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMap\n */\npublic inline fun ShortArray.flatMap(transform: (Short) -> Iterable): List {\n return flatMapTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMap\n */\npublic inline fun IntArray.flatMap(transform: (Int) -> Iterable): List {\n return flatMapTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMap\n */\npublic inline fun LongArray.flatMap(transform: (Long) -> Iterable): List {\n return flatMapTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMap\n */\npublic inline fun FloatArray.flatMap(transform: (Float) -> Iterable): List {\n return flatMapTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMap\n */\npublic inline fun DoubleArray.flatMap(transform: (Double) -> Iterable): List {\n return flatMapTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMap\n */\npublic inline fun BooleanArray.flatMap(transform: (Boolean) -> Iterable): List {\n return flatMapTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMap\n */\npublic inline fun CharArray.flatMap(transform: (Char) -> Iterable): List {\n return flatMapTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMap\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapSequence\")\npublic inline fun Array.flatMap(transform: (T) -> Sequence): List {\n return flatMapTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMapIndexed\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterable\")\n@kotlin.internal.InlineOnly\npublic inline fun Array.flatMapIndexed(transform: (index: Int, T) -> Iterable): List {\n return flatMapIndexedTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMapIndexed\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterable\")\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.flatMapIndexed(transform: (index: Int, Byte) -> Iterable): List {\n return flatMapIndexedTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMapIndexed\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterable\")\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.flatMapIndexed(transform: (index: Int, Short) -> Iterable): List {\n return flatMapIndexedTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMapIndexed\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterable\")\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.flatMapIndexed(transform: (index: Int, Int) -> Iterable): List {\n return flatMapIndexedTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMapIndexed\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterable\")\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.flatMapIndexed(transform: (index: Int, Long) -> Iterable): List {\n return flatMapIndexedTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMapIndexed\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterable\")\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.flatMapIndexed(transform: (index: Int, Float) -> Iterable): List {\n return flatMapIndexedTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMapIndexed\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterable\")\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.flatMapIndexed(transform: (index: Int, Double) -> Iterable): List {\n return flatMapIndexedTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMapIndexed\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterable\")\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.flatMapIndexed(transform: (index: Int, Boolean) -> Iterable): List {\n return flatMapIndexedTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMapIndexed\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterable\")\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.flatMapIndexed(transform: (index: Int, Char) -> Iterable): List {\n return flatMapIndexedTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMapIndexed\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedSequence\")\n@kotlin.internal.InlineOnly\npublic inline fun Array.flatMapIndexed(transform: (index: Int, T) -> Sequence): List {\n return flatMapIndexedTo(ArrayList(), transform)\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array, to the given [destination].\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterableTo\")\n@kotlin.internal.InlineOnly\npublic inline fun > Array.flatMapIndexedTo(destination: C, transform: (index: Int, T) -> Iterable): C {\n var index = 0\n for (element in this) {\n val list = transform(index++, element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array, to the given [destination].\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterableTo\")\n@kotlin.internal.InlineOnly\npublic inline fun > ByteArray.flatMapIndexedTo(destination: C, transform: (index: Int, Byte) -> Iterable): C {\n var index = 0\n for (element in this) {\n val list = transform(index++, element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array, to the given [destination].\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterableTo\")\n@kotlin.internal.InlineOnly\npublic inline fun > ShortArray.flatMapIndexedTo(destination: C, transform: (index: Int, Short) -> Iterable): C {\n var index = 0\n for (element in this) {\n val list = transform(index++, element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array, to the given [destination].\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterableTo\")\n@kotlin.internal.InlineOnly\npublic inline fun > IntArray.flatMapIndexedTo(destination: C, transform: (index: Int, Int) -> Iterable): C {\n var index = 0\n for (element in this) {\n val list = transform(index++, element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array, to the given [destination].\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterableTo\")\n@kotlin.internal.InlineOnly\npublic inline fun > LongArray.flatMapIndexedTo(destination: C, transform: (index: Int, Long) -> Iterable): C {\n var index = 0\n for (element in this) {\n val list = transform(index++, element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array, to the given [destination].\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterableTo\")\n@kotlin.internal.InlineOnly\npublic inline fun > FloatArray.flatMapIndexedTo(destination: C, transform: (index: Int, Float) -> Iterable): C {\n var index = 0\n for (element in this) {\n val list = transform(index++, element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array, to the given [destination].\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterableTo\")\n@kotlin.internal.InlineOnly\npublic inline fun > DoubleArray.flatMapIndexedTo(destination: C, transform: (index: Int, Double) -> Iterable): C {\n var index = 0\n for (element in this) {\n val list = transform(index++, element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array, to the given [destination].\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterableTo\")\n@kotlin.internal.InlineOnly\npublic inline fun > BooleanArray.flatMapIndexedTo(destination: C, transform: (index: Int, Boolean) -> Iterable): C {\n var index = 0\n for (element in this) {\n val list = transform(index++, element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array, to the given [destination].\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterableTo\")\n@kotlin.internal.InlineOnly\npublic inline fun > CharArray.flatMapIndexedTo(destination: C, transform: (index: Int, Char) -> Iterable): C {\n var index = 0\n for (element in this) {\n val list = transform(index++, element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array, to the given [destination].\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedSequenceTo\")\n@kotlin.internal.InlineOnly\npublic inline fun > Array.flatMapIndexedTo(destination: C, transform: (index: Int, T) -> Sequence): C {\n var index = 0\n for (element in this) {\n val list = transform(index++, element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element of original array, to the given [destination].\n */\npublic inline fun > Array.flatMapTo(destination: C, transform: (T) -> Iterable): C {\n for (element in this) {\n val list = transform(element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element of original array, to the given [destination].\n */\npublic inline fun > ByteArray.flatMapTo(destination: C, transform: (Byte) -> Iterable): C {\n for (element in this) {\n val list = transform(element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element of original array, to the given [destination].\n */\npublic inline fun > ShortArray.flatMapTo(destination: C, transform: (Short) -> Iterable): C {\n for (element in this) {\n val list = transform(element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element of original array, to the given [destination].\n */\npublic inline fun > IntArray.flatMapTo(destination: C, transform: (Int) -> Iterable): C {\n for (element in this) {\n val list = transform(element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element of original array, to the given [destination].\n */\npublic inline fun > LongArray.flatMapTo(destination: C, transform: (Long) -> Iterable): C {\n for (element in this) {\n val list = transform(element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element of original array, to the given [destination].\n */\npublic inline fun > FloatArray.flatMapTo(destination: C, transform: (Float) -> Iterable): C {\n for (element in this) {\n val list = transform(element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element of original array, to the given [destination].\n */\npublic inline fun > DoubleArray.flatMapTo(destination: C, transform: (Double) -> Iterable): C {\n for (element in this) {\n val list = transform(element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element of original array, to the given [destination].\n */\npublic inline fun > BooleanArray.flatMapTo(destination: C, transform: (Boolean) -> Iterable): C {\n for (element in this) {\n val list = transform(element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element of original array, to the given [destination].\n */\npublic inline fun > CharArray.flatMapTo(destination: C, transform: (Char) -> Iterable): C {\n for (element in this) {\n val list = transform(element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element of original array, to the given [destination].\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapSequenceTo\")\npublic inline fun > Array.flatMapTo(destination: C, transform: (T) -> Sequence): C {\n for (element in this) {\n val list = transform(element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and returns a map where each group key is associated with a list of corresponding elements.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun Array.groupBy(keySelector: (T) -> K): Map> {\n return groupByTo(LinkedHashMap>(), keySelector)\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and returns a map where each group key is associated with a list of corresponding elements.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun ByteArray.groupBy(keySelector: (Byte) -> K): Map> {\n return groupByTo(LinkedHashMap>(), keySelector)\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and returns a map where each group key is associated with a list of corresponding elements.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun ShortArray.groupBy(keySelector: (Short) -> K): Map> {\n return groupByTo(LinkedHashMap>(), keySelector)\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and returns a map where each group key is associated with a list of corresponding elements.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun IntArray.groupBy(keySelector: (Int) -> K): Map> {\n return groupByTo(LinkedHashMap>(), keySelector)\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and returns a map where each group key is associated with a list of corresponding elements.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun LongArray.groupBy(keySelector: (Long) -> K): Map> {\n return groupByTo(LinkedHashMap>(), keySelector)\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and returns a map where each group key is associated with a list of corresponding elements.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun FloatArray.groupBy(keySelector: (Float) -> K): Map> {\n return groupByTo(LinkedHashMap>(), keySelector)\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and returns a map where each group key is associated with a list of corresponding elements.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun DoubleArray.groupBy(keySelector: (Double) -> K): Map> {\n return groupByTo(LinkedHashMap>(), keySelector)\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and returns a map where each group key is associated with a list of corresponding elements.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun BooleanArray.groupBy(keySelector: (Boolean) -> K): Map> {\n return groupByTo(LinkedHashMap>(), keySelector)\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and returns a map where each group key is associated with a list of corresponding elements.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun CharArray.groupBy(keySelector: (Char) -> K): Map> {\n return groupByTo(LinkedHashMap>(), keySelector)\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and returns a map where each group key is associated with a list of corresponding values.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun Array.groupBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map> {\n return groupByTo(LinkedHashMap>(), keySelector, valueTransform)\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and returns a map where each group key is associated with a list of corresponding values.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun ByteArray.groupBy(keySelector: (Byte) -> K, valueTransform: (Byte) -> V): Map> {\n return groupByTo(LinkedHashMap>(), keySelector, valueTransform)\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and returns a map where each group key is associated with a list of corresponding values.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun ShortArray.groupBy(keySelector: (Short) -> K, valueTransform: (Short) -> V): Map> {\n return groupByTo(LinkedHashMap>(), keySelector, valueTransform)\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and returns a map where each group key is associated with a list of corresponding values.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun IntArray.groupBy(keySelector: (Int) -> K, valueTransform: (Int) -> V): Map> {\n return groupByTo(LinkedHashMap>(), keySelector, valueTransform)\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and returns a map where each group key is associated with a list of corresponding values.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun LongArray.groupBy(keySelector: (Long) -> K, valueTransform: (Long) -> V): Map> {\n return groupByTo(LinkedHashMap>(), keySelector, valueTransform)\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and returns a map where each group key is associated with a list of corresponding values.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun FloatArray.groupBy(keySelector: (Float) -> K, valueTransform: (Float) -> V): Map> {\n return groupByTo(LinkedHashMap>(), keySelector, valueTransform)\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and returns a map where each group key is associated with a list of corresponding values.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun DoubleArray.groupBy(keySelector: (Double) -> K, valueTransform: (Double) -> V): Map> {\n return groupByTo(LinkedHashMap>(), keySelector, valueTransform)\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and returns a map where each group key is associated with a list of corresponding values.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun BooleanArray.groupBy(keySelector: (Boolean) -> K, valueTransform: (Boolean) -> V): Map> {\n return groupByTo(LinkedHashMap>(), keySelector, valueTransform)\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and returns a map where each group key is associated with a list of corresponding values.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun CharArray.groupBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map> {\n return groupByTo(LinkedHashMap>(), keySelector, valueTransform)\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun >> Array.groupByTo(destination: M, keySelector: (T) -> K): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(element)\n }\n return destination\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun >> ByteArray.groupByTo(destination: M, keySelector: (Byte) -> K): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(element)\n }\n return destination\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun >> ShortArray.groupByTo(destination: M, keySelector: (Short) -> K): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(element)\n }\n return destination\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun >> IntArray.groupByTo(destination: M, keySelector: (Int) -> K): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(element)\n }\n return destination\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun >> LongArray.groupByTo(destination: M, keySelector: (Long) -> K): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(element)\n }\n return destination\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun >> FloatArray.groupByTo(destination: M, keySelector: (Float) -> K): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(element)\n }\n return destination\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun >> DoubleArray.groupByTo(destination: M, keySelector: (Double) -> K): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(element)\n }\n return destination\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun >> BooleanArray.groupByTo(destination: M, keySelector: (Boolean) -> K): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(element)\n }\n return destination\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun >> CharArray.groupByTo(destination: M, keySelector: (Char) -> K): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(element)\n }\n return destination\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and puts to the [destination] map each group key associated with a list of corresponding values.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun >> Array.groupByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(valueTransform(element))\n }\n return destination\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and puts to the [destination] map each group key associated with a list of corresponding values.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun >> ByteArray.groupByTo(destination: M, keySelector: (Byte) -> K, valueTransform: (Byte) -> V): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(valueTransform(element))\n }\n return destination\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and puts to the [destination] map each group key associated with a list of corresponding values.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun >> ShortArray.groupByTo(destination: M, keySelector: (Short) -> K, valueTransform: (Short) -> V): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(valueTransform(element))\n }\n return destination\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and puts to the [destination] map each group key associated with a list of corresponding values.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun >> IntArray.groupByTo(destination: M, keySelector: (Int) -> K, valueTransform: (Int) -> V): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(valueTransform(element))\n }\n return destination\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and puts to the [destination] map each group key associated with a list of corresponding values.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun >> LongArray.groupByTo(destination: M, keySelector: (Long) -> K, valueTransform: (Long) -> V): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(valueTransform(element))\n }\n return destination\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and puts to the [destination] map each group key associated with a list of corresponding values.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun >> FloatArray.groupByTo(destination: M, keySelector: (Float) -> K, valueTransform: (Float) -> V): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(valueTransform(element))\n }\n return destination\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and puts to the [destination] map each group key associated with a list of corresponding values.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun >> DoubleArray.groupByTo(destination: M, keySelector: (Double) -> K, valueTransform: (Double) -> V): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(valueTransform(element))\n }\n return destination\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and puts to the [destination] map each group key associated with a list of corresponding values.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun >> BooleanArray.groupByTo(destination: M, keySelector: (Boolean) -> K, valueTransform: (Boolean) -> V): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(valueTransform(element))\n }\n return destination\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and puts to the [destination] map each group key associated with a list of corresponding values.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun >> CharArray.groupByTo(destination: M, keySelector: (Char) -> K, valueTransform: (Char) -> V): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(valueTransform(element))\n }\n return destination\n}\n\n/**\n * Creates a [Grouping] source from an array to be used later with one of group-and-fold operations\n * using the specified [keySelector] function to extract a key from each element.\n * \n * @sample samples.collections.Grouping.groupingByEachCount\n */\n@SinceKotlin(\"1.1\")\npublic inline fun Array.groupingBy(crossinline keySelector: (T) -> K): Grouping {\n return object : Grouping {\n override fun sourceIterator(): Iterator = this@groupingBy.iterator()\n override fun keyOf(element: T): K = keySelector(element)\n }\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element in the original array.\n * \n * @sample samples.collections.Collections.Transformations.map\n */\npublic inline fun Array.map(transform: (T) -> R): List {\n return mapTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element in the original array.\n * \n * @sample samples.collections.Collections.Transformations.map\n */\npublic inline fun ByteArray.map(transform: (Byte) -> R): List {\n return mapTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element in the original array.\n * \n * @sample samples.collections.Collections.Transformations.map\n */\npublic inline fun ShortArray.map(transform: (Short) -> R): List {\n return mapTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element in the original array.\n * \n * @sample samples.collections.Collections.Transformations.map\n */\npublic inline fun IntArray.map(transform: (Int) -> R): List {\n return mapTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element in the original array.\n * \n * @sample samples.collections.Collections.Transformations.map\n */\npublic inline fun LongArray.map(transform: (Long) -> R): List {\n return mapTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element in the original array.\n * \n * @sample samples.collections.Collections.Transformations.map\n */\npublic inline fun FloatArray.map(transform: (Float) -> R): List {\n return mapTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element in the original array.\n * \n * @sample samples.collections.Collections.Transformations.map\n */\npublic inline fun DoubleArray.map(transform: (Double) -> R): List {\n return mapTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element in the original array.\n * \n * @sample samples.collections.Collections.Transformations.map\n */\npublic inline fun BooleanArray.map(transform: (Boolean) -> R): List {\n return mapTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element in the original array.\n * \n * @sample samples.collections.Collections.Transformations.map\n */\npublic inline fun CharArray.map(transform: (Char) -> R): List {\n return mapTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element and its index in the original array.\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun Array.mapIndexed(transform: (index: Int, T) -> R): List {\n return mapIndexedTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element and its index in the original array.\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun ByteArray.mapIndexed(transform: (index: Int, Byte) -> R): List {\n return mapIndexedTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element and its index in the original array.\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun ShortArray.mapIndexed(transform: (index: Int, Short) -> R): List {\n return mapIndexedTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element and its index in the original array.\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun IntArray.mapIndexed(transform: (index: Int, Int) -> R): List {\n return mapIndexedTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element and its index in the original array.\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun LongArray.mapIndexed(transform: (index: Int, Long) -> R): List {\n return mapIndexedTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element and its index in the original array.\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun FloatArray.mapIndexed(transform: (index: Int, Float) -> R): List {\n return mapIndexedTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element and its index in the original array.\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun DoubleArray.mapIndexed(transform: (index: Int, Double) -> R): List {\n return mapIndexedTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element and its index in the original array.\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun BooleanArray.mapIndexed(transform: (index: Int, Boolean) -> R): List {\n return mapIndexedTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element and its index in the original array.\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun CharArray.mapIndexed(transform: (index: Int, Char) -> R): List {\n return mapIndexedTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing only the non-null results of applying the given [transform] function\n * to each element and its index in the original array.\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun Array.mapIndexedNotNull(transform: (index: Int, T) -> R?): List {\n return mapIndexedNotNullTo(ArrayList(), transform)\n}\n\n/**\n * Applies the given [transform] function to each element and its index in the original array\n * and appends only the non-null results to the given [destination].\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun > Array.mapIndexedNotNullTo(destination: C, transform: (index: Int, T) -> R?): C {\n forEachIndexed { index, element -> transform(index, element)?.let { destination.add(it) } }\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element and its index in the original array\n * and appends the results to the given [destination].\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun > Array.mapIndexedTo(destination: C, transform: (index: Int, T) -> R): C {\n var index = 0\n for (item in this)\n destination.add(transform(index++, item))\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element and its index in the original array\n * and appends the results to the given [destination].\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun > ByteArray.mapIndexedTo(destination: C, transform: (index: Int, Byte) -> R): C {\n var index = 0\n for (item in this)\n destination.add(transform(index++, item))\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element and its index in the original array\n * and appends the results to the given [destination].\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun > ShortArray.mapIndexedTo(destination: C, transform: (index: Int, Short) -> R): C {\n var index = 0\n for (item in this)\n destination.add(transform(index++, item))\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element and its index in the original array\n * and appends the results to the given [destination].\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun > IntArray.mapIndexedTo(destination: C, transform: (index: Int, Int) -> R): C {\n var index = 0\n for (item in this)\n destination.add(transform(index++, item))\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element and its index in the original array\n * and appends the results to the given [destination].\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun > LongArray.mapIndexedTo(destination: C, transform: (index: Int, Long) -> R): C {\n var index = 0\n for (item in this)\n destination.add(transform(index++, item))\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element and its index in the original array\n * and appends the results to the given [destination].\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun > FloatArray.mapIndexedTo(destination: C, transform: (index: Int, Float) -> R): C {\n var index = 0\n for (item in this)\n destination.add(transform(index++, item))\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element and its index in the original array\n * and appends the results to the given [destination].\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun > DoubleArray.mapIndexedTo(destination: C, transform: (index: Int, Double) -> R): C {\n var index = 0\n for (item in this)\n destination.add(transform(index++, item))\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element and its index in the original array\n * and appends the results to the given [destination].\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun > BooleanArray.mapIndexedTo(destination: C, transform: (index: Int, Boolean) -> R): C {\n var index = 0\n for (item in this)\n destination.add(transform(index++, item))\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element and its index in the original array\n * and appends the results to the given [destination].\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun > CharArray.mapIndexedTo(destination: C, transform: (index: Int, Char) -> R): C {\n var index = 0\n for (item in this)\n destination.add(transform(index++, item))\n return destination\n}\n\n/**\n * Returns a list containing only the non-null results of applying the given [transform] function\n * to each element in the original array.\n * \n * @sample samples.collections.Collections.Transformations.mapNotNull\n */\npublic inline fun Array.mapNotNull(transform: (T) -> R?): List {\n return mapNotNullTo(ArrayList(), transform)\n}\n\n/**\n * Applies the given [transform] function to each element in the original array\n * and appends only the non-null results to the given [destination].\n */\npublic inline fun > Array.mapNotNullTo(destination: C, transform: (T) -> R?): C {\n forEach { element -> transform(element)?.let { destination.add(it) } }\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element of the original array\n * and appends the results to the given [destination].\n */\npublic inline fun > Array.mapTo(destination: C, transform: (T) -> R): C {\n for (item in this)\n destination.add(transform(item))\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element of the original array\n * and appends the results to the given [destination].\n */\npublic inline fun > ByteArray.mapTo(destination: C, transform: (Byte) -> R): C {\n for (item in this)\n destination.add(transform(item))\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element of the original array\n * and appends the results to the given [destination].\n */\npublic inline fun > ShortArray.mapTo(destination: C, transform: (Short) -> R): C {\n for (item in this)\n destination.add(transform(item))\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element of the original array\n * and appends the results to the given [destination].\n */\npublic inline fun > IntArray.mapTo(destination: C, transform: (Int) -> R): C {\n for (item in this)\n destination.add(transform(item))\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element of the original array\n * and appends the results to the given [destination].\n */\npublic inline fun > LongArray.mapTo(destination: C, transform: (Long) -> R): C {\n for (item in this)\n destination.add(transform(item))\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element of the original array\n * and appends the results to the given [destination].\n */\npublic inline fun > FloatArray.mapTo(destination: C, transform: (Float) -> R): C {\n for (item in this)\n destination.add(transform(item))\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element of the original array\n * and appends the results to the given [destination].\n */\npublic inline fun > DoubleArray.mapTo(destination: C, transform: (Double) -> R): C {\n for (item in this)\n destination.add(transform(item))\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element of the original array\n * and appends the results to the given [destination].\n */\npublic inline fun > BooleanArray.mapTo(destination: C, transform: (Boolean) -> R): C {\n for (item in this)\n destination.add(transform(item))\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element of the original array\n * and appends the results to the given [destination].\n */\npublic inline fun > CharArray.mapTo(destination: C, transform: (Char) -> R): C {\n for (item in this)\n destination.add(transform(item))\n return destination\n}\n\n/**\n * Returns a lazy [Iterable] that wraps each element of the original array\n * into an [IndexedValue] containing the index of that element and the element itself.\n */\npublic fun Array.withIndex(): Iterable> {\n return IndexingIterable { iterator() }\n}\n\n/**\n * Returns a lazy [Iterable] that wraps each element of the original array\n * into an [IndexedValue] containing the index of that element and the element itself.\n */\npublic fun ByteArray.withIndex(): Iterable> {\n return IndexingIterable { iterator() }\n}\n\n/**\n * Returns a lazy [Iterable] that wraps each element of the original array\n * into an [IndexedValue] containing the index of that element and the element itself.\n */\npublic fun ShortArray.withIndex(): Iterable> {\n return IndexingIterable { iterator() }\n}\n\n/**\n * Returns a lazy [Iterable] that wraps each element of the original array\n * into an [IndexedValue] containing the index of that element and the element itself.\n */\npublic fun IntArray.withIndex(): Iterable> {\n return IndexingIterable { iterator() }\n}\n\n/**\n * Returns a lazy [Iterable] that wraps each element of the original array\n * into an [IndexedValue] containing the index of that element and the element itself.\n */\npublic fun LongArray.withIndex(): Iterable> {\n return IndexingIterable { iterator() }\n}\n\n/**\n * Returns a lazy [Iterable] that wraps each element of the original array\n * into an [IndexedValue] containing the index of that element and the element itself.\n */\npublic fun FloatArray.withIndex(): Iterable> {\n return IndexingIterable { iterator() }\n}\n\n/**\n * Returns a lazy [Iterable] that wraps each element of the original array\n * into an [IndexedValue] containing the index of that element and the element itself.\n */\npublic fun DoubleArray.withIndex(): Iterable> {\n return IndexingIterable { iterator() }\n}\n\n/**\n * Returns a lazy [Iterable] that wraps each element of the original array\n * into an [IndexedValue] containing the index of that element and the element itself.\n */\npublic fun BooleanArray.withIndex(): Iterable> {\n return IndexingIterable { iterator() }\n}\n\n/**\n * Returns a lazy [Iterable] that wraps each element of the original array\n * into an [IndexedValue] containing the index of that element and the element itself.\n */\npublic fun CharArray.withIndex(): Iterable> {\n return IndexingIterable { iterator() }\n}\n\n/**\n * Returns a list containing only distinct elements from the given array.\n * \n * Among equal elements of the given array, only the first one will be present in the resulting list.\n * The elements in the resulting list are in the same order as they were in the source array.\n * \n * @sample samples.collections.Collections.Transformations.distinctAndDistinctBy\n */\npublic fun Array.distinct(): List {\n return this.toMutableSet().toList()\n}\n\n/**\n * Returns a list containing only distinct elements from the given array.\n * \n * The elements in the resulting list are in the same order as they were in the source array.\n * \n * @sample samples.collections.Collections.Transformations.distinctAndDistinctBy\n */\npublic fun ByteArray.distinct(): List {\n return this.toMutableSet().toList()\n}\n\n/**\n * Returns a list containing only distinct elements from the given array.\n * \n * The elements in the resulting list are in the same order as they were in the source array.\n * \n * @sample samples.collections.Collections.Transformations.distinctAndDistinctBy\n */\npublic fun ShortArray.distinct(): List {\n return this.toMutableSet().toList()\n}\n\n/**\n * Returns a list containing only distinct elements from the given array.\n * \n * The elements in the resulting list are in the same order as they were in the source array.\n * \n * @sample samples.collections.Collections.Transformations.distinctAndDistinctBy\n */\npublic fun IntArray.distinct(): List {\n return this.toMutableSet().toList()\n}\n\n/**\n * Returns a list containing only distinct elements from the given array.\n * \n * The elements in the resulting list are in the same order as they were in the source array.\n * \n * @sample samples.collections.Collections.Transformations.distinctAndDistinctBy\n */\npublic fun LongArray.distinct(): List {\n return this.toMutableSet().toList()\n}\n\n/**\n * Returns a list containing only distinct elements from the given array.\n * \n * The elements in the resulting list are in the same order as they were in the source array.\n * \n * @sample samples.collections.Collections.Transformations.distinctAndDistinctBy\n */\npublic fun FloatArray.distinct(): List {\n return this.toMutableSet().toList()\n}\n\n/**\n * Returns a list containing only distinct elements from the given array.\n * \n * The elements in the resulting list are in the same order as they were in the source array.\n * \n * @sample samples.collections.Collections.Transformations.distinctAndDistinctBy\n */\npublic fun DoubleArray.distinct(): List {\n return this.toMutableSet().toList()\n}\n\n/**\n * Returns a list containing only distinct elements from the given array.\n * \n * The elements in the resulting list are in the same order as they were in the source array.\n * \n * @sample samples.collections.Collections.Transformations.distinctAndDistinctBy\n */\npublic fun BooleanArray.distinct(): List {\n return this.toMutableSet().toList()\n}\n\n/**\n * Returns a list containing only distinct elements from the given array.\n * \n * The elements in the resulting list are in the same order as they were in the source array.\n * \n * @sample samples.collections.Collections.Transformations.distinctAndDistinctBy\n */\npublic fun CharArray.distinct(): List {\n return this.toMutableSet().toList()\n}\n\n/**\n * Returns a list containing only elements from the given array\n * having distinct keys returned by the given [selector] function.\n * \n * Among elements of the given array with equal keys, only the first one will be present in the resulting list.\n * The elements in the resulting list are in the same order as they were in the source array.\n * \n * @sample samples.collections.Collections.Transformations.distinctAndDistinctBy\n */\npublic inline fun Array.distinctBy(selector: (T) -> K): List {\n val set = HashSet()\n val list = ArrayList()\n for (e in this) {\n val key = selector(e)\n if (set.add(key))\n list.add(e)\n }\n return list\n}\n\n/**\n * Returns a list containing only elements from the given array\n * having distinct keys returned by the given [selector] function.\n * \n * The elements in the resulting list are in the same order as they were in the source array.\n * \n * @sample samples.collections.Collections.Transformations.distinctAndDistinctBy\n */\npublic inline fun ByteArray.distinctBy(selector: (Byte) -> K): List {\n val set = HashSet()\n val list = ArrayList()\n for (e in this) {\n val key = selector(e)\n if (set.add(key))\n list.add(e)\n }\n return list\n}\n\n/**\n * Returns a list containing only elements from the given array\n * having distinct keys returned by the given [selector] function.\n * \n * The elements in the resulting list are in the same order as they were in the source array.\n * \n * @sample samples.collections.Collections.Transformations.distinctAndDistinctBy\n */\npublic inline fun ShortArray.distinctBy(selector: (Short) -> K): List {\n val set = HashSet()\n val list = ArrayList()\n for (e in this) {\n val key = selector(e)\n if (set.add(key))\n list.add(e)\n }\n return list\n}\n\n/**\n * Returns a list containing only elements from the given array\n * having distinct keys returned by the given [selector] function.\n * \n * The elements in the resulting list are in the same order as they were in the source array.\n * \n * @sample samples.collections.Collections.Transformations.distinctAndDistinctBy\n */\npublic inline fun IntArray.distinctBy(selector: (Int) -> K): List {\n val set = HashSet()\n val list = ArrayList()\n for (e in this) {\n val key = selector(e)\n if (set.add(key))\n list.add(e)\n }\n return list\n}\n\n/**\n * Returns a list containing only elements from the given array\n * having distinct keys returned by the given [selector] function.\n * \n * The elements in the resulting list are in the same order as they were in the source array.\n * \n * @sample samples.collections.Collections.Transformations.distinctAndDistinctBy\n */\npublic inline fun LongArray.distinctBy(selector: (Long) -> K): List {\n val set = HashSet()\n val list = ArrayList()\n for (e in this) {\n val key = selector(e)\n if (set.add(key))\n list.add(e)\n }\n return list\n}\n\n/**\n * Returns a list containing only elements from the given array\n * having distinct keys returned by the given [selector] function.\n * \n * The elements in the resulting list are in the same order as they were in the source array.\n * \n * @sample samples.collections.Collections.Transformations.distinctAndDistinctBy\n */\npublic inline fun FloatArray.distinctBy(selector: (Float) -> K): List {\n val set = HashSet()\n val list = ArrayList()\n for (e in this) {\n val key = selector(e)\n if (set.add(key))\n list.add(e)\n }\n return list\n}\n\n/**\n * Returns a list containing only elements from the given array\n * having distinct keys returned by the given [selector] function.\n * \n * The elements in the resulting list are in the same order as they were in the source array.\n * \n * @sample samples.collections.Collections.Transformations.distinctAndDistinctBy\n */\npublic inline fun DoubleArray.distinctBy(selector: (Double) -> K): List {\n val set = HashSet()\n val list = ArrayList()\n for (e in this) {\n val key = selector(e)\n if (set.add(key))\n list.add(e)\n }\n return list\n}\n\n/**\n * Returns a list containing only elements from the given array\n * having distinct keys returned by the given [selector] function.\n * \n * The elements in the resulting list are in the same order as they were in the source array.\n * \n * @sample samples.collections.Collections.Transformations.distinctAndDistinctBy\n */\npublic inline fun BooleanArray.distinctBy(selector: (Boolean) -> K): List {\n val set = HashSet()\n val list = ArrayList()\n for (e in this) {\n val key = selector(e)\n if (set.add(key))\n list.add(e)\n }\n return list\n}\n\n/**\n * Returns a list containing only elements from the given array\n * having distinct keys returned by the given [selector] function.\n * \n * The elements in the resulting list are in the same order as they were in the source array.\n * \n * @sample samples.collections.Collections.Transformations.distinctAndDistinctBy\n */\npublic inline fun CharArray.distinctBy(selector: (Char) -> K): List {\n val set = HashSet()\n val list = ArrayList()\n for (e in this) {\n val key = selector(e)\n if (set.add(key))\n list.add(e)\n }\n return list\n}\n\n/**\n * Returns a set containing all elements that are contained by both this array and the specified collection.\n * \n * The returned set preserves the element iteration order of the original array.\n * \n * To get a set containing all elements that are contained at least in one of these collections use [union].\n */\npublic infix fun Array.intersect(other: Iterable): Set {\n val set = this.toMutableSet()\n set.retainAll(other)\n return set\n}\n\n/**\n * Returns a set containing all elements that are contained by both this array and the specified collection.\n * \n * The returned set preserves the element iteration order of the original array.\n * \n * To get a set containing all elements that are contained at least in one of these collections use [union].\n */\npublic infix fun ByteArray.intersect(other: Iterable): Set {\n val set = this.toMutableSet()\n set.retainAll(other)\n return set\n}\n\n/**\n * Returns a set containing all elements that are contained by both this array and the specified collection.\n * \n * The returned set preserves the element iteration order of the original array.\n * \n * To get a set containing all elements that are contained at least in one of these collections use [union].\n */\npublic infix fun ShortArray.intersect(other: Iterable): Set {\n val set = this.toMutableSet()\n set.retainAll(other)\n return set\n}\n\n/**\n * Returns a set containing all elements that are contained by both this array and the specified collection.\n * \n * The returned set preserves the element iteration order of the original array.\n * \n * To get a set containing all elements that are contained at least in one of these collections use [union].\n */\npublic infix fun IntArray.intersect(other: Iterable): Set {\n val set = this.toMutableSet()\n set.retainAll(other)\n return set\n}\n\n/**\n * Returns a set containing all elements that are contained by both this array and the specified collection.\n * \n * The returned set preserves the element iteration order of the original array.\n * \n * To get a set containing all elements that are contained at least in one of these collections use [union].\n */\npublic infix fun LongArray.intersect(other: Iterable): Set {\n val set = this.toMutableSet()\n set.retainAll(other)\n return set\n}\n\n/**\n * Returns a set containing all elements that are contained by both this array and the specified collection.\n * \n * The returned set preserves the element iteration order of the original array.\n * \n * To get a set containing all elements that are contained at least in one of these collections use [union].\n */\npublic infix fun FloatArray.intersect(other: Iterable): Set {\n val set = this.toMutableSet()\n set.retainAll(other)\n return set\n}\n\n/**\n * Returns a set containing all elements that are contained by both this array and the specified collection.\n * \n * The returned set preserves the element iteration order of the original array.\n * \n * To get a set containing all elements that are contained at least in one of these collections use [union].\n */\npublic infix fun DoubleArray.intersect(other: Iterable): Set {\n val set = this.toMutableSet()\n set.retainAll(other)\n return set\n}\n\n/**\n * Returns a set containing all elements that are contained by both this array and the specified collection.\n * \n * The returned set preserves the element iteration order of the original array.\n * \n * To get a set containing all elements that are contained at least in one of these collections use [union].\n */\npublic infix fun BooleanArray.intersect(other: Iterable): Set {\n val set = this.toMutableSet()\n set.retainAll(other)\n return set\n}\n\n/**\n * Returns a set containing all elements that are contained by both this array and the specified collection.\n * \n * The returned set preserves the element iteration order of the original array.\n * \n * To get a set containing all elements that are contained at least in one of these collections use [union].\n */\npublic infix fun CharArray.intersect(other: Iterable): Set {\n val set = this.toMutableSet()\n set.retainAll(other)\n return set\n}\n\n/**\n * Returns a set containing all elements that are contained by this array and not contained by the specified collection.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic infix fun Array.subtract(other: Iterable): Set {\n val set = this.toMutableSet()\n set.removeAll(other)\n return set\n}\n\n/**\n * Returns a set containing all elements that are contained by this array and not contained by the specified collection.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic infix fun ByteArray.subtract(other: Iterable): Set {\n val set = this.toMutableSet()\n set.removeAll(other)\n return set\n}\n\n/**\n * Returns a set containing all elements that are contained by this array and not contained by the specified collection.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic infix fun ShortArray.subtract(other: Iterable): Set {\n val set = this.toMutableSet()\n set.removeAll(other)\n return set\n}\n\n/**\n * Returns a set containing all elements that are contained by this array and not contained by the specified collection.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic infix fun IntArray.subtract(other: Iterable): Set {\n val set = this.toMutableSet()\n set.removeAll(other)\n return set\n}\n\n/**\n * Returns a set containing all elements that are contained by this array and not contained by the specified collection.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic infix fun LongArray.subtract(other: Iterable): Set {\n val set = this.toMutableSet()\n set.removeAll(other)\n return set\n}\n\n/**\n * Returns a set containing all elements that are contained by this array and not contained by the specified collection.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic infix fun FloatArray.subtract(other: Iterable): Set {\n val set = this.toMutableSet()\n set.removeAll(other)\n return set\n}\n\n/**\n * Returns a set containing all elements that are contained by this array and not contained by the specified collection.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic infix fun DoubleArray.subtract(other: Iterable): Set {\n val set = this.toMutableSet()\n set.removeAll(other)\n return set\n}\n\n/**\n * Returns a set containing all elements that are contained by this array and not contained by the specified collection.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic infix fun BooleanArray.subtract(other: Iterable): Set {\n val set = this.toMutableSet()\n set.removeAll(other)\n return set\n}\n\n/**\n * Returns a set containing all elements that are contained by this array and not contained by the specified collection.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic infix fun CharArray.subtract(other: Iterable): Set {\n val set = this.toMutableSet()\n set.removeAll(other)\n return set\n}\n\n/**\n * Returns a new [MutableSet] containing all distinct elements from the given array.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic fun Array.toMutableSet(): MutableSet {\n return toCollection(LinkedHashSet(mapCapacity(size)))\n}\n\n/**\n * Returns a new [MutableSet] containing all distinct elements from the given array.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic fun ByteArray.toMutableSet(): MutableSet {\n return toCollection(LinkedHashSet(mapCapacity(size)))\n}\n\n/**\n * Returns a new [MutableSet] containing all distinct elements from the given array.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic fun ShortArray.toMutableSet(): MutableSet {\n return toCollection(LinkedHashSet(mapCapacity(size)))\n}\n\n/**\n * Returns a new [MutableSet] containing all distinct elements from the given array.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic fun IntArray.toMutableSet(): MutableSet {\n return toCollection(LinkedHashSet(mapCapacity(size)))\n}\n\n/**\n * Returns a new [MutableSet] containing all distinct elements from the given array.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic fun LongArray.toMutableSet(): MutableSet {\n return toCollection(LinkedHashSet(mapCapacity(size)))\n}\n\n/**\n * Returns a new [MutableSet] containing all distinct elements from the given array.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic fun FloatArray.toMutableSet(): MutableSet {\n return toCollection(LinkedHashSet(mapCapacity(size)))\n}\n\n/**\n * Returns a new [MutableSet] containing all distinct elements from the given array.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic fun DoubleArray.toMutableSet(): MutableSet {\n return toCollection(LinkedHashSet(mapCapacity(size)))\n}\n\n/**\n * Returns a new [MutableSet] containing all distinct elements from the given array.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic fun BooleanArray.toMutableSet(): MutableSet {\n return toCollection(LinkedHashSet(mapCapacity(size)))\n}\n\n/**\n * Returns a new [MutableSet] containing all distinct elements from the given array.\n * \n * The returned set preserves the element iteration order of the original array.\n */\npublic fun CharArray.toMutableSet(): MutableSet {\n return toCollection(LinkedHashSet(mapCapacity(size.coerceAtMost(128))))\n}\n\n/**\n * Returns a set containing all distinct elements from both collections.\n * \n * The returned set preserves the element iteration order of the original array.\n * Those elements of the [other] collection that are unique are iterated in the end\n * in the order of the [other] collection.\n * \n * To get a set containing all elements that are contained in both collections use [intersect].\n */\npublic infix fun Array.union(other: Iterable): Set {\n val set = this.toMutableSet()\n set.addAll(other)\n return set\n}\n\n/**\n * Returns a set containing all distinct elements from both collections.\n * \n * The returned set preserves the element iteration order of the original array.\n * Those elements of the [other] collection that are unique are iterated in the end\n * in the order of the [other] collection.\n * \n * To get a set containing all elements that are contained in both collections use [intersect].\n */\npublic infix fun ByteArray.union(other: Iterable): Set {\n val set = this.toMutableSet()\n set.addAll(other)\n return set\n}\n\n/**\n * Returns a set containing all distinct elements from both collections.\n * \n * The returned set preserves the element iteration order of the original array.\n * Those elements of the [other] collection that are unique are iterated in the end\n * in the order of the [other] collection.\n * \n * To get a set containing all elements that are contained in both collections use [intersect].\n */\npublic infix fun ShortArray.union(other: Iterable): Set {\n val set = this.toMutableSet()\n set.addAll(other)\n return set\n}\n\n/**\n * Returns a set containing all distinct elements from both collections.\n * \n * The returned set preserves the element iteration order of the original array.\n * Those elements of the [other] collection that are unique are iterated in the end\n * in the order of the [other] collection.\n * \n * To get a set containing all elements that are contained in both collections use [intersect].\n */\npublic infix fun IntArray.union(other: Iterable): Set {\n val set = this.toMutableSet()\n set.addAll(other)\n return set\n}\n\n/**\n * Returns a set containing all distinct elements from both collections.\n * \n * The returned set preserves the element iteration order of the original array.\n * Those elements of the [other] collection that are unique are iterated in the end\n * in the order of the [other] collection.\n * \n * To get a set containing all elements that are contained in both collections use [intersect].\n */\npublic infix fun LongArray.union(other: Iterable): Set {\n val set = this.toMutableSet()\n set.addAll(other)\n return set\n}\n\n/**\n * Returns a set containing all distinct elements from both collections.\n * \n * The returned set preserves the element iteration order of the original array.\n * Those elements of the [other] collection that are unique are iterated in the end\n * in the order of the [other] collection.\n * \n * To get a set containing all elements that are contained in both collections use [intersect].\n */\npublic infix fun FloatArray.union(other: Iterable): Set {\n val set = this.toMutableSet()\n set.addAll(other)\n return set\n}\n\n/**\n * Returns a set containing all distinct elements from both collections.\n * \n * The returned set preserves the element iteration order of the original array.\n * Those elements of the [other] collection that are unique are iterated in the end\n * in the order of the [other] collection.\n * \n * To get a set containing all elements that are contained in both collections use [intersect].\n */\npublic infix fun DoubleArray.union(other: Iterable): Set {\n val set = this.toMutableSet()\n set.addAll(other)\n return set\n}\n\n/**\n * Returns a set containing all distinct elements from both collections.\n * \n * The returned set preserves the element iteration order of the original array.\n * Those elements of the [other] collection that are unique are iterated in the end\n * in the order of the [other] collection.\n * \n * To get a set containing all elements that are contained in both collections use [intersect].\n */\npublic infix fun BooleanArray.union(other: Iterable): Set {\n val set = this.toMutableSet()\n set.addAll(other)\n return set\n}\n\n/**\n * Returns a set containing all distinct elements from both collections.\n * \n * The returned set preserves the element iteration order of the original array.\n * Those elements of the [other] collection that are unique are iterated in the end\n * in the order of the [other] collection.\n * \n * To get a set containing all elements that are contained in both collections use [intersect].\n */\npublic infix fun CharArray.union(other: Iterable): Set {\n val set = this.toMutableSet()\n set.addAll(other)\n return set\n}\n\n/**\n * Returns `true` if all elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.all\n */\npublic inline fun Array.all(predicate: (T) -> Boolean): Boolean {\n for (element in this) if (!predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if all elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.all\n */\npublic inline fun ByteArray.all(predicate: (Byte) -> Boolean): Boolean {\n for (element in this) if (!predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if all elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.all\n */\npublic inline fun ShortArray.all(predicate: (Short) -> Boolean): Boolean {\n for (element in this) if (!predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if all elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.all\n */\npublic inline fun IntArray.all(predicate: (Int) -> Boolean): Boolean {\n for (element in this) if (!predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if all elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.all\n */\npublic inline fun LongArray.all(predicate: (Long) -> Boolean): Boolean {\n for (element in this) if (!predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if all elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.all\n */\npublic inline fun FloatArray.all(predicate: (Float) -> Boolean): Boolean {\n for (element in this) if (!predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if all elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.all\n */\npublic inline fun DoubleArray.all(predicate: (Double) -> Boolean): Boolean {\n for (element in this) if (!predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if all elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.all\n */\npublic inline fun BooleanArray.all(predicate: (Boolean) -> Boolean): Boolean {\n for (element in this) if (!predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if all elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.all\n */\npublic inline fun CharArray.all(predicate: (Char) -> Boolean): Boolean {\n for (element in this) if (!predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if array has at least one element.\n * \n * @sample samples.collections.Collections.Aggregates.any\n */\npublic fun Array.any(): Boolean {\n return !isEmpty()\n}\n\n/**\n * Returns `true` if array has at least one element.\n * \n * @sample samples.collections.Collections.Aggregates.any\n */\npublic fun ByteArray.any(): Boolean {\n return !isEmpty()\n}\n\n/**\n * Returns `true` if array has at least one element.\n * \n * @sample samples.collections.Collections.Aggregates.any\n */\npublic fun ShortArray.any(): Boolean {\n return !isEmpty()\n}\n\n/**\n * Returns `true` if array has at least one element.\n * \n * @sample samples.collections.Collections.Aggregates.any\n */\npublic fun IntArray.any(): Boolean {\n return !isEmpty()\n}\n\n/**\n * Returns `true` if array has at least one element.\n * \n * @sample samples.collections.Collections.Aggregates.any\n */\npublic fun LongArray.any(): Boolean {\n return !isEmpty()\n}\n\n/**\n * Returns `true` if array has at least one element.\n * \n * @sample samples.collections.Collections.Aggregates.any\n */\npublic fun FloatArray.any(): Boolean {\n return !isEmpty()\n}\n\n/**\n * Returns `true` if array has at least one element.\n * \n * @sample samples.collections.Collections.Aggregates.any\n */\npublic fun DoubleArray.any(): Boolean {\n return !isEmpty()\n}\n\n/**\n * Returns `true` if array has at least one element.\n * \n * @sample samples.collections.Collections.Aggregates.any\n */\npublic fun BooleanArray.any(): Boolean {\n return !isEmpty()\n}\n\n/**\n * Returns `true` if array has at least one element.\n * \n * @sample samples.collections.Collections.Aggregates.any\n */\npublic fun CharArray.any(): Boolean {\n return !isEmpty()\n}\n\n/**\n * Returns `true` if at least one element matches the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.anyWithPredicate\n */\npublic inline fun Array.any(predicate: (T) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return true\n return false\n}\n\n/**\n * Returns `true` if at least one element matches the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.anyWithPredicate\n */\npublic inline fun ByteArray.any(predicate: (Byte) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return true\n return false\n}\n\n/**\n * Returns `true` if at least one element matches the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.anyWithPredicate\n */\npublic inline fun ShortArray.any(predicate: (Short) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return true\n return false\n}\n\n/**\n * Returns `true` if at least one element matches the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.anyWithPredicate\n */\npublic inline fun IntArray.any(predicate: (Int) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return true\n return false\n}\n\n/**\n * Returns `true` if at least one element matches the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.anyWithPredicate\n */\npublic inline fun LongArray.any(predicate: (Long) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return true\n return false\n}\n\n/**\n * Returns `true` if at least one element matches the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.anyWithPredicate\n */\npublic inline fun FloatArray.any(predicate: (Float) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return true\n return false\n}\n\n/**\n * Returns `true` if at least one element matches the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.anyWithPredicate\n */\npublic inline fun DoubleArray.any(predicate: (Double) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return true\n return false\n}\n\n/**\n * Returns `true` if at least one element matches the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.anyWithPredicate\n */\npublic inline fun BooleanArray.any(predicate: (Boolean) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return true\n return false\n}\n\n/**\n * Returns `true` if at least one element matches the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.anyWithPredicate\n */\npublic inline fun CharArray.any(predicate: (Char) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return true\n return false\n}\n\n/**\n * Returns the number of elements in this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun Array.count(): Int {\n return size\n}\n\n/**\n * Returns the number of elements in this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.count(): Int {\n return size\n}\n\n/**\n * Returns the number of elements in this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.count(): Int {\n return size\n}\n\n/**\n * Returns the number of elements in this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.count(): Int {\n return size\n}\n\n/**\n * Returns the number of elements in this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.count(): Int {\n return size\n}\n\n/**\n * Returns the number of elements in this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.count(): Int {\n return size\n}\n\n/**\n * Returns the number of elements in this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.count(): Int {\n return size\n}\n\n/**\n * Returns the number of elements in this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.count(): Int {\n return size\n}\n\n/**\n * Returns the number of elements in this array.\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.count(): Int {\n return size\n}\n\n/**\n * Returns the number of elements matching the given [predicate].\n */\npublic inline fun Array.count(predicate: (T) -> Boolean): Int {\n var count = 0\n for (element in this) if (predicate(element)) ++count\n return count\n}\n\n/**\n * Returns the number of elements matching the given [predicate].\n */\npublic inline fun ByteArray.count(predicate: (Byte) -> Boolean): Int {\n var count = 0\n for (element in this) if (predicate(element)) ++count\n return count\n}\n\n/**\n * Returns the number of elements matching the given [predicate].\n */\npublic inline fun ShortArray.count(predicate: (Short) -> Boolean): Int {\n var count = 0\n for (element in this) if (predicate(element)) ++count\n return count\n}\n\n/**\n * Returns the number of elements matching the given [predicate].\n */\npublic inline fun IntArray.count(predicate: (Int) -> Boolean): Int {\n var count = 0\n for (element in this) if (predicate(element)) ++count\n return count\n}\n\n/**\n * Returns the number of elements matching the given [predicate].\n */\npublic inline fun LongArray.count(predicate: (Long) -> Boolean): Int {\n var count = 0\n for (element in this) if (predicate(element)) ++count\n return count\n}\n\n/**\n * Returns the number of elements matching the given [predicate].\n */\npublic inline fun FloatArray.count(predicate: (Float) -> Boolean): Int {\n var count = 0\n for (element in this) if (predicate(element)) ++count\n return count\n}\n\n/**\n * Returns the number of elements matching the given [predicate].\n */\npublic inline fun DoubleArray.count(predicate: (Double) -> Boolean): Int {\n var count = 0\n for (element in this) if (predicate(element)) ++count\n return count\n}\n\n/**\n * Returns the number of elements matching the given [predicate].\n */\npublic inline fun BooleanArray.count(predicate: (Boolean) -> Boolean): Int {\n var count = 0\n for (element in this) if (predicate(element)) ++count\n return count\n}\n\n/**\n * Returns the number of elements matching the given [predicate].\n */\npublic inline fun CharArray.count(predicate: (Char) -> Boolean): Int {\n var count = 0\n for (element in this) if (predicate(element)) ++count\n return count\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n */\npublic inline fun Array.fold(initial: R, operation: (acc: R, T) -> R): R {\n var accumulator = initial\n for (element in this) accumulator = operation(accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n */\npublic inline fun ByteArray.fold(initial: R, operation: (acc: R, Byte) -> R): R {\n var accumulator = initial\n for (element in this) accumulator = operation(accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n */\npublic inline fun ShortArray.fold(initial: R, operation: (acc: R, Short) -> R): R {\n var accumulator = initial\n for (element in this) accumulator = operation(accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n */\npublic inline fun IntArray.fold(initial: R, operation: (acc: R, Int) -> R): R {\n var accumulator = initial\n for (element in this) accumulator = operation(accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n */\npublic inline fun LongArray.fold(initial: R, operation: (acc: R, Long) -> R): R {\n var accumulator = initial\n for (element in this) accumulator = operation(accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n */\npublic inline fun FloatArray.fold(initial: R, operation: (acc: R, Float) -> R): R {\n var accumulator = initial\n for (element in this) accumulator = operation(accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n */\npublic inline fun DoubleArray.fold(initial: R, operation: (acc: R, Double) -> R): R {\n var accumulator = initial\n for (element in this) accumulator = operation(accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n */\npublic inline fun BooleanArray.fold(initial: R, operation: (acc: R, Boolean) -> R): R {\n var accumulator = initial\n for (element in this) accumulator = operation(accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n */\npublic inline fun CharArray.fold(initial: R, operation: (acc: R, Char) -> R): R {\n var accumulator = initial\n for (element in this) accumulator = operation(accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n */\npublic inline fun Array.foldIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): R {\n var index = 0\n var accumulator = initial\n for (element in this) accumulator = operation(index++, accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n */\npublic inline fun ByteArray.foldIndexed(initial: R, operation: (index: Int, acc: R, Byte) -> R): R {\n var index = 0\n var accumulator = initial\n for (element in this) accumulator = operation(index++, accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n */\npublic inline fun ShortArray.foldIndexed(initial: R, operation: (index: Int, acc: R, Short) -> R): R {\n var index = 0\n var accumulator = initial\n for (element in this) accumulator = operation(index++, accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n */\npublic inline fun IntArray.foldIndexed(initial: R, operation: (index: Int, acc: R, Int) -> R): R {\n var index = 0\n var accumulator = initial\n for (element in this) accumulator = operation(index++, accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n */\npublic inline fun LongArray.foldIndexed(initial: R, operation: (index: Int, acc: R, Long) -> R): R {\n var index = 0\n var accumulator = initial\n for (element in this) accumulator = operation(index++, accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n */\npublic inline fun FloatArray.foldIndexed(initial: R, operation: (index: Int, acc: R, Float) -> R): R {\n var index = 0\n var accumulator = initial\n for (element in this) accumulator = operation(index++, accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n */\npublic inline fun DoubleArray.foldIndexed(initial: R, operation: (index: Int, acc: R, Double) -> R): R {\n var index = 0\n var accumulator = initial\n for (element in this) accumulator = operation(index++, accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n */\npublic inline fun BooleanArray.foldIndexed(initial: R, operation: (index: Int, acc: R, Boolean) -> R): R {\n var index = 0\n var accumulator = initial\n for (element in this) accumulator = operation(index++, accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n */\npublic inline fun CharArray.foldIndexed(initial: R, operation: (index: Int, acc: R, Char) -> R): R {\n var index = 0\n var accumulator = initial\n for (element in this) accumulator = operation(index++, accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun Array.foldRight(initial: R, operation: (T, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun ByteArray.foldRight(initial: R, operation: (Byte, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun ShortArray.foldRight(initial: R, operation: (Short, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun IntArray.foldRight(initial: R, operation: (Int, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun LongArray.foldRight(initial: R, operation: (Long, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun FloatArray.foldRight(initial: R, operation: (Float, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun DoubleArray.foldRight(initial: R, operation: (Double, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun BooleanArray.foldRight(initial: R, operation: (Boolean, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun CharArray.foldRight(initial: R, operation: (Char, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself\n * and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun Array.foldRightIndexed(initial: R, operation: (index: Int, T, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself\n * and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun ByteArray.foldRightIndexed(initial: R, operation: (index: Int, Byte, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself\n * and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun ShortArray.foldRightIndexed(initial: R, operation: (index: Int, Short, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself\n * and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun IntArray.foldRightIndexed(initial: R, operation: (index: Int, Int, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself\n * and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun LongArray.foldRightIndexed(initial: R, operation: (index: Int, Long, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself\n * and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun FloatArray.foldRightIndexed(initial: R, operation: (index: Int, Float, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself\n * and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun DoubleArray.foldRightIndexed(initial: R, operation: (index: Int, Double, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself\n * and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun BooleanArray.foldRightIndexed(initial: R, operation: (index: Int, Boolean, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself\n * and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun CharArray.foldRightIndexed(initial: R, operation: (index: Int, Char, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Performs the given [action] on each element.\n */\npublic inline fun Array.forEach(action: (T) -> Unit): Unit {\n for (element in this) action(element)\n}\n\n/**\n * Performs the given [action] on each element.\n */\npublic inline fun ByteArray.forEach(action: (Byte) -> Unit): Unit {\n for (element in this) action(element)\n}\n\n/**\n * Performs the given [action] on each element.\n */\npublic inline fun ShortArray.forEach(action: (Short) -> Unit): Unit {\n for (element in this) action(element)\n}\n\n/**\n * Performs the given [action] on each element.\n */\npublic inline fun IntArray.forEach(action: (Int) -> Unit): Unit {\n for (element in this) action(element)\n}\n\n/**\n * Performs the given [action] on each element.\n */\npublic inline fun LongArray.forEach(action: (Long) -> Unit): Unit {\n for (element in this) action(element)\n}\n\n/**\n * Performs the given [action] on each element.\n */\npublic inline fun FloatArray.forEach(action: (Float) -> Unit): Unit {\n for (element in this) action(element)\n}\n\n/**\n * Performs the given [action] on each element.\n */\npublic inline fun DoubleArray.forEach(action: (Double) -> Unit): Unit {\n for (element in this) action(element)\n}\n\n/**\n * Performs the given [action] on each element.\n */\npublic inline fun BooleanArray.forEach(action: (Boolean) -> Unit): Unit {\n for (element in this) action(element)\n}\n\n/**\n * Performs the given [action] on each element.\n */\npublic inline fun CharArray.forEach(action: (Char) -> Unit): Unit {\n for (element in this) action(element)\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\npublic inline fun Array.forEachIndexed(action: (index: Int, T) -> Unit): Unit {\n var index = 0\n for (item in this) action(index++, item)\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\npublic inline fun ByteArray.forEachIndexed(action: (index: Int, Byte) -> Unit): Unit {\n var index = 0\n for (item in this) action(index++, item)\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\npublic inline fun ShortArray.forEachIndexed(action: (index: Int, Short) -> Unit): Unit {\n var index = 0\n for (item in this) action(index++, item)\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\npublic inline fun IntArray.forEachIndexed(action: (index: Int, Int) -> Unit): Unit {\n var index = 0\n for (item in this) action(index++, item)\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\npublic inline fun LongArray.forEachIndexed(action: (index: Int, Long) -> Unit): Unit {\n var index = 0\n for (item in this) action(index++, item)\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\npublic inline fun FloatArray.forEachIndexed(action: (index: Int, Float) -> Unit): Unit {\n var index = 0\n for (item in this) action(index++, item)\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\npublic inline fun DoubleArray.forEachIndexed(action: (index: Int, Double) -> Unit): Unit {\n var index = 0\n for (item in this) action(index++, item)\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\npublic inline fun BooleanArray.forEachIndexed(action: (index: Int, Boolean) -> Unit): Unit {\n var index = 0\n for (item in this) action(index++, item)\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\npublic inline fun CharArray.forEachIndexed(action: (index: Int, Char) -> Unit): Unit {\n var index = 0\n for (item in this) action(index++, item)\n}\n\n@Deprecated(\"Use maxOrNull instead.\", ReplaceWith(\"this.maxOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\n@SinceKotlin(\"1.1\")\npublic fun Array.max(): Double? {\n return maxOrNull()\n}\n\n@Deprecated(\"Use maxOrNull instead.\", ReplaceWith(\"this.maxOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\n@SinceKotlin(\"1.1\")\npublic fun Array.max(): Float? {\n return maxOrNull()\n}\n\n@Deprecated(\"Use maxOrNull instead.\", ReplaceWith(\"this.maxOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun > Array.max(): T? {\n return maxOrNull()\n}\n\n@Deprecated(\"Use maxOrNull instead.\", ReplaceWith(\"this.maxOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun ByteArray.max(): Byte? {\n return maxOrNull()\n}\n\n@Deprecated(\"Use maxOrNull instead.\", ReplaceWith(\"this.maxOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun ShortArray.max(): Short? {\n return maxOrNull()\n}\n\n@Deprecated(\"Use maxOrNull instead.\", ReplaceWith(\"this.maxOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun IntArray.max(): Int? {\n return maxOrNull()\n}\n\n@Deprecated(\"Use maxOrNull instead.\", ReplaceWith(\"this.maxOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun LongArray.max(): Long? {\n return maxOrNull()\n}\n\n@Deprecated(\"Use maxOrNull instead.\", ReplaceWith(\"this.maxOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun FloatArray.max(): Float? {\n return maxOrNull()\n}\n\n@Deprecated(\"Use maxOrNull instead.\", ReplaceWith(\"this.maxOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun DoubleArray.max(): Double? {\n return maxOrNull()\n}\n\n@Deprecated(\"Use maxOrNull instead.\", ReplaceWith(\"this.maxOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun CharArray.max(): Char? {\n return maxOrNull()\n}\n\n@Deprecated(\"Use maxByOrNull instead.\", ReplaceWith(\"this.maxByOrNull(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic inline fun > Array.maxBy(selector: (T) -> R): T? {\n return maxByOrNull(selector)\n}\n\n@Deprecated(\"Use maxByOrNull instead.\", ReplaceWith(\"this.maxByOrNull(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic inline fun > ByteArray.maxBy(selector: (Byte) -> R): Byte? {\n return maxByOrNull(selector)\n}\n\n@Deprecated(\"Use maxByOrNull instead.\", ReplaceWith(\"this.maxByOrNull(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic inline fun > ShortArray.maxBy(selector: (Short) -> R): Short? {\n return maxByOrNull(selector)\n}\n\n@Deprecated(\"Use maxByOrNull instead.\", ReplaceWith(\"this.maxByOrNull(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic inline fun > IntArray.maxBy(selector: (Int) -> R): Int? {\n return maxByOrNull(selector)\n}\n\n@Deprecated(\"Use maxByOrNull instead.\", ReplaceWith(\"this.maxByOrNull(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic inline fun > LongArray.maxBy(selector: (Long) -> R): Long? {\n return maxByOrNull(selector)\n}\n\n@Deprecated(\"Use maxByOrNull instead.\", ReplaceWith(\"this.maxByOrNull(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic inline fun > FloatArray.maxBy(selector: (Float) -> R): Float? {\n return maxByOrNull(selector)\n}\n\n@Deprecated(\"Use maxByOrNull instead.\", ReplaceWith(\"this.maxByOrNull(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic inline fun > DoubleArray.maxBy(selector: (Double) -> R): Double? {\n return maxByOrNull(selector)\n}\n\n@Deprecated(\"Use maxByOrNull instead.\", ReplaceWith(\"this.maxByOrNull(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic inline fun > BooleanArray.maxBy(selector: (Boolean) -> R): Boolean? {\n return maxByOrNull(selector)\n}\n\n@Deprecated(\"Use maxByOrNull instead.\", ReplaceWith(\"this.maxByOrNull(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic inline fun > CharArray.maxBy(selector: (Char) -> R): Char? {\n return maxByOrNull(selector)\n}\n\n/**\n * Returns the first element yielding the largest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.maxByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > Array.maxByOrNull(selector: (T) -> R): T? {\n if (isEmpty()) return null\n var maxElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return maxElem\n var maxValue = selector(maxElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (maxValue < v) {\n maxElem = e\n maxValue = v\n }\n }\n return maxElem\n}\n\n/**\n * Returns the first element yielding the largest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.maxByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > ByteArray.maxByOrNull(selector: (Byte) -> R): Byte? {\n if (isEmpty()) return null\n var maxElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return maxElem\n var maxValue = selector(maxElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (maxValue < v) {\n maxElem = e\n maxValue = v\n }\n }\n return maxElem\n}\n\n/**\n * Returns the first element yielding the largest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.maxByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > ShortArray.maxByOrNull(selector: (Short) -> R): Short? {\n if (isEmpty()) return null\n var maxElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return maxElem\n var maxValue = selector(maxElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (maxValue < v) {\n maxElem = e\n maxValue = v\n }\n }\n return maxElem\n}\n\n/**\n * Returns the first element yielding the largest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.maxByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > IntArray.maxByOrNull(selector: (Int) -> R): Int? {\n if (isEmpty()) return null\n var maxElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return maxElem\n var maxValue = selector(maxElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (maxValue < v) {\n maxElem = e\n maxValue = v\n }\n }\n return maxElem\n}\n\n/**\n * Returns the first element yielding the largest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.maxByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > LongArray.maxByOrNull(selector: (Long) -> R): Long? {\n if (isEmpty()) return null\n var maxElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return maxElem\n var maxValue = selector(maxElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (maxValue < v) {\n maxElem = e\n maxValue = v\n }\n }\n return maxElem\n}\n\n/**\n * Returns the first element yielding the largest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.maxByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > FloatArray.maxByOrNull(selector: (Float) -> R): Float? {\n if (isEmpty()) return null\n var maxElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return maxElem\n var maxValue = selector(maxElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (maxValue < v) {\n maxElem = e\n maxValue = v\n }\n }\n return maxElem\n}\n\n/**\n * Returns the first element yielding the largest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.maxByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > DoubleArray.maxByOrNull(selector: (Double) -> R): Double? {\n if (isEmpty()) return null\n var maxElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return maxElem\n var maxValue = selector(maxElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (maxValue < v) {\n maxElem = e\n maxValue = v\n }\n }\n return maxElem\n}\n\n/**\n * Returns the first element yielding the largest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.maxByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > BooleanArray.maxByOrNull(selector: (Boolean) -> R): Boolean? {\n if (isEmpty()) return null\n var maxElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return maxElem\n var maxValue = selector(maxElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (maxValue < v) {\n maxElem = e\n maxValue = v\n }\n }\n return maxElem\n}\n\n/**\n * Returns the first element yielding the largest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.maxByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > CharArray.maxByOrNull(selector: (Char) -> R): Char? {\n if (isEmpty()) return null\n var maxElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return maxElem\n var maxValue = selector(maxElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (maxValue < v) {\n maxElem = e\n maxValue = v\n }\n }\n return maxElem\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Array.maxOf(selector: (T) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.maxOf(selector: (Byte) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.maxOf(selector: (Short) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.maxOf(selector: (Int) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.maxOf(selector: (Long) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.maxOf(selector: (Float) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.maxOf(selector: (Double) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.maxOf(selector: (Boolean) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.maxOf(selector: (Char) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Array.maxOf(selector: (T) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.maxOf(selector: (Byte) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.maxOf(selector: (Short) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.maxOf(selector: (Int) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.maxOf(selector: (Long) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.maxOf(selector: (Float) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.maxOf(selector: (Double) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.maxOf(selector: (Boolean) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.maxOf(selector: (Char) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > Array.maxOf(selector: (T) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > ByteArray.maxOf(selector: (Byte) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > ShortArray.maxOf(selector: (Short) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > IntArray.maxOf(selector: (Int) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > LongArray.maxOf(selector: (Long) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > FloatArray.maxOf(selector: (Float) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > DoubleArray.maxOf(selector: (Double) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > BooleanArray.maxOf(selector: (Boolean) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > CharArray.maxOf(selector: (Char) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Array.maxOfOrNull(selector: (T) -> Double): Double? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.maxOfOrNull(selector: (Byte) -> Double): Double? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.maxOfOrNull(selector: (Short) -> Double): Double? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.maxOfOrNull(selector: (Int) -> Double): Double? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.maxOfOrNull(selector: (Long) -> Double): Double? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.maxOfOrNull(selector: (Float) -> Double): Double? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.maxOfOrNull(selector: (Double) -> Double): Double? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.maxOfOrNull(selector: (Boolean) -> Double): Double? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.maxOfOrNull(selector: (Char) -> Double): Double? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Array.maxOfOrNull(selector: (T) -> Float): Float? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.maxOfOrNull(selector: (Byte) -> Float): Float? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.maxOfOrNull(selector: (Short) -> Float): Float? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.maxOfOrNull(selector: (Int) -> Float): Float? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.maxOfOrNull(selector: (Long) -> Float): Float? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.maxOfOrNull(selector: (Float) -> Float): Float? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.maxOfOrNull(selector: (Double) -> Float): Float? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.maxOfOrNull(selector: (Boolean) -> Float): Float? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.maxOfOrNull(selector: (Char) -> Float): Float? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > Array.maxOfOrNull(selector: (T) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > ByteArray.maxOfOrNull(selector: (Byte) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > ShortArray.maxOfOrNull(selector: (Short) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > IntArray.maxOfOrNull(selector: (Int) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > LongArray.maxOfOrNull(selector: (Long) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > FloatArray.maxOfOrNull(selector: (Float) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > DoubleArray.maxOfOrNull(selector: (Double) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > BooleanArray.maxOfOrNull(selector: (Boolean) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > CharArray.maxOfOrNull(selector: (Char) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Array.maxOfWith(comparator: Comparator, selector: (T) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.maxOfWith(comparator: Comparator, selector: (Byte) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.maxOfWith(comparator: Comparator, selector: (Short) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.maxOfWith(comparator: Comparator, selector: (Int) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.maxOfWith(comparator: Comparator, selector: (Long) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.maxOfWith(comparator: Comparator, selector: (Float) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.maxOfWith(comparator: Comparator, selector: (Double) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.maxOfWith(comparator: Comparator, selector: (Boolean) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.maxOfWith(comparator: Comparator, selector: (Char) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Array.maxOfWithOrNull(comparator: Comparator, selector: (T) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.maxOfWithOrNull(comparator: Comparator, selector: (Byte) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.maxOfWithOrNull(comparator: Comparator, selector: (Short) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.maxOfWithOrNull(comparator: Comparator, selector: (Int) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.maxOfWithOrNull(comparator: Comparator, selector: (Long) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.maxOfWithOrNull(comparator: Comparator, selector: (Float) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.maxOfWithOrNull(comparator: Comparator, selector: (Double) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.maxOfWithOrNull(comparator: Comparator, selector: (Boolean) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.maxOfWithOrNull(comparator: Comparator, selector: (Char) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n * \n * If any of elements is `NaN` returns `NaN`.\n */\n@SinceKotlin(\"1.4\")\npublic fun Array.maxOrNull(): Double? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n max = maxOf(max, e)\n }\n return max\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n * \n * If any of elements is `NaN` returns `NaN`.\n */\n@SinceKotlin(\"1.4\")\npublic fun Array.maxOrNull(): Float? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n max = maxOf(max, e)\n }\n return max\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun > Array.maxOrNull(): T? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (max < e) max = e\n }\n return max\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun ByteArray.maxOrNull(): Byte? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (max < e) max = e\n }\n return max\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun ShortArray.maxOrNull(): Short? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (max < e) max = e\n }\n return max\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun IntArray.maxOrNull(): Int? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (max < e) max = e\n }\n return max\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun LongArray.maxOrNull(): Long? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (max < e) max = e\n }\n return max\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n * \n * If any of elements is `NaN` returns `NaN`.\n */\n@SinceKotlin(\"1.4\")\npublic fun FloatArray.maxOrNull(): Float? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n max = maxOf(max, e)\n }\n return max\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n * \n * If any of elements is `NaN` returns `NaN`.\n */\n@SinceKotlin(\"1.4\")\npublic fun DoubleArray.maxOrNull(): Double? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n max = maxOf(max, e)\n }\n return max\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun CharArray.maxOrNull(): Char? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (max < e) max = e\n }\n return max\n}\n\n@Deprecated(\"Use maxWithOrNull instead.\", ReplaceWith(\"this.maxWithOrNull(comparator)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun Array.maxWith(comparator: Comparator): T? {\n return maxWithOrNull(comparator)\n}\n\n@Deprecated(\"Use maxWithOrNull instead.\", ReplaceWith(\"this.maxWithOrNull(comparator)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun ByteArray.maxWith(comparator: Comparator): Byte? {\n return maxWithOrNull(comparator)\n}\n\n@Deprecated(\"Use maxWithOrNull instead.\", ReplaceWith(\"this.maxWithOrNull(comparator)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun ShortArray.maxWith(comparator: Comparator): Short? {\n return maxWithOrNull(comparator)\n}\n\n@Deprecated(\"Use maxWithOrNull instead.\", ReplaceWith(\"this.maxWithOrNull(comparator)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun IntArray.maxWith(comparator: Comparator): Int? {\n return maxWithOrNull(comparator)\n}\n\n@Deprecated(\"Use maxWithOrNull instead.\", ReplaceWith(\"this.maxWithOrNull(comparator)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun LongArray.maxWith(comparator: Comparator): Long? {\n return maxWithOrNull(comparator)\n}\n\n@Deprecated(\"Use maxWithOrNull instead.\", ReplaceWith(\"this.maxWithOrNull(comparator)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun FloatArray.maxWith(comparator: Comparator): Float? {\n return maxWithOrNull(comparator)\n}\n\n@Deprecated(\"Use maxWithOrNull instead.\", ReplaceWith(\"this.maxWithOrNull(comparator)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun DoubleArray.maxWith(comparator: Comparator): Double? {\n return maxWithOrNull(comparator)\n}\n\n@Deprecated(\"Use maxWithOrNull instead.\", ReplaceWith(\"this.maxWithOrNull(comparator)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun BooleanArray.maxWith(comparator: Comparator): Boolean? {\n return maxWithOrNull(comparator)\n}\n\n@Deprecated(\"Use maxWithOrNull instead.\", ReplaceWith(\"this.maxWithOrNull(comparator)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun CharArray.maxWith(comparator: Comparator): Char? {\n return maxWithOrNull(comparator)\n}\n\n/**\n * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun Array.maxWithOrNull(comparator: Comparator): T? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(max, e) < 0) max = e\n }\n return max\n}\n\n/**\n * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun ByteArray.maxWithOrNull(comparator: Comparator): Byte? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(max, e) < 0) max = e\n }\n return max\n}\n\n/**\n * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun ShortArray.maxWithOrNull(comparator: Comparator): Short? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(max, e) < 0) max = e\n }\n return max\n}\n\n/**\n * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun IntArray.maxWithOrNull(comparator: Comparator): Int? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(max, e) < 0) max = e\n }\n return max\n}\n\n/**\n * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun LongArray.maxWithOrNull(comparator: Comparator): Long? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(max, e) < 0) max = e\n }\n return max\n}\n\n/**\n * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun FloatArray.maxWithOrNull(comparator: Comparator): Float? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(max, e) < 0) max = e\n }\n return max\n}\n\n/**\n * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun DoubleArray.maxWithOrNull(comparator: Comparator): Double? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(max, e) < 0) max = e\n }\n return max\n}\n\n/**\n * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun BooleanArray.maxWithOrNull(comparator: Comparator): Boolean? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(max, e) < 0) max = e\n }\n return max\n}\n\n/**\n * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun CharArray.maxWithOrNull(comparator: Comparator): Char? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(max, e) < 0) max = e\n }\n return max\n}\n\n@Deprecated(\"Use minOrNull instead.\", ReplaceWith(\"this.minOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\n@SinceKotlin(\"1.1\")\npublic fun Array.min(): Double? {\n return minOrNull()\n}\n\n@Deprecated(\"Use minOrNull instead.\", ReplaceWith(\"this.minOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\n@SinceKotlin(\"1.1\")\npublic fun Array.min(): Float? {\n return minOrNull()\n}\n\n@Deprecated(\"Use minOrNull instead.\", ReplaceWith(\"this.minOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun > Array.min(): T? {\n return minOrNull()\n}\n\n@Deprecated(\"Use minOrNull instead.\", ReplaceWith(\"this.minOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun ByteArray.min(): Byte? {\n return minOrNull()\n}\n\n@Deprecated(\"Use minOrNull instead.\", ReplaceWith(\"this.minOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun ShortArray.min(): Short? {\n return minOrNull()\n}\n\n@Deprecated(\"Use minOrNull instead.\", ReplaceWith(\"this.minOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun IntArray.min(): Int? {\n return minOrNull()\n}\n\n@Deprecated(\"Use minOrNull instead.\", ReplaceWith(\"this.minOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun LongArray.min(): Long? {\n return minOrNull()\n}\n\n@Deprecated(\"Use minOrNull instead.\", ReplaceWith(\"this.minOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun FloatArray.min(): Float? {\n return minOrNull()\n}\n\n@Deprecated(\"Use minOrNull instead.\", ReplaceWith(\"this.minOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun DoubleArray.min(): Double? {\n return minOrNull()\n}\n\n@Deprecated(\"Use minOrNull instead.\", ReplaceWith(\"this.minOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun CharArray.min(): Char? {\n return minOrNull()\n}\n\n@Deprecated(\"Use minByOrNull instead.\", ReplaceWith(\"this.minByOrNull(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic inline fun > Array.minBy(selector: (T) -> R): T? {\n return minByOrNull(selector)\n}\n\n@Deprecated(\"Use minByOrNull instead.\", ReplaceWith(\"this.minByOrNull(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic inline fun > ByteArray.minBy(selector: (Byte) -> R): Byte? {\n return minByOrNull(selector)\n}\n\n@Deprecated(\"Use minByOrNull instead.\", ReplaceWith(\"this.minByOrNull(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic inline fun > ShortArray.minBy(selector: (Short) -> R): Short? {\n return minByOrNull(selector)\n}\n\n@Deprecated(\"Use minByOrNull instead.\", ReplaceWith(\"this.minByOrNull(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic inline fun > IntArray.minBy(selector: (Int) -> R): Int? {\n return minByOrNull(selector)\n}\n\n@Deprecated(\"Use minByOrNull instead.\", ReplaceWith(\"this.minByOrNull(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic inline fun > LongArray.minBy(selector: (Long) -> R): Long? {\n return minByOrNull(selector)\n}\n\n@Deprecated(\"Use minByOrNull instead.\", ReplaceWith(\"this.minByOrNull(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic inline fun > FloatArray.minBy(selector: (Float) -> R): Float? {\n return minByOrNull(selector)\n}\n\n@Deprecated(\"Use minByOrNull instead.\", ReplaceWith(\"this.minByOrNull(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic inline fun > DoubleArray.minBy(selector: (Double) -> R): Double? {\n return minByOrNull(selector)\n}\n\n@Deprecated(\"Use minByOrNull instead.\", ReplaceWith(\"this.minByOrNull(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic inline fun > BooleanArray.minBy(selector: (Boolean) -> R): Boolean? {\n return minByOrNull(selector)\n}\n\n@Deprecated(\"Use minByOrNull instead.\", ReplaceWith(\"this.minByOrNull(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic inline fun > CharArray.minBy(selector: (Char) -> R): Char? {\n return minByOrNull(selector)\n}\n\n/**\n * Returns the first element yielding the smallest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.minByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > Array.minByOrNull(selector: (T) -> R): T? {\n if (isEmpty()) return null\n var minElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return minElem\n var minValue = selector(minElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (minValue > v) {\n minElem = e\n minValue = v\n }\n }\n return minElem\n}\n\n/**\n * Returns the first element yielding the smallest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.minByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > ByteArray.minByOrNull(selector: (Byte) -> R): Byte? {\n if (isEmpty()) return null\n var minElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return minElem\n var minValue = selector(minElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (minValue > v) {\n minElem = e\n minValue = v\n }\n }\n return minElem\n}\n\n/**\n * Returns the first element yielding the smallest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.minByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > ShortArray.minByOrNull(selector: (Short) -> R): Short? {\n if (isEmpty()) return null\n var minElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return minElem\n var minValue = selector(minElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (minValue > v) {\n minElem = e\n minValue = v\n }\n }\n return minElem\n}\n\n/**\n * Returns the first element yielding the smallest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.minByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > IntArray.minByOrNull(selector: (Int) -> R): Int? {\n if (isEmpty()) return null\n var minElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return minElem\n var minValue = selector(minElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (minValue > v) {\n minElem = e\n minValue = v\n }\n }\n return minElem\n}\n\n/**\n * Returns the first element yielding the smallest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.minByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > LongArray.minByOrNull(selector: (Long) -> R): Long? {\n if (isEmpty()) return null\n var minElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return minElem\n var minValue = selector(minElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (minValue > v) {\n minElem = e\n minValue = v\n }\n }\n return minElem\n}\n\n/**\n * Returns the first element yielding the smallest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.minByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > FloatArray.minByOrNull(selector: (Float) -> R): Float? {\n if (isEmpty()) return null\n var minElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return minElem\n var minValue = selector(minElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (minValue > v) {\n minElem = e\n minValue = v\n }\n }\n return minElem\n}\n\n/**\n * Returns the first element yielding the smallest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.minByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > DoubleArray.minByOrNull(selector: (Double) -> R): Double? {\n if (isEmpty()) return null\n var minElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return minElem\n var minValue = selector(minElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (minValue > v) {\n minElem = e\n minValue = v\n }\n }\n return minElem\n}\n\n/**\n * Returns the first element yielding the smallest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.minByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > BooleanArray.minByOrNull(selector: (Boolean) -> R): Boolean? {\n if (isEmpty()) return null\n var minElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return minElem\n var minValue = selector(minElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (minValue > v) {\n minElem = e\n minValue = v\n }\n }\n return minElem\n}\n\n/**\n * Returns the first element yielding the smallest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.minByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > CharArray.minByOrNull(selector: (Char) -> R): Char? {\n if (isEmpty()) return null\n var minElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return minElem\n var minValue = selector(minElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (minValue > v) {\n minElem = e\n minValue = v\n }\n }\n return minElem\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Array.minOf(selector: (T) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.minOf(selector: (Byte) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.minOf(selector: (Short) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.minOf(selector: (Int) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.minOf(selector: (Long) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.minOf(selector: (Float) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.minOf(selector: (Double) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.minOf(selector: (Boolean) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.minOf(selector: (Char) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Array.minOf(selector: (T) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.minOf(selector: (Byte) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.minOf(selector: (Short) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.minOf(selector: (Int) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.minOf(selector: (Long) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.minOf(selector: (Float) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.minOf(selector: (Double) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.minOf(selector: (Boolean) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.minOf(selector: (Char) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > Array.minOf(selector: (T) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > ByteArray.minOf(selector: (Byte) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > ShortArray.minOf(selector: (Short) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > IntArray.minOf(selector: (Int) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > LongArray.minOf(selector: (Long) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > FloatArray.minOf(selector: (Float) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > DoubleArray.minOf(selector: (Double) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > BooleanArray.minOf(selector: (Boolean) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > CharArray.minOf(selector: (Char) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Array.minOfOrNull(selector: (T) -> Double): Double? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.minOfOrNull(selector: (Byte) -> Double): Double? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.minOfOrNull(selector: (Short) -> Double): Double? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.minOfOrNull(selector: (Int) -> Double): Double? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.minOfOrNull(selector: (Long) -> Double): Double? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.minOfOrNull(selector: (Float) -> Double): Double? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.minOfOrNull(selector: (Double) -> Double): Double? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.minOfOrNull(selector: (Boolean) -> Double): Double? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.minOfOrNull(selector: (Char) -> Double): Double? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Array.minOfOrNull(selector: (T) -> Float): Float? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.minOfOrNull(selector: (Byte) -> Float): Float? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.minOfOrNull(selector: (Short) -> Float): Float? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.minOfOrNull(selector: (Int) -> Float): Float? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.minOfOrNull(selector: (Long) -> Float): Float? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.minOfOrNull(selector: (Float) -> Float): Float? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.minOfOrNull(selector: (Double) -> Float): Float? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.minOfOrNull(selector: (Boolean) -> Float): Float? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.minOfOrNull(selector: (Char) -> Float): Float? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > Array.minOfOrNull(selector: (T) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > ByteArray.minOfOrNull(selector: (Byte) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > ShortArray.minOfOrNull(selector: (Short) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > IntArray.minOfOrNull(selector: (Int) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > LongArray.minOfOrNull(selector: (Long) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > FloatArray.minOfOrNull(selector: (Float) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > DoubleArray.minOfOrNull(selector: (Double) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > BooleanArray.minOfOrNull(selector: (Boolean) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > CharArray.minOfOrNull(selector: (Char) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Array.minOfWith(comparator: Comparator, selector: (T) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.minOfWith(comparator: Comparator, selector: (Byte) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.minOfWith(comparator: Comparator, selector: (Short) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.minOfWith(comparator: Comparator, selector: (Int) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.minOfWith(comparator: Comparator, selector: (Long) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.minOfWith(comparator: Comparator, selector: (Float) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.minOfWith(comparator: Comparator, selector: (Double) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.minOfWith(comparator: Comparator, selector: (Boolean) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.minOfWith(comparator: Comparator, selector: (Char) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Array.minOfWithOrNull(comparator: Comparator, selector: (T) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.minOfWithOrNull(comparator: Comparator, selector: (Byte) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.minOfWithOrNull(comparator: Comparator, selector: (Short) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.minOfWithOrNull(comparator: Comparator, selector: (Int) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.minOfWithOrNull(comparator: Comparator, selector: (Long) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.minOfWithOrNull(comparator: Comparator, selector: (Float) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.minOfWithOrNull(comparator: Comparator, selector: (Double) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.minOfWithOrNull(comparator: Comparator, selector: (Boolean) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.minOfWithOrNull(comparator: Comparator, selector: (Char) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n * \n * If any of elements is `NaN` returns `NaN`.\n */\n@SinceKotlin(\"1.4\")\npublic fun Array.minOrNull(): Double? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n min = minOf(min, e)\n }\n return min\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n * \n * If any of elements is `NaN` returns `NaN`.\n */\n@SinceKotlin(\"1.4\")\npublic fun Array.minOrNull(): Float? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n min = minOf(min, e)\n }\n return min\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun > Array.minOrNull(): T? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (min > e) min = e\n }\n return min\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun ByteArray.minOrNull(): Byte? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (min > e) min = e\n }\n return min\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun ShortArray.minOrNull(): Short? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (min > e) min = e\n }\n return min\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun IntArray.minOrNull(): Int? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (min > e) min = e\n }\n return min\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun LongArray.minOrNull(): Long? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (min > e) min = e\n }\n return min\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n * \n * If any of elements is `NaN` returns `NaN`.\n */\n@SinceKotlin(\"1.4\")\npublic fun FloatArray.minOrNull(): Float? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n min = minOf(min, e)\n }\n return min\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n * \n * If any of elements is `NaN` returns `NaN`.\n */\n@SinceKotlin(\"1.4\")\npublic fun DoubleArray.minOrNull(): Double? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n min = minOf(min, e)\n }\n return min\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun CharArray.minOrNull(): Char? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (min > e) min = e\n }\n return min\n}\n\n@Deprecated(\"Use minWithOrNull instead.\", ReplaceWith(\"this.minWithOrNull(comparator)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun Array.minWith(comparator: Comparator): T? {\n return minWithOrNull(comparator)\n}\n\n@Deprecated(\"Use minWithOrNull instead.\", ReplaceWith(\"this.minWithOrNull(comparator)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun ByteArray.minWith(comparator: Comparator): Byte? {\n return minWithOrNull(comparator)\n}\n\n@Deprecated(\"Use minWithOrNull instead.\", ReplaceWith(\"this.minWithOrNull(comparator)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun ShortArray.minWith(comparator: Comparator): Short? {\n return minWithOrNull(comparator)\n}\n\n@Deprecated(\"Use minWithOrNull instead.\", ReplaceWith(\"this.minWithOrNull(comparator)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun IntArray.minWith(comparator: Comparator): Int? {\n return minWithOrNull(comparator)\n}\n\n@Deprecated(\"Use minWithOrNull instead.\", ReplaceWith(\"this.minWithOrNull(comparator)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun LongArray.minWith(comparator: Comparator): Long? {\n return minWithOrNull(comparator)\n}\n\n@Deprecated(\"Use minWithOrNull instead.\", ReplaceWith(\"this.minWithOrNull(comparator)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun FloatArray.minWith(comparator: Comparator): Float? {\n return minWithOrNull(comparator)\n}\n\n@Deprecated(\"Use minWithOrNull instead.\", ReplaceWith(\"this.minWithOrNull(comparator)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun DoubleArray.minWith(comparator: Comparator): Double? {\n return minWithOrNull(comparator)\n}\n\n@Deprecated(\"Use minWithOrNull instead.\", ReplaceWith(\"this.minWithOrNull(comparator)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun BooleanArray.minWith(comparator: Comparator): Boolean? {\n return minWithOrNull(comparator)\n}\n\n@Deprecated(\"Use minWithOrNull instead.\", ReplaceWith(\"this.minWithOrNull(comparator)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun CharArray.minWith(comparator: Comparator): Char? {\n return minWithOrNull(comparator)\n}\n\n/**\n * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun Array.minWithOrNull(comparator: Comparator): T? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(min, e) > 0) min = e\n }\n return min\n}\n\n/**\n * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun ByteArray.minWithOrNull(comparator: Comparator): Byte? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(min, e) > 0) min = e\n }\n return min\n}\n\n/**\n * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun ShortArray.minWithOrNull(comparator: Comparator): Short? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(min, e) > 0) min = e\n }\n return min\n}\n\n/**\n * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun IntArray.minWithOrNull(comparator: Comparator): Int? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(min, e) > 0) min = e\n }\n return min\n}\n\n/**\n * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun LongArray.minWithOrNull(comparator: Comparator): Long? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(min, e) > 0) min = e\n }\n return min\n}\n\n/**\n * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun FloatArray.minWithOrNull(comparator: Comparator): Float? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(min, e) > 0) min = e\n }\n return min\n}\n\n/**\n * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun DoubleArray.minWithOrNull(comparator: Comparator): Double? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(min, e) > 0) min = e\n }\n return min\n}\n\n/**\n * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun BooleanArray.minWithOrNull(comparator: Comparator): Boolean? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(min, e) > 0) min = e\n }\n return min\n}\n\n/**\n * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun CharArray.minWithOrNull(comparator: Comparator): Char? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(min, e) > 0) min = e\n }\n return min\n}\n\n/**\n * Returns `true` if the array has no elements.\n * \n * @sample samples.collections.Collections.Aggregates.none\n */\npublic fun Array.none(): Boolean {\n return isEmpty()\n}\n\n/**\n * Returns `true` if the array has no elements.\n * \n * @sample samples.collections.Collections.Aggregates.none\n */\npublic fun ByteArray.none(): Boolean {\n return isEmpty()\n}\n\n/**\n * Returns `true` if the array has no elements.\n * \n * @sample samples.collections.Collections.Aggregates.none\n */\npublic fun ShortArray.none(): Boolean {\n return isEmpty()\n}\n\n/**\n * Returns `true` if the array has no elements.\n * \n * @sample samples.collections.Collections.Aggregates.none\n */\npublic fun IntArray.none(): Boolean {\n return isEmpty()\n}\n\n/**\n * Returns `true` if the array has no elements.\n * \n * @sample samples.collections.Collections.Aggregates.none\n */\npublic fun LongArray.none(): Boolean {\n return isEmpty()\n}\n\n/**\n * Returns `true` if the array has no elements.\n * \n * @sample samples.collections.Collections.Aggregates.none\n */\npublic fun FloatArray.none(): Boolean {\n return isEmpty()\n}\n\n/**\n * Returns `true` if the array has no elements.\n * \n * @sample samples.collections.Collections.Aggregates.none\n */\npublic fun DoubleArray.none(): Boolean {\n return isEmpty()\n}\n\n/**\n * Returns `true` if the array has no elements.\n * \n * @sample samples.collections.Collections.Aggregates.none\n */\npublic fun BooleanArray.none(): Boolean {\n return isEmpty()\n}\n\n/**\n * Returns `true` if the array has no elements.\n * \n * @sample samples.collections.Collections.Aggregates.none\n */\npublic fun CharArray.none(): Boolean {\n return isEmpty()\n}\n\n/**\n * Returns `true` if no elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.noneWithPredicate\n */\npublic inline fun Array.none(predicate: (T) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if no elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.noneWithPredicate\n */\npublic inline fun ByteArray.none(predicate: (Byte) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if no elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.noneWithPredicate\n */\npublic inline fun ShortArray.none(predicate: (Short) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if no elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.noneWithPredicate\n */\npublic inline fun IntArray.none(predicate: (Int) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if no elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.noneWithPredicate\n */\npublic inline fun LongArray.none(predicate: (Long) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if no elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.noneWithPredicate\n */\npublic inline fun FloatArray.none(predicate: (Float) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if no elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.noneWithPredicate\n */\npublic inline fun DoubleArray.none(predicate: (Double) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if no elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.noneWithPredicate\n */\npublic inline fun BooleanArray.none(predicate: (Boolean) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if no elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.noneWithPredicate\n */\npublic inline fun CharArray.none(predicate: (Char) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return false\n return true\n}\n\n/**\n * Performs the given [action] on each element and returns the array itself afterwards.\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun Array.onEach(action: (T) -> Unit): Array {\n return apply { for (element in this) action(element) }\n}\n\n/**\n * Performs the given [action] on each element and returns the array itself afterwards.\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.onEach(action: (Byte) -> Unit): ByteArray {\n return apply { for (element in this) action(element) }\n}\n\n/**\n * Performs the given [action] on each element and returns the array itself afterwards.\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.onEach(action: (Short) -> Unit): ShortArray {\n return apply { for (element in this) action(element) }\n}\n\n/**\n * Performs the given [action] on each element and returns the array itself afterwards.\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.onEach(action: (Int) -> Unit): IntArray {\n return apply { for (element in this) action(element) }\n}\n\n/**\n * Performs the given [action] on each element and returns the array itself afterwards.\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.onEach(action: (Long) -> Unit): LongArray {\n return apply { for (element in this) action(element) }\n}\n\n/**\n * Performs the given [action] on each element and returns the array itself afterwards.\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.onEach(action: (Float) -> Unit): FloatArray {\n return apply { for (element in this) action(element) }\n}\n\n/**\n * Performs the given [action] on each element and returns the array itself afterwards.\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.onEach(action: (Double) -> Unit): DoubleArray {\n return apply { for (element in this) action(element) }\n}\n\n/**\n * Performs the given [action] on each element and returns the array itself afterwards.\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.onEach(action: (Boolean) -> Unit): BooleanArray {\n return apply { for (element in this) action(element) }\n}\n\n/**\n * Performs the given [action] on each element and returns the array itself afterwards.\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.onEach(action: (Char) -> Unit): CharArray {\n return apply { for (element in this) action(element) }\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element,\n * and returns the array itself afterwards.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun Array.onEachIndexed(action: (index: Int, T) -> Unit): Array {\n return apply { forEachIndexed(action) }\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element,\n * and returns the array itself afterwards.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.onEachIndexed(action: (index: Int, Byte) -> Unit): ByteArray {\n return apply { forEachIndexed(action) }\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element,\n * and returns the array itself afterwards.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.onEachIndexed(action: (index: Int, Short) -> Unit): ShortArray {\n return apply { forEachIndexed(action) }\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element,\n * and returns the array itself afterwards.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.onEachIndexed(action: (index: Int, Int) -> Unit): IntArray {\n return apply { forEachIndexed(action) }\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element,\n * and returns the array itself afterwards.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.onEachIndexed(action: (index: Int, Long) -> Unit): LongArray {\n return apply { forEachIndexed(action) }\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element,\n * and returns the array itself afterwards.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.onEachIndexed(action: (index: Int, Float) -> Unit): FloatArray {\n return apply { forEachIndexed(action) }\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element,\n * and returns the array itself afterwards.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.onEachIndexed(action: (index: Int, Double) -> Unit): DoubleArray {\n return apply { forEachIndexed(action) }\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element,\n * and returns the array itself afterwards.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.onEachIndexed(action: (index: Int, Boolean) -> Unit): BooleanArray {\n return apply { forEachIndexed(action) }\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element,\n * and returns the array itself afterwards.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.onEachIndexed(action: (index: Int, Char) -> Unit): CharArray {\n return apply { forEachIndexed(action) }\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun Array.reduce(operation: (acc: S, T) -> S): S {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator: S = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun ByteArray.reduce(operation: (acc: Byte, Byte) -> Byte): Byte {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun ShortArray.reduce(operation: (acc: Short, Short) -> Short): Short {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun IntArray.reduce(operation: (acc: Int, Int) -> Int): Int {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun LongArray.reduce(operation: (acc: Long, Long) -> Long): Long {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun FloatArray.reduce(operation: (acc: Float, Float) -> Float): Float {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun DoubleArray.reduce(operation: (acc: Double, Double) -> Double): Double {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun BooleanArray.reduce(operation: (acc: Boolean, Boolean) -> Boolean): Boolean {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun CharArray.reduce(operation: (acc: Char, Char) -> Char): Char {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun Array.reduceIndexed(operation: (index: Int, acc: S, T) -> S): S {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator: S = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun ByteArray.reduceIndexed(operation: (index: Int, acc: Byte, Byte) -> Byte): Byte {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun ShortArray.reduceIndexed(operation: (index: Int, acc: Short, Short) -> Short): Short {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun IntArray.reduceIndexed(operation: (index: Int, acc: Int, Int) -> Int): Int {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun LongArray.reduceIndexed(operation: (index: Int, acc: Long, Long) -> Long): Long {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun FloatArray.reduceIndexed(operation: (index: Int, acc: Float, Float) -> Float): Float {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun DoubleArray.reduceIndexed(operation: (index: Int, acc: Double, Double) -> Double): Double {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun BooleanArray.reduceIndexed(operation: (index: Int, acc: Boolean, Boolean) -> Boolean): Boolean {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun CharArray.reduceIndexed(operation: (index: Int, acc: Char, Char) -> Char): Char {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun Array.reduceIndexedOrNull(operation: (index: Int, acc: S, T) -> S): S? {\n if (isEmpty())\n return null\n var accumulator: S = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun ByteArray.reduceIndexedOrNull(operation: (index: Int, acc: Byte, Byte) -> Byte): Byte? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun ShortArray.reduceIndexedOrNull(operation: (index: Int, acc: Short, Short) -> Short): Short? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun IntArray.reduceIndexedOrNull(operation: (index: Int, acc: Int, Int) -> Int): Int? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun LongArray.reduceIndexedOrNull(operation: (index: Int, acc: Long, Long) -> Long): Long? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun FloatArray.reduceIndexedOrNull(operation: (index: Int, acc: Float, Float) -> Float): Float? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun DoubleArray.reduceIndexedOrNull(operation: (index: Int, acc: Double, Double) -> Double): Double? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun BooleanArray.reduceIndexedOrNull(operation: (index: Int, acc: Boolean, Boolean) -> Boolean): Boolean? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun CharArray.reduceIndexedOrNull(operation: (index: Int, acc: Char, Char) -> Char): Char? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun Array.reduceOrNull(operation: (acc: S, T) -> S): S? {\n if (isEmpty())\n return null\n var accumulator: S = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun ByteArray.reduceOrNull(operation: (acc: Byte, Byte) -> Byte): Byte? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun ShortArray.reduceOrNull(operation: (acc: Short, Short) -> Short): Short? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun IntArray.reduceOrNull(operation: (acc: Int, Int) -> Int): Int? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun LongArray.reduceOrNull(operation: (acc: Long, Long) -> Long): Long? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun FloatArray.reduceOrNull(operation: (acc: Float, Float) -> Float): Float? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun DoubleArray.reduceOrNull(operation: (acc: Double, Double) -> Double): Double? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun BooleanArray.reduceOrNull(operation: (acc: Boolean, Boolean) -> Boolean): Boolean? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun CharArray.reduceOrNull(operation: (acc: Char, Char) -> Char): Char? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\npublic inline fun Array.reduceRight(operation: (T, acc: S) -> S): S {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator: S = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\npublic inline fun ByteArray.reduceRight(operation: (Byte, acc: Byte) -> Byte): Byte {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\npublic inline fun ShortArray.reduceRight(operation: (Short, acc: Short) -> Short): Short {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\npublic inline fun IntArray.reduceRight(operation: (Int, acc: Int) -> Int): Int {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\npublic inline fun LongArray.reduceRight(operation: (Long, acc: Long) -> Long): Long {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\npublic inline fun FloatArray.reduceRight(operation: (Float, acc: Float) -> Float): Float {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\npublic inline fun DoubleArray.reduceRight(operation: (Double, acc: Double) -> Double): Double {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\npublic inline fun BooleanArray.reduceRight(operation: (Boolean, acc: Boolean) -> Boolean): Boolean {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\npublic inline fun CharArray.reduceRight(operation: (Char, acc: Char) -> Char): Char {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\npublic inline fun Array.reduceRightIndexed(operation: (index: Int, T, acc: S) -> S): S {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator: S = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\npublic inline fun ByteArray.reduceRightIndexed(operation: (index: Int, Byte, acc: Byte) -> Byte): Byte {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\npublic inline fun ShortArray.reduceRightIndexed(operation: (index: Int, Short, acc: Short) -> Short): Short {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\npublic inline fun IntArray.reduceRightIndexed(operation: (index: Int, Int, acc: Int) -> Int): Int {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\npublic inline fun LongArray.reduceRightIndexed(operation: (index: Int, Long, acc: Long) -> Long): Long {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\npublic inline fun FloatArray.reduceRightIndexed(operation: (index: Int, Float, acc: Float) -> Float): Float {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\npublic inline fun DoubleArray.reduceRightIndexed(operation: (index: Int, Double, acc: Double) -> Double): Double {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\npublic inline fun BooleanArray.reduceRightIndexed(operation: (index: Int, Boolean, acc: Boolean) -> Boolean): Boolean {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\npublic inline fun CharArray.reduceRightIndexed(operation: (index: Int, Char, acc: Char) -> Char): Char {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun Array.reduceRightIndexedOrNull(operation: (index: Int, T, acc: S) -> S): S? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator: S = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun ByteArray.reduceRightIndexedOrNull(operation: (index: Int, Byte, acc: Byte) -> Byte): Byte? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun ShortArray.reduceRightIndexedOrNull(operation: (index: Int, Short, acc: Short) -> Short): Short? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun IntArray.reduceRightIndexedOrNull(operation: (index: Int, Int, acc: Int) -> Int): Int? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun LongArray.reduceRightIndexedOrNull(operation: (index: Int, Long, acc: Long) -> Long): Long? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun FloatArray.reduceRightIndexedOrNull(operation: (index: Int, Float, acc: Float) -> Float): Float? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun DoubleArray.reduceRightIndexedOrNull(operation: (index: Int, Double, acc: Double) -> Double): Double? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun BooleanArray.reduceRightIndexedOrNull(operation: (index: Int, Boolean, acc: Boolean) -> Boolean): Boolean? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun CharArray.reduceRightIndexedOrNull(operation: (index: Int, Char, acc: Char) -> Char): Char? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun Array.reduceRightOrNull(operation: (T, acc: S) -> S): S? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator: S = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun ByteArray.reduceRightOrNull(operation: (Byte, acc: Byte) -> Byte): Byte? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun ShortArray.reduceRightOrNull(operation: (Short, acc: Short) -> Short): Short? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun IntArray.reduceRightOrNull(operation: (Int, acc: Int) -> Int): Int? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun LongArray.reduceRightOrNull(operation: (Long, acc: Long) -> Long): Long? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun FloatArray.reduceRightOrNull(operation: (Float, acc: Float) -> Float): Float? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun DoubleArray.reduceRightOrNull(operation: (Double, acc: Double) -> Double): Double? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun BooleanArray.reduceRightOrNull(operation: (Boolean, acc: Boolean) -> Boolean): Boolean? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun CharArray.reduceRightOrNull(operation: (Char, acc: Char) -> Char): Char? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\npublic inline fun Array.runningFold(initial: R, operation: (acc: R, T) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (element in this) {\n accumulator = operation(accumulator, element)\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.runningFold(initial: R, operation: (acc: R, Byte) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (element in this) {\n accumulator = operation(accumulator, element)\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.runningFold(initial: R, operation: (acc: R, Short) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (element in this) {\n accumulator = operation(accumulator, element)\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.runningFold(initial: R, operation: (acc: R, Int) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (element in this) {\n accumulator = operation(accumulator, element)\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.runningFold(initial: R, operation: (acc: R, Long) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (element in this) {\n accumulator = operation(accumulator, element)\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.runningFold(initial: R, operation: (acc: R, Float) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (element in this) {\n accumulator = operation(accumulator, element)\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.runningFold(initial: R, operation: (acc: R, Double) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (element in this) {\n accumulator = operation(accumulator, element)\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.runningFold(initial: R, operation: (acc: R, Boolean) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (element in this) {\n accumulator = operation(accumulator, element)\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.runningFold(initial: R, operation: (acc: R, Char) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (element in this) {\n accumulator = operation(accumulator, element)\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\npublic inline fun Array.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (index in indices) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, Byte) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (index in indices) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, Short) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (index in indices) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, Int) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (index in indices) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, Long) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (index in indices) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, Float) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (index in indices) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, Double) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (index in indices) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, Boolean) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (index in indices) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, Char) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (index in indices) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with the first element of this array.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and the element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun Array.runningReduce(operation: (acc: S, T) -> S): List {\n if (isEmpty()) return emptyList()\n var accumulator: S = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with the first element of this array.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.runningReduce(operation: (acc: Byte, Byte) -> Byte): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with the first element of this array.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.runningReduce(operation: (acc: Short, Short) -> Short): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with the first element of this array.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.runningReduce(operation: (acc: Int, Int) -> Int): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with the first element of this array.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.runningReduce(operation: (acc: Long, Long) -> Long): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with the first element of this array.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.runningReduce(operation: (acc: Float, Float) -> Float): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with the first element of this array.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.runningReduce(operation: (acc: Double, Double) -> Double): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with the first element of this array.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.runningReduce(operation: (acc: Boolean, Boolean) -> Boolean): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with the first element of this array.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.runningReduce(operation: (acc: Char, Char) -> Char): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with the first element of this array.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\npublic inline fun Array.runningReduceIndexed(operation: (index: Int, acc: S, T) -> S): List {\n if (isEmpty()) return emptyList()\n var accumulator: S = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with the first element of this array.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.runningReduceIndexed(operation: (index: Int, acc: Byte, Byte) -> Byte): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with the first element of this array.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.runningReduceIndexed(operation: (index: Int, acc: Short, Short) -> Short): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with the first element of this array.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.runningReduceIndexed(operation: (index: Int, acc: Int, Int) -> Int): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with the first element of this array.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.runningReduceIndexed(operation: (index: Int, acc: Long, Long) -> Long): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with the first element of this array.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.runningReduceIndexed(operation: (index: Int, acc: Float, Float) -> Float): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with the first element of this array.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.runningReduceIndexed(operation: (index: Int, acc: Double, Double) -> Double): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with the first element of this array.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.runningReduceIndexed(operation: (index: Int, acc: Boolean, Boolean) -> Boolean): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with the first element of this array.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.runningReduceIndexed(operation: (index: Int, acc: Char, Char) -> Char): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun Array.scan(initial: R, operation: (acc: R, T) -> R): List {\n return runningFold(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.scan(initial: R, operation: (acc: R, Byte) -> R): List {\n return runningFold(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.scan(initial: R, operation: (acc: R, Short) -> R): List {\n return runningFold(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.scan(initial: R, operation: (acc: R, Int) -> R): List {\n return runningFold(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.scan(initial: R, operation: (acc: R, Long) -> R): List {\n return runningFold(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.scan(initial: R, operation: (acc: R, Float) -> R): List {\n return runningFold(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.scan(initial: R, operation: (acc: R, Double) -> R): List {\n return runningFold(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.scan(initial: R, operation: (acc: R, Boolean) -> R): List {\n return runningFold(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.scan(initial: R, operation: (acc: R, Char) -> R): List {\n return runningFold(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun Array.scanIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): List {\n return runningFoldIndexed(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.scanIndexed(initial: R, operation: (index: Int, acc: R, Byte) -> R): List {\n return runningFoldIndexed(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.scanIndexed(initial: R, operation: (index: Int, acc: R, Short) -> R): List {\n return runningFoldIndexed(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.scanIndexed(initial: R, operation: (index: Int, acc: R, Int) -> R): List {\n return runningFoldIndexed(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.scanIndexed(initial: R, operation: (index: Int, acc: R, Long) -> R): List {\n return runningFoldIndexed(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.scanIndexed(initial: R, operation: (index: Int, acc: R, Float) -> R): List {\n return runningFoldIndexed(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.scanIndexed(initial: R, operation: (index: Int, acc: R, Double) -> R): List {\n return runningFoldIndexed(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.scanIndexed(initial: R, operation: (index: Int, acc: R, Boolean) -> R): List {\n return runningFoldIndexed(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.scanIndexed(initial: R, operation: (index: Int, acc: R, Char) -> R): List {\n return runningFoldIndexed(initial, operation)\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun Array.sumBy(selector: (T) -> Int): Int {\n var sum: Int = 0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun ByteArray.sumBy(selector: (Byte) -> Int): Int {\n var sum: Int = 0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun ShortArray.sumBy(selector: (Short) -> Int): Int {\n var sum: Int = 0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun IntArray.sumBy(selector: (Int) -> Int): Int {\n var sum: Int = 0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun LongArray.sumBy(selector: (Long) -> Int): Int {\n var sum: Int = 0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun FloatArray.sumBy(selector: (Float) -> Int): Int {\n var sum: Int = 0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun DoubleArray.sumBy(selector: (Double) -> Int): Int {\n var sum: Int = 0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun BooleanArray.sumBy(selector: (Boolean) -> Int): Int {\n var sum: Int = 0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun CharArray.sumBy(selector: (Char) -> Int): Int {\n var sum: Int = 0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun Array.sumByDouble(selector: (T) -> Double): Double {\n var sum: Double = 0.0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun ByteArray.sumByDouble(selector: (Byte) -> Double): Double {\n var sum: Double = 0.0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun ShortArray.sumByDouble(selector: (Short) -> Double): Double {\n var sum: Double = 0.0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun IntArray.sumByDouble(selector: (Int) -> Double): Double {\n var sum: Double = 0.0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun LongArray.sumByDouble(selector: (Long) -> Double): Double {\n var sum: Double = 0.0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun FloatArray.sumByDouble(selector: (Float) -> Double): Double {\n var sum: Double = 0.0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun DoubleArray.sumByDouble(selector: (Double) -> Double): Double {\n var sum: Double = 0.0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun BooleanArray.sumByDouble(selector: (Boolean) -> Double): Double {\n var sum: Double = 0.0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun CharArray.sumByDouble(selector: (Char) -> Double): Double {\n var sum: Double = 0.0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfDouble\")\n@kotlin.internal.InlineOnly\npublic inline fun Array.sumOf(selector: (T) -> Double): Double {\n var sum: Double = 0.toDouble()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfDouble\")\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.sumOf(selector: (Byte) -> Double): Double {\n var sum: Double = 0.toDouble()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfDouble\")\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.sumOf(selector: (Short) -> Double): Double {\n var sum: Double = 0.toDouble()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfDouble\")\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.sumOf(selector: (Int) -> Double): Double {\n var sum: Double = 0.toDouble()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfDouble\")\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.sumOf(selector: (Long) -> Double): Double {\n var sum: Double = 0.toDouble()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfDouble\")\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.sumOf(selector: (Float) -> Double): Double {\n var sum: Double = 0.toDouble()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfDouble\")\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.sumOf(selector: (Double) -> Double): Double {\n var sum: Double = 0.toDouble()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfDouble\")\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.sumOf(selector: (Boolean) -> Double): Double {\n var sum: Double = 0.toDouble()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfDouble\")\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.sumOf(selector: (Char) -> Double): Double {\n var sum: Double = 0.toDouble()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfInt\")\n@kotlin.internal.InlineOnly\npublic inline fun Array.sumOf(selector: (T) -> Int): Int {\n var sum: Int = 0.toInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfInt\")\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.sumOf(selector: (Byte) -> Int): Int {\n var sum: Int = 0.toInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfInt\")\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.sumOf(selector: (Short) -> Int): Int {\n var sum: Int = 0.toInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfInt\")\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.sumOf(selector: (Int) -> Int): Int {\n var sum: Int = 0.toInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfInt\")\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.sumOf(selector: (Long) -> Int): Int {\n var sum: Int = 0.toInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfInt\")\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.sumOf(selector: (Float) -> Int): Int {\n var sum: Int = 0.toInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfInt\")\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.sumOf(selector: (Double) -> Int): Int {\n var sum: Int = 0.toInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfInt\")\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.sumOf(selector: (Boolean) -> Int): Int {\n var sum: Int = 0.toInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfInt\")\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.sumOf(selector: (Char) -> Int): Int {\n var sum: Int = 0.toInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfLong\")\n@kotlin.internal.InlineOnly\npublic inline fun Array.sumOf(selector: (T) -> Long): Long {\n var sum: Long = 0.toLong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfLong\")\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.sumOf(selector: (Byte) -> Long): Long {\n var sum: Long = 0.toLong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfLong\")\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.sumOf(selector: (Short) -> Long): Long {\n var sum: Long = 0.toLong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfLong\")\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.sumOf(selector: (Int) -> Long): Long {\n var sum: Long = 0.toLong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfLong\")\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.sumOf(selector: (Long) -> Long): Long {\n var sum: Long = 0.toLong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfLong\")\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.sumOf(selector: (Float) -> Long): Long {\n var sum: Long = 0.toLong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfLong\")\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.sumOf(selector: (Double) -> Long): Long {\n var sum: Long = 0.toLong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfLong\")\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.sumOf(selector: (Boolean) -> Long): Long {\n var sum: Long = 0.toLong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfLong\")\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.sumOf(selector: (Char) -> Long): Long {\n var sum: Long = 0.toLong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfUInt\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Array.sumOf(selector: (T) -> UInt): UInt {\n var sum: UInt = 0.toUInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfUInt\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.sumOf(selector: (Byte) -> UInt): UInt {\n var sum: UInt = 0.toUInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfUInt\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.sumOf(selector: (Short) -> UInt): UInt {\n var sum: UInt = 0.toUInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfUInt\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.sumOf(selector: (Int) -> UInt): UInt {\n var sum: UInt = 0.toUInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfUInt\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.sumOf(selector: (Long) -> UInt): UInt {\n var sum: UInt = 0.toUInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfUInt\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.sumOf(selector: (Float) -> UInt): UInt {\n var sum: UInt = 0.toUInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfUInt\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.sumOf(selector: (Double) -> UInt): UInt {\n var sum: UInt = 0.toUInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfUInt\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.sumOf(selector: (Boolean) -> UInt): UInt {\n var sum: UInt = 0.toUInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfUInt\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.sumOf(selector: (Char) -> UInt): UInt {\n var sum: UInt = 0.toUInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfULong\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Array.sumOf(selector: (T) -> ULong): ULong {\n var sum: ULong = 0.toULong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfULong\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.sumOf(selector: (Byte) -> ULong): ULong {\n var sum: ULong = 0.toULong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfULong\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.sumOf(selector: (Short) -> ULong): ULong {\n var sum: ULong = 0.toULong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfULong\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.sumOf(selector: (Int) -> ULong): ULong {\n var sum: ULong = 0.toULong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfULong\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.sumOf(selector: (Long) -> ULong): ULong {\n var sum: ULong = 0.toULong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfULong\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.sumOf(selector: (Float) -> ULong): ULong {\n var sum: ULong = 0.toULong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfULong\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.sumOf(selector: (Double) -> ULong): ULong {\n var sum: ULong = 0.toULong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfULong\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun BooleanArray.sumOf(selector: (Boolean) -> ULong): ULong {\n var sum: ULong = 0.toULong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfULong\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.sumOf(selector: (Char) -> ULong): ULong {\n var sum: ULong = 0.toULong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements.\n */\npublic fun Array.requireNoNulls(): Array {\n for (element in this) {\n if (element == null) {\n throw IllegalArgumentException(\"null element found in $this.\")\n }\n }\n @Suppress(\"UNCHECKED_CAST\")\n return this as Array\n}\n\n/**\n * Splits the original array into pair of lists,\n * where *first* list contains elements for which [predicate] yielded `true`,\n * while *second* list contains elements for which [predicate] yielded `false`.\n * \n * @sample samples.collections.Arrays.Transformations.partitionArrayOfPrimitives\n */\npublic inline fun Array.partition(predicate: (T) -> Boolean): Pair, List> {\n val first = ArrayList()\n val second = ArrayList()\n for (element in this) {\n if (predicate(element)) {\n first.add(element)\n } else {\n second.add(element)\n }\n }\n return Pair(first, second)\n}\n\n/**\n * Splits the original array into pair of lists,\n * where *first* list contains elements for which [predicate] yielded `true`,\n * while *second* list contains elements for which [predicate] yielded `false`.\n * \n * @sample samples.collections.Arrays.Transformations.partitionArrayOfPrimitives\n */\npublic inline fun ByteArray.partition(predicate: (Byte) -> Boolean): Pair, List> {\n val first = ArrayList()\n val second = ArrayList()\n for (element in this) {\n if (predicate(element)) {\n first.add(element)\n } else {\n second.add(element)\n }\n }\n return Pair(first, second)\n}\n\n/**\n * Splits the original array into pair of lists,\n * where *first* list contains elements for which [predicate] yielded `true`,\n * while *second* list contains elements for which [predicate] yielded `false`.\n * \n * @sample samples.collections.Arrays.Transformations.partitionArrayOfPrimitives\n */\npublic inline fun ShortArray.partition(predicate: (Short) -> Boolean): Pair, List> {\n val first = ArrayList()\n val second = ArrayList()\n for (element in this) {\n if (predicate(element)) {\n first.add(element)\n } else {\n second.add(element)\n }\n }\n return Pair(first, second)\n}\n\n/**\n * Splits the original array into pair of lists,\n * where *first* list contains elements for which [predicate] yielded `true`,\n * while *second* list contains elements for which [predicate] yielded `false`.\n * \n * @sample samples.collections.Arrays.Transformations.partitionArrayOfPrimitives\n */\npublic inline fun IntArray.partition(predicate: (Int) -> Boolean): Pair, List> {\n val first = ArrayList()\n val second = ArrayList()\n for (element in this) {\n if (predicate(element)) {\n first.add(element)\n } else {\n second.add(element)\n }\n }\n return Pair(first, second)\n}\n\n/**\n * Splits the original array into pair of lists,\n * where *first* list contains elements for which [predicate] yielded `true`,\n * while *second* list contains elements for which [predicate] yielded `false`.\n * \n * @sample samples.collections.Arrays.Transformations.partitionArrayOfPrimitives\n */\npublic inline fun LongArray.partition(predicate: (Long) -> Boolean): Pair, List> {\n val first = ArrayList()\n val second = ArrayList()\n for (element in this) {\n if (predicate(element)) {\n first.add(element)\n } else {\n second.add(element)\n }\n }\n return Pair(first, second)\n}\n\n/**\n * Splits the original array into pair of lists,\n * where *first* list contains elements for which [predicate] yielded `true`,\n * while *second* list contains elements for which [predicate] yielded `false`.\n * \n * @sample samples.collections.Arrays.Transformations.partitionArrayOfPrimitives\n */\npublic inline fun FloatArray.partition(predicate: (Float) -> Boolean): Pair, List> {\n val first = ArrayList()\n val second = ArrayList()\n for (element in this) {\n if (predicate(element)) {\n first.add(element)\n } else {\n second.add(element)\n }\n }\n return Pair(first, second)\n}\n\n/**\n * Splits the original array into pair of lists,\n * where *first* list contains elements for which [predicate] yielded `true`,\n * while *second* list contains elements for which [predicate] yielded `false`.\n * \n * @sample samples.collections.Arrays.Transformations.partitionArrayOfPrimitives\n */\npublic inline fun DoubleArray.partition(predicate: (Double) -> Boolean): Pair, List> {\n val first = ArrayList()\n val second = ArrayList()\n for (element in this) {\n if (predicate(element)) {\n first.add(element)\n } else {\n second.add(element)\n }\n }\n return Pair(first, second)\n}\n\n/**\n * Splits the original array into pair of lists,\n * where *first* list contains elements for which [predicate] yielded `true`,\n * while *second* list contains elements for which [predicate] yielded `false`.\n * \n * @sample samples.collections.Arrays.Transformations.partitionArrayOfPrimitives\n */\npublic inline fun BooleanArray.partition(predicate: (Boolean) -> Boolean): Pair, List> {\n val first = ArrayList()\n val second = ArrayList()\n for (element in this) {\n if (predicate(element)) {\n first.add(element)\n } else {\n second.add(element)\n }\n }\n return Pair(first, second)\n}\n\n/**\n * Splits the original array into pair of lists,\n * where *first* list contains elements for which [predicate] yielded `true`,\n * while *second* list contains elements for which [predicate] yielded `false`.\n * \n * @sample samples.collections.Arrays.Transformations.partitionArrayOfPrimitives\n */\npublic inline fun CharArray.partition(predicate: (Char) -> Boolean): Pair, List> {\n val first = ArrayList()\n val second = ArrayList()\n for (element in this) {\n if (predicate(element)) {\n first.add(element)\n } else {\n second.add(element)\n }\n }\n return Pair(first, second)\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun Array.zip(other: Array): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun ByteArray.zip(other: Array): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun ShortArray.zip(other: Array): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun IntArray.zip(other: Array): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun LongArray.zip(other: Array): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun FloatArray.zip(other: Array): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun DoubleArray.zip(other: Array): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun BooleanArray.zip(other: Array): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun CharArray.zip(other: Array): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun Array.zip(other: Array, transform: (a: T, b: R) -> V): List {\n val size = minOf(size, other.size)\n val list = ArrayList(size)\n for (i in 0 until size) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun ByteArray.zip(other: Array, transform: (a: Byte, b: R) -> V): List {\n val size = minOf(size, other.size)\n val list = ArrayList(size)\n for (i in 0 until size) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun ShortArray.zip(other: Array, transform: (a: Short, b: R) -> V): List {\n val size = minOf(size, other.size)\n val list = ArrayList(size)\n for (i in 0 until size) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun IntArray.zip(other: Array, transform: (a: Int, b: R) -> V): List {\n val size = minOf(size, other.size)\n val list = ArrayList(size)\n for (i in 0 until size) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun LongArray.zip(other: Array, transform: (a: Long, b: R) -> V): List {\n val size = minOf(size, other.size)\n val list = ArrayList(size)\n for (i in 0 until size) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun FloatArray.zip(other: Array, transform: (a: Float, b: R) -> V): List {\n val size = minOf(size, other.size)\n val list = ArrayList(size)\n for (i in 0 until size) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun DoubleArray.zip(other: Array, transform: (a: Double, b: R) -> V): List {\n val size = minOf(size, other.size)\n val list = ArrayList(size)\n for (i in 0 until size) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun BooleanArray.zip(other: Array, transform: (a: Boolean, b: R) -> V): List {\n val size = minOf(size, other.size)\n val list = ArrayList(size)\n for (i in 0 until size) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun CharArray.zip(other: Array, transform: (a: Char, b: R) -> V): List {\n val size = minOf(size, other.size)\n val list = ArrayList(size)\n for (i in 0 until size) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` collection and [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun Array.zip(other: Iterable): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` collection and [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun ByteArray.zip(other: Iterable): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` collection and [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun ShortArray.zip(other: Iterable): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` collection and [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun IntArray.zip(other: Iterable): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` collection and [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun LongArray.zip(other: Iterable): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` collection and [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun FloatArray.zip(other: Iterable): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` collection and [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun DoubleArray.zip(other: Iterable): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` collection and [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun BooleanArray.zip(other: Iterable): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` collection and [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun CharArray.zip(other: Iterable): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] collection with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun Array.zip(other: Iterable, transform: (a: T, b: R) -> V): List {\n val arraySize = size\n val list = ArrayList(minOf(other.collectionSizeOrDefault(10), arraySize))\n var i = 0\n for (element in other) {\n if (i >= arraySize) break\n list.add(transform(this[i++], element))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] collection with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun ByteArray.zip(other: Iterable, transform: (a: Byte, b: R) -> V): List {\n val arraySize = size\n val list = ArrayList(minOf(other.collectionSizeOrDefault(10), arraySize))\n var i = 0\n for (element in other) {\n if (i >= arraySize) break\n list.add(transform(this[i++], element))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] collection with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun ShortArray.zip(other: Iterable, transform: (a: Short, b: R) -> V): List {\n val arraySize = size\n val list = ArrayList(minOf(other.collectionSizeOrDefault(10), arraySize))\n var i = 0\n for (element in other) {\n if (i >= arraySize) break\n list.add(transform(this[i++], element))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] collection with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun IntArray.zip(other: Iterable, transform: (a: Int, b: R) -> V): List {\n val arraySize = size\n val list = ArrayList(minOf(other.collectionSizeOrDefault(10), arraySize))\n var i = 0\n for (element in other) {\n if (i >= arraySize) break\n list.add(transform(this[i++], element))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] collection with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun LongArray.zip(other: Iterable, transform: (a: Long, b: R) -> V): List {\n val arraySize = size\n val list = ArrayList(minOf(other.collectionSizeOrDefault(10), arraySize))\n var i = 0\n for (element in other) {\n if (i >= arraySize) break\n list.add(transform(this[i++], element))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] collection with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun FloatArray.zip(other: Iterable, transform: (a: Float, b: R) -> V): List {\n val arraySize = size\n val list = ArrayList(minOf(other.collectionSizeOrDefault(10), arraySize))\n var i = 0\n for (element in other) {\n if (i >= arraySize) break\n list.add(transform(this[i++], element))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] collection with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun DoubleArray.zip(other: Iterable, transform: (a: Double, b: R) -> V): List {\n val arraySize = size\n val list = ArrayList(minOf(other.collectionSizeOrDefault(10), arraySize))\n var i = 0\n for (element in other) {\n if (i >= arraySize) break\n list.add(transform(this[i++], element))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] collection with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun BooleanArray.zip(other: Iterable, transform: (a: Boolean, b: R) -> V): List {\n val arraySize = size\n val list = ArrayList(minOf(other.collectionSizeOrDefault(10), arraySize))\n var i = 0\n for (element in other) {\n if (i >= arraySize) break\n list.add(transform(this[i++], element))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] collection with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun CharArray.zip(other: Iterable, transform: (a: Char, b: R) -> V): List {\n val arraySize = size\n val list = ArrayList(minOf(other.collectionSizeOrDefault(10), arraySize))\n var i = 0\n for (element in other) {\n if (i >= arraySize) break\n list.add(transform(this[i++], element))\n }\n return list\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun ByteArray.zip(other: ByteArray): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun ShortArray.zip(other: ShortArray): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun IntArray.zip(other: IntArray): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun LongArray.zip(other: LongArray): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun FloatArray.zip(other: FloatArray): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun DoubleArray.zip(other: DoubleArray): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun BooleanArray.zip(other: BooleanArray): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun CharArray.zip(other: CharArray): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest array.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun ByteArray.zip(other: ByteArray, transform: (a: Byte, b: Byte) -> V): List {\n val size = minOf(size, other.size)\n val list = ArrayList(size)\n for (i in 0 until size) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest array.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun ShortArray.zip(other: ShortArray, transform: (a: Short, b: Short) -> V): List {\n val size = minOf(size, other.size)\n val list = ArrayList(size)\n for (i in 0 until size) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest array.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun IntArray.zip(other: IntArray, transform: (a: Int, b: Int) -> V): List {\n val size = minOf(size, other.size)\n val list = ArrayList(size)\n for (i in 0 until size) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest array.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun LongArray.zip(other: LongArray, transform: (a: Long, b: Long) -> V): List {\n val size = minOf(size, other.size)\n val list = ArrayList(size)\n for (i in 0 until size) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest array.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun FloatArray.zip(other: FloatArray, transform: (a: Float, b: Float) -> V): List {\n val size = minOf(size, other.size)\n val list = ArrayList(size)\n for (i in 0 until size) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest array.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun DoubleArray.zip(other: DoubleArray, transform: (a: Double, b: Double) -> V): List {\n val size = minOf(size, other.size)\n val list = ArrayList(size)\n for (i in 0 until size) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest array.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun BooleanArray.zip(other: BooleanArray, transform: (a: Boolean, b: Boolean) -> V): List {\n val size = minOf(size, other.size)\n val list = ArrayList(size)\n for (i in 0 until size) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest array.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun CharArray.zip(other: CharArray, transform: (a: Char, b: Char) -> V): List {\n val size = minOf(size, other.size)\n val list = ArrayList(size)\n for (i in 0 until size) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n * \n * @sample samples.collections.Collections.Transformations.joinTo\n */\npublic fun Array.joinTo(buffer: A, separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((T) -> CharSequence)? = null): A {\n buffer.append(prefix)\n var count = 0\n for (element in this) {\n if (++count > 1) buffer.append(separator)\n if (limit < 0 || count <= limit) {\n buffer.appendElement(element, transform)\n } else break\n }\n if (limit >= 0 && count > limit) buffer.append(truncated)\n buffer.append(postfix)\n return buffer\n}\n\n/**\n * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n * \n * @sample samples.collections.Collections.Transformations.joinTo\n */\npublic fun ByteArray.joinTo(buffer: A, separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((Byte) -> CharSequence)? = null): A {\n buffer.append(prefix)\n var count = 0\n for (element in this) {\n if (++count > 1) buffer.append(separator)\n if (limit < 0 || count <= limit) {\n if (transform != null)\n buffer.append(transform(element))\n else\n buffer.append(element.toString())\n } else break\n }\n if (limit >= 0 && count > limit) buffer.append(truncated)\n buffer.append(postfix)\n return buffer\n}\n\n/**\n * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n * \n * @sample samples.collections.Collections.Transformations.joinTo\n */\npublic fun ShortArray.joinTo(buffer: A, separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((Short) -> CharSequence)? = null): A {\n buffer.append(prefix)\n var count = 0\n for (element in this) {\n if (++count > 1) buffer.append(separator)\n if (limit < 0 || count <= limit) {\n if (transform != null)\n buffer.append(transform(element))\n else\n buffer.append(element.toString())\n } else break\n }\n if (limit >= 0 && count > limit) buffer.append(truncated)\n buffer.append(postfix)\n return buffer\n}\n\n/**\n * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n * \n * @sample samples.collections.Collections.Transformations.joinTo\n */\npublic fun IntArray.joinTo(buffer: A, separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((Int) -> CharSequence)? = null): A {\n buffer.append(prefix)\n var count = 0\n for (element in this) {\n if (++count > 1) buffer.append(separator)\n if (limit < 0 || count <= limit) {\n if (transform != null)\n buffer.append(transform(element))\n else\n buffer.append(element.toString())\n } else break\n }\n if (limit >= 0 && count > limit) buffer.append(truncated)\n buffer.append(postfix)\n return buffer\n}\n\n/**\n * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n * \n * @sample samples.collections.Collections.Transformations.joinTo\n */\npublic fun LongArray.joinTo(buffer: A, separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((Long) -> CharSequence)? = null): A {\n buffer.append(prefix)\n var count = 0\n for (element in this) {\n if (++count > 1) buffer.append(separator)\n if (limit < 0 || count <= limit) {\n if (transform != null)\n buffer.append(transform(element))\n else\n buffer.append(element.toString())\n } else break\n }\n if (limit >= 0 && count > limit) buffer.append(truncated)\n buffer.append(postfix)\n return buffer\n}\n\n/**\n * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n * \n * @sample samples.collections.Collections.Transformations.joinTo\n */\npublic fun FloatArray.joinTo(buffer: A, separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((Float) -> CharSequence)? = null): A {\n buffer.append(prefix)\n var count = 0\n for (element in this) {\n if (++count > 1) buffer.append(separator)\n if (limit < 0 || count <= limit) {\n if (transform != null)\n buffer.append(transform(element))\n else\n buffer.append(element.toString())\n } else break\n }\n if (limit >= 0 && count > limit) buffer.append(truncated)\n buffer.append(postfix)\n return buffer\n}\n\n/**\n * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n * \n * @sample samples.collections.Collections.Transformations.joinTo\n */\npublic fun DoubleArray.joinTo(buffer: A, separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((Double) -> CharSequence)? = null): A {\n buffer.append(prefix)\n var count = 0\n for (element in this) {\n if (++count > 1) buffer.append(separator)\n if (limit < 0 || count <= limit) {\n if (transform != null)\n buffer.append(transform(element))\n else\n buffer.append(element.toString())\n } else break\n }\n if (limit >= 0 && count > limit) buffer.append(truncated)\n buffer.append(postfix)\n return buffer\n}\n\n/**\n * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n * \n * @sample samples.collections.Collections.Transformations.joinTo\n */\npublic fun BooleanArray.joinTo(buffer: A, separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((Boolean) -> CharSequence)? = null): A {\n buffer.append(prefix)\n var count = 0\n for (element in this) {\n if (++count > 1) buffer.append(separator)\n if (limit < 0 || count <= limit) {\n if (transform != null)\n buffer.append(transform(element))\n else\n buffer.append(element.toString())\n } else break\n }\n if (limit >= 0 && count > limit) buffer.append(truncated)\n buffer.append(postfix)\n return buffer\n}\n\n/**\n * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n * \n * @sample samples.collections.Collections.Transformations.joinTo\n */\npublic fun CharArray.joinTo(buffer: A, separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((Char) -> CharSequence)? = null): A {\n buffer.append(prefix)\n var count = 0\n for (element in this) {\n if (++count > 1) buffer.append(separator)\n if (limit < 0 || count <= limit) {\n if (transform != null)\n buffer.append(transform(element))\n else\n buffer.append(element)\n } else break\n }\n if (limit >= 0 && count > limit) buffer.append(truncated)\n buffer.append(postfix)\n return buffer\n}\n\n/**\n * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n * \n * @sample samples.collections.Collections.Transformations.joinToString\n */\npublic fun Array.joinToString(separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((T) -> CharSequence)? = null): String {\n return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated, transform).toString()\n}\n\n/**\n * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n * \n * @sample samples.collections.Collections.Transformations.joinToString\n */\npublic fun ByteArray.joinToString(separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((Byte) -> CharSequence)? = null): String {\n return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated, transform).toString()\n}\n\n/**\n * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n * \n * @sample samples.collections.Collections.Transformations.joinToString\n */\npublic fun ShortArray.joinToString(separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((Short) -> CharSequence)? = null): String {\n return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated, transform).toString()\n}\n\n/**\n * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n * \n * @sample samples.collections.Collections.Transformations.joinToString\n */\npublic fun IntArray.joinToString(separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((Int) -> CharSequence)? = null): String {\n return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated, transform).toString()\n}\n\n/**\n * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n * \n * @sample samples.collections.Collections.Transformations.joinToString\n */\npublic fun LongArray.joinToString(separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((Long) -> CharSequence)? = null): String {\n return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated, transform).toString()\n}\n\n/**\n * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n * \n * @sample samples.collections.Collections.Transformations.joinToString\n */\npublic fun FloatArray.joinToString(separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((Float) -> CharSequence)? = null): String {\n return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated, transform).toString()\n}\n\n/**\n * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n * \n * @sample samples.collections.Collections.Transformations.joinToString\n */\npublic fun DoubleArray.joinToString(separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((Double) -> CharSequence)? = null): String {\n return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated, transform).toString()\n}\n\n/**\n * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n * \n * @sample samples.collections.Collections.Transformations.joinToString\n */\npublic fun BooleanArray.joinToString(separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((Boolean) -> CharSequence)? = null): String {\n return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated, transform).toString()\n}\n\n/**\n * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n * \n * @sample samples.collections.Collections.Transformations.joinToString\n */\npublic fun CharArray.joinToString(separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((Char) -> CharSequence)? = null): String {\n return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated, transform).toString()\n}\n\n/**\n * Creates an [Iterable] instance that wraps the original array returning its elements when being iterated.\n */\npublic fun Array.asIterable(): Iterable {\n if (isEmpty()) return emptyList()\n return Iterable { this.iterator() }\n}\n\n/**\n * Creates an [Iterable] instance that wraps the original array returning its elements when being iterated.\n */\npublic fun ByteArray.asIterable(): Iterable {\n if (isEmpty()) return emptyList()\n return Iterable { this.iterator() }\n}\n\n/**\n * Creates an [Iterable] instance that wraps the original array returning its elements when being iterated.\n */\npublic fun ShortArray.asIterable(): Iterable {\n if (isEmpty()) return emptyList()\n return Iterable { this.iterator() }\n}\n\n/**\n * Creates an [Iterable] instance that wraps the original array returning its elements when being iterated.\n */\npublic fun IntArray.asIterable(): Iterable {\n if (isEmpty()) return emptyList()\n return Iterable { this.iterator() }\n}\n\n/**\n * Creates an [Iterable] instance that wraps the original array returning its elements when being iterated.\n */\npublic fun LongArray.asIterable(): Iterable {\n if (isEmpty()) return emptyList()\n return Iterable { this.iterator() }\n}\n\n/**\n * Creates an [Iterable] instance that wraps the original array returning its elements when being iterated.\n */\npublic fun FloatArray.asIterable(): Iterable {\n if (isEmpty()) return emptyList()\n return Iterable { this.iterator() }\n}\n\n/**\n * Creates an [Iterable] instance that wraps the original array returning its elements when being iterated.\n */\npublic fun DoubleArray.asIterable(): Iterable {\n if (isEmpty()) return emptyList()\n return Iterable { this.iterator() }\n}\n\n/**\n * Creates an [Iterable] instance that wraps the original array returning its elements when being iterated.\n */\npublic fun BooleanArray.asIterable(): Iterable {\n if (isEmpty()) return emptyList()\n return Iterable { this.iterator() }\n}\n\n/**\n * Creates an [Iterable] instance that wraps the original array returning its elements when being iterated.\n */\npublic fun CharArray.asIterable(): Iterable {\n if (isEmpty()) return emptyList()\n return Iterable { this.iterator() }\n}\n\n/**\n * Creates a [Sequence] instance that wraps the original array returning its elements when being iterated.\n * \n * @sample samples.collections.Sequences.Building.sequenceFromArray\n */\npublic fun Array.asSequence(): Sequence {\n if (isEmpty()) return emptySequence()\n return Sequence { this.iterator() }\n}\n\n/**\n * Creates a [Sequence] instance that wraps the original array returning its elements when being iterated.\n * \n * @sample samples.collections.Sequences.Building.sequenceFromArray\n */\npublic fun ByteArray.asSequence(): Sequence {\n if (isEmpty()) return emptySequence()\n return Sequence { this.iterator() }\n}\n\n/**\n * Creates a [Sequence] instance that wraps the original array returning its elements when being iterated.\n * \n * @sample samples.collections.Sequences.Building.sequenceFromArray\n */\npublic fun ShortArray.asSequence(): Sequence {\n if (isEmpty()) return emptySequence()\n return Sequence { this.iterator() }\n}\n\n/**\n * Creates a [Sequence] instance that wraps the original array returning its elements when being iterated.\n * \n * @sample samples.collections.Sequences.Building.sequenceFromArray\n */\npublic fun IntArray.asSequence(): Sequence {\n if (isEmpty()) return emptySequence()\n return Sequence { this.iterator() }\n}\n\n/**\n * Creates a [Sequence] instance that wraps the original array returning its elements when being iterated.\n * \n * @sample samples.collections.Sequences.Building.sequenceFromArray\n */\npublic fun LongArray.asSequence(): Sequence {\n if (isEmpty()) return emptySequence()\n return Sequence { this.iterator() }\n}\n\n/**\n * Creates a [Sequence] instance that wraps the original array returning its elements when being iterated.\n * \n * @sample samples.collections.Sequences.Building.sequenceFromArray\n */\npublic fun FloatArray.asSequence(): Sequence {\n if (isEmpty()) return emptySequence()\n return Sequence { this.iterator() }\n}\n\n/**\n * Creates a [Sequence] instance that wraps the original array returning its elements when being iterated.\n * \n * @sample samples.collections.Sequences.Building.sequenceFromArray\n */\npublic fun DoubleArray.asSequence(): Sequence {\n if (isEmpty()) return emptySequence()\n return Sequence { this.iterator() }\n}\n\n/**\n * Creates a [Sequence] instance that wraps the original array returning its elements when being iterated.\n * \n * @sample samples.collections.Sequences.Building.sequenceFromArray\n */\npublic fun BooleanArray.asSequence(): Sequence {\n if (isEmpty()) return emptySequence()\n return Sequence { this.iterator() }\n}\n\n/**\n * Creates a [Sequence] instance that wraps the original array returning its elements when being iterated.\n * \n * @sample samples.collections.Sequences.Building.sequenceFromArray\n */\npublic fun CharArray.asSequence(): Sequence {\n if (isEmpty()) return emptySequence()\n return Sequence { this.iterator() }\n}\n\n/**\n * Returns an average value of elements in the array.\n */\n@kotlin.jvm.JvmName(\"averageOfByte\")\npublic fun Array.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n ++count\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the array.\n */\n@kotlin.jvm.JvmName(\"averageOfShort\")\npublic fun Array.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n ++count\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the array.\n */\n@kotlin.jvm.JvmName(\"averageOfInt\")\npublic fun Array.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n ++count\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the array.\n */\n@kotlin.jvm.JvmName(\"averageOfLong\")\npublic fun Array.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n ++count\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the array.\n */\n@kotlin.jvm.JvmName(\"averageOfFloat\")\npublic fun Array.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n ++count\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the array.\n */\n@kotlin.jvm.JvmName(\"averageOfDouble\")\npublic fun Array.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n ++count\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the array.\n */\npublic fun ByteArray.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n ++count\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the array.\n */\npublic fun ShortArray.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n ++count\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the array.\n */\npublic fun IntArray.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n ++count\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the array.\n */\npublic fun LongArray.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n ++count\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the array.\n */\npublic fun FloatArray.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n ++count\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the array.\n */\npublic fun DoubleArray.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n ++count\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns the sum of all elements in the array.\n */\n@kotlin.jvm.JvmName(\"sumOfByte\")\npublic fun Array.sum(): Int {\n var sum: Int = 0\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the array.\n */\n@kotlin.jvm.JvmName(\"sumOfShort\")\npublic fun Array.sum(): Int {\n var sum: Int = 0\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the array.\n */\n@kotlin.jvm.JvmName(\"sumOfInt\")\npublic fun Array.sum(): Int {\n var sum: Int = 0\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the array.\n */\n@kotlin.jvm.JvmName(\"sumOfLong\")\npublic fun Array.sum(): Long {\n var sum: Long = 0L\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the array.\n */\n@kotlin.jvm.JvmName(\"sumOfFloat\")\npublic fun Array.sum(): Float {\n var sum: Float = 0.0f\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the array.\n */\n@kotlin.jvm.JvmName(\"sumOfDouble\")\npublic fun Array.sum(): Double {\n var sum: Double = 0.0\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the array.\n */\npublic fun ByteArray.sum(): Int {\n var sum: Int = 0\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the array.\n */\npublic fun ShortArray.sum(): Int {\n var sum: Int = 0\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the array.\n */\npublic fun IntArray.sum(): Int {\n var sum: Int = 0\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the array.\n */\npublic fun LongArray.sum(): Long {\n var sum: Long = 0L\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the array.\n */\npublic fun FloatArray.sum(): Float {\n var sum: Float = 0.0f\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the array.\n */\npublic fun DoubleArray.sum(): Double {\n var sum: Double = 0.0\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n","/*\n * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"RangesKt\")\n\npackage kotlin.ranges\n\n//\n// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt\n// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib\n//\n\nimport kotlin.random.*\n\n/**\n * Returns the first element.\n * \n * @throws NoSuchElementException if the progression is empty.\n */\n@SinceKotlin(\"1.7\")\npublic fun IntProgression.first(): Int {\n if (isEmpty())\n throw NoSuchElementException(\"Progression $this is empty.\")\n return this.first\n}\n\n/**\n * Returns the first element.\n * \n * @throws NoSuchElementException if the progression is empty.\n */\n@SinceKotlin(\"1.7\")\npublic fun LongProgression.first(): Long {\n if (isEmpty())\n throw NoSuchElementException(\"Progression $this is empty.\")\n return this.first\n}\n\n/**\n * Returns the first element.\n * \n * @throws NoSuchElementException if the progression is empty.\n */\n@SinceKotlin(\"1.7\")\npublic fun CharProgression.first(): Char {\n if (isEmpty())\n throw NoSuchElementException(\"Progression $this is empty.\")\n return this.first\n}\n\n/**\n * Returns the first element, or `null` if the progression is empty.\n */\n@SinceKotlin(\"1.7\")\npublic fun IntProgression.firstOrNull(): Int? {\n return if (isEmpty()) null else this.first\n}\n\n/**\n * Returns the first element, or `null` if the progression is empty.\n */\n@SinceKotlin(\"1.7\")\npublic fun LongProgression.firstOrNull(): Long? {\n return if (isEmpty()) null else this.first\n}\n\n/**\n * Returns the first element, or `null` if the progression is empty.\n */\n@SinceKotlin(\"1.7\")\npublic fun CharProgression.firstOrNull(): Char? {\n return if (isEmpty()) null else this.first\n}\n\n/**\n * Returns the last element.\n * \n * @throws NoSuchElementException if the progression is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\n@SinceKotlin(\"1.7\")\npublic fun IntProgression.last(): Int {\n if (isEmpty())\n throw NoSuchElementException(\"Progression $this is empty.\")\n return this.last\n}\n\n/**\n * Returns the last element.\n * \n * @throws NoSuchElementException if the progression is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\n@SinceKotlin(\"1.7\")\npublic fun LongProgression.last(): Long {\n if (isEmpty())\n throw NoSuchElementException(\"Progression $this is empty.\")\n return this.last\n}\n\n/**\n * Returns the last element.\n * \n * @throws NoSuchElementException if the progression is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\n@SinceKotlin(\"1.7\")\npublic fun CharProgression.last(): Char {\n if (isEmpty())\n throw NoSuchElementException(\"Progression $this is empty.\")\n return this.last\n}\n\n/**\n * Returns the last element, or `null` if the progression is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\n@SinceKotlin(\"1.7\")\npublic fun IntProgression.lastOrNull(): Int? {\n return if (isEmpty()) null else this.last\n}\n\n/**\n * Returns the last element, or `null` if the progression is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\n@SinceKotlin(\"1.7\")\npublic fun LongProgression.lastOrNull(): Long? {\n return if (isEmpty()) null else this.last\n}\n\n/**\n * Returns the last element, or `null` if the progression is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\n@SinceKotlin(\"1.7\")\npublic fun CharProgression.lastOrNull(): Char? {\n return if (isEmpty()) null else this.last\n}\n\n/**\n * Returns a random element from this range.\n * \n * @throws IllegalArgumentException if this range is empty.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun IntRange.random(): Int {\n return random(Random)\n}\n\n/**\n * Returns a random element from this range.\n * \n * @throws IllegalArgumentException if this range is empty.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun LongRange.random(): Long {\n return random(Random)\n}\n\n/**\n * Returns a random element from this range.\n * \n * @throws IllegalArgumentException if this range is empty.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun CharRange.random(): Char {\n return random(Random)\n}\n\n/**\n * Returns a random element from this range using the specified source of randomness.\n * \n * @throws IllegalArgumentException if this range is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun IntRange.random(random: Random): Int {\n try {\n return random.nextInt(this)\n } catch(e: IllegalArgumentException) {\n throw NoSuchElementException(e.message)\n }\n}\n\n/**\n * Returns a random element from this range using the specified source of randomness.\n * \n * @throws IllegalArgumentException if this range is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun LongRange.random(random: Random): Long {\n try {\n return random.nextLong(this)\n } catch(e: IllegalArgumentException) {\n throw NoSuchElementException(e.message)\n }\n}\n\n/**\n * Returns a random element from this range using the specified source of randomness.\n * \n * @throws IllegalArgumentException if this range is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun CharRange.random(random: Random): Char {\n try {\n return random.nextInt(first.code, last.code + 1).toChar()\n } catch(e: IllegalArgumentException) {\n throw NoSuchElementException(e.message)\n }\n}\n\n/**\n * Returns a random element from this range, or `null` if this range is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun IntRange.randomOrNull(): Int? {\n return randomOrNull(Random)\n}\n\n/**\n * Returns a random element from this range, or `null` if this range is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun LongRange.randomOrNull(): Long? {\n return randomOrNull(Random)\n}\n\n/**\n * Returns a random element from this range, or `null` if this range is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun CharRange.randomOrNull(): Char? {\n return randomOrNull(Random)\n}\n\n/**\n * Returns a random element from this range using the specified source of randomness, or `null` if this range is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun IntRange.randomOrNull(random: Random): Int? {\n if (isEmpty())\n return null\n return random.nextInt(this)\n}\n\n/**\n * Returns a random element from this range using the specified source of randomness, or `null` if this range is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun LongRange.randomOrNull(random: Random): Long? {\n if (isEmpty())\n return null\n return random.nextLong(this)\n}\n\n/**\n * Returns a random element from this range using the specified source of randomness, or `null` if this range is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun CharRange.randomOrNull(random: Random): Char? {\n if (isEmpty())\n return null\n return random.nextInt(first.code, last.code + 1).toChar()\n}\n\n/**\n * Returns `true` if this range contains the specified [element].\n * \n * Always returns `false` if the [element] is `null`.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline operator fun IntRange.contains(element: Int?): Boolean {\n return element != null && contains(element)\n}\n\n/**\n * Returns `true` if this range contains the specified [element].\n * \n * Always returns `false` if the [element] is `null`.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline operator fun LongRange.contains(element: Long?): Boolean {\n return element != null && contains(element)\n}\n\n/**\n * Returns `true` if this range contains the specified [element].\n * \n * Always returns `false` if the [element] is `null`.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline operator fun CharRange.contains(element: Char?): Boolean {\n return element != null && contains(element)\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"intRangeContains\")\npublic operator fun ClosedRange.contains(value: Byte): Boolean {\n return contains(value.toInt())\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"longRangeContains\")\npublic operator fun ClosedRange.contains(value: Byte): Boolean {\n return contains(value.toLong())\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"shortRangeContains\")\npublic operator fun ClosedRange.contains(value: Byte): Boolean {\n return contains(value.toShort())\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@Deprecated(\"This `contains` operation mixing integer and floating point arguments has ambiguous semantics and is going to be removed.\")\n@DeprecatedSinceKotlin(warningSince = \"1.3\", errorSince = \"1.4\", hiddenSince = \"1.5\")\n@kotlin.jvm.JvmName(\"doubleRangeContains\")\npublic operator fun ClosedRange.contains(value: Byte): Boolean {\n return contains(value.toDouble())\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@Deprecated(\"This `contains` operation mixing integer and floating point arguments has ambiguous semantics and is going to be removed.\")\n@DeprecatedSinceKotlin(warningSince = \"1.3\", errorSince = \"1.4\", hiddenSince = \"1.5\")\n@kotlin.jvm.JvmName(\"floatRangeContains\")\npublic operator fun ClosedRange.contains(value: Byte): Boolean {\n return contains(value.toFloat())\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"intRangeContains\")\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\npublic operator fun OpenEndRange.contains(value: Byte): Boolean {\n return contains(value.toInt())\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"longRangeContains\")\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\npublic operator fun OpenEndRange.contains(value: Byte): Boolean {\n return contains(value.toLong())\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"shortRangeContains\")\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\npublic operator fun OpenEndRange.contains(value: Byte): Boolean {\n return contains(value.toShort())\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun IntRange.contains(value: Byte): Boolean {\n return (this as ClosedRange).contains(value)\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun LongRange.contains(value: Byte): Boolean {\n return (this as ClosedRange).contains(value)\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@Deprecated(\"This `contains` operation mixing integer and floating point arguments has ambiguous semantics and is going to be removed.\")\n@DeprecatedSinceKotlin(warningSince = \"1.3\", errorSince = \"1.4\", hiddenSince = \"1.5\")\n@kotlin.jvm.JvmName(\"intRangeContains\")\npublic operator fun ClosedRange.contains(value: Double): Boolean {\n return value.toIntExactOrNull().let { if (it != null) contains(it) else false }\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@Deprecated(\"This `contains` operation mixing integer and floating point arguments has ambiguous semantics and is going to be removed.\")\n@DeprecatedSinceKotlin(warningSince = \"1.3\", errorSince = \"1.4\", hiddenSince = \"1.5\")\n@kotlin.jvm.JvmName(\"longRangeContains\")\npublic operator fun ClosedRange.contains(value: Double): Boolean {\n return value.toLongExactOrNull().let { if (it != null) contains(it) else false }\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@Deprecated(\"This `contains` operation mixing integer and floating point arguments has ambiguous semantics and is going to be removed.\")\n@DeprecatedSinceKotlin(warningSince = \"1.3\", errorSince = \"1.4\", hiddenSince = \"1.5\")\n@kotlin.jvm.JvmName(\"byteRangeContains\")\npublic operator fun ClosedRange.contains(value: Double): Boolean {\n return value.toByteExactOrNull().let { if (it != null) contains(it) else false }\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@Deprecated(\"This `contains` operation mixing integer and floating point arguments has ambiguous semantics and is going to be removed.\")\n@DeprecatedSinceKotlin(warningSince = \"1.3\", errorSince = \"1.4\", hiddenSince = \"1.5\")\n@kotlin.jvm.JvmName(\"shortRangeContains\")\npublic operator fun ClosedRange.contains(value: Double): Boolean {\n return value.toShortExactOrNull().let { if (it != null) contains(it) else false }\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"floatRangeContains\")\npublic operator fun ClosedRange.contains(value: Double): Boolean {\n return contains(value.toFloat())\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@Deprecated(\"This `contains` operation mixing integer and floating point arguments has ambiguous semantics and is going to be removed.\")\n@DeprecatedSinceKotlin(warningSince = \"1.3\", errorSince = \"1.4\", hiddenSince = \"1.5\")\n@kotlin.jvm.JvmName(\"intRangeContains\")\npublic operator fun ClosedRange.contains(value: Float): Boolean {\n return value.toIntExactOrNull().let { if (it != null) contains(it) else false }\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@Deprecated(\"This `contains` operation mixing integer and floating point arguments has ambiguous semantics and is going to be removed.\")\n@DeprecatedSinceKotlin(warningSince = \"1.3\", errorSince = \"1.4\", hiddenSince = \"1.5\")\n@kotlin.jvm.JvmName(\"longRangeContains\")\npublic operator fun ClosedRange.contains(value: Float): Boolean {\n return value.toLongExactOrNull().let { if (it != null) contains(it) else false }\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@Deprecated(\"This `contains` operation mixing integer and floating point arguments has ambiguous semantics and is going to be removed.\")\n@DeprecatedSinceKotlin(warningSince = \"1.3\", errorSince = \"1.4\", hiddenSince = \"1.5\")\n@kotlin.jvm.JvmName(\"byteRangeContains\")\npublic operator fun ClosedRange.contains(value: Float): Boolean {\n return value.toByteExactOrNull().let { if (it != null) contains(it) else false }\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@Deprecated(\"This `contains` operation mixing integer and floating point arguments has ambiguous semantics and is going to be removed.\")\n@DeprecatedSinceKotlin(warningSince = \"1.3\", errorSince = \"1.4\", hiddenSince = \"1.5\")\n@kotlin.jvm.JvmName(\"shortRangeContains\")\npublic operator fun ClosedRange.contains(value: Float): Boolean {\n return value.toShortExactOrNull().let { if (it != null) contains(it) else false }\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"doubleRangeContains\")\npublic operator fun ClosedRange.contains(value: Float): Boolean {\n return contains(value.toDouble())\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"doubleRangeContains\")\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\npublic operator fun OpenEndRange.contains(value: Float): Boolean {\n return contains(value.toDouble())\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"longRangeContains\")\npublic operator fun ClosedRange.contains(value: Int): Boolean {\n return contains(value.toLong())\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"byteRangeContains\")\npublic operator fun ClosedRange.contains(value: Int): Boolean {\n return value.toByteExactOrNull().let { if (it != null) contains(it) else false }\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"shortRangeContains\")\npublic operator fun ClosedRange.contains(value: Int): Boolean {\n return value.toShortExactOrNull().let { if (it != null) contains(it) else false }\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@Deprecated(\"This `contains` operation mixing integer and floating point arguments has ambiguous semantics and is going to be removed.\")\n@DeprecatedSinceKotlin(warningSince = \"1.3\", errorSince = \"1.4\", hiddenSince = \"1.5\")\n@kotlin.jvm.JvmName(\"doubleRangeContains\")\npublic operator fun ClosedRange.contains(value: Int): Boolean {\n return contains(value.toDouble())\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@Deprecated(\"This `contains` operation mixing integer and floating point arguments has ambiguous semantics and is going to be removed.\")\n@DeprecatedSinceKotlin(warningSince = \"1.3\", errorSince = \"1.4\", hiddenSince = \"1.5\")\n@kotlin.jvm.JvmName(\"floatRangeContains\")\npublic operator fun ClosedRange.contains(value: Int): Boolean {\n return contains(value.toFloat())\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"longRangeContains\")\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\npublic operator fun OpenEndRange.contains(value: Int): Boolean {\n return contains(value.toLong())\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"byteRangeContains\")\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\npublic operator fun OpenEndRange.contains(value: Int): Boolean {\n return value.toByteExactOrNull().let { if (it != null) contains(it) else false }\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"shortRangeContains\")\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\npublic operator fun OpenEndRange.contains(value: Int): Boolean {\n return value.toShortExactOrNull().let { if (it != null) contains(it) else false }\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun LongRange.contains(value: Int): Boolean {\n return (this as ClosedRange).contains(value)\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"intRangeContains\")\npublic operator fun ClosedRange.contains(value: Long): Boolean {\n return value.toIntExactOrNull().let { if (it != null) contains(it) else false }\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"byteRangeContains\")\npublic operator fun ClosedRange.contains(value: Long): Boolean {\n return value.toByteExactOrNull().let { if (it != null) contains(it) else false }\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"shortRangeContains\")\npublic operator fun ClosedRange.contains(value: Long): Boolean {\n return value.toShortExactOrNull().let { if (it != null) contains(it) else false }\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@Deprecated(\"This `contains` operation mixing integer and floating point arguments has ambiguous semantics and is going to be removed.\")\n@DeprecatedSinceKotlin(warningSince = \"1.3\", errorSince = \"1.4\", hiddenSince = \"1.5\")\n@kotlin.jvm.JvmName(\"doubleRangeContains\")\npublic operator fun ClosedRange.contains(value: Long): Boolean {\n return contains(value.toDouble())\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@Deprecated(\"This `contains` operation mixing integer and floating point arguments has ambiguous semantics and is going to be removed.\")\n@DeprecatedSinceKotlin(warningSince = \"1.3\", errorSince = \"1.4\", hiddenSince = \"1.5\")\n@kotlin.jvm.JvmName(\"floatRangeContains\")\npublic operator fun ClosedRange.contains(value: Long): Boolean {\n return contains(value.toFloat())\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"intRangeContains\")\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\npublic operator fun OpenEndRange.contains(value: Long): Boolean {\n return value.toIntExactOrNull().let { if (it != null) contains(it) else false }\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"byteRangeContains\")\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\npublic operator fun OpenEndRange.contains(value: Long): Boolean {\n return value.toByteExactOrNull().let { if (it != null) contains(it) else false }\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"shortRangeContains\")\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\npublic operator fun OpenEndRange.contains(value: Long): Boolean {\n return value.toShortExactOrNull().let { if (it != null) contains(it) else false }\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun IntRange.contains(value: Long): Boolean {\n return (this as ClosedRange).contains(value)\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"intRangeContains\")\npublic operator fun ClosedRange.contains(value: Short): Boolean {\n return contains(value.toInt())\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"longRangeContains\")\npublic operator fun ClosedRange.contains(value: Short): Boolean {\n return contains(value.toLong())\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"byteRangeContains\")\npublic operator fun ClosedRange.contains(value: Short): Boolean {\n return value.toByteExactOrNull().let { if (it != null) contains(it) else false }\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@Deprecated(\"This `contains` operation mixing integer and floating point arguments has ambiguous semantics and is going to be removed.\")\n@DeprecatedSinceKotlin(warningSince = \"1.3\", errorSince = \"1.4\", hiddenSince = \"1.5\")\n@kotlin.jvm.JvmName(\"doubleRangeContains\")\npublic operator fun ClosedRange.contains(value: Short): Boolean {\n return contains(value.toDouble())\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@Deprecated(\"This `contains` operation mixing integer and floating point arguments has ambiguous semantics and is going to be removed.\")\n@DeprecatedSinceKotlin(warningSince = \"1.3\", errorSince = \"1.4\", hiddenSince = \"1.5\")\n@kotlin.jvm.JvmName(\"floatRangeContains\")\npublic operator fun ClosedRange.contains(value: Short): Boolean {\n return contains(value.toFloat())\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"intRangeContains\")\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\npublic operator fun OpenEndRange.contains(value: Short): Boolean {\n return contains(value.toInt())\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"longRangeContains\")\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\npublic operator fun OpenEndRange.contains(value: Short): Boolean {\n return contains(value.toLong())\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.jvm.JvmName(\"byteRangeContains\")\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\npublic operator fun OpenEndRange.contains(value: Short): Boolean {\n return value.toByteExactOrNull().let { if (it != null) contains(it) else false }\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun IntRange.contains(value: Short): Boolean {\n return (this as ClosedRange).contains(value)\n}\n\n/**\n * Checks if the specified [value] belongs to this range.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun LongRange.contains(value: Short): Boolean {\n return (this as ClosedRange).contains(value)\n}\n\n/**\n * Returns a progression from this value down to the specified [to] value with the step -1.\n * \n * The [to] value should be less than or equal to `this` value.\n * If the [to] value is greater than `this` value the returned progression is empty.\n */\npublic infix fun Int.downTo(to: Byte): IntProgression {\n return IntProgression.fromClosedRange(this, to.toInt(), -1)\n}\n\n/**\n * Returns a progression from this value down to the specified [to] value with the step -1.\n * \n * The [to] value should be less than or equal to `this` value.\n * If the [to] value is greater than `this` value the returned progression is empty.\n */\npublic infix fun Long.downTo(to: Byte): LongProgression {\n return LongProgression.fromClosedRange(this, to.toLong(), -1L)\n}\n\n/**\n * Returns a progression from this value down to the specified [to] value with the step -1.\n * \n * The [to] value should be less than or equal to `this` value.\n * If the [to] value is greater than `this` value the returned progression is empty.\n */\npublic infix fun Byte.downTo(to: Byte): IntProgression {\n return IntProgression.fromClosedRange(this.toInt(), to.toInt(), -1)\n}\n\n/**\n * Returns a progression from this value down to the specified [to] value with the step -1.\n * \n * The [to] value should be less than or equal to `this` value.\n * If the [to] value is greater than `this` value the returned progression is empty.\n */\npublic infix fun Short.downTo(to: Byte): IntProgression {\n return IntProgression.fromClosedRange(this.toInt(), to.toInt(), -1)\n}\n\n/**\n * Returns a progression from this value down to the specified [to] value with the step -1.\n * \n * The [to] value should be less than or equal to `this` value.\n * If the [to] value is greater than `this` value the returned progression is empty.\n */\npublic infix fun Char.downTo(to: Char): CharProgression {\n return CharProgression.fromClosedRange(this, to, -1)\n}\n\n/**\n * Returns a progression from this value down to the specified [to] value with the step -1.\n * \n * The [to] value should be less than or equal to `this` value.\n * If the [to] value is greater than `this` value the returned progression is empty.\n */\npublic infix fun Int.downTo(to: Int): IntProgression {\n return IntProgression.fromClosedRange(this, to, -1)\n}\n\n/**\n * Returns a progression from this value down to the specified [to] value with the step -1.\n * \n * The [to] value should be less than or equal to `this` value.\n * If the [to] value is greater than `this` value the returned progression is empty.\n */\npublic infix fun Long.downTo(to: Int): LongProgression {\n return LongProgression.fromClosedRange(this, to.toLong(), -1L)\n}\n\n/**\n * Returns a progression from this value down to the specified [to] value with the step -1.\n * \n * The [to] value should be less than or equal to `this` value.\n * If the [to] value is greater than `this` value the returned progression is empty.\n */\npublic infix fun Byte.downTo(to: Int): IntProgression {\n return IntProgression.fromClosedRange(this.toInt(), to, -1)\n}\n\n/**\n * Returns a progression from this value down to the specified [to] value with the step -1.\n * \n * The [to] value should be less than or equal to `this` value.\n * If the [to] value is greater than `this` value the returned progression is empty.\n */\npublic infix fun Short.downTo(to: Int): IntProgression {\n return IntProgression.fromClosedRange(this.toInt(), to, -1)\n}\n\n/**\n * Returns a progression from this value down to the specified [to] value with the step -1.\n * \n * The [to] value should be less than or equal to `this` value.\n * If the [to] value is greater than `this` value the returned progression is empty.\n */\npublic infix fun Int.downTo(to: Long): LongProgression {\n return LongProgression.fromClosedRange(this.toLong(), to, -1L)\n}\n\n/**\n * Returns a progression from this value down to the specified [to] value with the step -1.\n * \n * The [to] value should be less than or equal to `this` value.\n * If the [to] value is greater than `this` value the returned progression is empty.\n */\npublic infix fun Long.downTo(to: Long): LongProgression {\n return LongProgression.fromClosedRange(this, to, -1L)\n}\n\n/**\n * Returns a progression from this value down to the specified [to] value with the step -1.\n * \n * The [to] value should be less than or equal to `this` value.\n * If the [to] value is greater than `this` value the returned progression is empty.\n */\npublic infix fun Byte.downTo(to: Long): LongProgression {\n return LongProgression.fromClosedRange(this.toLong(), to, -1L)\n}\n\n/**\n * Returns a progression from this value down to the specified [to] value with the step -1.\n * \n * The [to] value should be less than or equal to `this` value.\n * If the [to] value is greater than `this` value the returned progression is empty.\n */\npublic infix fun Short.downTo(to: Long): LongProgression {\n return LongProgression.fromClosedRange(this.toLong(), to, -1L)\n}\n\n/**\n * Returns a progression from this value down to the specified [to] value with the step -1.\n * \n * The [to] value should be less than or equal to `this` value.\n * If the [to] value is greater than `this` value the returned progression is empty.\n */\npublic infix fun Int.downTo(to: Short): IntProgression {\n return IntProgression.fromClosedRange(this, to.toInt(), -1)\n}\n\n/**\n * Returns a progression from this value down to the specified [to] value with the step -1.\n * \n * The [to] value should be less than or equal to `this` value.\n * If the [to] value is greater than `this` value the returned progression is empty.\n */\npublic infix fun Long.downTo(to: Short): LongProgression {\n return LongProgression.fromClosedRange(this, to.toLong(), -1L)\n}\n\n/**\n * Returns a progression from this value down to the specified [to] value with the step -1.\n * \n * The [to] value should be less than or equal to `this` value.\n * If the [to] value is greater than `this` value the returned progression is empty.\n */\npublic infix fun Byte.downTo(to: Short): IntProgression {\n return IntProgression.fromClosedRange(this.toInt(), to.toInt(), -1)\n}\n\n/**\n * Returns a progression from this value down to the specified [to] value with the step -1.\n * \n * The [to] value should be less than or equal to `this` value.\n * If the [to] value is greater than `this` value the returned progression is empty.\n */\npublic infix fun Short.downTo(to: Short): IntProgression {\n return IntProgression.fromClosedRange(this.toInt(), to.toInt(), -1)\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\n@kotlin.internal.InlineOnly\npublic inline operator fun Int.rangeUntil(to: Byte): IntRange {\n return until(to)\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\n@kotlin.internal.InlineOnly\npublic inline operator fun Long.rangeUntil(to: Byte): LongRange {\n return until(to)\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\n@kotlin.internal.InlineOnly\npublic inline operator fun Byte.rangeUntil(to: Byte): IntRange {\n return until(to)\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\n@kotlin.internal.InlineOnly\npublic inline operator fun Short.rangeUntil(to: Byte): IntRange {\n return until(to)\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\n@kotlin.internal.InlineOnly\npublic inline operator fun Char.rangeUntil(to: Char): CharRange {\n return until(to)\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\n@kotlin.internal.InlineOnly\npublic inline operator fun Int.rangeUntil(to: Int): IntRange {\n return until(to)\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\n@kotlin.internal.InlineOnly\npublic inline operator fun Long.rangeUntil(to: Int): LongRange {\n return until(to)\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\n@kotlin.internal.InlineOnly\npublic inline operator fun Byte.rangeUntil(to: Int): IntRange {\n return until(to)\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\n@kotlin.internal.InlineOnly\npublic inline operator fun Short.rangeUntil(to: Int): IntRange {\n return until(to)\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\n@kotlin.internal.InlineOnly\npublic inline operator fun Int.rangeUntil(to: Long): LongRange {\n return until(to)\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\n@kotlin.internal.InlineOnly\npublic inline operator fun Long.rangeUntil(to: Long): LongRange {\n return until(to)\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\n@kotlin.internal.InlineOnly\npublic inline operator fun Byte.rangeUntil(to: Long): LongRange {\n return until(to)\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\n@kotlin.internal.InlineOnly\npublic inline operator fun Short.rangeUntil(to: Long): LongRange {\n return until(to)\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\n@kotlin.internal.InlineOnly\npublic inline operator fun Int.rangeUntil(to: Short): IntRange {\n return until(to)\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\n@kotlin.internal.InlineOnly\npublic inline operator fun Long.rangeUntil(to: Short): LongRange {\n return until(to)\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\n@kotlin.internal.InlineOnly\npublic inline operator fun Byte.rangeUntil(to: Short): IntRange {\n return until(to)\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\n@kotlin.internal.InlineOnly\npublic inline operator fun Short.rangeUntil(to: Short): IntRange {\n return until(to)\n}\n\n/**\n * Returns a progression that goes over the same range in the opposite direction with the same step.\n */\npublic fun IntProgression.reversed(): IntProgression {\n return IntProgression.fromClosedRange(last, first, -step)\n}\n\n/**\n * Returns a progression that goes over the same range in the opposite direction with the same step.\n */\npublic fun LongProgression.reversed(): LongProgression {\n return LongProgression.fromClosedRange(last, first, -step)\n}\n\n/**\n * Returns a progression that goes over the same range in the opposite direction with the same step.\n */\npublic fun CharProgression.reversed(): CharProgression {\n return CharProgression.fromClosedRange(last, first, -step)\n}\n\n/**\n * Returns a progression that goes over the same range with the given step.\n */\npublic infix fun IntProgression.step(step: Int): IntProgression {\n checkStepIsPositive(step > 0, step)\n return IntProgression.fromClosedRange(first, last, if (this.step > 0) step else -step)\n}\n\n/**\n * Returns a progression that goes over the same range with the given step.\n */\npublic infix fun LongProgression.step(step: Long): LongProgression {\n checkStepIsPositive(step > 0, step)\n return LongProgression.fromClosedRange(first, last, if (this.step > 0) step else -step)\n}\n\n/**\n * Returns a progression that goes over the same range with the given step.\n */\npublic infix fun CharProgression.step(step: Int): CharProgression {\n checkStepIsPositive(step > 0, step)\n return CharProgression.fromClosedRange(first, last, if (this.step > 0) step else -step)\n}\n\ninternal fun Int.toByteExactOrNull(): Byte? {\n return if (this in Byte.MIN_VALUE.toInt()..Byte.MAX_VALUE.toInt()) this.toByte() else null\n}\n\ninternal fun Long.toByteExactOrNull(): Byte? {\n return if (this in Byte.MIN_VALUE.toLong()..Byte.MAX_VALUE.toLong()) this.toByte() else null\n}\n\ninternal fun Short.toByteExactOrNull(): Byte? {\n return if (this in Byte.MIN_VALUE.toShort()..Byte.MAX_VALUE.toShort()) this.toByte() else null\n}\n\ninternal fun Double.toByteExactOrNull(): Byte? {\n return if (this in Byte.MIN_VALUE.toDouble()..Byte.MAX_VALUE.toDouble()) this.toInt().toByte() else null\n}\n\ninternal fun Float.toByteExactOrNull(): Byte? {\n return if (this in Byte.MIN_VALUE.toFloat()..Byte.MAX_VALUE.toFloat()) this.toInt().toByte() else null\n}\n\ninternal fun Long.toIntExactOrNull(): Int? {\n return if (this in Int.MIN_VALUE.toLong()..Int.MAX_VALUE.toLong()) this.toInt() else null\n}\n\ninternal fun Double.toIntExactOrNull(): Int? {\n return if (this in Int.MIN_VALUE.toDouble()..Int.MAX_VALUE.toDouble()) this.toInt() else null\n}\n\ninternal fun Float.toIntExactOrNull(): Int? {\n return if (this in Int.MIN_VALUE.toFloat()..Int.MAX_VALUE.toFloat()) this.toInt() else null\n}\n\ninternal fun Double.toLongExactOrNull(): Long? {\n return if (this in Long.MIN_VALUE.toDouble()..Long.MAX_VALUE.toDouble()) this.toLong() else null\n}\n\ninternal fun Float.toLongExactOrNull(): Long? {\n return if (this in Long.MIN_VALUE.toFloat()..Long.MAX_VALUE.toFloat()) this.toLong() else null\n}\n\ninternal fun Int.toShortExactOrNull(): Short? {\n return if (this in Short.MIN_VALUE.toInt()..Short.MAX_VALUE.toInt()) this.toShort() else null\n}\n\ninternal fun Long.toShortExactOrNull(): Short? {\n return if (this in Short.MIN_VALUE.toLong()..Short.MAX_VALUE.toLong()) this.toShort() else null\n}\n\ninternal fun Double.toShortExactOrNull(): Short? {\n return if (this in Short.MIN_VALUE.toDouble()..Short.MAX_VALUE.toDouble()) this.toInt().toShort() else null\n}\n\ninternal fun Float.toShortExactOrNull(): Short? {\n return if (this in Short.MIN_VALUE.toFloat()..Short.MAX_VALUE.toFloat()) this.toInt().toShort() else null\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\npublic infix fun Int.until(to: Byte): IntRange {\n return this .. (to.toInt() - 1).toInt()\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\npublic infix fun Long.until(to: Byte): LongRange {\n return this .. (to.toLong() - 1).toLong()\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\npublic infix fun Byte.until(to: Byte): IntRange {\n return this.toInt() .. (to.toInt() - 1).toInt()\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\npublic infix fun Short.until(to: Byte): IntRange {\n return this.toInt() .. (to.toInt() - 1).toInt()\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\npublic infix fun Char.until(to: Char): CharRange {\n if (to <= '\\u0000') return CharRange.EMPTY\n return this .. (to - 1).toChar()\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\npublic infix fun Int.until(to: Int): IntRange {\n if (to <= Int.MIN_VALUE) return IntRange.EMPTY\n return this .. (to - 1).toInt()\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\npublic infix fun Long.until(to: Int): LongRange {\n return this .. (to.toLong() - 1).toLong()\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\npublic infix fun Byte.until(to: Int): IntRange {\n if (to <= Int.MIN_VALUE) return IntRange.EMPTY\n return this.toInt() .. (to - 1).toInt()\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\npublic infix fun Short.until(to: Int): IntRange {\n if (to <= Int.MIN_VALUE) return IntRange.EMPTY\n return this.toInt() .. (to - 1).toInt()\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\npublic infix fun Int.until(to: Long): LongRange {\n if (to <= Long.MIN_VALUE) return LongRange.EMPTY\n return this.toLong() .. (to - 1).toLong()\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\npublic infix fun Long.until(to: Long): LongRange {\n if (to <= Long.MIN_VALUE) return LongRange.EMPTY\n return this .. (to - 1).toLong()\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\npublic infix fun Byte.until(to: Long): LongRange {\n if (to <= Long.MIN_VALUE) return LongRange.EMPTY\n return this.toLong() .. (to - 1).toLong()\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\npublic infix fun Short.until(to: Long): LongRange {\n if (to <= Long.MIN_VALUE) return LongRange.EMPTY\n return this.toLong() .. (to - 1).toLong()\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\npublic infix fun Int.until(to: Short): IntRange {\n return this .. (to.toInt() - 1).toInt()\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\npublic infix fun Long.until(to: Short): LongRange {\n return this .. (to.toLong() - 1).toLong()\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\npublic infix fun Byte.until(to: Short): IntRange {\n return this.toInt() .. (to.toInt() - 1).toInt()\n}\n\n/**\n * Returns a range from this value up to but excluding the specified [to] value.\n * \n * If the [to] value is less than or equal to `this` value, then the returned range is empty.\n */\npublic infix fun Short.until(to: Short): IntRange {\n return this.toInt() .. (to.toInt() - 1).toInt()\n}\n\n/**\n * Ensures that this value is not less than the specified [minimumValue].\n * \n * @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise.\n * \n * @sample samples.comparisons.ComparableOps.coerceAtLeastComparable\n */\npublic fun > T.coerceAtLeast(minimumValue: T): T {\n return if (this < minimumValue) minimumValue else this\n}\n\n/**\n * Ensures that this value is not less than the specified [minimumValue].\n * \n * @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise.\n * \n * @sample samples.comparisons.ComparableOps.coerceAtLeast\n */\npublic fun Byte.coerceAtLeast(minimumValue: Byte): Byte {\n return if (this < minimumValue) minimumValue else this\n}\n\n/**\n * Ensures that this value is not less than the specified [minimumValue].\n * \n * @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise.\n * \n * @sample samples.comparisons.ComparableOps.coerceAtLeast\n */\npublic fun Short.coerceAtLeast(minimumValue: Short): Short {\n return if (this < minimumValue) minimumValue else this\n}\n\n/**\n * Ensures that this value is not less than the specified [minimumValue].\n * \n * @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise.\n * \n * @sample samples.comparisons.ComparableOps.coerceAtLeast\n */\npublic fun Int.coerceAtLeast(minimumValue: Int): Int {\n return if (this < minimumValue) minimumValue else this\n}\n\n/**\n * Ensures that this value is not less than the specified [minimumValue].\n * \n * @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise.\n * \n * @sample samples.comparisons.ComparableOps.coerceAtLeast\n */\npublic fun Long.coerceAtLeast(minimumValue: Long): Long {\n return if (this < minimumValue) minimumValue else this\n}\n\n/**\n * Ensures that this value is not less than the specified [minimumValue].\n * \n * @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise.\n * \n * @sample samples.comparisons.ComparableOps.coerceAtLeast\n */\npublic fun Float.coerceAtLeast(minimumValue: Float): Float {\n return if (this < minimumValue) minimumValue else this\n}\n\n/**\n * Ensures that this value is not less than the specified [minimumValue].\n * \n * @return this value if it's greater than or equal to the [minimumValue] or the [minimumValue] otherwise.\n * \n * @sample samples.comparisons.ComparableOps.coerceAtLeast\n */\npublic fun Double.coerceAtLeast(minimumValue: Double): Double {\n return if (this < minimumValue) minimumValue else this\n}\n\n/**\n * Ensures that this value is not greater than the specified [maximumValue].\n * \n * @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise.\n * \n * @sample samples.comparisons.ComparableOps.coerceAtMostComparable\n */\npublic fun > T.coerceAtMost(maximumValue: T): T {\n return if (this > maximumValue) maximumValue else this\n}\n\n/**\n * Ensures that this value is not greater than the specified [maximumValue].\n * \n * @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise.\n * \n * @sample samples.comparisons.ComparableOps.coerceAtMost\n */\npublic fun Byte.coerceAtMost(maximumValue: Byte): Byte {\n return if (this > maximumValue) maximumValue else this\n}\n\n/**\n * Ensures that this value is not greater than the specified [maximumValue].\n * \n * @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise.\n * \n * @sample samples.comparisons.ComparableOps.coerceAtMost\n */\npublic fun Short.coerceAtMost(maximumValue: Short): Short {\n return if (this > maximumValue) maximumValue else this\n}\n\n/**\n * Ensures that this value is not greater than the specified [maximumValue].\n * \n * @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise.\n * \n * @sample samples.comparisons.ComparableOps.coerceAtMost\n */\npublic fun Int.coerceAtMost(maximumValue: Int): Int {\n return if (this > maximumValue) maximumValue else this\n}\n\n/**\n * Ensures that this value is not greater than the specified [maximumValue].\n * \n * @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise.\n * \n * @sample samples.comparisons.ComparableOps.coerceAtMost\n */\npublic fun Long.coerceAtMost(maximumValue: Long): Long {\n return if (this > maximumValue) maximumValue else this\n}\n\n/**\n * Ensures that this value is not greater than the specified [maximumValue].\n * \n * @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise.\n * \n * @sample samples.comparisons.ComparableOps.coerceAtMost\n */\npublic fun Float.coerceAtMost(maximumValue: Float): Float {\n return if (this > maximumValue) maximumValue else this\n}\n\n/**\n * Ensures that this value is not greater than the specified [maximumValue].\n * \n * @return this value if it's less than or equal to the [maximumValue] or the [maximumValue] otherwise.\n * \n * @sample samples.comparisons.ComparableOps.coerceAtMost\n */\npublic fun Double.coerceAtMost(maximumValue: Double): Double {\n return if (this > maximumValue) maximumValue else this\n}\n\n/**\n * Ensures that this value lies in the specified range [minimumValue]..[maximumValue].\n * \n * @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue].\n * \n * @sample samples.comparisons.ComparableOps.coerceInComparable\n */\npublic fun > T.coerceIn(minimumValue: T?, maximumValue: T?): T {\n if (minimumValue !== null && maximumValue !== null) {\n if (minimumValue > maximumValue) throw IllegalArgumentException(\"Cannot coerce value to an empty range: maximum $maximumValue is less than minimum $minimumValue.\")\n if (this < minimumValue) return minimumValue\n if (this > maximumValue) return maximumValue\n }\n else {\n if (minimumValue !== null && this < minimumValue) return minimumValue\n if (maximumValue !== null && this > maximumValue) return maximumValue\n }\n return this\n}\n\n/**\n * Ensures that this value lies in the specified range [minimumValue]..[maximumValue].\n * \n * @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue].\n * \n * @sample samples.comparisons.ComparableOps.coerceIn\n */\npublic fun Byte.coerceIn(minimumValue: Byte, maximumValue: Byte): Byte {\n if (minimumValue > maximumValue) throw IllegalArgumentException(\"Cannot coerce value to an empty range: maximum $maximumValue is less than minimum $minimumValue.\")\n if (this < minimumValue) return minimumValue\n if (this > maximumValue) return maximumValue\n return this\n}\n\n/**\n * Ensures that this value lies in the specified range [minimumValue]..[maximumValue].\n * \n * @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue].\n * \n * @sample samples.comparisons.ComparableOps.coerceIn\n */\npublic fun Short.coerceIn(minimumValue: Short, maximumValue: Short): Short {\n if (minimumValue > maximumValue) throw IllegalArgumentException(\"Cannot coerce value to an empty range: maximum $maximumValue is less than minimum $minimumValue.\")\n if (this < minimumValue) return minimumValue\n if (this > maximumValue) return maximumValue\n return this\n}\n\n/**\n * Ensures that this value lies in the specified range [minimumValue]..[maximumValue].\n * \n * @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue].\n * \n * @sample samples.comparisons.ComparableOps.coerceIn\n */\npublic fun Int.coerceIn(minimumValue: Int, maximumValue: Int): Int {\n if (minimumValue > maximumValue) throw IllegalArgumentException(\"Cannot coerce value to an empty range: maximum $maximumValue is less than minimum $minimumValue.\")\n if (this < minimumValue) return minimumValue\n if (this > maximumValue) return maximumValue\n return this\n}\n\n/**\n * Ensures that this value lies in the specified range [minimumValue]..[maximumValue].\n * \n * @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue].\n * \n * @sample samples.comparisons.ComparableOps.coerceIn\n */\npublic fun Long.coerceIn(minimumValue: Long, maximumValue: Long): Long {\n if (minimumValue > maximumValue) throw IllegalArgumentException(\"Cannot coerce value to an empty range: maximum $maximumValue is less than minimum $minimumValue.\")\n if (this < minimumValue) return minimumValue\n if (this > maximumValue) return maximumValue\n return this\n}\n\n/**\n * Ensures that this value lies in the specified range [minimumValue]..[maximumValue].\n * \n * @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue].\n * \n * @sample samples.comparisons.ComparableOps.coerceIn\n */\npublic fun Float.coerceIn(minimumValue: Float, maximumValue: Float): Float {\n if (minimumValue > maximumValue) throw IllegalArgumentException(\"Cannot coerce value to an empty range: maximum $maximumValue is less than minimum $minimumValue.\")\n if (this < minimumValue) return minimumValue\n if (this > maximumValue) return maximumValue\n return this\n}\n\n/**\n * Ensures that this value lies in the specified range [minimumValue]..[maximumValue].\n * \n * @return this value if it's in the range, or [minimumValue] if this value is less than [minimumValue], or [maximumValue] if this value is greater than [maximumValue].\n * \n * @sample samples.comparisons.ComparableOps.coerceIn\n */\npublic fun Double.coerceIn(minimumValue: Double, maximumValue: Double): Double {\n if (minimumValue > maximumValue) throw IllegalArgumentException(\"Cannot coerce value to an empty range: maximum $maximumValue is less than minimum $minimumValue.\")\n if (this < minimumValue) return minimumValue\n if (this > maximumValue) return maximumValue\n return this\n}\n\n/**\n * Ensures that this value lies in the specified [range].\n * \n * @return this value if it's in the [range], or `range.start` if this value is less than `range.start`, or `range.endInclusive` if this value is greater than `range.endInclusive`.\n * \n * @sample samples.comparisons.ComparableOps.coerceInFloatingPointRange\n */\n@SinceKotlin(\"1.1\")\npublic fun > T.coerceIn(range: ClosedFloatingPointRange): T {\n if (range.isEmpty()) throw IllegalArgumentException(\"Cannot coerce value to an empty range: $range.\")\n return when {\n // this < start equiv to this <= start && !(this >= start)\n range.lessThanOrEquals(this, range.start) && !range.lessThanOrEquals(range.start, this) -> range.start\n // this > end equiv to this >= end && !(this <= end)\n range.lessThanOrEquals(range.endInclusive, this) && !range.lessThanOrEquals(this, range.endInclusive) -> range.endInclusive\n else -> this\n }\n}\n\n/**\n * Ensures that this value lies in the specified [range].\n * \n * @return this value if it's in the [range], or `range.start` if this value is less than `range.start`, or `range.endInclusive` if this value is greater than `range.endInclusive`.\n * \n * @sample samples.comparisons.ComparableOps.coerceInComparable\n */\npublic fun > T.coerceIn(range: ClosedRange): T {\n if (range is ClosedFloatingPointRange) {\n return this.coerceIn(range)\n }\n if (range.isEmpty()) throw IllegalArgumentException(\"Cannot coerce value to an empty range: $range.\")\n return when {\n this < range.start -> range.start\n this > range.endInclusive -> range.endInclusive\n else -> this\n }\n}\n\n/**\n * Ensures that this value lies in the specified [range].\n * \n * @return this value if it's in the [range], or `range.start` if this value is less than `range.start`, or `range.endInclusive` if this value is greater than `range.endInclusive`.\n * \n * @sample samples.comparisons.ComparableOps.coerceIn\n */\npublic fun Int.coerceIn(range: ClosedRange): Int {\n if (range is ClosedFloatingPointRange) {\n return this.coerceIn(range)\n }\n if (range.isEmpty()) throw IllegalArgumentException(\"Cannot coerce value to an empty range: $range.\")\n return when {\n this < range.start -> range.start\n this > range.endInclusive -> range.endInclusive\n else -> this\n }\n}\n\n/**\n * Ensures that this value lies in the specified [range].\n * \n * @return this value if it's in the [range], or `range.start` if this value is less than `range.start`, or `range.endInclusive` if this value is greater than `range.endInclusive`.\n * \n * @sample samples.comparisons.ComparableOps.coerceIn\n */\npublic fun Long.coerceIn(range: ClosedRange): Long {\n if (range is ClosedFloatingPointRange) {\n return this.coerceIn(range)\n }\n if (range.isEmpty()) throw IllegalArgumentException(\"Cannot coerce value to an empty range: $range.\")\n return when {\n this < range.start -> range.start\n this > range.endInclusive -> range.endInclusive\n else -> this\n }\n}\n\n","/*\n * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n// Auto-generated file. DO NOT EDIT!\n\npackage kotlin\n\nimport kotlin.experimental.*\nimport kotlin.jvm.*\n\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@JvmInline\npublic value class UByte @kotlin.internal.IntrinsicConstEvaluation @PublishedApi internal constructor(@PublishedApi internal val data: Byte) : Comparable {\n\n companion object {\n /**\n * A constant holding the minimum value an instance of UByte can have.\n */\n public const val MIN_VALUE: UByte = UByte(0)\n\n /**\n * A constant holding the maximum value an instance of UByte can have.\n */\n public const val MAX_VALUE: UByte = UByte(-1)\n\n /**\n * The number of bytes used to represent an instance of UByte in a binary form.\n */\n public const val SIZE_BYTES: Int = 1\n\n /**\n * The number of bits used to represent an instance of UByte in a binary form.\n */\n public const val SIZE_BITS: Int = 8\n }\n\n /**\n * Compares this value with the specified value for order.\n * Returns zero if this value is equal to the specified other value, a negative number if it's less than other,\n * or a positive number if it's greater than other.\n */\n @kotlin.internal.InlineOnly\n @Suppress(\"OVERRIDE_BY_INLINE\")\n public override inline operator fun compareTo(other: UByte): Int = this.toInt().compareTo(other.toInt())\n\n /**\n * Compares this value with the specified value for order.\n * Returns zero if this value is equal to the specified other value, a negative number if it's less than other,\n * or a positive number if it's greater than other.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun compareTo(other: UShort): Int = this.toInt().compareTo(other.toInt())\n\n /**\n * Compares this value with the specified value for order.\n * Returns zero if this value is equal to the specified other value, a negative number if it's less than other,\n * or a positive number if it's greater than other.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun compareTo(other: UInt): Int = this.toUInt().compareTo(other)\n\n /**\n * Compares this value with the specified value for order.\n * Returns zero if this value is equal to the specified other value, a negative number if it's less than other,\n * or a positive number if it's greater than other.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun compareTo(other: ULong): Int = this.toULong().compareTo(other)\n\n /** Adds the other value to this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun plus(other: UByte): UInt = this.toUInt().plus(other.toUInt())\n /** Adds the other value to this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun plus(other: UShort): UInt = this.toUInt().plus(other.toUInt())\n /** Adds the other value to this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun plus(other: UInt): UInt = this.toUInt().plus(other)\n /** Adds the other value to this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun plus(other: ULong): ULong = this.toULong().plus(other)\n\n /** Subtracts the other value from this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun minus(other: UByte): UInt = this.toUInt().minus(other.toUInt())\n /** Subtracts the other value from this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun minus(other: UShort): UInt = this.toUInt().minus(other.toUInt())\n /** Subtracts the other value from this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun minus(other: UInt): UInt = this.toUInt().minus(other)\n /** Subtracts the other value from this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun minus(other: ULong): ULong = this.toULong().minus(other)\n\n /** Multiplies this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun times(other: UByte): UInt = this.toUInt().times(other.toUInt())\n /** Multiplies this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun times(other: UShort): UInt = this.toUInt().times(other.toUInt())\n /** Multiplies this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun times(other: UInt): UInt = this.toUInt().times(other)\n /** Multiplies this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun times(other: ULong): ULong = this.toULong().times(other)\n\n /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */\n @kotlin.internal.InlineOnly\n public inline operator fun div(other: UByte): UInt = this.toUInt().div(other.toUInt())\n /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */\n @kotlin.internal.InlineOnly\n public inline operator fun div(other: UShort): UInt = this.toUInt().div(other.toUInt())\n /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */\n @kotlin.internal.InlineOnly\n public inline operator fun div(other: UInt): UInt = this.toUInt().div(other)\n /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */\n @kotlin.internal.InlineOnly\n public inline operator fun div(other: ULong): ULong = this.toULong().div(other)\n\n /**\n * Calculates the remainder of truncating division of this value by the other value.\n * \n * The result is always less than the divisor.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun rem(other: UByte): UInt = this.toUInt().rem(other.toUInt())\n /**\n * Calculates the remainder of truncating division of this value by the other value.\n * \n * The result is always less than the divisor.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun rem(other: UShort): UInt = this.toUInt().rem(other.toUInt())\n /**\n * Calculates the remainder of truncating division of this value by the other value.\n * \n * The result is always less than the divisor.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun rem(other: UInt): UInt = this.toUInt().rem(other)\n /**\n * Calculates the remainder of truncating division of this value by the other value.\n * \n * The result is always less than the divisor.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun rem(other: ULong): ULong = this.toULong().rem(other)\n\n /**\n * Divides this value by the other value, flooring the result to an integer that is closer to negative infinity.\n * \n * For unsigned types, the results of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun floorDiv(other: UByte): UInt = this.toUInt().floorDiv(other.toUInt())\n /**\n * Divides this value by the other value, flooring the result to an integer that is closer to negative infinity.\n * \n * For unsigned types, the results of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun floorDiv(other: UShort): UInt = this.toUInt().floorDiv(other.toUInt())\n /**\n * Divides this value by the other value, flooring the result to an integer that is closer to negative infinity.\n * \n * For unsigned types, the results of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun floorDiv(other: UInt): UInt = this.toUInt().floorDiv(other)\n /**\n * Divides this value by the other value, flooring the result to an integer that is closer to negative infinity.\n * \n * For unsigned types, the results of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun floorDiv(other: ULong): ULong = this.toULong().floorDiv(other)\n\n /**\n * Calculates the remainder of flooring division of this value by the other value.\n * \n * The result is always less than the divisor.\n * \n * For unsigned types, the remainders of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun mod(other: UByte): UByte = this.toUInt().mod(other.toUInt()).toUByte()\n /**\n * Calculates the remainder of flooring division of this value by the other value.\n * \n * The result is always less than the divisor.\n * \n * For unsigned types, the remainders of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun mod(other: UShort): UShort = this.toUInt().mod(other.toUInt()).toUShort()\n /**\n * Calculates the remainder of flooring division of this value by the other value.\n * \n * The result is always less than the divisor.\n * \n * For unsigned types, the remainders of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun mod(other: UInt): UInt = this.toUInt().mod(other)\n /**\n * Calculates the remainder of flooring division of this value by the other value.\n * \n * The result is always less than the divisor.\n * \n * For unsigned types, the remainders of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun mod(other: ULong): ULong = this.toULong().mod(other)\n\n /**\n * Returns this value incremented by one.\n *\n * @sample samples.misc.Builtins.inc\n */\n @kotlin.internal.InlineOnly\n public inline operator fun inc(): UByte = UByte(data.inc())\n\n /**\n * Returns this value decremented by one.\n *\n * @sample samples.misc.Builtins.dec\n */\n @kotlin.internal.InlineOnly\n public inline operator fun dec(): UByte = UByte(data.dec())\n\n /** Creates a range from this value to the specified [other] value. */\n @kotlin.internal.InlineOnly\n public inline operator fun rangeTo(other: UByte): UIntRange = UIntRange(this.toUInt(), other.toUInt())\n\n /** Performs a bitwise AND operation between the two values. */\n @kotlin.internal.InlineOnly\n public inline infix fun and(other: UByte): UByte = UByte(this.data and other.data)\n /** Performs a bitwise OR operation between the two values. */\n @kotlin.internal.InlineOnly\n public inline infix fun or(other: UByte): UByte = UByte(this.data or other.data)\n /** Performs a bitwise XOR operation between the two values. */\n @kotlin.internal.InlineOnly\n public inline infix fun xor(other: UByte): UByte = UByte(this.data xor other.data)\n /** Inverts the bits in this value. */\n @kotlin.internal.InlineOnly\n public inline fun inv(): UByte = UByte(data.inv())\n\n /**\n * Converts this [UByte] value to [Byte].\n *\n * If this value is less than or equals to [Byte.MAX_VALUE], the resulting `Byte` value represents\n * the same numerical value as this `UByte`. Otherwise the result is negative.\n *\n * The resulting `Byte` value has the same binary representation as this `UByte` value.\n */\n @kotlin.internal.InlineOnly\n public inline fun toByte(): Byte = data\n /**\n * Converts this [UByte] value to [Short].\n *\n * The resulting `Short` value represents the same numerical value as this `UByte`.\n *\n * The least significant 8 bits of the resulting `Short` value are the same as the bits of this `UByte` value,\n * whereas the most significant 8 bits are filled with zeros.\n */\n @kotlin.internal.InlineOnly\n public inline fun toShort(): Short = data.toShort() and 0xFF\n /**\n * Converts this [UByte] value to [Int].\n *\n * The resulting `Int` value represents the same numerical value as this `UByte`.\n *\n * The least significant 8 bits of the resulting `Int` value are the same as the bits of this `UByte` value,\n * whereas the most significant 24 bits are filled with zeros.\n */\n @kotlin.internal.InlineOnly\n public inline fun toInt(): Int = data.toInt() and 0xFF\n /**\n * Converts this [UByte] value to [Long].\n *\n * The resulting `Long` value represents the same numerical value as this `UByte`.\n *\n * The least significant 8 bits of the resulting `Long` value are the same as the bits of this `UByte` value,\n * whereas the most significant 56 bits are filled with zeros.\n */\n @kotlin.internal.InlineOnly\n public inline fun toLong(): Long = data.toLong() and 0xFF\n\n /** Returns this value. */\n @kotlin.internal.InlineOnly\n public inline fun toUByte(): UByte = this\n /**\n * Converts this [UByte] value to [UShort].\n *\n * The resulting `UShort` value represents the same numerical value as this `UByte`.\n *\n * The least significant 8 bits of the resulting `UShort` value are the same as the bits of this `UByte` value,\n * whereas the most significant 8 bits are filled with zeros.\n */\n @kotlin.internal.InlineOnly\n public inline fun toUShort(): UShort = UShort(data.toShort() and 0xFF)\n /**\n * Converts this [UByte] value to [UInt].\n *\n * The resulting `UInt` value represents the same numerical value as this `UByte`.\n *\n * The least significant 8 bits of the resulting `UInt` value are the same as the bits of this `UByte` value,\n * whereas the most significant 24 bits are filled with zeros.\n */\n @kotlin.internal.InlineOnly\n public inline fun toUInt(): UInt = UInt(data.toInt() and 0xFF)\n /**\n * Converts this [UByte] value to [ULong].\n *\n * The resulting `ULong` value represents the same numerical value as this `UByte`.\n *\n * The least significant 8 bits of the resulting `ULong` value are the same as the bits of this `UByte` value,\n * whereas the most significant 56 bits are filled with zeros.\n */\n @kotlin.internal.InlineOnly\n public inline fun toULong(): ULong = ULong(data.toLong() and 0xFF)\n\n /**\n * Converts this [UByte] value to [Float].\n *\n * The resulting `Float` value represents the same numerical value as this `UByte`.\n */\n @kotlin.internal.InlineOnly\n public inline fun toFloat(): Float = this.toInt().toFloat()\n /**\n * Converts this [UByte] value to [Double].\n *\n * The resulting `Double` value represents the same numerical value as this `UByte`.\n */\n @kotlin.internal.InlineOnly\n public inline fun toDouble(): Double = this.toInt().toDouble()\n\n public override fun toString(): String = toInt().toString()\n\n}\n\n/**\n * Converts this [Byte] value to [UByte].\n *\n * If this value is positive, the resulting `UByte` value represents the same numerical value as this `Byte`.\n *\n * The resulting `UByte` value has the same binary representation as this `Byte` value.\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Byte.toUByte(): UByte = UByte(this)\n/**\n * Converts this [Short] value to [UByte].\n *\n * If this value is positive and less than or equals to [UByte.MAX_VALUE], the resulting `UByte` value represents\n * the same numerical value as this `Short`.\n *\n * The resulting `UByte` value is represented by the least significant 8 bits of this `Short` value.\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Short.toUByte(): UByte = UByte(this.toByte())\n/**\n * Converts this [Int] value to [UByte].\n *\n * If this value is positive and less than or equals to [UByte.MAX_VALUE], the resulting `UByte` value represents\n * the same numerical value as this `Int`.\n *\n * The resulting `UByte` value is represented by the least significant 8 bits of this `Int` value.\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Int.toUByte(): UByte = UByte(this.toByte())\n/**\n * Converts this [Long] value to [UByte].\n *\n * If this value is positive and less than or equals to [UByte.MAX_VALUE], the resulting `UByte` value represents\n * the same numerical value as this `Long`.\n *\n * The resulting `UByte` value is represented by the least significant 8 bits of this `Long` value.\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Long.toUByte(): UByte = UByte(this.toByte())\n","/*\n * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n// Auto-generated file. DO NOT EDIT!\n\npackage kotlin\n\nimport kotlin.experimental.*\nimport kotlin.jvm.*\n\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@JvmInline\npublic value class UInt @kotlin.internal.IntrinsicConstEvaluation @PublishedApi internal constructor(@PublishedApi internal val data: Int) : Comparable {\n\n companion object {\n /**\n * A constant holding the minimum value an instance of UInt can have.\n */\n public const val MIN_VALUE: UInt = UInt(0)\n\n /**\n * A constant holding the maximum value an instance of UInt can have.\n */\n public const val MAX_VALUE: UInt = UInt(-1)\n\n /**\n * The number of bytes used to represent an instance of UInt in a binary form.\n */\n public const val SIZE_BYTES: Int = 4\n\n /**\n * The number of bits used to represent an instance of UInt in a binary form.\n */\n public const val SIZE_BITS: Int = 32\n }\n\n /**\n * Compares this value with the specified value for order.\n * Returns zero if this value is equal to the specified other value, a negative number if it's less than other,\n * or a positive number if it's greater than other.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun compareTo(other: UByte): Int = this.compareTo(other.toUInt())\n\n /**\n * Compares this value with the specified value for order.\n * Returns zero if this value is equal to the specified other value, a negative number if it's less than other,\n * or a positive number if it's greater than other.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun compareTo(other: UShort): Int = this.compareTo(other.toUInt())\n\n /**\n * Compares this value with the specified value for order.\n * Returns zero if this value is equal to the specified other value, a negative number if it's less than other,\n * or a positive number if it's greater than other.\n */\n @kotlin.internal.InlineOnly\n @Suppress(\"OVERRIDE_BY_INLINE\")\n public override inline operator fun compareTo(other: UInt): Int = uintCompare(this.data, other.data)\n\n /**\n * Compares this value with the specified value for order.\n * Returns zero if this value is equal to the specified other value, a negative number if it's less than other,\n * or a positive number if it's greater than other.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun compareTo(other: ULong): Int = this.toULong().compareTo(other)\n\n /** Adds the other value to this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun plus(other: UByte): UInt = this.plus(other.toUInt())\n /** Adds the other value to this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun plus(other: UShort): UInt = this.plus(other.toUInt())\n /** Adds the other value to this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun plus(other: UInt): UInt = UInt(this.data.plus(other.data))\n /** Adds the other value to this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun plus(other: ULong): ULong = this.toULong().plus(other)\n\n /** Subtracts the other value from this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun minus(other: UByte): UInt = this.minus(other.toUInt())\n /** Subtracts the other value from this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun minus(other: UShort): UInt = this.minus(other.toUInt())\n /** Subtracts the other value from this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun minus(other: UInt): UInt = UInt(this.data.minus(other.data))\n /** Subtracts the other value from this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun minus(other: ULong): ULong = this.toULong().minus(other)\n\n /** Multiplies this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun times(other: UByte): UInt = this.times(other.toUInt())\n /** Multiplies this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun times(other: UShort): UInt = this.times(other.toUInt())\n /** Multiplies this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun times(other: UInt): UInt = UInt(this.data.times(other.data))\n /** Multiplies this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun times(other: ULong): ULong = this.toULong().times(other)\n\n /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */\n @kotlin.internal.InlineOnly\n public inline operator fun div(other: UByte): UInt = this.div(other.toUInt())\n /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */\n @kotlin.internal.InlineOnly\n public inline operator fun div(other: UShort): UInt = this.div(other.toUInt())\n /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */\n @kotlin.internal.InlineOnly\n public inline operator fun div(other: UInt): UInt = uintDivide(this, other)\n /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */\n @kotlin.internal.InlineOnly\n public inline operator fun div(other: ULong): ULong = this.toULong().div(other)\n\n /**\n * Calculates the remainder of truncating division of this value by the other value.\n * \n * The result is always less than the divisor.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun rem(other: UByte): UInt = this.rem(other.toUInt())\n /**\n * Calculates the remainder of truncating division of this value by the other value.\n * \n * The result is always less than the divisor.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun rem(other: UShort): UInt = this.rem(other.toUInt())\n /**\n * Calculates the remainder of truncating division of this value by the other value.\n * \n * The result is always less than the divisor.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun rem(other: UInt): UInt = uintRemainder(this, other)\n /**\n * Calculates the remainder of truncating division of this value by the other value.\n * \n * The result is always less than the divisor.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun rem(other: ULong): ULong = this.toULong().rem(other)\n\n /**\n * Divides this value by the other value, flooring the result to an integer that is closer to negative infinity.\n * \n * For unsigned types, the results of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun floorDiv(other: UByte): UInt = this.floorDiv(other.toUInt())\n /**\n * Divides this value by the other value, flooring the result to an integer that is closer to negative infinity.\n * \n * For unsigned types, the results of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun floorDiv(other: UShort): UInt = this.floorDiv(other.toUInt())\n /**\n * Divides this value by the other value, flooring the result to an integer that is closer to negative infinity.\n * \n * For unsigned types, the results of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun floorDiv(other: UInt): UInt = div(other)\n /**\n * Divides this value by the other value, flooring the result to an integer that is closer to negative infinity.\n * \n * For unsigned types, the results of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun floorDiv(other: ULong): ULong = this.toULong().floorDiv(other)\n\n /**\n * Calculates the remainder of flooring division of this value by the other value.\n * \n * The result is always less than the divisor.\n * \n * For unsigned types, the remainders of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun mod(other: UByte): UByte = this.mod(other.toUInt()).toUByte()\n /**\n * Calculates the remainder of flooring division of this value by the other value.\n * \n * The result is always less than the divisor.\n * \n * For unsigned types, the remainders of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun mod(other: UShort): UShort = this.mod(other.toUInt()).toUShort()\n /**\n * Calculates the remainder of flooring division of this value by the other value.\n * \n * The result is always less than the divisor.\n * \n * For unsigned types, the remainders of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun mod(other: UInt): UInt = rem(other)\n /**\n * Calculates the remainder of flooring division of this value by the other value.\n * \n * The result is always less than the divisor.\n * \n * For unsigned types, the remainders of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun mod(other: ULong): ULong = this.toULong().mod(other)\n\n /**\n * Returns this value incremented by one.\n *\n * @sample samples.misc.Builtins.inc\n */\n @kotlin.internal.InlineOnly\n public inline operator fun inc(): UInt = UInt(data.inc())\n\n /**\n * Returns this value decremented by one.\n *\n * @sample samples.misc.Builtins.dec\n */\n @kotlin.internal.InlineOnly\n public inline operator fun dec(): UInt = UInt(data.dec())\n\n /** Creates a range from this value to the specified [other] value. */\n @kotlin.internal.InlineOnly\n public inline operator fun rangeTo(other: UInt): UIntRange = UIntRange(this, other)\n\n /**\n * Shifts this value left by the [bitCount] number of bits.\n *\n * Note that only the five lowest-order bits of the [bitCount] are used as the shift distance.\n * The shift distance actually used is therefore always in the range `0..31`.\n */\n @kotlin.internal.InlineOnly\n public inline infix fun shl(bitCount: Int): UInt = UInt(data shl bitCount)\n\n /**\n * Shifts this value right by the [bitCount] number of bits, filling the leftmost bits with zeros.\n *\n * Note that only the five lowest-order bits of the [bitCount] are used as the shift distance.\n * The shift distance actually used is therefore always in the range `0..31`.\n */\n @kotlin.internal.InlineOnly\n public inline infix fun shr(bitCount: Int): UInt = UInt(data ushr bitCount)\n\n /** Performs a bitwise AND operation between the two values. */\n @kotlin.internal.InlineOnly\n public inline infix fun and(other: UInt): UInt = UInt(this.data and other.data)\n /** Performs a bitwise OR operation between the two values. */\n @kotlin.internal.InlineOnly\n public inline infix fun or(other: UInt): UInt = UInt(this.data or other.data)\n /** Performs a bitwise XOR operation between the two values. */\n @kotlin.internal.InlineOnly\n public inline infix fun xor(other: UInt): UInt = UInt(this.data xor other.data)\n /** Inverts the bits in this value. */\n @kotlin.internal.InlineOnly\n public inline fun inv(): UInt = UInt(data.inv())\n\n /**\n * Converts this [UInt] value to [Byte].\n *\n * If this value is less than or equals to [Byte.MAX_VALUE], the resulting `Byte` value represents\n * the same numerical value as this `UInt`.\n *\n * The resulting `Byte` value is represented by the least significant 8 bits of this `UInt` value.\n * Note that the resulting `Byte` value may be negative.\n */\n @kotlin.internal.InlineOnly\n public inline fun toByte(): Byte = data.toByte()\n /**\n * Converts this [UInt] value to [Short].\n *\n * If this value is less than or equals to [Short.MAX_VALUE], the resulting `Short` value represents\n * the same numerical value as this `UInt`.\n *\n * The resulting `Short` value is represented by the least significant 16 bits of this `UInt` value.\n * Note that the resulting `Short` value may be negative.\n */\n @kotlin.internal.InlineOnly\n public inline fun toShort(): Short = data.toShort()\n /**\n * Converts this [UInt] value to [Int].\n *\n * If this value is less than or equals to [Int.MAX_VALUE], the resulting `Int` value represents\n * the same numerical value as this `UInt`. Otherwise the result is negative.\n *\n * The resulting `Int` value has the same binary representation as this `UInt` value.\n */\n @kotlin.internal.InlineOnly\n public inline fun toInt(): Int = data\n /**\n * Converts this [UInt] value to [Long].\n *\n * The resulting `Long` value represents the same numerical value as this `UInt`.\n *\n * The least significant 32 bits of the resulting `Long` value are the same as the bits of this `UInt` value,\n * whereas the most significant 32 bits are filled with zeros.\n */\n @kotlin.internal.InlineOnly\n public inline fun toLong(): Long = data.toLong() and 0xFFFF_FFFF\n\n /**\n * Converts this [UInt] value to [UByte].\n *\n * If this value is less than or equals to [UByte.MAX_VALUE], the resulting `UByte` value represents\n * the same numerical value as this `UInt`.\n *\n * The resulting `UByte` value is represented by the least significant 8 bits of this `UInt` value.\n */\n @kotlin.internal.InlineOnly\n public inline fun toUByte(): UByte = data.toUByte()\n /**\n * Converts this [UInt] value to [UShort].\n *\n * If this value is less than or equals to [UShort.MAX_VALUE], the resulting `UShort` value represents\n * the same numerical value as this `UInt`.\n *\n * The resulting `UShort` value is represented by the least significant 16 bits of this `UInt` value.\n */\n @kotlin.internal.InlineOnly\n public inline fun toUShort(): UShort = data.toUShort()\n /** Returns this value. */\n @kotlin.internal.InlineOnly\n public inline fun toUInt(): UInt = this\n /**\n * Converts this [UInt] value to [ULong].\n *\n * The resulting `ULong` value represents the same numerical value as this `UInt`.\n *\n * The least significant 32 bits of the resulting `ULong` value are the same as the bits of this `UInt` value,\n * whereas the most significant 32 bits are filled with zeros.\n */\n @kotlin.internal.InlineOnly\n public inline fun toULong(): ULong = ULong(data.toLong() and 0xFFFF_FFFF)\n\n /**\n * Converts this [UInt] value to [Float].\n *\n * The resulting value is the closest `Float` to this `UInt` value.\n * In case when this `UInt` value is exactly between two `Float`s,\n * the one with zero at least significant bit of mantissa is selected.\n */\n @kotlin.internal.InlineOnly\n public inline fun toFloat(): Float = this.toDouble().toFloat()\n /**\n * Converts this [UInt] value to [Double].\n *\n * The resulting `Double` value represents the same numerical value as this `UInt`.\n */\n @kotlin.internal.InlineOnly\n public inline fun toDouble(): Double = uintToDouble(data)\n\n public override fun toString(): String = toLong().toString()\n\n}\n\n/**\n * Converts this [Byte] value to [UInt].\n *\n * If this value is positive, the resulting `UInt` value represents the same numerical value as this `Byte`.\n *\n * The least significant 8 bits of the resulting `UInt` value are the same as the bits of this `Byte` value,\n * whereas the most significant 24 bits are filled with the sign bit of this value.\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Byte.toUInt(): UInt = UInt(this.toInt())\n/**\n * Converts this [Short] value to [UInt].\n *\n * If this value is positive, the resulting `UInt` value represents the same numerical value as this `Short`.\n *\n * The least significant 16 bits of the resulting `UInt` value are the same as the bits of this `Short` value,\n * whereas the most significant 16 bits are filled with the sign bit of this value.\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Short.toUInt(): UInt = UInt(this.toInt())\n/**\n * Converts this [Int] value to [UInt].\n *\n * If this value is positive, the resulting `UInt` value represents the same numerical value as this `Int`.\n *\n * The resulting `UInt` value has the same binary representation as this `Int` value.\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Int.toUInt(): UInt = UInt(this)\n/**\n * Converts this [Long] value to [UInt].\n *\n * If this value is positive and less than or equals to [UInt.MAX_VALUE], the resulting `UInt` value represents\n * the same numerical value as this `Long`.\n *\n * The resulting `UInt` value is represented by the least significant 32 bits of this `Long` value.\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Long.toUInt(): UInt = UInt(this.toInt())\n\n/**\n * Converts this [Float] value to [UInt].\n *\n * The fractional part, if any, is rounded down towards zero.\n * Returns zero if this `Float` value is negative or `NaN`, [UInt.MAX_VALUE] if it's bigger than `UInt.MAX_VALUE`.\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Float.toUInt(): UInt = doubleToUInt(this.toDouble())\n/**\n * Converts this [Double] value to [UInt].\n *\n * The fractional part, if any, is rounded down towards zero.\n * Returns zero if this `Double` value is negative or `NaN`, [UInt.MAX_VALUE] if it's bigger than `UInt.MAX_VALUE`.\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Double.toUInt(): UInt = doubleToUInt(this)\n","/*\n * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n// Auto-generated file. DO NOT EDIT!\n\npackage kotlin\n\nimport kotlin.experimental.*\nimport kotlin.jvm.*\n\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@JvmInline\npublic value class UShort @kotlin.internal.IntrinsicConstEvaluation @PublishedApi internal constructor(@PublishedApi internal val data: Short) : Comparable {\n\n companion object {\n /**\n * A constant holding the minimum value an instance of UShort can have.\n */\n public const val MIN_VALUE: UShort = UShort(0)\n\n /**\n * A constant holding the maximum value an instance of UShort can have.\n */\n public const val MAX_VALUE: UShort = UShort(-1)\n\n /**\n * The number of bytes used to represent an instance of UShort in a binary form.\n */\n public const val SIZE_BYTES: Int = 2\n\n /**\n * The number of bits used to represent an instance of UShort in a binary form.\n */\n public const val SIZE_BITS: Int = 16\n }\n\n /**\n * Compares this value with the specified value for order.\n * Returns zero if this value is equal to the specified other value, a negative number if it's less than other,\n * or a positive number if it's greater than other.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun compareTo(other: UByte): Int = this.toInt().compareTo(other.toInt())\n\n /**\n * Compares this value with the specified value for order.\n * Returns zero if this value is equal to the specified other value, a negative number if it's less than other,\n * or a positive number if it's greater than other.\n */\n @kotlin.internal.InlineOnly\n @Suppress(\"OVERRIDE_BY_INLINE\")\n public override inline operator fun compareTo(other: UShort): Int = this.toInt().compareTo(other.toInt())\n\n /**\n * Compares this value with the specified value for order.\n * Returns zero if this value is equal to the specified other value, a negative number if it's less than other,\n * or a positive number if it's greater than other.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun compareTo(other: UInt): Int = this.toUInt().compareTo(other)\n\n /**\n * Compares this value with the specified value for order.\n * Returns zero if this value is equal to the specified other value, a negative number if it's less than other,\n * or a positive number if it's greater than other.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun compareTo(other: ULong): Int = this.toULong().compareTo(other)\n\n /** Adds the other value to this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun plus(other: UByte): UInt = this.toUInt().plus(other.toUInt())\n /** Adds the other value to this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun plus(other: UShort): UInt = this.toUInt().plus(other.toUInt())\n /** Adds the other value to this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun plus(other: UInt): UInt = this.toUInt().plus(other)\n /** Adds the other value to this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun plus(other: ULong): ULong = this.toULong().plus(other)\n\n /** Subtracts the other value from this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun minus(other: UByte): UInt = this.toUInt().minus(other.toUInt())\n /** Subtracts the other value from this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun minus(other: UShort): UInt = this.toUInt().minus(other.toUInt())\n /** Subtracts the other value from this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun minus(other: UInt): UInt = this.toUInt().minus(other)\n /** Subtracts the other value from this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun minus(other: ULong): ULong = this.toULong().minus(other)\n\n /** Multiplies this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun times(other: UByte): UInt = this.toUInt().times(other.toUInt())\n /** Multiplies this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun times(other: UShort): UInt = this.toUInt().times(other.toUInt())\n /** Multiplies this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun times(other: UInt): UInt = this.toUInt().times(other)\n /** Multiplies this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun times(other: ULong): ULong = this.toULong().times(other)\n\n /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */\n @kotlin.internal.InlineOnly\n public inline operator fun div(other: UByte): UInt = this.toUInt().div(other.toUInt())\n /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */\n @kotlin.internal.InlineOnly\n public inline operator fun div(other: UShort): UInt = this.toUInt().div(other.toUInt())\n /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */\n @kotlin.internal.InlineOnly\n public inline operator fun div(other: UInt): UInt = this.toUInt().div(other)\n /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */\n @kotlin.internal.InlineOnly\n public inline operator fun div(other: ULong): ULong = this.toULong().div(other)\n\n /**\n * Calculates the remainder of truncating division of this value by the other value.\n * \n * The result is always less than the divisor.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun rem(other: UByte): UInt = this.toUInt().rem(other.toUInt())\n /**\n * Calculates the remainder of truncating division of this value by the other value.\n * \n * The result is always less than the divisor.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun rem(other: UShort): UInt = this.toUInt().rem(other.toUInt())\n /**\n * Calculates the remainder of truncating division of this value by the other value.\n * \n * The result is always less than the divisor.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun rem(other: UInt): UInt = this.toUInt().rem(other)\n /**\n * Calculates the remainder of truncating division of this value by the other value.\n * \n * The result is always less than the divisor.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun rem(other: ULong): ULong = this.toULong().rem(other)\n\n /**\n * Divides this value by the other value, flooring the result to an integer that is closer to negative infinity.\n * \n * For unsigned types, the results of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun floorDiv(other: UByte): UInt = this.toUInt().floorDiv(other.toUInt())\n /**\n * Divides this value by the other value, flooring the result to an integer that is closer to negative infinity.\n * \n * For unsigned types, the results of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun floorDiv(other: UShort): UInt = this.toUInt().floorDiv(other.toUInt())\n /**\n * Divides this value by the other value, flooring the result to an integer that is closer to negative infinity.\n * \n * For unsigned types, the results of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun floorDiv(other: UInt): UInt = this.toUInt().floorDiv(other)\n /**\n * Divides this value by the other value, flooring the result to an integer that is closer to negative infinity.\n * \n * For unsigned types, the results of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun floorDiv(other: ULong): ULong = this.toULong().floorDiv(other)\n\n /**\n * Calculates the remainder of flooring division of this value by the other value.\n * \n * The result is always less than the divisor.\n * \n * For unsigned types, the remainders of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun mod(other: UByte): UByte = this.toUInt().mod(other.toUInt()).toUByte()\n /**\n * Calculates the remainder of flooring division of this value by the other value.\n * \n * The result is always less than the divisor.\n * \n * For unsigned types, the remainders of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun mod(other: UShort): UShort = this.toUInt().mod(other.toUInt()).toUShort()\n /**\n * Calculates the remainder of flooring division of this value by the other value.\n * \n * The result is always less than the divisor.\n * \n * For unsigned types, the remainders of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun mod(other: UInt): UInt = this.toUInt().mod(other)\n /**\n * Calculates the remainder of flooring division of this value by the other value.\n * \n * The result is always less than the divisor.\n * \n * For unsigned types, the remainders of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun mod(other: ULong): ULong = this.toULong().mod(other)\n\n /**\n * Returns this value incremented by one.\n *\n * @sample samples.misc.Builtins.inc\n */\n @kotlin.internal.InlineOnly\n public inline operator fun inc(): UShort = UShort(data.inc())\n\n /**\n * Returns this value decremented by one.\n *\n * @sample samples.misc.Builtins.dec\n */\n @kotlin.internal.InlineOnly\n public inline operator fun dec(): UShort = UShort(data.dec())\n\n /** Creates a range from this value to the specified [other] value. */\n @kotlin.internal.InlineOnly\n public inline operator fun rangeTo(other: UShort): UIntRange = UIntRange(this.toUInt(), other.toUInt())\n\n /** Performs a bitwise AND operation between the two values. */\n @kotlin.internal.InlineOnly\n public inline infix fun and(other: UShort): UShort = UShort(this.data and other.data)\n /** Performs a bitwise OR operation between the two values. */\n @kotlin.internal.InlineOnly\n public inline infix fun or(other: UShort): UShort = UShort(this.data or other.data)\n /** Performs a bitwise XOR operation between the two values. */\n @kotlin.internal.InlineOnly\n public inline infix fun xor(other: UShort): UShort = UShort(this.data xor other.data)\n /** Inverts the bits in this value. */\n @kotlin.internal.InlineOnly\n public inline fun inv(): UShort = UShort(data.inv())\n\n /**\n * Converts this [UShort] value to [Byte].\n *\n * If this value is less than or equals to [Byte.MAX_VALUE], the resulting `Byte` value represents\n * the same numerical value as this `UShort`.\n *\n * The resulting `Byte` value is represented by the least significant 8 bits of this `UShort` value.\n * Note that the resulting `Byte` value may be negative.\n */\n @kotlin.internal.InlineOnly\n public inline fun toByte(): Byte = data.toByte()\n /**\n * Converts this [UShort] value to [Short].\n *\n * If this value is less than or equals to [Short.MAX_VALUE], the resulting `Short` value represents\n * the same numerical value as this `UShort`. Otherwise the result is negative.\n *\n * The resulting `Short` value has the same binary representation as this `UShort` value.\n */\n @kotlin.internal.InlineOnly\n public inline fun toShort(): Short = data\n /**\n * Converts this [UShort] value to [Int].\n *\n * The resulting `Int` value represents the same numerical value as this `UShort`.\n *\n * The least significant 16 bits of the resulting `Int` value are the same as the bits of this `UShort` value,\n * whereas the most significant 16 bits are filled with zeros.\n */\n @kotlin.internal.InlineOnly\n public inline fun toInt(): Int = data.toInt() and 0xFFFF\n /**\n * Converts this [UShort] value to [Long].\n *\n * The resulting `Long` value represents the same numerical value as this `UShort`.\n *\n * The least significant 16 bits of the resulting `Long` value are the same as the bits of this `UShort` value,\n * whereas the most significant 48 bits are filled with zeros.\n */\n @kotlin.internal.InlineOnly\n public inline fun toLong(): Long = data.toLong() and 0xFFFF\n\n /**\n * Converts this [UShort] value to [UByte].\n *\n * If this value is less than or equals to [UByte.MAX_VALUE], the resulting `UByte` value represents\n * the same numerical value as this `UShort`.\n *\n * The resulting `UByte` value is represented by the least significant 8 bits of this `UShort` value.\n */\n @kotlin.internal.InlineOnly\n public inline fun toUByte(): UByte = data.toUByte()\n /** Returns this value. */\n @kotlin.internal.InlineOnly\n public inline fun toUShort(): UShort = this\n /**\n * Converts this [UShort] value to [UInt].\n *\n * The resulting `UInt` value represents the same numerical value as this `UShort`.\n *\n * The least significant 16 bits of the resulting `UInt` value are the same as the bits of this `UShort` value,\n * whereas the most significant 16 bits are filled with zeros.\n */\n @kotlin.internal.InlineOnly\n public inline fun toUInt(): UInt = UInt(data.toInt() and 0xFFFF)\n /**\n * Converts this [UShort] value to [ULong].\n *\n * The resulting `ULong` value represents the same numerical value as this `UShort`.\n *\n * The least significant 16 bits of the resulting `ULong` value are the same as the bits of this `UShort` value,\n * whereas the most significant 48 bits are filled with zeros.\n */\n @kotlin.internal.InlineOnly\n public inline fun toULong(): ULong = ULong(data.toLong() and 0xFFFF)\n\n /**\n * Converts this [UShort] value to [Float].\n *\n * The resulting `Float` value represents the same numerical value as this `UShort`.\n */\n @kotlin.internal.InlineOnly\n public inline fun toFloat(): Float = this.toInt().toFloat()\n /**\n * Converts this [UShort] value to [Double].\n *\n * The resulting `Double` value represents the same numerical value as this `UShort`.\n */\n @kotlin.internal.InlineOnly\n public inline fun toDouble(): Double = this.toInt().toDouble()\n\n public override fun toString(): String = toInt().toString()\n\n}\n\n/**\n * Converts this [Byte] value to [UShort].\n *\n * If this value is positive, the resulting `UShort` value represents the same numerical value as this `Byte`.\n *\n * The least significant 8 bits of the resulting `UShort` value are the same as the bits of this `Byte` value,\n * whereas the most significant 8 bits are filled with the sign bit of this value.\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Byte.toUShort(): UShort = UShort(this.toShort())\n/**\n * Converts this [Short] value to [UShort].\n *\n * If this value is positive, the resulting `UShort` value represents the same numerical value as this `Short`.\n *\n * The resulting `UShort` value has the same binary representation as this `Short` value.\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Short.toUShort(): UShort = UShort(this)\n/**\n * Converts this [Int] value to [UShort].\n *\n * If this value is positive and less than or equals to [UShort.MAX_VALUE], the resulting `UShort` value represents\n * the same numerical value as this `Int`.\n *\n * The resulting `UShort` value is represented by the least significant 16 bits of this `Int` value.\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Int.toUShort(): UShort = UShort(this.toShort())\n/**\n * Converts this [Long] value to [UShort].\n *\n * If this value is positive and less than or equals to [UShort.MAX_VALUE], the resulting `UShort` value represents\n * the same numerical value as this `Long`.\n *\n * The resulting `UShort` value is represented by the least significant 16 bits of this `Long` value.\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Long.toUShort(): UShort = UShort(this.toShort())\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"CollectionsKt\")\n@file:OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n\npackage kotlin.collections\n\nimport kotlin.contracts.*\nimport kotlin.random.Random\n\ninternal object EmptyIterator : ListIterator {\n override fun hasNext(): Boolean = false\n override fun hasPrevious(): Boolean = false\n override fun nextIndex(): Int = 0\n override fun previousIndex(): Int = -1\n override fun next(): Nothing = throw NoSuchElementException()\n override fun previous(): Nothing = throw NoSuchElementException()\n}\n\ninternal object EmptyList : List, Serializable, RandomAccess {\n private const val serialVersionUID: Long = -7390468764508069838L\n\n override fun equals(other: Any?): Boolean = other is List<*> && other.isEmpty()\n override fun hashCode(): Int = 1\n override fun toString(): String = \"[]\"\n\n override val size: Int get() = 0\n override fun isEmpty(): Boolean = true\n override fun contains(element: Nothing): Boolean = false\n override fun containsAll(elements: Collection): Boolean = elements.isEmpty()\n\n override fun get(index: Int): Nothing = throw IndexOutOfBoundsException(\"Empty list doesn't contain element at index $index.\")\n override fun indexOf(element: Nothing): Int = -1\n override fun lastIndexOf(element: Nothing): Int = -1\n\n override fun iterator(): Iterator = EmptyIterator\n override fun listIterator(): ListIterator = EmptyIterator\n override fun listIterator(index: Int): ListIterator {\n if (index != 0) throw IndexOutOfBoundsException(\"Index: $index\")\n return EmptyIterator\n }\n\n override fun subList(fromIndex: Int, toIndex: Int): List {\n if (fromIndex == 0 && toIndex == 0) return this\n throw IndexOutOfBoundsException(\"fromIndex: $fromIndex, toIndex: $toIndex\")\n }\n\n private fun readResolve(): Any = EmptyList\n}\n\ninternal fun Array.asCollection(): Collection = ArrayAsCollection(this, isVarargs = false)\n\nprivate class ArrayAsCollection(val values: Array, val isVarargs: Boolean) : Collection {\n override val size: Int get() = values.size\n override fun isEmpty(): Boolean = values.isEmpty()\n override fun contains(element: T): Boolean = values.contains(element)\n override fun containsAll(elements: Collection): Boolean = elements.all { contains(it) }\n override fun iterator(): Iterator = values.iterator()\n // override hidden toArray implementation to prevent copying of values array\n public fun toArray(): Array = values.copyToArrayOfAny(isVarargs)\n}\n\n/**\n * Returns an empty read-only list. The returned list is serializable (JVM).\n * @sample samples.collections.Collections.Lists.emptyReadOnlyList\n */\npublic fun emptyList(): List = EmptyList\n\n/**\n * Returns a new read-only list of given elements. The returned list is serializable (JVM).\n * @sample samples.collections.Collections.Lists.readOnlyList\n */\npublic fun listOf(vararg elements: T): List = if (elements.size > 0) elements.asList() else emptyList()\n\n/**\n * Returns an empty read-only list. The returned list is serializable (JVM).\n * @sample samples.collections.Collections.Lists.emptyReadOnlyList\n */\n@kotlin.internal.InlineOnly\npublic inline fun listOf(): List = emptyList()\n\n/**\n * Returns an empty new [MutableList].\n * @sample samples.collections.Collections.Lists.emptyMutableList\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline fun mutableListOf(): MutableList = ArrayList()\n\n/**\n * Returns an empty new [ArrayList].\n * @sample samples.collections.Collections.Lists.emptyArrayList\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline fun arrayListOf(): ArrayList = ArrayList()\n\n/**\n * Returns a new [MutableList] with the given elements.\n * @sample samples.collections.Collections.Lists.mutableList\n */\npublic fun mutableListOf(vararg elements: T): MutableList =\n if (elements.size == 0) ArrayList() else ArrayList(ArrayAsCollection(elements, isVarargs = true))\n\n/**\n * Returns a new [ArrayList] with the given elements.\n * @sample samples.collections.Collections.Lists.arrayList\n */\npublic fun arrayListOf(vararg elements: T): ArrayList =\n if (elements.size == 0) ArrayList() else ArrayList(ArrayAsCollection(elements, isVarargs = true))\n\n/**\n * Returns a new read-only list either of single given element, if it is not null, or empty list if the element is null. The returned list is serializable (JVM).\n * @sample samples.collections.Collections.Lists.listOfNotNull\n */\npublic fun listOfNotNull(element: T?): List = if (element != null) listOf(element) else emptyList()\n\n/**\n * Returns a new read-only list only of those given elements, that are not null. The returned list is serializable (JVM).\n * @sample samples.collections.Collections.Lists.listOfNotNull\n */\npublic fun listOfNotNull(vararg elements: T?): List = elements.filterNotNull()\n\n/**\n * Creates a new read-only list with the specified [size], where each element is calculated by calling the specified\n * [init] function.\n *\n * The function [init] is called for each list element sequentially starting from the first one.\n * It should return the value for a list element given its index.\n *\n * @sample samples.collections.Collections.Lists.readOnlyListFromInitializer\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline fun List(size: Int, init: (index: Int) -> T): List = MutableList(size, init)\n\n/**\n * Creates a new mutable list with the specified [size], where each element is calculated by calling the specified\n * [init] function.\n *\n * The function [init] is called for each list element sequentially starting from the first one.\n * It should return the value for a list element given its index.\n *\n * @sample samples.collections.Collections.Lists.mutableListFromInitializer\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline fun MutableList(size: Int, init: (index: Int) -> T): MutableList {\n val list = ArrayList(size)\n repeat(size) { index -> list.add(init(index)) }\n return list\n}\n\n/**\n * Builds a new read-only [List] by populating a [MutableList] using the given [builderAction]\n * and returning a read-only list with the same elements.\n *\n * The list passed as a receiver to the [builderAction] is valid only inside that function.\n * Using it outside of the function produces an unspecified behavior.\n *\n * The returned list is serializable (JVM).\n *\n * @sample samples.collections.Builders.Lists.buildListSample\n */\n@SinceKotlin(\"1.6\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun buildList(@BuilderInference builderAction: MutableList.() -> Unit): List {\n contract { callsInPlace(builderAction, InvocationKind.EXACTLY_ONCE) }\n return buildListInternal(builderAction)\n}\n\n@PublishedApi\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\ninternal expect inline fun buildListInternal(builderAction: MutableList.() -> Unit): List\n\n/**\n * Builds a new read-only [List] by populating a [MutableList] using the given [builderAction]\n * and returning a read-only list with the same elements.\n *\n * The list passed as a receiver to the [builderAction] is valid only inside that function.\n * Using it outside of the function produces an unspecified behavior.\n *\n * The returned list is serializable (JVM).\n *\n * [capacity] is used to hint the expected number of elements added in the [builderAction].\n *\n * @throws IllegalArgumentException if the given [capacity] is negative.\n *\n * @sample samples.collections.Builders.Lists.buildListSampleWithCapacity\n */\n@SinceKotlin(\"1.6\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun buildList(capacity: Int, @BuilderInference builderAction: MutableList.() -> Unit): List {\n contract { callsInPlace(builderAction, InvocationKind.EXACTLY_ONCE) }\n return buildListInternal(capacity, builderAction)\n}\n\n@PublishedApi\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\ninternal expect inline fun buildListInternal(capacity: Int, builderAction: MutableList.() -> Unit): List\n\n/**\n * Returns an [IntRange] of the valid indices for this collection.\n * @sample samples.collections.Collections.Collections.indicesOfCollection\n */\npublic val Collection<*>.indices: IntRange\n get() = 0..size - 1\n\n/**\n * Returns the index of the last item in the list or -1 if the list is empty.\n *\n * @sample samples.collections.Collections.Lists.lastIndexOfList\n */\npublic val List.lastIndex: Int\n get() = this.size - 1\n\n/**\n * Returns `true` if the collection is not empty.\n * @sample samples.collections.Collections.Collections.collectionIsNotEmpty\n */\n@kotlin.internal.InlineOnly\npublic inline fun Collection.isNotEmpty(): Boolean = !isEmpty()\n\n/**\n * Returns `true` if this nullable collection is either null or empty.\n * @sample samples.collections.Collections.Collections.collectionIsNullOrEmpty\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun Collection?.isNullOrEmpty(): Boolean {\n contract {\n returns(false) implies (this@isNullOrEmpty != null)\n }\n\n return this == null || this.isEmpty()\n}\n\n/**\n * Returns this Collection if it's not `null` and the empty list otherwise.\n * @sample samples.collections.Collections.Collections.collectionOrEmpty\n */\n@kotlin.internal.InlineOnly\npublic inline fun Collection?.orEmpty(): Collection = this ?: emptyList()\n\n/**\n * Returns this List if it's not `null` and the empty list otherwise.\n * @sample samples.collections.Collections.Lists.listOrEmpty\n */\n@kotlin.internal.InlineOnly\npublic inline fun List?.orEmpty(): List = this ?: emptyList()\n\n/**\n * Returns this collection if it's not empty\n * or the result of calling [defaultValue] function if the collection is empty.\n *\n * @sample samples.collections.Collections.Collections.collectionIfEmpty\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun C.ifEmpty(defaultValue: () -> R): R where C : Collection<*>, C : R =\n if (isEmpty()) defaultValue() else this\n\n\n/**\n * Checks if all elements in the specified collection are contained in this collection.\n *\n * Allows to overcome type-safety restriction of `containsAll` that requires to pass a collection of type `Collection`.\n * @sample samples.collections.Collections.Collections.collectionContainsAll\n */\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\") // false warning, extension takes precedence in some cases\n@kotlin.internal.InlineOnly\npublic inline fun <@kotlin.internal.OnlyInputTypes T> Collection.containsAll(elements: Collection): Boolean = this.containsAll(elements)\n\n\n/**\n * Returns a new list with the elements of this list randomly shuffled\n * using the specified [random] instance as the source of randomness.\n */\n@SinceKotlin(\"1.3\")\npublic fun Iterable.shuffled(random: Random): List = toMutableList().apply { shuffle(random) }\n\n\ninternal fun List.optimizeReadOnlyList() = when (size) {\n 0 -> emptyList()\n 1 -> listOf(this[0])\n else -> this\n}\n\n/**\n * Searches this list or its range for the provided [element] using the binary search algorithm.\n * The list is expected to be sorted into ascending order according to the Comparable natural ordering of its elements,\n * otherwise the result is undefined.\n *\n * If the list contains multiple elements equal to the specified [element], there is no guarantee which one will be found.\n *\n * `null` value is considered to be less than any non-null value.\n *\n * @return the index of the element, if it is contained in the list within the specified range;\n * otherwise, the inverted insertion point `(-insertion point - 1)`.\n * The insertion point is defined as the index at which the element should be inserted,\n * so that the list (or the specified subrange of list) still remains sorted.\n * @sample samples.collections.Collections.Lists.binarySearchOnComparable\n * @sample samples.collections.Collections.Lists.binarySearchWithBoundaries\n */\npublic fun > List.binarySearch(element: T?, fromIndex: Int = 0, toIndex: Int = size): Int {\n rangeCheck(size, fromIndex, toIndex)\n\n var low = fromIndex\n var high = toIndex - 1\n\n while (low <= high) {\n val mid = (low + high).ushr(1) // safe from overflows\n val midVal = get(mid)\n val cmp = compareValues(midVal, element)\n\n if (cmp < 0)\n low = mid + 1\n else if (cmp > 0)\n high = mid - 1\n else\n return mid // key found\n }\n return -(low + 1) // key not found\n}\n\n/**\n * Searches this list or its range for the provided [element] using the binary search algorithm.\n * The list is expected to be sorted into ascending order according to the specified [comparator],\n * otherwise the result is undefined.\n *\n * If the list contains multiple elements equal to the specified [element], there is no guarantee which one will be found.\n *\n * `null` value is considered to be less than any non-null value.\n *\n * @return the index of the element, if it is contained in the list within the specified range;\n * otherwise, the inverted insertion point `(-insertion point - 1)`.\n * The insertion point is defined as the index at which the element should be inserted,\n * so that the list (or the specified subrange of list) still remains sorted according to the specified [comparator].\n * @sample samples.collections.Collections.Lists.binarySearchWithComparator\n */\npublic fun List.binarySearch(element: T, comparator: Comparator, fromIndex: Int = 0, toIndex: Int = size): Int {\n rangeCheck(size, fromIndex, toIndex)\n\n var low = fromIndex\n var high = toIndex - 1\n\n while (low <= high) {\n val mid = (low + high).ushr(1) // safe from overflows\n val midVal = get(mid)\n val cmp = comparator.compare(midVal, element)\n\n if (cmp < 0)\n low = mid + 1\n else if (cmp > 0)\n high = mid - 1\n else\n return mid // key found\n }\n return -(low + 1) // key not found\n}\n\n/**\n * Searches this list or its range for an element having the key returned by the specified [selector] function\n * equal to the provided [key] value using the binary search algorithm.\n * The list is expected to be sorted into ascending order according to the Comparable natural ordering of keys of its elements.\n * otherwise the result is undefined.\n *\n * If the list contains multiple elements with the specified [key], there is no guarantee which one will be found.\n *\n * `null` value is considered to be less than any non-null value.\n *\n * @return the index of the element with the specified [key], if it is contained in the list within the specified range;\n * otherwise, the inverted insertion point `(-insertion point - 1)`.\n * The insertion point is defined as the index at which the element should be inserted,\n * so that the list (or the specified subrange of list) still remains sorted.\n * @sample samples.collections.Collections.Lists.binarySearchByKey\n */\npublic inline fun > List.binarySearchBy(\n key: K?,\n fromIndex: Int = 0,\n toIndex: Int = size,\n crossinline selector: (T) -> K?\n): Int =\n binarySearch(fromIndex, toIndex) { compareValues(selector(it), key) }\n\n// do not introduce this overload --- too rare\n//public fun List.binarySearchBy(key: K, comparator: Comparator, fromIndex: Int = 0, toIndex: Int = size(), selector: (T) -> K): Int =\n// binarySearch(fromIndex, toIndex) { comparator.compare(selector(it), key) }\n\n\n/**\n * Searches this list or its range for an element for which the given [comparison] function returns zero using the binary search algorithm.\n *\n * The list is expected to be sorted so that the signs of the [comparison] function's return values ascend on the list elements,\n * i.e. negative values come before zero and zeroes come before positive values.\n * Otherwise, the result is undefined.\n *\n * If the list contains multiple elements for which [comparison] returns zero, there is no guarantee which one will be found.\n *\n * @param comparison function that returns zero when called on the list element being searched.\n * On the elements coming before the target element, the function must return negative values;\n * on the elements coming after the target element, the function must return positive values.\n *\n * @return the index of the found element, if it is contained in the list within the specified range;\n * otherwise, the inverted insertion point `(-insertion point - 1)`.\n * The insertion point is defined as the index at which the element should be inserted,\n * so that the list (or the specified subrange of list) still remains sorted.\n * @sample samples.collections.Collections.Lists.binarySearchWithComparisonFunction\n */\npublic fun List.binarySearch(fromIndex: Int = 0, toIndex: Int = size, comparison: (T) -> Int): Int {\n rangeCheck(size, fromIndex, toIndex)\n\n var low = fromIndex\n var high = toIndex - 1\n\n while (low <= high) {\n val mid = (low + high).ushr(1) // safe from overflows\n val midVal = get(mid)\n val cmp = comparison(midVal)\n\n if (cmp < 0)\n low = mid + 1\n else if (cmp > 0)\n high = mid - 1\n else\n return mid // key found\n }\n return -(low + 1) // key not found\n}\n\n/**\n * Checks that `from` and `to` are in\n * the range of [0..size] and throws an appropriate exception, if they aren't.\n */\nprivate fun rangeCheck(size: Int, fromIndex: Int, toIndex: Int) {\n when {\n fromIndex > toIndex -> throw IllegalArgumentException(\"fromIndex ($fromIndex) is greater than toIndex ($toIndex).\")\n fromIndex < 0 -> throw IndexOutOfBoundsException(\"fromIndex ($fromIndex) is less than zero.\")\n toIndex > size -> throw IndexOutOfBoundsException(\"toIndex ($toIndex) is greater than size ($size).\")\n }\n}\n\n\n@PublishedApi\n@SinceKotlin(\"1.3\")\ninternal expect fun checkIndexOverflow(index: Int): Int\n\n@PublishedApi\n@SinceKotlin(\"1.3\")\ninternal expect fun checkCountOverflow(count: Int): Int\n\n\n@PublishedApi\n@SinceKotlin(\"1.3\")\ninternal fun throwIndexOverflow() { throw ArithmeticException(\"Index overflow has happened.\") }\n\n@PublishedApi\n@SinceKotlin(\"1.3\")\ninternal fun throwCountOverflow() { throw ArithmeticException(\"Count overflow has happened.\") }\n\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"MapsKt\")\n@file:OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n\npackage kotlin.collections\n\nimport kotlin.contracts.*\n\nprivate object EmptyMap : Map, Serializable {\n private const val serialVersionUID: Long = 8246714829545688274\n\n override fun equals(other: Any?): Boolean = other is Map<*, *> && other.isEmpty()\n override fun hashCode(): Int = 0\n override fun toString(): String = \"{}\"\n\n override val size: Int get() = 0\n override fun isEmpty(): Boolean = true\n\n override fun containsKey(key: Any?): Boolean = false\n override fun containsValue(value: Nothing): Boolean = false\n override fun get(key: Any?): Nothing? = null\n override val entries: Set> get() = EmptySet\n override val keys: Set get() = EmptySet\n override val values: Collection get() = EmptyList\n\n private fun readResolve(): Any = EmptyMap\n}\n\n/**\n * Returns an empty read-only map of specified type.\n *\n * The returned map is serializable (JVM).\n * @sample samples.collections.Maps.Instantiation.emptyReadOnlyMap\n */\npublic fun emptyMap(): Map = @Suppress(\"UNCHECKED_CAST\") (EmptyMap as Map)\n\n/**\n * Returns a new read-only map with the specified contents, given as a list of pairs\n * where the first value is the key and the second is the value.\n *\n * If multiple pairs have the same key, the resulting map will contain the value from the last of those pairs.\n *\n * Entries of the map are iterated in the order they were specified.\n *\n * The returned map is serializable (JVM).\n *\n * @sample samples.collections.Maps.Instantiation.mapFromPairs\n */\npublic fun mapOf(vararg pairs: Pair): Map =\n if (pairs.size > 0) pairs.toMap(LinkedHashMap(mapCapacity(pairs.size))) else emptyMap()\n\n/**\n * Returns an empty read-only map.\n *\n * The returned map is serializable (JVM).\n * @sample samples.collections.Maps.Instantiation.emptyReadOnlyMap\n */\n@kotlin.internal.InlineOnly\npublic inline fun mapOf(): Map = emptyMap()\n\n/**\n * Returns an empty new [MutableMap].\n *\n * The returned map preserves the entry iteration order.\n * @sample samples.collections.Maps.Instantiation.emptyMutableMap\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline fun mutableMapOf(): MutableMap = LinkedHashMap()\n\n/**\n * Returns a new [MutableMap] with the specified contents, given as a list of pairs\n * where the first component is the key and the second is the value.\n *\n * If multiple pairs have the same key, the resulting map will contain the value from the last of those pairs.\n *\n * Entries of the map are iterated in the order they were specified.\n *\n * @sample samples.collections.Maps.Instantiation.mutableMapFromPairs\n * @sample samples.collections.Maps.Instantiation.emptyMutableMap\n */\npublic fun mutableMapOf(vararg pairs: Pair): MutableMap =\n LinkedHashMap(mapCapacity(pairs.size)).apply { putAll(pairs) }\n\n/**\n * Returns an empty new [HashMap].\n *\n * @sample samples.collections.Maps.Instantiation.emptyHashMap\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline fun hashMapOf(): HashMap = HashMap()\n\n/**\n * Returns a new [HashMap] with the specified contents, given as a list of pairs\n * where the first component is the key and the second is the value.\n *\n * @sample samples.collections.Maps.Instantiation.hashMapFromPairs\n */\npublic fun hashMapOf(vararg pairs: Pair): HashMap = HashMap(mapCapacity(pairs.size)).apply { putAll(pairs) }\n\n/**\n * Returns an empty new [LinkedHashMap].\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline fun linkedMapOf(): LinkedHashMap = LinkedHashMap()\n\n/**\n * Returns a new [LinkedHashMap] with the specified contents, given as a list of pairs\n * where the first component is the key and the second is the value.\n *\n * If multiple pairs have the same key, the resulting map will contain the value from the last of those pairs.\n *\n * Entries of the map are iterated in the order they were specified.\n *\n * @sample samples.collections.Maps.Instantiation.linkedMapFromPairs\n */\npublic fun linkedMapOf(vararg pairs: Pair): LinkedHashMap = pairs.toMap(LinkedHashMap(mapCapacity(pairs.size)))\n\n/**\n * Builds a new read-only [Map] by populating a [MutableMap] using the given [builderAction]\n * and returning a read-only map with the same key-value pairs.\n *\n * The map passed as a receiver to the [builderAction] is valid only inside that function.\n * Using it outside of the function produces an unspecified behavior.\n *\n * Entries of the map are iterated in the order they were added by the [builderAction].\n *\n * The returned map is serializable (JVM).\n *\n * @sample samples.collections.Builders.Maps.buildMapSample\n */\n@SinceKotlin(\"1.6\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun buildMap(@BuilderInference builderAction: MutableMap.() -> Unit): Map {\n contract { callsInPlace(builderAction, InvocationKind.EXACTLY_ONCE) }\n return buildMapInternal(builderAction)\n}\n\n@PublishedApi\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\ninternal expect inline fun buildMapInternal(builderAction: MutableMap.() -> Unit): Map\n\n/**\n * Builds a new read-only [Map] by populating a [MutableMap] using the given [builderAction]\n * and returning a read-only map with the same key-value pairs.\n *\n * The map passed as a receiver to the [builderAction] is valid only inside that function.\n * Using it outside of the function produces an unspecified behavior.\n *\n * [capacity] is used to hint the expected number of pairs added in the [builderAction].\n *\n * Entries of the map are iterated in the order they were added by the [builderAction].\n *\n * The returned map is serializable (JVM).\n *\n * @throws IllegalArgumentException if the given [capacity] is negative.\n *\n * @sample samples.collections.Builders.Maps.buildMapSample\n */\n@SinceKotlin(\"1.6\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun buildMap(capacity: Int, @BuilderInference builderAction: MutableMap.() -> Unit): Map {\n contract { callsInPlace(builderAction, InvocationKind.EXACTLY_ONCE) }\n return buildMapInternal(capacity, builderAction)\n}\n\n@PublishedApi\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\ninternal expect inline fun buildMapInternal(capacity: Int, builderAction: MutableMap.() -> Unit): Map\n\n/**\n * Calculate the initial capacity of a map.\n */\n@PublishedApi\ninternal expect fun mapCapacity(expectedSize: Int): Int\n\n/**\n * Returns `true` if this map is not empty.\n * @sample samples.collections.Maps.Usage.mapIsNotEmpty\n */\n@kotlin.internal.InlineOnly\npublic inline fun Map.isNotEmpty(): Boolean = !isEmpty()\n\n/**\n * Returns `true` if this nullable map is either null or empty.\n * @sample samples.collections.Maps.Usage.mapIsNullOrEmpty\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun Map?.isNullOrEmpty(): Boolean {\n contract {\n returns(false) implies (this@isNullOrEmpty != null)\n }\n\n return this == null || isEmpty()\n}\n\n/**\n * Returns the [Map] if its not `null`, or the empty [Map] otherwise.\n *\n * @sample samples.collections.Maps.Usage.mapOrEmpty\n */\n@kotlin.internal.InlineOnly\npublic inline fun Map?.orEmpty(): Map = this ?: emptyMap()\n\n/**\n * Returns this map if it's not empty\n * or the result of calling [defaultValue] function if the map is empty.\n *\n * @sample samples.collections.Maps.Usage.mapIfEmpty\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun M.ifEmpty(defaultValue: () -> R): R where M : Map<*, *>, M : R =\n if (isEmpty()) defaultValue() else this\n\n/**\n * Checks if the map contains the given key.\n *\n * This method allows to use the `x in map` syntax for checking whether an object is contained in the map.\n *\n * @sample samples.collections.Maps.Usage.containsKey\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun <@kotlin.internal.OnlyInputTypes K, V> Map.contains(key: K): Boolean = containsKey(key)\n\n/**\n * Returns the value corresponding to the given [key], or `null` if such a key is not present in the map.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun <@kotlin.internal.OnlyInputTypes K, V> Map.get(key: K): V? =\n @Suppress(\"UNCHECKED_CAST\") (this as Map).get(key)\n\n/**\n * Allows to use the index operator for storing values in a mutable map.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun MutableMap.set(key: K, value: V): Unit {\n put(key, value)\n}\n\n/**\n * Returns `true` if the map contains the specified [key].\n *\n * Allows to overcome type-safety restriction of `containsKey` that requires to pass a key of type `K`.\n */\n@kotlin.internal.InlineOnly\npublic inline fun <@kotlin.internal.OnlyInputTypes K> Map.containsKey(key: K): Boolean =\n @Suppress(\"UNCHECKED_CAST\") (this as Map).containsKey(key)\n\n/**\n * Returns `true` if the map maps one or more keys to the specified [value].\n *\n * Allows to overcome type-safety restriction of `containsValue` that requires to pass a value of type `V`.\n *\n * @sample samples.collections.Maps.Usage.containsValue\n */\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\") // false warning, extension takes precedence in some cases\n@kotlin.internal.InlineOnly\npublic inline fun Map.containsValue(value: V): Boolean = this.containsValue(value)\n\n\n/**\n * Removes the specified key and its corresponding value from this map.\n *\n * @return the previous value associated with the key, or `null` if the key was not present in the map.\n\n * Allows to overcome type-safety restriction of `remove` that requires to pass a key of type `K`.\n */\n@kotlin.internal.InlineOnly\npublic inline fun <@kotlin.internal.OnlyInputTypes K, V> MutableMap.remove(key: K): V? =\n @Suppress(\"UNCHECKED_CAST\") (this as MutableMap).remove(key)\n\n/**\n * Returns the key component of the map entry.\n *\n * This method allows to use destructuring declarations when working with maps, for example:\n * ```\n * for ((key, value) in map) {\n * // do something with the key and the value\n * }\n * ```\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun Map.Entry.component1(): K = key\n\n/**\n * Returns the value component of the map entry.\n *\n * This method allows to use destructuring declarations when working with maps, for example:\n * ```\n * for ((key, value) in map) {\n * // do something with the key and the value\n * }\n * ```\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun Map.Entry.component2(): V = value\n\n/**\n * Converts entry to [Pair] with key being first component and value being second.\n */\n@kotlin.internal.InlineOnly\npublic inline fun Map.Entry.toPair(): Pair = Pair(key, value)\n\n/**\n * Returns the value for the given key, or the result of the [defaultValue] function if there was no entry for the given key.\n *\n * @sample samples.collections.Maps.Usage.getOrElse\n */\n@kotlin.internal.InlineOnly\npublic inline fun Map.getOrElse(key: K, defaultValue: () -> V): V = get(key) ?: defaultValue()\n\n\ninternal inline fun Map.getOrElseNullable(key: K, defaultValue: () -> V): V {\n val value = get(key)\n if (value == null && !containsKey(key)) {\n return defaultValue()\n } else {\n @Suppress(\"UNCHECKED_CAST\")\n return value as V\n }\n}\n\n/**\n * Returns the value for the given [key] or throws an exception if there is no such key in the map.\n *\n * If the map was created by [withDefault], resorts to its `defaultValue` provider function\n * instead of throwing an exception.\n *\n * @throws NoSuchElementException when the map doesn't contain a value for the specified key and\n * no implicit default value was provided for that map.\n */\n@SinceKotlin(\"1.1\")\npublic fun Map.getValue(key: K): V = getOrImplicitDefault(key)\n\n/**\n * Returns the value for the given key. If the key is not found in the map, calls the [defaultValue] function,\n * puts its result into the map under the given key and returns it.\n *\n * Note that the operation is not guaranteed to be atomic if the map is being modified concurrently.\n *\n * @sample samples.collections.Maps.Usage.getOrPut\n */\npublic inline fun MutableMap.getOrPut(key: K, defaultValue: () -> V): V {\n val value = get(key)\n return if (value == null) {\n val answer = defaultValue()\n put(key, answer)\n answer\n } else {\n value\n }\n}\n\n/**\n * Returns an [Iterator] over the entries in the [Map].\n *\n * @sample samples.collections.Maps.Usage.forOverEntries\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun Map.iterator(): Iterator> = entries.iterator()\n\n/**\n * Returns a [MutableIterator] over the mutable entries in the [MutableMap].\n *\n */\n@kotlin.jvm.JvmName(\"mutableIterator\")\n@kotlin.internal.InlineOnly\npublic inline operator fun MutableMap.iterator(): MutableIterator> = entries.iterator()\n\n/**\n * Populates the given [destination] map with entries having the keys of this map and the values obtained\n * by applying the [transform] function to each entry in this [Map].\n */\npublic inline fun > Map.mapValuesTo(destination: M, transform: (Map.Entry) -> R): M {\n return entries.associateByTo(destination, { it.key }, transform)\n}\n\n/**\n * Populates the given [destination] map with entries having the keys obtained\n * by applying the [transform] function to each entry in this [Map] and the values of this map.\n *\n * In case if any two entries are mapped to the equal keys, the value of the latter one will overwrite\n * the value associated with the former one.\n */\npublic inline fun > Map.mapKeysTo(destination: M, transform: (Map.Entry) -> R): M {\n return entries.associateByTo(destination, transform, { it.value })\n}\n\n/**\n * Puts all the given [pairs] into this [MutableMap] with the first component in the pair being the key and the second the value.\n */\npublic fun MutableMap.putAll(pairs: Array>): Unit {\n for ((key, value) in pairs) {\n put(key, value)\n }\n}\n\n/**\n * Puts all the elements of the given collection into this [MutableMap] with the first component in the pair being the key and the second the value.\n */\npublic fun MutableMap.putAll(pairs: Iterable>): Unit {\n for ((key, value) in pairs) {\n put(key, value)\n }\n}\n\n/**\n * Puts all the elements of the given sequence into this [MutableMap] with the first component in the pair being the key and the second the value.\n */\npublic fun MutableMap.putAll(pairs: Sequence>): Unit {\n for ((key, value) in pairs) {\n put(key, value)\n }\n}\n\n/**\n * Returns a new map with entries having the keys of this map and the values obtained by applying the [transform]\n * function to each entry in this [Map].\n *\n * The returned map preserves the entry iteration order of the original map.\n *\n * @sample samples.collections.Maps.Transformations.mapValues\n */\npublic inline fun Map.mapValues(transform: (Map.Entry) -> R): Map {\n return mapValuesTo(LinkedHashMap(mapCapacity(size)), transform) // .optimizeReadOnlyMap()\n}\n\n/**\n * Returns a new Map with entries having the keys obtained by applying the [transform] function to each entry in this\n * [Map] and the values of this map.\n *\n * In case if any two entries are mapped to the equal keys, the value of the latter one will overwrite\n * the value associated with the former one.\n *\n * The returned map preserves the entry iteration order of the original map.\n *\n * @sample samples.collections.Maps.Transformations.mapKeys\n */\npublic inline fun Map.mapKeys(transform: (Map.Entry) -> R): Map {\n return mapKeysTo(LinkedHashMap(mapCapacity(size)), transform) // .optimizeReadOnlyMap()\n}\n\n/**\n * Returns a map containing all key-value pairs with keys matching the given [predicate].\n *\n * The returned map preserves the entry iteration order of the original map.\n * @sample samples.collections.Maps.Filtering.filterKeys\n */\npublic inline fun Map.filterKeys(predicate: (K) -> Boolean): Map {\n val result = LinkedHashMap()\n for (entry in this) {\n if (predicate(entry.key)) {\n result.put(entry.key, entry.value)\n }\n }\n return result\n}\n\n/**\n * Returns a map containing all key-value pairs with values matching the given [predicate].\n *\n * The returned map preserves the entry iteration order of the original map.\n * @sample samples.collections.Maps.Filtering.filterValues\n */\npublic inline fun Map.filterValues(predicate: (V) -> Boolean): Map {\n val result = LinkedHashMap()\n for (entry in this) {\n if (predicate(entry.value)) {\n result.put(entry.key, entry.value)\n }\n }\n return result\n}\n\n\n/**\n * Appends all entries matching the given [predicate] into the mutable map given as [destination] parameter.\n *\n * @return the destination map.\n * @sample samples.collections.Maps.Filtering.filterTo\n */\npublic inline fun > Map.filterTo(destination: M, predicate: (Map.Entry) -> Boolean): M {\n for (element in this) {\n if (predicate(element)) {\n destination.put(element.key, element.value)\n }\n }\n return destination\n}\n\n/**\n * Returns a new map containing all key-value pairs matching the given [predicate].\n *\n * The returned map preserves the entry iteration order of the original map.\n * @sample samples.collections.Maps.Filtering.filter\n */\npublic inline fun Map.filter(predicate: (Map.Entry) -> Boolean): Map {\n return filterTo(LinkedHashMap(), predicate)\n}\n\n/**\n * Appends all entries not matching the given [predicate] into the given [destination].\n *\n * @return the destination map.\n * @sample samples.collections.Maps.Filtering.filterNotTo\n */\npublic inline fun > Map.filterNotTo(destination: M, predicate: (Map.Entry) -> Boolean): M {\n for (element in this) {\n if (!predicate(element)) {\n destination.put(element.key, element.value)\n }\n }\n return destination\n}\n\n/**\n * Returns a new map containing all key-value pairs not matching the given [predicate].\n *\n * The returned map preserves the entry iteration order of the original map.\n * @sample samples.collections.Maps.Filtering.filterNot\n */\npublic inline fun Map.filterNot(predicate: (Map.Entry) -> Boolean): Map {\n return filterNotTo(LinkedHashMap(), predicate)\n}\n\n/**\n * Returns a new map containing all key-value pairs from the given collection of pairs.\n *\n * The returned map preserves the entry iteration order of the original collection.\n * If any of two pairs would have the same key the last one gets added to the map.\n */\npublic fun Iterable>.toMap(): Map {\n if (this is Collection) {\n return when (size) {\n 0 -> emptyMap()\n 1 -> mapOf(if (this is List) this[0] else iterator().next())\n else -> toMap(LinkedHashMap(mapCapacity(size)))\n }\n }\n return toMap(LinkedHashMap()).optimizeReadOnlyMap()\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs from the given collection of pairs.\n */\npublic fun > Iterable>.toMap(destination: M): M =\n destination.apply { putAll(this@toMap) }\n\n/**\n * Returns a new map containing all key-value pairs from the given array of pairs.\n *\n * The returned map preserves the entry iteration order of the original array.\n * If any of two pairs would have the same key the last one gets added to the map.\n */\npublic fun Array>.toMap(): Map = when (size) {\n 0 -> emptyMap()\n 1 -> mapOf(this[0])\n else -> toMap(LinkedHashMap(mapCapacity(size)))\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs from the given array of pairs.\n */\npublic fun > Array>.toMap(destination: M): M =\n destination.apply { putAll(this@toMap) }\n\n/**\n * Returns a new map containing all key-value pairs from the given sequence of pairs.\n *\n * The returned map preserves the entry iteration order of the original sequence.\n * If any of two pairs would have the same key the last one gets added to the map.\n */\npublic fun Sequence>.toMap(): Map = toMap(LinkedHashMap()).optimizeReadOnlyMap()\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs from the given sequence of pairs.\n */\npublic fun > Sequence>.toMap(destination: M): M =\n destination.apply { putAll(this@toMap) }\n\n/**\n * Returns a new read-only map containing all key-value pairs from the original map.\n *\n * The returned map preserves the entry iteration order of the original map.\n */\n@SinceKotlin(\"1.1\")\npublic fun Map.toMap(): Map = when (size) {\n 0 -> emptyMap()\n 1 -> toSingletonMap()\n else -> toMutableMap()\n}\n\n/**\n * Returns a new mutable map containing all key-value pairs from the original map.\n *\n * The returned map preserves the entry iteration order of the original map.\n */\n@SinceKotlin(\"1.1\")\npublic fun Map.toMutableMap(): MutableMap = LinkedHashMap(this)\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs from the given map.\n */\n@SinceKotlin(\"1.1\")\npublic fun > Map.toMap(destination: M): M =\n destination.apply { putAll(this@toMap) }\n\n/**\n * Creates a new read-only map by replacing or adding an entry to this map from a given key-value [pair].\n *\n * The returned map preserves the entry iteration order of the original map.\n * The [pair] is iterated in the end if it has a unique key.\n */\npublic operator fun Map.plus(pair: Pair): Map =\n if (this.isEmpty()) mapOf(pair) else LinkedHashMap(this).apply { put(pair.first, pair.second) }\n\n/**\n * Creates a new read-only map by replacing or adding entries to this map from a given collection of key-value [pairs].\n *\n * The returned map preserves the entry iteration order of the original map.\n * Those [pairs] with unique keys are iterated in the end in the order of [pairs] collection.\n */\npublic operator fun Map.plus(pairs: Iterable>): Map =\n if (this.isEmpty()) pairs.toMap() else LinkedHashMap(this).apply { putAll(pairs) }\n\n/**\n * Creates a new read-only map by replacing or adding entries to this map from a given array of key-value [pairs].\n *\n * The returned map preserves the entry iteration order of the original map.\n * Those [pairs] with unique keys are iterated in the end in the order of [pairs] array.\n */\npublic operator fun Map.plus(pairs: Array>): Map =\n if (this.isEmpty()) pairs.toMap() else LinkedHashMap(this).apply { putAll(pairs) }\n\n/**\n * Creates a new read-only map by replacing or adding entries to this map from a given sequence of key-value [pairs].\n *\n * The returned map preserves the entry iteration order of the original map.\n * Those [pairs] with unique keys are iterated in the end in the order of [pairs] sequence.\n */\npublic operator fun Map.plus(pairs: Sequence>): Map =\n LinkedHashMap(this).apply { putAll(pairs) }.optimizeReadOnlyMap()\n\n/**\n * Creates a new read-only map by replacing or adding entries to this map from another [map].\n *\n * The returned map preserves the entry iteration order of the original map.\n * Those entries of another [map] that are missing in this map are iterated in the end in the order of that [map].\n */\npublic operator fun Map.plus(map: Map): Map =\n LinkedHashMap(this).apply { putAll(map) }\n\n\n/**\n * Appends or replaces the given [pair] in this mutable map.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun MutableMap.plusAssign(pair: Pair) {\n put(pair.first, pair.second)\n}\n\n/**\n * Appends or replaces all pairs from the given collection of [pairs] in this mutable map.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun MutableMap.plusAssign(pairs: Iterable>) {\n putAll(pairs)\n}\n\n/**\n * Appends or replaces all pairs from the given array of [pairs] in this mutable map.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun MutableMap.plusAssign(pairs: Array>) {\n putAll(pairs)\n}\n\n/**\n * Appends or replaces all pairs from the given sequence of [pairs] in this mutable map.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun MutableMap.plusAssign(pairs: Sequence>) {\n putAll(pairs)\n}\n\n/**\n * Appends or replaces all entries from the given [map] in this mutable map.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun MutableMap.plusAssign(map: Map) {\n putAll(map)\n}\n\n/**\n * Returns a map containing all entries of the original map except the entry with the given [key].\n *\n * The returned map preserves the entry iteration order of the original map.\n */\n@SinceKotlin(\"1.1\")\npublic operator fun Map.minus(key: K): Map =\n this.toMutableMap().apply { minusAssign(key) }.optimizeReadOnlyMap()\n\n/**\n * Returns a map containing all entries of the original map except those entries\n * the keys of which are contained in the given [keys] collection.\n *\n * The returned map preserves the entry iteration order of the original map.\n */\n@SinceKotlin(\"1.1\")\npublic operator fun Map.minus(keys: Iterable): Map =\n this.toMutableMap().apply { minusAssign(keys) }.optimizeReadOnlyMap()\n\n/**\n * Returns a map containing all entries of the original map except those entries\n * the keys of which are contained in the given [keys] array.\n *\n * The returned map preserves the entry iteration order of the original map.\n */\n@SinceKotlin(\"1.1\")\npublic operator fun Map.minus(keys: Array): Map =\n this.toMutableMap().apply { minusAssign(keys) }.optimizeReadOnlyMap()\n\n/**\n * Returns a map containing all entries of the original map except those entries\n * the keys of which are contained in the given [keys] sequence.\n *\n * The returned map preserves the entry iteration order of the original map.\n */\n@SinceKotlin(\"1.1\")\npublic operator fun Map.minus(keys: Sequence): Map =\n this.toMutableMap().apply { minusAssign(keys) }.optimizeReadOnlyMap()\n\n/**\n * Removes the entry with the given [key] from this mutable map.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline operator fun MutableMap.minusAssign(key: K) {\n remove(key)\n}\n\n/**\n * Removes all entries the keys of which are contained in the given [keys] collection from this mutable map.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline operator fun MutableMap.minusAssign(keys: Iterable) {\n this.keys.removeAll(keys)\n}\n\n/**\n * Removes all entries the keys of which are contained in the given [keys] array from this mutable map.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline operator fun MutableMap.minusAssign(keys: Array) {\n this.keys.removeAll(keys)\n}\n\n/**\n * Removes all entries from the keys of which are contained in the given [keys] sequence from this mutable map.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline operator fun MutableMap.minusAssign(keys: Sequence) {\n this.keys.removeAll(keys)\n}\n\n\n// do not expose for now @PublishedApi\ninternal fun Map.optimizeReadOnlyMap() = when (size) {\n 0 -> emptyMap()\n 1 -> toSingletonMapOrSelf()\n else -> this\n}\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"StringsKt\")\n@file:Suppress(\"PLATFORM_CLASS_MAPPED_TO_KOTLIN\")\n\npackage kotlin.text\n\n/**\n * Parses the string as a signed [Byte] number and returns the result\n * or `null` if the string is not a valid representation of a number.\n */\n@SinceKotlin(\"1.1\")\npublic fun String.toByteOrNull(): Byte? = toByteOrNull(radix = 10)\n\n/**\n * Parses the string as a signed [Byte] number and returns the result\n * or `null` if the string is not a valid representation of a number.\n *\n * @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion.\n */\n@SinceKotlin(\"1.1\")\npublic fun String.toByteOrNull(radix: Int): Byte? {\n val int = this.toIntOrNull(radix) ?: return null\n if (int < Byte.MIN_VALUE || int > Byte.MAX_VALUE) return null\n return int.toByte()\n}\n\n/**\n * Parses the string as a [Short] number and returns the result\n * or `null` if the string is not a valid representation of a number.\n */\n@SinceKotlin(\"1.1\")\npublic fun String.toShortOrNull(): Short? = toShortOrNull(radix = 10)\n\n/**\n * Parses the string as a [Short] number and returns the result\n * or `null` if the string is not a valid representation of a number.\n *\n * @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion.\n */\n@SinceKotlin(\"1.1\")\npublic fun String.toShortOrNull(radix: Int): Short? {\n val int = this.toIntOrNull(radix) ?: return null\n if (int < Short.MIN_VALUE || int > Short.MAX_VALUE) return null\n return int.toShort()\n}\n\n/**\n * Parses the string as an [Int] number and returns the result\n * or `null` if the string is not a valid representation of a number.\n */\n@SinceKotlin(\"1.1\")\npublic fun String.toIntOrNull(): Int? = toIntOrNull(radix = 10)\n\n/**\n * Parses the string as an [Int] number and returns the result\n * or `null` if the string is not a valid representation of a number.\n *\n * @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion.\n */\n@SinceKotlin(\"1.1\")\npublic fun String.toIntOrNull(radix: Int): Int? {\n checkRadix(radix)\n\n val length = this.length\n if (length == 0) return null\n\n val start: Int\n val isNegative: Boolean\n val limit: Int\n\n val firstChar = this[0]\n if (firstChar < '0') { // Possible leading sign\n if (length == 1) return null // non-digit (possible sign) only, no digits after\n\n start = 1\n\n if (firstChar == '-') {\n isNegative = true\n limit = Int.MIN_VALUE\n } else if (firstChar == '+') {\n isNegative = false\n limit = -Int.MAX_VALUE\n } else\n return null\n } else {\n start = 0\n isNegative = false\n limit = -Int.MAX_VALUE\n }\n\n\n val limitForMaxRadix = (-Int.MAX_VALUE) / 36\n\n var limitBeforeMul = limitForMaxRadix\n var result = 0\n for (i in start until length) {\n val digit = digitOf(this[i], radix)\n\n if (digit < 0) return null\n if (result < limitBeforeMul) {\n if (limitBeforeMul == limitForMaxRadix) {\n limitBeforeMul = limit / radix\n\n if (result < limitBeforeMul) {\n return null\n }\n } else {\n return null\n }\n }\n\n result *= radix\n\n if (result < limit + digit) return null\n\n result -= digit\n }\n\n return if (isNegative) result else -result\n}\n\n/**\n * Parses the string as a [Long] number and returns the result\n * or `null` if the string is not a valid representation of a number.\n */\n@SinceKotlin(\"1.1\")\npublic fun String.toLongOrNull(): Long? = toLongOrNull(radix = 10)\n\n/**\n * Parses the string as a [Long] number and returns the result\n * or `null` if the string is not a valid representation of a number.\n *\n * @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion.\n */\n@SinceKotlin(\"1.1\")\npublic fun String.toLongOrNull(radix: Int): Long? {\n checkRadix(radix)\n\n val length = this.length\n if (length == 0) return null\n\n val start: Int\n val isNegative: Boolean\n val limit: Long\n\n val firstChar = this[0]\n if (firstChar < '0') { // Possible leading sign\n if (length == 1) return null // non-digit (possible sign) only, no digits after\n\n start = 1\n\n if (firstChar == '-') {\n isNegative = true\n limit = Long.MIN_VALUE\n } else if (firstChar == '+') {\n isNegative = false\n limit = -Long.MAX_VALUE\n } else\n return null\n } else {\n start = 0\n isNegative = false\n limit = -Long.MAX_VALUE\n }\n\n\n val limitForMaxRadix = (-Long.MAX_VALUE) / 36\n\n var limitBeforeMul = limitForMaxRadix\n var result = 0L\n for (i in start until length) {\n val digit = digitOf(this[i], radix)\n\n if (digit < 0) return null\n if (result < limitBeforeMul) {\n if (limitBeforeMul == limitForMaxRadix) {\n limitBeforeMul = limit / radix\n\n if (result < limitBeforeMul) {\n return null\n }\n } else {\n return null\n }\n }\n\n result *= radix\n\n if (result < limit + digit) return null\n\n result -= digit\n }\n\n return if (isNegative) result else -result\n}\n\n\ninternal fun numberFormatError(input: String): Nothing = throw NumberFormatException(\"Invalid number format: '$input'\")\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.time\n\nimport kotlin.contracts.*\nimport kotlin.jvm.JvmInline\nimport kotlin.math.*\n\n/**\n * Represents the amount of time one instant of time is away from another instant.\n *\n * A negative duration is possible in a situation when the second instant is earlier than the first one.\n *\n * The type can store duration values up to ±146 years with nanosecond precision,\n * and up to ±146 million years with millisecond precision.\n * If a duration-returning operation provided in `kotlin.time` produces a duration value that doesn't fit into the above range,\n * the returned `Duration` is infinite.\n *\n * An infinite duration value [Duration.INFINITE] can be used to represent infinite timeouts.\n *\n * To construct a duration use either the extension function [toDuration],\n * or the extension properties [hours], [minutes], [seconds], and so on,\n * available on [Int], [Long], and [Double] numeric types.\n *\n * To get the value of this duration expressed in a particular [duration units][DurationUnit]\n * use the functions [toInt], [toLong], and [toDouble]\n * or the properties [inWholeHours], [inWholeMinutes], [inWholeSeconds], [inWholeNanoseconds], and so on.\n */\n@SinceKotlin(\"1.6\")\n@WasExperimental(ExperimentalTime::class)\n@JvmInline\npublic value class Duration internal constructor(private val rawValue: Long) : Comparable {\n\n private val value: Long get() = rawValue shr 1\n private inline val unitDiscriminator: Int get() = rawValue.toInt() and 1\n private fun isInNanos() = unitDiscriminator == 0\n private fun isInMillis() = unitDiscriminator == 1\n private val storageUnit get() = if (isInNanos()) DurationUnit.NANOSECONDS else DurationUnit.MILLISECONDS\n\n init {\n if (durationAssertionsEnabled) {\n if (isInNanos()) {\n if (value !in -MAX_NANOS..MAX_NANOS) throw AssertionError(\"$value ns is out of nanoseconds range\")\n } else {\n if (value !in -MAX_MILLIS..MAX_MILLIS) throw AssertionError(\"$value ms is out of milliseconds range\")\n if (value in -MAX_NANOS_IN_MILLIS..MAX_NANOS_IN_MILLIS) throw AssertionError(\"$value ms is denormalized\")\n }\n }\n }\n\n companion object {\n /** The duration equal to exactly 0 seconds. */\n public val ZERO: Duration = Duration(0L)\n\n /** The duration whose value is positive infinity. It is useful for representing timeouts that should never expire. */\n public val INFINITE: Duration = durationOfMillis(MAX_MILLIS)\n internal val NEG_INFINITE: Duration = durationOfMillis(-MAX_MILLIS)\n\n /** Converts the given time duration [value] expressed in the specified [sourceUnit] into the specified [targetUnit]. */\n @ExperimentalTime\n public fun convert(value: Double, sourceUnit: DurationUnit, targetUnit: DurationUnit): Double =\n convertDurationUnit(value, sourceUnit, targetUnit)\n\n // Duration construction extension properties in Duration companion scope\n\n /** Returns a [Duration] equal to this [Int] number of nanoseconds. */\n @kotlin.internal.InlineOnly\n public inline val Int.nanoseconds get() = toDuration(DurationUnit.NANOSECONDS)\n\n /** Returns a [Duration] equal to this [Long] number of nanoseconds. */\n @kotlin.internal.InlineOnly\n public inline val Long.nanoseconds get() = toDuration(DurationUnit.NANOSECONDS)\n\n /**\n * Returns a [Duration] equal to this [Double] number of nanoseconds.\n *\n * Depending on its magnitude, the value is rounded to an integer number of nanoseconds or milliseconds.\n *\n * @throws IllegalArgumentException if this [Double] value is `NaN`.\n */\n @kotlin.internal.InlineOnly\n public inline val Double.nanoseconds get() = toDuration(DurationUnit.NANOSECONDS)\n\n\n /** Returns a [Duration] equal to this [Int] number of microseconds. */\n @kotlin.internal.InlineOnly\n public inline val Int.microseconds get() = toDuration(DurationUnit.MICROSECONDS)\n\n /** Returns a [Duration] equal to this [Long] number of microseconds. */\n @kotlin.internal.InlineOnly\n public inline val Long.microseconds get() = toDuration(DurationUnit.MICROSECONDS)\n\n /**\n * Returns a [Duration] equal to this [Double] number of microseconds.\n *\n * Depending on its magnitude, the value is rounded to an integer number of nanoseconds or milliseconds.\n *\n * @throws IllegalArgumentException if this [Double] value is `NaN`.\n */\n @kotlin.internal.InlineOnly\n public inline val Double.microseconds get() = toDuration(DurationUnit.MICROSECONDS)\n\n\n /** Returns a [Duration] equal to this [Int] number of milliseconds. */\n @kotlin.internal.InlineOnly\n public inline val Int.milliseconds get() = toDuration(DurationUnit.MILLISECONDS)\n\n /** Returns a [Duration] equal to this [Long] number of milliseconds. */\n @kotlin.internal.InlineOnly\n public inline val Long.milliseconds get() = toDuration(DurationUnit.MILLISECONDS)\n\n /**\n * Returns a [Duration] equal to this [Double] number of milliseconds.\n *\n * Depending on its magnitude, the value is rounded to an integer number of nanoseconds or milliseconds.\n *\n * @throws IllegalArgumentException if this [Double] value is `NaN`.\n */\n @kotlin.internal.InlineOnly\n public inline val Double.milliseconds get() = toDuration(DurationUnit.MILLISECONDS)\n\n\n /** Returns a [Duration] equal to this [Int] number of seconds. */\n @kotlin.internal.InlineOnly\n public inline val Int.seconds get() = toDuration(DurationUnit.SECONDS)\n\n /** Returns a [Duration] equal to this [Long] number of seconds. */\n @kotlin.internal.InlineOnly\n public inline val Long.seconds get() = toDuration(DurationUnit.SECONDS)\n\n /**\n * Returns a [Duration] equal to this [Double] number of seconds.\n *\n * Depending on its magnitude, the value is rounded to an integer number of nanoseconds or milliseconds.\n *\n * @throws IllegalArgumentException if this [Double] value is `NaN`.\n */\n @kotlin.internal.InlineOnly\n public inline val Double.seconds get() = toDuration(DurationUnit.SECONDS)\n\n\n /** Returns a [Duration] equal to this [Int] number of minutes. */\n @kotlin.internal.InlineOnly\n public inline val Int.minutes get() = toDuration(DurationUnit.MINUTES)\n\n /** Returns a [Duration] equal to this [Long] number of minutes. */\n @kotlin.internal.InlineOnly\n public inline val Long.minutes get() = toDuration(DurationUnit.MINUTES)\n\n /**\n * Returns a [Duration] equal to this [Double] number of minutes.\n *\n * Depending on its magnitude, the value is rounded to an integer number of nanoseconds or milliseconds.\n *\n * @throws IllegalArgumentException if this [Double] value is `NaN`.\n */\n @kotlin.internal.InlineOnly\n public inline val Double.minutes get() = toDuration(DurationUnit.MINUTES)\n\n\n /** Returns a [Duration] equal to this [Int] number of hours. */\n @kotlin.internal.InlineOnly\n public inline val Int.hours get() = toDuration(DurationUnit.HOURS)\n\n /** Returns a [Duration] equal to this [Long] number of hours. */\n @kotlin.internal.InlineOnly\n public inline val Long.hours get() = toDuration(DurationUnit.HOURS)\n\n /**\n * Returns a [Duration] equal to this [Double] number of hours.\n *\n * Depending on its magnitude, the value is rounded to an integer number of nanoseconds or milliseconds.\n *\n * @throws IllegalArgumentException if this [Double] value is `NaN`.\n */\n @kotlin.internal.InlineOnly\n public inline val Double.hours get() = toDuration(DurationUnit.HOURS)\n\n\n /** Returns a [Duration] equal to this [Int] number of days. */\n @kotlin.internal.InlineOnly\n public inline val Int.days get() = toDuration(DurationUnit.DAYS)\n\n /** Returns a [Duration] equal to this [Long] number of days. */\n @kotlin.internal.InlineOnly\n public inline val Long.days get() = toDuration(DurationUnit.DAYS)\n\n /**\n * Returns a [Duration] equal to this [Double] number of days.\n *\n * Depending on its magnitude, the value is rounded to an integer number of nanoseconds or milliseconds.\n *\n * @throws IllegalArgumentException if this [Double] value is `NaN`.\n */\n @kotlin.internal.InlineOnly\n public inline val Double.days get() = toDuration(DurationUnit.DAYS)\n\n\n // deprecated static factory functions\n\n /** Returns a [Duration] representing the specified [value] number of nanoseconds. */\n @SinceKotlin(\"1.5\")\n @ExperimentalTime\n @Deprecated(\"Use 'Int.nanoseconds' extension property from Duration.Companion instead.\", ReplaceWith(\"value.nanoseconds\", \"kotlin.time.Duration.Companion.nanoseconds\"))\n @DeprecatedSinceKotlin(warningSince = \"1.6\")\n public fun nanoseconds(value: Int): Duration = value.toDuration(DurationUnit.NANOSECONDS)\n\n /** Returns a [Duration] representing the specified [value] number of nanoseconds. */\n @SinceKotlin(\"1.5\")\n @ExperimentalTime\n @Deprecated(\"Use 'Long.nanoseconds' extension property from Duration.Companion instead.\", ReplaceWith(\"value.nanoseconds\", \"kotlin.time.Duration.Companion.nanoseconds\"))\n @DeprecatedSinceKotlin(warningSince = \"1.6\")\n public fun nanoseconds(value: Long): Duration = value.toDuration(DurationUnit.NANOSECONDS)\n\n /**\n * Returns a [Duration] representing the specified [value] number of nanoseconds.\n *\n * @throws IllegalArgumentException if the provided `Double` [value] is `NaN`.\n */\n @SinceKotlin(\"1.5\")\n @ExperimentalTime\n @Deprecated(\"Use 'Double.nanoseconds' extension property from Duration.Companion instead.\", ReplaceWith(\"value.nanoseconds\", \"kotlin.time.Duration.Companion.nanoseconds\"))\n @DeprecatedSinceKotlin(warningSince = \"1.6\")\n public fun nanoseconds(value: Double): Duration = value.toDuration(DurationUnit.NANOSECONDS)\n\n\n /** Returns a [Duration] representing the specified [value] number of microseconds. */\n @SinceKotlin(\"1.5\")\n @ExperimentalTime\n @Deprecated(\"Use 'Int.microseconds' extension property from Duration.Companion instead.\", ReplaceWith(\"value.microseconds\", \"kotlin.time.Duration.Companion.microseconds\"))\n @DeprecatedSinceKotlin(warningSince = \"1.6\")\n public fun microseconds(value: Int): Duration = value.toDuration(DurationUnit.MICROSECONDS)\n\n /** Returns a [Duration] representing the specified [value] number of microseconds. */\n @SinceKotlin(\"1.5\")\n @ExperimentalTime\n @Deprecated(\"Use 'Long.microseconds' extension property from Duration.Companion instead.\", ReplaceWith(\"value.microseconds\", \"kotlin.time.Duration.Companion.microseconds\"))\n @DeprecatedSinceKotlin(warningSince = \"1.6\")\n public fun microseconds(value: Long): Duration = value.toDuration(DurationUnit.MICROSECONDS)\n\n /**\n * Returns a [Duration] representing the specified [value] number of microseconds.\n *\n * @throws IllegalArgumentException if the provided `Double` [value] is `NaN`.\n */\n @SinceKotlin(\"1.5\")\n @ExperimentalTime\n @Deprecated(\"Use 'Double.microseconds' extension property from Duration.Companion instead.\", ReplaceWith(\"value.microseconds\", \"kotlin.time.Duration.Companion.microseconds\"))\n @DeprecatedSinceKotlin(warningSince = \"1.6\")\n public fun microseconds(value: Double): Duration = value.toDuration(DurationUnit.MICROSECONDS)\n\n\n /** Returns a [Duration] representing the specified [value] number of milliseconds. */\n @SinceKotlin(\"1.5\")\n @ExperimentalTime\n @Deprecated(\"Use 'Int.milliseconds' extension property from Duration.Companion instead.\", ReplaceWith(\"value.milliseconds\", \"kotlin.time.Duration.Companion.milliseconds\"))\n @DeprecatedSinceKotlin(warningSince = \"1.6\")\n public fun milliseconds(value: Int): Duration = value.toDuration(DurationUnit.MILLISECONDS)\n\n /** Returns a [Duration] representing the specified [value] number of milliseconds. */\n @SinceKotlin(\"1.5\")\n @ExperimentalTime\n @Deprecated(\"Use 'Long.milliseconds' extension property from Duration.Companion instead.\", ReplaceWith(\"value.milliseconds\", \"kotlin.time.Duration.Companion.milliseconds\"))\n @DeprecatedSinceKotlin(warningSince = \"1.6\")\n public fun milliseconds(value: Long): Duration = value.toDuration(DurationUnit.MILLISECONDS)\n\n /**\n * Returns a [Duration] representing the specified [value] number of milliseconds.\n *\n * @throws IllegalArgumentException if the provided `Double` [value] is `NaN`.\n */\n @SinceKotlin(\"1.5\")\n @ExperimentalTime\n @Deprecated(\"Use 'Double.milliseconds' extension property from Duration.Companion instead.\", ReplaceWith(\"value.milliseconds\", \"kotlin.time.Duration.Companion.milliseconds\"))\n @DeprecatedSinceKotlin(warningSince = \"1.6\")\n public fun milliseconds(value: Double): Duration = value.toDuration(DurationUnit.MILLISECONDS)\n\n\n /** Returns a [Duration] representing the specified [value] number of seconds. */\n @SinceKotlin(\"1.5\")\n @ExperimentalTime\n @Deprecated(\"Use 'Int.seconds' extension property from Duration.Companion instead.\", ReplaceWith(\"value.seconds\", \"kotlin.time.Duration.Companion.seconds\"))\n @DeprecatedSinceKotlin(warningSince = \"1.6\")\n public fun seconds(value: Int): Duration = value.toDuration(DurationUnit.SECONDS)\n\n /** Returns a [Duration] representing the specified [value] number of seconds. */\n @SinceKotlin(\"1.5\")\n @ExperimentalTime\n @Deprecated(\"Use 'Long.seconds' extension property from Duration.Companion instead.\", ReplaceWith(\"value.seconds\", \"kotlin.time.Duration.Companion.seconds\"))\n @DeprecatedSinceKotlin(warningSince = \"1.6\")\n public fun seconds(value: Long): Duration = value.toDuration(DurationUnit.SECONDS)\n\n /**\n * Returns a [Duration] representing the specified [value] number of seconds.\n *\n * @throws IllegalArgumentException if the provided `Double` [value] is `NaN`.\n */\n @SinceKotlin(\"1.5\")\n @ExperimentalTime\n @Deprecated(\"Use 'Double.seconds' extension property from Duration.Companion instead.\", ReplaceWith(\"value.seconds\", \"kotlin.time.Duration.Companion.seconds\"))\n @DeprecatedSinceKotlin(warningSince = \"1.6\")\n public fun seconds(value: Double): Duration = value.toDuration(DurationUnit.SECONDS)\n\n\n /** Returns a [Duration] representing the specified [value] number of minutes. */\n @SinceKotlin(\"1.5\")\n @ExperimentalTime\n @Deprecated(\"Use 'Int.minutes' extension property from Duration.Companion instead.\", ReplaceWith(\"value.minutes\", \"kotlin.time.Duration.Companion.minutes\"))\n @DeprecatedSinceKotlin(warningSince = \"1.6\")\n public fun minutes(value: Int): Duration = value.toDuration(DurationUnit.MINUTES)\n\n /** Returns a [Duration] representing the specified [value] number of minutes. */\n @SinceKotlin(\"1.5\")\n @ExperimentalTime\n @Deprecated(\"Use 'Long.minutes' extension property from Duration.Companion instead.\", ReplaceWith(\"value.minutes\", \"kotlin.time.Duration.Companion.minutes\"))\n @DeprecatedSinceKotlin(warningSince = \"1.6\")\n public fun minutes(value: Long): Duration = value.toDuration(DurationUnit.MINUTES)\n\n /**\n * Returns a [Duration] representing the specified [value] number of minutes.\n *\n * @throws IllegalArgumentException if the provided `Double` [value] is `NaN`.\n */\n @SinceKotlin(\"1.5\")\n @ExperimentalTime\n @Deprecated(\"Use 'Double.minutes' extension property from Duration.Companion instead.\", ReplaceWith(\"value.minutes\", \"kotlin.time.Duration.Companion.minutes\"))\n @DeprecatedSinceKotlin(warningSince = \"1.6\")\n public fun minutes(value: Double): Duration = value.toDuration(DurationUnit.MINUTES)\n\n\n /** Returns a [Duration] representing the specified [value] number of hours. */\n @SinceKotlin(\"1.5\")\n @ExperimentalTime\n @Deprecated(\"Use 'Int.hours' extension property from Duration.Companion instead.\", ReplaceWith(\"value.hours\", \"kotlin.time.Duration.Companion.hours\"))\n @DeprecatedSinceKotlin(warningSince = \"1.6\")\n public fun hours(value: Int): Duration = value.toDuration(DurationUnit.HOURS)\n\n /** Returns a [Duration] representing the specified [value] number of hours. */\n @SinceKotlin(\"1.5\")\n @ExperimentalTime\n @Deprecated(\"Use 'Long.hours' extension property from Duration.Companion instead.\", ReplaceWith(\"value.hours\", \"kotlin.time.Duration.Companion.hours\"))\n @DeprecatedSinceKotlin(warningSince = \"1.6\")\n public fun hours(value: Long): Duration = value.toDuration(DurationUnit.HOURS)\n\n /**\n * Returns a [Duration] representing the specified [value] number of hours.\n *\n * @throws IllegalArgumentException if the provided `Double` [value] is `NaN`.\n */\n @SinceKotlin(\"1.5\")\n @ExperimentalTime\n @Deprecated(\"Use 'Double.hours' extension property from Duration.Companion instead.\", ReplaceWith(\"value.hours\", \"kotlin.time.Duration.Companion.hours\"))\n @DeprecatedSinceKotlin(warningSince = \"1.6\")\n public fun hours(value: Double): Duration = value.toDuration(DurationUnit.HOURS)\n\n\n /** Returns a [Duration] representing the specified [value] number of days. */\n @SinceKotlin(\"1.5\")\n @ExperimentalTime\n @Deprecated(\"Use 'Int.days' extension property from Duration.Companion instead.\", ReplaceWith(\"value.days\", \"kotlin.time.Duration.Companion.days\"))\n @DeprecatedSinceKotlin(warningSince = \"1.6\")\n public fun days(value: Int): Duration = value.toDuration(DurationUnit.DAYS)\n\n /** Returns a [Duration] representing the specified [value] number of days. */\n @SinceKotlin(\"1.5\")\n @ExperimentalTime\n @Deprecated(\"Use 'Long.days' extension property from Duration.Companion instead.\", ReplaceWith(\"value.days\", \"kotlin.time.Duration.Companion.days\"))\n @DeprecatedSinceKotlin(warningSince = \"1.6\")\n public fun days(value: Long): Duration = value.toDuration(DurationUnit.DAYS)\n\n /**\n * Returns a [Duration] representing the specified [value] number of days.\n *\n * @throws IllegalArgumentException if the provided `Double` [value] is `NaN`.\n */\n @SinceKotlin(\"1.5\")\n @ExperimentalTime\n @Deprecated(\"Use 'Double.days' extension property from Duration.Companion instead.\", ReplaceWith(\"value.days\", \"kotlin.time.Duration.Companion.days\"))\n @DeprecatedSinceKotlin(warningSince = \"1.6\")\n public fun days(value: Double): Duration = value.toDuration(DurationUnit.DAYS)\n\n /**\n * Parses a string that represents a duration and returns the parsed [Duration] value.\n *\n * The following formats are accepted:\n *\n * - ISO-8601 Duration format, e.g. `P1DT2H3M4.058S`, see [toIsoString] and [parseIsoString].\n * - The format of string returned by the default [Duration.toString] and `toString` in a specific unit,\n * e.g. `10s`, `1h 30m` or `-(1h 30m)`.\n *\n * @throws IllegalArgumentException if the string doesn't represent a duration in any of the supported formats.\n * @sample samples.time.Durations.parse\n */\n public fun parse(value: String): Duration = try {\n parseDuration(value, strictIso = false)\n } catch (e: IllegalArgumentException) {\n throw IllegalArgumentException(\"Invalid duration string format: '$value'.\", e)\n }\n\n /**\n * Parses a string that represents a duration in a restricted ISO-8601 composite representation\n * and returns the parsed [Duration] value.\n * Composite representation is a relaxed version of ISO-8601 duration format that supports\n * negative durations and negative values of individual components.\n *\n * The following restrictions are imposed:\n *\n * - The only allowed non-time designator is days (`D`). `Y` (years), `W` (weeks), and `M` (months) are not supported.\n * - Day is considered to be exactly 24 hours (24-hour clock time scale).\n * - Alternative week-based representation `[\"P\"][number][\"W\"]` is not supported.\n *\n * @throws IllegalArgumentException if the string doesn't represent a duration in ISO-8601 format.\n * @sample samples.time.Durations.parseIsoString\n */\n public fun parseIsoString(value: String): Duration = try {\n parseDuration(value, strictIso = true)\n } catch (e: IllegalArgumentException) {\n throw IllegalArgumentException(\"Invalid ISO duration string format: '$value'.\", e)\n }\n\n /**\n * Parses a string that represents a duration and returns the parsed [Duration] value,\n * or `null` if the string doesn't represent a duration in any of the supported formats.\n *\n * The following formats are accepted:\n *\n * - Restricted ISO-8601 duration composite representation, e.g. `P1DT2H3M4.058S`, see [toIsoString] and [parseIsoString].\n * - The format of string returned by the default [Duration.toString] and `toString` in a specific unit,\n * e.g. `10s`, `1h 30m` or `-(1h 30m)`.\n * @sample samples.time.Durations.parse\n */\n public fun parseOrNull(value: String): Duration? = try {\n parseDuration(value, strictIso = false)\n } catch (e: IllegalArgumentException) {\n null\n }\n\n /**\n * Parses a string that represents a duration in restricted ISO-8601 composite representation\n * and returns the parsed [Duration] value or `null` if the string doesn't represent a duration in the format\n * acceptable by [parseIsoString].\n *\n * @sample samples.time.Durations.parseIsoString\n */\n public fun parseIsoStringOrNull(value: String): Duration? = try {\n parseDuration(value, strictIso = true)\n } catch (e: IllegalArgumentException) {\n null\n }\n }\n\n // arithmetic operators\n\n /** Returns the negative of this value. */\n public operator fun unaryMinus(): Duration = durationOf(-value, unitDiscriminator)\n\n /**\n * Returns a duration whose value is the sum of this and [other] duration values.\n *\n * @throws IllegalArgumentException if the operation results in an undefined value for the given arguments,\n * e.g. when adding infinite durations of different sign.\n */\n public operator fun plus(other: Duration): Duration {\n when {\n this.isInfinite() -> {\n if (other.isFinite() || (this.rawValue xor other.rawValue >= 0))\n return this\n else\n throw IllegalArgumentException(\"Summing infinite durations of different signs yields an undefined result.\")\n }\n other.isInfinite() -> return other\n }\n\n return when {\n this.unitDiscriminator == other.unitDiscriminator -> {\n val result = this.value + other.value // never overflows long, but can overflow long63\n when {\n isInNanos() ->\n durationOfNanosNormalized(result)\n else ->\n durationOfMillisNormalized(result)\n }\n }\n this.isInMillis() ->\n addValuesMixedRanges(this.value, other.value)\n else ->\n addValuesMixedRanges(other.value, this.value)\n }\n }\n\n private fun addValuesMixedRanges(thisMillis: Long, otherNanos: Long): Duration {\n val otherMillis = nanosToMillis(otherNanos)\n val resultMillis = thisMillis + otherMillis\n return if (resultMillis in -MAX_NANOS_IN_MILLIS..MAX_NANOS_IN_MILLIS) {\n val otherNanoRemainder = otherNanos - millisToNanos(otherMillis)\n durationOfNanos(millisToNanos(resultMillis) + otherNanoRemainder)\n } else {\n durationOfMillis(resultMillis.coerceIn(-MAX_MILLIS, MAX_MILLIS))\n }\n }\n\n /**\n * Returns a duration whose value is the difference between this and [other] duration values.\n *\n * @throws IllegalArgumentException if the operation results in an undefined value for the given arguments,\n * e.g. when subtracting infinite durations of the same sign.\n */\n public operator fun minus(other: Duration): Duration = this + (-other)\n\n /**\n * Returns a duration whose value is this duration value multiplied by the given [scale] number.\n *\n * @throws IllegalArgumentException if the operation results in an undefined value for the given arguments,\n * e.g. when multiplying an infinite duration by zero.\n */\n public operator fun times(scale: Int): Duration {\n if (isInfinite()) {\n return when {\n scale == 0 -> throw IllegalArgumentException(\"Multiplying infinite duration by zero yields an undefined result.\")\n scale > 0 -> this\n else -> -this\n }\n }\n if (scale == 0) return ZERO\n\n val value = value\n val result = value * scale\n return if (isInNanos()) {\n if (value in (MAX_NANOS / Int.MIN_VALUE)..(-MAX_NANOS / Int.MIN_VALUE)) {\n // can't overflow nanos range for any scale\n durationOfNanos(result)\n } else {\n if (result / scale == value) {\n durationOfNanosNormalized(result)\n } else {\n val millis = nanosToMillis(value)\n val remNanos = value - millisToNanos(millis)\n val resultMillis = millis * scale\n val totalMillis = resultMillis + nanosToMillis(remNanos * scale)\n if (resultMillis / scale == millis && totalMillis xor resultMillis >= 0) {\n durationOfMillis(totalMillis.coerceIn(-MAX_MILLIS..MAX_MILLIS))\n } else {\n if (value.sign * scale.sign > 0) INFINITE else NEG_INFINITE\n }\n }\n }\n } else {\n if (result / scale == value) {\n durationOfMillis(result.coerceIn(-MAX_MILLIS..MAX_MILLIS))\n } else {\n if (value.sign * scale.sign > 0) INFINITE else NEG_INFINITE\n }\n }\n }\n\n /**\n * Returns a duration whose value is this duration value multiplied by the given [scale] number.\n *\n * The operation may involve rounding when the result cannot be represented exactly with a [Double] number.\n *\n * @throws IllegalArgumentException if the operation results in an undefined value for the given arguments,\n * e.g. when multiplying an infinite duration by zero.\n */\n public operator fun times(scale: Double): Duration {\n val intScale = scale.roundToInt()\n if (intScale.toDouble() == scale) {\n return times(intScale)\n }\n\n val unit = storageUnit\n val result = toDouble(unit) * scale\n return result.toDuration(unit)\n }\n\n /**\n * Returns a duration whose value is this duration value divided by the given [scale] number.\n *\n * @throws IllegalArgumentException if the operation results in an undefined value for the given arguments,\n * e.g. when dividing zero duration by zero.\n */\n public operator fun div(scale: Int): Duration {\n if (scale == 0) {\n return when {\n isPositive() -> INFINITE\n isNegative() -> NEG_INFINITE\n else -> throw IllegalArgumentException(\"Dividing zero duration by zero yields an undefined result.\")\n }\n }\n if (isInNanos()) {\n return durationOfNanos(value / scale)\n } else {\n if (isInfinite())\n return this * scale.sign\n\n val result = value / scale\n\n if (result in -MAX_NANOS_IN_MILLIS..MAX_NANOS_IN_MILLIS) {\n val rem = millisToNanos(value - (result * scale)) / scale\n return durationOfNanos(millisToNanos(result) + rem)\n }\n return durationOfMillis(result)\n }\n }\n\n /**\n * Returns a duration whose value is this duration value divided by the given [scale] number.\n *\n * @throws IllegalArgumentException if the operation results in an undefined value for the given arguments,\n * e.g. when dividing an infinite duration by infinity or zero duration by zero.\n */\n public operator fun div(scale: Double): Duration {\n val intScale = scale.roundToInt()\n if (intScale.toDouble() == scale && intScale != 0) {\n return div(intScale)\n }\n\n val unit = storageUnit\n val result = toDouble(unit) / scale\n return result.toDuration(unit)\n }\n\n /** Returns a number that is the ratio of this and [other] duration values. */\n public operator fun div(other: Duration): Double {\n val coarserUnit = maxOf(this.storageUnit, other.storageUnit)\n return this.toDouble(coarserUnit) / other.toDouble(coarserUnit)\n }\n\n /** Returns true, if the duration value is less than zero. */\n public fun isNegative(): Boolean = rawValue < 0\n\n /** Returns true, if the duration value is greater than zero. */\n public fun isPositive(): Boolean = rawValue > 0\n\n /** Returns true, if the duration value is infinite. */\n public fun isInfinite(): Boolean = rawValue == INFINITE.rawValue || rawValue == NEG_INFINITE.rawValue\n\n /** Returns true, if the duration value is finite. */\n public fun isFinite(): Boolean = !isInfinite()\n\n /** Returns the absolute value of this value. The returned value is always non-negative. */\n public val absoluteValue: Duration get() = if (isNegative()) -this else this\n\n override fun compareTo(other: Duration): Int {\n val compareBits = this.rawValue xor other.rawValue\n if (compareBits < 0 || compareBits.toInt() and 1 == 0) // different signs or same sign/same range\n return this.rawValue.compareTo(other.rawValue)\n // same sign/different ranges\n val r = this.unitDiscriminator - other.unitDiscriminator // compare ranges\n return if (isNegative()) -r else r\n }\n\n\n // splitting to components\n\n /**\n * Splits this duration into days, hours, minutes, seconds, and nanoseconds and executes the given [action] with these components.\n * The result of [action] is returned as the result of this function.\n *\n * - `nanoseconds` represents the whole number of nanoseconds in this duration, and its absolute value is less than 1_000_000_000;\n * - `seconds` represents the whole number of seconds in this duration, and its absolute value is less than 60;\n * - `minutes` represents the whole number of minutes in this duration, and its absolute value is less than 60;\n * - `hours` represents the whole number of hours in this duration, and its absolute value is less than 24;\n * - `days` represents the whole number of days in this duration.\n *\n * Infinite durations are represented as either [Long.MAX_VALUE] days, or [Long.MIN_VALUE] days (depending on the sign of infinity),\n * and zeroes in the lower components.\n */\n public inline fun toComponents(action: (days: Long, hours: Int, minutes: Int, seconds: Int, nanoseconds: Int) -> T): T {\n contract { callsInPlace(action, InvocationKind.EXACTLY_ONCE) }\n return action(inWholeDays, hoursComponent, minutesComponent, secondsComponent, nanosecondsComponent)\n }\n\n /**\n * Splits this duration into hours, minutes, seconds, and nanoseconds and executes the given [action] with these components.\n * The result of [action] is returned as the result of this function.\n *\n * - `nanoseconds` represents the whole number of nanoseconds in this duration, and its absolute value is less than 1_000_000_000;\n * - `seconds` represents the whole number of seconds in this duration, and its absolute value is less than 60;\n * - `minutes` represents the whole number of minutes in this duration, and its absolute value is less than 60;\n * - `hours` represents the whole number of hours in this duration.\n *\n * Infinite durations are represented as either [Long.MAX_VALUE] hours, or [Long.MIN_VALUE] hours (depending on the sign of infinity),\n * and zeroes in the lower components.\n */\n public inline fun toComponents(action: (hours: Long, minutes: Int, seconds: Int, nanoseconds: Int) -> T): T {\n contract { callsInPlace(action, InvocationKind.EXACTLY_ONCE) }\n return action(inWholeHours, minutesComponent, secondsComponent, nanosecondsComponent)\n }\n\n /**\n * Splits this duration into minutes, seconds, and nanoseconds and executes the given [action] with these components.\n * The result of [action] is returned as the result of this function.\n *\n * - `nanoseconds` represents the whole number of nanoseconds in this duration, and its absolute value is less than 1_000_000_000;\n * - `seconds` represents the whole number of seconds in this duration, and its absolute value is less than 60;\n * - `minutes` represents the whole number of minutes in this duration.\n *\n * Infinite durations are represented as either [Long.MAX_VALUE] minutes, or [Long.MIN_VALUE] minutes (depending on the sign of infinity),\n * and zeroes in the lower components.\n */\n public inline fun toComponents(action: (minutes: Long, seconds: Int, nanoseconds: Int) -> T): T {\n contract { callsInPlace(action, InvocationKind.EXACTLY_ONCE) }\n return action(inWholeMinutes, secondsComponent, nanosecondsComponent)\n }\n\n /**\n * Splits this duration into seconds, and nanoseconds and executes the given [action] with these components.\n * The result of [action] is returned as the result of this function.\n *\n * - `nanoseconds` represents the whole number of nanoseconds in this duration, and its absolute value is less than 1_000_000_000;\n * - `seconds` represents the whole number of seconds in this duration.\n *\n * Infinite durations are represented as either [Long.MAX_VALUE] seconds, or [Long.MIN_VALUE] seconds (depending on the sign of infinity),\n * and zero nanoseconds.\n */\n public inline fun toComponents(action: (seconds: Long, nanoseconds: Int) -> T): T {\n contract { callsInPlace(action, InvocationKind.EXACTLY_ONCE) }\n return action(inWholeSeconds, nanosecondsComponent)\n }\n\n @PublishedApi\n internal val hoursComponent: Int\n get() = if (isInfinite()) 0 else (inWholeHours % 24).toInt()\n\n @PublishedApi\n internal val minutesComponent: Int\n get() = if (isInfinite()) 0 else (inWholeMinutes % 60).toInt()\n\n @PublishedApi\n internal val secondsComponent: Int\n get() = if (isInfinite()) 0 else (inWholeSeconds % 60).toInt()\n\n @PublishedApi\n internal val nanosecondsComponent: Int\n get() = when {\n isInfinite() -> 0\n isInMillis() -> millisToNanos(value % 1_000).toInt()\n else -> (value % 1_000_000_000).toInt()\n }\n\n\n // conversion to units\n\n /**\n * Returns the value of this duration expressed as a [Double] number of the specified [unit].\n *\n * The operation may involve rounding when the result cannot be represented exactly with a [Double] number.\n *\n * An infinite duration value is converted either to [Double.POSITIVE_INFINITY] or [Double.NEGATIVE_INFINITY] depending on its sign.\n */\n public fun toDouble(unit: DurationUnit): Double {\n return when (rawValue) {\n INFINITE.rawValue -> Double.POSITIVE_INFINITY\n NEG_INFINITE.rawValue -> Double.NEGATIVE_INFINITY\n else -> {\n // TODO: whether it's ok to convert to Double before scaling\n convertDurationUnit(value.toDouble(), storageUnit, unit)\n }\n }\n }\n\n /**\n * Returns the value of this duration expressed as a [Long] number of the specified [unit].\n *\n * If the result doesn't fit in the range of [Long] type, it is coerced into that range:\n * - [Long.MIN_VALUE] is returned if it's less than `Long.MIN_VALUE`,\n * - [Long.MAX_VALUE] is returned if it's greater than `Long.MAX_VALUE`.\n *\n * An infinite duration value is converted either to [Long.MAX_VALUE] or [Long.MIN_VALUE] depending on its sign.\n */\n public fun toLong(unit: DurationUnit): Long {\n return when (rawValue) {\n INFINITE.rawValue -> Long.MAX_VALUE\n NEG_INFINITE.rawValue -> Long.MIN_VALUE\n else -> convertDurationUnit(value, storageUnit, unit)\n }\n }\n\n /**\n * Returns the value of this duration expressed as an [Int] number of the specified [unit].\n *\n * If the result doesn't fit in the range of [Int] type, it is coerced into that range:\n * - [Int.MIN_VALUE] is returned if it's less than `Int.MIN_VALUE`,\n * - [Int.MAX_VALUE] is returned if it's greater than `Int.MAX_VALUE`.\n *\n * An infinite duration value is converted either to [Int.MAX_VALUE] or [Int.MIN_VALUE] depending on its sign.\n */\n public fun toInt(unit: DurationUnit): Int =\n toLong(unit).coerceIn(Int.MIN_VALUE.toLong(), Int.MAX_VALUE.toLong()).toInt()\n\n /** The value of this duration expressed as a [Double] number of days. */\n @ExperimentalTime\n @Deprecated(\"Use inWholeDays property instead or convert toDouble(DAYS) if a double value is required.\", ReplaceWith(\"toDouble(DurationUnit.DAYS)\"))\n public val inDays: Double get() = toDouble(DurationUnit.DAYS)\n\n /** The value of this duration expressed as a [Double] number of hours. */\n @ExperimentalTime\n @Deprecated(\"Use inWholeHours property instead or convert toDouble(HOURS) if a double value is required.\", ReplaceWith(\"toDouble(DurationUnit.HOURS)\"))\n public val inHours: Double get() = toDouble(DurationUnit.HOURS)\n\n /** The value of this duration expressed as a [Double] number of minutes. */\n @ExperimentalTime\n @Deprecated(\"Use inWholeMinutes property instead or convert toDouble(MINUTES) if a double value is required.\", ReplaceWith(\"toDouble(DurationUnit.MINUTES)\"))\n public val inMinutes: Double get() = toDouble(DurationUnit.MINUTES)\n\n /** The value of this duration expressed as a [Double] number of seconds. */\n @ExperimentalTime\n @Deprecated(\"Use inWholeSeconds property instead or convert toDouble(SECONDS) if a double value is required.\", ReplaceWith(\"toDouble(DurationUnit.SECONDS)\"))\n public val inSeconds: Double get() = toDouble(DurationUnit.SECONDS)\n\n /** The value of this duration expressed as a [Double] number of milliseconds. */\n @ExperimentalTime\n @Deprecated(\"Use inWholeMilliseconds property instead or convert toDouble(MILLISECONDS) if a double value is required.\", ReplaceWith(\"toDouble(DurationUnit.MILLISECONDS)\"))\n public val inMilliseconds: Double get() = toDouble(DurationUnit.MILLISECONDS)\n\n /** The value of this duration expressed as a [Double] number of microseconds. */\n @ExperimentalTime\n @Deprecated(\"Use inWholeMicroseconds property instead or convert toDouble(MICROSECONDS) if a double value is required.\", ReplaceWith(\"toDouble(DurationUnit.MICROSECONDS)\"))\n public val inMicroseconds: Double get() = toDouble(DurationUnit.MICROSECONDS)\n\n /** The value of this duration expressed as a [Double] number of nanoseconds. */\n @ExperimentalTime\n @Deprecated(\"Use inWholeNanoseconds property instead or convert toDouble(NANOSECONDS) if a double value is required.\", ReplaceWith(\"toDouble(DurationUnit.NANOSECONDS)\"))\n public val inNanoseconds: Double get() = toDouble(DurationUnit.NANOSECONDS)\n\n\n /**\n * The value of this duration expressed as a [Long] number of days.\n *\n * An infinite duration value is converted either to [Long.MAX_VALUE] or [Long.MIN_VALUE] depending on its sign.\n */\n public val inWholeDays: Long\n get() = toLong(DurationUnit.DAYS)\n\n /**\n * The value of this duration expressed as a [Long] number of hours.\n *\n * An infinite duration value is converted either to [Long.MAX_VALUE] or [Long.MIN_VALUE] depending on its sign.\n */\n public val inWholeHours: Long\n get() = toLong(DurationUnit.HOURS)\n\n /**\n * The value of this duration expressed as a [Long] number of minutes.\n *\n * An infinite duration value is converted either to [Long.MAX_VALUE] or [Long.MIN_VALUE] depending on its sign.\n */\n public val inWholeMinutes: Long\n get() = toLong(DurationUnit.MINUTES)\n\n /**\n * The value of this duration expressed as a [Long] number of seconds.\n *\n * An infinite duration value is converted either to [Long.MAX_VALUE] or [Long.MIN_VALUE] depending on its sign.\n */\n public val inWholeSeconds: Long\n get() = toLong(DurationUnit.SECONDS)\n\n /**\n * The value of this duration expressed as a [Long] number of milliseconds.\n *\n * An infinite duration value is converted either to [Long.MAX_VALUE] or [Long.MIN_VALUE] depending on its sign.\n */\n public val inWholeMilliseconds: Long\n get() {\n return if (isInMillis() && isFinite()) value else toLong(DurationUnit.MILLISECONDS)\n }\n\n /**\n * The value of this duration expressed as a [Long] number of microseconds.\n *\n * If the result doesn't fit in the range of [Long] type, it is coerced into that range:\n * - [Long.MIN_VALUE] is returned if it's less than `Long.MIN_VALUE`,\n * - [Long.MAX_VALUE] is returned if it's greater than `Long.MAX_VALUE`.\n *\n * An infinite duration value is converted either to [Long.MAX_VALUE] or [Long.MIN_VALUE] depending on its sign.\n */\n public val inWholeMicroseconds: Long\n get() = toLong(DurationUnit.MICROSECONDS)\n\n /**\n * The value of this duration expressed as a [Long] number of nanoseconds.\n *\n * If the result doesn't fit in the range of [Long] type, it is coerced into that range:\n * - [Long.MIN_VALUE] is returned if it's less than `Long.MIN_VALUE`,\n * - [Long.MAX_VALUE] is returned if it's greater than `Long.MAX_VALUE`.\n *\n * An infinite duration value is converted either to [Long.MAX_VALUE] or [Long.MIN_VALUE] depending on its sign.\n */\n public val inWholeNanoseconds: Long\n get() {\n val value = value\n return when {\n isInNanos() -> value\n value > Long.MAX_VALUE / NANOS_IN_MILLIS -> Long.MAX_VALUE\n value < Long.MIN_VALUE / NANOS_IN_MILLIS -> Long.MIN_VALUE\n else -> millisToNanos(value)\n }\n }\n\n // shortcuts\n\n /**\n * Returns the value of this duration expressed as a [Long] number of nanoseconds.\n *\n * If the value doesn't fit in the range of [Long] type, it is coerced into that range, see the conversion [Double.toLong] for details.\n *\n * The range of durations that can be expressed as a `Long` number of nanoseconds is approximately ±292 years.\n */\n @ExperimentalTime\n @Deprecated(\"Use inWholeNanoseconds property instead.\", ReplaceWith(\"this.inWholeNanoseconds\"))\n public fun toLongNanoseconds(): Long = inWholeNanoseconds\n\n /**\n * Returns the value of this duration expressed as a [Long] number of milliseconds.\n *\n * The value is coerced to the range of [Long] type, if it doesn't fit in that range, see the conversion [Double.toLong] for details.\n *\n * The range of durations that can be expressed as a `Long` number of milliseconds is approximately ±292 million years.\n */\n @ExperimentalTime\n @Deprecated(\"Use inWholeMilliseconds property instead.\", ReplaceWith(\"this.inWholeMilliseconds\"))\n public fun toLongMilliseconds(): Long = inWholeMilliseconds\n\n /**\n * Returns a string representation of this duration value\n * expressed as a combination of numeric components, each in its own unit.\n *\n * Each component is a number followed by the unit abbreviated name: `d`, `h`, `m`, `s`:\n * `5h`, `1d 12h`, `1h 0m 30.340s`.\n * The last component, usually seconds, can be a number with a fractional part.\n *\n * If the duration is less than a second, it is represented as a single number\n * with one of sub-second units: `ms` (milliseconds), `us` (microseconds), or `ns` (nanoseconds):\n * `140.884ms`, `500us`, `24ns`.\n *\n * A negative duration is prefixed with `-` sign and, if it consists of multiple components, surrounded with parentheses:\n * `-12m` and `-(1h 30m)`.\n *\n * Special cases:\n * - an infinite duration is formatted as `\"Infinity\"` or `\"-Infinity\"` without a unit.\n *\n * It's recommended to use [toIsoString] that uses more strict ISO-8601 format instead of this `toString`\n * when you want to convert a duration to a string in cases of serialization, interchange, etc.\n *\n * @sample samples.time.Durations.toStringDefault\n */\n override fun toString(): String = when (rawValue) {\n 0L -> \"0s\"\n INFINITE.rawValue -> \"Infinity\"\n NEG_INFINITE.rawValue -> \"-Infinity\"\n else -> {\n val isNegative = isNegative()\n buildString {\n if (isNegative) append('-')\n absoluteValue.toComponents { days, hours, minutes, seconds, nanoseconds ->\n val hasDays = days != 0L\n val hasHours = hours != 0\n val hasMinutes = minutes != 0\n val hasSeconds = seconds != 0 || nanoseconds != 0\n var components = 0\n if (hasDays) {\n append(days).append('d')\n components++\n }\n if (hasHours || (hasDays && (hasMinutes || hasSeconds))) {\n if (components++ > 0) append(' ')\n append(hours).append('h')\n }\n if (hasMinutes || (hasSeconds && (hasHours || hasDays))) {\n if (components++ > 0) append(' ')\n append(minutes).append('m')\n }\n if (hasSeconds) {\n if (components++ > 0) append(' ')\n when {\n seconds != 0 || hasDays || hasHours || hasMinutes ->\n appendFractional(seconds, nanoseconds, 9, \"s\", isoZeroes = false)\n nanoseconds >= 1_000_000 ->\n appendFractional(nanoseconds / 1_000_000, nanoseconds % 1_000_000, 6, \"ms\", isoZeroes = false)\n nanoseconds >= 1_000 ->\n appendFractional(nanoseconds / 1_000, nanoseconds % 1_000, 3, \"us\", isoZeroes = false)\n else ->\n append(nanoseconds).append(\"ns\")\n }\n }\n if (isNegative && components > 1) insert(1, '(').append(')')\n }\n }\n }\n }\n\n private fun StringBuilder.appendFractional(whole: Int, fractional: Int, fractionalSize: Int, unit: String, isoZeroes: Boolean) {\n append(whole)\n if (fractional != 0) {\n append('.')\n val fracString = fractional.toString().padStart(fractionalSize, '0')\n val nonZeroDigits = fracString.indexOfLast { it != '0' } + 1\n when {\n !isoZeroes && nonZeroDigits < 3 -> appendRange(fracString, 0, nonZeroDigits)\n else -> appendRange(fracString, 0, ((nonZeroDigits + 2) / 3) * 3)\n }\n }\n append(unit)\n }\n\n /**\n * Returns a string representation of this duration value expressed in the given [unit]\n * and formatted with the specified [decimals] number of digits after decimal point.\n *\n * Special cases:\n * - an infinite duration is formatted as `\"Infinity\"` or `\"-Infinity\"` without a unit.\n *\n * @param decimals the number of digits after decimal point to show. The value must be non-negative.\n * No more than 12 decimals will be shown, even if a larger number is requested.\n *\n * @return the value of duration in the specified [unit] followed by that unit abbreviated name: `d`, `h`, `m`, `s`, `ms`, `us`, or `ns`.\n *\n * @throws IllegalArgumentException if [decimals] is less than zero.\n *\n * @sample samples.time.Durations.toStringDecimals\n */\n public fun toString(unit: DurationUnit, decimals: Int = 0): String {\n require(decimals >= 0) { \"decimals must be not negative, but was $decimals\" }\n val number = toDouble(unit)\n if (number.isInfinite()) return number.toString()\n return formatToExactDecimals(number, decimals.coerceAtMost(12)) + unit.shortName()\n }\n\n\n /**\n * Returns an ISO-8601 based string representation of this duration.\n *\n * The returned value is presented in the format `PThHmMs.fS`, where `h`, `m`, `s` are the integer components of this duration (see [toComponents])\n * and `f` is a fractional part of second. Depending on the roundness of the value the fractional part can be formatted with either\n * 0, 3, 6, or 9 decimal digits.\n *\n * The infinite duration is represented as `\"PT9999999999999H\"` which is larger than any possible finite duration in Kotlin.\n *\n * Negative durations are indicated with the sign `-` in the beginning of the returned string, for example, `\"-PT5M30S\"`.\n *\n * @sample samples.time.Durations.toIsoString\n */\n public fun toIsoString(): String = buildString {\n if (isNegative()) append('-')\n append(\"PT\")\n this@Duration.absoluteValue.toComponents { hours, minutes, seconds, nanoseconds ->\n @Suppress(\"NAME_SHADOWING\")\n var hours = hours\n if (isInfinite()) {\n // use large enough value instead of Long.MAX_VALUE\n hours = 9_999_999_999_999\n }\n val hasHours = hours != 0L\n val hasSeconds = seconds != 0 || nanoseconds != 0\n val hasMinutes = minutes != 0 || (hasSeconds && hasHours)\n if (hasHours) {\n append(hours).append('H')\n }\n if (hasMinutes) {\n append(minutes).append('M')\n }\n if (hasSeconds || (!hasHours && !hasMinutes)) {\n appendFractional(seconds, nanoseconds, 9, \"S\", isoZeroes = true)\n }\n }\n }\n\n}\n\n// constructing from number of units\n// extension functions\n\n/** Returns a [Duration] equal to this [Int] number of the specified [unit]. */\n@SinceKotlin(\"1.6\")\n@WasExperimental(ExperimentalTime::class)\npublic fun Int.toDuration(unit: DurationUnit): Duration {\n return if (unit <= DurationUnit.SECONDS) {\n durationOfNanos(convertDurationUnitOverflow(this.toLong(), unit, DurationUnit.NANOSECONDS))\n } else\n toLong().toDuration(unit)\n}\n\n/** Returns a [Duration] equal to this [Long] number of the specified [unit]. */\n@SinceKotlin(\"1.6\")\n@WasExperimental(ExperimentalTime::class)\npublic fun Long.toDuration(unit: DurationUnit): Duration {\n val maxNsInUnit = convertDurationUnitOverflow(MAX_NANOS, DurationUnit.NANOSECONDS, unit)\n if (this in -maxNsInUnit..maxNsInUnit) {\n return durationOfNanos(convertDurationUnitOverflow(this, unit, DurationUnit.NANOSECONDS))\n } else {\n val millis = convertDurationUnit(this, unit, DurationUnit.MILLISECONDS)\n return durationOfMillis(millis.coerceIn(-MAX_MILLIS, MAX_MILLIS))\n }\n}\n\n/**\n * Returns a [Duration] equal to this [Double] number of the specified [unit].\n *\n * Depending on its magnitude, the value is rounded to an integer number of nanoseconds or milliseconds.\n *\n * @throws IllegalArgumentException if this `Double` value is `NaN`.\n */\n@SinceKotlin(\"1.6\")\n@WasExperimental(ExperimentalTime::class)\npublic fun Double.toDuration(unit: DurationUnit): Duration {\n val valueInNs = convertDurationUnit(this, unit, DurationUnit.NANOSECONDS)\n require(!valueInNs.isNaN()) { \"Duration value cannot be NaN.\" }\n val nanos = valueInNs.roundToLong()\n return if (nanos in -MAX_NANOS..MAX_NANOS) {\n durationOfNanos(nanos)\n } else {\n val millis = convertDurationUnit(this, unit, DurationUnit.MILLISECONDS).roundToLong()\n durationOfMillisNormalized(millis)\n }\n}\n\n// constructing from number of units\n// deprecated extension properties\n\n/** Returns a [Duration] equal to this [Int] number of nanoseconds. */\n@SinceKotlin(\"1.3\")\n@ExperimentalTime\n@Deprecated(\"Use 'Int.nanoseconds' extension property from Duration.Companion instead.\", ReplaceWith(\"this.nanoseconds\", \"kotlin.time.Duration.Companion.nanoseconds\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic val Int.nanoseconds get() = toDuration(DurationUnit.NANOSECONDS)\n\n/** Returns a [Duration] equal to this [Long] number of nanoseconds. */\n@SinceKotlin(\"1.3\")\n@ExperimentalTime\n@Deprecated(\"Use 'Long.nanoseconds' extension property from Duration.Companion instead.\", ReplaceWith(\"this.nanoseconds\", \"kotlin.time.Duration.Companion.nanoseconds\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic val Long.nanoseconds get() = toDuration(DurationUnit.NANOSECONDS)\n\n/**\n * Returns a [Duration] equal to this [Double] number of nanoseconds.\n *\n * @throws IllegalArgumentException if this [Double] value is `NaN`.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalTime\n@Deprecated(\"Use 'Double.nanoseconds' extension property from Duration.Companion instead.\", ReplaceWith(\"this.nanoseconds\", \"kotlin.time.Duration.Companion.nanoseconds\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic val Double.nanoseconds get() = toDuration(DurationUnit.NANOSECONDS)\n\n\n/** Returns a [Duration] equal to this [Int] number of microseconds. */\n@SinceKotlin(\"1.3\")\n@ExperimentalTime\n@Deprecated(\"Use 'Int.microseconds' extension property from Duration.Companion instead.\", ReplaceWith(\"this.microseconds\", \"kotlin.time.Duration.Companion.microseconds\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic val Int.microseconds get() = toDuration(DurationUnit.MICROSECONDS)\n\n/** Returns a [Duration] equal to this [Long] number of microseconds. */\n@SinceKotlin(\"1.3\")\n@ExperimentalTime\n@Deprecated(\"Use 'Long.microseconds' extension property from Duration.Companion instead.\", ReplaceWith(\"this.microseconds\", \"kotlin.time.Duration.Companion.microseconds\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic val Long.microseconds get() = toDuration(DurationUnit.MICROSECONDS)\n\n/**\n * Returns a [Duration] equal to this [Double] number of microseconds.\n *\n * @throws IllegalArgumentException if this [Double] value is `NaN`.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalTime\n@Deprecated(\"Use 'Double.microseconds' extension property from Duration.Companion instead.\", ReplaceWith(\"this.microseconds\", \"kotlin.time.Duration.Companion.microseconds\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic val Double.microseconds get() = toDuration(DurationUnit.MICROSECONDS)\n\n\n/** Returns a [Duration] equal to this [Int] number of milliseconds. */\n@SinceKotlin(\"1.3\")\n@ExperimentalTime\n@Deprecated(\"Use 'Int.milliseconds' extension property from Duration.Companion instead.\", ReplaceWith(\"this.milliseconds\", \"kotlin.time.Duration.Companion.milliseconds\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic val Int.milliseconds get() = toDuration(DurationUnit.MILLISECONDS)\n\n/** Returns a [Duration] equal to this [Long] number of milliseconds. */\n@SinceKotlin(\"1.3\")\n@ExperimentalTime\n@Deprecated(\"Use 'Long.milliseconds' extension property from Duration.Companion instead.\", ReplaceWith(\"this.milliseconds\", \"kotlin.time.Duration.Companion.milliseconds\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic val Long.milliseconds get() = toDuration(DurationUnit.MILLISECONDS)\n\n/**\n * Returns a [Duration] equal to this [Double] number of milliseconds.\n *\n * @throws IllegalArgumentException if this [Double] value is `NaN`.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalTime\n@Deprecated(\"Use 'Double.milliseconds' extension property from Duration.Companion instead.\", ReplaceWith(\"this.milliseconds\", \"kotlin.time.Duration.Companion.milliseconds\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic val Double.milliseconds get() = toDuration(DurationUnit.MILLISECONDS)\n\n\n/** Returns a [Duration] equal to this [Int] number of seconds. */\n@SinceKotlin(\"1.3\")\n@ExperimentalTime\n@Deprecated(\"Use 'Int.seconds' extension property from Duration.Companion instead.\", ReplaceWith(\"this.seconds\", \"kotlin.time.Duration.Companion.seconds\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic val Int.seconds get() = toDuration(DurationUnit.SECONDS)\n\n/** Returns a [Duration] equal to this [Long] number of seconds. */\n@SinceKotlin(\"1.3\")\n@ExperimentalTime\n@Deprecated(\"Use 'Long.seconds' extension property from Duration.Companion instead.\", ReplaceWith(\"this.seconds\", \"kotlin.time.Duration.Companion.seconds\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic val Long.seconds get() = toDuration(DurationUnit.SECONDS)\n\n/**\n * Returns a [Duration] equal to this [Double] number of seconds.\n *\n * @throws IllegalArgumentException if this [Double] value is `NaN`.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalTime\n@Deprecated(\"Use 'Double.seconds' extension property from Duration.Companion instead.\", ReplaceWith(\"this.seconds\", \"kotlin.time.Duration.Companion.seconds\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic val Double.seconds get() = toDuration(DurationUnit.SECONDS)\n\n\n/** Returns a [Duration] equal to this [Int] number of minutes. */\n@SinceKotlin(\"1.3\")\n@ExperimentalTime\n@Deprecated(\"Use 'Int.minutes' extension property from Duration.Companion instead.\", ReplaceWith(\"this.minutes\", \"kotlin.time.Duration.Companion.minutes\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic val Int.minutes get() = toDuration(DurationUnit.MINUTES)\n\n/** Returns a [Duration] equal to this [Long] number of minutes. */\n@SinceKotlin(\"1.3\")\n@ExperimentalTime\n@Deprecated(\"Use 'Long.minutes' extension property from Duration.Companion instead.\", ReplaceWith(\"this.minutes\", \"kotlin.time.Duration.Companion.minutes\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic val Long.minutes get() = toDuration(DurationUnit.MINUTES)\n\n/**\n * Returns a [Duration] equal to this [Double] number of minutes.\n *\n * @throws IllegalArgumentException if this [Double] value is `NaN`.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalTime\n@Deprecated(\"Use 'Double.minutes' extension property from Duration.Companion instead.\", ReplaceWith(\"this.minutes\", \"kotlin.time.Duration.Companion.minutes\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic val Double.minutes get() = toDuration(DurationUnit.MINUTES)\n\n\n/** Returns a [Duration] equal to this [Int] number of hours. */\n@SinceKotlin(\"1.3\")\n@ExperimentalTime\n@Deprecated(\"Use 'Int.hours' extension property from Duration.Companion instead.\", ReplaceWith(\"this.hours\", \"kotlin.time.Duration.Companion.hours\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic val Int.hours get() = toDuration(DurationUnit.HOURS)\n\n/** Returns a [Duration] equal to this [Long] number of hours. */\n@SinceKotlin(\"1.3\")\n@ExperimentalTime\n@Deprecated(\"Use 'Long.hours' extension property from Duration.Companion instead.\", ReplaceWith(\"this.hours\", \"kotlin.time.Duration.Companion.hours\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic val Long.hours get() = toDuration(DurationUnit.HOURS)\n\n/**\n * Returns a [Duration] equal to this [Double] number of hours.\n *\n * @throws IllegalArgumentException if this [Double] value is `NaN`.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalTime\n@Deprecated(\"Use 'Double.hours' extension property from Duration.Companion instead.\", ReplaceWith(\"this.hours\", \"kotlin.time.Duration.Companion.hours\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic val Double.hours get() = toDuration(DurationUnit.HOURS)\n\n\n/** Returns a [Duration] equal to this [Int] number of days. */\n@SinceKotlin(\"1.3\")\n@ExperimentalTime\n@Deprecated(\"Use 'Int.days' extension property from Duration.Companion instead.\", ReplaceWith(\"this.days\", \"kotlin.time.Duration.Companion.days\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic val Int.days get() = toDuration(DurationUnit.DAYS)\n\n/** Returns a [Duration] equal to this [Long] number of days. */\n@SinceKotlin(\"1.3\")\n@ExperimentalTime\n@Deprecated(\"Use 'Long.days' extension property from Duration.Companion instead.\", ReplaceWith(\"this.days\", \"kotlin.time.Duration.Companion.days\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic val Long.days get() = toDuration(DurationUnit.DAYS)\n\n/**\n * Returns a [Duration] equal to this [Double] number of days.\n *\n * @throws IllegalArgumentException if this [Double] value is `NaN`.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalTime\n@Deprecated(\"Use 'Double.days' extension property from Duration.Companion instead.\", ReplaceWith(\"this.days\", \"kotlin.time.Duration.Companion.days\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic val Double.days get() = toDuration(DurationUnit.DAYS)\n\n\n/** Returns a duration whose value is the specified [duration] value multiplied by this number. */\n@SinceKotlin(\"1.6\")\n@WasExperimental(ExperimentalTime::class)\n@kotlin.internal.InlineOnly\npublic inline operator fun Int.times(duration: Duration): Duration = duration * this\n\n/**\n * Returns a duration whose value is the specified [duration] value multiplied by this number.\n *\n * The operation may involve rounding when the result cannot be represented exactly with a [Double] number.\n *\n * @throws IllegalArgumentException if the operation results in a `NaN` value.\n */\n@SinceKotlin(\"1.6\")\n@WasExperimental(ExperimentalTime::class)\n@kotlin.internal.InlineOnly\npublic inline operator fun Double.times(duration: Duration): Duration = duration * this\n\n\n\nprivate fun parseDuration(value: String, strictIso: Boolean): Duration {\n var length = value.length\n if (length == 0) throw IllegalArgumentException(\"The string is empty\")\n var index = 0\n var result = Duration.ZERO\n val infinityString = \"Infinity\"\n when (value[index]) {\n '+', '-' -> index++\n }\n val hasSign = index > 0\n val isNegative = hasSign && value.startsWith('-')\n when {\n length <= index ->\n throw IllegalArgumentException(\"No components\")\n value[index] == 'P' -> {\n if (++index == length) throw IllegalArgumentException()\n val nonDigitSymbols = \"+-.\"\n var isTimeComponent = false\n var prevUnit: DurationUnit? = null\n while (index < length) {\n if (value[index] == 'T') {\n if (isTimeComponent || ++index == length) throw IllegalArgumentException()\n isTimeComponent = true\n continue\n }\n val component = value.substringWhile(index) { it in '0'..'9' || it in nonDigitSymbols }\n if (component.isEmpty()) throw IllegalArgumentException()\n index += component.length\n val unitChar = value.getOrElse(index) { throw IllegalArgumentException(\"Missing unit for value $component\") }\n index++\n val unit = durationUnitByIsoChar(unitChar, isTimeComponent)\n if (prevUnit != null && prevUnit <= unit) throw IllegalArgumentException(\"Unexpected order of duration components\")\n prevUnit = unit\n val dotIndex = component.indexOf('.')\n if (unit == DurationUnit.SECONDS && dotIndex > 0) {\n val whole = component.substring(0, dotIndex)\n result += parseOverLongIsoComponent(whole).toDuration(unit)\n result += component.substring(dotIndex).toDouble().toDuration(unit)\n } else {\n result += parseOverLongIsoComponent(component).toDuration(unit)\n }\n }\n }\n strictIso ->\n throw IllegalArgumentException()\n value.regionMatches(index, infinityString, 0, length = maxOf(length - index, infinityString.length), ignoreCase = true) -> {\n result = Duration.INFINITE\n }\n else -> {\n // parse default string format\n var prevUnit: DurationUnit? = null\n var afterFirst = false\n var allowSpaces = !hasSign\n if (hasSign && value[index] == '(' && value.last() == ')') {\n allowSpaces = true\n if (++index == --length) throw IllegalArgumentException(\"No components\")\n }\n while (index < length) {\n if (afterFirst && allowSpaces) {\n index = value.skipWhile(index) { it == ' ' }\n }\n afterFirst = true\n val component = value.substringWhile(index) { it in '0'..'9' || it == '.' }\n if (component.isEmpty()) throw IllegalArgumentException()\n index += component.length\n val unitName = value.substringWhile(index) { it in 'a'..'z' }\n index += unitName.length\n val unit = durationUnitByShortName(unitName)\n if (prevUnit != null && prevUnit <= unit) throw IllegalArgumentException(\"Unexpected order of duration components\")\n prevUnit = unit\n val dotIndex = component.indexOf('.')\n if (dotIndex > 0) {\n val whole = component.substring(0, dotIndex)\n result += whole.toLong().toDuration(unit)\n result += component.substring(dotIndex).toDouble().toDuration(unit)\n if (index < length) throw IllegalArgumentException(\"Fractional component must be last\")\n } else {\n result += component.toLong().toDuration(unit)\n }\n }\n }\n }\n return if (isNegative) -result else result\n}\n\n\nprivate fun parseOverLongIsoComponent(value: String): Long {\n val length = value.length\n var startIndex = 0\n if (length > 0 && value[0] in \"+-\") startIndex++\n if ((length - startIndex) > 16 && (startIndex..value.lastIndex).all { value[it] in '0'..'9' }) {\n // all chars are digits, but more than ceiling(log10(MAX_MILLIS / 1000)) of them\n return if (value[0] == '-') Long.MIN_VALUE else Long.MAX_VALUE\n }\n // TODO: replace with just toLong after min JDK becomes 8\n return if (value.startsWith(\"+\")) value.drop(1).toLong() else value.toLong()\n}\n\n\n\nprivate inline fun String.substringWhile(startIndex: Int, predicate: (Char) -> Boolean): String =\n substring(startIndex, skipWhile(startIndex, predicate))\n\nprivate inline fun String.skipWhile(startIndex: Int, predicate: (Char) -> Boolean): Int {\n var i = startIndex\n while (i < length && predicate(this[i])) i++\n return i\n}\n\n\n\n\n\n// The ranges are chosen so that they are:\n// - symmetric relative to zero: this greatly simplifies operations with sign, e.g. unaryMinus and minus.\n// - non-overlapping, but adjacent: the first value that doesn't fit in nanos range, can be exactly represented in millis.\n\ninternal const val NANOS_IN_MILLIS = 1_000_000\n// maximum number duration can store in nanosecond range\ninternal const val MAX_NANOS = Long.MAX_VALUE / 2 / NANOS_IN_MILLIS * NANOS_IN_MILLIS - 1 // ends in ..._999_999\n// maximum number duration can store in millisecond range, also encodes an infinite value\ninternal const val MAX_MILLIS = Long.MAX_VALUE / 2\n// MAX_NANOS expressed in milliseconds\nprivate const val MAX_NANOS_IN_MILLIS = MAX_NANOS / NANOS_IN_MILLIS\n\nprivate fun nanosToMillis(nanos: Long): Long = nanos / NANOS_IN_MILLIS\nprivate fun millisToNanos(millis: Long): Long = millis * NANOS_IN_MILLIS\n\nprivate fun durationOfNanos(normalNanos: Long) = Duration(normalNanos shl 1)\nprivate fun durationOfMillis(normalMillis: Long) = Duration((normalMillis shl 1) + 1)\nprivate fun durationOf(normalValue: Long, unitDiscriminator: Int) = Duration((normalValue shl 1) + unitDiscriminator)\nprivate fun durationOfNanosNormalized(nanos: Long) =\n if (nanos in -MAX_NANOS..MAX_NANOS) {\n durationOfNanos(nanos)\n } else {\n durationOfMillis(nanosToMillis(nanos))\n }\n\nprivate fun durationOfMillisNormalized(millis: Long) =\n if (millis in -MAX_NANOS_IN_MILLIS..MAX_NANOS_IN_MILLIS) {\n durationOfNanos(millisToNanos(millis))\n } else {\n durationOfMillis(millis.coerceIn(-MAX_MILLIS, MAX_MILLIS))\n }\n\ninternal expect val durationAssertionsEnabled: Boolean\n\ninternal expect fun formatToExactDecimals(value: Double, decimals: Int): String\ninternal expect fun formatUpToDecimals(value: Double, decimals: Int): String\n","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"SequencesKt\")\n\npackage kotlin.sequences\n\nimport kotlin.random.Random\n\n/**\n * Given an [iterator] function constructs a [Sequence] that returns values through the [Iterator]\n * provided by that function.\n * The values are evaluated lazily, and the sequence is potentially infinite.\n *\n * @sample samples.collections.Sequences.Building.sequenceFromIterator\n */\n@kotlin.internal.InlineOnly\npublic inline fun Sequence(crossinline iterator: () -> Iterator): Sequence = object : Sequence {\n override fun iterator(): Iterator = iterator()\n}\n\n/**\n * Creates a sequence that returns all elements from this iterator. The sequence is constrained to be iterated only once.\n *\n * @sample samples.collections.Sequences.Building.sequenceFromIterator\n */\npublic fun Iterator.asSequence(): Sequence = Sequence { this }.constrainOnce()\n\n/**\n * Creates a sequence that returns the specified values.\n *\n * @sample samples.collections.Sequences.Building.sequenceOfValues\n */\npublic fun sequenceOf(vararg elements: T): Sequence = if (elements.isEmpty()) emptySequence() else elements.asSequence()\n\n/**\n * Returns an empty sequence.\n */\npublic fun emptySequence(): Sequence = EmptySequence\n\nprivate object EmptySequence : Sequence, DropTakeSequence {\n override fun iterator(): Iterator = EmptyIterator\n override fun drop(n: Int) = EmptySequence\n override fun take(n: Int) = EmptySequence\n}\n\n/**\n * Returns this sequence if it's not `null` and the empty sequence otherwise.\n * @sample samples.collections.Sequences.Usage.sequenceOrEmpty\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun Sequence?.orEmpty(): Sequence = this ?: emptySequence()\n\n\n/**\n * Returns a sequence that iterates through the elements either of this sequence\n * or, if this sequence turns out to be empty, of the sequence returned by [defaultValue] function.\n *\n * @sample samples.collections.Sequences.Usage.sequenceIfEmpty\n */\n@SinceKotlin(\"1.3\")\npublic fun Sequence.ifEmpty(defaultValue: () -> Sequence): Sequence = sequence {\n val iterator = this@ifEmpty.iterator()\n if (iterator.hasNext()) {\n yieldAll(iterator)\n } else {\n yieldAll(defaultValue())\n }\n}\n\n/**\n * Returns a sequence of all elements from all sequences in this sequence.\n *\n * The operation is _intermediate_ and _stateless_.\n *\n * @sample samples.collections.Sequences.Transformations.flattenSequenceOfSequences\n */\npublic fun Sequence>.flatten(): Sequence = flatten { it.iterator() }\n\n/**\n * Returns a sequence of all elements from all iterables in this sequence.\n *\n * The operation is _intermediate_ and _stateless_.\n *\n * @sample samples.collections.Sequences.Transformations.flattenSequenceOfLists\n */\n@kotlin.jvm.JvmName(\"flattenSequenceOfIterable\")\npublic fun Sequence>.flatten(): Sequence = flatten { it.iterator() }\n\nprivate fun Sequence.flatten(iterator: (T) -> Iterator): Sequence {\n if (this is TransformingSequence<*, *>) {\n return (this as TransformingSequence<*, T>).flatten(iterator)\n }\n return FlatteningSequence(this, { it }, iterator)\n}\n\n/**\n * Returns a pair of lists, where\n * *first* list is built from the first values of each pair from this sequence,\n * *second* list is built from the second values of each pair from this sequence.\n *\n * The operation is _terminal_.\n *\n * @sample samples.collections.Sequences.Transformations.unzip\n */\npublic fun Sequence>.unzip(): Pair, List> {\n val listT = ArrayList()\n val listR = ArrayList()\n for (pair in this) {\n listT.add(pair.first)\n listR.add(pair.second)\n }\n return listT to listR\n}\n\n/**\n * Returns a sequence that yields elements of this sequence randomly shuffled.\n *\n * Note that every iteration of the sequence returns elements in a different order.\n *\n * The operation is _intermediate_ and _stateful_.\n */\n@SinceKotlin(\"1.4\")\npublic fun Sequence.shuffled(): Sequence = shuffled(Random)\n\n/**\n * Returns a sequence that yields elements of this sequence randomly shuffled\n * using the specified [random] instance as the source of randomness.\n *\n * Note that every iteration of the sequence returns elements in a different order.\n *\n * The operation is _intermediate_ and _stateful_.\n */\n@SinceKotlin(\"1.4\")\npublic fun Sequence.shuffled(random: Random): Sequence = sequence {\n val buffer = toMutableList()\n while (buffer.isNotEmpty()) {\n val j = random.nextInt(buffer.size)\n val last = buffer.removeLast()\n val value = if (j < buffer.size) buffer.set(j, last) else last\n yield(value)\n }\n}\n\n\n/**\n * A sequence that returns the values from the underlying [sequence] that either match or do not match\n * the specified [predicate].\n *\n * @param sendWhen If `true`, values for which the predicate returns `true` are returned. Otherwise,\n * values for which the predicate returns `false` are returned\n */\ninternal class FilteringSequence(\n private val sequence: Sequence,\n private val sendWhen: Boolean = true,\n private val predicate: (T) -> Boolean\n) : Sequence {\n\n override fun iterator(): Iterator = object : Iterator {\n val iterator = sequence.iterator()\n var nextState: Int = -1 // -1 for unknown, 0 for done, 1 for continue\n var nextItem: T? = null\n\n private fun calcNext() {\n while (iterator.hasNext()) {\n val item = iterator.next()\n if (predicate(item) == sendWhen) {\n nextItem = item\n nextState = 1\n return\n }\n }\n nextState = 0\n }\n\n override fun next(): T {\n if (nextState == -1)\n calcNext()\n if (nextState == 0)\n throw NoSuchElementException()\n val result = nextItem\n nextItem = null\n nextState = -1\n @Suppress(\"UNCHECKED_CAST\")\n return result as T\n }\n\n override fun hasNext(): Boolean {\n if (nextState == -1)\n calcNext()\n return nextState == 1\n }\n }\n}\n\n/**\n * A sequence which returns the results of applying the given [transformer] function to the values\n * in the underlying [sequence].\n */\n\ninternal class TransformingSequence\nconstructor(private val sequence: Sequence, private val transformer: (T) -> R) : Sequence {\n override fun iterator(): Iterator = object : Iterator {\n val iterator = sequence.iterator()\n override fun next(): R {\n return transformer(iterator.next())\n }\n\n override fun hasNext(): Boolean {\n return iterator.hasNext()\n }\n }\n\n internal fun flatten(iterator: (R) -> Iterator): Sequence {\n return FlatteningSequence(sequence, transformer, iterator)\n }\n}\n\n/**\n * A sequence which returns the results of applying the given [transformer] function to the values\n * in the underlying [sequence], where the transformer function takes the index of the value in the underlying\n * sequence along with the value itself.\n */\ninternal class TransformingIndexedSequence\nconstructor(private val sequence: Sequence, private val transformer: (Int, T) -> R) : Sequence {\n override fun iterator(): Iterator = object : Iterator {\n val iterator = sequence.iterator()\n var index = 0\n override fun next(): R {\n return transformer(checkIndexOverflow(index++), iterator.next())\n }\n\n override fun hasNext(): Boolean {\n return iterator.hasNext()\n }\n }\n}\n\n/**\n * A sequence which combines values from the underlying [sequence] with their indices and returns them as\n * [IndexedValue] objects.\n */\ninternal class IndexingSequence\nconstructor(private val sequence: Sequence) : Sequence> {\n override fun iterator(): Iterator> = object : Iterator> {\n val iterator = sequence.iterator()\n var index = 0\n override fun next(): IndexedValue {\n return IndexedValue(checkIndexOverflow(index++), iterator.next())\n }\n\n override fun hasNext(): Boolean {\n return iterator.hasNext()\n }\n }\n}\n\n/**\n * A sequence which takes the values from two parallel underlying sequences, passes them to the given\n * [transform] function and returns the values returned by that function. The sequence stops returning\n * values as soon as one of the underlying sequences stops returning values.\n */\ninternal class MergingSequence\nconstructor(\n private val sequence1: Sequence,\n private val sequence2: Sequence,\n private val transform: (T1, T2) -> V\n) : Sequence {\n override fun iterator(): Iterator = object : Iterator {\n val iterator1 = sequence1.iterator()\n val iterator2 = sequence2.iterator()\n override fun next(): V {\n return transform(iterator1.next(), iterator2.next())\n }\n\n override fun hasNext(): Boolean {\n return iterator1.hasNext() && iterator2.hasNext()\n }\n }\n}\n\ninternal class FlatteningSequence\nconstructor(\n private val sequence: Sequence,\n private val transformer: (T) -> R,\n private val iterator: (R) -> Iterator\n) : Sequence {\n override fun iterator(): Iterator = object : Iterator {\n val iterator = sequence.iterator()\n var itemIterator: Iterator? = null\n\n override fun next(): E {\n if (!ensureItemIterator())\n throw NoSuchElementException()\n return itemIterator!!.next()\n }\n\n override fun hasNext(): Boolean {\n return ensureItemIterator()\n }\n\n private fun ensureItemIterator(): Boolean {\n if (itemIterator?.hasNext() == false)\n itemIterator = null\n\n while (itemIterator == null) {\n if (!iterator.hasNext()) {\n return false\n } else {\n val element = iterator.next()\n val nextItemIterator = iterator(transformer(element))\n if (nextItemIterator.hasNext()) {\n itemIterator = nextItemIterator\n return true\n }\n }\n }\n return true\n }\n }\n}\n\ninternal fun flatMapIndexed(source: Sequence, transform: (Int, T) -> C, iterator: (C) -> Iterator): Sequence =\n sequence {\n var index = 0\n for (element in source) {\n val result = transform(checkIndexOverflow(index++), element)\n yieldAll(iterator(result))\n }\n }\n\n/**\n * A sequence that supports drop(n) and take(n) operations\n */\ninternal interface DropTakeSequence : Sequence {\n fun drop(n: Int): Sequence\n fun take(n: Int): Sequence\n}\n\n/**\n * A sequence that skips [startIndex] values from the underlying [sequence]\n * and stops returning values right before [endIndex], i.e. stops at `endIndex - 1`\n */\ninternal class SubSequence(\n private val sequence: Sequence,\n private val startIndex: Int,\n private val endIndex: Int\n) : Sequence, DropTakeSequence {\n\n init {\n require(startIndex >= 0) { \"startIndex should be non-negative, but is $startIndex\" }\n require(endIndex >= 0) { \"endIndex should be non-negative, but is $endIndex\" }\n require(endIndex >= startIndex) { \"endIndex should be not less than startIndex, but was $endIndex < $startIndex\" }\n }\n\n private val count: Int get() = endIndex - startIndex\n\n override fun drop(n: Int): Sequence = if (n >= count) emptySequence() else SubSequence(sequence, startIndex + n, endIndex)\n override fun take(n: Int): Sequence = if (n >= count) this else SubSequence(sequence, startIndex, startIndex + n)\n\n override fun iterator() = object : Iterator {\n\n val iterator = sequence.iterator()\n var position = 0\n\n // Shouldn't be called from constructor to avoid premature iteration\n private fun drop() {\n while (position < startIndex && iterator.hasNext()) {\n iterator.next()\n position++\n }\n }\n\n override fun hasNext(): Boolean {\n drop()\n return (position < endIndex) && iterator.hasNext()\n }\n\n override fun next(): T {\n drop()\n if (position >= endIndex)\n throw NoSuchElementException()\n position++\n return iterator.next()\n }\n }\n}\n\n/**\n * A sequence that returns at most [count] values from the underlying [sequence], and stops returning values\n * as soon as that count is reached.\n */\ninternal class TakeSequence(\n private val sequence: Sequence,\n private val count: Int\n) : Sequence, DropTakeSequence {\n\n init {\n require(count >= 0) { \"count must be non-negative, but was $count.\" }\n }\n\n override fun drop(n: Int): Sequence = if (n >= count) emptySequence() else SubSequence(sequence, n, count)\n override fun take(n: Int): Sequence = if (n >= count) this else TakeSequence(sequence, n)\n\n override fun iterator(): Iterator = object : Iterator {\n var left = count\n val iterator = sequence.iterator()\n\n override fun next(): T {\n if (left == 0)\n throw NoSuchElementException()\n left--\n return iterator.next()\n }\n\n override fun hasNext(): Boolean {\n return left > 0 && iterator.hasNext()\n }\n }\n}\n\n/**\n * A sequence that returns values from the underlying [sequence] while the [predicate] function returns\n * `true`, and stops returning values once the function returns `false` for the next element.\n */\ninternal class TakeWhileSequence\nconstructor(\n private val sequence: Sequence,\n private val predicate: (T) -> Boolean\n) : Sequence {\n override fun iterator(): Iterator = object : Iterator {\n val iterator = sequence.iterator()\n var nextState: Int = -1 // -1 for unknown, 0 for done, 1 for continue\n var nextItem: T? = null\n\n private fun calcNext() {\n if (iterator.hasNext()) {\n val item = iterator.next()\n if (predicate(item)) {\n nextState = 1\n nextItem = item\n return\n }\n }\n nextState = 0\n }\n\n override fun next(): T {\n if (nextState == -1)\n calcNext() // will change nextState\n if (nextState == 0)\n throw NoSuchElementException()\n @Suppress(\"UNCHECKED_CAST\")\n val result = nextItem as T\n\n // Clean next to avoid keeping reference on yielded instance\n nextItem = null\n nextState = -1\n return result\n }\n\n override fun hasNext(): Boolean {\n if (nextState == -1)\n calcNext() // will change nextState\n return nextState == 1\n }\n }\n}\n\n/**\n * A sequence that skips the specified number of values from the underlying [sequence] and returns\n * all values after that.\n */\ninternal class DropSequence(\n private val sequence: Sequence,\n private val count: Int\n) : Sequence, DropTakeSequence {\n init {\n require(count >= 0) { \"count must be non-negative, but was $count.\" }\n }\n\n override fun drop(n: Int): Sequence = (count + n).let { n1 -> if (n1 < 0) DropSequence(this, n) else DropSequence(sequence, n1) }\n override fun take(n: Int): Sequence = (count + n).let { n1 -> if (n1 < 0) TakeSequence(this, n) else SubSequence(sequence, count, n1) }\n\n override fun iterator(): Iterator = object : Iterator {\n val iterator = sequence.iterator()\n var left = count\n\n // Shouldn't be called from constructor to avoid premature iteration\n private fun drop() {\n while (left > 0 && iterator.hasNext()) {\n iterator.next()\n left--\n }\n }\n\n override fun next(): T {\n drop()\n return iterator.next()\n }\n\n override fun hasNext(): Boolean {\n drop()\n return iterator.hasNext()\n }\n }\n}\n\n/**\n * A sequence that skips the values from the underlying [sequence] while the given [predicate] returns `true` and returns\n * all values after that.\n */\ninternal class DropWhileSequence\nconstructor(\n private val sequence: Sequence,\n private val predicate: (T) -> Boolean\n) : Sequence {\n\n override fun iterator(): Iterator = object : Iterator {\n val iterator = sequence.iterator()\n var dropState: Int = -1 // -1 for not dropping, 1 for nextItem, 0 for normal iteration\n var nextItem: T? = null\n\n private fun drop() {\n while (iterator.hasNext()) {\n val item = iterator.next()\n if (!predicate(item)) {\n nextItem = item\n dropState = 1\n return\n }\n }\n dropState = 0\n }\n\n override fun next(): T {\n if (dropState == -1)\n drop()\n\n if (dropState == 1) {\n @Suppress(\"UNCHECKED_CAST\")\n val result = nextItem as T\n nextItem = null\n dropState = 0\n return result\n }\n return iterator.next()\n }\n\n override fun hasNext(): Boolean {\n if (dropState == -1)\n drop()\n return dropState == 1 || iterator.hasNext()\n }\n }\n}\n\ninternal class DistinctSequence(private val source: Sequence, private val keySelector: (T) -> K) : Sequence {\n override fun iterator(): Iterator = DistinctIterator(source.iterator(), keySelector)\n}\n\nprivate class DistinctIterator(private val source: Iterator, private val keySelector: (T) -> K) : AbstractIterator() {\n private val observed = HashSet()\n\n override fun computeNext() {\n while (source.hasNext()) {\n val next = source.next()\n val key = keySelector(next)\n\n if (observed.add(key)) {\n setNext(next)\n return\n }\n }\n\n done()\n }\n}\n\n\nprivate class GeneratorSequence(private val getInitialValue: () -> T?, private val getNextValue: (T) -> T?) : Sequence {\n override fun iterator(): Iterator = object : Iterator {\n var nextItem: T? = null\n var nextState: Int = -2 // -2 for initial unknown, -1 for next unknown, 0 for done, 1 for continue\n\n private fun calcNext() {\n nextItem = if (nextState == -2) getInitialValue() else getNextValue(nextItem!!)\n nextState = if (nextItem == null) 0 else 1\n }\n\n override fun next(): T {\n if (nextState < 0)\n calcNext()\n\n if (nextState == 0)\n throw NoSuchElementException()\n val result = nextItem as T\n // Do not clean nextItem (to avoid keeping reference on yielded instance) -- need to keep state for getNextValue\n nextState = -1\n return result\n }\n\n override fun hasNext(): Boolean {\n if (nextState < 0)\n calcNext()\n return nextState == 1\n }\n }\n}\n\n/**\n * Returns a wrapper sequence that provides values of this sequence, but ensures it can be iterated only one time.\n *\n * The operation is _intermediate_ and _stateless_.\n *\n * [IllegalStateException] is thrown on iterating the returned sequence for the second time and the following times.\n *\n */\npublic fun Sequence.constrainOnce(): Sequence {\n // as? does not work in js\n //return this as? ConstrainedOnceSequence ?: ConstrainedOnceSequence(this)\n return if (this is ConstrainedOnceSequence) this else ConstrainedOnceSequence(this)\n}\n\n\n/**\n * Returns a sequence which invokes the function to calculate the next value on each iteration until the function returns `null`.\n *\n * The returned sequence is constrained to be iterated only once.\n *\n * @see constrainOnce\n * @see kotlin.sequences.sequence\n *\n * @sample samples.collections.Sequences.Building.generateSequence\n */\npublic fun generateSequence(nextFunction: () -> T?): Sequence {\n return GeneratorSequence(nextFunction, { nextFunction() }).constrainOnce()\n}\n\n/**\n * Returns a sequence defined by the starting value [seed] and the function [nextFunction],\n * which is invoked to calculate the next value based on the previous one on each iteration.\n *\n * The sequence produces values until it encounters first `null` value.\n * If [seed] is `null`, an empty sequence is produced.\n *\n * The sequence can be iterated multiple times, each time starting with [seed].\n *\n * @see kotlin.sequences.sequence\n *\n * @sample samples.collections.Sequences.Building.generateSequenceWithSeed\n */\n@kotlin.internal.LowPriorityInOverloadResolution\npublic fun generateSequence(seed: T?, nextFunction: (T) -> T?): Sequence =\n if (seed == null)\n EmptySequence\n else\n GeneratorSequence({ seed }, nextFunction)\n\n/**\n * Returns a sequence defined by the function [seedFunction], which is invoked to produce the starting value,\n * and the [nextFunction], which is invoked to calculate the next value based on the previous one on each iteration.\n *\n * The sequence produces values until it encounters first `null` value.\n * If [seedFunction] returns `null`, an empty sequence is produced.\n *\n * The sequence can be iterated multiple times.\n *\n * @see kotlin.sequences.sequence\n *\n * @sample samples.collections.Sequences.Building.generateSequenceWithLazySeed\n */\npublic fun generateSequence(seedFunction: () -> T?, nextFunction: (T) -> T?): Sequence =\n GeneratorSequence(seedFunction, nextFunction)\n\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"CollectionsKt\")\n\npackage kotlin.collections\n\n//\n// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt\n// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib\n//\n\nimport kotlin.random.*\nimport kotlin.ranges.contains\nimport kotlin.ranges.reversed\n\n/**\n * Returns 1st *element* from the list.\n * \n * Throws an [IndexOutOfBoundsException] if the size of this list is less than 1.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun List.component1(): T {\n return get(0)\n}\n\n/**\n * Returns 2nd *element* from the list.\n * \n * Throws an [IndexOutOfBoundsException] if the size of this list is less than 2.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun List.component2(): T {\n return get(1)\n}\n\n/**\n * Returns 3rd *element* from the list.\n * \n * Throws an [IndexOutOfBoundsException] if the size of this list is less than 3.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun List.component3(): T {\n return get(2)\n}\n\n/**\n * Returns 4th *element* from the list.\n * \n * Throws an [IndexOutOfBoundsException] if the size of this list is less than 4.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun List.component4(): T {\n return get(3)\n}\n\n/**\n * Returns 5th *element* from the list.\n * \n * Throws an [IndexOutOfBoundsException] if the size of this list is less than 5.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun List.component5(): T {\n return get(4)\n}\n\n/**\n * Returns `true` if [element] is found in the collection.\n */\npublic operator fun <@kotlin.internal.OnlyInputTypes T> Iterable.contains(element: T): Boolean {\n if (this is Collection)\n return contains(element)\n return indexOf(element) >= 0\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this collection.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic fun Iterable.elementAt(index: Int): T {\n if (this is List)\n return get(index)\n return elementAtOrElse(index) { throw IndexOutOfBoundsException(\"Collection doesn't contain element at index $index.\") }\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this list.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\n@kotlin.internal.InlineOnly\npublic inline fun List.elementAt(index: Int): T {\n return get(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this collection.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\npublic fun Iterable.elementAtOrElse(index: Int, defaultValue: (Int) -> T): T {\n if (this is List)\n return this.getOrElse(index, defaultValue)\n if (index < 0)\n return defaultValue(index)\n val iterator = iterator()\n var count = 0\n while (iterator.hasNext()) {\n val element = iterator.next()\n if (index == count++)\n return element\n }\n return defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this list.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@kotlin.internal.InlineOnly\npublic inline fun List.elementAtOrElse(index: Int, defaultValue: (Int) -> T): T {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this collection.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\npublic fun Iterable.elementAtOrNull(index: Int): T? {\n if (this is List)\n return this.getOrNull(index)\n if (index < 0)\n return null\n val iterator = iterator()\n var count = 0\n while (iterator.hasNext()) {\n val element = iterator.next()\n if (index == count++)\n return element\n }\n return null\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this list.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@kotlin.internal.InlineOnly\npublic inline fun List.elementAtOrNull(index: Int): T? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.find(predicate: (T) -> Boolean): T? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.findLast(predicate: (T) -> Boolean): T? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun List.findLast(predicate: (T) -> Boolean): T? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns first element.\n * @throws [NoSuchElementException] if the collection is empty.\n */\npublic fun Iterable.first(): T {\n when (this) {\n is List -> return this.first()\n else -> {\n val iterator = iterator()\n if (!iterator.hasNext())\n throw NoSuchElementException(\"Collection is empty.\")\n return iterator.next()\n }\n }\n}\n\n/**\n * Returns first element.\n * @throws [NoSuchElementException] if the list is empty.\n */\npublic fun List.first(): T {\n if (isEmpty())\n throw NoSuchElementException(\"List is empty.\")\n return this[0]\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun Iterable.first(predicate: (T) -> Boolean): T {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Collection contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first non-null value produced by [transform] function being applied to elements of this collection in iteration order,\n * or throws [NoSuchElementException] if no non-null value was produced.\n * \n * @sample samples.collections.Collections.Transformations.firstNotNullOf\n */\n@SinceKotlin(\"1.5\")\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.firstNotNullOf(transform: (T) -> R?): R {\n return firstNotNullOfOrNull(transform) ?: throw NoSuchElementException(\"No element of the collection was transformed to a non-null value.\")\n}\n\n/**\n * Returns the first non-null value produced by [transform] function being applied to elements of this collection in iteration order,\n * or `null` if no non-null value was produced.\n * \n * @sample samples.collections.Collections.Transformations.firstNotNullOf\n */\n@SinceKotlin(\"1.5\")\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.firstNotNullOfOrNull(transform: (T) -> R?): R? {\n for (element in this) {\n val result = transform(element)\n if (result != null) {\n return result\n }\n }\n return null\n}\n\n/**\n * Returns the first element, or `null` if the collection is empty.\n */\npublic fun Iterable.firstOrNull(): T? {\n when (this) {\n is List -> {\n if (isEmpty())\n return null\n else\n return this[0]\n }\n else -> {\n val iterator = iterator()\n if (!iterator.hasNext())\n return null\n return iterator.next()\n }\n }\n}\n\n/**\n * Returns the first element, or `null` if the list is empty.\n */\npublic fun List.firstOrNull(): T? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n */\npublic inline fun Iterable.firstOrNull(predicate: (T) -> Boolean): T? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this list.\n */\n@kotlin.internal.InlineOnly\npublic inline fun List.getOrElse(index: Int, defaultValue: (Int) -> T): T {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this list.\n * \n * @sample samples.collections.Collections.Elements.getOrNull\n */\npublic fun List.getOrNull(index: Int): T? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns first index of [element], or -1 if the collection does not contain element.\n */\npublic fun <@kotlin.internal.OnlyInputTypes T> Iterable.indexOf(element: T): Int {\n if (this is List) return this.indexOf(element)\n var index = 0\n for (item in this) {\n checkIndexOverflow(index)\n if (element == item)\n return index\n index++\n }\n return -1\n}\n\n/**\n * Returns first index of [element], or -1 if the list does not contain element.\n */\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\") // false warning, extension takes precedence in some cases\npublic fun <@kotlin.internal.OnlyInputTypes T> List.indexOf(element: T): Int {\n return indexOf(element)\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element.\n */\npublic inline fun Iterable.indexOfFirst(predicate: (T) -> Boolean): Int {\n var index = 0\n for (item in this) {\n checkIndexOverflow(index)\n if (predicate(item))\n return index\n index++\n }\n return -1\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the list does not contain such element.\n */\npublic inline fun List.indexOfFirst(predicate: (T) -> Boolean): Int {\n var index = 0\n for (item in this) {\n if (predicate(item))\n return index\n index++\n }\n return -1\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element.\n */\npublic inline fun Iterable.indexOfLast(predicate: (T) -> Boolean): Int {\n var lastIndex = -1\n var index = 0\n for (item in this) {\n checkIndexOverflow(index)\n if (predicate(item))\n lastIndex = index\n index++\n }\n return lastIndex\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the list does not contain such element.\n */\npublic inline fun List.indexOfLast(predicate: (T) -> Boolean): Int {\n val iterator = this.listIterator(size)\n while (iterator.hasPrevious()) {\n if (predicate(iterator.previous())) {\n return iterator.nextIndex()\n }\n }\n return -1\n}\n\n/**\n * Returns the last element.\n * \n * @throws NoSuchElementException if the collection is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun Iterable.last(): T {\n when (this) {\n is List -> return this.last()\n else -> {\n val iterator = iterator()\n if (!iterator.hasNext())\n throw NoSuchElementException(\"Collection is empty.\")\n var last = iterator.next()\n while (iterator.hasNext())\n last = iterator.next()\n return last\n }\n }\n}\n\n/**\n * Returns the last element.\n * \n * @throws NoSuchElementException if the list is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun List.last(): T {\n if (isEmpty())\n throw NoSuchElementException(\"List is empty.\")\n return this[lastIndex]\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * \n * @throws NoSuchElementException if no such element is found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun Iterable.last(predicate: (T) -> Boolean): T {\n var last: T? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n last = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Collection contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return last as T\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * \n * @throws NoSuchElementException if no such element is found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun List.last(predicate: (T) -> Boolean): T {\n val iterator = this.listIterator(size)\n while (iterator.hasPrevious()) {\n val element = iterator.previous()\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"List contains no element matching the predicate.\")\n}\n\n/**\n * Returns last index of [element], or -1 if the collection does not contain element.\n */\npublic fun <@kotlin.internal.OnlyInputTypes T> Iterable.lastIndexOf(element: T): Int {\n if (this is List) return this.lastIndexOf(element)\n var lastIndex = -1\n var index = 0\n for (item in this) {\n checkIndexOverflow(index)\n if (element == item)\n lastIndex = index\n index++\n }\n return lastIndex\n}\n\n/**\n * Returns last index of [element], or -1 if the list does not contain element.\n */\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\") // false warning, extension takes precedence in some cases\npublic fun <@kotlin.internal.OnlyInputTypes T> List.lastIndexOf(element: T): Int {\n return lastIndexOf(element)\n}\n\n/**\n * Returns the last element, or `null` if the collection is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun Iterable.lastOrNull(): T? {\n when (this) {\n is List -> return if (isEmpty()) null else this[size - 1]\n else -> {\n val iterator = iterator()\n if (!iterator.hasNext())\n return null\n var last = iterator.next()\n while (iterator.hasNext())\n last = iterator.next()\n return last\n }\n }\n}\n\n/**\n * Returns the last element, or `null` if the list is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun List.lastOrNull(): T? {\n return if (isEmpty()) null else this[size - 1]\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun Iterable.lastOrNull(predicate: (T) -> Boolean): T? {\n var last: T? = null\n for (element in this) {\n if (predicate(element)) {\n last = element\n }\n }\n return last\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun List.lastOrNull(predicate: (T) -> Boolean): T? {\n val iterator = this.listIterator(size)\n while (iterator.hasPrevious()) {\n val element = iterator.previous()\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns a random element from this collection.\n * \n * @throws NoSuchElementException if this collection is empty.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun Collection.random(): T {\n return random(Random)\n}\n\n/**\n * Returns a random element from this collection using the specified source of randomness.\n * \n * @throws NoSuchElementException if this collection is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun Collection.random(random: Random): T {\n if (isEmpty())\n throw NoSuchElementException(\"Collection is empty.\")\n return elementAt(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this collection, or `null` if this collection is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun Collection.randomOrNull(): T? {\n return randomOrNull(Random)\n}\n\n/**\n * Returns a random element from this collection using the specified source of randomness, or `null` if this collection is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun Collection.randomOrNull(random: Random): T? {\n if (isEmpty())\n return null\n return elementAt(random.nextInt(size))\n}\n\n/**\n * Returns the single element, or throws an exception if the collection is empty or has more than one element.\n */\npublic fun Iterable.single(): T {\n when (this) {\n is List -> return this.single()\n else -> {\n val iterator = iterator()\n if (!iterator.hasNext())\n throw NoSuchElementException(\"Collection is empty.\")\n val single = iterator.next()\n if (iterator.hasNext())\n throw IllegalArgumentException(\"Collection has more than one element.\")\n return single\n }\n }\n}\n\n/**\n * Returns the single element, or throws an exception if the list is empty or has more than one element.\n */\npublic fun List.single(): T {\n return when (size) {\n 0 -> throw NoSuchElementException(\"List is empty.\")\n 1 -> this[0]\n else -> throw IllegalArgumentException(\"List has more than one element.\")\n }\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n */\npublic inline fun Iterable.single(predicate: (T) -> Boolean): T {\n var single: T? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Collection contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Collection contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as T\n}\n\n/**\n * Returns single element, or `null` if the collection is empty or has more than one element.\n */\npublic fun Iterable.singleOrNull(): T? {\n when (this) {\n is List -> return if (size == 1) this[0] else null\n else -> {\n val iterator = iterator()\n if (!iterator.hasNext())\n return null\n val single = iterator.next()\n if (iterator.hasNext())\n return null\n return single\n }\n }\n}\n\n/**\n * Returns single element, or `null` if the list is empty or has more than one element.\n */\npublic fun List.singleOrNull(): T? {\n return if (size == 1) this[0] else null\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n */\npublic inline fun Iterable.singleOrNull(predicate: (T) -> Boolean): T? {\n var single: T? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns a list containing all elements except first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun Iterable.drop(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return toList()\n val list: ArrayList\n if (this is Collection<*>) {\n val resultSize = size - n\n if (resultSize <= 0)\n return emptyList()\n if (resultSize == 1)\n return listOf(last())\n list = ArrayList(resultSize)\n if (this is List) {\n if (this is RandomAccess) {\n for (index in n until size)\n list.add(this[index])\n } else {\n for (item in listIterator(n))\n list.add(item)\n }\n return list\n }\n }\n else {\n list = ArrayList()\n }\n var count = 0\n for (item in this) {\n if (count >= n) list.add(item) else ++count\n }\n return list.optimizeReadOnlyList()\n}\n\n/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun List.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun List.dropLastWhile(predicate: (T) -> Boolean): List {\n if (!isEmpty()) {\n val iterator = listIterator(size)\n while (iterator.hasPrevious()) {\n if (!predicate(iterator.previous())) {\n return take(iterator.nextIndex() + 1)\n }\n }\n }\n return emptyList()\n}\n\n/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun Iterable.dropWhile(predicate: (T) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\npublic inline fun Iterable.filter(predicate: (T) -> Boolean): List {\n return filterTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexed\n */\npublic inline fun Iterable.filterIndexed(predicate: (index: Int, T) -> Boolean): List {\n return filterIndexedTo(ArrayList(), predicate)\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexedTo\n */\npublic inline fun > Iterable.filterIndexedTo(destination: C, predicate: (index: Int, T) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Returns a list containing all elements that are instances of specified type parameter R.\n * \n * @sample samples.collections.Collections.Filtering.filterIsInstance\n */\npublic inline fun Iterable<*>.filterIsInstance(): List<@kotlin.internal.NoInfer R> {\n return filterIsInstanceTo(ArrayList())\n}\n\n/**\n * Appends all elements that are instances of specified type parameter R to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterIsInstanceTo\n */\npublic inline fun > Iterable<*>.filterIsInstanceTo(destination: C): C {\n for (element in this) if (element is R) destination.add(element)\n return destination\n}\n\n/**\n * Returns a list containing all elements not matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\npublic inline fun Iterable.filterNot(predicate: (T) -> Boolean): List {\n return filterNotTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing all elements that are not `null`.\n * \n * @sample samples.collections.Collections.Filtering.filterNotNull\n */\npublic fun Iterable.filterNotNull(): List {\n return filterNotNullTo(ArrayList())\n}\n\n/**\n * Appends all elements that are not `null` to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterNotNullTo\n */\npublic fun , T : Any> Iterable.filterNotNullTo(destination: C): C {\n for (element in this) if (element != null) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun > Iterable.filterNotTo(destination: C, predicate: (T) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun > Iterable.filterTo(destination: C, predicate: (T) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Returns a list containing elements at indices in the specified [indices] range.\n */\npublic fun List.slice(indices: IntRange): List {\n if (indices.isEmpty()) return listOf()\n return this.subList(indices.start, indices.endInclusive + 1).toList()\n}\n\n/**\n * Returns a list containing elements at specified [indices].\n */\npublic fun List.slice(indices: Iterable): List {\n val size = indices.collectionSizeOrDefault(10)\n if (size == 0) return emptyList()\n val list = ArrayList(size)\n for (index in indices) {\n list.add(get(index))\n }\n return list\n}\n\n/**\n * Returns a list containing first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun Iterable.take(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n if (this is Collection) {\n if (n >= size) return toList()\n if (n == 1) return listOf(first())\n }\n var count = 0\n val list = ArrayList(n)\n for (item in this) {\n list.add(item)\n if (++count == n)\n break\n }\n return list.optimizeReadOnlyList()\n}\n\n/**\n * Returns a list containing last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun List.takeLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n val size = size\n if (n >= size) return toList()\n if (n == 1) return listOf(last())\n val list = ArrayList(n)\n if (this is RandomAccess) {\n for (index in size - n until size)\n list.add(this[index])\n } else {\n for (item in listIterator(size - n))\n list.add(item)\n }\n return list\n}\n\n/**\n * Returns a list containing last elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic inline fun List.takeLastWhile(predicate: (T) -> Boolean): List {\n if (isEmpty())\n return emptyList()\n val iterator = listIterator(size)\n while (iterator.hasPrevious()) {\n if (!predicate(iterator.previous())) {\n iterator.next()\n val expectedSize = size - iterator.nextIndex()\n if (expectedSize == 0) return emptyList()\n return ArrayList(expectedSize).apply {\n while (iterator.hasNext())\n add(iterator.next())\n }\n }\n }\n return toList()\n}\n\n/**\n * Returns a list containing first elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic inline fun Iterable.takeWhile(predicate: (T) -> Boolean): List {\n val list = ArrayList()\n for (item in this) {\n if (!predicate(item))\n break\n list.add(item)\n }\n return list\n}\n\n/**\n * Reverses elements in the list in-place.\n */\npublic expect fun MutableList.reverse(): Unit\n\n/**\n * Returns a list with elements in reversed order.\n */\npublic fun Iterable.reversed(): List {\n if (this is Collection && size <= 1) return toList()\n val list = toMutableList()\n list.reverse()\n return list\n}\n\n/**\n * Randomly shuffles elements in this list in-place using the specified [random] instance as the source of randomness.\n * \n * See: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm\n */\n@SinceKotlin(\"1.3\")\npublic fun MutableList.shuffle(random: Random): Unit {\n for (i in lastIndex downTo 1) {\n val j = random.nextInt(i + 1)\n this[j] = this.set(i, this[j])\n }\n}\n\n/**\n * Sorts elements in the list in-place according to natural sort order of the value returned by specified [selector] function.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic inline fun > MutableList.sortBy(crossinline selector: (T) -> R?): Unit {\n if (size > 1) sortWith(compareBy(selector))\n}\n\n/**\n * Sorts elements in the list in-place descending according to natural sort order of the value returned by specified [selector] function.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic inline fun > MutableList.sortByDescending(crossinline selector: (T) -> R?): Unit {\n if (size > 1) sortWith(compareByDescending(selector))\n}\n\n/**\n * Sorts elements in the list in-place descending according to their natural sort order.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic fun > MutableList.sortDescending(): Unit {\n sortWith(reverseOrder())\n}\n\n/**\n * Returns a list of all elements sorted according to their natural sort order.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic fun > Iterable.sorted(): List {\n if (this is Collection) {\n if (size <= 1) return this.toList()\n @Suppress(\"UNCHECKED_CAST\")\n return (toTypedArray>() as Array).apply { sort() }.asList()\n }\n return toMutableList().apply { sort() }\n}\n\n/**\n * Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n * \n * @sample samples.collections.Collections.Sorting.sortedBy\n */\npublic inline fun > Iterable.sortedBy(crossinline selector: (T) -> R?): List {\n return sortedWith(compareBy(selector))\n}\n\n/**\n * Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic inline fun > Iterable.sortedByDescending(crossinline selector: (T) -> R?): List {\n return sortedWith(compareByDescending(selector))\n}\n\n/**\n * Returns a list of all elements sorted descending according to their natural sort order.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic fun > Iterable.sortedDescending(): List {\n return sortedWith(reverseOrder())\n}\n\n/**\n * Returns a list of all elements sorted according to the specified [comparator].\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic fun Iterable.sortedWith(comparator: Comparator): List {\n if (this is Collection) {\n if (size <= 1) return this.toList()\n @Suppress(\"UNCHECKED_CAST\")\n return (toTypedArray() as Array).apply { sortWith(comparator) }.asList()\n }\n return toMutableList().apply { sortWith(comparator) }\n}\n\n/**\n * Returns an array of Boolean containing all of the elements of this collection.\n */\npublic fun Collection.toBooleanArray(): BooleanArray {\n val result = BooleanArray(size)\n var index = 0\n for (element in this)\n result[index++] = element\n return result\n}\n\n/**\n * Returns an array of Byte containing all of the elements of this collection.\n */\npublic fun Collection.toByteArray(): ByteArray {\n val result = ByteArray(size)\n var index = 0\n for (element in this)\n result[index++] = element\n return result\n}\n\n/**\n * Returns an array of Char containing all of the elements of this collection.\n */\npublic fun Collection.toCharArray(): CharArray {\n val result = CharArray(size)\n var index = 0\n for (element in this)\n result[index++] = element\n return result\n}\n\n/**\n * Returns an array of Double containing all of the elements of this collection.\n */\npublic fun Collection.toDoubleArray(): DoubleArray {\n val result = DoubleArray(size)\n var index = 0\n for (element in this)\n result[index++] = element\n return result\n}\n\n/**\n * Returns an array of Float containing all of the elements of this collection.\n */\npublic fun Collection.toFloatArray(): FloatArray {\n val result = FloatArray(size)\n var index = 0\n for (element in this)\n result[index++] = element\n return result\n}\n\n/**\n * Returns an array of Int containing all of the elements of this collection.\n */\npublic fun Collection.toIntArray(): IntArray {\n val result = IntArray(size)\n var index = 0\n for (element in this)\n result[index++] = element\n return result\n}\n\n/**\n * Returns an array of Long containing all of the elements of this collection.\n */\npublic fun Collection.toLongArray(): LongArray {\n val result = LongArray(size)\n var index = 0\n for (element in this)\n result[index++] = element\n return result\n}\n\n/**\n * Returns an array of Short containing all of the elements of this collection.\n */\npublic fun Collection.toShortArray(): ShortArray {\n val result = ShortArray(size)\n var index = 0\n for (element in this)\n result[index++] = element\n return result\n}\n\n/**\n * Returns a [Map] containing key-value pairs provided by [transform] function\n * applied to elements of the given collection.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original collection.\n * \n * @sample samples.collections.Collections.Transformations.associate\n */\npublic inline fun Iterable.associate(transform: (T) -> Pair): Map {\n val capacity = mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16)\n return associateTo(LinkedHashMap(capacity), transform)\n}\n\n/**\n * Returns a [Map] containing the elements from the given collection indexed by the key\n * returned from [keySelector] function applied to each element.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original collection.\n * \n * @sample samples.collections.Collections.Transformations.associateBy\n */\npublic inline fun Iterable.associateBy(keySelector: (T) -> K): Map {\n val capacity = mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector)\n}\n\n/**\n * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given collection.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original collection.\n * \n * @sample samples.collections.Collections.Transformations.associateByWithValueTransform\n */\npublic inline fun Iterable.associateBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map {\n val capacity = mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform)\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function applied to each element of the given collection\n * and value is the element itself.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * @sample samples.collections.Collections.Transformations.associateByTo\n */\npublic inline fun > Iterable.associateByTo(destination: M, keySelector: (T) -> K): M {\n for (element in this) {\n destination.put(keySelector(element), element)\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function and\n * and value is provided by the [valueTransform] function applied to elements of the given collection.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * @sample samples.collections.Collections.Transformations.associateByToWithValueTransform\n */\npublic inline fun > Iterable.associateByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M {\n for (element in this) {\n destination.put(keySelector(element), valueTransform(element))\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs\n * provided by [transform] function applied to each element of the given collection.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * @sample samples.collections.Collections.Transformations.associateTo\n */\npublic inline fun > Iterable.associateTo(destination: M, transform: (T) -> Pair): M {\n for (element in this) {\n destination += transform(element)\n }\n return destination\n}\n\n/**\n * Returns a [Map] where keys are elements from the given collection and values are\n * produced by the [valueSelector] function applied to each element.\n * \n * If any two elements are equal, the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original collection.\n * \n * @sample samples.collections.Collections.Transformations.associateWith\n */\n@SinceKotlin(\"1.3\")\npublic inline fun Iterable.associateWith(valueSelector: (K) -> V): Map {\n val result = LinkedHashMap(mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16))\n return associateWithTo(result, valueSelector)\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs for each element of the given collection,\n * where key is the element itself and value is provided by the [valueSelector] function applied to that key.\n * \n * If any two elements are equal, the last one overwrites the former value in the map.\n * \n * @sample samples.collections.Collections.Transformations.associateWithTo\n */\n@SinceKotlin(\"1.3\")\npublic inline fun > Iterable.associateWithTo(destination: M, valueSelector: (K) -> V): M {\n for (element in this) {\n destination.put(element, valueSelector(element))\n }\n return destination\n}\n\n/**\n * Appends all elements to the given [destination] collection.\n */\npublic fun > Iterable.toCollection(destination: C): C {\n for (item in this) {\n destination.add(item)\n }\n return destination\n}\n\n/**\n * Returns a new [HashSet] of all elements.\n */\npublic fun Iterable.toHashSet(): HashSet {\n return toCollection(HashSet(mapCapacity(collectionSizeOrDefault(12))))\n}\n\n/**\n * Returns a [List] containing all elements.\n */\npublic fun Iterable.toList(): List {\n if (this is Collection) {\n return when (size) {\n 0 -> emptyList()\n 1 -> listOf(if (this is List) get(0) else iterator().next())\n else -> this.toMutableList()\n }\n }\n return this.toMutableList().optimizeReadOnlyList()\n}\n\n/**\n * Returns a new [MutableList] filled with all elements of this collection.\n */\npublic fun Iterable.toMutableList(): MutableList {\n if (this is Collection)\n return this.toMutableList()\n return toCollection(ArrayList())\n}\n\n/**\n * Returns a new [MutableList] filled with all elements of this collection.\n */\npublic fun Collection.toMutableList(): MutableList {\n return ArrayList(this)\n}\n\n/**\n * Returns a [Set] of all elements.\n * \n * The returned set preserves the element iteration order of the original collection.\n */\npublic fun Iterable.toSet(): Set {\n if (this is Collection) {\n return when (size) {\n 0 -> emptySet()\n 1 -> setOf(if (this is List) this[0] else iterator().next())\n else -> toCollection(LinkedHashSet(mapCapacity(size)))\n }\n }\n return toCollection(LinkedHashSet()).optimizeReadOnlySet()\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection.\n * \n * @sample samples.collections.Collections.Transformations.flatMap\n */\npublic inline fun Iterable.flatMap(transform: (T) -> Iterable): List {\n return flatMapTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection.\n * \n * @sample samples.collections.Collections.Transformations.flatMap\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapSequence\")\npublic inline fun Iterable.flatMap(transform: (T) -> Sequence): List {\n return flatMapTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original collection.\n * \n * @sample samples.collections.Collections.Transformations.flatMapIndexed\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterable\")\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.flatMapIndexed(transform: (index: Int, T) -> Iterable): List {\n return flatMapIndexedTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original collection.\n * \n * @sample samples.collections.Collections.Transformations.flatMapIndexed\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedSequence\")\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.flatMapIndexed(transform: (index: Int, T) -> Sequence): List {\n return flatMapIndexedTo(ArrayList(), transform)\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original collection, to the given [destination].\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterableTo\")\n@kotlin.internal.InlineOnly\npublic inline fun > Iterable.flatMapIndexedTo(destination: C, transform: (index: Int, T) -> Iterable): C {\n var index = 0\n for (element in this) {\n val list = transform(checkIndexOverflow(index++), element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original collection, to the given [destination].\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedSequenceTo\")\n@kotlin.internal.InlineOnly\npublic inline fun > Iterable.flatMapIndexedTo(destination: C, transform: (index: Int, T) -> Sequence): C {\n var index = 0\n for (element in this) {\n val list = transform(checkIndexOverflow(index++), element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination].\n */\npublic inline fun > Iterable.flatMapTo(destination: C, transform: (T) -> Iterable): C {\n for (element in this) {\n val list = transform(element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination].\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapSequenceTo\")\npublic inline fun > Iterable.flatMapTo(destination: C, transform: (T) -> Sequence): C {\n for (element in this) {\n val list = transform(element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Groups elements of the original collection by the key returned by the given [keySelector] function\n * applied to each element and returns a map where each group key is associated with a list of corresponding elements.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original collection.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun Iterable.groupBy(keySelector: (T) -> K): Map> {\n return groupByTo(LinkedHashMap>(), keySelector)\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original collection\n * by the key returned by the given [keySelector] function applied to the element\n * and returns a map where each group key is associated with a list of corresponding values.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original collection.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun Iterable.groupBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map> {\n return groupByTo(LinkedHashMap>(), keySelector, valueTransform)\n}\n\n/**\n * Groups elements of the original collection by the key returned by the given [keySelector] function\n * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun >> Iterable.groupByTo(destination: M, keySelector: (T) -> K): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(element)\n }\n return destination\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original collection\n * by the key returned by the given [keySelector] function applied to the element\n * and puts to the [destination] map each group key associated with a list of corresponding values.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun >> Iterable.groupByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(valueTransform(element))\n }\n return destination\n}\n\n/**\n * Creates a [Grouping] source from a collection to be used later with one of group-and-fold operations\n * using the specified [keySelector] function to extract a key from each element.\n * \n * @sample samples.collections.Grouping.groupingByEachCount\n */\n@SinceKotlin(\"1.1\")\npublic inline fun Iterable.groupingBy(crossinline keySelector: (T) -> K): Grouping {\n return object : Grouping {\n override fun sourceIterator(): Iterator = this@groupingBy.iterator()\n override fun keyOf(element: T): K = keySelector(element)\n }\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element in the original collection.\n * \n * @sample samples.collections.Collections.Transformations.map\n */\npublic inline fun Iterable.map(transform: (T) -> R): List {\n return mapTo(ArrayList(collectionSizeOrDefault(10)), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element and its index in the original collection.\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun Iterable.mapIndexed(transform: (index: Int, T) -> R): List {\n return mapIndexedTo(ArrayList(collectionSizeOrDefault(10)), transform)\n}\n\n/**\n * Returns a list containing only the non-null results of applying the given [transform] function\n * to each element and its index in the original collection.\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun Iterable.mapIndexedNotNull(transform: (index: Int, T) -> R?): List {\n return mapIndexedNotNullTo(ArrayList(), transform)\n}\n\n/**\n * Applies the given [transform] function to each element and its index in the original collection\n * and appends only the non-null results to the given [destination].\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun > Iterable.mapIndexedNotNullTo(destination: C, transform: (index: Int, T) -> R?): C {\n forEachIndexed { index, element -> transform(index, element)?.let { destination.add(it) } }\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element and its index in the original collection\n * and appends the results to the given [destination].\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun > Iterable.mapIndexedTo(destination: C, transform: (index: Int, T) -> R): C {\n var index = 0\n for (item in this)\n destination.add(transform(checkIndexOverflow(index++), item))\n return destination\n}\n\n/**\n * Returns a list containing only the non-null results of applying the given [transform] function\n * to each element in the original collection.\n * \n * @sample samples.collections.Collections.Transformations.mapNotNull\n */\npublic inline fun Iterable.mapNotNull(transform: (T) -> R?): List {\n return mapNotNullTo(ArrayList(), transform)\n}\n\n/**\n * Applies the given [transform] function to each element in the original collection\n * and appends only the non-null results to the given [destination].\n */\npublic inline fun > Iterable.mapNotNullTo(destination: C, transform: (T) -> R?): C {\n forEach { element -> transform(element)?.let { destination.add(it) } }\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element of the original collection\n * and appends the results to the given [destination].\n */\npublic inline fun > Iterable.mapTo(destination: C, transform: (T) -> R): C {\n for (item in this)\n destination.add(transform(item))\n return destination\n}\n\n/**\n * Returns a lazy [Iterable] that wraps each element of the original collection\n * into an [IndexedValue] containing the index of that element and the element itself.\n */\npublic fun Iterable.withIndex(): Iterable> {\n return IndexingIterable { iterator() }\n}\n\n/**\n * Returns a list containing only distinct elements from the given collection.\n * \n * Among equal elements of the given collection, only the first one will be present in the resulting list.\n * The elements in the resulting list are in the same order as they were in the source collection.\n * \n * @sample samples.collections.Collections.Transformations.distinctAndDistinctBy\n */\npublic fun Iterable.distinct(): List {\n return this.toMutableSet().toList()\n}\n\n/**\n * Returns a list containing only elements from the given collection\n * having distinct keys returned by the given [selector] function.\n * \n * Among elements of the given collection with equal keys, only the first one will be present in the resulting list.\n * The elements in the resulting list are in the same order as they were in the source collection.\n * \n * @sample samples.collections.Collections.Transformations.distinctAndDistinctBy\n */\npublic inline fun Iterable.distinctBy(selector: (T) -> K): List {\n val set = HashSet()\n val list = ArrayList()\n for (e in this) {\n val key = selector(e)\n if (set.add(key))\n list.add(e)\n }\n return list\n}\n\n/**\n * Returns a set containing all elements that are contained by both this collection and the specified collection.\n * \n * The returned set preserves the element iteration order of the original collection.\n * \n * To get a set containing all elements that are contained at least in one of these collections use [union].\n */\npublic infix fun Iterable.intersect(other: Iterable): Set {\n val set = this.toMutableSet()\n set.retainAll(other)\n return set\n}\n\n/**\n * Returns a set containing all elements that are contained by this collection and not contained by the specified collection.\n * \n * The returned set preserves the element iteration order of the original collection.\n */\npublic infix fun Iterable.subtract(other: Iterable): Set {\n val set = this.toMutableSet()\n set.removeAll(other)\n return set\n}\n\n/**\n * Returns a new [MutableSet] containing all distinct elements from the given collection.\n * \n * The returned set preserves the element iteration order of the original collection.\n */\npublic fun Iterable.toMutableSet(): MutableSet {\n return when (this) {\n is Collection -> LinkedHashSet(this)\n else -> toCollection(LinkedHashSet())\n }\n}\n\n/**\n * Returns a set containing all distinct elements from both collections.\n * \n * The returned set preserves the element iteration order of the original collection.\n * Those elements of the [other] collection that are unique are iterated in the end\n * in the order of the [other] collection.\n * \n * To get a set containing all elements that are contained in both collections use [intersect].\n */\npublic infix fun Iterable.union(other: Iterable): Set {\n val set = this.toMutableSet()\n set.addAll(other)\n return set\n}\n\n/**\n * Returns `true` if all elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.all\n */\npublic inline fun Iterable.all(predicate: (T) -> Boolean): Boolean {\n if (this is Collection && isEmpty()) return true\n for (element in this) if (!predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if collection has at least one element.\n * \n * @sample samples.collections.Collections.Aggregates.any\n */\npublic fun Iterable.any(): Boolean {\n if (this is Collection) return !isEmpty()\n return iterator().hasNext()\n}\n\n/**\n * Returns `true` if at least one element matches the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.anyWithPredicate\n */\npublic inline fun Iterable.any(predicate: (T) -> Boolean): Boolean {\n if (this is Collection && isEmpty()) return false\n for (element in this) if (predicate(element)) return true\n return false\n}\n\n/**\n * Returns the number of elements in this collection.\n */\npublic fun Iterable.count(): Int {\n if (this is Collection) return size\n var count = 0\n for (element in this) checkCountOverflow(++count)\n return count\n}\n\n/**\n * Returns the number of elements in this collection.\n */\n@kotlin.internal.InlineOnly\npublic inline fun Collection.count(): Int {\n return size\n}\n\n/**\n * Returns the number of elements matching the given [predicate].\n */\npublic inline fun Iterable.count(predicate: (T) -> Boolean): Int {\n if (this is Collection && isEmpty()) return 0\n var count = 0\n for (element in this) if (predicate(element)) checkCountOverflow(++count)\n return count\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns the specified [initial] value if the collection is empty.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n */\npublic inline fun Iterable.fold(initial: R, operation: (acc: R, T) -> R): R {\n var accumulator = initial\n for (element in this) accumulator = operation(accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original collection.\n * \n * Returns the specified [initial] value if the collection is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n */\npublic inline fun Iterable.foldIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): R {\n var index = 0\n var accumulator = initial\n for (element in this) accumulator = operation(checkIndexOverflow(index++), accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns the specified [initial] value if the list is empty.\n * \n * @param [operation] function that takes an element and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun List.foldRight(initial: R, operation: (T, acc: R) -> R): R {\n var accumulator = initial\n if (!isEmpty()) {\n val iterator = listIterator(size)\n while (iterator.hasPrevious()) {\n accumulator = operation(iterator.previous(), accumulator)\n }\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element with its index in the original list and current accumulator value.\n * \n * Returns the specified [initial] value if the list is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself\n * and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun List.foldRightIndexed(initial: R, operation: (index: Int, T, acc: R) -> R): R {\n var accumulator = initial\n if (!isEmpty()) {\n val iterator = listIterator(size)\n while (iterator.hasPrevious()) {\n val index = iterator.previousIndex()\n accumulator = operation(index, iterator.previous(), accumulator)\n }\n }\n return accumulator\n}\n\n/**\n * Performs the given [action] on each element.\n */\n@kotlin.internal.HidesMembers\npublic inline fun Iterable.forEach(action: (T) -> Unit): Unit {\n for (element in this) action(element)\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\npublic inline fun Iterable.forEachIndexed(action: (index: Int, T) -> Unit): Unit {\n var index = 0\n for (item in this) action(checkIndexOverflow(index++), item)\n}\n\n@Deprecated(\"Use maxOrNull instead.\", ReplaceWith(\"this.maxOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\n@SinceKotlin(\"1.1\")\npublic fun Iterable.max(): Double? {\n return maxOrNull()\n}\n\n@Deprecated(\"Use maxOrNull instead.\", ReplaceWith(\"this.maxOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\n@SinceKotlin(\"1.1\")\npublic fun Iterable.max(): Float? {\n return maxOrNull()\n}\n\n@Deprecated(\"Use maxOrNull instead.\", ReplaceWith(\"this.maxOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun > Iterable.max(): T? {\n return maxOrNull()\n}\n\n@Deprecated(\"Use maxByOrNull instead.\", ReplaceWith(\"this.maxByOrNull(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic inline fun > Iterable.maxBy(selector: (T) -> R): T? {\n return maxByOrNull(selector)\n}\n\n/**\n * Returns the first element yielding the largest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.maxByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > Iterable.maxByOrNull(selector: (T) -> R): T? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var maxElem = iterator.next()\n if (!iterator.hasNext()) return maxElem\n var maxValue = selector(maxElem)\n do {\n val e = iterator.next()\n val v = selector(e)\n if (maxValue < v) {\n maxElem = e\n maxValue = v\n }\n } while (iterator.hasNext())\n return maxElem\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the collection.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the collection is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.maxOf(selector: (T) -> Double): Double {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var maxValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the collection.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the collection is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.maxOf(selector: (T) -> Float): Float {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var maxValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the collection.\n * \n * @throws NoSuchElementException if the collection is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > Iterable.maxOf(selector: (T) -> R): R {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var maxValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the collection or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.maxOfOrNull(selector: (T) -> Double): Double? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var maxValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the collection or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.maxOfOrNull(selector: (T) -> Float): Float? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var maxValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the collection or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > Iterable.maxOfOrNull(selector: (T) -> R): R? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var maxValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the collection.\n * \n * @throws NoSuchElementException if the collection is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.maxOfWith(comparator: Comparator, selector: (T) -> R): R {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var maxValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the collection or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.maxOfWithOrNull(comparator: Comparator, selector: (T) -> R): R? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var maxValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n * \n * If any of elements is `NaN` returns `NaN`.\n */\n@SinceKotlin(\"1.4\")\npublic fun Iterable.maxOrNull(): Double? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var max = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n max = maxOf(max, e)\n }\n return max\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n * \n * If any of elements is `NaN` returns `NaN`.\n */\n@SinceKotlin(\"1.4\")\npublic fun Iterable.maxOrNull(): Float? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var max = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n max = maxOf(max, e)\n }\n return max\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun > Iterable.maxOrNull(): T? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var max = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n if (max < e) max = e\n }\n return max\n}\n\n@Deprecated(\"Use maxWithOrNull instead.\", ReplaceWith(\"this.maxWithOrNull(comparator)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun Iterable.maxWith(comparator: Comparator): T? {\n return maxWithOrNull(comparator)\n}\n\n/**\n * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun Iterable.maxWithOrNull(comparator: Comparator): T? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var max = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n if (comparator.compare(max, e) < 0) max = e\n }\n return max\n}\n\n@Deprecated(\"Use minOrNull instead.\", ReplaceWith(\"this.minOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\n@SinceKotlin(\"1.1\")\npublic fun Iterable.min(): Double? {\n return minOrNull()\n}\n\n@Deprecated(\"Use minOrNull instead.\", ReplaceWith(\"this.minOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\n@SinceKotlin(\"1.1\")\npublic fun Iterable.min(): Float? {\n return minOrNull()\n}\n\n@Deprecated(\"Use minOrNull instead.\", ReplaceWith(\"this.minOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun > Iterable.min(): T? {\n return minOrNull()\n}\n\n@Deprecated(\"Use minByOrNull instead.\", ReplaceWith(\"this.minByOrNull(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic inline fun > Iterable.minBy(selector: (T) -> R): T? {\n return minByOrNull(selector)\n}\n\n/**\n * Returns the first element yielding the smallest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.minByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > Iterable.minByOrNull(selector: (T) -> R): T? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var minElem = iterator.next()\n if (!iterator.hasNext()) return minElem\n var minValue = selector(minElem)\n do {\n val e = iterator.next()\n val v = selector(e)\n if (minValue > v) {\n minElem = e\n minValue = v\n }\n } while (iterator.hasNext())\n return minElem\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the collection.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the collection is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.minOf(selector: (T) -> Double): Double {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var minValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the collection.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the collection is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.minOf(selector: (T) -> Float): Float {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var minValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the collection.\n * \n * @throws NoSuchElementException if the collection is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > Iterable.minOf(selector: (T) -> R): R {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var minValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the collection or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.minOfOrNull(selector: (T) -> Double): Double? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var minValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the collection or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.minOfOrNull(selector: (T) -> Float): Float? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var minValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the collection or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > Iterable.minOfOrNull(selector: (T) -> R): R? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var minValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the collection.\n * \n * @throws NoSuchElementException if the collection is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.minOfWith(comparator: Comparator, selector: (T) -> R): R {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var minValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the collection or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.minOfWithOrNull(comparator: Comparator, selector: (T) -> R): R? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var minValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n * \n * If any of elements is `NaN` returns `NaN`.\n */\n@SinceKotlin(\"1.4\")\npublic fun Iterable.minOrNull(): Double? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var min = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n min = minOf(min, e)\n }\n return min\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n * \n * If any of elements is `NaN` returns `NaN`.\n */\n@SinceKotlin(\"1.4\")\npublic fun Iterable.minOrNull(): Float? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var min = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n min = minOf(min, e)\n }\n return min\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun > Iterable.minOrNull(): T? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var min = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n if (min > e) min = e\n }\n return min\n}\n\n@Deprecated(\"Use minWithOrNull instead.\", ReplaceWith(\"this.minWithOrNull(comparator)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun Iterable.minWith(comparator: Comparator): T? {\n return minWithOrNull(comparator)\n}\n\n/**\n * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun Iterable.minWithOrNull(comparator: Comparator): T? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var min = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n if (comparator.compare(min, e) > 0) min = e\n }\n return min\n}\n\n/**\n * Returns `true` if the collection has no elements.\n * \n * @sample samples.collections.Collections.Aggregates.none\n */\npublic fun Iterable.none(): Boolean {\n if (this is Collection) return isEmpty()\n return !iterator().hasNext()\n}\n\n/**\n * Returns `true` if no elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.noneWithPredicate\n */\npublic inline fun Iterable.none(predicate: (T) -> Boolean): Boolean {\n if (this is Collection && isEmpty()) return true\n for (element in this) if (predicate(element)) return false\n return true\n}\n\n/**\n * Performs the given [action] on each element and returns the collection itself afterwards.\n */\n@SinceKotlin(\"1.1\")\npublic inline fun > C.onEach(action: (T) -> Unit): C {\n return apply { for (element in this) action(element) }\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element,\n * and returns the collection itself afterwards.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > C.onEachIndexed(action: (index: Int, T) -> Unit): C {\n return apply { forEachIndexed(action) }\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Throws an exception if this collection is empty. If the collection can be empty in an expected way,\n * please use [reduceOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun Iterable.reduce(operation: (acc: S, T) -> S): S {\n val iterator = this.iterator()\n if (!iterator.hasNext()) throw UnsupportedOperationException(\"Empty collection can't be reduced.\")\n var accumulator: S = iterator.next()\n while (iterator.hasNext()) {\n accumulator = operation(accumulator, iterator.next())\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original collection.\n * \n * Throws an exception if this collection is empty. If the collection can be empty in an expected way,\n * please use [reduceIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun Iterable.reduceIndexed(operation: (index: Int, acc: S, T) -> S): S {\n val iterator = this.iterator()\n if (!iterator.hasNext()) throw UnsupportedOperationException(\"Empty collection can't be reduced.\")\n var index = 1\n var accumulator: S = iterator.next()\n while (iterator.hasNext()) {\n accumulator = operation(checkIndexOverflow(index++), accumulator, iterator.next())\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original collection.\n * \n * Returns `null` if the collection is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun Iterable.reduceIndexedOrNull(operation: (index: Int, acc: S, T) -> S): S? {\n val iterator = this.iterator()\n if (!iterator.hasNext()) return null\n var index = 1\n var accumulator: S = iterator.next()\n while (iterator.hasNext()) {\n accumulator = operation(checkIndexOverflow(index++), accumulator, iterator.next())\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns `null` if the collection is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun Iterable.reduceOrNull(operation: (acc: S, T) -> S): S? {\n val iterator = this.iterator()\n if (!iterator.hasNext()) return null\n var accumulator: S = iterator.next()\n while (iterator.hasNext()) {\n accumulator = operation(accumulator, iterator.next())\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Throws an exception if this list is empty. If the list can be empty in an expected way,\n * please use [reduceRightOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\npublic inline fun List.reduceRight(operation: (T, acc: S) -> S): S {\n val iterator = listIterator(size)\n if (!iterator.hasPrevious())\n throw UnsupportedOperationException(\"Empty list can't be reduced.\")\n var accumulator: S = iterator.previous()\n while (iterator.hasPrevious()) {\n accumulator = operation(iterator.previous(), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original list and current accumulator value.\n * \n * Throws an exception if this list is empty. If the list can be empty in an expected way,\n * please use [reduceRightIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\npublic inline fun List.reduceRightIndexed(operation: (index: Int, T, acc: S) -> S): S {\n val iterator = listIterator(size)\n if (!iterator.hasPrevious())\n throw UnsupportedOperationException(\"Empty list can't be reduced.\")\n var accumulator: S = iterator.previous()\n while (iterator.hasPrevious()) {\n val index = iterator.previousIndex()\n accumulator = operation(index, iterator.previous(), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original list and current accumulator value.\n * \n * Returns `null` if the list is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun List.reduceRightIndexedOrNull(operation: (index: Int, T, acc: S) -> S): S? {\n val iterator = listIterator(size)\n if (!iterator.hasPrevious())\n return null\n var accumulator: S = iterator.previous()\n while (iterator.hasPrevious()) {\n val index = iterator.previousIndex()\n accumulator = operation(index, iterator.previous(), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns `null` if the list is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun List.reduceRightOrNull(operation: (T, acc: S) -> S): S? {\n val iterator = listIterator(size)\n if (!iterator.hasPrevious())\n return null\n var accumulator: S = iterator.previous()\n while (iterator.hasPrevious()) {\n accumulator = operation(iterator.previous(), accumulator)\n }\n return accumulator\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\npublic inline fun Iterable.runningFold(initial: R, operation: (acc: R, T) -> R): List {\n val estimatedSize = collectionSizeOrDefault(9)\n if (estimatedSize == 0) return listOf(initial)\n val result = ArrayList(estimatedSize + 1).apply { add(initial) }\n var accumulator = initial\n for (element in this) {\n accumulator = operation(accumulator, element)\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original collection and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\npublic inline fun Iterable.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): List {\n val estimatedSize = collectionSizeOrDefault(9)\n if (estimatedSize == 0) return listOf(initial)\n val result = ArrayList(estimatedSize + 1).apply { add(initial) }\n var index = 0\n var accumulator = initial\n for (element in this) {\n accumulator = operation(index++, accumulator, element)\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with the first element of this collection.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and the element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun Iterable.runningReduce(operation: (acc: S, T) -> S): List {\n val iterator = this.iterator()\n if (!iterator.hasNext()) return emptyList()\n var accumulator: S = iterator.next()\n val result = ArrayList(collectionSizeOrDefault(10)).apply { add(accumulator) }\n while (iterator.hasNext()) {\n accumulator = operation(accumulator, iterator.next())\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original collection and current accumulator value that starts with the first element of this collection.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\npublic inline fun Iterable.runningReduceIndexed(operation: (index: Int, acc: S, T) -> S): List {\n val iterator = this.iterator()\n if (!iterator.hasNext()) return emptyList()\n var accumulator: S = iterator.next()\n val result = ArrayList(collectionSizeOrDefault(10)).apply { add(accumulator) }\n var index = 1\n while (iterator.hasNext()) {\n accumulator = operation(index++, accumulator, iterator.next())\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun Iterable.scan(initial: R, operation: (acc: R, T) -> R): List {\n return runningFold(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original collection and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun Iterable.scanIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): List {\n return runningFoldIndexed(initial, operation)\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the collection.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun Iterable.sumBy(selector: (T) -> Int): Int {\n var sum: Int = 0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the collection.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun Iterable.sumByDouble(selector: (T) -> Double): Double {\n var sum: Double = 0.0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the collection.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfDouble\")\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.sumOf(selector: (T) -> Double): Double {\n var sum: Double = 0.toDouble()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the collection.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfInt\")\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.sumOf(selector: (T) -> Int): Int {\n var sum: Int = 0.toInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the collection.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfLong\")\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.sumOf(selector: (T) -> Long): Long {\n var sum: Long = 0.toLong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the collection.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfUInt\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.sumOf(selector: (T) -> UInt): UInt {\n var sum: UInt = 0.toUInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the collection.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfULong\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.sumOf(selector: (T) -> ULong): ULong {\n var sum: ULong = 0.toULong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements.\n */\npublic fun Iterable.requireNoNulls(): Iterable {\n for (element in this) {\n if (element == null) {\n throw IllegalArgumentException(\"null element found in $this.\")\n }\n }\n @Suppress(\"UNCHECKED_CAST\")\n return this as Iterable\n}\n\n/**\n * Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements.\n */\npublic fun List.requireNoNulls(): List {\n for (element in this) {\n if (element == null) {\n throw IllegalArgumentException(\"null element found in $this.\")\n }\n }\n @Suppress(\"UNCHECKED_CAST\")\n return this as List\n}\n\n/**\n * Splits this collection into a list of lists each not exceeding the given [size].\n * \n * The last list in the resulting list may have fewer elements than the given [size].\n * \n * @param size the number of elements to take in each list, must be positive and can be greater than the number of elements in this collection.\n * \n * @sample samples.collections.Collections.Transformations.chunked\n */\n@SinceKotlin(\"1.2\")\npublic fun Iterable.chunked(size: Int): List> {\n return windowed(size, size, partialWindows = true)\n}\n\n/**\n * Splits this collection into several lists each not exceeding the given [size]\n * and applies the given [transform] function to an each.\n * \n * @return list of results of the [transform] applied to an each list.\n * \n * Note that the list passed to the [transform] function is ephemeral and is valid only inside that function.\n * You should not store it or allow it to escape in some way, unless you made a snapshot of it.\n * The last list may have fewer elements than the given [size].\n * \n * @param size the number of elements to take in each list, must be positive and can be greater than the number of elements in this collection.\n * \n * @sample samples.text.Strings.chunkedTransform\n */\n@SinceKotlin(\"1.2\")\npublic fun Iterable.chunked(size: Int, transform: (List) -> R): List {\n return windowed(size, size, partialWindows = true, transform = transform)\n}\n\n/**\n * Returns a list containing all elements of the original collection without the first occurrence of the given [element].\n */\npublic operator fun Iterable.minus(element: T): List {\n val result = ArrayList(collectionSizeOrDefault(10))\n var removed = false\n return this.filterTo(result) { if (!removed && it == element) { removed = true; false } else true }\n}\n\n/**\n * Returns a list containing all elements of the original collection except the elements contained in the given [elements] array.\n * \n * Before Kotlin 1.6, the [elements] array may have been converted to a [HashSet] to speed up the operation, thus the elements were required to have\n * a correct and stable implementation of `hashCode()` that didn't change between successive invocations.\n * On JVM, you can enable this behavior back with the system property `kotlin.collections.convert_arg_to_set_in_removeAll` set to `true`.\n */\npublic operator fun Iterable.minus(elements: Array): List {\n if (elements.isEmpty()) return this.toList()\n val other = elements.convertToSetForSetOperation()\n return this.filterNot { it in other }\n}\n\n/**\n * Returns a list containing all elements of the original collection except the elements contained in the given [elements] collection.\n * \n * Before Kotlin 1.6, the [elements] collection may have been converted to a [HashSet] to speed up the operation, thus the elements were required to have\n * a correct and stable implementation of `hashCode()` that didn't change between successive invocations.\n * On JVM, you can enable this behavior back with the system property `kotlin.collections.convert_arg_to_set_in_removeAll` set to `true`.\n */\npublic operator fun Iterable.minus(elements: Iterable): List {\n val other = elements.convertToSetForSetOperationWith(this)\n if (other.isEmpty())\n return this.toList()\n return this.filterNot { it in other }\n}\n\n/**\n * Returns a list containing all elements of the original collection except the elements contained in the given [elements] sequence.\n * \n * Before Kotlin 1.6, the [elements] sequence may have been converted to a [HashSet] to speed up the operation, thus the elements were required to have\n * a correct and stable implementation of `hashCode()` that didn't change between successive invocations.\n * On JVM, you can enable this behavior back with the system property `kotlin.collections.convert_arg_to_set_in_removeAll` set to `true`.\n */\npublic operator fun Iterable.minus(elements: Sequence): List {\n val other = elements.convertToSetForSetOperation()\n if (other.isEmpty())\n return this.toList()\n return this.filterNot { it in other }\n}\n\n/**\n * Returns a list containing all elements of the original collection without the first occurrence of the given [element].\n */\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.minusElement(element: T): List {\n return minus(element)\n}\n\n/**\n * Splits the original collection into pair of lists,\n * where *first* list contains elements for which [predicate] yielded `true`,\n * while *second* list contains elements for which [predicate] yielded `false`.\n * \n * @sample samples.collections.Iterables.Operations.partition\n */\npublic inline fun Iterable.partition(predicate: (T) -> Boolean): Pair, List> {\n val first = ArrayList()\n val second = ArrayList()\n for (element in this) {\n if (predicate(element)) {\n first.add(element)\n } else {\n second.add(element)\n }\n }\n return Pair(first, second)\n}\n\n/**\n * Returns a list containing all elements of the original collection and then the given [element].\n */\npublic operator fun Iterable.plus(element: T): List {\n if (this is Collection) return this.plus(element)\n val result = ArrayList()\n result.addAll(this)\n result.add(element)\n return result\n}\n\n/**\n * Returns a list containing all elements of the original collection and then the given [element].\n */\npublic operator fun Collection.plus(element: T): List {\n val result = ArrayList(size + 1)\n result.addAll(this)\n result.add(element)\n return result\n}\n\n/**\n * Returns a list containing all elements of the original collection and then all elements of the given [elements] array.\n */\npublic operator fun Iterable.plus(elements: Array): List {\n if (this is Collection) return this.plus(elements)\n val result = ArrayList()\n result.addAll(this)\n result.addAll(elements)\n return result\n}\n\n/**\n * Returns a list containing all elements of the original collection and then all elements of the given [elements] array.\n */\npublic operator fun Collection.plus(elements: Array): List {\n val result = ArrayList(this.size + elements.size)\n result.addAll(this)\n result.addAll(elements)\n return result\n}\n\n/**\n * Returns a list containing all elements of the original collection and then all elements of the given [elements] collection.\n */\npublic operator fun Iterable.plus(elements: Iterable): List {\n if (this is Collection) return this.plus(elements)\n val result = ArrayList()\n result.addAll(this)\n result.addAll(elements)\n return result\n}\n\n/**\n * Returns a list containing all elements of the original collection and then all elements of the given [elements] collection.\n */\npublic operator fun Collection.plus(elements: Iterable): List {\n if (elements is Collection) {\n val result = ArrayList(this.size + elements.size)\n result.addAll(this)\n result.addAll(elements)\n return result\n } else {\n val result = ArrayList(this)\n result.addAll(elements)\n return result\n }\n}\n\n/**\n * Returns a list containing all elements of the original collection and then all elements of the given [elements] sequence.\n */\npublic operator fun Iterable.plus(elements: Sequence): List {\n val result = ArrayList()\n result.addAll(this)\n result.addAll(elements)\n return result\n}\n\n/**\n * Returns a list containing all elements of the original collection and then all elements of the given [elements] sequence.\n */\npublic operator fun Collection.plus(elements: Sequence): List {\n val result = ArrayList(this.size + 10)\n result.addAll(this)\n result.addAll(elements)\n return result\n}\n\n/**\n * Returns a list containing all elements of the original collection and then the given [element].\n */\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.plusElement(element: T): List {\n return plus(element)\n}\n\n/**\n * Returns a list containing all elements of the original collection and then the given [element].\n */\n@kotlin.internal.InlineOnly\npublic inline fun Collection.plusElement(element: T): List {\n return plus(element)\n}\n\n/**\n * Returns a list of snapshots of the window of the given [size]\n * sliding along this collection with the given [step], where each\n * snapshot is a list.\n * \n * Several last lists may have fewer elements than the given [size].\n * \n * Both [size] and [step] must be positive and can be greater than the number of elements in this collection.\n * @param size the number of elements to take in each window\n * @param step the number of elements to move the window forward by on an each step, by default 1\n * @param partialWindows controls whether or not to keep partial windows in the end if any,\n * by default `false` which means partial windows won't be preserved\n * \n * @sample samples.collections.Sequences.Transformations.takeWindows\n */\n@SinceKotlin(\"1.2\")\npublic fun Iterable.windowed(size: Int, step: Int = 1, partialWindows: Boolean = false): List> {\n checkWindowSizeStep(size, step)\n if (this is RandomAccess && this is List) {\n val thisSize = this.size\n val resultCapacity = thisSize / step + if (thisSize % step == 0) 0 else 1\n val result = ArrayList>(resultCapacity)\n var index = 0\n while (index in 0 until thisSize) {\n val windowSize = size.coerceAtMost(thisSize - index)\n if (windowSize < size && !partialWindows) break\n result.add(List(windowSize) { this[it + index] })\n index += step\n }\n return result\n }\n val result = ArrayList>()\n windowedIterator(iterator(), size, step, partialWindows, reuseBuffer = false).forEach {\n result.add(it)\n }\n return result\n}\n\n/**\n * Returns a list of results of applying the given [transform] function to\n * an each list representing a view over the window of the given [size]\n * sliding along this collection with the given [step].\n * \n * Note that the list passed to the [transform] function is ephemeral and is valid only inside that function.\n * You should not store it or allow it to escape in some way, unless you made a snapshot of it.\n * Several last lists may have fewer elements than the given [size].\n * \n * Both [size] and [step] must be positive and can be greater than the number of elements in this collection.\n * @param size the number of elements to take in each window\n * @param step the number of elements to move the window forward by on an each step, by default 1\n * @param partialWindows controls whether or not to keep partial windows in the end if any,\n * by default `false` which means partial windows won't be preserved\n * \n * @sample samples.collections.Sequences.Transformations.averageWindows\n */\n@SinceKotlin(\"1.2\")\npublic fun Iterable.windowed(size: Int, step: Int = 1, partialWindows: Boolean = false, transform: (List) -> R): List {\n checkWindowSizeStep(size, step)\n if (this is RandomAccess && this is List) {\n val thisSize = this.size\n val resultCapacity = thisSize / step + if (thisSize % step == 0) 0 else 1\n val result = ArrayList(resultCapacity)\n val window = MovingSubList(this)\n var index = 0\n while (index in 0 until thisSize) {\n val windowSize = size.coerceAtMost(thisSize - index)\n if (!partialWindows && windowSize < size) break\n window.move(index, index + windowSize)\n result.add(transform(window))\n index += step\n }\n return result\n }\n val result = ArrayList()\n windowedIterator(iterator(), size, step, partialWindows, reuseBuffer = true).forEach {\n result.add(transform(it))\n }\n return result\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` collection and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun Iterable.zip(other: Array): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of values built from the elements of `this` collection and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun Iterable.zip(other: Array, transform: (a: T, b: R) -> V): List {\n val arraySize = other.size\n val list = ArrayList(minOf(collectionSizeOrDefault(10), arraySize))\n var i = 0\n for (element in this) {\n if (i >= arraySize) break\n list.add(transform(element, other[i++]))\n }\n return list\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` collection and [other] collection with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun Iterable.zip(other: Iterable): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of values built from the elements of `this` collection and the [other] collection with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun Iterable.zip(other: Iterable, transform: (a: T, b: R) -> V): List {\n val first = iterator()\n val second = other.iterator()\n val list = ArrayList(minOf(collectionSizeOrDefault(10), other.collectionSizeOrDefault(10)))\n while (first.hasNext() && second.hasNext()) {\n list.add(transform(first.next(), second.next()))\n }\n return list\n}\n\n/**\n * Returns a list of pairs of each two adjacent elements in this collection.\n * \n * The returned list is empty if this collection contains less than two elements.\n * \n * @sample samples.collections.Collections.Transformations.zipWithNext\n */\n@SinceKotlin(\"1.2\")\npublic fun Iterable.zipWithNext(): List> {\n return zipWithNext { a, b -> a to b }\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to an each pair of two adjacent elements in this collection.\n * \n * The returned list is empty if this collection contains less than two elements.\n * \n * @sample samples.collections.Collections.Transformations.zipWithNextToFindDeltas\n */\n@SinceKotlin(\"1.2\")\npublic inline fun Iterable.zipWithNext(transform: (a: T, b: T) -> R): List {\n val iterator = iterator()\n if (!iterator.hasNext()) return emptyList()\n val result = mutableListOf()\n var current = iterator.next()\n while (iterator.hasNext()) {\n val next = iterator.next()\n result.add(transform(current, next))\n current = next\n }\n return result\n}\n\n/**\n * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n * \n * @sample samples.collections.Collections.Transformations.joinTo\n */\npublic fun Iterable.joinTo(buffer: A, separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((T) -> CharSequence)? = null): A {\n buffer.append(prefix)\n var count = 0\n for (element in this) {\n if (++count > 1) buffer.append(separator)\n if (limit < 0 || count <= limit) {\n buffer.appendElement(element, transform)\n } else break\n }\n if (limit >= 0 && count > limit) buffer.append(truncated)\n buffer.append(postfix)\n return buffer\n}\n\n/**\n * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n * \n * @sample samples.collections.Collections.Transformations.joinToString\n */\npublic fun Iterable.joinToString(separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((T) -> CharSequence)? = null): String {\n return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated, transform).toString()\n}\n\n/**\n * Returns this collection as an [Iterable].\n */\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.asIterable(): Iterable {\n return this\n}\n\n/**\n * Creates a [Sequence] instance that wraps the original collection returning its elements when being iterated.\n * \n * @sample samples.collections.Sequences.Building.sequenceFromCollection\n */\npublic fun Iterable.asSequence(): Sequence {\n return Sequence { this.iterator() }\n}\n\n/**\n * Returns an average value of elements in the collection.\n */\n@kotlin.jvm.JvmName(\"averageOfByte\")\npublic fun Iterable.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n checkCountOverflow(++count)\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the collection.\n */\n@kotlin.jvm.JvmName(\"averageOfShort\")\npublic fun Iterable.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n checkCountOverflow(++count)\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the collection.\n */\n@kotlin.jvm.JvmName(\"averageOfInt\")\npublic fun Iterable.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n checkCountOverflow(++count)\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the collection.\n */\n@kotlin.jvm.JvmName(\"averageOfLong\")\npublic fun Iterable.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n checkCountOverflow(++count)\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the collection.\n */\n@kotlin.jvm.JvmName(\"averageOfFloat\")\npublic fun Iterable.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n checkCountOverflow(++count)\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the collection.\n */\n@kotlin.jvm.JvmName(\"averageOfDouble\")\npublic fun Iterable.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n checkCountOverflow(++count)\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns the sum of all elements in the collection.\n */\n@kotlin.jvm.JvmName(\"sumOfByte\")\npublic fun Iterable.sum(): Int {\n var sum: Int = 0\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the collection.\n */\n@kotlin.jvm.JvmName(\"sumOfShort\")\npublic fun Iterable.sum(): Int {\n var sum: Int = 0\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the collection.\n */\n@kotlin.jvm.JvmName(\"sumOfInt\")\npublic fun Iterable.sum(): Int {\n var sum: Int = 0\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the collection.\n */\n@kotlin.jvm.JvmName(\"sumOfLong\")\npublic fun Iterable.sum(): Long {\n var sum: Long = 0L\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the collection.\n */\n@kotlin.jvm.JvmName(\"sumOfFloat\")\npublic fun Iterable.sum(): Float {\n var sum: Float = 0.0f\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the collection.\n */\n@kotlin.jvm.JvmName(\"sumOfDouble\")\npublic fun Iterable.sum(): Double {\n var sum: Double = 0.0\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"PreconditionsKt\")\n\npackage kotlin\n\nimport kotlin.contracts.contract\n\n/**\n * Throws an [IllegalArgumentException] if the [value] is false.\n *\n * @sample samples.misc.Preconditions.failRequireWithLazyMessage\n */\n@kotlin.internal.InlineOnly\npublic inline fun require(value: Boolean): Unit {\n contract {\n returns() implies value\n }\n require(value) { \"Failed requirement.\" }\n}\n\n/**\n * Throws an [IllegalArgumentException] with the result of calling [lazyMessage] if the [value] is false.\n *\n * @sample samples.misc.Preconditions.failRequireWithLazyMessage\n */\n@kotlin.internal.InlineOnly\npublic inline fun require(value: Boolean, lazyMessage: () -> Any): Unit {\n contract {\n returns() implies value\n }\n if (!value) {\n val message = lazyMessage()\n throw IllegalArgumentException(message.toString())\n }\n}\n\n/**\n * Throws an [IllegalArgumentException] if the [value] is null. Otherwise returns the not null value.\n */\n@kotlin.internal.InlineOnly\npublic inline fun requireNotNull(value: T?): T {\n contract {\n returns() implies (value != null)\n }\n return requireNotNull(value) { \"Required value was null.\" }\n}\n\n/**\n * Throws an [IllegalArgumentException] with the result of calling [lazyMessage] if the [value] is null. Otherwise\n * returns the not null value.\n *\n * @sample samples.misc.Preconditions.failRequireNotNullWithLazyMessage\n */\n@kotlin.internal.InlineOnly\npublic inline fun requireNotNull(value: T?, lazyMessage: () -> Any): T {\n contract {\n returns() implies (value != null)\n }\n\n if (value == null) {\n val message = lazyMessage()\n throw IllegalArgumentException(message.toString())\n } else {\n return value\n }\n}\n\n/**\n * Throws an [IllegalStateException] if the [value] is false.\n *\n * @sample samples.misc.Preconditions.failCheckWithLazyMessage\n */\n@kotlin.internal.InlineOnly\npublic inline fun check(value: Boolean): Unit {\n contract {\n returns() implies value\n }\n check(value) { \"Check failed.\" }\n}\n\n/**\n * Throws an [IllegalStateException] with the result of calling [lazyMessage] if the [value] is false.\n *\n * @sample samples.misc.Preconditions.failCheckWithLazyMessage\n */\n@kotlin.internal.InlineOnly\npublic inline fun check(value: Boolean, lazyMessage: () -> Any): Unit {\n contract {\n returns() implies value\n }\n if (!value) {\n val message = lazyMessage()\n throw IllegalStateException(message.toString())\n }\n}\n\n/**\n * Throws an [IllegalStateException] if the [value] is null. Otherwise\n * returns the not null value.\n *\n * @sample samples.misc.Preconditions.failCheckWithLazyMessage\n */\n@kotlin.internal.InlineOnly\npublic inline fun checkNotNull(value: T?): T {\n contract {\n returns() implies (value != null)\n }\n return checkNotNull(value) { \"Required value was null.\" }\n}\n\n/**\n * Throws an [IllegalStateException] with the result of calling [lazyMessage] if the [value] is null. Otherwise\n * returns the not null value.\n *\n * @sample samples.misc.Preconditions.failCheckWithLazyMessage\n */\n@kotlin.internal.InlineOnly\npublic inline fun checkNotNull(value: T?, lazyMessage: () -> Any): T {\n contract {\n returns() implies (value != null)\n }\n\n if (value == null) {\n val message = lazyMessage()\n throw IllegalStateException(message.toString())\n } else {\n return value\n }\n}\n\n\n/**\n * Throws an [IllegalStateException] with the given [message].\n *\n * @sample samples.misc.Preconditions.failWithError\n */\n@kotlin.internal.InlineOnly\npublic inline fun error(message: Any): Nothing = throw IllegalStateException(message.toString())\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"CollectionsKt\")\n\npackage kotlin.collections\n\n/**\n * Given an [iterator] function constructs an [Iterable] instance that returns values through the [Iterator]\n * provided by that function.\n * @sample samples.collections.Iterables.Building.iterable\n */\n@kotlin.internal.InlineOnly\npublic inline fun Iterable(crossinline iterator: () -> Iterator): Iterable = object : Iterable {\n override fun iterator(): Iterator = iterator()\n}\n\n/**\n * A wrapper over another [Iterable] (or any other object that can produce an [Iterator]) that returns\n * an indexing iterator.\n */\ninternal class IndexingIterable(private val iteratorFactory: () -> Iterator) : Iterable> {\n override fun iterator(): Iterator> = IndexingIterator(iteratorFactory())\n}\n\n\n/**\n * Returns the size of this iterable if it is known, or `null` otherwise.\n */\n@PublishedApi\ninternal fun Iterable.collectionSizeOrNull(): Int? = if (this is Collection<*>) this.size else null\n\n/**\n * Returns the size of this iterable if it is known, or the specified [default] value otherwise.\n */\n@PublishedApi\ninternal fun Iterable.collectionSizeOrDefault(default: Int): Int = if (this is Collection<*>) this.size else default\n\n\n/**\n * Returns a single list of all elements from all collections in the given collection.\n * @sample samples.collections.Iterables.Operations.flattenIterable\n */\npublic fun Iterable>.flatten(): List {\n val result = ArrayList()\n for (element in this) {\n result.addAll(element)\n }\n return result\n}\n\n/**\n * Returns a pair of lists, where\n * *first* list is built from the first values of each pair from this collection,\n * *second* list is built from the second values of each pair from this collection.\n * @sample samples.collections.Iterables.Operations.unzipIterable\n */\npublic fun Iterable>.unzip(): Pair, List> {\n val expectedSize = collectionSizeOrDefault(10)\n val listT = ArrayList(expectedSize)\n val listR = ArrayList(expectedSize)\n for (pair in this) {\n listT.add(pair.first)\n listR.add(pair.second)\n }\n return listT to listR\n}\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"SequencesKt\")\n\npackage kotlin.sequences\n\n//\n// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt\n// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib\n//\n\nimport kotlin.random.*\n\n/**\n * Returns `true` if [element] is found in the sequence.\n *\n * The operation is _terminal_.\n */\npublic operator fun <@kotlin.internal.OnlyInputTypes T> Sequence.contains(element: T): Boolean {\n return indexOf(element) >= 0\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this sequence.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic fun Sequence.elementAt(index: Int): T {\n return elementAtOrElse(index) { throw IndexOutOfBoundsException(\"Sequence doesn't contain element at index $index.\") }\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this sequence.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\npublic fun Sequence.elementAtOrElse(index: Int, defaultValue: (Int) -> T): T {\n if (index < 0)\n return defaultValue(index)\n val iterator = iterator()\n var count = 0\n while (iterator.hasNext()) {\n val element = iterator.next()\n if (index == count++)\n return element\n }\n return defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this sequence.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\npublic fun Sequence.elementAtOrNull(index: Int): T? {\n if (index < 0)\n return null\n val iterator = iterator()\n var count = 0\n while (iterator.hasNext()) {\n val element = iterator.next()\n if (index == count++)\n return element\n }\n return null\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun Sequence.find(predicate: (T) -> Boolean): T? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun Sequence.findLast(predicate: (T) -> Boolean): T? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns first element.\n * @throws [NoSuchElementException] if the sequence is empty.\n *\n * The operation is _terminal_.\n */\npublic fun Sequence.first(): T {\n val iterator = iterator()\n if (!iterator.hasNext())\n throw NoSuchElementException(\"Sequence is empty.\")\n return iterator.next()\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n *\n * The operation is _terminal_.\n */\npublic inline fun Sequence.first(predicate: (T) -> Boolean): T {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Sequence contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first non-null value produced by [transform] function being applied to elements of this sequence in iteration order,\n * or throws [NoSuchElementException] if no non-null value was produced.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Transformations.firstNotNullOf\n */\n@SinceKotlin(\"1.5\")\n@kotlin.internal.InlineOnly\npublic inline fun Sequence.firstNotNullOf(transform: (T) -> R?): R {\n return firstNotNullOfOrNull(transform) ?: throw NoSuchElementException(\"No element of the sequence was transformed to a non-null value.\")\n}\n\n/**\n * Returns the first non-null value produced by [transform] function being applied to elements of this sequence in iteration order,\n * or `null` if no non-null value was produced.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Transformations.firstNotNullOf\n */\n@SinceKotlin(\"1.5\")\n@kotlin.internal.InlineOnly\npublic inline fun Sequence.firstNotNullOfOrNull(transform: (T) -> R?): R? {\n for (element in this) {\n val result = transform(element)\n if (result != null) {\n return result\n }\n }\n return null\n}\n\n/**\n * Returns the first element, or `null` if the sequence is empty.\n *\n * The operation is _terminal_.\n */\npublic fun Sequence.firstOrNull(): T? {\n val iterator = iterator()\n if (!iterator.hasNext())\n return null\n return iterator.next()\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n *\n * The operation is _terminal_.\n */\npublic inline fun Sequence.firstOrNull(predicate: (T) -> Boolean): T? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns first index of [element], or -1 if the sequence does not contain element.\n *\n * The operation is _terminal_.\n */\npublic fun <@kotlin.internal.OnlyInputTypes T> Sequence.indexOf(element: T): Int {\n var index = 0\n for (item in this) {\n checkIndexOverflow(index)\n if (element == item)\n return index\n index++\n }\n return -1\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the sequence does not contain such element.\n *\n * The operation is _terminal_.\n */\npublic inline fun Sequence.indexOfFirst(predicate: (T) -> Boolean): Int {\n var index = 0\n for (item in this) {\n checkIndexOverflow(index)\n if (predicate(item))\n return index\n index++\n }\n return -1\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the sequence does not contain such element.\n *\n * The operation is _terminal_.\n */\npublic inline fun Sequence.indexOfLast(predicate: (T) -> Boolean): Int {\n var lastIndex = -1\n var index = 0\n for (item in this) {\n checkIndexOverflow(index)\n if (predicate(item))\n lastIndex = index\n index++\n }\n return lastIndex\n}\n\n/**\n * Returns the last element.\n *\n * The operation is _terminal_.\n * \n * @throws NoSuchElementException if the sequence is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun Sequence.last(): T {\n val iterator = iterator()\n if (!iterator.hasNext())\n throw NoSuchElementException(\"Sequence is empty.\")\n var last = iterator.next()\n while (iterator.hasNext())\n last = iterator.next()\n return last\n}\n\n/**\n * Returns the last element matching the given [predicate].\n *\n * The operation is _terminal_.\n * \n * @throws NoSuchElementException if no such element is found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun Sequence.last(predicate: (T) -> Boolean): T {\n var last: T? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n last = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Sequence contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return last as T\n}\n\n/**\n * Returns last index of [element], or -1 if the sequence does not contain element.\n *\n * The operation is _terminal_.\n */\npublic fun <@kotlin.internal.OnlyInputTypes T> Sequence.lastIndexOf(element: T): Int {\n var lastIndex = -1\n var index = 0\n for (item in this) {\n checkIndexOverflow(index)\n if (element == item)\n lastIndex = index\n index++\n }\n return lastIndex\n}\n\n/**\n * Returns the last element, or `null` if the sequence is empty.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun Sequence.lastOrNull(): T? {\n val iterator = iterator()\n if (!iterator.hasNext())\n return null\n var last = iterator.next()\n while (iterator.hasNext())\n last = iterator.next()\n return last\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun Sequence.lastOrNull(predicate: (T) -> Boolean): T? {\n var last: T? = null\n for (element in this) {\n if (predicate(element)) {\n last = element\n }\n }\n return last\n}\n\n/**\n * Returns the single element, or throws an exception if the sequence is empty or has more than one element.\n *\n * The operation is _terminal_.\n */\npublic fun Sequence.single(): T {\n val iterator = iterator()\n if (!iterator.hasNext())\n throw NoSuchElementException(\"Sequence is empty.\")\n val single = iterator.next()\n if (iterator.hasNext())\n throw IllegalArgumentException(\"Sequence has more than one element.\")\n return single\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n *\n * The operation is _terminal_.\n */\npublic inline fun Sequence.single(predicate: (T) -> Boolean): T {\n var single: T? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Sequence contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Sequence contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as T\n}\n\n/**\n * Returns single element, or `null` if the sequence is empty or has more than one element.\n *\n * The operation is _terminal_.\n */\npublic fun Sequence.singleOrNull(): T? {\n val iterator = iterator()\n if (!iterator.hasNext())\n return null\n val single = iterator.next()\n if (iterator.hasNext())\n return null\n return single\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n *\n * The operation is _terminal_.\n */\npublic inline fun Sequence.singleOrNull(predicate: (T) -> Boolean): T? {\n var single: T? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns a sequence containing all elements except first [n] elements.\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun Sequence.drop(n: Int): Sequence {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return when {\n n == 0 -> this\n this is DropTakeSequence -> this.drop(n)\n else -> DropSequence(this, n)\n }\n}\n\n/**\n * Returns a sequence containing all elements except first elements that satisfy the given [predicate].\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun Sequence.dropWhile(predicate: (T) -> Boolean): Sequence {\n return DropWhileSequence(this, predicate)\n}\n\n/**\n * Returns a sequence containing only elements matching the given [predicate].\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\npublic fun Sequence.filter(predicate: (T) -> Boolean): Sequence {\n return FilteringSequence(this, true, predicate)\n}\n\n/**\n * Returns a sequence containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexed\n */\npublic fun Sequence.filterIndexed(predicate: (index: Int, T) -> Boolean): Sequence {\n // TODO: Rewrite with generalized MapFilterIndexingSequence\n return TransformingSequence(FilteringSequence(IndexingSequence(this), true, { predicate(it.index, it.value) }), { it.value })\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexedTo\n */\npublic inline fun > Sequence.filterIndexedTo(destination: C, predicate: (index: Int, T) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Returns a sequence containing all elements that are instances of specified type parameter R.\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @sample samples.collections.Collections.Filtering.filterIsInstance\n */\npublic inline fun Sequence<*>.filterIsInstance(): Sequence<@kotlin.internal.NoInfer R> {\n @Suppress(\"UNCHECKED_CAST\")\n return filter { it is R } as Sequence\n}\n\n/**\n * Appends all elements that are instances of specified type parameter R to the given [destination].\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Filtering.filterIsInstanceTo\n */\npublic inline fun > Sequence<*>.filterIsInstanceTo(destination: C): C {\n for (element in this) if (element is R) destination.add(element)\n return destination\n}\n\n/**\n * Returns a sequence containing all elements not matching the given [predicate].\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\npublic fun Sequence.filterNot(predicate: (T) -> Boolean): Sequence {\n return FilteringSequence(this, false, predicate)\n}\n\n/**\n * Returns a sequence containing all elements that are not `null`.\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @sample samples.collections.Collections.Filtering.filterNotNull\n */\npublic fun Sequence.filterNotNull(): Sequence {\n @Suppress(\"UNCHECKED_CAST\")\n return filterNot { it == null } as Sequence\n}\n\n/**\n * Appends all elements that are not `null` to the given [destination].\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Filtering.filterNotNullTo\n */\npublic fun , T : Any> Sequence.filterNotNullTo(destination: C): C {\n for (element in this) if (element != null) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun > Sequence.filterNotTo(destination: C, predicate: (T) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun > Sequence.filterTo(destination: C, predicate: (T) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Returns a sequence containing first [n] elements.\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun Sequence.take(n: Int): Sequence {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return when {\n n == 0 -> emptySequence()\n this is DropTakeSequence -> this.take(n)\n else -> TakeSequence(this, n)\n }\n}\n\n/**\n * Returns a sequence containing first elements satisfying the given [predicate].\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun Sequence.takeWhile(predicate: (T) -> Boolean): Sequence {\n return TakeWhileSequence(this, predicate)\n}\n\n/**\n * Returns a sequence that yields elements of this sequence sorted according to their natural sort order.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n *\n * The operation is _intermediate_ and _stateful_.\n */\npublic fun > Sequence.sorted(): Sequence {\n return object : Sequence {\n override fun iterator(): Iterator {\n val sortedList = this@sorted.toMutableList()\n sortedList.sort()\n return sortedList.iterator()\n }\n }\n}\n\n/**\n * Returns a sequence that yields elements of this sequence sorted according to natural sort order of the value returned by specified [selector] function.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n *\n * The operation is _intermediate_ and _stateful_.\n * \n * @sample samples.collections.Collections.Sorting.sortedBy\n */\npublic inline fun > Sequence.sortedBy(crossinline selector: (T) -> R?): Sequence {\n return sortedWith(compareBy(selector))\n}\n\n/**\n * Returns a sequence that yields elements of this sequence sorted descending according to natural sort order of the value returned by specified [selector] function.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n *\n * The operation is _intermediate_ and _stateful_.\n */\npublic inline fun > Sequence.sortedByDescending(crossinline selector: (T) -> R?): Sequence {\n return sortedWith(compareByDescending(selector))\n}\n\n/**\n * Returns a sequence that yields elements of this sequence sorted descending according to their natural sort order.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n *\n * The operation is _intermediate_ and _stateful_.\n */\npublic fun > Sequence.sortedDescending(): Sequence {\n return sortedWith(reverseOrder())\n}\n\n/**\n * Returns a sequence that yields elements of this sequence sorted according to the specified [comparator].\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n *\n * The operation is _intermediate_ and _stateful_.\n */\npublic fun Sequence.sortedWith(comparator: Comparator): Sequence {\n return object : Sequence {\n override fun iterator(): Iterator {\n val sortedList = this@sortedWith.toMutableList()\n sortedList.sortWith(comparator)\n return sortedList.iterator()\n }\n }\n}\n\n/**\n * Returns a [Map] containing key-value pairs provided by [transform] function\n * applied to elements of the given sequence.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original sequence.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Transformations.associate\n */\npublic inline fun Sequence.associate(transform: (T) -> Pair): Map {\n return associateTo(LinkedHashMap(), transform)\n}\n\n/**\n * Returns a [Map] containing the elements from the given sequence indexed by the key\n * returned from [keySelector] function applied to each element.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original sequence.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Transformations.associateBy\n */\npublic inline fun Sequence.associateBy(keySelector: (T) -> K): Map {\n return associateByTo(LinkedHashMap(), keySelector)\n}\n\n/**\n * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given sequence.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original sequence.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Transformations.associateByWithValueTransform\n */\npublic inline fun Sequence.associateBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map {\n return associateByTo(LinkedHashMap(), keySelector, valueTransform)\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function applied to each element of the given sequence\n * and value is the element itself.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Transformations.associateByTo\n */\npublic inline fun > Sequence.associateByTo(destination: M, keySelector: (T) -> K): M {\n for (element in this) {\n destination.put(keySelector(element), element)\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function and\n * and value is provided by the [valueTransform] function applied to elements of the given sequence.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Transformations.associateByToWithValueTransform\n */\npublic inline fun > Sequence.associateByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M {\n for (element in this) {\n destination.put(keySelector(element), valueTransform(element))\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs\n * provided by [transform] function applied to each element of the given sequence.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Transformations.associateTo\n */\npublic inline fun > Sequence.associateTo(destination: M, transform: (T) -> Pair): M {\n for (element in this) {\n destination += transform(element)\n }\n return destination\n}\n\n/**\n * Returns a [Map] where keys are elements from the given sequence and values are\n * produced by the [valueSelector] function applied to each element.\n * \n * If any two elements are equal, the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original sequence.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Transformations.associateWith\n */\n@SinceKotlin(\"1.3\")\npublic inline fun Sequence.associateWith(valueSelector: (K) -> V): Map {\n val result = LinkedHashMap()\n return associateWithTo(result, valueSelector)\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs for each element of the given sequence,\n * where key is the element itself and value is provided by the [valueSelector] function applied to that key.\n * \n * If any two elements are equal, the last one overwrites the former value in the map.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Transformations.associateWithTo\n */\n@SinceKotlin(\"1.3\")\npublic inline fun > Sequence.associateWithTo(destination: M, valueSelector: (K) -> V): M {\n for (element in this) {\n destination.put(element, valueSelector(element))\n }\n return destination\n}\n\n/**\n * Appends all elements to the given [destination] collection.\n *\n * The operation is _terminal_.\n */\npublic fun > Sequence.toCollection(destination: C): C {\n for (item in this) {\n destination.add(item)\n }\n return destination\n}\n\n/**\n * Returns a new [HashSet] of all elements.\n *\n * The operation is _terminal_.\n */\npublic fun Sequence.toHashSet(): HashSet {\n return toCollection(HashSet())\n}\n\n/**\n * Returns a [List] containing all elements.\n *\n * The operation is _terminal_.\n */\npublic fun Sequence.toList(): List {\n return this.toMutableList().optimizeReadOnlyList()\n}\n\n/**\n * Returns a new [MutableList] filled with all elements of this sequence.\n *\n * The operation is _terminal_.\n */\npublic fun Sequence.toMutableList(): MutableList {\n return toCollection(ArrayList())\n}\n\n/**\n * Returns a [Set] of all elements.\n * \n * The returned set preserves the element iteration order of the original sequence.\n *\n * The operation is _terminal_.\n */\npublic fun Sequence.toSet(): Set {\n return toCollection(LinkedHashSet()).optimizeReadOnlySet()\n}\n\n/**\n * Returns a single sequence of all elements from results of [transform] function being invoked on each element of original sequence.\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @sample samples.collections.Collections.Transformations.flatMap\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIterable\")\npublic fun Sequence.flatMap(transform: (T) -> Iterable): Sequence {\n return FlatteningSequence(this, transform, Iterable::iterator)\n}\n\n/**\n * Returns a single sequence of all elements from results of [transform] function being invoked on each element of original sequence.\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @sample samples.collections.Collections.Transformations.flatMap\n */\npublic fun Sequence.flatMap(transform: (T) -> Sequence): Sequence {\n return FlatteningSequence(this, transform, Sequence::iterator)\n}\n\n/**\n * Returns a single sequence of all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original sequence.\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @sample samples.collections.Collections.Transformations.flatMapIndexed\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterable\")\npublic fun Sequence.flatMapIndexed(transform: (index: Int, T) -> Iterable): Sequence {\n return flatMapIndexed(this, transform, Iterable::iterator)\n}\n\n/**\n * Returns a single sequence of all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original sequence.\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @sample samples.collections.Collections.Transformations.flatMapIndexed\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedSequence\")\npublic fun Sequence.flatMapIndexed(transform: (index: Int, T) -> Sequence): Sequence {\n return flatMapIndexed(this, transform, Sequence::iterator)\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original sequence, to the given [destination].\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterableTo\")\n@kotlin.internal.InlineOnly\npublic inline fun > Sequence.flatMapIndexedTo(destination: C, transform: (index: Int, T) -> Iterable): C {\n var index = 0\n for (element in this) {\n val list = transform(checkIndexOverflow(index++), element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original sequence, to the given [destination].\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedSequenceTo\")\n@kotlin.internal.InlineOnly\npublic inline fun > Sequence.flatMapIndexedTo(destination: C, transform: (index: Int, T) -> Sequence): C {\n var index = 0\n for (element in this) {\n val list = transform(checkIndexOverflow(index++), element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element of original sequence, to the given [destination].\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIterableTo\")\npublic inline fun > Sequence.flatMapTo(destination: C, transform: (T) -> Iterable): C {\n for (element in this) {\n val list = transform(element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element of original sequence, to the given [destination].\n *\n * The operation is _terminal_.\n */\npublic inline fun > Sequence.flatMapTo(destination: C, transform: (T) -> Sequence): C {\n for (element in this) {\n val list = transform(element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Groups elements of the original sequence by the key returned by the given [keySelector] function\n * applied to each element and returns a map where each group key is associated with a list of corresponding elements.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original sequence.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun Sequence.groupBy(keySelector: (T) -> K): Map> {\n return groupByTo(LinkedHashMap>(), keySelector)\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original sequence\n * by the key returned by the given [keySelector] function applied to the element\n * and returns a map where each group key is associated with a list of corresponding values.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original sequence.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun Sequence.groupBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map> {\n return groupByTo(LinkedHashMap>(), keySelector, valueTransform)\n}\n\n/**\n * Groups elements of the original sequence by the key returned by the given [keySelector] function\n * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements.\n * \n * @return The [destination] map.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun >> Sequence.groupByTo(destination: M, keySelector: (T) -> K): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(element)\n }\n return destination\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original sequence\n * by the key returned by the given [keySelector] function applied to the element\n * and puts to the [destination] map each group key associated with a list of corresponding values.\n * \n * @return The [destination] map.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun >> Sequence.groupByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(valueTransform(element))\n }\n return destination\n}\n\n/**\n * Creates a [Grouping] source from a sequence to be used later with one of group-and-fold operations\n * using the specified [keySelector] function to extract a key from each element.\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @sample samples.collections.Grouping.groupingByEachCount\n */\n@SinceKotlin(\"1.1\")\npublic inline fun Sequence.groupingBy(crossinline keySelector: (T) -> K): Grouping {\n return object : Grouping {\n override fun sourceIterator(): Iterator = this@groupingBy.iterator()\n override fun keyOf(element: T): K = keySelector(element)\n }\n}\n\n/**\n * Returns a sequence containing the results of applying the given [transform] function\n * to each element in the original sequence.\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @sample samples.collections.Collections.Transformations.map\n */\npublic fun Sequence.map(transform: (T) -> R): Sequence {\n return TransformingSequence(this, transform)\n}\n\n/**\n * Returns a sequence containing the results of applying the given [transform] function\n * to each element and its index in the original sequence.\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n *\n * The operation is _intermediate_ and _stateless_.\n */\npublic fun Sequence.mapIndexed(transform: (index: Int, T) -> R): Sequence {\n return TransformingIndexedSequence(this, transform)\n}\n\n/**\n * Returns a sequence containing only the non-null results of applying the given [transform] function\n * to each element and its index in the original sequence.\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n *\n * The operation is _intermediate_ and _stateless_.\n */\npublic fun Sequence.mapIndexedNotNull(transform: (index: Int, T) -> R?): Sequence {\n return TransformingIndexedSequence(this, transform).filterNotNull()\n}\n\n/**\n * Applies the given [transform] function to each element and its index in the original sequence\n * and appends only the non-null results to the given [destination].\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n *\n * The operation is _terminal_.\n */\npublic inline fun > Sequence.mapIndexedNotNullTo(destination: C, transform: (index: Int, T) -> R?): C {\n forEachIndexed { index, element -> transform(index, element)?.let { destination.add(it) } }\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element and its index in the original sequence\n * and appends the results to the given [destination].\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n *\n * The operation is _terminal_.\n */\npublic inline fun > Sequence.mapIndexedTo(destination: C, transform: (index: Int, T) -> R): C {\n var index = 0\n for (item in this)\n destination.add(transform(checkIndexOverflow(index++), item))\n return destination\n}\n\n/**\n * Returns a sequence containing only the non-null results of applying the given [transform] function\n * to each element in the original sequence.\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @sample samples.collections.Collections.Transformations.mapNotNull\n */\npublic fun Sequence.mapNotNull(transform: (T) -> R?): Sequence {\n return TransformingSequence(this, transform).filterNotNull()\n}\n\n/**\n * Applies the given [transform] function to each element in the original sequence\n * and appends only the non-null results to the given [destination].\n *\n * The operation is _terminal_.\n */\npublic inline fun > Sequence.mapNotNullTo(destination: C, transform: (T) -> R?): C {\n forEach { element -> transform(element)?.let { destination.add(it) } }\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element of the original sequence\n * and appends the results to the given [destination].\n *\n * The operation is _terminal_.\n */\npublic inline fun > Sequence.mapTo(destination: C, transform: (T) -> R): C {\n for (item in this)\n destination.add(transform(item))\n return destination\n}\n\n/**\n * Returns a sequence that wraps each element of the original sequence\n * into an [IndexedValue] containing the index of that element and the element itself.\n *\n * The operation is _intermediate_ and _stateless_.\n */\npublic fun Sequence.withIndex(): Sequence> {\n return IndexingSequence(this)\n}\n\n/**\n * Returns a sequence containing only distinct elements from the given sequence.\n * \n * Among equal elements of the given sequence, only the first one will be present in the resulting sequence.\n * The elements in the resulting sequence are in the same order as they were in the source sequence.\n *\n * The operation is _intermediate_ and _stateful_.\n * \n * @sample samples.collections.Collections.Transformations.distinctAndDistinctBy\n */\npublic fun Sequence.distinct(): Sequence {\n return this.distinctBy { it }\n}\n\n/**\n * Returns a sequence containing only elements from the given sequence\n * having distinct keys returned by the given [selector] function.\n * \n * Among elements of the given sequence with equal keys, only the first one will be present in the resulting sequence.\n * The elements in the resulting sequence are in the same order as they were in the source sequence.\n *\n * The operation is _intermediate_ and _stateful_.\n * \n * @sample samples.collections.Collections.Transformations.distinctAndDistinctBy\n */\npublic fun Sequence.distinctBy(selector: (T) -> K): Sequence {\n return DistinctSequence(this, selector)\n}\n\n/**\n * Returns a new [MutableSet] containing all distinct elements from the given sequence.\n * \n * The returned set preserves the element iteration order of the original sequence.\n *\n * The operation is _terminal_.\n */\npublic fun Sequence.toMutableSet(): MutableSet {\n val set = LinkedHashSet()\n for (item in this) set.add(item)\n return set\n}\n\n/**\n * Returns `true` if all elements match the given [predicate].\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Aggregates.all\n */\npublic inline fun Sequence.all(predicate: (T) -> Boolean): Boolean {\n for (element in this) if (!predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if sequence has at least one element.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Aggregates.any\n */\npublic fun Sequence.any(): Boolean {\n return iterator().hasNext()\n}\n\n/**\n * Returns `true` if at least one element matches the given [predicate].\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Aggregates.anyWithPredicate\n */\npublic inline fun Sequence.any(predicate: (T) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return true\n return false\n}\n\n/**\n * Returns the number of elements in this sequence.\n *\n * The operation is _terminal_.\n */\npublic fun Sequence.count(): Int {\n var count = 0\n for (element in this) checkCountOverflow(++count)\n return count\n}\n\n/**\n * Returns the number of elements matching the given [predicate].\n *\n * The operation is _terminal_.\n */\npublic inline fun Sequence.count(predicate: (T) -> Boolean): Int {\n var count = 0\n for (element in this) if (predicate(element)) checkCountOverflow(++count)\n return count\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns the specified [initial] value if the sequence is empty.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n *\n * The operation is _terminal_.\n */\npublic inline fun Sequence.fold(initial: R, operation: (acc: R, T) -> R): R {\n var accumulator = initial\n for (element in this) accumulator = operation(accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original sequence.\n * \n * Returns the specified [initial] value if the sequence is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n *\n * The operation is _terminal_.\n */\npublic inline fun Sequence.foldIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): R {\n var index = 0\n var accumulator = initial\n for (element in this) accumulator = operation(checkIndexOverflow(index++), accumulator, element)\n return accumulator\n}\n\n/**\n * Performs the given [action] on each element.\n *\n * The operation is _terminal_.\n */\npublic inline fun Sequence.forEach(action: (T) -> Unit): Unit {\n for (element in this) action(element)\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n *\n * The operation is _terminal_.\n */\npublic inline fun Sequence.forEachIndexed(action: (index: Int, T) -> Unit): Unit {\n var index = 0\n for (item in this) action(checkIndexOverflow(index++), item)\n}\n\n@Deprecated(\"Use maxOrNull instead.\", ReplaceWith(\"this.maxOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\n@SinceKotlin(\"1.1\")\npublic fun Sequence.max(): Double? {\n return maxOrNull()\n}\n\n@Deprecated(\"Use maxOrNull instead.\", ReplaceWith(\"this.maxOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\n@SinceKotlin(\"1.1\")\npublic fun Sequence.max(): Float? {\n return maxOrNull()\n}\n\n@Deprecated(\"Use maxOrNull instead.\", ReplaceWith(\"this.maxOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun > Sequence.max(): T? {\n return maxOrNull()\n}\n\n@Deprecated(\"Use maxByOrNull instead.\", ReplaceWith(\"this.maxByOrNull(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic inline fun > Sequence.maxBy(selector: (T) -> R): T? {\n return maxByOrNull(selector)\n}\n\n/**\n * Returns the first element yielding the largest value of the given function or `null` if there are no elements.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Aggregates.maxByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > Sequence.maxByOrNull(selector: (T) -> R): T? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var maxElem = iterator.next()\n if (!iterator.hasNext()) return maxElem\n var maxValue = selector(maxElem)\n do {\n val e = iterator.next()\n val v = selector(e)\n if (maxValue < v) {\n maxElem = e\n maxValue = v\n }\n } while (iterator.hasNext())\n return maxElem\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the sequence.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the sequence is empty.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Sequence.maxOf(selector: (T) -> Double): Double {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var maxValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the sequence.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the sequence is empty.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Sequence.maxOf(selector: (T) -> Float): Float {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var maxValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the sequence.\n * \n * @throws NoSuchElementException if the sequence is empty.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > Sequence.maxOf(selector: (T) -> R): R {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var maxValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the sequence or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Sequence.maxOfOrNull(selector: (T) -> Double): Double? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var maxValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the sequence or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Sequence.maxOfOrNull(selector: (T) -> Float): Float? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var maxValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the sequence or `null` if there are no elements.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > Sequence.maxOfOrNull(selector: (T) -> R): R? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var maxValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the sequence.\n * \n * @throws NoSuchElementException if the sequence is empty.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Sequence.maxOfWith(comparator: Comparator, selector: (T) -> R): R {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var maxValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the sequence or `null` if there are no elements.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Sequence.maxOfWithOrNull(comparator: Comparator, selector: (T) -> R): R? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var maxValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n * \n * If any of elements is `NaN` returns `NaN`.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\npublic fun Sequence.maxOrNull(): Double? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var max = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n max = maxOf(max, e)\n }\n return max\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n * \n * If any of elements is `NaN` returns `NaN`.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\npublic fun Sequence.maxOrNull(): Float? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var max = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n max = maxOf(max, e)\n }\n return max\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\npublic fun > Sequence.maxOrNull(): T? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var max = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n if (max < e) max = e\n }\n return max\n}\n\n@Deprecated(\"Use maxWithOrNull instead.\", ReplaceWith(\"this.maxWithOrNull(comparator)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun Sequence.maxWith(comparator: Comparator): T? {\n return maxWithOrNull(comparator)\n}\n\n/**\n * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\npublic fun Sequence.maxWithOrNull(comparator: Comparator): T? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var max = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n if (comparator.compare(max, e) < 0) max = e\n }\n return max\n}\n\n@Deprecated(\"Use minOrNull instead.\", ReplaceWith(\"this.minOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\n@SinceKotlin(\"1.1\")\npublic fun Sequence.min(): Double? {\n return minOrNull()\n}\n\n@Deprecated(\"Use minOrNull instead.\", ReplaceWith(\"this.minOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\n@SinceKotlin(\"1.1\")\npublic fun Sequence.min(): Float? {\n return minOrNull()\n}\n\n@Deprecated(\"Use minOrNull instead.\", ReplaceWith(\"this.minOrNull()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun > Sequence.min(): T? {\n return minOrNull()\n}\n\n@Deprecated(\"Use minByOrNull instead.\", ReplaceWith(\"this.minByOrNull(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic inline fun > Sequence.minBy(selector: (T) -> R): T? {\n return minByOrNull(selector)\n}\n\n/**\n * Returns the first element yielding the smallest value of the given function or `null` if there are no elements.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Aggregates.minByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > Sequence.minByOrNull(selector: (T) -> R): T? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var minElem = iterator.next()\n if (!iterator.hasNext()) return minElem\n var minValue = selector(minElem)\n do {\n val e = iterator.next()\n val v = selector(e)\n if (minValue > v) {\n minElem = e\n minValue = v\n }\n } while (iterator.hasNext())\n return minElem\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the sequence.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the sequence is empty.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Sequence.minOf(selector: (T) -> Double): Double {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var minValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the sequence.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the sequence is empty.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Sequence.minOf(selector: (T) -> Float): Float {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var minValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the sequence.\n * \n * @throws NoSuchElementException if the sequence is empty.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > Sequence.minOf(selector: (T) -> R): R {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var minValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the sequence or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Sequence.minOfOrNull(selector: (T) -> Double): Double? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var minValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the sequence or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Sequence.minOfOrNull(selector: (T) -> Float): Float? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var minValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the sequence or `null` if there are no elements.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > Sequence.minOfOrNull(selector: (T) -> R): R? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var minValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the sequence.\n * \n * @throws NoSuchElementException if the sequence is empty.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Sequence.minOfWith(comparator: Comparator, selector: (T) -> R): R {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var minValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the sequence or `null` if there are no elements.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Sequence.minOfWithOrNull(comparator: Comparator, selector: (T) -> R): R? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var minValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n * \n * If any of elements is `NaN` returns `NaN`.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\npublic fun Sequence.minOrNull(): Double? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var min = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n min = minOf(min, e)\n }\n return min\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n * \n * If any of elements is `NaN` returns `NaN`.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\npublic fun Sequence.minOrNull(): Float? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var min = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n min = minOf(min, e)\n }\n return min\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\npublic fun > Sequence.minOrNull(): T? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var min = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n if (min > e) min = e\n }\n return min\n}\n\n@Deprecated(\"Use minWithOrNull instead.\", ReplaceWith(\"this.minWithOrNull(comparator)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\", hiddenSince = \"1.6\")\npublic fun Sequence.minWith(comparator: Comparator): T? {\n return minWithOrNull(comparator)\n}\n\n/**\n * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\npublic fun Sequence.minWithOrNull(comparator: Comparator): T? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var min = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n if (comparator.compare(min, e) > 0) min = e\n }\n return min\n}\n\n/**\n * Returns `true` if the sequence has no elements.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Aggregates.none\n */\npublic fun Sequence.none(): Boolean {\n return !iterator().hasNext()\n}\n\n/**\n * Returns `true` if no elements match the given [predicate].\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Aggregates.noneWithPredicate\n */\npublic inline fun Sequence.none(predicate: (T) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return false\n return true\n}\n\n/**\n * Returns a sequence which performs the given [action] on each element of the original sequence as they pass through it.\n *\n * The operation is _intermediate_ and _stateless_.\n */\n@SinceKotlin(\"1.1\")\npublic fun Sequence.onEach(action: (T) -> Unit): Sequence {\n return map {\n action(it)\n it\n }\n}\n\n/**\n * Returns a sequence which performs the given [action] on each element of the original sequence as they pass through it.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n *\n * The operation is _intermediate_ and _stateless_.\n */\n@SinceKotlin(\"1.4\")\npublic fun Sequence.onEachIndexed(action: (index: Int, T) -> Unit): Sequence {\n return mapIndexed { index, element ->\n action(index, element)\n element\n }\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Throws an exception if this sequence is empty. If the sequence can be empty in an expected way,\n * please use [reduceOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun Sequence.reduce(operation: (acc: S, T) -> S): S {\n val iterator = this.iterator()\n if (!iterator.hasNext()) throw UnsupportedOperationException(\"Empty sequence can't be reduced.\")\n var accumulator: S = iterator.next()\n while (iterator.hasNext()) {\n accumulator = operation(accumulator, iterator.next())\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original sequence.\n * \n * Throws an exception if this sequence is empty. If the sequence can be empty in an expected way,\n * please use [reduceIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun Sequence.reduceIndexed(operation: (index: Int, acc: S, T) -> S): S {\n val iterator = this.iterator()\n if (!iterator.hasNext()) throw UnsupportedOperationException(\"Empty sequence can't be reduced.\")\n var index = 1\n var accumulator: S = iterator.next()\n while (iterator.hasNext()) {\n accumulator = operation(checkIndexOverflow(index++), accumulator, iterator.next())\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original sequence.\n * \n * Returns `null` if the sequence is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun Sequence.reduceIndexedOrNull(operation: (index: Int, acc: S, T) -> S): S? {\n val iterator = this.iterator()\n if (!iterator.hasNext()) return null\n var index = 1\n var accumulator: S = iterator.next()\n while (iterator.hasNext()) {\n accumulator = operation(checkIndexOverflow(index++), accumulator, iterator.next())\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns `null` if the sequence is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun Sequence.reduceOrNull(operation: (acc: S, T) -> S): S? {\n val iterator = this.iterator()\n if (!iterator.hasNext()) return null\n var accumulator: S = iterator.next()\n while (iterator.hasNext()) {\n accumulator = operation(accumulator, iterator.next())\n }\n return accumulator\n}\n\n/**\n * Returns a sequence containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting sequence.\n * The [initial] value should also be immutable (or should not be mutated)\n * as it may be passed to [operation] function later because of sequence's lazy nature.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\npublic fun Sequence.runningFold(initial: R, operation: (acc: R, T) -> R): Sequence {\n return sequence {\n yield(initial)\n var accumulator = initial\n for (element in this@runningFold) {\n accumulator = operation(accumulator, element)\n yield(accumulator)\n }\n }\n}\n\n/**\n * Returns a sequence containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original sequence and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting sequence.\n * The [initial] value should also be immutable (or should not be mutated)\n * as it may be passed to [operation] function later because of sequence's lazy nature.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\npublic fun Sequence.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): Sequence {\n return sequence {\n yield(initial)\n var index = 0\n var accumulator = initial\n for (element in this@runningFoldIndexed) {\n accumulator = operation(checkIndexOverflow(index++), accumulator, element)\n yield(accumulator)\n }\n }\n}\n\n/**\n * Returns a sequence containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with the first element of this sequence.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting sequence.\n * \n * @param [operation] function that takes current accumulator value and the element, and calculates the next accumulator value.\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun Sequence.runningReduce(operation: (acc: S, T) -> S): Sequence {\n return sequence {\n val iterator = iterator()\n if (iterator.hasNext()) {\n var accumulator: S = iterator.next()\n yield(accumulator)\n while (iterator.hasNext()) {\n accumulator = operation(accumulator, iterator.next())\n yield(accumulator)\n }\n }\n }\n}\n\n/**\n * Returns a sequence containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original sequence and current accumulator value that starts with the first element of this sequence.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting sequence.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\npublic fun Sequence.runningReduceIndexed(operation: (index: Int, acc: S, T) -> S): Sequence {\n return sequence {\n val iterator = iterator()\n if (iterator.hasNext()) {\n var accumulator: S = iterator.next()\n yield(accumulator)\n var index = 1\n while (iterator.hasNext()) {\n accumulator = operation(checkIndexOverflow(index++), accumulator, iterator.next())\n yield(accumulator)\n }\n }\n }\n}\n\n/**\n * Returns a sequence containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting sequence.\n * The [initial] value should also be immutable (or should not be mutated)\n * as it may be passed to [operation] function later because of sequence's lazy nature.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun Sequence.scan(initial: R, operation: (acc: R, T) -> R): Sequence {\n return runningFold(initial, operation)\n}\n\n/**\n * Returns a sequence containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original sequence and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting sequence.\n * The [initial] value should also be immutable (or should not be mutated)\n * as it may be passed to [operation] function later because of sequence's lazy nature.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun Sequence.scanIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): Sequence {\n return runningFoldIndexed(initial, operation)\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the sequence.\n *\n * The operation is _terminal_.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun Sequence.sumBy(selector: (T) -> Int): Int {\n var sum: Int = 0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the sequence.\n *\n * The operation is _terminal_.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun Sequence.sumByDouble(selector: (T) -> Double): Double {\n var sum: Double = 0.0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the sequence.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfDouble\")\n@kotlin.internal.InlineOnly\npublic inline fun Sequence.sumOf(selector: (T) -> Double): Double {\n var sum: Double = 0.toDouble()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the sequence.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfInt\")\n@kotlin.internal.InlineOnly\npublic inline fun Sequence.sumOf(selector: (T) -> Int): Int {\n var sum: Int = 0.toInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the sequence.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfLong\")\n@kotlin.internal.InlineOnly\npublic inline fun Sequence.sumOf(selector: (T) -> Long): Long {\n var sum: Long = 0.toLong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the sequence.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfUInt\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Sequence.sumOf(selector: (T) -> UInt): UInt {\n var sum: UInt = 0.toUInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the sequence.\n *\n * The operation is _terminal_.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfULong\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Sequence.sumOf(selector: (T) -> ULong): ULong {\n var sum: ULong = 0.toULong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements.\n *\n * The operation is _intermediate_ and _stateless_.\n */\npublic fun Sequence.requireNoNulls(): Sequence {\n return map { it ?: throw IllegalArgumentException(\"null element found in $this.\") }\n}\n\n/**\n * Splits this sequence into a sequence of lists each not exceeding the given [size].\n * \n * The last list in the resulting sequence may have fewer elements than the given [size].\n * \n * @param size the number of elements to take in each list, must be positive and can be greater than the number of elements in this sequence.\n *\n * The operation is _intermediate_ and _stateful_.\n * \n * @sample samples.collections.Collections.Transformations.chunked\n */\n@SinceKotlin(\"1.2\")\npublic fun Sequence.chunked(size: Int): Sequence> {\n return windowed(size, size, partialWindows = true)\n}\n\n/**\n * Splits this sequence into several lists each not exceeding the given [size]\n * and applies the given [transform] function to an each.\n * \n * @return sequence of results of the [transform] applied to an each list.\n * \n * Note that the list passed to the [transform] function is ephemeral and is valid only inside that function.\n * You should not store it or allow it to escape in some way, unless you made a snapshot of it.\n * The last list may have fewer elements than the given [size].\n * \n * @param size the number of elements to take in each list, must be positive and can be greater than the number of elements in this sequence.\n *\n * The operation is _intermediate_ and _stateful_.\n * \n * @sample samples.text.Strings.chunkedTransform\n */\n@SinceKotlin(\"1.2\")\npublic fun Sequence.chunked(size: Int, transform: (List) -> R): Sequence {\n return windowed(size, size, partialWindows = true, transform = transform)\n}\n\n/**\n * Returns a sequence containing all elements of the original sequence without the first occurrence of the given [element].\n *\n * The operation is _intermediate_ and _stateless_.\n */\npublic operator fun Sequence.minus(element: T): Sequence {\n return object: Sequence {\n override fun iterator(): Iterator {\n var removed = false\n return this@minus.filter { if (!removed && it == element) { removed = true; false } else true }.iterator()\n }\n }\n}\n\n/**\n * Returns a sequence containing all elements of original sequence except the elements contained in the given [elements] array.\n * \n * Note that the source sequence and the array being subtracted are iterated only when an `iterator` is requested from\n * the resulting sequence. Changing any of them between successive calls to `iterator` may affect the result.\n * \n * Before Kotlin 1.6, the [elements] array may have been converted to a [HashSet] to speed up the operation, thus the elements were required to have\n * a correct and stable implementation of `hashCode()` that didn't change between successive invocations.\n * On JVM, you can enable this behavior back with the system property `kotlin.collections.convert_arg_to_set_in_removeAll` set to `true`.\n *\n * The operation is _intermediate_ and _stateful_.\n */\npublic operator fun Sequence.minus(elements: Array): Sequence {\n if (elements.isEmpty()) return this\n return object: Sequence {\n override fun iterator(): Iterator {\n val other = elements.convertToSetForSetOperation()\n return this@minus.filterNot { it in other }.iterator()\n }\n }\n}\n\n/**\n * Returns a sequence containing all elements of original sequence except the elements contained in the given [elements] collection.\n * \n * Note that the source sequence and the collection being subtracted are iterated only when an `iterator` is requested from\n * the resulting sequence. Changing any of them between successive calls to `iterator` may affect the result.\n * \n * Before Kotlin 1.6, the [elements] collection may have been converted to a [HashSet] to speed up the operation, thus the elements were required to have\n * a correct and stable implementation of `hashCode()` that didn't change between successive invocations.\n * On JVM, you can enable this behavior back with the system property `kotlin.collections.convert_arg_to_set_in_removeAll` set to `true`.\n *\n * The operation is _intermediate_ and _stateful_.\n */\npublic operator fun Sequence.minus(elements: Iterable): Sequence {\n return object: Sequence {\n override fun iterator(): Iterator {\n val other = elements.convertToSetForSetOperation()\n if (other.isEmpty())\n return this@minus.iterator()\n else\n return this@minus.filterNot { it in other }.iterator()\n }\n }\n}\n\n/**\n * Returns a sequence containing all elements of original sequence except the elements contained in the given [elements] sequence.\n * \n * Note that the source sequence and the sequence being subtracted are iterated only when an `iterator` is requested from\n * the resulting sequence. Changing any of them between successive calls to `iterator` may affect the result.\n * \n * The operation is _intermediate_ for this sequence and _terminal_ and _stateful_ for the [elements] sequence.\n * \n * Before Kotlin 1.6, the [elements] sequence may have been converted to a [HashSet] to speed up the operation, thus the elements were required to have\n * a correct and stable implementation of `hashCode()` that didn't change between successive invocations.\n * On JVM, you can enable this behavior back with the system property `kotlin.collections.convert_arg_to_set_in_removeAll` set to `true`.\n */\npublic operator fun Sequence.minus(elements: Sequence): Sequence {\n return object: Sequence {\n override fun iterator(): Iterator {\n val other = elements.convertToSetForSetOperation()\n if (other.isEmpty())\n return this@minus.iterator()\n else\n return this@minus.filterNot { it in other }.iterator()\n }\n }\n}\n\n/**\n * Returns a sequence containing all elements of the original sequence without the first occurrence of the given [element].\n *\n * The operation is _intermediate_ and _stateless_.\n */\n@kotlin.internal.InlineOnly\npublic inline fun Sequence.minusElement(element: T): Sequence {\n return minus(element)\n}\n\n/**\n * Splits the original sequence into pair of lists,\n * where *first* list contains elements for which [predicate] yielded `true`,\n * while *second* list contains elements for which [predicate] yielded `false`.\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Sequences.Transformations.partition\n */\npublic inline fun Sequence.partition(predicate: (T) -> Boolean): Pair, List> {\n val first = ArrayList()\n val second = ArrayList()\n for (element in this) {\n if (predicate(element)) {\n first.add(element)\n } else {\n second.add(element)\n }\n }\n return Pair(first, second)\n}\n\n/**\n * Returns a sequence containing all elements of the original sequence and then the given [element].\n *\n * The operation is _intermediate_ and _stateless_.\n */\npublic operator fun Sequence.plus(element: T): Sequence {\n return sequenceOf(this, sequenceOf(element)).flatten()\n}\n\n/**\n * Returns a sequence containing all elements of original sequence and then all elements of the given [elements] array.\n * \n * Note that the source sequence and the array being added are iterated only when an `iterator` is requested from\n * the resulting sequence. Changing any of them between successive calls to `iterator` may affect the result.\n *\n * The operation is _intermediate_ and _stateless_.\n */\npublic operator fun Sequence.plus(elements: Array): Sequence {\n return this.plus(elements.asList())\n}\n\n/**\n * Returns a sequence containing all elements of original sequence and then all elements of the given [elements] collection.\n * \n * Note that the source sequence and the collection being added are iterated only when an `iterator` is requested from\n * the resulting sequence. Changing any of them between successive calls to `iterator` may affect the result.\n *\n * The operation is _intermediate_ and _stateless_.\n */\npublic operator fun Sequence.plus(elements: Iterable): Sequence {\n return sequenceOf(this, elements.asSequence()).flatten()\n}\n\n/**\n * Returns a sequence containing all elements of original sequence and then all elements of the given [elements] sequence.\n * \n * Note that the source sequence and the sequence being added are iterated only when an `iterator` is requested from\n * the resulting sequence. Changing any of them between successive calls to `iterator` may affect the result.\n *\n * The operation is _intermediate_ and _stateless_.\n */\npublic operator fun Sequence.plus(elements: Sequence): Sequence {\n return sequenceOf(this, elements).flatten()\n}\n\n/**\n * Returns a sequence containing all elements of the original sequence and then the given [element].\n *\n * The operation is _intermediate_ and _stateless_.\n */\n@kotlin.internal.InlineOnly\npublic inline fun Sequence.plusElement(element: T): Sequence {\n return plus(element)\n}\n\n/**\n * Returns a sequence of snapshots of the window of the given [size]\n * sliding along this sequence with the given [step], where each\n * snapshot is a list.\n * \n * Several last lists may have fewer elements than the given [size].\n * \n * Both [size] and [step] must be positive and can be greater than the number of elements in this sequence.\n * @param size the number of elements to take in each window\n * @param step the number of elements to move the window forward by on an each step, by default 1\n * @param partialWindows controls whether or not to keep partial windows in the end if any,\n * by default `false` which means partial windows won't be preserved\n * \n * @sample samples.collections.Sequences.Transformations.takeWindows\n */\n@SinceKotlin(\"1.2\")\npublic fun Sequence.windowed(size: Int, step: Int = 1, partialWindows: Boolean = false): Sequence> {\n return windowedSequence(size, step, partialWindows, reuseBuffer = false)\n}\n\n/**\n * Returns a sequence of results of applying the given [transform] function to\n * an each list representing a view over the window of the given [size]\n * sliding along this sequence with the given [step].\n * \n * Note that the list passed to the [transform] function is ephemeral and is valid only inside that function.\n * You should not store it or allow it to escape in some way, unless you made a snapshot of it.\n * Several last lists may have fewer elements than the given [size].\n * \n * Both [size] and [step] must be positive and can be greater than the number of elements in this sequence.\n * @param size the number of elements to take in each window\n * @param step the number of elements to move the window forward by on an each step, by default 1\n * @param partialWindows controls whether or not to keep partial windows in the end if any,\n * by default `false` which means partial windows won't be preserved\n * \n * @sample samples.collections.Sequences.Transformations.averageWindows\n */\n@SinceKotlin(\"1.2\")\npublic fun Sequence.windowed(size: Int, step: Int = 1, partialWindows: Boolean = false, transform: (List) -> R): Sequence {\n return windowedSequence(size, step, partialWindows, reuseBuffer = true).map(transform)\n}\n\n/**\n * Returns a sequence of values built from the elements of `this` sequence and the [other] sequence with the same index.\n * The resulting sequence ends as soon as the shortest input sequence ends.\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @sample samples.collections.Sequences.Transformations.zip\n */\npublic infix fun Sequence.zip(other: Sequence): Sequence> {\n return MergingSequence(this, other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a sequence of values built from the elements of `this` sequence and the [other] sequence with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The resulting sequence ends as soon as the shortest input sequence ends.\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @sample samples.collections.Sequences.Transformations.zipWithTransform\n */\npublic fun Sequence.zip(other: Sequence, transform: (a: T, b: R) -> V): Sequence {\n return MergingSequence(this, other, transform)\n}\n\n/**\n * Returns a sequence of pairs of each two adjacent elements in this sequence.\n * \n * The returned sequence is empty if this sequence contains less than two elements.\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @sample samples.collections.Collections.Transformations.zipWithNext\n */\n@SinceKotlin(\"1.2\")\npublic fun Sequence.zipWithNext(): Sequence> {\n return zipWithNext { a, b -> a to b }\n}\n\n/**\n * Returns a sequence containing the results of applying the given [transform] function\n * to an each pair of two adjacent elements in this sequence.\n * \n * The returned sequence is empty if this sequence contains less than two elements.\n *\n * The operation is _intermediate_ and _stateless_.\n * \n * @sample samples.collections.Collections.Transformations.zipWithNextToFindDeltas\n */\n@SinceKotlin(\"1.2\")\npublic fun Sequence.zipWithNext(transform: (a: T, b: T) -> R): Sequence {\n return sequence result@ {\n val iterator = iterator()\n if (!iterator.hasNext()) return@result\n var current = iterator.next()\n while (iterator.hasNext()) {\n val next = iterator.next()\n yield(transform(current, next))\n current = next\n }\n }\n}\n\n/**\n * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Transformations.joinTo\n */\npublic fun Sequence.joinTo(buffer: A, separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((T) -> CharSequence)? = null): A {\n buffer.append(prefix)\n var count = 0\n for (element in this) {\n if (++count > 1) buffer.append(separator)\n if (limit < 0 || count <= limit) {\n buffer.appendElement(element, transform)\n } else break\n }\n if (limit >= 0 && count > limit) buffer.append(truncated)\n buffer.append(postfix)\n return buffer\n}\n\n/**\n * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n *\n * The operation is _terminal_.\n * \n * @sample samples.collections.Collections.Transformations.joinToString\n */\npublic fun Sequence.joinToString(separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((T) -> CharSequence)? = null): String {\n return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated, transform).toString()\n}\n\n/**\n * Creates an [Iterable] instance that wraps the original sequence returning its elements when being iterated.\n */\npublic fun Sequence.asIterable(): Iterable {\n return Iterable { this.iterator() }\n}\n\n/**\n * Returns this sequence as a [Sequence].\n */\n@kotlin.internal.InlineOnly\npublic inline fun Sequence.asSequence(): Sequence {\n return this\n}\n\n/**\n * Returns an average value of elements in the sequence.\n *\n * The operation is _terminal_.\n */\n@kotlin.jvm.JvmName(\"averageOfByte\")\npublic fun Sequence.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n checkCountOverflow(++count)\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the sequence.\n *\n * The operation is _terminal_.\n */\n@kotlin.jvm.JvmName(\"averageOfShort\")\npublic fun Sequence.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n checkCountOverflow(++count)\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the sequence.\n *\n * The operation is _terminal_.\n */\n@kotlin.jvm.JvmName(\"averageOfInt\")\npublic fun Sequence.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n checkCountOverflow(++count)\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the sequence.\n *\n * The operation is _terminal_.\n */\n@kotlin.jvm.JvmName(\"averageOfLong\")\npublic fun Sequence.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n checkCountOverflow(++count)\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the sequence.\n *\n * The operation is _terminal_.\n */\n@kotlin.jvm.JvmName(\"averageOfFloat\")\npublic fun Sequence.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n checkCountOverflow(++count)\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the sequence.\n *\n * The operation is _terminal_.\n */\n@kotlin.jvm.JvmName(\"averageOfDouble\")\npublic fun Sequence.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n checkCountOverflow(++count)\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns the sum of all elements in the sequence.\n *\n * The operation is _terminal_.\n */\n@kotlin.jvm.JvmName(\"sumOfByte\")\npublic fun Sequence.sum(): Int {\n var sum: Int = 0\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the sequence.\n *\n * The operation is _terminal_.\n */\n@kotlin.jvm.JvmName(\"sumOfShort\")\npublic fun Sequence.sum(): Int {\n var sum: Int = 0\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the sequence.\n *\n * The operation is _terminal_.\n */\n@kotlin.jvm.JvmName(\"sumOfInt\")\npublic fun Sequence.sum(): Int {\n var sum: Int = 0\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the sequence.\n *\n * The operation is _terminal_.\n */\n@kotlin.jvm.JvmName(\"sumOfLong\")\npublic fun Sequence.sum(): Long {\n var sum: Long = 0L\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the sequence.\n *\n * The operation is _terminal_.\n */\n@kotlin.jvm.JvmName(\"sumOfFloat\")\npublic fun Sequence.sum(): Float {\n var sum: Float = 0.0f\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the sequence.\n *\n * The operation is _terminal_.\n */\n@kotlin.jvm.JvmName(\"sumOfDouble\")\npublic fun Sequence.sum(): Double {\n var sum: Double = 0.0\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n","/*\n * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"StringsKt\")\n\npackage kotlin.text\n\n//\n// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt\n// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib\n//\n\nimport kotlin.random.*\n\n/**\n * Returns a character at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this char sequence.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic expect fun CharSequence.elementAt(index: Int): Char\n\n/**\n * Returns a character at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this char sequence.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.elementAtOrElse(index: Int, defaultValue: (Int) -> Char): Char {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns a character at the given [index] or `null` if the [index] is out of bounds of this char sequence.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.elementAtOrNull(index: Int): Char? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns the first character matching the given [predicate], or `null` if no such character was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.find(predicate: (Char) -> Boolean): Char? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the last character matching the given [predicate], or `null` if no such character was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.findLast(predicate: (Char) -> Boolean): Char? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns the first character.\n * \n * @throws NoSuchElementException if the char sequence is empty.\n */\npublic fun CharSequence.first(): Char {\n if (isEmpty())\n throw NoSuchElementException(\"Char sequence is empty.\")\n return this[0]\n}\n\n/**\n * Returns the first character matching the given [predicate].\n * @throws [NoSuchElementException] if no such character is found.\n */\npublic inline fun CharSequence.first(predicate: (Char) -> Boolean): Char {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Char sequence contains no character matching the predicate.\")\n}\n\n/**\n * Returns the first non-null value produced by [transform] function being applied to characters of this char sequence in iteration order,\n * or throws [NoSuchElementException] if no non-null value was produced.\n * \n * @sample samples.collections.Collections.Transformations.firstNotNullOf\n */\n@SinceKotlin(\"1.5\")\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.firstNotNullOf(transform: (Char) -> R?): R {\n return firstNotNullOfOrNull(transform) ?: throw NoSuchElementException(\"No element of the char sequence was transformed to a non-null value.\")\n}\n\n/**\n * Returns the first non-null value produced by [transform] function being applied to characters of this char sequence in iteration order,\n * or `null` if no non-null value was produced.\n * \n * @sample samples.collections.Collections.Transformations.firstNotNullOf\n */\n@SinceKotlin(\"1.5\")\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.firstNotNullOfOrNull(transform: (Char) -> R?): R? {\n for (element in this) {\n val result = transform(element)\n if (result != null) {\n return result\n }\n }\n return null\n}\n\n/**\n * Returns the first character, or `null` if the char sequence is empty.\n */\npublic fun CharSequence.firstOrNull(): Char? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first character matching the given [predicate], or `null` if character was not found.\n */\npublic inline fun CharSequence.firstOrNull(predicate: (Char) -> Boolean): Char? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns a character at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this char sequence.\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.getOrElse(index: Int, defaultValue: (Int) -> Char): Char {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns a character at the given [index] or `null` if the [index] is out of bounds of this char sequence.\n * \n * @sample samples.collections.Collections.Elements.getOrNull\n */\npublic fun CharSequence.getOrNull(index: Int): Char? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns index of the first character matching the given [predicate], or -1 if the char sequence does not contain such character.\n */\npublic inline fun CharSequence.indexOfFirst(predicate: (Char) -> Boolean): Int {\n for (index in indices) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns index of the last character matching the given [predicate], or -1 if the char sequence does not contain such character.\n */\npublic inline fun CharSequence.indexOfLast(predicate: (Char) -> Boolean): Int {\n for (index in indices.reversed()) {\n if (predicate(this[index])) {\n return index\n }\n }\n return -1\n}\n\n/**\n * Returns the last character.\n * \n * @throws NoSuchElementException if the char sequence is empty.\n * \n * @sample samples.text.Strings.last\n */\npublic fun CharSequence.last(): Char {\n if (isEmpty())\n throw NoSuchElementException(\"Char sequence is empty.\")\n return this[lastIndex]\n}\n\n/**\n * Returns the last character matching the given [predicate].\n * \n * @throws NoSuchElementException if no such character is found.\n * \n * @sample samples.text.Strings.last\n */\npublic inline fun CharSequence.last(predicate: (Char) -> Boolean): Char {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"Char sequence contains no character matching the predicate.\")\n}\n\n/**\n * Returns the last character, or `null` if the char sequence is empty.\n * \n * @sample samples.text.Strings.last\n */\npublic fun CharSequence.lastOrNull(): Char? {\n return if (isEmpty()) null else this[length - 1]\n}\n\n/**\n * Returns the last character matching the given [predicate], or `null` if no such character was found.\n * \n * @sample samples.text.Strings.last\n */\npublic inline fun CharSequence.lastOrNull(predicate: (Char) -> Boolean): Char? {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns a random character from this char sequence.\n * \n * @throws NoSuchElementException if this char sequence is empty.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.random(): Char {\n return random(Random)\n}\n\n/**\n * Returns a random character from this char sequence using the specified source of randomness.\n * \n * @throws NoSuchElementException if this char sequence is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun CharSequence.random(random: Random): Char {\n if (isEmpty())\n throw NoSuchElementException(\"Char sequence is empty.\")\n return get(random.nextInt(length))\n}\n\n/**\n * Returns a random character from this char sequence, or `null` if this char sequence is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.randomOrNull(): Char? {\n return randomOrNull(Random)\n}\n\n/**\n * Returns a random character from this char sequence using the specified source of randomness, or `null` if this char sequence is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun CharSequence.randomOrNull(random: Random): Char? {\n if (isEmpty())\n return null\n return get(random.nextInt(length))\n}\n\n/**\n * Returns the single character, or throws an exception if the char sequence is empty or has more than one character.\n */\npublic fun CharSequence.single(): Char {\n return when (length) {\n 0 -> throw NoSuchElementException(\"Char sequence is empty.\")\n 1 -> this[0]\n else -> throw IllegalArgumentException(\"Char sequence has more than one element.\")\n }\n}\n\n/**\n * Returns the single character matching the given [predicate], or throws exception if there is no or more than one matching character.\n */\npublic inline fun CharSequence.single(predicate: (Char) -> Boolean): Char {\n var single: Char? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Char sequence contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Char sequence contains no character matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as Char\n}\n\n/**\n * Returns single character, or `null` if the char sequence is empty or has more than one character.\n */\npublic fun CharSequence.singleOrNull(): Char? {\n return if (length == 1) this[0] else null\n}\n\n/**\n * Returns the single character matching the given [predicate], or `null` if character was not found or more than one character was found.\n */\npublic inline fun CharSequence.singleOrNull(predicate: (Char) -> Boolean): Char? {\n var single: Char? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns a subsequence of this char sequence with the first [n] characters removed.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.text.Strings.drop\n */\npublic fun CharSequence.drop(n: Int): CharSequence {\n require(n >= 0) { \"Requested character count $n is less than zero.\" }\n return subSequence(n.coerceAtMost(length), length)\n}\n\n/**\n * Returns a string with the first [n] characters removed.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.text.Strings.drop\n */\npublic fun String.drop(n: Int): String {\n require(n >= 0) { \"Requested character count $n is less than zero.\" }\n return substring(n.coerceAtMost(length))\n}\n\n/**\n * Returns a subsequence of this char sequence with the last [n] characters removed.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.text.Strings.drop\n */\npublic fun CharSequence.dropLast(n: Int): CharSequence {\n require(n >= 0) { \"Requested character count $n is less than zero.\" }\n return take((length - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a string with the last [n] characters removed.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.text.Strings.drop\n */\npublic fun String.dropLast(n: Int): String {\n require(n >= 0) { \"Requested character count $n is less than zero.\" }\n return take((length - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a subsequence of this char sequence containing all characters except last characters that satisfy the given [predicate].\n * \n * @sample samples.text.Strings.drop\n */\npublic inline fun CharSequence.dropLastWhile(predicate: (Char) -> Boolean): CharSequence {\n for (index in lastIndex downTo 0)\n if (!predicate(this[index]))\n return subSequence(0, index + 1)\n return \"\"\n}\n\n/**\n * Returns a string containing all characters except last characters that satisfy the given [predicate].\n * \n * @sample samples.text.Strings.drop\n */\npublic inline fun String.dropLastWhile(predicate: (Char) -> Boolean): String {\n for (index in lastIndex downTo 0)\n if (!predicate(this[index]))\n return substring(0, index + 1)\n return \"\"\n}\n\n/**\n * Returns a subsequence of this char sequence containing all characters except first characters that satisfy the given [predicate].\n * \n * @sample samples.text.Strings.drop\n */\npublic inline fun CharSequence.dropWhile(predicate: (Char) -> Boolean): CharSequence {\n for (index in this.indices)\n if (!predicate(this[index]))\n return subSequence(index, length)\n return \"\"\n}\n\n/**\n * Returns a string containing all characters except first characters that satisfy the given [predicate].\n * \n * @sample samples.text.Strings.drop\n */\npublic inline fun String.dropWhile(predicate: (Char) -> Boolean): String {\n for (index in this.indices)\n if (!predicate(this[index]))\n return substring(index)\n return \"\"\n}\n\n/**\n * Returns a char sequence containing only those characters from the original char sequence that match the given [predicate].\n * \n * @sample samples.text.Strings.filter\n */\npublic inline fun CharSequence.filter(predicate: (Char) -> Boolean): CharSequence {\n return filterTo(StringBuilder(), predicate)\n}\n\n/**\n * Returns a string containing only those characters from the original string that match the given [predicate].\n * \n * @sample samples.text.Strings.filter\n */\npublic inline fun String.filter(predicate: (Char) -> Boolean): String {\n return filterTo(StringBuilder(), predicate).toString()\n}\n\n/**\n * Returns a char sequence containing only those characters from the original char sequence that match the given [predicate].\n * @param [predicate] function that takes the index of a character and the character itself\n * and returns the result of predicate evaluation on the character.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexed\n */\npublic inline fun CharSequence.filterIndexed(predicate: (index: Int, Char) -> Boolean): CharSequence {\n return filterIndexedTo(StringBuilder(), predicate)\n}\n\n/**\n * Returns a string containing only those characters from the original string that match the given [predicate].\n * @param [predicate] function that takes the index of a character and the character itself\n * and returns the result of predicate evaluation on the character.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexed\n */\npublic inline fun String.filterIndexed(predicate: (index: Int, Char) -> Boolean): String {\n return filterIndexedTo(StringBuilder(), predicate).toString()\n}\n\n/**\n * Appends all characters matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of a character and the character itself\n * and returns the result of predicate evaluation on the character.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexedTo\n */\npublic inline fun CharSequence.filterIndexedTo(destination: C, predicate: (index: Int, Char) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.append(element)\n }\n return destination\n}\n\n/**\n * Returns a char sequence containing only those characters from the original char sequence that do not match the given [predicate].\n * \n * @sample samples.text.Strings.filterNot\n */\npublic inline fun CharSequence.filterNot(predicate: (Char) -> Boolean): CharSequence {\n return filterNotTo(StringBuilder(), predicate)\n}\n\n/**\n * Returns a string containing only those characters from the original string that do not match the given [predicate].\n * \n * @sample samples.text.Strings.filterNot\n */\npublic inline fun String.filterNot(predicate: (Char) -> Boolean): String {\n return filterNotTo(StringBuilder(), predicate).toString()\n}\n\n/**\n * Appends all characters not matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun CharSequence.filterNotTo(destination: C, predicate: (Char) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.append(element)\n return destination\n}\n\n/**\n * Appends all characters matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun CharSequence.filterTo(destination: C, predicate: (Char) -> Boolean): C {\n for (index in 0 until length) {\n val element = get(index)\n if (predicate(element)) destination.append(element)\n }\n return destination\n}\n\n/**\n * Returns a char sequence containing characters of the original char sequence at the specified range of [indices].\n */\npublic fun CharSequence.slice(indices: IntRange): CharSequence {\n if (indices.isEmpty()) return \"\"\n return subSequence(indices)\n}\n\n/**\n * Returns a string containing characters of the original string at the specified range of [indices].\n */\npublic fun String.slice(indices: IntRange): String {\n if (indices.isEmpty()) return \"\"\n return substring(indices)\n}\n\n/**\n * Returns a char sequence containing characters of the original char sequence at specified [indices].\n */\npublic fun CharSequence.slice(indices: Iterable): CharSequence {\n val size = indices.collectionSizeOrDefault(10)\n if (size == 0) return \"\"\n val result = StringBuilder(size)\n for (i in indices) {\n result.append(get(i))\n }\n return result\n}\n\n/**\n * Returns a string containing characters of the original string at specified [indices].\n */\n@kotlin.internal.InlineOnly\npublic inline fun String.slice(indices: Iterable): String {\n return (this as CharSequence).slice(indices).toString()\n}\n\n/**\n * Returns a subsequence of this char sequence containing the first [n] characters from this char sequence, or the entire char sequence if this char sequence is shorter.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.text.Strings.take\n */\npublic fun CharSequence.take(n: Int): CharSequence {\n require(n >= 0) { \"Requested character count $n is less than zero.\" }\n return subSequence(0, n.coerceAtMost(length))\n}\n\n/**\n * Returns a string containing the first [n] characters from this string, or the entire string if this string is shorter.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.text.Strings.take\n */\npublic fun String.take(n: Int): String {\n require(n >= 0) { \"Requested character count $n is less than zero.\" }\n return substring(0, n.coerceAtMost(length))\n}\n\n/**\n * Returns a subsequence of this char sequence containing the last [n] characters from this char sequence, or the entire char sequence if this char sequence is shorter.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.text.Strings.take\n */\npublic fun CharSequence.takeLast(n: Int): CharSequence {\n require(n >= 0) { \"Requested character count $n is less than zero.\" }\n val length = length\n return subSequence(length - n.coerceAtMost(length), length)\n}\n\n/**\n * Returns a string containing the last [n] characters from this string, or the entire string if this string is shorter.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.text.Strings.take\n */\npublic fun String.takeLast(n: Int): String {\n require(n >= 0) { \"Requested character count $n is less than zero.\" }\n val length = length\n return substring(length - n.coerceAtMost(length))\n}\n\n/**\n * Returns a subsequence of this char sequence containing last characters that satisfy the given [predicate].\n * \n * @sample samples.text.Strings.take\n */\npublic inline fun CharSequence.takeLastWhile(predicate: (Char) -> Boolean): CharSequence {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return subSequence(index + 1, length)\n }\n }\n return subSequence(0, length)\n}\n\n/**\n * Returns a string containing last characters that satisfy the given [predicate].\n * \n * @sample samples.text.Strings.take\n */\npublic inline fun String.takeLastWhile(predicate: (Char) -> Boolean): String {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return substring(index + 1)\n }\n }\n return this\n}\n\n/**\n * Returns a subsequence of this char sequence containing the first characters that satisfy the given [predicate].\n * \n * @sample samples.text.Strings.take\n */\npublic inline fun CharSequence.takeWhile(predicate: (Char) -> Boolean): CharSequence {\n for (index in 0 until length)\n if (!predicate(get(index))) {\n return subSequence(0, index)\n }\n return subSequence(0, length)\n}\n\n/**\n * Returns a string containing the first characters that satisfy the given [predicate].\n * \n * @sample samples.text.Strings.take\n */\npublic inline fun String.takeWhile(predicate: (Char) -> Boolean): String {\n for (index in 0 until length)\n if (!predicate(get(index))) {\n return substring(0, index)\n }\n return this\n}\n\n/**\n * Returns a char sequence with characters in reversed order.\n */\npublic fun CharSequence.reversed(): CharSequence {\n return StringBuilder(this).reverse()\n}\n\n/**\n * Returns a string with characters in reversed order.\n */\n@kotlin.internal.InlineOnly\npublic inline fun String.reversed(): String {\n return (this as CharSequence).reversed().toString()\n}\n\n/**\n * Returns a [Map] containing key-value pairs provided by [transform] function\n * applied to characters of the given char sequence.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original char sequence.\n * \n * @sample samples.text.Strings.associate\n */\npublic inline fun CharSequence.associate(transform: (Char) -> Pair): Map {\n val capacity = mapCapacity(length).coerceAtLeast(16)\n return associateTo(LinkedHashMap(capacity), transform)\n}\n\n/**\n * Returns a [Map] containing the characters from the given char sequence indexed by the key\n * returned from [keySelector] function applied to each character.\n * \n * If any two characters would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original char sequence.\n * \n * @sample samples.text.Strings.associateBy\n */\npublic inline fun CharSequence.associateBy(keySelector: (Char) -> K): Map {\n val capacity = mapCapacity(length).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector)\n}\n\n/**\n * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to characters of the given char sequence.\n * \n * If any two characters would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original char sequence.\n * \n * @sample samples.text.Strings.associateByWithValueTransform\n */\npublic inline fun CharSequence.associateBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map {\n val capacity = mapCapacity(length).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform)\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function applied to each character of the given char sequence\n * and value is the character itself.\n * \n * If any two characters would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * @sample samples.text.Strings.associateByTo\n */\npublic inline fun > CharSequence.associateByTo(destination: M, keySelector: (Char) -> K): M {\n for (element in this) {\n destination.put(keySelector(element), element)\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function and\n * and value is provided by the [valueTransform] function applied to characters of the given char sequence.\n * \n * If any two characters would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * @sample samples.text.Strings.associateByToWithValueTransform\n */\npublic inline fun > CharSequence.associateByTo(destination: M, keySelector: (Char) -> K, valueTransform: (Char) -> V): M {\n for (element in this) {\n destination.put(keySelector(element), valueTransform(element))\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs\n * provided by [transform] function applied to each character of the given char sequence.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * @sample samples.text.Strings.associateTo\n */\npublic inline fun > CharSequence.associateTo(destination: M, transform: (Char) -> Pair): M {\n for (element in this) {\n destination += transform(element)\n }\n return destination\n}\n\n/**\n * Returns a [Map] where keys are characters from the given char sequence and values are\n * produced by the [valueSelector] function applied to each character.\n * \n * If any two characters are equal, the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original char sequence.\n * \n * @sample samples.text.Strings.associateWith\n */\n@SinceKotlin(\"1.3\")\npublic inline fun CharSequence.associateWith(valueSelector: (Char) -> V): Map {\n val result = LinkedHashMap(mapCapacity(length.coerceAtMost(128)).coerceAtLeast(16))\n return associateWithTo(result, valueSelector)\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs for each character of the given char sequence,\n * where key is the character itself and value is provided by the [valueSelector] function applied to that key.\n * \n * If any two characters are equal, the last one overwrites the former value in the map.\n * \n * @sample samples.text.Strings.associateWithTo\n */\n@SinceKotlin(\"1.3\")\npublic inline fun > CharSequence.associateWithTo(destination: M, valueSelector: (Char) -> V): M {\n for (element in this) {\n destination.put(element, valueSelector(element))\n }\n return destination\n}\n\n/**\n * Appends all characters to the given [destination] collection.\n */\npublic fun > CharSequence.toCollection(destination: C): C {\n for (item in this) {\n destination.add(item)\n }\n return destination\n}\n\n/**\n * Returns a new [HashSet] of all characters.\n */\npublic fun CharSequence.toHashSet(): HashSet {\n return toCollection(HashSet(mapCapacity(length.coerceAtMost(128))))\n}\n\n/**\n * Returns a [List] containing all characters.\n */\npublic fun CharSequence.toList(): List {\n return when (length) {\n 0 -> emptyList()\n 1 -> listOf(this[0])\n else -> this.toMutableList()\n }\n}\n\n/**\n * Returns a new [MutableList] filled with all characters of this char sequence.\n */\npublic fun CharSequence.toMutableList(): MutableList {\n return toCollection(ArrayList(length))\n}\n\n/**\n * Returns a [Set] of all characters.\n * \n * The returned set preserves the element iteration order of the original char sequence.\n */\npublic fun CharSequence.toSet(): Set {\n return when (length) {\n 0 -> emptySet()\n 1 -> setOf(this[0])\n else -> toCollection(LinkedHashSet(mapCapacity(length.coerceAtMost(128))))\n }\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each character of original char sequence.\n * \n * @sample samples.collections.Collections.Transformations.flatMap\n */\npublic inline fun CharSequence.flatMap(transform: (Char) -> Iterable): List {\n return flatMapTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each character\n * and its index in the original char sequence.\n * \n * @sample samples.collections.Collections.Transformations.flatMapIndexed\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterable\")\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.flatMapIndexed(transform: (index: Int, Char) -> Iterable): List {\n return flatMapIndexedTo(ArrayList(), transform)\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each character\n * and its index in the original char sequence, to the given [destination].\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterableTo\")\n@kotlin.internal.InlineOnly\npublic inline fun > CharSequence.flatMapIndexedTo(destination: C, transform: (index: Int, Char) -> Iterable): C {\n var index = 0\n for (element in this) {\n val list = transform(index++, element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each character of original char sequence, to the given [destination].\n */\npublic inline fun > CharSequence.flatMapTo(destination: C, transform: (Char) -> Iterable): C {\n for (element in this) {\n val list = transform(element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Groups characters of the original char sequence by the key returned by the given [keySelector] function\n * applied to each character and returns a map where each group key is associated with a list of corresponding characters.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original char sequence.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun CharSequence.groupBy(keySelector: (Char) -> K): Map> {\n return groupByTo(LinkedHashMap>(), keySelector)\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each character of the original char sequence\n * by the key returned by the given [keySelector] function applied to the character\n * and returns a map where each group key is associated with a list of corresponding values.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original char sequence.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun CharSequence.groupBy(keySelector: (Char) -> K, valueTransform: (Char) -> V): Map> {\n return groupByTo(LinkedHashMap>(), keySelector, valueTransform)\n}\n\n/**\n * Groups characters of the original char sequence by the key returned by the given [keySelector] function\n * applied to each character and puts to the [destination] map each group key associated with a list of corresponding characters.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun >> CharSequence.groupByTo(destination: M, keySelector: (Char) -> K): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(element)\n }\n return destination\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each character of the original char sequence\n * by the key returned by the given [keySelector] function applied to the character\n * and puts to the [destination] map each group key associated with a list of corresponding values.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun >> CharSequence.groupByTo(destination: M, keySelector: (Char) -> K, valueTransform: (Char) -> V): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(valueTransform(element))\n }\n return destination\n}\n\n/**\n * Creates a [Grouping] source from a char sequence to be used later with one of group-and-fold operations\n * using the specified [keySelector] function to extract a key from each character.\n * \n * @sample samples.collections.Grouping.groupingByEachCount\n */\n@SinceKotlin(\"1.1\")\npublic inline fun CharSequence.groupingBy(crossinline keySelector: (Char) -> K): Grouping {\n return object : Grouping {\n override fun sourceIterator(): Iterator = this@groupingBy.iterator()\n override fun keyOf(element: Char): K = keySelector(element)\n }\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each character in the original char sequence.\n * \n * @sample samples.text.Strings.map\n */\npublic inline fun CharSequence.map(transform: (Char) -> R): List {\n return mapTo(ArrayList(length), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each character and its index in the original char sequence.\n * @param [transform] function that takes the index of a character and the character itself\n * and returns the result of the transform applied to the character.\n */\npublic inline fun CharSequence.mapIndexed(transform: (index: Int, Char) -> R): List {\n return mapIndexedTo(ArrayList(length), transform)\n}\n\n/**\n * Returns a list containing only the non-null results of applying the given [transform] function\n * to each character and its index in the original char sequence.\n * @param [transform] function that takes the index of a character and the character itself\n * and returns the result of the transform applied to the character.\n */\npublic inline fun CharSequence.mapIndexedNotNull(transform: (index: Int, Char) -> R?): List {\n return mapIndexedNotNullTo(ArrayList(), transform)\n}\n\n/**\n * Applies the given [transform] function to each character and its index in the original char sequence\n * and appends only the non-null results to the given [destination].\n * @param [transform] function that takes the index of a character and the character itself\n * and returns the result of the transform applied to the character.\n */\npublic inline fun > CharSequence.mapIndexedNotNullTo(destination: C, transform: (index: Int, Char) -> R?): C {\n forEachIndexed { index, element -> transform(index, element)?.let { destination.add(it) } }\n return destination\n}\n\n/**\n * Applies the given [transform] function to each character and its index in the original char sequence\n * and appends the results to the given [destination].\n * @param [transform] function that takes the index of a character and the character itself\n * and returns the result of the transform applied to the character.\n */\npublic inline fun > CharSequence.mapIndexedTo(destination: C, transform: (index: Int, Char) -> R): C {\n var index = 0\n for (item in this)\n destination.add(transform(index++, item))\n return destination\n}\n\n/**\n * Returns a list containing only the non-null results of applying the given [transform] function\n * to each character in the original char sequence.\n * \n * @sample samples.collections.Collections.Transformations.mapNotNull\n */\npublic inline fun CharSequence.mapNotNull(transform: (Char) -> R?): List {\n return mapNotNullTo(ArrayList(), transform)\n}\n\n/**\n * Applies the given [transform] function to each character in the original char sequence\n * and appends only the non-null results to the given [destination].\n */\npublic inline fun > CharSequence.mapNotNullTo(destination: C, transform: (Char) -> R?): C {\n forEach { element -> transform(element)?.let { destination.add(it) } }\n return destination\n}\n\n/**\n * Applies the given [transform] function to each character of the original char sequence\n * and appends the results to the given [destination].\n */\npublic inline fun > CharSequence.mapTo(destination: C, transform: (Char) -> R): C {\n for (item in this)\n destination.add(transform(item))\n return destination\n}\n\n/**\n * Returns a lazy [Iterable] that wraps each character of the original char sequence\n * into an [IndexedValue] containing the index of that character and the character itself.\n */\npublic fun CharSequence.withIndex(): Iterable> {\n return IndexingIterable { iterator() }\n}\n\n/**\n * Returns `true` if all characters match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.all\n */\npublic inline fun CharSequence.all(predicate: (Char) -> Boolean): Boolean {\n for (element in this) if (!predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if char sequence has at least one character.\n * \n * @sample samples.collections.Collections.Aggregates.any\n */\npublic fun CharSequence.any(): Boolean {\n return !isEmpty()\n}\n\n/**\n * Returns `true` if at least one character matches the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.anyWithPredicate\n */\npublic inline fun CharSequence.any(predicate: (Char) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return true\n return false\n}\n\n/**\n * Returns the length of this char sequence.\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.count(): Int {\n return length\n}\n\n/**\n * Returns the number of characters matching the given [predicate].\n */\npublic inline fun CharSequence.count(predicate: (Char) -> Boolean): Int {\n var count = 0\n for (element in this) if (predicate(element)) ++count\n return count\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each character.\n * \n * Returns the specified [initial] value if the char sequence is empty.\n * \n * @param [operation] function that takes current accumulator value and a character, and calculates the next accumulator value.\n */\npublic inline fun CharSequence.fold(initial: R, operation: (acc: R, Char) -> R): R {\n var accumulator = initial\n for (element in this) accumulator = operation(accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each character with its index in the original char sequence.\n * \n * Returns the specified [initial] value if the char sequence is empty.\n * \n * @param [operation] function that takes the index of a character, current accumulator value\n * and the character itself, and calculates the next accumulator value.\n */\npublic inline fun CharSequence.foldIndexed(initial: R, operation: (index: Int, acc: R, Char) -> R): R {\n var index = 0\n var accumulator = initial\n for (element in this) accumulator = operation(index++, accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each character and current accumulator value.\n * \n * Returns the specified [initial] value if the char sequence is empty.\n * \n * @param [operation] function that takes a character and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun CharSequence.foldRight(initial: R, operation: (Char, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each character with its index in the original char sequence and current accumulator value.\n * \n * Returns the specified [initial] value if the char sequence is empty.\n * \n * @param [operation] function that takes the index of a character, the character itself\n * and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun CharSequence.foldRightIndexed(initial: R, operation: (index: Int, Char, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Performs the given [action] on each character.\n */\npublic inline fun CharSequence.forEach(action: (Char) -> Unit): Unit {\n for (element in this) action(element)\n}\n\n/**\n * Performs the given [action] on each character, providing sequential index with the character.\n * @param [action] function that takes the index of a character and the character itself\n * and performs the action on the character.\n */\npublic inline fun CharSequence.forEachIndexed(action: (index: Int, Char) -> Unit): Unit {\n var index = 0\n for (item in this) action(index++, item)\n}\n\n/**\n * Returns the largest character.\n * \n * @throws NoSuchElementException if the char sequence is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"maxOrThrow\")\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun CharSequence.max(): Char {\n if (isEmpty()) throw NoSuchElementException()\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (max < e) max = e\n }\n return max\n}\n\n/**\n * Returns the first character yielding the largest value of the given function.\n * \n * @throws NoSuchElementException if the char sequence is empty.\n * \n * @sample samples.collections.Collections.Aggregates.maxBy\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"maxByOrThrow\")\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic inline fun > CharSequence.maxBy(selector: (Char) -> R): Char {\n if (isEmpty()) throw NoSuchElementException()\n var maxElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return maxElem\n var maxValue = selector(maxElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (maxValue < v) {\n maxElem = e\n maxValue = v\n }\n }\n return maxElem\n}\n\n/**\n * Returns the first character yielding the largest value of the given function or `null` if there are no characters.\n * \n * @sample samples.collections.Collections.Aggregates.maxByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > CharSequence.maxByOrNull(selector: (Char) -> R): Char? {\n if (isEmpty()) return null\n var maxElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return maxElem\n var maxValue = selector(maxElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (maxValue < v) {\n maxElem = e\n maxValue = v\n }\n }\n return maxElem\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each character in the char sequence.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the char sequence is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.maxOf(selector: (Char) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each character in the char sequence.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the char sequence is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.maxOf(selector: (Char) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each character in the char sequence.\n * \n * @throws NoSuchElementException if the char sequence is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > CharSequence.maxOf(selector: (Char) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each character in the char sequence or `null` if there are no characters.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.maxOfOrNull(selector: (Char) -> Double): Double? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each character in the char sequence or `null` if there are no characters.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.maxOfOrNull(selector: (Char) -> Float): Float? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each character in the char sequence or `null` if there are no characters.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > CharSequence.maxOfOrNull(selector: (Char) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each character in the char sequence.\n * \n * @throws NoSuchElementException if the char sequence is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.maxOfWith(comparator: Comparator, selector: (Char) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each character in the char sequence or `null` if there are no characters.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.maxOfWithOrNull(comparator: Comparator, selector: (Char) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest character or `null` if there are no characters.\n */\n@SinceKotlin(\"1.4\")\npublic fun CharSequence.maxOrNull(): Char? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (max < e) max = e\n }\n return max\n}\n\n/**\n * Returns the first character having the largest value according to the provided [comparator].\n * \n * @throws NoSuchElementException if the char sequence is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"maxWithOrThrow\")\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun CharSequence.maxWith(comparator: Comparator): Char {\n if (isEmpty()) throw NoSuchElementException()\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(max, e) < 0) max = e\n }\n return max\n}\n\n/**\n * Returns the first character having the largest value according to the provided [comparator] or `null` if there are no characters.\n */\n@SinceKotlin(\"1.4\")\npublic fun CharSequence.maxWithOrNull(comparator: Comparator): Char? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(max, e) < 0) max = e\n }\n return max\n}\n\n/**\n * Returns the smallest character.\n * \n * @throws NoSuchElementException if the char sequence is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"minOrThrow\")\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun CharSequence.min(): Char {\n if (isEmpty()) throw NoSuchElementException()\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (min > e) min = e\n }\n return min\n}\n\n/**\n * Returns the first character yielding the smallest value of the given function.\n * \n * @throws NoSuchElementException if the char sequence is empty.\n * \n * @sample samples.collections.Collections.Aggregates.minBy\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"minByOrThrow\")\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic inline fun > CharSequence.minBy(selector: (Char) -> R): Char {\n if (isEmpty()) throw NoSuchElementException()\n var minElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return minElem\n var minValue = selector(minElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (minValue > v) {\n minElem = e\n minValue = v\n }\n }\n return minElem\n}\n\n/**\n * Returns the first character yielding the smallest value of the given function or `null` if there are no characters.\n * \n * @sample samples.collections.Collections.Aggregates.minByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > CharSequence.minByOrNull(selector: (Char) -> R): Char? {\n if (isEmpty()) return null\n var minElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return minElem\n var minValue = selector(minElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (minValue > v) {\n minElem = e\n minValue = v\n }\n }\n return minElem\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each character in the char sequence.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the char sequence is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.minOf(selector: (Char) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each character in the char sequence.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the char sequence is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.minOf(selector: (Char) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each character in the char sequence.\n * \n * @throws NoSuchElementException if the char sequence is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > CharSequence.minOf(selector: (Char) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each character in the char sequence or `null` if there are no characters.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.minOfOrNull(selector: (Char) -> Double): Double? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each character in the char sequence or `null` if there are no characters.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.minOfOrNull(selector: (Char) -> Float): Float? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each character in the char sequence or `null` if there are no characters.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > CharSequence.minOfOrNull(selector: (Char) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each character in the char sequence.\n * \n * @throws NoSuchElementException if the char sequence is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.minOfWith(comparator: Comparator, selector: (Char) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each character in the char sequence or `null` if there are no characters.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.minOfWithOrNull(comparator: Comparator, selector: (Char) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest character or `null` if there are no characters.\n */\n@SinceKotlin(\"1.4\")\npublic fun CharSequence.minOrNull(): Char? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (min > e) min = e\n }\n return min\n}\n\n/**\n * Returns the first character having the smallest value according to the provided [comparator].\n * \n * @throws NoSuchElementException if the char sequence is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"minWithOrThrow\")\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun CharSequence.minWith(comparator: Comparator): Char {\n if (isEmpty()) throw NoSuchElementException()\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(min, e) > 0) min = e\n }\n return min\n}\n\n/**\n * Returns the first character having the smallest value according to the provided [comparator] or `null` if there are no characters.\n */\n@SinceKotlin(\"1.4\")\npublic fun CharSequence.minWithOrNull(comparator: Comparator): Char? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(min, e) > 0) min = e\n }\n return min\n}\n\n/**\n * Returns `true` if the char sequence has no characters.\n * \n * @sample samples.collections.Collections.Aggregates.none\n */\npublic fun CharSequence.none(): Boolean {\n return isEmpty()\n}\n\n/**\n * Returns `true` if no characters match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.noneWithPredicate\n */\npublic inline fun CharSequence.none(predicate: (Char) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return false\n return true\n}\n\n/**\n * Performs the given [action] on each character and returns the char sequence itself afterwards.\n */\n@SinceKotlin(\"1.1\")\npublic inline fun S.onEach(action: (Char) -> Unit): S {\n return apply { for (element in this) action(element) }\n}\n\n/**\n * Performs the given [action] on each character, providing sequential index with the character,\n * and returns the char sequence itself afterwards.\n * @param [action] function that takes the index of a character and the character itself\n * and performs the action on the character.\n */\n@SinceKotlin(\"1.4\")\npublic inline fun S.onEachIndexed(action: (index: Int, Char) -> Unit): S {\n return apply { forEachIndexed(action) }\n}\n\n/**\n * Accumulates value starting with the first character and applying [operation] from left to right\n * to current accumulator value and each character.\n * \n * Throws an exception if this char sequence is empty. If the char sequence can be empty in an expected way,\n * please use [reduceOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes current accumulator value and a character,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun CharSequence.reduce(operation: (acc: Char, Char) -> Char): Char {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty char sequence can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first character and applying [operation] from left to right\n * to current accumulator value and each character with its index in the original char sequence.\n * \n * Throws an exception if this char sequence is empty. If the char sequence can be empty in an expected way,\n * please use [reduceIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of a character, current accumulator value and the character itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun CharSequence.reduceIndexed(operation: (index: Int, acc: Char, Char) -> Char): Char {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty char sequence can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first character and applying [operation] from left to right\n * to current accumulator value and each character with its index in the original char sequence.\n * \n * Returns `null` if the char sequence is empty.\n * \n * @param [operation] function that takes the index of a character, current accumulator value and the character itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun CharSequence.reduceIndexedOrNull(operation: (index: Int, acc: Char, Char) -> Char): Char? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first character and applying [operation] from left to right\n * to current accumulator value and each character.\n * \n * Returns `null` if the char sequence is empty.\n * \n * @param [operation] function that takes current accumulator value and a character,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun CharSequence.reduceOrNull(operation: (acc: Char, Char) -> Char): Char? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last character and applying [operation] from right to left\n * to each character and current accumulator value.\n * \n * Throws an exception if this char sequence is empty. If the char sequence can be empty in an expected way,\n * please use [reduceRightOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes a character and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\npublic inline fun CharSequence.reduceRight(operation: (Char, acc: Char) -> Char): Char {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty char sequence can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last character and applying [operation] from right to left\n * to each character with its index in the original char sequence and current accumulator value.\n * \n * Throws an exception if this char sequence is empty. If the char sequence can be empty in an expected way,\n * please use [reduceRightIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of a character, the character itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\npublic inline fun CharSequence.reduceRightIndexed(operation: (index: Int, Char, acc: Char) -> Char): Char {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty char sequence can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last character and applying [operation] from right to left\n * to each character with its index in the original char sequence and current accumulator value.\n * \n * Returns `null` if the char sequence is empty.\n * \n * @param [operation] function that takes the index of a character, the character itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun CharSequence.reduceRightIndexedOrNull(operation: (index: Int, Char, acc: Char) -> Char): Char? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last character and applying [operation] from right to left\n * to each character and current accumulator value.\n * \n * Returns `null` if the char sequence is empty.\n * \n * @param [operation] function that takes a character and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun CharSequence.reduceRightOrNull(operation: (Char, acc: Char) -> Char): Char? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each character and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and a character, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\npublic inline fun CharSequence.runningFold(initial: R, operation: (acc: R, Char) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(length + 1).apply { add(initial) }\n var accumulator = initial\n for (element in this) {\n accumulator = operation(accumulator, element)\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each character, its index in the original char sequence and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of a character, current accumulator value\n * and the character itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\npublic inline fun CharSequence.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, Char) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(length + 1).apply { add(initial) }\n var accumulator = initial\n for (index in indices) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each character and current accumulator value that starts with the first character of this char sequence.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and a character, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\npublic inline fun CharSequence.runningReduce(operation: (acc: Char, Char) -> Char): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(length).apply { add(accumulator) }\n for (index in 1 until length) {\n accumulator = operation(accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each character, its index in the original char sequence and current accumulator value that starts with the first character of this char sequence.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of a character, current accumulator value\n * and the character itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\npublic inline fun CharSequence.runningReduceIndexed(operation: (index: Int, acc: Char, Char) -> Char): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(length).apply { add(accumulator) }\n for (index in 1 until length) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each character and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and a character, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun CharSequence.scan(initial: R, operation: (acc: R, Char) -> R): List {\n return runningFold(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each character, its index in the original char sequence and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of a character, current accumulator value\n * and the character itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun CharSequence.scanIndexed(initial: R, operation: (index: Int, acc: R, Char) -> R): List {\n return runningFoldIndexed(initial, operation)\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each character in the char sequence.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun CharSequence.sumBy(selector: (Char) -> Int): Int {\n var sum: Int = 0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each character in the char sequence.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun CharSequence.sumByDouble(selector: (Char) -> Double): Double {\n var sum: Double = 0.0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each character in the char sequence.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfDouble\")\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.sumOf(selector: (Char) -> Double): Double {\n var sum: Double = 0.toDouble()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each character in the char sequence.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfInt\")\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.sumOf(selector: (Char) -> Int): Int {\n var sum: Int = 0.toInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each character in the char sequence.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfLong\")\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.sumOf(selector: (Char) -> Long): Long {\n var sum: Long = 0.toLong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each character in the char sequence.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfUInt\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.sumOf(selector: (Char) -> UInt): UInt {\n var sum: UInt = 0.toUInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each character in the char sequence.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfULong\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.sumOf(selector: (Char) -> ULong): ULong {\n var sum: ULong = 0.toULong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Splits this char sequence into a list of strings each not exceeding the given [size].\n * \n * The last string in the resulting list may have fewer characters than the given [size].\n * \n * @param size the number of elements to take in each string, must be positive and can be greater than the number of elements in this char sequence.\n * \n * @sample samples.text.Strings.chunked\n */\n@SinceKotlin(\"1.2\")\npublic fun CharSequence.chunked(size: Int): List {\n return windowed(size, size, partialWindows = true)\n}\n\n/**\n * Splits this char sequence into several char sequences each not exceeding the given [size]\n * and applies the given [transform] function to an each.\n * \n * @return list of results of the [transform] applied to an each char sequence.\n * \n * Note that the char sequence passed to the [transform] function is ephemeral and is valid only inside that function.\n * You should not store it or allow it to escape in some way, unless you made a snapshot of it.\n * The last char sequence may have fewer characters than the given [size].\n * \n * @param size the number of elements to take in each char sequence, must be positive and can be greater than the number of elements in this char sequence.\n * \n * @sample samples.text.Strings.chunkedTransform\n */\n@SinceKotlin(\"1.2\")\npublic fun CharSequence.chunked(size: Int, transform: (CharSequence) -> R): List {\n return windowed(size, size, partialWindows = true, transform = transform)\n}\n\n/**\n * Splits this char sequence into a sequence of strings each not exceeding the given [size].\n * \n * The last string in the resulting sequence may have fewer characters than the given [size].\n * \n * @param size the number of elements to take in each string, must be positive and can be greater than the number of elements in this char sequence.\n * \n * @sample samples.collections.Collections.Transformations.chunked\n */\n@SinceKotlin(\"1.2\")\npublic fun CharSequence.chunkedSequence(size: Int): Sequence {\n return chunkedSequence(size) { it.toString() }\n}\n\n/**\n * Splits this char sequence into several char sequences each not exceeding the given [size]\n * and applies the given [transform] function to an each.\n * \n * @return sequence of results of the [transform] applied to an each char sequence.\n * \n * Note that the char sequence passed to the [transform] function is ephemeral and is valid only inside that function.\n * You should not store it or allow it to escape in some way, unless you made a snapshot of it.\n * The last char sequence may have fewer characters than the given [size].\n * \n * @param size the number of elements to take in each char sequence, must be positive and can be greater than the number of elements in this char sequence.\n * \n * @sample samples.text.Strings.chunkedTransformToSequence\n */\n@SinceKotlin(\"1.2\")\npublic fun CharSequence.chunkedSequence(size: Int, transform: (CharSequence) -> R): Sequence {\n return windowedSequence(size, size, partialWindows = true, transform = transform)\n}\n\n/**\n * Splits the original char sequence into pair of char sequences,\n * where *first* char sequence contains characters for which [predicate] yielded `true`,\n * while *second* char sequence contains characters for which [predicate] yielded `false`.\n * \n * @sample samples.text.Strings.partition\n */\npublic inline fun CharSequence.partition(predicate: (Char) -> Boolean): Pair {\n val first = StringBuilder()\n val second = StringBuilder()\n for (element in this) {\n if (predicate(element)) {\n first.append(element)\n } else {\n second.append(element)\n }\n }\n return Pair(first, second)\n}\n\n/**\n * Splits the original string into pair of strings,\n * where *first* string contains characters for which [predicate] yielded `true`,\n * while *second* string contains characters for which [predicate] yielded `false`.\n * \n * @sample samples.text.Strings.partition\n */\npublic inline fun String.partition(predicate: (Char) -> Boolean): Pair {\n val first = StringBuilder()\n val second = StringBuilder()\n for (element in this) {\n if (predicate(element)) {\n first.append(element)\n } else {\n second.append(element)\n }\n }\n return Pair(first.toString(), second.toString())\n}\n\n/**\n * Returns a list of snapshots of the window of the given [size]\n * sliding along this char sequence with the given [step], where each\n * snapshot is a string.\n * \n * Several last strings may have fewer characters than the given [size].\n * \n * Both [size] and [step] must be positive and can be greater than the number of elements in this char sequence.\n * @param size the number of elements to take in each window\n * @param step the number of elements to move the window forward by on an each step, by default 1\n * @param partialWindows controls whether or not to keep partial windows in the end if any,\n * by default `false` which means partial windows won't be preserved\n * \n * @sample samples.collections.Sequences.Transformations.takeWindows\n */\n@SinceKotlin(\"1.2\")\npublic fun CharSequence.windowed(size: Int, step: Int = 1, partialWindows: Boolean = false): List {\n return windowed(size, step, partialWindows) { it.toString() }\n}\n\n/**\n * Returns a list of results of applying the given [transform] function to\n * an each char sequence representing a view over the window of the given [size]\n * sliding along this char sequence with the given [step].\n * \n * Note that the char sequence passed to the [transform] function is ephemeral and is valid only inside that function.\n * You should not store it or allow it to escape in some way, unless you made a snapshot of it.\n * Several last char sequences may have fewer characters than the given [size].\n * \n * Both [size] and [step] must be positive and can be greater than the number of elements in this char sequence.\n * @param size the number of elements to take in each window\n * @param step the number of elements to move the window forward by on an each step, by default 1\n * @param partialWindows controls whether or not to keep partial windows in the end if any,\n * by default `false` which means partial windows won't be preserved\n * \n * @sample samples.collections.Sequences.Transformations.averageWindows\n */\n@SinceKotlin(\"1.2\")\npublic fun CharSequence.windowed(size: Int, step: Int = 1, partialWindows: Boolean = false, transform: (CharSequence) -> R): List {\n checkWindowSizeStep(size, step)\n val thisSize = this.length\n val resultCapacity = thisSize / step + if (thisSize % step == 0) 0 else 1\n val result = ArrayList(resultCapacity)\n var index = 0\n while (index in 0 until thisSize) {\n val end = index + size\n val coercedEnd = if (end < 0 || end > thisSize) { if (partialWindows) thisSize else break } else end\n result.add(transform(subSequence(index, coercedEnd)))\n index += step\n }\n return result\n}\n\n/**\n * Returns a sequence of snapshots of the window of the given [size]\n * sliding along this char sequence with the given [step], where each\n * snapshot is a string.\n * \n * Several last strings may have fewer characters than the given [size].\n * \n * Both [size] and [step] must be positive and can be greater than the number of elements in this char sequence.\n * @param size the number of elements to take in each window\n * @param step the number of elements to move the window forward by on an each step, by default 1\n * @param partialWindows controls whether or not to keep partial windows in the end if any,\n * by default `false` which means partial windows won't be preserved\n * \n * @sample samples.collections.Sequences.Transformations.takeWindows\n */\n@SinceKotlin(\"1.2\")\npublic fun CharSequence.windowedSequence(size: Int, step: Int = 1, partialWindows: Boolean = false): Sequence {\n return windowedSequence(size, step, partialWindows) { it.toString() }\n}\n\n/**\n * Returns a sequence of results of applying the given [transform] function to\n * an each char sequence representing a view over the window of the given [size]\n * sliding along this char sequence with the given [step].\n * \n * Note that the char sequence passed to the [transform] function is ephemeral and is valid only inside that function.\n * You should not store it or allow it to escape in some way, unless you made a snapshot of it.\n * Several last char sequences may have fewer characters than the given [size].\n * \n * Both [size] and [step] must be positive and can be greater than the number of elements in this char sequence.\n * @param size the number of elements to take in each window\n * @param step the number of elements to move the window forward by on an each step, by default 1\n * @param partialWindows controls whether or not to keep partial windows in the end if any,\n * by default `false` which means partial windows won't be preserved\n * \n * @sample samples.collections.Sequences.Transformations.averageWindows\n */\n@SinceKotlin(\"1.2\")\npublic fun CharSequence.windowedSequence(size: Int, step: Int = 1, partialWindows: Boolean = false, transform: (CharSequence) -> R): Sequence {\n checkWindowSizeStep(size, step)\n val windows = (if (partialWindows) indices else 0 until length - size + 1) step step\n return windows.asSequence().map { index ->\n val end = index + size\n val coercedEnd = if (end < 0 || end > length) length else end\n transform(subSequence(index, coercedEnd))\n }\n}\n\n/**\n * Returns a list of pairs built from the characters of `this` and the [other] char sequences with the same index\n * The returned list has length of the shortest char sequence.\n * \n * @sample samples.text.Strings.zip\n */\npublic infix fun CharSequence.zip(other: CharSequence): List> {\n return zip(other) { c1, c2 -> c1 to c2 }\n}\n\n/**\n * Returns a list of values built from the characters of `this` and the [other] char sequences with the same index\n * using the provided [transform] function applied to each pair of characters.\n * The returned list has length of the shortest char sequence.\n * \n * @sample samples.text.Strings.zipWithTransform\n */\npublic inline fun CharSequence.zip(other: CharSequence, transform: (a: Char, b: Char) -> V): List {\n val length = minOf(this.length, other.length)\n val list = ArrayList(length)\n for (i in 0 until length) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Returns a list of pairs of each two adjacent characters in this char sequence.\n * \n * The returned list is empty if this char sequence contains less than two characters.\n * \n * @sample samples.collections.Collections.Transformations.zipWithNext\n */\n@SinceKotlin(\"1.2\")\npublic fun CharSequence.zipWithNext(): List> {\n return zipWithNext { a, b -> a to b }\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to an each pair of two adjacent characters in this char sequence.\n * \n * The returned list is empty if this char sequence contains less than two characters.\n * \n * @sample samples.collections.Collections.Transformations.zipWithNextToFindDeltas\n */\n@SinceKotlin(\"1.2\")\npublic inline fun CharSequence.zipWithNext(transform: (a: Char, b: Char) -> R): List {\n val size = length - 1\n if (size < 1) return emptyList()\n val result = ArrayList(size)\n for (index in 0 until size) {\n result.add(transform(this[index], this[index + 1]))\n }\n return result\n}\n\n/**\n * Creates an [Iterable] instance that wraps the original char sequence returning its characters when being iterated.\n */\npublic fun CharSequence.asIterable(): Iterable {\n if (this is String && isEmpty()) return emptyList()\n return Iterable { this.iterator() }\n}\n\n/**\n * Creates a [Sequence] instance that wraps the original char sequence returning its characters when being iterated.\n */\npublic fun CharSequence.asSequence(): Sequence {\n if (this is String && isEmpty()) return emptySequence()\n return Sequence { this.iterator() }\n}\n\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"StringsKt\")\n\npackage kotlin.text\n\nimport kotlin.contracts.contract\nimport kotlin.jvm.JvmName\n\n/**\n * Returns a copy of this string converted to upper case using the rules of the default locale.\n */\n@Deprecated(\"Use uppercase() instead.\", ReplaceWith(\"uppercase()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic expect fun String.toUpperCase(): String\n\n/**\n * Returns a copy of this string converted to upper case using Unicode mapping rules of the invariant locale.\n *\n * This function supports one-to-many and many-to-one character mapping,\n * thus the length of the returned string can be different from the length of the original string.\n *\n * @sample samples.text.Strings.uppercase\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic expect fun String.uppercase(): String\n\n/**\n * Returns a copy of this string converted to lower case using the rules of the default locale.\n */\n@Deprecated(\"Use lowercase() instead.\", ReplaceWith(\"lowercase()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic expect fun String.toLowerCase(): String\n\n/**\n * Returns a copy of this string converted to lower case using Unicode mapping rules of the invariant locale.\n *\n * This function supports one-to-many and many-to-one character mapping,\n * thus the length of the returned string can be different from the length of the original string.\n *\n * @sample samples.text.Strings.lowercase\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic expect fun String.lowercase(): String\n\n/**\n * Returns a copy of this string having its first letter titlecased using the rules of the default locale,\n * or the original string if it's empty or already starts with a title case letter.\n *\n * The title case of a character is usually the same as its upper case with several exceptions.\n * The particular list of characters with the special title case form depends on the underlying platform.\n *\n * @sample samples.text.Strings.capitalize\n */\n@Deprecated(\"Use replaceFirstChar instead.\", ReplaceWith(\"replaceFirstChar { if (it.isLowerCase()) it.titlecase() else it.toString() }\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic expect fun String.capitalize(): String\n\n/**\n * Returns a copy of this string having its first letter lowercased using the rules of the default locale,\n * or the original string if it's empty or already starts with a lower case letter.\n *\n * @sample samples.text.Strings.decapitalize\n */\n@Deprecated(\"Use replaceFirstChar instead.\", ReplaceWith(\"replaceFirstChar { it.lowercase() }\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic expect fun String.decapitalize(): String\n\n/**\n * Returns a sub sequence of this char sequence having leading and trailing characters matching the [predicate] removed.\n */\npublic inline fun CharSequence.trim(predicate: (Char) -> Boolean): CharSequence {\n var startIndex = 0\n var endIndex = length - 1\n var startFound = false\n\n while (startIndex <= endIndex) {\n val index = if (!startFound) startIndex else endIndex\n val match = predicate(this[index])\n\n if (!startFound) {\n if (!match)\n startFound = true\n else\n startIndex += 1\n } else {\n if (!match)\n break\n else\n endIndex -= 1\n }\n }\n\n return subSequence(startIndex, endIndex + 1)\n}\n\n/**\n * Returns a string having leading and trailing characters matching the [predicate] removed.\n */\npublic inline fun String.trim(predicate: (Char) -> Boolean): String =\n (this as CharSequence).trim(predicate).toString()\n\n/**\n * Returns a sub sequence of this char sequence having leading characters matching the [predicate] removed.\n */\npublic inline fun CharSequence.trimStart(predicate: (Char) -> Boolean): CharSequence {\n for (index in this.indices)\n if (!predicate(this[index]))\n return subSequence(index, length)\n\n return \"\"\n}\n\n/**\n * Returns a string having leading characters matching the [predicate] removed.\n */\npublic inline fun String.trimStart(predicate: (Char) -> Boolean): String =\n (this as CharSequence).trimStart(predicate).toString()\n\n/**\n * Returns a sub sequence of this char sequence having trailing characters matching the [predicate] removed.\n */\npublic inline fun CharSequence.trimEnd(predicate: (Char) -> Boolean): CharSequence {\n for (index in this.indices.reversed())\n if (!predicate(this[index]))\n return subSequence(0, index + 1)\n\n return \"\"\n}\n\n/**\n * Returns a string having trailing characters matching the [predicate] removed.\n */\npublic inline fun String.trimEnd(predicate: (Char) -> Boolean): String =\n (this as CharSequence).trimEnd(predicate).toString()\n\n/**\n * Returns a sub sequence of this char sequence having leading and trailing characters from the [chars] array removed.\n */\npublic fun CharSequence.trim(vararg chars: Char): CharSequence = trim { it in chars }\n\n/**\n * Returns a string having leading and trailing characters from the [chars] array removed.\n */\npublic fun String.trim(vararg chars: Char): String = trim { it in chars }\n\n/**\n * Returns a sub sequence of this char sequence having leading characters from the [chars] array removed.\n */\npublic fun CharSequence.trimStart(vararg chars: Char): CharSequence = trimStart { it in chars }\n\n/**\n * Returns a string having leading characters from the [chars] array removed.\n */\npublic fun String.trimStart(vararg chars: Char): String = trimStart { it in chars }\n\n/**\n * Returns a sub sequence of this char sequence having trailing characters from the [chars] array removed.\n */\npublic fun CharSequence.trimEnd(vararg chars: Char): CharSequence = trimEnd { it in chars }\n\n/**\n * Returns a string having trailing characters from the [chars] array removed.\n */\npublic fun String.trimEnd(vararg chars: Char): String = trimEnd { it in chars }\n\n/**\n * Returns a sub sequence of this char sequence having leading and trailing whitespace removed.\n */\npublic fun CharSequence.trim(): CharSequence = trim(Char::isWhitespace)\n\n/**\n * Returns a string having leading and trailing whitespace removed.\n */\n@kotlin.internal.InlineOnly\npublic inline fun String.trim(): String = (this as CharSequence).trim().toString()\n\n/**\n * Returns a sub sequence of this char sequence having leading whitespace removed.\n */\npublic fun CharSequence.trimStart(): CharSequence = trimStart(Char::isWhitespace)\n\n/**\n * Returns a string having leading whitespace removed.\n */\n@kotlin.internal.InlineOnly\npublic inline fun String.trimStart(): String = (this as CharSequence).trimStart().toString()\n\n/**\n * Returns a sub sequence of this char sequence having trailing whitespace removed.\n */\npublic fun CharSequence.trimEnd(): CharSequence = trimEnd(Char::isWhitespace)\n\n/**\n * Returns a string having trailing whitespace removed.\n */\n@kotlin.internal.InlineOnly\npublic inline fun String.trimEnd(): String = (this as CharSequence).trimEnd().toString()\n\n/**\n * Returns a char sequence with content of this char sequence padded at the beginning\n * to the specified [length] with the specified character or space.\n *\n * @param length the desired string length.\n * @param padChar the character to pad string with, if it has length less than the [length] specified. Space is used by default.\n * @return Returns a char sequence of length at least [length] consisting of `this` char sequence prepended with [padChar] as many times\n * as are necessary to reach that length.\n * @sample samples.text.Strings.padStart\n */\npublic fun CharSequence.padStart(length: Int, padChar: Char = ' '): CharSequence {\n if (length < 0)\n throw IllegalArgumentException(\"Desired length $length is less than zero.\")\n if (length <= this.length)\n return this.subSequence(0, this.length)\n\n val sb = StringBuilder(length)\n for (i in 1..(length - this.length))\n sb.append(padChar)\n sb.append(this)\n return sb\n}\n\n/**\n * Pads the string to the specified [length] at the beginning with the specified character or space.\n *\n * @param length the desired string length.\n * @param padChar the character to pad string with, if it has length less than the [length] specified. Space is used by default.\n * @return Returns a string of length at least [length] consisting of `this` string prepended with [padChar] as many times\n * as are necessary to reach that length.\n * @sample samples.text.Strings.padStart\n */\npublic fun String.padStart(length: Int, padChar: Char = ' '): String =\n (this as CharSequence).padStart(length, padChar).toString()\n\n/**\n * Returns a char sequence with content of this char sequence padded at the end\n * to the specified [length] with the specified character or space.\n *\n * @param length the desired string length.\n * @param padChar the character to pad string with, if it has length less than the [length] specified. Space is used by default.\n * @return Returns a char sequence of length at least [length] consisting of `this` char sequence appended with [padChar] as many times\n * as are necessary to reach that length.\n * @sample samples.text.Strings.padEnd\n */\npublic fun CharSequence.padEnd(length: Int, padChar: Char = ' '): CharSequence {\n if (length < 0)\n throw IllegalArgumentException(\"Desired length $length is less than zero.\")\n if (length <= this.length)\n return this.subSequence(0, this.length)\n\n val sb = StringBuilder(length)\n sb.append(this)\n for (i in 1..(length - this.length))\n sb.append(padChar)\n return sb\n}\n\n/**\n * Pads the string to the specified [length] at the end with the specified character or space.\n *\n * @param length the desired string length.\n * @param padChar the character to pad string with, if it has length less than the [length] specified. Space is used by default.\n * @return Returns a string of length at least [length] consisting of `this` string appended with [padChar] as many times\n * as are necessary to reach that length.\n * @sample samples.text.Strings.padEnd\n */\npublic fun String.padEnd(length: Int, padChar: Char = ' '): String =\n (this as CharSequence).padEnd(length, padChar).toString()\n\n/**\n * Returns `true` if this nullable char sequence is either `null` or empty.\n *\n * @sample samples.text.Strings.stringIsNullOrEmpty\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence?.isNullOrEmpty(): Boolean {\n contract {\n returns(false) implies (this@isNullOrEmpty != null)\n }\n\n return this == null || this.length == 0\n}\n\n/**\n * Returns `true` if this char sequence is empty (contains no characters).\n *\n * @sample samples.text.Strings.stringIsEmpty\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.isEmpty(): Boolean = length == 0\n\n/**\n * Returns `true` if this char sequence is not empty.\n *\n * @sample samples.text.Strings.stringIsNotEmpty\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.isNotEmpty(): Boolean = length > 0\n\n// implemented differently in JVM and JS\n//public fun String.isBlank(): Boolean = length() == 0 || all { it.isWhitespace() }\n\n\n/**\n * Returns `true` if this char sequence is not empty and contains some characters except of whitespace characters.\n *\n * @sample samples.text.Strings.stringIsNotBlank\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.isNotBlank(): Boolean = !isBlank()\n\n/**\n * Returns `true` if this nullable char sequence is either `null` or empty or consists solely of whitespace characters.\n *\n * @sample samples.text.Strings.stringIsNullOrBlank\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence?.isNullOrBlank(): Boolean {\n contract {\n returns(false) implies (this@isNullOrBlank != null)\n }\n\n return this == null || this.isBlank()\n}\n\n/**\n * Iterator for characters of the given char sequence.\n */\npublic operator fun CharSequence.iterator(): CharIterator = object : CharIterator() {\n private var index = 0\n\n public override fun nextChar(): Char = get(index++)\n\n public override fun hasNext(): Boolean = index < length\n}\n\n/** Returns the string if it is not `null`, or the empty string otherwise. */\n@kotlin.internal.InlineOnly\npublic inline fun String?.orEmpty(): String = this ?: \"\"\n\n/**\n * Returns this char sequence if it's not empty\n * or the result of calling [defaultValue] function if the char sequence is empty.\n *\n * @sample samples.text.Strings.stringIfEmpty\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun C.ifEmpty(defaultValue: () -> R): R where C : CharSequence, C : R =\n if (isEmpty()) defaultValue() else this\n\n/**\n * Returns this char sequence if it is not empty and doesn't consist solely of whitespace characters,\n * or the result of calling [defaultValue] function otherwise.\n *\n * @sample samples.text.Strings.stringIfBlank\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun C.ifBlank(defaultValue: () -> R): R where C : CharSequence, C : R =\n if (isBlank()) defaultValue() else this\n\n/**\n * Returns the range of valid character indices for this char sequence.\n */\npublic val CharSequence.indices: IntRange\n get() = 0..length - 1\n\n/**\n * Returns the index of the last character in the char sequence or -1 if it is empty.\n */\npublic val CharSequence.lastIndex: Int\n get() = this.length - 1\n\n/**\n * Returns `true` if this CharSequence has Unicode surrogate pair at the specified [index].\n */\npublic fun CharSequence.hasSurrogatePairAt(index: Int): Boolean {\n return index in 0..length - 2\n && this[index].isHighSurrogate()\n && this[index + 1].isLowSurrogate()\n}\n\n/**\n * Returns a substring specified by the given [range] of indices.\n */\npublic fun String.substring(range: IntRange): String = substring(range.start, range.endInclusive + 1)\n\n/**\n * Returns a subsequence of this char sequence specified by the given [range] of indices.\n */\npublic fun CharSequence.subSequence(range: IntRange): CharSequence = subSequence(range.start, range.endInclusive + 1)\n\n/**\n * Returns a subsequence of this char sequence.\n *\n * This extension is chosen only for invocation with old-named parameters.\n * Replace parameter names with the same as those of [CharSequence.subSequence].\n */\n@kotlin.internal.InlineOnly\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\") // false warning\n@Deprecated(\"Use parameters named startIndex and endIndex.\", ReplaceWith(\"subSequence(startIndex = start, endIndex = end)\"))\npublic inline fun String.subSequence(start: Int, end: Int): CharSequence = subSequence(start, end)\n\n/**\n * Returns a substring of chars from a range of this char sequence starting at the [startIndex] and ending right before the [endIndex].\n *\n * @param startIndex the start index (inclusive).\n * @param endIndex the end index (exclusive). If not specified, the length of the char sequence is used.\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.substring(startIndex: Int, endIndex: Int = length): String = subSequence(startIndex, endIndex).toString()\n\n/**\n * Returns a substring of chars at indices from the specified [range] of this char sequence.\n */\npublic fun CharSequence.substring(range: IntRange): String = subSequence(range.start, range.endInclusive + 1).toString()\n\n/**\n * Returns a substring before the first occurrence of [delimiter].\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.substringBefore(delimiter: Char, missingDelimiterValue: String = this): String {\n val index = indexOf(delimiter)\n return if (index == -1) missingDelimiterValue else substring(0, index)\n}\n\n/**\n * Returns a substring before the first occurrence of [delimiter].\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.substringBefore(delimiter: String, missingDelimiterValue: String = this): String {\n val index = indexOf(delimiter)\n return if (index == -1) missingDelimiterValue else substring(0, index)\n}\n\n/**\n * Returns a substring after the first occurrence of [delimiter].\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.substringAfter(delimiter: Char, missingDelimiterValue: String = this): String {\n val index = indexOf(delimiter)\n return if (index == -1) missingDelimiterValue else substring(index + 1, length)\n}\n\n/**\n * Returns a substring after the first occurrence of [delimiter].\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.substringAfter(delimiter: String, missingDelimiterValue: String = this): String {\n val index = indexOf(delimiter)\n return if (index == -1) missingDelimiterValue else substring(index + delimiter.length, length)\n}\n\n/**\n * Returns a substring before the last occurrence of [delimiter].\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.substringBeforeLast(delimiter: Char, missingDelimiterValue: String = this): String {\n val index = lastIndexOf(delimiter)\n return if (index == -1) missingDelimiterValue else substring(0, index)\n}\n\n/**\n * Returns a substring before the last occurrence of [delimiter].\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.substringBeforeLast(delimiter: String, missingDelimiterValue: String = this): String {\n val index = lastIndexOf(delimiter)\n return if (index == -1) missingDelimiterValue else substring(0, index)\n}\n\n/**\n * Returns a substring after the last occurrence of [delimiter].\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.substringAfterLast(delimiter: Char, missingDelimiterValue: String = this): String {\n val index = lastIndexOf(delimiter)\n return if (index == -1) missingDelimiterValue else substring(index + 1, length)\n}\n\n/**\n * Returns a substring after the last occurrence of [delimiter].\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.substringAfterLast(delimiter: String, missingDelimiterValue: String = this): String {\n val index = lastIndexOf(delimiter)\n return if (index == -1) missingDelimiterValue else substring(index + delimiter.length, length)\n}\n\n/**\n * Returns a char sequence with content of this char sequence where its part at the given range\n * is replaced with the [replacement] char sequence.\n * @param startIndex the index of the first character to be replaced.\n * @param endIndex the index of the first character after the replacement to keep in the string.\n */\npublic fun CharSequence.replaceRange(startIndex: Int, endIndex: Int, replacement: CharSequence): CharSequence {\n if (endIndex < startIndex)\n throw IndexOutOfBoundsException(\"End index ($endIndex) is less than start index ($startIndex).\")\n val sb = StringBuilder()\n sb.appendRange(this, 0, startIndex)\n sb.append(replacement)\n sb.appendRange(this, endIndex, length)\n return sb\n}\n\n/**\n * Replaces the part of the string at the given range with the [replacement] char sequence.\n * @param startIndex the index of the first character to be replaced.\n * @param endIndex the index of the first character after the replacement to keep in the string.\n */\n@kotlin.internal.InlineOnly\npublic inline fun String.replaceRange(startIndex: Int, endIndex: Int, replacement: CharSequence): String =\n (this as CharSequence).replaceRange(startIndex, endIndex, replacement).toString()\n\n/**\n * Returns a char sequence with content of this char sequence where its part at the given [range]\n * is replaced with the [replacement] char sequence.\n *\n * The end index of the [range] is included in the part to be replaced.\n */\npublic fun CharSequence.replaceRange(range: IntRange, replacement: CharSequence): CharSequence =\n replaceRange(range.start, range.endInclusive + 1, replacement)\n\n/**\n * Replace the part of string at the given [range] with the [replacement] string.\n *\n * The end index of the [range] is included in the part to be replaced.\n */\n@kotlin.internal.InlineOnly\npublic inline fun String.replaceRange(range: IntRange, replacement: CharSequence): String =\n (this as CharSequence).replaceRange(range, replacement).toString()\n\n/**\n * Returns a char sequence with content of this char sequence where its part at the given range is removed.\n *\n * @param startIndex the index of the first character to be removed.\n * @param endIndex the index of the first character after the removed part to keep in the string.\n *\n * [endIndex] is not included in the removed part.\n */\npublic fun CharSequence.removeRange(startIndex: Int, endIndex: Int): CharSequence {\n if (endIndex < startIndex)\n throw IndexOutOfBoundsException(\"End index ($endIndex) is less than start index ($startIndex).\")\n\n if (endIndex == startIndex)\n return this.subSequence(0, length)\n\n val sb = StringBuilder(length - (endIndex - startIndex))\n sb.appendRange(this, 0, startIndex)\n sb.appendRange(this, endIndex, length)\n return sb\n}\n\n/**\n * Removes the part of a string at a given range.\n * @param startIndex the index of the first character to be removed.\n * @param endIndex the index of the first character after the removed part to keep in the string.\n *\n * [endIndex] is not included in the removed part.\n */\n@kotlin.internal.InlineOnly\npublic inline fun String.removeRange(startIndex: Int, endIndex: Int): String =\n (this as CharSequence).removeRange(startIndex, endIndex).toString()\n\n/**\n * Returns a char sequence with content of this char sequence where its part at the given [range] is removed.\n *\n * The end index of the [range] is included in the removed part.\n */\npublic fun CharSequence.removeRange(range: IntRange): CharSequence = removeRange(range.start, range.endInclusive + 1)\n\n/**\n * Removes the part of a string at the given [range].\n *\n * The end index of the [range] is included in the removed part.\n */\n@kotlin.internal.InlineOnly\npublic inline fun String.removeRange(range: IntRange): String =\n (this as CharSequence).removeRange(range).toString()\n\n/**\n * If this char sequence starts with the given [prefix], returns a new char sequence\n * with the prefix removed. Otherwise, returns a new char sequence with the same characters.\n */\npublic fun CharSequence.removePrefix(prefix: CharSequence): CharSequence {\n if (startsWith(prefix)) {\n return subSequence(prefix.length, length)\n }\n return subSequence(0, length)\n}\n\n/**\n * If this string starts with the given [prefix], returns a copy of this string\n * with the prefix removed. Otherwise, returns this string.\n */\npublic fun String.removePrefix(prefix: CharSequence): String {\n if (startsWith(prefix)) {\n return substring(prefix.length)\n }\n return this\n}\n\n/**\n * If this char sequence ends with the given [suffix], returns a new char sequence\n * with the suffix removed. Otherwise, returns a new char sequence with the same characters.\n */\npublic fun CharSequence.removeSuffix(suffix: CharSequence): CharSequence {\n if (endsWith(suffix)) {\n return subSequence(0, length - suffix.length)\n }\n return subSequence(0, length)\n}\n\n/**\n * If this string ends with the given [suffix], returns a copy of this string\n * with the suffix removed. Otherwise, returns this string.\n */\npublic fun String.removeSuffix(suffix: CharSequence): String {\n if (endsWith(suffix)) {\n return substring(0, length - suffix.length)\n }\n return this\n}\n\n/**\n * When this char sequence starts with the given [prefix] and ends with the given [suffix],\n * returns a new char sequence having both the given [prefix] and [suffix] removed.\n * Otherwise returns a new char sequence with the same characters.\n */\npublic fun CharSequence.removeSurrounding(prefix: CharSequence, suffix: CharSequence): CharSequence {\n if ((length >= prefix.length + suffix.length) && startsWith(prefix) && endsWith(suffix)) {\n return subSequence(prefix.length, length - suffix.length)\n }\n return subSequence(0, length)\n}\n\n/**\n * Removes from a string both the given [prefix] and [suffix] if and only if\n * it starts with the [prefix] and ends with the [suffix].\n * Otherwise returns this string unchanged.\n */\npublic fun String.removeSurrounding(prefix: CharSequence, suffix: CharSequence): String {\n if ((length >= prefix.length + suffix.length) && startsWith(prefix) && endsWith(suffix)) {\n return substring(prefix.length, length - suffix.length)\n }\n return this\n}\n\n/**\n * When this char sequence starts with and ends with the given [delimiter],\n * returns a new char sequence having this [delimiter] removed both from the start and end.\n * Otherwise returns a new char sequence with the same characters.\n */\npublic fun CharSequence.removeSurrounding(delimiter: CharSequence): CharSequence = removeSurrounding(delimiter, delimiter)\n\n/**\n * Removes the given [delimiter] string from both the start and the end of this string\n * if and only if it starts with and ends with the [delimiter].\n * Otherwise returns this string unchanged.\n */\npublic fun String.removeSurrounding(delimiter: CharSequence): String = removeSurrounding(delimiter, delimiter)\n\n/**\n * Replace part of string before the first occurrence of given delimiter with the [replacement] string.\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.replaceBefore(delimiter: Char, replacement: String, missingDelimiterValue: String = this): String {\n val index = indexOf(delimiter)\n return if (index == -1) missingDelimiterValue else replaceRange(0, index, replacement)\n}\n\n/**\n * Replace part of string before the first occurrence of given delimiter with the [replacement] string.\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.replaceBefore(delimiter: String, replacement: String, missingDelimiterValue: String = this): String {\n val index = indexOf(delimiter)\n return if (index == -1) missingDelimiterValue else replaceRange(0, index, replacement)\n}\n\n/**\n * Replace part of string after the first occurrence of given delimiter with the [replacement] string.\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.replaceAfter(delimiter: Char, replacement: String, missingDelimiterValue: String = this): String {\n val index = indexOf(delimiter)\n return if (index == -1) missingDelimiterValue else replaceRange(index + 1, length, replacement)\n}\n\n/**\n * Replace part of string after the first occurrence of given delimiter with the [replacement] string.\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.replaceAfter(delimiter: String, replacement: String, missingDelimiterValue: String = this): String {\n val index = indexOf(delimiter)\n return if (index == -1) missingDelimiterValue else replaceRange(index + delimiter.length, length, replacement)\n}\n\n/**\n * Replace part of string after the last occurrence of given delimiter with the [replacement] string.\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.replaceAfterLast(delimiter: String, replacement: String, missingDelimiterValue: String = this): String {\n val index = lastIndexOf(delimiter)\n return if (index == -1) missingDelimiterValue else replaceRange(index + delimiter.length, length, replacement)\n}\n\n/**\n * Replace part of string after the last occurrence of given delimiter with the [replacement] string.\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.replaceAfterLast(delimiter: Char, replacement: String, missingDelimiterValue: String = this): String {\n val index = lastIndexOf(delimiter)\n return if (index == -1) missingDelimiterValue else replaceRange(index + 1, length, replacement)\n}\n\n/**\n * Replace part of string before the last occurrence of given delimiter with the [replacement] string.\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.replaceBeforeLast(delimiter: Char, replacement: String, missingDelimiterValue: String = this): String {\n val index = lastIndexOf(delimiter)\n return if (index == -1) missingDelimiterValue else replaceRange(0, index, replacement)\n}\n\n/**\n * Replace part of string before the last occurrence of given delimiter with the [replacement] string.\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.replaceBeforeLast(delimiter: String, replacement: String, missingDelimiterValue: String = this): String {\n val index = lastIndexOf(delimiter)\n return if (index == -1) missingDelimiterValue else replaceRange(0, index, replacement)\n}\n\n\n// public fun String.replace(oldChar: Char, newChar: Char, ignoreCase: Boolean): String // JVM- and JS-specific\n// public fun String.replace(oldValue: String, newValue: String, ignoreCase: Boolean): String // JVM- and JS-specific\n\n/**\n * Returns a new string obtained by replacing each substring of this char sequence that matches the given regular expression\n * with the given [replacement].\n *\n * The [replacement] can consist of any combination of literal text and $-substitutions. To treat the replacement string\n * literally escape it with the [kotlin.text.Regex.Companion.escapeReplacement] method.\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.replace(regex: Regex, replacement: String): String = regex.replace(this, replacement)\n\n/**\n * Returns a new string obtained by replacing each substring of this char sequence that matches the given regular expression\n * with the result of the given function [transform] that takes [MatchResult] and returns a string to be used as a\n * replacement for that match.\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.replace(regex: Regex, noinline transform: (MatchResult) -> CharSequence): String =\n regex.replace(this, transform)\n\n/**\n * Replaces the first occurrence of the given regular expression [regex] in this char sequence with specified [replacement] expression.\n *\n * @param replacement A replacement expression that can include substitutions. See [Regex.replaceFirst] for details.\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.replaceFirst(regex: Regex, replacement: String): String = regex.replaceFirst(this, replacement)\n\n/**\n * Returns a copy of this string having its first character replaced with the result of the specified [transform],\n * or the original string if it's empty.\n *\n * @param transform function that takes the first character and returns the result of the transform applied to the character.\n *\n * @sample samples.text.Strings.replaceFirstChar\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@JvmName(\"replaceFirstCharWithChar\")\n@kotlin.internal.InlineOnly\npublic inline fun String.replaceFirstChar(transform: (Char) -> Char): String {\n return if (isNotEmpty()) transform(this[0]) + substring(1) else this\n}\n\n/**\n * Returns a copy of this string having its first character replaced with the result of the specified [transform],\n * or the original string if it's empty.\n *\n * @param transform function that takes the first character and returns the result of the transform applied to the character.\n *\n * @sample samples.text.Strings.replaceFirstChar\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@JvmName(\"replaceFirstCharWithCharSequence\")\n@kotlin.internal.InlineOnly\npublic inline fun String.replaceFirstChar(transform: (Char) -> CharSequence): String {\n return if (isNotEmpty()) transform(this[0]).toString() + substring(1) else this\n}\n\n\n/**\n * Returns `true` if this char sequence matches the given regular expression.\n */\n@kotlin.internal.InlineOnly\npublic inline infix fun CharSequence.matches(regex: Regex): Boolean = regex.matches(this)\n\n/**\n * Implementation of [regionMatches] for CharSequences.\n * Invoked when it's already known that arguments are not Strings, so that no additional type checks are performed.\n */\ninternal fun CharSequence.regionMatchesImpl(thisOffset: Int, other: CharSequence, otherOffset: Int, length: Int, ignoreCase: Boolean): Boolean {\n if ((otherOffset < 0) || (thisOffset < 0) || (thisOffset > this.length - length) || (otherOffset > other.length - length)) {\n return false\n }\n\n for (index in 0 until length) {\n if (!this[thisOffset + index].equals(other[otherOffset + index], ignoreCase))\n return false\n }\n return true\n}\n\n/**\n * Returns `true` if this char sequence starts with the specified character.\n */\npublic fun CharSequence.startsWith(char: Char, ignoreCase: Boolean = false): Boolean =\n this.length > 0 && this[0].equals(char, ignoreCase)\n\n/**\n * Returns `true` if this char sequence ends with the specified character.\n */\npublic fun CharSequence.endsWith(char: Char, ignoreCase: Boolean = false): Boolean =\n this.length > 0 && this[lastIndex].equals(char, ignoreCase)\n\n/**\n * Returns `true` if this char sequence starts with the specified prefix.\n */\npublic fun CharSequence.startsWith(prefix: CharSequence, ignoreCase: Boolean = false): Boolean {\n if (!ignoreCase && this is String && prefix is String)\n return this.startsWith(prefix)\n else\n return regionMatchesImpl(0, prefix, 0, prefix.length, ignoreCase)\n}\n\n/**\n * Returns `true` if a substring of this char sequence starting at the specified offset [startIndex] starts with the specified prefix.\n */\npublic fun CharSequence.startsWith(prefix: CharSequence, startIndex: Int, ignoreCase: Boolean = false): Boolean {\n if (!ignoreCase && this is String && prefix is String)\n return this.startsWith(prefix, startIndex)\n else\n return regionMatchesImpl(startIndex, prefix, 0, prefix.length, ignoreCase)\n}\n\n/**\n * Returns `true` if this char sequence ends with the specified suffix.\n */\npublic fun CharSequence.endsWith(suffix: CharSequence, ignoreCase: Boolean = false): Boolean {\n if (!ignoreCase && this is String && suffix is String)\n return this.endsWith(suffix)\n else\n return regionMatchesImpl(length - suffix.length, suffix, 0, suffix.length, ignoreCase)\n}\n\n\n// common prefix and suffix\n\n/**\n * Returns the longest string `prefix` such that this char sequence and [other] char sequence both start with this prefix,\n * taking care not to split surrogate pairs.\n * If this and [other] have no common prefix, returns the empty string.\n\n * @param ignoreCase `true` to ignore character case when matching a character. By default `false`.\n * @sample samples.text.Strings.commonPrefixWith\n */\npublic fun CharSequence.commonPrefixWith(other: CharSequence, ignoreCase: Boolean = false): String {\n val shortestLength = minOf(this.length, other.length)\n\n var i = 0\n while (i < shortestLength && this[i].equals(other[i], ignoreCase = ignoreCase)) {\n i++\n }\n if (this.hasSurrogatePairAt(i - 1) || other.hasSurrogatePairAt(i - 1)) {\n i--\n }\n return subSequence(0, i).toString()\n}\n\n/**\n * Returns the longest string `suffix` such that this char sequence and [other] char sequence both end with this suffix,\n * taking care not to split surrogate pairs.\n * If this and [other] have no common suffix, returns the empty string.\n\n * @param ignoreCase `true` to ignore character case when matching a character. By default `false`.\n * @sample samples.text.Strings.commonSuffixWith\n */\npublic fun CharSequence.commonSuffixWith(other: CharSequence, ignoreCase: Boolean = false): String {\n val thisLength = this.length\n val otherLength = other.length\n val shortestLength = minOf(thisLength, otherLength)\n\n var i = 0\n while (i < shortestLength && this[thisLength - i - 1].equals(other[otherLength - i - 1], ignoreCase = ignoreCase)) {\n i++\n }\n if (this.hasSurrogatePairAt(thisLength - i - 1) || other.hasSurrogatePairAt(otherLength - i - 1)) {\n i--\n }\n return subSequence(thisLength - i, thisLength).toString()\n}\n\n\n// indexOfAny()\n\n/**\n * Finds the index of the first occurrence of any of the specified [chars] in this char sequence,\n * starting from the specified [startIndex] and optionally ignoring the case.\n *\n * @param ignoreCase `true` to ignore character case when matching a character. By default `false`.\n * @return An index of the first occurrence of matched character from [chars] or -1 if none of [chars] are found.\n *\n */\npublic fun CharSequence.indexOfAny(chars: CharArray, startIndex: Int = 0, ignoreCase: Boolean = false): Int {\n if (!ignoreCase && chars.size == 1 && this is String) {\n val char = chars.single()\n return nativeIndexOf(char, startIndex)\n }\n\n for (index in startIndex.coerceAtLeast(0)..lastIndex) {\n val charAtIndex = get(index)\n if (chars.any { it.equals(charAtIndex, ignoreCase) })\n return index\n }\n return -1\n}\n\n/**\n * Finds the index of the last occurrence of any of the specified [chars] in this char sequence,\n * starting from the specified [startIndex] and optionally ignoring the case.\n *\n * @param startIndex The index of character to start searching at. The search proceeds backward toward the beginning of the string.\n * @param ignoreCase `true` to ignore character case when matching a character. By default `false`.\n * @return An index of the last occurrence of matched character from [chars] or -1 if none of [chars] are found.\n *\n */\npublic fun CharSequence.lastIndexOfAny(chars: CharArray, startIndex: Int = lastIndex, ignoreCase: Boolean = false): Int {\n if (!ignoreCase && chars.size == 1 && this is String) {\n val char = chars.single()\n return nativeLastIndexOf(char, startIndex)\n }\n\n\n for (index in startIndex.coerceAtMost(lastIndex) downTo 0) {\n val charAtIndex = get(index)\n if (chars.any { it.equals(charAtIndex, ignoreCase) })\n return index\n }\n\n return -1\n}\n\n\nprivate fun CharSequence.indexOf(other: CharSequence, startIndex: Int, endIndex: Int, ignoreCase: Boolean, last: Boolean = false): Int {\n val indices = if (!last)\n startIndex.coerceAtLeast(0)..endIndex.coerceAtMost(length)\n else\n startIndex.coerceAtMost(lastIndex) downTo endIndex.coerceAtLeast(0)\n\n if (this is String && other is String) { // smart cast\n for (index in indices) {\n if (other.regionMatches(0, this, index, other.length, ignoreCase))\n return index\n }\n } else {\n for (index in indices) {\n if (other.regionMatchesImpl(0, this, index, other.length, ignoreCase))\n return index\n }\n }\n return -1\n}\n\nprivate fun CharSequence.findAnyOf(strings: Collection, startIndex: Int, ignoreCase: Boolean, last: Boolean): Pair? {\n if (!ignoreCase && strings.size == 1) {\n val string = strings.single()\n val index = if (!last) indexOf(string, startIndex) else lastIndexOf(string, startIndex)\n return if (index < 0) null else index to string\n }\n\n val indices = if (!last) startIndex.coerceAtLeast(0)..length else startIndex.coerceAtMost(lastIndex) downTo 0\n\n if (this is String) {\n for (index in indices) {\n val matchingString = strings.firstOrNull { it.regionMatches(0, this, index, it.length, ignoreCase) }\n if (matchingString != null)\n return index to matchingString\n }\n } else {\n for (index in indices) {\n val matchingString = strings.firstOrNull { it.regionMatchesImpl(0, this, index, it.length, ignoreCase) }\n if (matchingString != null)\n return index to matchingString\n }\n }\n\n return null\n}\n\n/**\n * Finds the first occurrence of any of the specified [strings] in this char sequence,\n * starting from the specified [startIndex] and optionally ignoring the case.\n *\n * @param ignoreCase `true` to ignore character case when matching a string. By default `false`.\n * @return A pair of an index of the first occurrence of matched string from [strings] and the string matched\n * or `null` if none of [strings] are found.\n *\n * To avoid ambiguous results when strings in [strings] have characters in common, this method proceeds from\n * the beginning to the end of this string, and finds at each position the first element in [strings]\n * that matches this string at that position.\n */\npublic fun CharSequence.findAnyOf(strings: Collection, startIndex: Int = 0, ignoreCase: Boolean = false): Pair? =\n findAnyOf(strings, startIndex, ignoreCase, last = false)\n\n/**\n * Finds the last occurrence of any of the specified [strings] in this char sequence,\n * starting from the specified [startIndex] and optionally ignoring the case.\n *\n * @param startIndex The index of character to start searching at. The search proceeds backward toward the beginning of the string.\n * @param ignoreCase `true` to ignore character case when matching a string. By default `false`.\n * @return A pair of an index of the last occurrence of matched string from [strings] and the string matched or `null` if none of [strings] are found.\n *\n * To avoid ambiguous results when strings in [strings] have characters in common, this method proceeds from\n * the end toward the beginning of this string, and finds at each position the first element in [strings]\n * that matches this string at that position.\n */\npublic fun CharSequence.findLastAnyOf(strings: Collection, startIndex: Int = lastIndex, ignoreCase: Boolean = false): Pair? =\n findAnyOf(strings, startIndex, ignoreCase, last = true)\n\n/**\n * Finds the index of the first occurrence of any of the specified [strings] in this char sequence,\n * starting from the specified [startIndex] and optionally ignoring the case.\n *\n * @param ignoreCase `true` to ignore character case when matching a string. By default `false`.\n * @return An index of the first occurrence of matched string from [strings] or -1 if none of [strings] are found.\n *\n * To avoid ambiguous results when strings in [strings] have characters in common, this method proceeds from\n * the beginning to the end of this string, and finds at each position the first element in [strings]\n * that matches this string at that position.\n */\npublic fun CharSequence.indexOfAny(strings: Collection, startIndex: Int = 0, ignoreCase: Boolean = false): Int =\n findAnyOf(strings, startIndex, ignoreCase, last = false)?.first ?: -1\n\n/**\n * Finds the index of the last occurrence of any of the specified [strings] in this char sequence,\n * starting from the specified [startIndex] and optionally ignoring the case.\n *\n * @param startIndex The index of character to start searching at. The search proceeds backward toward the beginning of the string.\n * @param ignoreCase `true` to ignore character case when matching a string. By default `false`.\n * @return An index of the last occurrence of matched string from [strings] or -1 if none of [strings] are found.\n *\n * To avoid ambiguous results when strings in [strings] have characters in common, this method proceeds from\n * the end toward the beginning of this string, and finds at each position the first element in [strings]\n * that matches this string at that position.\n */\npublic fun CharSequence.lastIndexOfAny(strings: Collection, startIndex: Int = lastIndex, ignoreCase: Boolean = false): Int =\n findAnyOf(strings, startIndex, ignoreCase, last = true)?.first ?: -1\n\n\n// indexOf\n\n/**\n * Returns the index within this string of the first occurrence of the specified character, starting from the specified [startIndex].\n *\n * @param ignoreCase `true` to ignore character case when matching a character. By default `false`.\n * @return An index of the first occurrence of [char] or -1 if none is found.\n */\npublic fun CharSequence.indexOf(char: Char, startIndex: Int = 0, ignoreCase: Boolean = false): Int {\n return if (ignoreCase || this !is String)\n indexOfAny(charArrayOf(char), startIndex, ignoreCase)\n else\n nativeIndexOf(char, startIndex)\n}\n\n/**\n * Returns the index within this char sequence of the first occurrence of the specified [string],\n * starting from the specified [startIndex].\n *\n * @param ignoreCase `true` to ignore character case when matching a string. By default `false`.\n * @return An index of the first occurrence of [string] or `-1` if none is found.\n * @sample samples.text.Strings.indexOf\n */\npublic fun CharSequence.indexOf(string: String, startIndex: Int = 0, ignoreCase: Boolean = false): Int {\n return if (ignoreCase || this !is String)\n indexOf(string, startIndex, length, ignoreCase)\n else\n nativeIndexOf(string, startIndex)\n}\n\n/**\n * Returns the index within this char sequence of the last occurrence of the specified character,\n * starting from the specified [startIndex].\n *\n * @param startIndex The index of character to start searching at. The search proceeds backward toward the beginning of the string.\n * @param ignoreCase `true` to ignore character case when matching a character. By default `false`.\n * @return An index of the last occurrence of [char] or -1 if none is found.\n */\npublic fun CharSequence.lastIndexOf(char: Char, startIndex: Int = lastIndex, ignoreCase: Boolean = false): Int {\n return if (ignoreCase || this !is String)\n lastIndexOfAny(charArrayOf(char), startIndex, ignoreCase)\n else\n nativeLastIndexOf(char, startIndex)\n}\n\n/**\n * Returns the index within this char sequence of the last occurrence of the specified [string],\n * starting from the specified [startIndex].\n *\n * @param startIndex The index of character to start searching at. The search proceeds backward toward the beginning of the string.\n * @param ignoreCase `true` to ignore character case when matching a string. By default `false`.\n * @return An index of the last occurrence of [string] or -1 if none is found.\n */\npublic fun CharSequence.lastIndexOf(string: String, startIndex: Int = lastIndex, ignoreCase: Boolean = false): Int {\n return if (ignoreCase || this !is String)\n indexOf(string, startIndex, 0, ignoreCase, last = true)\n else\n nativeLastIndexOf(string, startIndex)\n}\n\n/**\n * Returns `true` if this char sequence contains the specified [other] sequence of characters as a substring.\n *\n * @param ignoreCase `true` to ignore character case when comparing strings. By default `false`.\n */\n@Suppress(\"INAPPLICABLE_OPERATOR_MODIFIER\")\npublic operator fun CharSequence.contains(other: CharSequence, ignoreCase: Boolean = false): Boolean =\n if (other is String)\n indexOf(other, ignoreCase = ignoreCase) >= 0\n else\n indexOf(other, 0, length, ignoreCase) >= 0\n\n\n\n/**\n * Returns `true` if this char sequence contains the specified character [char].\n *\n * @param ignoreCase `true` to ignore character case when comparing characters. By default `false`.\n */\n@Suppress(\"INAPPLICABLE_OPERATOR_MODIFIER\")\npublic operator fun CharSequence.contains(char: Char, ignoreCase: Boolean = false): Boolean =\n indexOf(char, ignoreCase = ignoreCase) >= 0\n\n/**\n * Returns `true` if this char sequence contains at least one match of the specified regular expression [regex].\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun CharSequence.contains(regex: Regex): Boolean = regex.containsMatchIn(this)\n\n\n// rangesDelimitedBy\n\n\nprivate class DelimitedRangesSequence(\n private val input: CharSequence,\n private val startIndex: Int,\n private val limit: Int,\n private val getNextMatch: CharSequence.(currentIndex: Int) -> Pair?\n) : Sequence {\n\n override fun iterator(): Iterator = object : Iterator {\n var nextState: Int = -1 // -1 for unknown, 0 for done, 1 for continue\n var currentStartIndex: Int = startIndex.coerceIn(0, input.length)\n var nextSearchIndex: Int = currentStartIndex\n var nextItem: IntRange? = null\n var counter: Int = 0\n\n private fun calcNext() {\n if (nextSearchIndex < 0) {\n nextState = 0\n nextItem = null\n } else {\n if (limit > 0 && ++counter >= limit || nextSearchIndex > input.length) {\n nextItem = currentStartIndex..input.lastIndex\n nextSearchIndex = -1\n } else {\n val match = input.getNextMatch(nextSearchIndex)\n if (match == null) {\n nextItem = currentStartIndex..input.lastIndex\n nextSearchIndex = -1\n } else {\n val (index, length) = match\n nextItem = currentStartIndex until index\n currentStartIndex = index + length\n nextSearchIndex = currentStartIndex + if (length == 0) 1 else 0\n }\n }\n nextState = 1\n }\n }\n\n override fun next(): IntRange {\n if (nextState == -1)\n calcNext()\n if (nextState == 0)\n throw NoSuchElementException()\n val result = nextItem as IntRange\n // Clean next to avoid keeping reference on yielded instance\n nextItem = null\n nextState = -1\n return result\n }\n\n override fun hasNext(): Boolean {\n if (nextState == -1)\n calcNext()\n return nextState == 1\n }\n }\n}\n\n/**\n * Returns a sequence of index ranges of substrings in this char sequence around occurrences of the specified [delimiters].\n *\n * @param delimiters One or more characters to be used as delimiters.\n * @param startIndex The index to start searching delimiters from.\n * No range having its start value less than [startIndex] is returned.\n * [startIndex] is coerced to be non-negative and not greater than length of this string.\n * @param ignoreCase `true` to ignore character case when matching a delimiter. By default `false`.\n * @param limit The maximum number of substrings to return. Zero by default means no limit is set.\n */\nprivate fun CharSequence.rangesDelimitedBy(delimiters: CharArray, startIndex: Int = 0, ignoreCase: Boolean = false, limit: Int = 0): Sequence {\n requireNonNegativeLimit(limit)\n\n return DelimitedRangesSequence(this, startIndex, limit, { currentIndex ->\n indexOfAny(delimiters, currentIndex, ignoreCase = ignoreCase).let { if (it < 0) null else it to 1 }\n })\n}\n\n\n/**\n * Returns a sequence of index ranges of substrings in this char sequence around occurrences of the specified [delimiters].\n *\n * @param delimiters One or more strings to be used as delimiters.\n * @param startIndex The index to start searching delimiters from.\n * No range having its start value less than [startIndex] is returned.\n * [startIndex] is coerced to be non-negative and not greater than length of this string.\n * @param ignoreCase `true` to ignore character case when matching a delimiter. By default `false`.\n * @param limit The maximum number of substrings to return. Zero by default means no limit is set.\n *\n * To avoid ambiguous results when strings in [delimiters] have characters in common, this method proceeds from\n * the beginning to the end of this string, and finds at each position the first element in [delimiters]\n * that matches this string at that position.\n */\nprivate fun CharSequence.rangesDelimitedBy(delimiters: Array, startIndex: Int = 0, ignoreCase: Boolean = false, limit: Int = 0): Sequence {\n requireNonNegativeLimit(limit)\n val delimitersList = delimiters.asList()\n\n return DelimitedRangesSequence(this, startIndex, limit, { currentIndex -> findAnyOf(delimitersList, currentIndex, ignoreCase = ignoreCase, last = false)?.let { it.first to it.second.length } })\n\n}\n\ninternal fun requireNonNegativeLimit(limit: Int) =\n require(limit >= 0) { \"Limit must be non-negative, but was $limit\" }\n\n\n// split\n\n/**\n * Splits this char sequence to a sequence of strings around occurrences of the specified [delimiters].\n *\n * @param delimiters One or more strings to be used as delimiters.\n * @param ignoreCase `true` to ignore character case when matching a delimiter. By default `false`.\n * @param limit The maximum number of substrings to return. Zero by default means no limit is set.\n *\n * To avoid ambiguous results when strings in [delimiters] have characters in common, this method proceeds from\n * the beginning to the end of this string, and finds at each position the first element in [delimiters]\n * that matches this string at that position.\n */\npublic fun CharSequence.splitToSequence(vararg delimiters: String, ignoreCase: Boolean = false, limit: Int = 0): Sequence =\n rangesDelimitedBy(delimiters, ignoreCase = ignoreCase, limit = limit).map { substring(it) }\n\n/**\n * Splits this char sequence to a list of strings around occurrences of the specified [delimiters].\n *\n * @param delimiters One or more strings to be used as delimiters.\n * @param ignoreCase `true` to ignore character case when matching a delimiter. By default `false`.\n * @param limit The maximum number of substrings to return. Zero by default means no limit is set.\n *\n * To avoid ambiguous results when strings in [delimiters] have characters in common, this method proceeds from\n * the beginning to the end of this string, and matches at each position the first element in [delimiters]\n * that is equal to a delimiter in this instance at that position.\n */\npublic fun CharSequence.split(vararg delimiters: String, ignoreCase: Boolean = false, limit: Int = 0): List {\n if (delimiters.size == 1) {\n val delimiter = delimiters[0]\n if (!delimiter.isEmpty()) {\n return split(delimiter, ignoreCase, limit)\n }\n }\n\n return rangesDelimitedBy(delimiters, ignoreCase = ignoreCase, limit = limit).asIterable().map { substring(it) }\n}\n\n/**\n * Splits this char sequence to a sequence of strings around occurrences of the specified [delimiters].\n *\n * @param delimiters One or more characters to be used as delimiters.\n * @param ignoreCase `true` to ignore character case when matching a delimiter. By default `false`.\n * @param limit The maximum number of substrings to return.\n */\npublic fun CharSequence.splitToSequence(vararg delimiters: Char, ignoreCase: Boolean = false, limit: Int = 0): Sequence =\n rangesDelimitedBy(delimiters, ignoreCase = ignoreCase, limit = limit).map { substring(it) }\n\n/**\n * Splits this char sequence to a list of strings around occurrences of the specified [delimiters].\n *\n * @param delimiters One or more characters to be used as delimiters.\n * @param ignoreCase `true` to ignore character case when matching a delimiter. By default `false`.\n * @param limit The maximum number of substrings to return.\n */\npublic fun CharSequence.split(vararg delimiters: Char, ignoreCase: Boolean = false, limit: Int = 0): List {\n if (delimiters.size == 1) {\n return split(delimiters[0].toString(), ignoreCase, limit)\n }\n\n return rangesDelimitedBy(delimiters, ignoreCase = ignoreCase, limit = limit).asIterable().map { substring(it) }\n}\n\n/**\n * Splits this char sequence to a list of strings around occurrences of the specified [delimiter].\n * This is specialized version of split which receives single non-empty delimiter and offers better performance\n *\n * @param delimiter String used as delimiter\n * @param ignoreCase `true` to ignore character case when matching a delimiter. By default `false`.\n * @param limit The maximum number of substrings to return.\n */\nprivate fun CharSequence.split(delimiter: String, ignoreCase: Boolean, limit: Int): List {\n requireNonNegativeLimit(limit)\n\n var currentOffset = 0\n var nextIndex = indexOf(delimiter, currentOffset, ignoreCase)\n if (nextIndex == -1 || limit == 1) {\n return listOf(this.toString())\n }\n\n val isLimited = limit > 0\n val result = ArrayList(if (isLimited) limit.coerceAtMost(10) else 10)\n do {\n result.add(substring(currentOffset, nextIndex))\n currentOffset = nextIndex + delimiter.length\n // Do not search for next occurrence if we're reaching limit\n if (isLimited && result.size == limit - 1) break\n nextIndex = indexOf(delimiter, currentOffset, ignoreCase)\n } while (nextIndex != -1)\n\n result.add(substring(currentOffset, length))\n return result\n}\n\n/**\n * Splits this char sequence to a list of strings around matches of the given regular expression.\n *\n * @param limit Non-negative value specifying the maximum number of substrings to return.\n * Zero by default means no limit is set.\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.split(regex: Regex, limit: Int = 0): List = regex.split(this, limit)\n\n/**\n * Splits this char sequence to a sequence of strings around matches of the given regular expression.\n *\n * @param limit Non-negative value specifying the maximum number of substrings to return.\n * Zero by default means no limit is set.\n * @sample samples.text.Strings.splitToSequence\n */\n@SinceKotlin(\"1.6\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.splitToSequence(regex: Regex, limit: Int = 0): Sequence = regex.splitToSequence(this, limit)\n\n/**\n * Splits this char sequence to a sequence of lines delimited by any of the following character sequences: CRLF, LF or CR.\n *\n * The lines returned do not include terminating line separators.\n */\npublic fun CharSequence.lineSequence(): Sequence = splitToSequence(\"\\r\\n\", \"\\n\", \"\\r\")\n\n/**\n * Splits this char sequence to a list of lines delimited by any of the following character sequences: CRLF, LF or CR.\n *\n * The lines returned do not include terminating line separators.\n */\npublic fun CharSequence.lines(): List = lineSequence().toList()\n\n/**\n * Returns `true` if the contents of this char sequence are equal to the contents of the specified [other],\n * i.e. both char sequences contain the same number of the same characters in the same order.\n *\n * @sample samples.text.Strings.contentEquals\n */\n@SinceKotlin(\"1.5\")\npublic expect infix fun CharSequence?.contentEquals(other: CharSequence?): Boolean\n\n/**\n * Returns `true` if the contents of this char sequence are equal to the contents of the specified [other], optionally ignoring case difference.\n *\n * @param ignoreCase `true` to ignore character case when comparing contents.\n *\n * @sample samples.text.Strings.contentEquals\n */\n@SinceKotlin(\"1.5\")\npublic expect fun CharSequence?.contentEquals(other: CharSequence?, ignoreCase: Boolean): Boolean\n\ninternal fun CharSequence?.contentEqualsIgnoreCaseImpl(other: CharSequence?): Boolean {\n if (this is String && other is String) {\n return this.equals(other, ignoreCase = true)\n }\n\n if (this === other) return true\n if (this == null || other == null || this.length != other.length) return false\n\n for (i in 0 until length) {\n if (!this[i].equals(other[i], ignoreCase = true)) {\n return false\n }\n }\n\n return true\n}\n\ninternal fun CharSequence?.contentEqualsImpl(other: CharSequence?): Boolean {\n if (this is String && other is String) {\n return this == other\n }\n\n if (this === other) return true\n if (this == null || other == null || this.length != other.length) return false\n\n for (i in 0 until length) {\n if (this[i] != other[i]) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * Returns `true` if the content of this string is equal to the word \"true\", `false` if it is equal to \"false\",\n * and throws an exception otherwise.\n *\n * There is also a lenient version of the function available on nullable String, [String?.toBoolean].\n * Note that this function is case-sensitive.\n *\n * @sample samples.text.Strings.toBooleanStrict\n */\n@SinceKotlin(\"1.5\")\npublic fun String.toBooleanStrict(): Boolean = when (this) {\n \"true\" -> true\n \"false\" -> false\n else -> throw IllegalArgumentException(\"The string doesn't represent a boolean value: $this\")\n}\n\n/**\n * Returns `true` if the content of this string is equal to the word \"true\", `false` if it is equal to \"false\",\n * and `null` otherwise.\n *\n * There is also a lenient version of the function available on nullable String, [String?.toBoolean].\n * Note that this function is case-sensitive.\n *\n * @sample samples.text.Strings.toBooleanStrictOrNull\n */\n@SinceKotlin(\"1.5\")\npublic fun String.toBooleanStrictOrNull(): Boolean? = when (this) {\n \"true\" -> true\n \"false\" -> false\n else -> null\n}","/*\n * Copyright 2010-2015 JetBrains s.r.o.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage kotlin\n\n/**\n * The type with only one value: the `Unit` object. This type corresponds to the `void` type in Java.\n */\npublic object Unit {\n override fun toString() = \"kotlin.Unit\"\n}\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n@file:kotlin.jvm.JvmName(\"UnsignedKt\")\npackage kotlin\n\n@PublishedApi\ninternal fun uintCompare(v1: Int, v2: Int): Int = (v1 xor Int.MIN_VALUE).compareTo(v2 xor Int.MIN_VALUE)\n@PublishedApi\ninternal fun ulongCompare(v1: Long, v2: Long): Int = (v1 xor Long.MIN_VALUE).compareTo(v2 xor Long.MIN_VALUE)\n\n@PublishedApi\ninternal fun uintDivide(v1: UInt, v2: UInt): UInt = (v1.toLong() / v2.toLong()).toUInt()\n@PublishedApi\ninternal fun uintRemainder(v1: UInt, v2: UInt): UInt = (v1.toLong() % v2.toLong()).toUInt()\n\n// Division and remainder are based on Guava's UnsignedLongs implementation\n// Copyright 2011 The Guava Authors\n\n@PublishedApi\ninternal fun ulongDivide(v1: ULong, v2: ULong): ULong {\n val dividend = v1.toLong()\n val divisor = v2.toLong()\n if (divisor < 0) { // i.e., divisor >= 2^63:\n return if (v1 < v2) ULong(0) else ULong(1)\n }\n\n // Optimization - use signed division if both dividend and divisor < 2^63\n if (dividend >= 0) {\n return ULong(dividend / divisor)\n }\n\n // Otherwise, approximate the quotient, check, and correct if necessary.\n val quotient = ((dividend ushr 1) / divisor) shl 1\n val rem = dividend - quotient * divisor\n return ULong(quotient + if (ULong(rem) >= ULong(divisor)) 1 else 0)\n\n}\n\n@PublishedApi\ninternal fun ulongRemainder(v1: ULong, v2: ULong): ULong {\n val dividend = v1.toLong()\n val divisor = v2.toLong()\n if (divisor < 0) { // i.e., divisor >= 2^63:\n return if (v1 < v2) {\n v1 // dividend < divisor\n } else {\n v1 - v2 // dividend >= divisor\n }\n }\n\n // Optimization - use signed modulus if both dividend and divisor < 2^63\n if (dividend >= 0) {\n return ULong(dividend % divisor)\n }\n\n // Otherwise, approximate the quotient, check, and correct if necessary.\n val quotient = ((dividend ushr 1) / divisor) shl 1\n val rem = dividend - quotient * divisor\n return ULong(rem - if (ULong(rem) >= ULong(divisor)) divisor else 0)\n}\n\n@PublishedApi\ninternal fun doubleToUInt(v: Double): UInt = when {\n v.isNaN() -> 0u\n v <= UInt.MIN_VALUE.toDouble() -> UInt.MIN_VALUE\n v >= UInt.MAX_VALUE.toDouble() -> UInt.MAX_VALUE\n v <= Int.MAX_VALUE -> v.toInt().toUInt()\n else -> (v - Int.MAX_VALUE).toInt().toUInt() + Int.MAX_VALUE.toUInt() // Int.MAX_VALUE < v < UInt.MAX_VALUE\n}\n\n@PublishedApi\ninternal fun doubleToULong(v: Double): ULong = when {\n v.isNaN() -> 0u\n v <= ULong.MIN_VALUE.toDouble() -> ULong.MIN_VALUE\n v >= ULong.MAX_VALUE.toDouble() -> ULong.MAX_VALUE\n v < Long.MAX_VALUE -> v.toLong().toULong()\n\n // Real values from Long.MAX_VALUE to (Long.MAX_VALUE + 1) are not representable in Double, so don't handle them.\n else -> (v - 9223372036854775808.0).toLong().toULong() + 9223372036854775808uL // Long.MAX_VALUE + 1 < v < ULong.MAX_VALUE\n}\n\n\n@PublishedApi\ninternal fun uintToDouble(v: Int): Double = (v and Int.MAX_VALUE).toDouble() + (v ushr 31 shl 30).toDouble() * 2\n\n@PublishedApi\ninternal fun ulongToDouble(v: Long): Double = (v ushr 11).toDouble() * 2048 + (v and 2047)\n\n\ninternal fun ulongToString(v: Long): String = ulongToString(v, 10)\n\ninternal fun ulongToString(v: Long, base: Int): String {\n if (v >= 0) return v.toString(base)\n\n var quotient = ((v ushr 1) / base) shl 1\n var rem = v - quotient * base\n if (rem >= base) {\n rem -= base\n quotient += 1\n }\n return quotient.toString(base) + rem.toString(base)\n}\n\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@JsName(\"arrayIterator\")\ninternal fun arrayIterator(array: dynamic, type: String?) = when (type) {\n null -> {\n val arr: Array = array\n object : Iterator {\n var index = 0\n override fun hasNext() = index < arr.size\n override fun next() = if (index < arr.size) arr[index++] else throw NoSuchElementException(\"$index\")\n }\n }\n \"BooleanArray\" -> booleanArrayIterator(array)\n \"ByteArray\" -> byteArrayIterator(array)\n \"ShortArray\" -> shortArrayIterator(array)\n \"CharArray\" -> charArrayIterator(array)\n \"IntArray\" -> intArrayIterator(array)\n \"LongArray\" -> longArrayIterator(array)\n \"FloatArray\" -> floatArrayIterator(array)\n \"DoubleArray\" -> doubleArrayIterator(array)\n else -> throw IllegalStateException(\"Unsupported type argument for arrayIterator: $type\")\n}\n\n@JsName(\"booleanArrayIterator\")\ninternal fun booleanArrayIterator(array: BooleanArray) = object : BooleanIterator() {\n var index = 0\n override fun hasNext() = index < array.size\n override fun nextBoolean() = if (index < array.size) array[index++] else throw NoSuchElementException(\"$index\")\n}\n\n@JsName(\"byteArrayIterator\")\ninternal fun byteArrayIterator(array: ByteArray) = object : ByteIterator() {\n var index = 0\n override fun hasNext() = index < array.size\n override fun nextByte() = if (index < array.size) array[index++] else throw NoSuchElementException(\"$index\")\n}\n\n@JsName(\"shortArrayIterator\")\ninternal fun shortArrayIterator(array: ShortArray) = object : ShortIterator() {\n var index = 0\n override fun hasNext() = index < array.size\n override fun nextShort() = if (index < array.size) array[index++] else throw NoSuchElementException(\"$index\")\n}\n\n@JsName(\"charArrayIterator\")\ninternal fun charArrayIterator(array: CharArray) = object : CharIterator() {\n var index = 0\n override fun hasNext() = index < array.size\n override fun nextChar() = if (index < array.size) array[index++] else throw NoSuchElementException(\"$index\")\n}\n\n@JsName(\"intArrayIterator\")\ninternal fun intArrayIterator(array: IntArray) = object : IntIterator() {\n var index = 0\n override fun hasNext() = index < array.size\n override fun nextInt() = if (index < array.size) array[index++] else throw NoSuchElementException(\"$index\")\n}\n\n@JsName(\"floatArrayIterator\")\ninternal fun floatArrayIterator(array: FloatArray) = object : FloatIterator() {\n var index = 0\n override fun hasNext() = index < array.size\n override fun nextFloat() = if (index < array.size) array[index++] else throw NoSuchElementException(\"$index\")\n}\n\n@JsName(\"doubleArrayIterator\")\ninternal fun doubleArrayIterator(array: DoubleArray) = object : DoubleIterator() {\n var index = 0\n override fun hasNext() = index < array.size\n override fun nextDouble() = if (index < array.size) array[index++] else throw NoSuchElementException(\"$index\")\n}\n\n@JsName(\"longArrayIterator\")\ninternal fun longArrayIterator(array: LongArray) = object : LongIterator() {\n var index = 0\n override fun hasNext() = index < array.size\n override fun nextLong() = if (index < array.size) array[index++] else throw NoSuchElementException(\"$index\")\n}\n\n@JsName(\"PropertyMetadata\")\ninternal class PropertyMetadata(@JsName(\"callableName\") val name: String)\n\n@JsName(\"noWhenBranchMatched\")\ninternal fun noWhenBranchMatched(): Nothing = throw NoWhenBranchMatchedException()\n\n@JsName(\"subSequence\")\ninternal fun subSequence(c: CharSequence, startIndex: Int, endIndex: Int): CharSequence {\n if (c is String) {\n return c.substring(startIndex, endIndex)\n } else {\n return c.asDynamic().`subSequence_vux9f0$`(startIndex, endIndex)\n }\n}\n\n@JsName(\"captureStack\")\ninternal fun captureStack(@Suppress(\"UNUSED_PARAMETER\") baseClass: JsClass, instance: Throwable) {\n if (js(\"Error\").captureStackTrace) {\n // Using uncropped stack traces due to KT-37563.\n // Precise stack traces are implemented in JS IR compiler and stdlib\n js(\"Error\").captureStackTrace(instance);\n } else {\n instance.asDynamic().stack = js(\"new Error()\").stack;\n }\n}\n\n@JsName(\"newThrowable\")\ninternal fun newThrowable(message: String?, cause: Throwable?): Throwable {\n val throwable = js(\"new Error()\")\n throwable.message = if (jsTypeOf(message) == \"undefined\") {\n if (cause != null) cause.toString() else null\n } else {\n message\n }\n throwable.cause = cause\n throwable.name = \"Throwable\"\n return throwable\n}\n\n@JsName(\"BoxedChar\")\ninternal class BoxedChar(val c: Int) : Comparable {\n override fun equals(other: Any?): Boolean {\n return other is BoxedChar && c == other.c\n }\n\n override fun hashCode(): Int {\n return c\n }\n\n override fun toString(): String {\n return js(\"this.c\").unsafeCast().toString()\n }\n\n override fun compareTo(other: Int): Int {\n return js(\"this.c - other\").unsafeCast()\n }\n\n @JsName(\"valueOf\")\n public fun valueOf(): Int {\n return c\n }\n}\n\n@kotlin.internal.InlineOnly\ninternal inline fun concat(args: Array): T {\n val typed = js(\"Array\")(args.size)\n for (i in args.indices) {\n val arr = args[i]\n if (arr !is Array<*>) {\n typed[i] = js(\"[]\").slice.call(arr)\n } else {\n typed[i] = arr\n }\n }\n return js(\"[]\").concat.apply(js(\"[]\"), typed);\n}\n\n/** Concat regular Array's and TypedArray's into an Array.\n */\n@PublishedApi\n@JsName(\"arrayConcat\")\n@Suppress(\"UNUSED_PARAMETER\")\ninternal fun arrayConcat(a: T, b: T): T {\n return concat(js(\"arguments\"))\n}\n\n/** Concat primitive arrays. Main use: prepare vararg arguments.\n * For compatibility with 1.1.0 the arguments may be a mixture of Array's and TypedArray's.\n *\n * If the first argument is TypedArray (Byte-, Short-, Char-, Int-, Float-, and DoubleArray) returns a TypedArray, otherwise an Array.\n * If the first argument has the $type$ property (Boolean-, Char-, and LongArray) copy its value to result.$type$.\n * If the first argument is a regular Array without the $type$ property default to arrayConcat.\n */\n@PublishedApi\n@JsName(\"primitiveArrayConcat\")\n@Suppress(\"UNUSED_PARAMETER\")\ninternal fun primitiveArrayConcat(a: T, b: T): T {\n val args: Array = js(\"arguments\")\n if (a is Array<*> && a.asDynamic().`$type$` === undefined) {\n return concat(args)\n } else {\n var size = 0\n for (i in args.indices) {\n size += args[i].asDynamic().length as Int\n }\n val result = js(\"new a.constructor(size)\")\n kotlin.copyArrayType(a, result)\n size = 0\n for (i in args.indices) {\n val arr = args[i].asDynamic()\n for (j in 0 until arr.length) {\n result[size++] = arr[j]\n }\n }\n return result\n }\n}\n\n@JsName(\"booleanArrayOf\")\ninternal fun booleanArrayOf() = withType(\"BooleanArray\", js(\"[].slice.call(arguments)\"))\n\n@JsName(\"charArrayOf\")\ninternal fun charArrayOf() = withType(\"CharArray\", js(\"new Uint16Array(arguments)\"))\n\n@JsName(\"longArrayOf\")\ninternal fun longArrayOf() = withType(\"LongArray\", js(\"[].slice.call(arguments)\"))\n\n@JsName(\"withType\")\n@kotlin.internal.InlineOnly\ninternal inline fun withType(type: String, array: dynamic): dynamic {\n array.`$type$` = type\n return array\n}","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.coroutines\n\nimport kotlin.coroutines.intrinsics.COROUTINE_SUSPENDED\n\n@SinceKotlin(\"1.3\")\n@JsName(\"CoroutineImpl\")\ninternal abstract class CoroutineImpl(private val resultContinuation: Continuation) : Continuation {\n protected var state = 0\n protected var exceptionState = 0\n protected var result: Any? = null\n protected var exception: Throwable? = null\n protected var finallyPath: Array? = null\n\n public override val context: CoroutineContext = resultContinuation.context\n\n private var intercepted_: Continuation? = null\n\n public fun intercepted(): Continuation =\n intercepted_\n ?: (context[ContinuationInterceptor]?.interceptContinuation(this) ?: this)\n .also { intercepted_ = it }\n\n override fun resumeWith(result: Result) {\n var current = this\n var currentResult: Any? = result.getOrNull()\n var currentException: Throwable? = result.exceptionOrNull()\n\n // This loop unrolls recursion in current.resumeWith(param) to make saner and shorter stack traces on resume\n while (true) {\n with(current) {\n val completion = resultContinuation\n\n // Set result and exception fields in the current continuation\n if (currentException == null) {\n this.result = currentResult\n } else {\n state = exceptionState\n exception = currentException\n }\n\n try {\n val outcome = doResume()\n if (outcome === COROUTINE_SUSPENDED) return\n currentResult = outcome\n currentException = null\n } catch (exception: dynamic) { // Catch all exceptions\n currentResult = null\n currentException = exception.unsafeCast()\n }\n\n releaseIntercepted() // this state machine instance is terminating\n\n if (completion is CoroutineImpl) {\n // unrolling recursion via loop\n current = completion\n } else {\n // top-level completion reached -- invoke and return\n currentException?.let {\n completion.resumeWithException(it)\n } ?: completion.resume(currentResult)\n return\n }\n }\n }\n }\n\n private fun releaseIntercepted() {\n val intercepted = intercepted_\n if (intercepted != null && intercepted !== this) {\n context[ContinuationInterceptor]!!.releaseInterceptedContinuation(intercepted)\n }\n this.intercepted_ = CompletedContinuation // just in case\n }\n\n protected abstract fun doResume(): Any?\n}\n\ninternal object CompletedContinuation : Continuation {\n override val context: CoroutineContext\n get() = error(\"This continuation is already complete\")\n\n override fun resumeWith(result: Result) {\n error(\"This continuation is already complete\")\n }\n\n override fun toString(): String = \"This continuation is already complete\"\n}\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:Suppress(\"UNCHECKED_CAST\", \"RedundantVisibilityModifier\")\n\npackage kotlin\n\nimport kotlin.contracts.*\nimport kotlin.internal.InlineOnly\nimport kotlin.jvm.JvmField\nimport kotlin.jvm.JvmInline\nimport kotlin.jvm.JvmName\n\n/**\n * A discriminated union that encapsulates a successful outcome with a value of type [T]\n * or a failure with an arbitrary [Throwable] exception.\n */\n@SinceKotlin(\"1.3\")\n@JvmInline\npublic value class Result @PublishedApi internal constructor(\n @PublishedApi\n internal val value: Any?\n) : Serializable {\n // discovery\n\n /**\n * Returns `true` if this instance represents a successful outcome.\n * In this case [isFailure] returns `false`.\n */\n public val isSuccess: Boolean get() = value !is Failure\n\n /**\n * Returns `true` if this instance represents a failed outcome.\n * In this case [isSuccess] returns `false`.\n */\n public val isFailure: Boolean get() = value is Failure\n\n // value & exception retrieval\n\n /**\n * Returns the encapsulated value if this instance represents [success][Result.isSuccess] or `null`\n * if it is [failure][Result.isFailure].\n *\n * This function is a shorthand for `getOrElse { null }` (see [getOrElse]) or\n * `fold(onSuccess = { it }, onFailure = { null })` (see [fold]).\n */\n @InlineOnly\n public inline fun getOrNull(): T? =\n when {\n isFailure -> null\n else -> value as T\n }\n\n /**\n * Returns the encapsulated [Throwable] exception if this instance represents [failure][isFailure] or `null`\n * if it is [success][isSuccess].\n *\n * This function is a shorthand for `fold(onSuccess = { null }, onFailure = { it })` (see [fold]).\n */\n public fun exceptionOrNull(): Throwable? =\n when (value) {\n is Failure -> value.exception\n else -> null\n }\n\n /**\n * Returns a string `Success(v)` if this instance represents [success][Result.isSuccess]\n * where `v` is a string representation of the value or a string `Failure(x)` if\n * it is [failure][isFailure] where `x` is a string representation of the exception.\n */\n public override fun toString(): String =\n when (value) {\n is Failure -> value.toString() // \"Failure($exception)\"\n else -> \"Success($value)\"\n }\n\n // companion with constructors\n\n /**\n * Companion object for [Result] class that contains its constructor functions\n * [success] and [failure].\n */\n public companion object {\n /**\n * Returns an instance that encapsulates the given [value] as successful value.\n */\n @Suppress(\"INAPPLICABLE_JVM_NAME\")\n @InlineOnly\n @JvmName(\"success\")\n public inline fun success(value: T): Result =\n Result(value)\n\n /**\n * Returns an instance that encapsulates the given [Throwable] [exception] as failure.\n */\n @Suppress(\"INAPPLICABLE_JVM_NAME\")\n @InlineOnly\n @JvmName(\"failure\")\n public inline fun failure(exception: Throwable): Result =\n Result(createFailure(exception))\n }\n\n internal class Failure(\n @JvmField\n val exception: Throwable\n ) : Serializable {\n override fun equals(other: Any?): Boolean = other is Failure && exception == other.exception\n override fun hashCode(): Int = exception.hashCode()\n override fun toString(): String = \"Failure($exception)\"\n }\n}\n\n/**\n * Creates an instance of internal marker [Result.Failure] class to\n * make sure that this class is not exposed in ABI.\n */\n@PublishedApi\n@SinceKotlin(\"1.3\")\ninternal fun createFailure(exception: Throwable): Any =\n Result.Failure(exception)\n\n/**\n * Throws exception if the result is failure. This internal function minimizes\n * inlined bytecode for [getOrThrow] and makes sure that in the future we can\n * add some exception-augmenting logic here (if needed).\n */\n@PublishedApi\n@SinceKotlin(\"1.3\")\ninternal fun Result<*>.throwOnFailure() {\n if (value is Result.Failure) throw value.exception\n}\n\n/**\n * Calls the specified function [block] and returns its encapsulated result if invocation was successful,\n * catching any [Throwable] exception that was thrown from the [block] function execution and encapsulating it as a failure.\n */\n@InlineOnly\n@SinceKotlin(\"1.3\")\npublic inline fun runCatching(block: () -> R): Result {\n return try {\n Result.success(block())\n } catch (e: Throwable) {\n Result.failure(e)\n }\n}\n\n/**\n * Calls the specified function [block] with `this` value as its receiver and returns its encapsulated result if invocation was successful,\n * catching any [Throwable] exception that was thrown from the [block] function execution and encapsulating it as a failure.\n */\n@InlineOnly\n@SinceKotlin(\"1.3\")\npublic inline fun T.runCatching(block: T.() -> R): Result {\n return try {\n Result.success(block())\n } catch (e: Throwable) {\n Result.failure(e)\n }\n}\n\n// -- extensions ---\n\n/**\n * Returns the encapsulated value if this instance represents [success][Result.isSuccess] or throws the encapsulated [Throwable] exception\n * if it is [failure][Result.isFailure].\n *\n * This function is a shorthand for `getOrElse { throw it }` (see [getOrElse]).\n */\n@InlineOnly\n@SinceKotlin(\"1.3\")\npublic inline fun Result.getOrThrow(): T {\n throwOnFailure()\n return value as T\n}\n\n/**\n * Returns the encapsulated value if this instance represents [success][Result.isSuccess] or the\n * result of [onFailure] function for the encapsulated [Throwable] exception if it is [failure][Result.isFailure].\n *\n * Note, that this function rethrows any [Throwable] exception thrown by [onFailure] function.\n *\n * This function is a shorthand for `fold(onSuccess = { it }, onFailure = onFailure)` (see [fold]).\n */\n@InlineOnly\n@SinceKotlin(\"1.3\")\npublic inline fun Result.getOrElse(onFailure: (exception: Throwable) -> R): R {\n contract {\n callsInPlace(onFailure, InvocationKind.AT_MOST_ONCE)\n }\n return when (val exception = exceptionOrNull()) {\n null -> value as T\n else -> onFailure(exception)\n }\n}\n\n/**\n * Returns the encapsulated value if this instance represents [success][Result.isSuccess] or the\n * [defaultValue] if it is [failure][Result.isFailure].\n *\n * This function is a shorthand for `getOrElse { defaultValue }` (see [getOrElse]).\n */\n@InlineOnly\n@SinceKotlin(\"1.3\")\npublic inline fun Result.getOrDefault(defaultValue: R): R {\n if (isFailure) return defaultValue\n return value as T\n}\n\n/**\n * Returns the result of [onSuccess] for the encapsulated value if this instance represents [success][Result.isSuccess]\n * or the result of [onFailure] function for the encapsulated [Throwable] exception if it is [failure][Result.isFailure].\n *\n * Note, that this function rethrows any [Throwable] exception thrown by [onSuccess] or by [onFailure] function.\n */\n@InlineOnly\n@SinceKotlin(\"1.3\")\npublic inline fun Result.fold(\n onSuccess: (value: T) -> R,\n onFailure: (exception: Throwable) -> R\n): R {\n contract {\n callsInPlace(onSuccess, InvocationKind.AT_MOST_ONCE)\n callsInPlace(onFailure, InvocationKind.AT_MOST_ONCE)\n }\n return when (val exception = exceptionOrNull()) {\n null -> onSuccess(value as T)\n else -> onFailure(exception)\n }\n}\n\n// transformation\n\n/**\n * Returns the encapsulated result of the given [transform] function applied to the encapsulated value\n * if this instance represents [success][Result.isSuccess] or the\n * original encapsulated [Throwable] exception if it is [failure][Result.isFailure].\n *\n * Note, that this function rethrows any [Throwable] exception thrown by [transform] function.\n * See [mapCatching] for an alternative that encapsulates exceptions.\n */\n@InlineOnly\n@SinceKotlin(\"1.3\")\npublic inline fun Result.map(transform: (value: T) -> R): Result {\n contract {\n callsInPlace(transform, InvocationKind.AT_MOST_ONCE)\n }\n return when {\n isSuccess -> Result.success(transform(value as T))\n else -> Result(value)\n }\n}\n\n/**\n * Returns the encapsulated result of the given [transform] function applied to the encapsulated value\n * if this instance represents [success][Result.isSuccess] or the\n * original encapsulated [Throwable] exception if it is [failure][Result.isFailure].\n *\n * This function catches any [Throwable] exception thrown by [transform] function and encapsulates it as a failure.\n * See [map] for an alternative that rethrows exceptions from `transform` function.\n */\n@InlineOnly\n@SinceKotlin(\"1.3\")\npublic inline fun Result.mapCatching(transform: (value: T) -> R): Result {\n return when {\n isSuccess -> runCatching { transform(value as T) }\n else -> Result(value)\n }\n}\n\n/**\n * Returns the encapsulated result of the given [transform] function applied to the encapsulated [Throwable] exception\n * if this instance represents [failure][Result.isFailure] or the\n * original encapsulated value if it is [success][Result.isSuccess].\n *\n * Note, that this function rethrows any [Throwable] exception thrown by [transform] function.\n * See [recoverCatching] for an alternative that encapsulates exceptions.\n */\n@InlineOnly\n@SinceKotlin(\"1.3\")\npublic inline fun Result.recover(transform: (exception: Throwable) -> R): Result {\n contract {\n callsInPlace(transform, InvocationKind.AT_MOST_ONCE)\n }\n return when (val exception = exceptionOrNull()) {\n null -> this\n else -> Result.success(transform(exception))\n }\n}\n\n/**\n * Returns the encapsulated result of the given [transform] function applied to the encapsulated [Throwable] exception\n * if this instance represents [failure][Result.isFailure] or the\n * original encapsulated value if it is [success][Result.isSuccess].\n *\n * This function catches any [Throwable] exception thrown by [transform] function and encapsulates it as a failure.\n * See [recover] for an alternative that rethrows exceptions.\n */\n@InlineOnly\n@SinceKotlin(\"1.3\")\npublic inline fun Result.recoverCatching(transform: (exception: Throwable) -> R): Result {\n return when (val exception = exceptionOrNull()) {\n null -> this\n else -> runCatching { transform(exception) }\n }\n}\n\n// \"peek\" onto value/exception and pipe\n\n/**\n * Performs the given [action] on the encapsulated [Throwable] exception if this instance represents [failure][Result.isFailure].\n * Returns the original `Result` unchanged.\n */\n@InlineOnly\n@SinceKotlin(\"1.3\")\npublic inline fun Result.onFailure(action: (exception: Throwable) -> Unit): Result {\n contract {\n callsInPlace(action, InvocationKind.AT_MOST_ONCE)\n }\n exceptionOrNull()?.let { action(it) }\n return this\n}\n\n/**\n * Performs the given [action] on the encapsulated value if this instance represents [success][Result.isSuccess].\n * Returns the original `Result` unchanged.\n */\n@InlineOnly\n@SinceKotlin(\"1.3\")\npublic inline fun Result.onSuccess(action: (value: T) -> Unit): Result {\n contract {\n callsInPlace(action, InvocationKind.AT_MOST_ONCE)\n }\n if (isSuccess) action(value as T)\n return this\n}\n\n// -------------------\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"StandardKt\")\npackage kotlin\n\nimport kotlin.contracts.*\n\n/**\n * An exception is thrown to indicate that a method body remains to be implemented.\n */\npublic class NotImplementedError(message: String = \"An operation is not implemented.\") : Error(message)\n\n/**\n * Always throws [NotImplementedError] stating that operation is not implemented.\n */\n\n@kotlin.internal.InlineOnly\npublic inline fun TODO(): Nothing = throw NotImplementedError()\n\n/**\n * Always throws [NotImplementedError] stating that operation is not implemented.\n *\n * @param reason a string explaining why the implementation is missing.\n */\n@kotlin.internal.InlineOnly\npublic inline fun TODO(reason: String): Nothing = throw NotImplementedError(\"An operation is not implemented: $reason\")\n\n\n\n/**\n * Calls the specified function [block] and returns its result.\n *\n * For detailed usage information see the documentation for [scope functions](https://kotlinlang.org/docs/reference/scope-functions.html#run).\n */\n@kotlin.internal.InlineOnly\npublic inline fun run(block: () -> R): R {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n return block()\n}\n\n/**\n * Calls the specified function [block] with `this` value as its receiver and returns its result.\n *\n * For detailed usage information see the documentation for [scope functions](https://kotlinlang.org/docs/reference/scope-functions.html#run).\n */\n@kotlin.internal.InlineOnly\npublic inline fun T.run(block: T.() -> R): R {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n return block()\n}\n\n/**\n * Calls the specified function [block] with the given [receiver] as its receiver and returns its result.\n *\n * For detailed usage information see the documentation for [scope functions](https://kotlinlang.org/docs/reference/scope-functions.html#with).\n */\n@kotlin.internal.InlineOnly\npublic inline fun with(receiver: T, block: T.() -> R): R {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n return receiver.block()\n}\n\n/**\n * Calls the specified function [block] with `this` value as its receiver and returns `this` value.\n *\n * For detailed usage information see the documentation for [scope functions](https://kotlinlang.org/docs/reference/scope-functions.html#apply).\n */\n@kotlin.internal.InlineOnly\npublic inline fun T.apply(block: T.() -> Unit): T {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n block()\n return this\n}\n\n/**\n * Calls the specified function [block] with `this` value as its argument and returns `this` value.\n *\n * For detailed usage information see the documentation for [scope functions](https://kotlinlang.org/docs/reference/scope-functions.html#also).\n */\n@kotlin.internal.InlineOnly\n@SinceKotlin(\"1.1\")\npublic inline fun T.also(block: (T) -> Unit): T {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n block(this)\n return this\n}\n\n/**\n * Calls the specified function [block] with `this` value as its argument and returns its result.\n *\n * For detailed usage information see the documentation for [scope functions](https://kotlinlang.org/docs/reference/scope-functions.html#let).\n */\n@kotlin.internal.InlineOnly\npublic inline fun T.let(block: (T) -> R): R {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n return block(this)\n}\n\n/**\n * Returns `this` value if it satisfies the given [predicate] or `null`, if it doesn't.\n *\n * For detailed usage information see the documentation for [scope functions](https://kotlinlang.org/docs/reference/scope-functions.html#takeif-and-takeunless).\n */\n@kotlin.internal.InlineOnly\n@SinceKotlin(\"1.1\")\npublic inline fun T.takeIf(predicate: (T) -> Boolean): T? {\n contract {\n callsInPlace(predicate, InvocationKind.EXACTLY_ONCE)\n }\n return if (predicate(this)) this else null\n}\n\n/**\n * Returns `this` value if it _does not_ satisfy the given [predicate] or `null`, if it does.\n *\n * For detailed usage information see the documentation for [scope functions](https://kotlinlang.org/docs/reference/scope-functions.html#takeif-and-takeunless).\n */\n@kotlin.internal.InlineOnly\n@SinceKotlin(\"1.1\")\npublic inline fun T.takeUnless(predicate: (T) -> Boolean): T? {\n contract {\n callsInPlace(predicate, InvocationKind.EXACTLY_ONCE)\n }\n return if (!predicate(this)) this else null\n}\n\n/**\n * Executes the given function [action] specified number of [times].\n *\n * A zero-based index of current iteration is passed as a parameter to [action].\n *\n * @sample samples.misc.ControlFlow.repeat\n */\n@kotlin.internal.InlineOnly\npublic inline fun repeat(times: Int, action: (Int) -> Unit) {\n contract { callsInPlace(action) }\n\n for (index in 0 until times) {\n action(index)\n }\n}\n","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.coroutines\n\nimport kotlin.contracts.*\nimport kotlin.coroutines.intrinsics.*\nimport kotlin.internal.InlineOnly\n\n/**\n * Interface representing a continuation after a suspension point that returns a value of type `T`.\n */\n@SinceKotlin(\"1.3\")\npublic interface Continuation {\n /**\n * The context of the coroutine that corresponds to this continuation.\n */\n public val context: CoroutineContext\n\n /**\n * Resumes the execution of the corresponding coroutine passing a successful or failed [result] as the\n * return value of the last suspension point.\n */\n public fun resumeWith(result: Result)\n}\n\n/**\n * Classes and interfaces marked with this annotation are restricted when used as receivers for extension\n * `suspend` functions. These `suspend` extensions can only invoke other member or extension `suspend` functions on this particular\n * receiver and are restricted from calling arbitrary suspension functions.\n */\n@SinceKotlin(\"1.3\")\n@Target(AnnotationTarget.CLASS)\n@Retention(AnnotationRetention.BINARY)\npublic annotation class RestrictsSuspension\n\n/**\n * Resumes the execution of the corresponding coroutine passing [value] as the return value of the last suspension point.\n */\n@SinceKotlin(\"1.3\")\n@InlineOnly\npublic inline fun Continuation.resume(value: T): Unit =\n resumeWith(Result.success(value))\n\n/**\n * Resumes the execution of the corresponding coroutine so that the [exception] is re-thrown right after the\n * last suspension point.\n */\n@SinceKotlin(\"1.3\")\n@InlineOnly\npublic inline fun Continuation.resumeWithException(exception: Throwable): Unit =\n resumeWith(Result.failure(exception))\n\n\n/**\n * Creates a [Continuation] instance with the given [context] and implementation of [resumeWith] method.\n */\n@SinceKotlin(\"1.3\")\n@InlineOnly\npublic inline fun Continuation(\n context: CoroutineContext,\n crossinline resumeWith: (Result) -> Unit\n): Continuation =\n object : Continuation {\n override val context: CoroutineContext\n get() = context\n\n override fun resumeWith(result: Result) =\n resumeWith(result)\n }\n\n/**\n * Creates a coroutine without a receiver and with result type [T].\n * This function creates a new, fresh instance of suspendable computation every time it is invoked.\n *\n * To start executing the created coroutine, invoke `resume(Unit)` on the returned [Continuation] instance.\n * The [completion] continuation is invoked when the coroutine completes with a result or an exception.\n * Subsequent invocation of any resume function on the resulting continuation will produce an [IllegalStateException].\n */\n@SinceKotlin(\"1.3\")\n@Suppress(\"UNCHECKED_CAST\")\npublic fun (suspend () -> T).createCoroutine(\n completion: Continuation\n): Continuation =\n SafeContinuation(createCoroutineUnintercepted(completion).intercepted(), COROUTINE_SUSPENDED)\n\n/**\n * Creates a coroutine with receiver type [R] and result type [T].\n * This function creates a new, fresh instance of suspendable computation every time it is invoked.\n *\n * To start executing the created coroutine, invoke `resume(Unit)` on the returned [Continuation] instance.\n * The [completion] continuation is invoked when the coroutine completes with a result or an exception.\n * Subsequent invocation of any resume function on the resulting continuation will produce an [IllegalStateException].\n */\n@SinceKotlin(\"1.3\")\n@Suppress(\"UNCHECKED_CAST\")\npublic fun (suspend R.() -> T).createCoroutine(\n receiver: R,\n completion: Continuation\n): Continuation =\n SafeContinuation(createCoroutineUnintercepted(receiver, completion).intercepted(), COROUTINE_SUSPENDED)\n\n/**\n * Starts a coroutine without a receiver and with result type [T].\n * This function creates and starts a new, fresh instance of suspendable computation every time it is invoked.\n * The [completion] continuation is invoked when the coroutine completes with a result or an exception.\n */\n@SinceKotlin(\"1.3\")\n@Suppress(\"UNCHECKED_CAST\")\npublic fun (suspend () -> T).startCoroutine(\n completion: Continuation\n) {\n createCoroutineUnintercepted(completion).intercepted().resume(Unit)\n}\n\n/**\n * Starts a coroutine with receiver type [R] and result type [T].\n * This function creates and starts a new, fresh instance of suspendable computation every time it is invoked.\n * The [completion] continuation is invoked when the coroutine completes with a result or an exception.\n */\n@SinceKotlin(\"1.3\")\n@Suppress(\"UNCHECKED_CAST\")\npublic fun (suspend R.() -> T).startCoroutine(\n receiver: R,\n completion: Continuation\n) {\n createCoroutineUnintercepted(receiver, completion).intercepted().resume(Unit)\n}\n\n/**\n * Obtains the current continuation instance inside suspend functions and suspends\n * the currently running coroutine.\n *\n * In this function both [Continuation.resume] and [Continuation.resumeWithException] can be used either synchronously in\n * the same stack-frame where the suspension function is run or asynchronously later in the same thread or\n * from a different thread of execution. Subsequent invocation of any resume function will produce an [IllegalStateException].\n */\n@SinceKotlin(\"1.3\")\n@InlineOnly\npublic suspend inline fun suspendCoroutine(crossinline block: (Continuation) -> Unit): T {\n contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) }\n return suspendCoroutineUninterceptedOrReturn { c: Continuation ->\n val safe = SafeContinuation(c.intercepted())\n block(safe)\n safe.getOrThrow()\n }\n}\n\n/**\n * Returns the context of the current coroutine.\n */\n@SinceKotlin(\"1.3\")\n@Suppress(\"WRONG_MODIFIER_TARGET\")\n@InlineOnly\npublic suspend inline val coroutineContext: CoroutineContext\n get() {\n throw NotImplementedError(\"Implemented as intrinsic\")\n }\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.coroutines.intrinsics\n\nimport kotlin.coroutines.*\nimport kotlin.internal.InlineOnly\n\n/**\n * Starts an unintercepted coroutine without a receiver and with result type [T] and executes it until its first suspension.\n * Returns the result of the coroutine or throws its exception if it does not suspend or [COROUTINE_SUSPENDED] if it suspends.\n * In the latter case, the [completion] continuation is invoked when the coroutine completes with a result or an exception.\n *\n * The coroutine is started directly in the invoker's thread without going through the [ContinuationInterceptor] that might\n * be present in the completion's [CoroutineContext]. It is the invoker's responsibility to ensure that a proper invocation\n * context is established.\n *\n * This function is designed to be used from inside of [suspendCoroutineUninterceptedOrReturn] to resume the execution of the suspended\n * coroutine using a reference to the suspending function.\n */\n@SinceKotlin(\"1.3\")\n@InlineOnly\npublic actual inline fun (suspend () -> T).startCoroutineUninterceptedOrReturn(\n completion: Continuation\n): Any? = this.asDynamic()(completion, false)\n\n/**\n * Starts an unintercepted coroutine with receiver type [R] and result type [T] and executes it until its first suspension.\n * Returns the result of the coroutine or throws its exception if it does not suspend or [COROUTINE_SUSPENDED] if it suspends.\n * In the latter case, the [completion] continuation is invoked when the coroutine completes with a result or an exception.\n *\n * The coroutine is started directly in the invoker's thread without going through the [ContinuationInterceptor] that might\n * be present in the completion's [CoroutineContext]. It is the invoker's responsibility to ensure that a proper invocation\n * context is established.\n *\n * This function is designed to be used from inside of [suspendCoroutineUninterceptedOrReturn] to resume the execution of the suspended\n * coroutine using a reference to the suspending function.\n */\n@SinceKotlin(\"1.3\")\n@InlineOnly\npublic actual inline fun (suspend R.() -> T).startCoroutineUninterceptedOrReturn(\n receiver: R,\n completion: Continuation\n): Any? = this.asDynamic()(receiver, completion, false)\n\n@InlineOnly\ninternal actual inline fun (suspend R.(P) -> T).startCoroutineUninterceptedOrReturn(\n receiver: R,\n param: P,\n completion: Continuation\n): Any? = this.asDynamic()(receiver, param, completion, false)\n\n/**\n * Creates unintercepted coroutine without receiver and with result type [T].\n * This function creates a new, fresh instance of suspendable computation every time it is invoked.\n *\n * To start executing the created coroutine, invoke `resume(Unit)` on the returned [Continuation] instance.\n * The [completion] continuation is invoked when coroutine completes with result or exception.\n *\n * This function returns unintercepted continuation.\n * Invocation of `resume(Unit)` starts coroutine immediately in the invoker's call stack without going through the\n * [ContinuationInterceptor] that might be present in the completion's [CoroutineContext].\n * It is the invoker's responsibility to ensure that a proper invocation context is established.\n * Note that [completion] of this function may get invoked in an arbitrary context.\n *\n * [Continuation.intercepted] can be used to acquire the intercepted continuation.\n * Invocation of `resume(Unit)` on intercepted continuation guarantees that execution of\n * both the coroutine and [completion] happens in the invocation context established by\n * [ContinuationInterceptor].\n *\n * Repeated invocation of any resume function on the resulting continuation corrupts the\n * state machine of the coroutine and may result in arbitrary behaviour or exception.\n */\n@SinceKotlin(\"1.3\")\npublic actual fun (suspend () -> T).createCoroutineUnintercepted(\n completion: Continuation\n): Continuation =\n // Kotlin/JS suspend lambdas have an extra parameter `suspended`\n if (this.asDynamic().length == 2) {\n // When `suspended` is true the continuation is created, but not executed\n this.asDynamic()(completion, true)\n } else {\n createCoroutineFromSuspendFunction(completion) {\n this.asDynamic()(completion)\n }\n }\n\n/**\n * Creates unintercepted coroutine with receiver type [R] and result type [T].\n * This function creates a new, fresh instance of suspendable computation every time it is invoked.\n *\n * To start executing the created coroutine, invoke `resume(Unit)` on the returned [Continuation] instance.\n * The [completion] continuation is invoked when coroutine completes with result or exception.\n *\n * This function returns unintercepted continuation.\n * Invocation of `resume(Unit)` starts coroutine immediately in the invoker's call stack without going through the\n * [ContinuationInterceptor] that might be present in the completion's [CoroutineContext].\n * It is the invoker's responsibility to ensure that a proper invocation context is established.\n * Note that [completion] of this function may get invoked in an arbitrary context.\n *\n * [Continuation.intercepted] can be used to acquire the intercepted continuation.\n * Invocation of `resume(Unit)` on intercepted continuation guarantees that execution of\n * both the coroutine and [completion] happens in the invocation context established by\n * [ContinuationInterceptor].\n *\n * Repeated invocation of any resume function on the resulting continuation corrupts the\n * state machine of the coroutine and may result in arbitrary behaviour or exception.\n */\n@SinceKotlin(\"1.3\")\npublic actual fun (suspend R.() -> T).createCoroutineUnintercepted(\n receiver: R,\n completion: Continuation\n): Continuation =\n // Kotlin/JS suspend lambdas have an extra parameter `suspended`\n if (this.asDynamic().length == 3) {\n // When `suspended` is true the continuation is created, but not executed\n this.asDynamic()(receiver, completion, true)\n } else {\n createCoroutineFromSuspendFunction(completion) {\n this.asDynamic()(receiver, completion)\n }\n }\n\n/**\n * Intercepts this continuation with [ContinuationInterceptor].\n *\n * This function shall be used on the immediate result of [createCoroutineUnintercepted] or [suspendCoroutineUninterceptedOrReturn],\n * in which case it checks for [ContinuationInterceptor] in the continuation's [context][Continuation.context],\n * invokes [ContinuationInterceptor.interceptContinuation], caches and returns the result.\n *\n * If this function is invoked on other [Continuation] instances it returns `this` continuation unchanged.\n */\n@SinceKotlin(\"1.3\")\npublic actual fun Continuation.intercepted(): Continuation =\n (this as? CoroutineImpl)?.intercepted() ?: this\n\n\nprivate inline fun createCoroutineFromSuspendFunction(\n completion: Continuation,\n crossinline block: () -> Any?\n): Continuation {\n @Suppress(\"UNCHECKED_CAST\")\n return object : CoroutineImpl(completion as Continuation) {\n override fun doResume(): Any? {\n exception?.let { throw it }\n return block()\n }\n }\n}\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin\n\n// NOTE: Do not author your exceptions as they are written in this file, instead use this template:\n/*\npublic open class MyException : Exception {\n constructor() : super()\n constructor(message: String?) : super(message)\n constructor(message: String?, cause: Throwable?) : super(message, cause)\n constructor(cause: Throwable?) : super(cause)\n}\n*/\n\n\n// TODO: remove primary constructors, make all secondary KT-22055\n\n@Suppress(\"USELESS_ELVIS_RIGHT_IS_NULL\")\npublic actual open class Error actual constructor(message: String?, cause: Throwable?) : Throwable(message, cause ?: null) {\n actual constructor() : this(null, null)\n actual constructor(message: String?) : this(message, null)\n actual constructor(cause: Throwable?) : this(undefined, cause)\n}\n\n@Suppress(\"USELESS_ELVIS_RIGHT_IS_NULL\")\npublic actual open class Exception actual constructor(message: String?, cause: Throwable?) : Throwable(message, cause ?: null) {\n actual constructor() : this(null, null)\n actual constructor(message: String?) : this(message, null)\n actual constructor(cause: Throwable?) : this(undefined, cause)\n}\n\npublic actual open class RuntimeException actual constructor(message: String?, cause: Throwable?) : Exception(message, cause) {\n actual constructor() : this(null, null)\n actual constructor(message: String?) : this(message, null)\n actual constructor(cause: Throwable?) : this(undefined, cause)\n}\n\npublic actual open class IllegalArgumentException actual constructor(message: String?, cause: Throwable?) : RuntimeException(message, cause) {\n actual constructor() : this(null, null)\n actual constructor(message: String?) : this(message, null)\n actual constructor(cause: Throwable?) : this(undefined, cause)\n}\n\npublic actual open class IllegalStateException actual constructor(message: String?, cause: Throwable?) : RuntimeException(message, cause) {\n actual constructor() : this(null, null)\n actual constructor(message: String?) : this(message, null)\n actual constructor(cause: Throwable?) : this(undefined, cause)\n}\n\npublic actual open class IndexOutOfBoundsException actual constructor(message: String?) : RuntimeException(message) {\n actual constructor() : this(null)\n}\n\npublic actual open class ConcurrentModificationException actual constructor(message: String?, cause: Throwable?) : RuntimeException(message, cause) {\n actual constructor() : this(null, null)\n actual constructor(message: String?) : this(message, null)\n actual constructor(cause: Throwable?) : this(undefined, cause)\n}\n\npublic actual open class UnsupportedOperationException actual constructor(message: String?, cause: Throwable?) : RuntimeException(message, cause) {\n actual constructor() : this(null, null)\n actual constructor(message: String?) : this(message, null)\n actual constructor(cause: Throwable?) : this(undefined, cause)\n}\n\n\npublic actual open class NumberFormatException actual constructor(message: String?) : IllegalArgumentException(message) {\n actual constructor() : this(null)\n}\n\n\npublic actual open class NullPointerException actual constructor(message: String?) : RuntimeException(message) {\n actual constructor() : this(null)\n}\n\npublic actual open class ClassCastException actual constructor(message: String?) : RuntimeException(message) {\n actual constructor() : this(null)\n}\n\npublic actual open class AssertionError\n@SinceKotlin(\"1.4\")\nconstructor(message: String?, cause: Throwable?) : Error(message, cause) {\n actual constructor() : this(null)\n constructor(message: String?) : this(message, null)\n actual constructor(message: Any?) : this(message.toString(), message as? Throwable)\n}\n\npublic actual open class NoSuchElementException actual constructor(message: String?) : RuntimeException(message) {\n actual constructor() : this(null)\n}\n\n@SinceKotlin(\"1.3\")\npublic actual open class ArithmeticException actual constructor(message: String?) : RuntimeException(message) {\n actual constructor() : this(null)\n}\n\npublic actual open class NoWhenBranchMatchedException actual constructor(message: String?, cause: Throwable?) : RuntimeException(message, cause) {\n actual constructor() : this(null, null)\n actual constructor(message: String?) : this(message, null)\n actual constructor(cause: Throwable?) : this(undefined, cause)\n}\n\npublic actual open class UninitializedPropertyAccessException actual constructor(message: String?, cause: Throwable?) : RuntimeException(message, cause) {\n actual constructor() : this(null, null)\n actual constructor(message: String?) : this(message, null)\n actual constructor(cause: Throwable?) : this(undefined, cause)\n}\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:Suppress(\"UNUSED_PARAMETER\", \"NOTHING_TO_INLINE\")\n\npackage kotlin\n\n/**\n * Returns an empty array of the specified type [T].\n */\npublic inline fun emptyArray(): Array = js(\"[]\")\n\n@library\npublic fun arrayOf(vararg elements: T): Array = definedExternally\n\n@library\npublic fun doubleArrayOf(vararg elements: Double): DoubleArray = definedExternally\n\n@library\npublic fun floatArrayOf(vararg elements: Float): FloatArray = definedExternally\n\n@library\npublic fun longArrayOf(vararg elements: Long): LongArray = definedExternally\n\n@library\npublic fun intArrayOf(vararg elements: Int): IntArray = definedExternally\n\n@library\npublic fun charArrayOf(vararg elements: Char): CharArray = definedExternally\n\n@library\npublic fun shortArrayOf(vararg elements: Short): ShortArray = definedExternally\n\n@library\npublic fun byteArrayOf(vararg elements: Byte): ByteArray = definedExternally\n\n@library\npublic fun booleanArrayOf(vararg elements: Boolean): BooleanArray = definedExternally\n\n/**\n * Creates a new instance of the [Lazy] that uses the specified initialization function [initializer].\n */\npublic actual fun lazy(initializer: () -> T): Lazy = UnsafeLazyImpl(initializer)\n\n/**\n * Creates a new instance of the [Lazy] that uses the specified initialization function [initializer].\n *\n * The [mode] parameter is ignored. */\npublic actual fun lazy(mode: LazyThreadSafetyMode, initializer: () -> T): Lazy = UnsafeLazyImpl(initializer)\n\n/**\n * Creates a new instance of the [Lazy] that uses the specified initialization function [initializer].\n *\n * The [lock] parameter is ignored.\n */\npublic actual fun lazy(lock: Any?, initializer: () -> T): Lazy = UnsafeLazyImpl(initializer)\n\n\ninternal fun fillFrom(src: dynamic, dst: dynamic): dynamic {\n val srcLen: Int = src.length\n val dstLen: Int = dst.length\n var index: Int = 0\n while (index < srcLen && index < dstLen) dst[index] = src[index++]\n return dst\n}\n\n\ninternal fun arrayCopyResize(source: dynamic, newSize: Int, defaultValue: Any?): dynamic {\n val result = source.slice(0, newSize)\n copyArrayType(source, result)\n var index: Int = source.length\n if (newSize > index) {\n result.length = newSize\n while (index < newSize) result[index++] = defaultValue\n }\n return result\n}\n\ninternal fun arrayPlusCollection(array: dynamic, collection: Collection): dynamic {\n val result = array.slice()\n result.length += collection.size\n copyArrayType(array, result)\n var index: Int = array.length\n for (element in collection) result[index++] = element\n return result\n}\n\ninternal fun fillFromCollection(dst: dynamic, startIndex: Int, collection: Collection): dynamic {\n var index = startIndex\n for (element in collection) dst[index++] = element\n return dst\n}\n\ninternal inline fun copyArrayType(from: dynamic, to: dynamic) {\n if (from.`$type$` !== undefined) {\n to.`$type$` = from.`$type$`\n }\n}\n\ninternal inline fun jsIsType(obj: dynamic, jsClass: dynamic) = js(\"Kotlin\").isType(obj, jsClass)","/*\n * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.text\n\n/**\n * Returns a string representation of this [Long] value in the specified [radix].\n *\n * @throws IllegalArgumentException when [radix] is not a valid radix for number to string conversion.\n */\n@SinceKotlin(\"1.2\")\npublic actual fun Long.toString(radix: Int): String = asDynamic().toString(checkRadix(radix))","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.collections\n\n//\n// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt\n// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib\n//\n\nimport kotlin.js.*\nimport primitiveArrayConcat\nimport withType\nimport kotlin.ranges.contains\nimport kotlin.ranges.reversed\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic actual fun Array.elementAt(index: Int): T {\n return elementAtOrElse(index) { throw IndexOutOfBoundsException(\"index: $index, size: $size}\") }\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic actual fun ByteArray.elementAt(index: Int): Byte {\n return elementAtOrElse(index) { throw IndexOutOfBoundsException(\"index: $index, size: $size}\") }\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic actual fun ShortArray.elementAt(index: Int): Short {\n return elementAtOrElse(index) { throw IndexOutOfBoundsException(\"index: $index, size: $size}\") }\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic actual fun IntArray.elementAt(index: Int): Int {\n return elementAtOrElse(index) { throw IndexOutOfBoundsException(\"index: $index, size: $size}\") }\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic actual fun LongArray.elementAt(index: Int): Long {\n return elementAtOrElse(index) { throw IndexOutOfBoundsException(\"index: $index, size: $size}\") }\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic actual fun FloatArray.elementAt(index: Int): Float {\n return elementAtOrElse(index) { throw IndexOutOfBoundsException(\"index: $index, size: $size}\") }\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic actual fun DoubleArray.elementAt(index: Int): Double {\n return elementAtOrElse(index) { throw IndexOutOfBoundsException(\"index: $index, size: $size}\") }\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic actual fun BooleanArray.elementAt(index: Int): Boolean {\n return elementAtOrElse(index) { throw IndexOutOfBoundsException(\"index: $index, size: $size}\") }\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic actual fun CharArray.elementAt(index: Int): Char {\n return elementAtOrElse(index) { throw IndexOutOfBoundsException(\"index: $index, size: $size}\") }\n}\n\n/**\n * Returns a [List] that wraps the original array.\n */\npublic actual fun Array.asList(): List {\n return ArrayList(this.unsafeCast>())\n}\n\n/**\n * Returns a [List] that wraps the original array.\n */\n@kotlin.internal.InlineOnly\npublic actual inline fun ByteArray.asList(): List {\n return this.unsafeCast>().asList()\n}\n\n/**\n * Returns a [List] that wraps the original array.\n */\n@kotlin.internal.InlineOnly\npublic actual inline fun ShortArray.asList(): List {\n return this.unsafeCast>().asList()\n}\n\n/**\n * Returns a [List] that wraps the original array.\n */\n@kotlin.internal.InlineOnly\npublic actual inline fun IntArray.asList(): List {\n return this.unsafeCast>().asList()\n}\n\n/**\n * Returns a [List] that wraps the original array.\n */\n@kotlin.internal.InlineOnly\npublic actual inline fun LongArray.asList(): List {\n return this.unsafeCast>().asList()\n}\n\n/**\n * Returns a [List] that wraps the original array.\n */\n@kotlin.internal.InlineOnly\npublic actual inline fun FloatArray.asList(): List {\n return this.unsafeCast>().asList()\n}\n\n/**\n * Returns a [List] that wraps the original array.\n */\n@kotlin.internal.InlineOnly\npublic actual inline fun DoubleArray.asList(): List {\n return this.unsafeCast>().asList()\n}\n\n/**\n * Returns a [List] that wraps the original array.\n */\n@kotlin.internal.InlineOnly\npublic actual inline fun BooleanArray.asList(): List {\n return this.unsafeCast>().asList()\n}\n\n/**\n * Returns a [List] that wraps the original array.\n */\npublic actual fun CharArray.asList(): List {\n return object : AbstractList(), RandomAccess {\n override val size: Int get() = this@asList.size\n override fun isEmpty(): Boolean = this@asList.isEmpty()\n override fun contains(element: Char): Boolean = this@asList.contains(element)\n override fun get(index: Int): Char {\n AbstractList.checkElementIndex(index, size)\n return this@asList[index]\n }\n override fun indexOf(element: Char): Int {\n @Suppress(\"USELESS_CAST\")\n if ((element as Any?) !is Char) return -1\n return this@asList.indexOf(element)\n }\n override fun lastIndexOf(element: Char): Int {\n @Suppress(\"USELESS_CAST\")\n if ((element as Any?) !is Char) return -1\n return this@asList.lastIndexOf(element)\n }\n }\n}\n\n/**\n * Returns `true` if the two specified arrays are *deeply* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * If two corresponding elements are nested arrays, they are also compared deeply.\n * If any of arrays contains itself on any nesting level the behavior is undefined.\n * \n * The elements of other types are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.LowPriorityInOverloadResolution\npublic actual infix fun Array.contentDeepEquals(other: Array): Boolean {\n return this.contentDeepEquals(other)\n}\n\n/**\n * Returns `true` if the two specified arrays are *deeply* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The specified arrays are also considered deeply equal if both are `null`.\n * \n * If two corresponding elements are nested arrays, they are also compared deeply.\n * If any of arrays contains itself on any nesting level the behavior is undefined.\n * \n * The elements of other types are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayDeepEquals\")\npublic actual infix fun Array?.contentDeepEquals(other: Array?): Boolean {\n definedExternally\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n * Nested arrays are treated as lists too.\n * \n * If any of arrays contains itself on any nesting level the behavior is undefined.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.LowPriorityInOverloadResolution\npublic actual fun Array.contentDeepHashCode(): Int {\n return this.contentDeepHashCode()\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n * Nested arrays are treated as lists too.\n * \n * If any of arrays contains itself on any nesting level the behavior is undefined.\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayDeepHashCode\")\npublic actual fun Array?.contentDeepHashCode(): Int {\n definedExternally\n}\n\n/**\n * Returns a string representation of the contents of this array as if it is a [List].\n * Nested arrays are treated as lists too.\n * \n * If any of arrays contains itself on any nesting level that reference\n * is rendered as `\"[...]\"` to prevent recursion.\n * \n * @sample samples.collections.Arrays.ContentOperations.contentDeepToString\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.LowPriorityInOverloadResolution\npublic actual fun Array.contentDeepToString(): String {\n return this.contentDeepToString()\n}\n\n/**\n * Returns a string representation of the contents of this array as if it is a [List].\n * Nested arrays are treated as lists too.\n * \n * If any of arrays contains itself on any nesting level that reference\n * is rendered as `\"[...]\"` to prevent recursion.\n * \n * @sample samples.collections.Arrays.ContentOperations.contentDeepToString\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayDeepToString\")\npublic actual fun Array?.contentDeepToString(): String {\n definedExternally\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual infix fun Array.contentEquals(other: Array): Boolean {\n return this.contentEquals(other)\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual infix fun ByteArray.contentEquals(other: ByteArray): Boolean {\n return this.contentEquals(other)\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual infix fun ShortArray.contentEquals(other: ShortArray): Boolean {\n return this.contentEquals(other)\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual infix fun IntArray.contentEquals(other: IntArray): Boolean {\n return this.contentEquals(other)\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual infix fun LongArray.contentEquals(other: LongArray): Boolean {\n return this.contentEquals(other)\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual infix fun FloatArray.contentEquals(other: FloatArray): Boolean {\n return this.contentEquals(other)\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual infix fun DoubleArray.contentEquals(other: DoubleArray): Boolean {\n return this.contentEquals(other)\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual infix fun BooleanArray.contentEquals(other: BooleanArray): Boolean {\n return this.contentEquals(other)\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual infix fun CharArray.contentEquals(other: CharArray): Boolean {\n return this.contentEquals(other)\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayEquals\")\npublic actual infix fun Array?.contentEquals(other: Array?): Boolean {\n definedExternally\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayEquals\")\npublic actual infix fun ByteArray?.contentEquals(other: ByteArray?): Boolean {\n definedExternally\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayEquals\")\npublic actual infix fun ShortArray?.contentEquals(other: ShortArray?): Boolean {\n definedExternally\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayEquals\")\npublic actual infix fun IntArray?.contentEquals(other: IntArray?): Boolean {\n definedExternally\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayEquals\")\npublic actual infix fun LongArray?.contentEquals(other: LongArray?): Boolean {\n definedExternally\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayEquals\")\npublic actual infix fun FloatArray?.contentEquals(other: FloatArray?): Boolean {\n definedExternally\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayEquals\")\npublic actual infix fun DoubleArray?.contentEquals(other: DoubleArray?): Boolean {\n definedExternally\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayEquals\")\npublic actual infix fun BooleanArray?.contentEquals(other: BooleanArray?): Boolean {\n definedExternally\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n * \n * The elements are compared for equality with the [equals][Any.equals] function.\n * For floating point numbers it means that `NaN` is equal to itself and `-0.0` is not equal to `0.0`.\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayEquals\")\npublic actual infix fun CharArray?.contentEquals(other: CharArray?): Boolean {\n definedExternally\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual fun Array.contentHashCode(): Int {\n return this.contentHashCode()\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual fun ByteArray.contentHashCode(): Int {\n return this.contentHashCode()\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual fun ShortArray.contentHashCode(): Int {\n return this.contentHashCode()\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual fun IntArray.contentHashCode(): Int {\n return this.contentHashCode()\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual fun LongArray.contentHashCode(): Int {\n return this.contentHashCode()\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual fun FloatArray.contentHashCode(): Int {\n return this.contentHashCode()\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual fun DoubleArray.contentHashCode(): Int {\n return this.contentHashCode()\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual fun BooleanArray.contentHashCode(): Int {\n return this.contentHashCode()\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual fun CharArray.contentHashCode(): Int {\n return this.contentHashCode()\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayHashCode\")\npublic actual fun Array?.contentHashCode(): Int {\n definedExternally\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayHashCode\")\npublic actual fun ByteArray?.contentHashCode(): Int {\n definedExternally\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayHashCode\")\npublic actual fun ShortArray?.contentHashCode(): Int {\n definedExternally\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayHashCode\")\npublic actual fun IntArray?.contentHashCode(): Int {\n definedExternally\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayHashCode\")\npublic actual fun LongArray?.contentHashCode(): Int {\n definedExternally\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayHashCode\")\npublic actual fun FloatArray?.contentHashCode(): Int {\n definedExternally\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayHashCode\")\npublic actual fun DoubleArray?.contentHashCode(): Int {\n definedExternally\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayHashCode\")\npublic actual fun BooleanArray?.contentHashCode(): Int {\n definedExternally\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayHashCode\")\npublic actual fun CharArray?.contentHashCode(): Int {\n definedExternally\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual fun Array.contentToString(): String {\n return this.contentToString()\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual fun ByteArray.contentToString(): String {\n return this.contentToString()\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual fun ShortArray.contentToString(): String {\n return this.contentToString()\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual fun IntArray.contentToString(): String {\n return this.contentToString()\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual fun LongArray.contentToString(): String {\n return this.contentToString()\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual fun FloatArray.contentToString(): String {\n return this.contentToString()\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual fun DoubleArray.contentToString(): String {\n return this.contentToString()\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual fun BooleanArray.contentToString(): String {\n return this.contentToString()\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.1\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\npublic actual fun CharArray.contentToString(): String {\n return this.contentToString()\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayToString\")\npublic actual fun Array?.contentToString(): String {\n definedExternally\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayToString\")\npublic actual fun ByteArray?.contentToString(): String {\n definedExternally\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayToString\")\npublic actual fun ShortArray?.contentToString(): String {\n definedExternally\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayToString\")\npublic actual fun IntArray?.contentToString(): String {\n definedExternally\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayToString\")\npublic actual fun LongArray?.contentToString(): String {\n definedExternally\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayToString\")\npublic actual fun FloatArray?.contentToString(): String {\n definedExternally\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayToString\")\npublic actual fun DoubleArray?.contentToString(): String {\n definedExternally\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayToString\")\npublic actual fun BooleanArray?.contentToString(): String {\n definedExternally\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.4\")\n@library(\"arrayToString\")\npublic actual fun CharArray?.contentToString(): String {\n definedExternally\n}\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual inline fun Array.copyInto(destination: Array, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): Array {\n arrayCopy(this, destination, destinationOffset, startIndex, endIndex)\n return destination\n}\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual inline fun ByteArray.copyInto(destination: ByteArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): ByteArray {\n arrayCopy(this.unsafeCast>(), destination.unsafeCast>(), destinationOffset, startIndex, endIndex)\n return destination\n}\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual inline fun ShortArray.copyInto(destination: ShortArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): ShortArray {\n arrayCopy(this.unsafeCast>(), destination.unsafeCast>(), destinationOffset, startIndex, endIndex)\n return destination\n}\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual inline fun IntArray.copyInto(destination: IntArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): IntArray {\n arrayCopy(this.unsafeCast>(), destination.unsafeCast>(), destinationOffset, startIndex, endIndex)\n return destination\n}\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual inline fun LongArray.copyInto(destination: LongArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): LongArray {\n arrayCopy(this.unsafeCast>(), destination.unsafeCast>(), destinationOffset, startIndex, endIndex)\n return destination\n}\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual inline fun FloatArray.copyInto(destination: FloatArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): FloatArray {\n arrayCopy(this.unsafeCast>(), destination.unsafeCast>(), destinationOffset, startIndex, endIndex)\n return destination\n}\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual inline fun DoubleArray.copyInto(destination: DoubleArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): DoubleArray {\n arrayCopy(this.unsafeCast>(), destination.unsafeCast>(), destinationOffset, startIndex, endIndex)\n return destination\n}\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual inline fun BooleanArray.copyInto(destination: BooleanArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): BooleanArray {\n arrayCopy(this.unsafeCast>(), destination.unsafeCast>(), destinationOffset, startIndex, endIndex)\n return destination\n}\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual inline fun CharArray.copyInto(destination: CharArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): CharArray {\n arrayCopy(this.unsafeCast>(), destination.unsafeCast>(), destinationOffset, startIndex, endIndex)\n return destination\n}\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\n@Suppress(\"ACTUAL_WITHOUT_EXPECT\", \"NOTHING_TO_INLINE\")\npublic actual inline fun Array.copyOf(): Array {\n return this.asDynamic().slice()\n}\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline fun ByteArray.copyOf(): ByteArray {\n return this.asDynamic().slice()\n}\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline fun ShortArray.copyOf(): ShortArray {\n return this.asDynamic().slice()\n}\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline fun IntArray.copyOf(): IntArray {\n return this.asDynamic().slice()\n}\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\npublic actual fun LongArray.copyOf(): LongArray {\n return withType(\"LongArray\", this.asDynamic().slice())\n}\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline fun FloatArray.copyOf(): FloatArray {\n return this.asDynamic().slice()\n}\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline fun DoubleArray.copyOf(): DoubleArray {\n return this.asDynamic().slice()\n}\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\npublic actual fun BooleanArray.copyOf(): BooleanArray {\n return withType(\"BooleanArray\", this.asDynamic().slice())\n}\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\npublic actual fun CharArray.copyOf(): CharArray {\n return withType(\"CharArray\", this.asDynamic().slice())\n}\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with zero values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf\n */\npublic actual fun ByteArray.copyOf(newSize: Int): ByteArray {\n require(newSize >= 0) { \"Invalid new array size: $newSize.\" }\n return fillFrom(this, ByteArray(newSize))\n}\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with zero values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf\n */\npublic actual fun ShortArray.copyOf(newSize: Int): ShortArray {\n require(newSize >= 0) { \"Invalid new array size: $newSize.\" }\n return fillFrom(this, ShortArray(newSize))\n}\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with zero values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf\n */\npublic actual fun IntArray.copyOf(newSize: Int): IntArray {\n require(newSize >= 0) { \"Invalid new array size: $newSize.\" }\n return fillFrom(this, IntArray(newSize))\n}\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with zero values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf\n */\npublic actual fun LongArray.copyOf(newSize: Int): LongArray {\n require(newSize >= 0) { \"Invalid new array size: $newSize.\" }\n return withType(\"LongArray\", arrayCopyResize(this, newSize, 0L))\n}\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with zero values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf\n */\npublic actual fun FloatArray.copyOf(newSize: Int): FloatArray {\n require(newSize >= 0) { \"Invalid new array size: $newSize.\" }\n return fillFrom(this, FloatArray(newSize))\n}\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with zero values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf\n */\npublic actual fun DoubleArray.copyOf(newSize: Int): DoubleArray {\n require(newSize >= 0) { \"Invalid new array size: $newSize.\" }\n return fillFrom(this, DoubleArray(newSize))\n}\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with `false` values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with `false` values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf\n */\npublic actual fun BooleanArray.copyOf(newSize: Int): BooleanArray {\n require(newSize >= 0) { \"Invalid new array size: $newSize.\" }\n return withType(\"BooleanArray\", arrayCopyResize(this, newSize, false))\n}\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with null char (`\\u0000`) values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with null char (`\\u0000`) values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizedPrimitiveCopyOf\n */\npublic actual fun CharArray.copyOf(newSize: Int): CharArray {\n require(newSize >= 0) { \"Invalid new array size: $newSize.\" }\n return withType(\"CharArray\", fillFrom(this, CharArray(newSize)))\n}\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with `null` values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with `null` values.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.resizingCopyOf\n */\n@Suppress(\"ACTUAL_WITHOUT_EXPECT\")\npublic actual fun Array.copyOf(newSize: Int): Array {\n require(newSize >= 0) { \"Invalid new array size: $newSize.\" }\n return arrayCopyResize(this, newSize, null)\n}\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive) to copy.\n * @param toIndex the end of the range (exclusive) to copy.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@Suppress(\"ACTUAL_WITHOUT_EXPECT\")\npublic actual fun Array.copyOfRange(fromIndex: Int, toIndex: Int): Array {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n return this.asDynamic().slice(fromIndex, toIndex)\n}\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive) to copy.\n * @param toIndex the end of the range (exclusive) to copy.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\npublic actual fun ByteArray.copyOfRange(fromIndex: Int, toIndex: Int): ByteArray {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n return this.asDynamic().slice(fromIndex, toIndex)\n}\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive) to copy.\n * @param toIndex the end of the range (exclusive) to copy.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\npublic actual fun ShortArray.copyOfRange(fromIndex: Int, toIndex: Int): ShortArray {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n return this.asDynamic().slice(fromIndex, toIndex)\n}\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive) to copy.\n * @param toIndex the end of the range (exclusive) to copy.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\npublic actual fun IntArray.copyOfRange(fromIndex: Int, toIndex: Int): IntArray {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n return this.asDynamic().slice(fromIndex, toIndex)\n}\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive) to copy.\n * @param toIndex the end of the range (exclusive) to copy.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\npublic actual fun LongArray.copyOfRange(fromIndex: Int, toIndex: Int): LongArray {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n return withType(\"LongArray\", this.asDynamic().slice(fromIndex, toIndex))\n}\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive) to copy.\n * @param toIndex the end of the range (exclusive) to copy.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\npublic actual fun FloatArray.copyOfRange(fromIndex: Int, toIndex: Int): FloatArray {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n return this.asDynamic().slice(fromIndex, toIndex)\n}\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive) to copy.\n * @param toIndex the end of the range (exclusive) to copy.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\npublic actual fun DoubleArray.copyOfRange(fromIndex: Int, toIndex: Int): DoubleArray {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n return this.asDynamic().slice(fromIndex, toIndex)\n}\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive) to copy.\n * @param toIndex the end of the range (exclusive) to copy.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\npublic actual fun BooleanArray.copyOfRange(fromIndex: Int, toIndex: Int): BooleanArray {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n return withType(\"BooleanArray\", this.asDynamic().slice(fromIndex, toIndex))\n}\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive) to copy.\n * @param toIndex the end of the range (exclusive) to copy.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\npublic actual fun CharArray.copyOfRange(fromIndex: Int, toIndex: Int): CharArray {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n return withType(\"CharArray\", this.asDynamic().slice(fromIndex, toIndex))\n}\n\n/**\n * Fills this array or its subrange with the specified [element] value.\n * \n * @param fromIndex the start of the range (inclusive) to fill, 0 by default.\n * @param toIndex the end of the range (exclusive) to fill, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun Array.fill(element: T, fromIndex: Int = 0, toIndex: Int = size): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n this.asDynamic().fill(element, fromIndex, toIndex);\n}\n\n/**\n * Fills this array or its subrange with the specified [element] value.\n * \n * @param fromIndex the start of the range (inclusive) to fill, 0 by default.\n * @param toIndex the end of the range (exclusive) to fill, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun ByteArray.fill(element: Byte, fromIndex: Int = 0, toIndex: Int = size): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n this.asDynamic().fill(element, fromIndex, toIndex);\n}\n\n/**\n * Fills this array or its subrange with the specified [element] value.\n * \n * @param fromIndex the start of the range (inclusive) to fill, 0 by default.\n * @param toIndex the end of the range (exclusive) to fill, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun ShortArray.fill(element: Short, fromIndex: Int = 0, toIndex: Int = size): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n this.asDynamic().fill(element, fromIndex, toIndex);\n}\n\n/**\n * Fills this array or its subrange with the specified [element] value.\n * \n * @param fromIndex the start of the range (inclusive) to fill, 0 by default.\n * @param toIndex the end of the range (exclusive) to fill, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun IntArray.fill(element: Int, fromIndex: Int = 0, toIndex: Int = size): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n this.asDynamic().fill(element, fromIndex, toIndex);\n}\n\n/**\n * Fills this array or its subrange with the specified [element] value.\n * \n * @param fromIndex the start of the range (inclusive) to fill, 0 by default.\n * @param toIndex the end of the range (exclusive) to fill, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun LongArray.fill(element: Long, fromIndex: Int = 0, toIndex: Int = size): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n this.asDynamic().fill(element, fromIndex, toIndex);\n}\n\n/**\n * Fills this array or its subrange with the specified [element] value.\n * \n * @param fromIndex the start of the range (inclusive) to fill, 0 by default.\n * @param toIndex the end of the range (exclusive) to fill, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun FloatArray.fill(element: Float, fromIndex: Int = 0, toIndex: Int = size): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n this.asDynamic().fill(element, fromIndex, toIndex);\n}\n\n/**\n * Fills this array or its subrange with the specified [element] value.\n * \n * @param fromIndex the start of the range (inclusive) to fill, 0 by default.\n * @param toIndex the end of the range (exclusive) to fill, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun DoubleArray.fill(element: Double, fromIndex: Int = 0, toIndex: Int = size): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n this.asDynamic().fill(element, fromIndex, toIndex);\n}\n\n/**\n * Fills this array or its subrange with the specified [element] value.\n * \n * @param fromIndex the start of the range (inclusive) to fill, 0 by default.\n * @param toIndex the end of the range (exclusive) to fill, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun BooleanArray.fill(element: Boolean, fromIndex: Int = 0, toIndex: Int = size): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n this.asDynamic().fill(element, fromIndex, toIndex);\n}\n\n/**\n * Fills this array or its subrange with the specified [element] value.\n * \n * @param fromIndex the start of the range (inclusive) to fill, 0 by default.\n * @param toIndex the end of the range (exclusive) to fill, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun CharArray.fill(element: Char, fromIndex: Int = 0, toIndex: Int = size): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n this.asDynamic().fill(element, fromIndex, toIndex);\n}\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@Suppress(\"ACTUAL_WITHOUT_EXPECT\", \"NOTHING_TO_INLINE\")\npublic actual inline operator fun Array.plus(element: T): Array {\n return this.asDynamic().concat(arrayOf(element))\n}\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun ByteArray.plus(element: Byte): ByteArray {\n return plus(byteArrayOf(element))\n}\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun ShortArray.plus(element: Short): ShortArray {\n return plus(shortArrayOf(element))\n}\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun IntArray.plus(element: Int): IntArray {\n return plus(intArrayOf(element))\n}\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun LongArray.plus(element: Long): LongArray {\n return plus(longArrayOf(element))\n}\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun FloatArray.plus(element: Float): FloatArray {\n return plus(floatArrayOf(element))\n}\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun DoubleArray.plus(element: Double): DoubleArray {\n return plus(doubleArrayOf(element))\n}\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun BooleanArray.plus(element: Boolean): BooleanArray {\n return plus(booleanArrayOf(element))\n}\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun CharArray.plus(element: Char): CharArray {\n return plus(charArrayOf(element))\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\n@Suppress(\"ACTUAL_WITHOUT_EXPECT\")\npublic actual operator fun Array.plus(elements: Collection): Array {\n return arrayPlusCollection(this, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\npublic actual operator fun ByteArray.plus(elements: Collection): ByteArray {\n return fillFromCollection(this.copyOf(size + elements.size), this.size, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\npublic actual operator fun ShortArray.plus(elements: Collection): ShortArray {\n return fillFromCollection(this.copyOf(size + elements.size), this.size, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\npublic actual operator fun IntArray.plus(elements: Collection): IntArray {\n return fillFromCollection(this.copyOf(size + elements.size), this.size, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\npublic actual operator fun LongArray.plus(elements: Collection): LongArray {\n return arrayPlusCollection(this, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\npublic actual operator fun FloatArray.plus(elements: Collection): FloatArray {\n return fillFromCollection(this.copyOf(size + elements.size), this.size, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\npublic actual operator fun DoubleArray.plus(elements: Collection): DoubleArray {\n return fillFromCollection(this.copyOf(size + elements.size), this.size, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\npublic actual operator fun BooleanArray.plus(elements: Collection): BooleanArray {\n return arrayPlusCollection(this, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\npublic actual operator fun CharArray.plus(elements: Collection): CharArray {\n return fillFromCollection(this.copyOf(size + elements.size), this.size, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\n@Suppress(\"ACTUAL_WITHOUT_EXPECT\", \"NOTHING_TO_INLINE\")\npublic actual inline operator fun Array.plus(elements: Array): Array {\n return this.asDynamic().concat(elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun ByteArray.plus(elements: ByteArray): ByteArray {\n return primitiveArrayConcat(this, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun ShortArray.plus(elements: ShortArray): ShortArray {\n return primitiveArrayConcat(this, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun IntArray.plus(elements: IntArray): IntArray {\n return primitiveArrayConcat(this, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun LongArray.plus(elements: LongArray): LongArray {\n return primitiveArrayConcat(this, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun FloatArray.plus(elements: FloatArray): FloatArray {\n return primitiveArrayConcat(this, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun DoubleArray.plus(elements: DoubleArray): DoubleArray {\n return primitiveArrayConcat(this, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun BooleanArray.plus(elements: BooleanArray): BooleanArray {\n return primitiveArrayConcat(this, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline operator fun CharArray.plus(elements: CharArray): CharArray {\n return primitiveArrayConcat(this, elements)\n}\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@Suppress(\"ACTUAL_WITHOUT_EXPECT\", \"NOTHING_TO_INLINE\")\npublic actual inline fun Array.plusElement(element: T): Array {\n return this.asDynamic().concat(arrayOf(element))\n}\n\n/**\n * Sorts the array in-place.\n * \n * @sample samples.collections.Arrays.Sorting.sortArray\n */\n@library(\"primitiveArraySort\")\npublic actual fun IntArray.sort(): Unit {\n definedExternally\n}\n\n/**\n * Sorts the array in-place.\n * \n * @sample samples.collections.Arrays.Sorting.sortArray\n */\npublic actual fun LongArray.sort(): Unit {\n @Suppress(\"DEPRECATION\")\n if (size > 1) sort { a: Long, b: Long -> a.compareTo(b) }\n}\n\n/**\n * Sorts the array in-place.\n * \n * @sample samples.collections.Arrays.Sorting.sortArray\n */\n@library(\"primitiveArraySort\")\npublic actual fun ByteArray.sort(): Unit {\n definedExternally\n}\n\n/**\n * Sorts the array in-place.\n * \n * @sample samples.collections.Arrays.Sorting.sortArray\n */\n@library(\"primitiveArraySort\")\npublic actual fun ShortArray.sort(): Unit {\n definedExternally\n}\n\n/**\n * Sorts the array in-place.\n * \n * @sample samples.collections.Arrays.Sorting.sortArray\n */\n@library(\"primitiveArraySort\")\npublic actual fun DoubleArray.sort(): Unit {\n definedExternally\n}\n\n/**\n * Sorts the array in-place.\n * \n * @sample samples.collections.Arrays.Sorting.sortArray\n */\n@library(\"primitiveArraySort\")\npublic actual fun FloatArray.sort(): Unit {\n definedExternally\n}\n\n/**\n * Sorts the array in-place.\n * \n * @sample samples.collections.Arrays.Sorting.sortArray\n */\n@library(\"primitiveArraySort\")\npublic actual fun CharArray.sort(): Unit {\n definedExternally\n}\n\n/**\n * Sorts the array in-place according to the natural order of its elements.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n * \n * @sample samples.collections.Arrays.Sorting.sortArrayOfComparable\n */\npublic actual fun > Array.sort(): Unit {\n if (size > 1) sortArray(this)\n}\n\n/**\n * Sorts the array in-place according to the order specified by the given [comparison] function.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\n@Deprecated(\"Use sortWith instead\", ReplaceWith(\"this.sortWith(Comparator(comparison))\"))\n@DeprecatedSinceKotlin(warningSince = \"1.6\")\npublic fun Array.sort(comparison: (a: T, b: T) -> Int): Unit {\n if (size > 1) sortArrayWith(this, comparison)\n}\n\n/**\n * Sorts a range in the array in-place.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n * \n * @param fromIndex the start of the range (inclusive) to sort, 0 by default.\n * @param toIndex the end of the range (exclusive) to sort, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n * \n * @sample samples.collections.Arrays.Sorting.sortRangeOfArrayOfComparable\n */\n@SinceKotlin(\"1.4\")\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun > Array.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n sortArrayWith(this, fromIndex, toIndex, naturalOrder())\n}\n\n/**\n * Sorts a range in the array in-place.\n * \n * @param fromIndex the start of the range (inclusive) to sort, 0 by default.\n * @param toIndex the end of the range (exclusive) to sort, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n * \n * @sample samples.collections.Arrays.Sorting.sortRangeOfArray\n */\n@SinceKotlin(\"1.4\")\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun ByteArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n val subarray = this.asDynamic().subarray(fromIndex, toIndex).unsafeCast()\n subarray.sort()\n}\n\n/**\n * Sorts a range in the array in-place.\n * \n * @param fromIndex the start of the range (inclusive) to sort, 0 by default.\n * @param toIndex the end of the range (exclusive) to sort, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n * \n * @sample samples.collections.Arrays.Sorting.sortRangeOfArray\n */\n@SinceKotlin(\"1.4\")\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun ShortArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n val subarray = this.asDynamic().subarray(fromIndex, toIndex).unsafeCast()\n subarray.sort()\n}\n\n/**\n * Sorts a range in the array in-place.\n * \n * @param fromIndex the start of the range (inclusive) to sort, 0 by default.\n * @param toIndex the end of the range (exclusive) to sort, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n * \n * @sample samples.collections.Arrays.Sorting.sortRangeOfArray\n */\n@SinceKotlin(\"1.4\")\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun IntArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n val subarray = this.asDynamic().subarray(fromIndex, toIndex).unsafeCast()\n subarray.sort()\n}\n\n/**\n * Sorts a range in the array in-place.\n * \n * @param fromIndex the start of the range (inclusive) to sort, 0 by default.\n * @param toIndex the end of the range (exclusive) to sort, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n * \n * @sample samples.collections.Arrays.Sorting.sortRangeOfArray\n */\n@SinceKotlin(\"1.4\")\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun LongArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n sortArrayWith(this.unsafeCast>(), fromIndex, toIndex, naturalOrder())\n}\n\n/**\n * Sorts a range in the array in-place.\n * \n * @param fromIndex the start of the range (inclusive) to sort, 0 by default.\n * @param toIndex the end of the range (exclusive) to sort, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n * \n * @sample samples.collections.Arrays.Sorting.sortRangeOfArray\n */\n@SinceKotlin(\"1.4\")\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun FloatArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n val subarray = this.asDynamic().subarray(fromIndex, toIndex).unsafeCast()\n subarray.sort()\n}\n\n/**\n * Sorts a range in the array in-place.\n * \n * @param fromIndex the start of the range (inclusive) to sort, 0 by default.\n * @param toIndex the end of the range (exclusive) to sort, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n * \n * @sample samples.collections.Arrays.Sorting.sortRangeOfArray\n */\n@SinceKotlin(\"1.4\")\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun DoubleArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n val subarray = this.asDynamic().subarray(fromIndex, toIndex).unsafeCast()\n subarray.sort()\n}\n\n/**\n * Sorts a range in the array in-place.\n * \n * @param fromIndex the start of the range (inclusive) to sort, 0 by default.\n * @param toIndex the end of the range (exclusive) to sort, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n * \n * @sample samples.collections.Arrays.Sorting.sortRangeOfArray\n */\n@SinceKotlin(\"1.4\")\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun CharArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n val subarray = this.asDynamic().subarray(fromIndex, toIndex).unsafeCast()\n subarray.sort()\n}\n\n/**\n * Sorts the array in-place according to the order specified by the given [comparison] function.\n */\n@Deprecated(\"Use other sorting functions from the Standard Library\")\n@DeprecatedSinceKotlin(warningSince = \"1.6\")\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.sort(noinline comparison: (a: Byte, b: Byte) -> Int): Unit {\n asDynamic().sort(comparison)\n}\n\n/**\n * Sorts the array in-place according to the order specified by the given [comparison] function.\n */\n@Deprecated(\"Use other sorting functions from the Standard Library\")\n@DeprecatedSinceKotlin(warningSince = \"1.6\")\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.sort(noinline comparison: (a: Short, b: Short) -> Int): Unit {\n asDynamic().sort(comparison)\n}\n\n/**\n * Sorts the array in-place according to the order specified by the given [comparison] function.\n */\n@Deprecated(\"Use other sorting functions from the Standard Library\")\n@DeprecatedSinceKotlin(warningSince = \"1.6\")\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.sort(noinline comparison: (a: Int, b: Int) -> Int): Unit {\n asDynamic().sort(comparison)\n}\n\n/**\n * Sorts the array in-place according to the order specified by the given [comparison] function.\n */\n@Deprecated(\"Use other sorting functions from the Standard Library\")\n@DeprecatedSinceKotlin(warningSince = \"1.6\")\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.sort(noinline comparison: (a: Long, b: Long) -> Int): Unit {\n asDynamic().sort(comparison)\n}\n\n/**\n * Sorts the array in-place according to the order specified by the given [comparison] function.\n */\n@Deprecated(\"Use other sorting functions from the Standard Library\")\n@DeprecatedSinceKotlin(warningSince = \"1.6\")\n@kotlin.internal.InlineOnly\npublic inline fun FloatArray.sort(noinline comparison: (a: Float, b: Float) -> Int): Unit {\n asDynamic().sort(comparison)\n}\n\n/**\n * Sorts the array in-place according to the order specified by the given [comparison] function.\n */\n@Deprecated(\"Use other sorting functions from the Standard Library\")\n@DeprecatedSinceKotlin(warningSince = \"1.6\")\n@kotlin.internal.InlineOnly\npublic inline fun DoubleArray.sort(noinline comparison: (a: Double, b: Double) -> Int): Unit {\n asDynamic().sort(comparison)\n}\n\n/**\n * Sorts the array in-place according to the order specified by the given [comparison] function.\n */\n@Deprecated(\"Use other sorting functions from the Standard Library\")\n@DeprecatedSinceKotlin(warningSince = \"1.6\")\n@kotlin.internal.InlineOnly\npublic inline fun CharArray.sort(noinline comparison: (a: Char, b: Char) -> Int): Unit {\n asDynamic().sort(comparison)\n}\n\n/**\n * Sorts the array in-place according to the order specified by the given [comparator].\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic actual fun Array.sortWith(comparator: Comparator): Unit {\n if (size > 1) sortArrayWith(this, comparator)\n}\n\n/**\n * Sorts a range in the array in-place with the given [comparator].\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n * \n * @param fromIndex the start of the range (inclusive) to sort, 0 by default.\n * @param toIndex the end of the range (exclusive) to sort, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun Array.sortWith(comparator: Comparator, fromIndex: Int = 0, toIndex: Int = size): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n sortArrayWith(this, fromIndex, toIndex, comparator)\n}\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\npublic actual fun ByteArray.toTypedArray(): Array {\n return js(\"[]\").slice.call(this)\n}\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\npublic actual fun ShortArray.toTypedArray(): Array {\n return js(\"[]\").slice.call(this)\n}\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\npublic actual fun IntArray.toTypedArray(): Array {\n return js(\"[]\").slice.call(this)\n}\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\npublic actual fun LongArray.toTypedArray(): Array {\n return js(\"[]\").slice.call(this)\n}\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\npublic actual fun FloatArray.toTypedArray(): Array {\n return js(\"[]\").slice.call(this)\n}\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\npublic actual fun DoubleArray.toTypedArray(): Array {\n return js(\"[]\").slice.call(this)\n}\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\npublic actual fun BooleanArray.toTypedArray(): Array {\n return js(\"[]\").slice.call(this)\n}\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\npublic actual fun CharArray.toTypedArray(): Array {\n return Array(size) { index -> this[index] }\n}\n\n","/*\n * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.comparisons\n\n//\n// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt\n// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib\n//\n\nimport kotlin.js.*\n\n/**\n * Returns the greater of two values.\n * \n * If values are equal, returns the first one.\n */\n@SinceKotlin(\"1.1\")\npublic actual fun > maxOf(a: T, b: T): T {\n return if (a >= b) a else b\n}\n\n/**\n * Returns the greater of two values.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic actual inline fun maxOf(a: Byte, b: Byte): Byte {\n return maxOf(a.toInt(), b.toInt()).unsafeCast()\n}\n\n/**\n * Returns the greater of two values.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic actual inline fun maxOf(a: Short, b: Short): Short {\n return maxOf(a.toInt(), b.toInt()).unsafeCast()\n}\n\n/**\n * Returns the greater of two values.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic actual inline fun maxOf(a: Int, b: Int): Int {\n return JsMath.max(a, b)\n}\n\n/**\n * Returns the greater of two values.\n */\n@SinceKotlin(\"1.1\")\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline fun maxOf(a: Long, b: Long): Long {\n return if (a >= b) a else b\n}\n\n/**\n * Returns the greater of two values.\n * \n * If either value is `NaN`, returns `NaN`.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic actual inline fun maxOf(a: Float, b: Float): Float {\n return JsMath.max(a, b)\n}\n\n/**\n * Returns the greater of two values.\n * \n * If either value is `NaN`, returns `NaN`.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic actual inline fun maxOf(a: Double, b: Double): Double {\n return JsMath.max(a, b)\n}\n\n/**\n * Returns the greater of three values.\n * \n * If there are multiple equal maximal values, returns the first of them.\n */\n@SinceKotlin(\"1.1\")\npublic actual fun > maxOf(a: T, b: T, c: T): T {\n return maxOf(a, maxOf(b, c))\n}\n\n/**\n * Returns the greater of three values.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic actual inline fun maxOf(a: Byte, b: Byte, c: Byte): Byte {\n return JsMath.max(a.toInt(), b.toInt(), c.toInt()).unsafeCast()\n}\n\n/**\n * Returns the greater of three values.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic actual inline fun maxOf(a: Short, b: Short, c: Short): Short {\n return JsMath.max(a.toInt(), b.toInt(), c.toInt()).unsafeCast()\n}\n\n/**\n * Returns the greater of three values.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic actual inline fun maxOf(a: Int, b: Int, c: Int): Int {\n return JsMath.max(a, b, c)\n}\n\n/**\n * Returns the greater of three values.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic actual inline fun maxOf(a: Long, b: Long, c: Long): Long {\n return maxOf(a, maxOf(b, c))\n}\n\n/**\n * Returns the greater of three values.\n * \n * If any value is `NaN`, returns `NaN`.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic actual inline fun maxOf(a: Float, b: Float, c: Float): Float {\n return JsMath.max(a, b, c)\n}\n\n/**\n * Returns the greater of three values.\n * \n * If any value is `NaN`, returns `NaN`.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic actual inline fun maxOf(a: Double, b: Double, c: Double): Double {\n return JsMath.max(a, b, c)\n}\n\n/**\n * Returns the greater of the given values.\n * \n * If there are multiple equal maximal values, returns the first of them.\n */\n@SinceKotlin(\"1.4\")\npublic actual fun > maxOf(a: T, vararg other: T): T {\n var max = a\n for (e in other) max = maxOf(max, e)\n return max\n}\n\n/**\n * Returns the greater of the given values.\n */\n@SinceKotlin(\"1.4\")\npublic actual fun maxOf(a: Byte, vararg other: Byte): Byte {\n var max = a\n for (e in other) max = maxOf(max, e)\n return max\n}\n\n/**\n * Returns the greater of the given values.\n */\n@SinceKotlin(\"1.4\")\npublic actual fun maxOf(a: Short, vararg other: Short): Short {\n var max = a\n for (e in other) max = maxOf(max, e)\n return max\n}\n\n/**\n * Returns the greater of the given values.\n */\n@SinceKotlin(\"1.4\")\npublic actual fun maxOf(a: Int, vararg other: Int): Int {\n var max = a\n for (e in other) max = maxOf(max, e)\n return max\n}\n\n/**\n * Returns the greater of the given values.\n */\n@SinceKotlin(\"1.4\")\npublic actual fun maxOf(a: Long, vararg other: Long): Long {\n var max = a\n for (e in other) max = maxOf(max, e)\n return max\n}\n\n/**\n * Returns the greater of the given values.\n * \n * If any value is `NaN`, returns `NaN`.\n */\n@SinceKotlin(\"1.4\")\npublic actual fun maxOf(a: Float, vararg other: Float): Float {\n var max = a\n for (e in other) max = maxOf(max, e)\n return max\n}\n\n/**\n * Returns the greater of the given values.\n * \n * If any value is `NaN`, returns `NaN`.\n */\n@SinceKotlin(\"1.4\")\npublic actual fun maxOf(a: Double, vararg other: Double): Double {\n var max = a\n for (e in other) max = maxOf(max, e)\n return max\n}\n\n/**\n * Returns the smaller of two values.\n * \n * If values are equal, returns the first one.\n */\n@SinceKotlin(\"1.1\")\npublic actual fun > minOf(a: T, b: T): T {\n return if (a <= b) a else b\n}\n\n/**\n * Returns the smaller of two values.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic actual inline fun minOf(a: Byte, b: Byte): Byte {\n return minOf(a.toInt(), b.toInt()).unsafeCast()\n}\n\n/**\n * Returns the smaller of two values.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic actual inline fun minOf(a: Short, b: Short): Short {\n return minOf(a.toInt(), b.toInt()).unsafeCast()\n}\n\n/**\n * Returns the smaller of two values.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic actual inline fun minOf(a: Int, b: Int): Int {\n return JsMath.min(a, b)\n}\n\n/**\n * Returns the smaller of two values.\n */\n@SinceKotlin(\"1.1\")\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline fun minOf(a: Long, b: Long): Long {\n return if (a <= b) a else b\n}\n\n/**\n * Returns the smaller of two values.\n * \n * If either value is `NaN`, returns `NaN`.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic actual inline fun minOf(a: Float, b: Float): Float {\n return JsMath.min(a, b)\n}\n\n/**\n * Returns the smaller of two values.\n * \n * If either value is `NaN`, returns `NaN`.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic actual inline fun minOf(a: Double, b: Double): Double {\n return JsMath.min(a, b)\n}\n\n/**\n * Returns the smaller of three values.\n * \n * If there are multiple equal minimal values, returns the first of them.\n */\n@SinceKotlin(\"1.1\")\npublic actual fun > minOf(a: T, b: T, c: T): T {\n return minOf(a, minOf(b, c))\n}\n\n/**\n * Returns the smaller of three values.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic actual inline fun minOf(a: Byte, b: Byte, c: Byte): Byte {\n return JsMath.min(a.toInt(), b.toInt(), c.toInt()).unsafeCast()\n}\n\n/**\n * Returns the smaller of three values.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic actual inline fun minOf(a: Short, b: Short, c: Short): Short {\n return JsMath.min(a.toInt(), b.toInt(), c.toInt()).unsafeCast()\n}\n\n/**\n * Returns the smaller of three values.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic actual inline fun minOf(a: Int, b: Int, c: Int): Int {\n return JsMath.min(a, b, c)\n}\n\n/**\n * Returns the smaller of three values.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic actual inline fun minOf(a: Long, b: Long, c: Long): Long {\n return minOf(a, minOf(b, c))\n}\n\n/**\n * Returns the smaller of three values.\n * \n * If any value is `NaN`, returns `NaN`.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic actual inline fun minOf(a: Float, b: Float, c: Float): Float {\n return JsMath.min(a, b, c)\n}\n\n/**\n * Returns the smaller of three values.\n * \n * If any value is `NaN`, returns `NaN`.\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic actual inline fun minOf(a: Double, b: Double, c: Double): Double {\n return JsMath.min(a, b, c)\n}\n\n/**\n * Returns the smaller of the given values.\n * \n * If there are multiple equal minimal values, returns the first of them.\n */\n@SinceKotlin(\"1.4\")\npublic actual fun > minOf(a: T, vararg other: T): T {\n var min = a\n for (e in other) min = minOf(min, e)\n return min\n}\n\n/**\n * Returns the smaller of the given values.\n */\n@SinceKotlin(\"1.4\")\npublic actual fun minOf(a: Byte, vararg other: Byte): Byte {\n var min = a\n for (e in other) min = minOf(min, e)\n return min\n}\n\n/**\n * Returns the smaller of the given values.\n */\n@SinceKotlin(\"1.4\")\npublic actual fun minOf(a: Short, vararg other: Short): Short {\n var min = a\n for (e in other) min = minOf(min, e)\n return min\n}\n\n/**\n * Returns the smaller of the given values.\n */\n@SinceKotlin(\"1.4\")\npublic actual fun minOf(a: Int, vararg other: Int): Int {\n var min = a\n for (e in other) min = minOf(min, e)\n return min\n}\n\n/**\n * Returns the smaller of the given values.\n */\n@SinceKotlin(\"1.4\")\npublic actual fun minOf(a: Long, vararg other: Long): Long {\n var min = a\n for (e in other) min = minOf(min, e)\n return min\n}\n\n/**\n * Returns the smaller of the given values.\n * \n * If any value is `NaN`, returns `NaN`.\n */\n@SinceKotlin(\"1.4\")\npublic actual fun minOf(a: Float, vararg other: Float): Float {\n var min = a\n for (e in other) min = minOf(min, e)\n return min\n}\n\n/**\n * Returns the smaller of the given values.\n * \n * If any value is `NaN`, returns `NaN`.\n */\n@SinceKotlin(\"1.4\")\npublic actual fun minOf(a: Double, vararg other: Double): Double {\n var min = a\n for (e in other) min = minOf(min, e)\n return min\n}\n\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.text\n\n//\n// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateUnicodeData.kt\n// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib\n//\n\n// 37 ranges totally\nprivate object Digit {\n internal val rangeStart = intArrayOf(\n 0x0030, 0x0660, 0x06f0, 0x07c0, 0x0966, 0x09e6, 0x0a66, 0x0ae6, 0x0b66, 0x0be6, 0x0c66, 0x0ce6, 0x0d66, 0x0de6, 0x0e50, 0x0ed0, 0x0f20, 0x1040, 0x1090, 0x17e0, \n 0x1810, 0x1946, 0x19d0, 0x1a80, 0x1a90, 0x1b50, 0x1bb0, 0x1c40, 0x1c50, 0xa620, 0xa8d0, 0xa900, 0xa9d0, 0xa9f0, 0xaa50, 0xabf0, 0xff10, \n )\n}\n\n/**\n * Returns the index of the largest element in [array] smaller or equal to the specified [needle],\n * or -1 if [needle] is smaller than the smallest element in [array].\n */\ninternal fun binarySearchRange(array: IntArray, needle: Int): Int {\n var bottom = 0\n var top = array.size - 1\n var middle = -1\n var value = 0\n while (bottom <= top) {\n middle = (bottom + top) / 2\n value = array[middle]\n if (needle > value)\n bottom = middle + 1\n else if (needle == value)\n return middle\n else\n top = middle - 1\n }\n return middle - (if (needle < value) 1 else 0)\n}\n\n/**\n * Returns an integer from 0..9 indicating the digit this character represents,\n * or -1 if this character is not a digit.\n */\ninternal fun Char.digitToIntImpl(): Int {\n val ch = this.code\n val index = binarySearchRange(Digit.rangeStart, ch)\n val diff = ch - Digit.rangeStart[index]\n return if (diff < 10) diff else -1\n}\n\n/**\n * Returns `true` if this character is a digit.\n */\ninternal fun Char.isDigitImpl(): Boolean {\n return digitToIntImpl() >= 0\n}\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.text\n\n//\n// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateUnicodeData.kt\n// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib\n//\n\n// 9 ranges totally\n/**\n * Returns `true` if this character is a whitespace.\n */\ninternal fun Char.isWhitespaceImpl(): Boolean {\n val ch = this.code\n return ch in 0x0009..0x000d\n || ch in 0x001c..0x0020\n || ch == 0x00a0\n || ch > 0x1000 && (\n ch == 0x1680\n || ch in 0x2000..0x200a\n || ch == 0x2028\n || ch == 0x2029\n || ch == 0x202f\n || ch == 0x205f\n || ch == 0x3000\n )\n}\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin\n\n\n/**\n * Creates a Char with the specified [code], or throws an exception if the [code] is out of `Char.MIN_VALUE.code..Char.MAX_VALUE.code`.\n *\n * If the program that calls this function is written in a way that only valid [code] is passed as the argument,\n * using the overload that takes a [UShort] argument is preferable (`Char(intValue.toUShort())`).\n * That overload doesn't check validity of the argument, and may improve program performance when the function is called routinely inside a loop.\n *\n * @sample samples.text.Chars.charFromCode\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun Char(code: Int): Char {\n if (code < Char.MIN_VALUE.code || code > Char.MAX_VALUE.code) {\n throw IllegalArgumentException(\"Invalid Char code: $code\")\n }\n return code.toChar()\n}\n\n/**\n * Creates a Char with the specified [code].\n *\n * @sample samples.text.Chars.charFromCode\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@Suppress(\"NO_ACTUAL_FOR_EXPECT\")\npublic expect fun Char(code: UShort): Char\n\n/**\n * Returns the code of this Char.\n *\n * Code of a Char is the value it was constructed with, and the UTF-16 code unit corresponding to this Char.\n *\n * @sample samples.text.Chars.code\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\n@Suppress(\"DEPRECATION\")\npublic inline val Char.code: Int get() = this.toInt()\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.collections\n\nimport kotlin.comparisons.naturalOrder\nimport kotlin.random.Random\n\n/**\n * Returns the array if it's not `null`, or an empty array otherwise.\n * @sample samples.collections.Arrays.Usage.arrayOrEmpty\n */\n@kotlin.internal.InlineOnly\npublic actual inline fun Array?.orEmpty(): Array = this ?: emptyArray()\n\n/**\n * Returns a *typed* array containing all of the elements of this collection.\n *\n * Allocates an array of runtime type `T` having its size equal to the size of this collection\n * and populates the array with the elements of this collection.\n * @sample samples.collections.Collections.Collections.collectionToTypedArray\n */\n@kotlin.internal.InlineOnly\npublic actual inline fun Collection.toTypedArray(): Array = copyToArray(this)\n\n@JsName(\"copyToArray\")\n@PublishedApi\ninternal fun copyToArray(collection: Collection): Array {\n return if (collection.asDynamic().toArray !== undefined)\n collection.asDynamic().toArray().unsafeCast>()\n else\n copyToArrayImpl(collection).unsafeCast>()\n}\n\n@JsName(\"copyToArrayImpl\")\ninternal actual fun copyToArrayImpl(collection: Collection<*>): Array {\n val array = emptyArray()\n val iterator = collection.iterator()\n while (iterator.hasNext())\n array.asDynamic().push(iterator.next())\n return array\n}\n\n@JsName(\"copyToExistingArrayImpl\")\ninternal actual fun copyToArrayImpl(collection: Collection<*>, array: Array): Array {\n if (array.size < collection.size)\n return copyToArrayImpl(collection).unsafeCast>()\n\n val iterator = collection.iterator()\n var index = 0\n while (iterator.hasNext()) {\n array[index++] = iterator.next().unsafeCast()\n }\n if (index < array.size) {\n array[index] = null.unsafeCast()\n }\n return array\n}\n\n\n/**\n * Returns an immutable list containing only the specified object [element].\n */\npublic fun listOf(element: T): List = arrayListOf(element)\n\n@PublishedApi\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\ninternal actual inline fun buildListInternal(builderAction: MutableList.() -> Unit): List {\n return ArrayList().apply(builderAction).build()\n}\n\n@PublishedApi\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\ninternal actual inline fun buildListInternal(capacity: Int, builderAction: MutableList.() -> Unit): List {\n checkBuilderCapacity(capacity)\n return ArrayList(capacity).apply(builderAction).build()\n}\n\n\n/**\n * Returns an immutable set containing only the specified object [element].\n */\npublic fun setOf(element: T): Set = hashSetOf(element)\n\n@PublishedApi\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\ninternal actual inline fun buildSetInternal(builderAction: MutableSet.() -> Unit): Set {\n return LinkedHashSet().apply(builderAction).build()\n}\n\n@PublishedApi\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\ninternal actual inline fun buildSetInternal(capacity: Int, builderAction: MutableSet.() -> Unit): Set {\n return LinkedHashSet(capacity).apply(builderAction).build()\n}\n\n\n/**\n * Returns an immutable map, mapping only the specified key to the\n * specified value.\n */\npublic fun mapOf(pair: Pair): Map = hashMapOf(pair)\n\n@PublishedApi\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\ninternal actual inline fun buildMapInternal(builderAction: MutableMap.() -> Unit): Map {\n return LinkedHashMap().apply(builderAction).build()\n}\n\n@PublishedApi\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\ninternal actual inline fun buildMapInternal(capacity: Int, builderAction: MutableMap.() -> Unit): Map {\n return LinkedHashMap(capacity).apply(builderAction).build()\n}\n\n\n/**\n * Fills the list with the provided [value].\n *\n * Each element in the list gets replaced with the [value].\n */\n@SinceKotlin(\"1.2\")\npublic actual fun MutableList.fill(value: T): Unit {\n for (index in 0..lastIndex) {\n this[index] = value\n }\n}\n\n/**\n * Randomly shuffles elements in this list.\n *\n * See: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm\n */\n@SinceKotlin(\"1.2\")\npublic actual fun MutableList.shuffle(): Unit = shuffle(Random)\n\n/**\n * Returns a new list with the elements of this list randomly shuffled.\n */\n@SinceKotlin(\"1.2\")\npublic actual fun Iterable.shuffled(): List = toMutableList().apply { shuffle() }\n\n/**\n * Sorts elements in the list in-place according to their natural sort order.\n *\n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n *\n * @sample samples.collections.Collections.Sorting.sortMutableList\n */\npublic actual fun > MutableList.sort(): Unit {\n collectionsSort(this, naturalOrder())\n}\n\n/**\n * Sorts elements in the list in-place according to the order specified with [comparator].\n *\n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n *\n * @sample samples.collections.Collections.Sorting.sortMutableListWith\n */\npublic actual fun MutableList.sortWith(comparator: Comparator): Unit {\n collectionsSort(this, comparator)\n}\n\nprivate fun collectionsSort(list: MutableList, comparator: Comparator) {\n if (list.size <= 1) return\n\n val array = copyToArray(list)\n sortArrayWith(array, comparator)\n\n for (i in 0 until array.size) {\n list[i] = array[i]\n }\n}\n\ninternal actual fun arrayOfNulls(reference: Array, size: Int): Array {\n return arrayOfNulls(size).unsafeCast>()\n}\n\n@SinceKotlin(\"1.3\")\n@PublishedApi\n@JsName(\"arrayCopy\")\ninternal fun arrayCopy(source: Array, destination: Array, destinationOffset: Int, startIndex: Int, endIndex: Int) {\n AbstractList.checkRangeIndexes(startIndex, endIndex, source.size)\n val rangeSize = endIndex - startIndex\n AbstractList.checkRangeIndexes(destinationOffset, destinationOffset + rangeSize, destination.size)\n\n if (js(\"ArrayBuffer\").isView(destination) && js(\"ArrayBuffer\").isView(source)) {\n val subrange = source.asDynamic().subarray(startIndex, endIndex)\n destination.asDynamic().set(subrange, destinationOffset)\n } else {\n if (source !== destination || destinationOffset <= startIndex) {\n for (index in 0 until rangeSize) {\n destination[destinationOffset + index] = source[startIndex + index]\n }\n } else {\n for (index in rangeSize - 1 downTo 0) {\n destination[destinationOffset + index] = source[startIndex + index]\n }\n }\n }\n}\n\n// no singleton map implementation in js, return map as is\n@Suppress(\"NOTHING_TO_INLINE\")\ninternal actual inline fun Map.toSingletonMapOrSelf(): Map = this\n\n@Suppress(\"NOTHING_TO_INLINE\")\ninternal actual inline fun Map.toSingletonMap(): Map = this.toMutableMap()\n\n\n@Suppress(\"NOTHING_TO_INLINE\")\ninternal actual inline fun Array.copyToArrayOfAny(isVarargs: Boolean): Array =\n if (isVarargs)\n // no need to copy vararg array in JS\n this\n else\n this.copyOf()\n\n\n\n@PublishedApi\ninternal actual fun checkIndexOverflow(index: Int): Int {\n if (index < 0) {\n throwIndexOverflow()\n }\n return index\n}\n\n@PublishedApi\ninternal actual fun checkCountOverflow(count: Int): Int {\n if (count < 0) {\n throwCountOverflow()\n }\n return count\n}\n\n\n/**\n * JS map and set implementations do not make use of capacities or load factors.\n */\n@PublishedApi\ninternal actual fun mapCapacity(expectedSize: Int) = expectedSize\n\n/**\n * Checks a collection builder function capacity argument.\n * In JS no validation is made in Map/Set constructor yet.\n */\n@SinceKotlin(\"1.3\")\n@PublishedApi\ninternal fun checkBuilderCapacity(capacity: Int) {\n require(capacity >= 0) { \"capacity must be non-negative.\" }\n}\n\ninternal actual fun brittleContainsOptimizationEnabled(): Boolean = false","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.collections\n\n/**\n * Provides a skeletal implementation of the [MutableCollection] interface.\n *\n * @param E the type of elements contained in the collection. The collection is invariant in its element type.\n */\npublic actual abstract class AbstractMutableCollection protected actual constructor() : AbstractCollection(), MutableCollection {\n\n actual abstract override fun add(element: E): Boolean\n\n actual override fun remove(element: E): Boolean {\n checkIsMutable()\n val iterator = iterator()\n while (iterator.hasNext()) {\n if (iterator.next() == element) {\n iterator.remove()\n return true\n }\n }\n return false\n }\n\n actual override fun addAll(elements: Collection): Boolean {\n checkIsMutable()\n var modified = false\n for (element in elements) {\n if (add(element)) modified = true\n }\n return modified\n }\n\n actual override fun removeAll(elements: Collection): Boolean {\n checkIsMutable()\n return (this as MutableIterable).removeAll { it in elements }\n }\n\n actual override fun retainAll(elements: Collection): Boolean {\n checkIsMutable()\n return (this as MutableIterable).removeAll { it !in elements }\n }\n\n actual override fun clear(): Unit {\n checkIsMutable()\n val iterator = this.iterator()\n while (iterator.hasNext()) {\n iterator.next()\n iterator.remove()\n }\n }\n\n @Deprecated(\"Provided so that subclasses inherit this function\", level = DeprecationLevel.HIDDEN)\n @JsName(\"toJSON\")\n protected fun toJSON(): Any = this.toArray()\n\n\n /**\n * This method is called every time when a mutating method is called on this mutable collection.\n * Mutable collections that are built (frozen) must throw `UnsupportedOperationException`.\n */\n internal open fun checkIsMutable(): Unit { }\n}\n\n","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n/*\n * Based on GWT AbstractList\n * Copyright 2007 Google Inc.\n*/\n\n\npackage kotlin.collections\n\n/**\n * Provides a skeletal implementation of the [MutableList] interface.\n *\n * @param E the type of elements contained in the list. The list is invariant in its element type.\n */\npublic actual abstract class AbstractMutableList protected actual constructor() : AbstractMutableCollection(), MutableList {\n protected var modCount: Int = 0\n\n abstract override fun add(index: Int, element: E): Unit\n abstract override fun removeAt(index: Int): E\n abstract override fun set(index: Int, element: E): E\n\n /**\n * Adds the specified element to the end of this list.\n *\n * @return `true` because the list is always modified as the result of this operation.\n */\n actual override fun add(element: E): Boolean {\n checkIsMutable()\n add(size, element)\n return true\n }\n\n actual override fun addAll(index: Int, elements: Collection): Boolean {\n AbstractList.checkPositionIndex(index, size)\n\n checkIsMutable()\n var _index = index\n var changed = false\n for (e in elements) {\n add(_index++, e)\n changed = true\n }\n return changed\n }\n\n actual override fun clear() {\n checkIsMutable()\n removeRange(0, size)\n }\n\n actual override fun removeAll(elements: Collection): Boolean {\n checkIsMutable()\n return removeAll { it in elements }\n }\n\n actual override fun retainAll(elements: Collection): Boolean {\n checkIsMutable()\n return removeAll { it !in elements }\n }\n\n\n actual override fun iterator(): MutableIterator = IteratorImpl()\n\n actual override fun contains(element: E): Boolean = indexOf(element) >= 0\n\n actual override fun indexOf(element: E): Int {\n for (index in 0..lastIndex) {\n if (get(index) == element) {\n return index\n }\n }\n return -1\n }\n\n actual override fun lastIndexOf(element: E): Int {\n for (index in lastIndex downTo 0) {\n if (get(index) == element) {\n return index\n }\n }\n return -1\n }\n\n actual override fun listIterator(): MutableListIterator = listIterator(0)\n actual override fun listIterator(index: Int): MutableListIterator = ListIteratorImpl(index)\n\n\n actual override fun subList(fromIndex: Int, toIndex: Int): MutableList = SubList(this, fromIndex, toIndex)\n\n /**\n * Removes the range of elements from this list starting from [fromIndex] and ending with but not including [toIndex].\n */\n protected open fun removeRange(fromIndex: Int, toIndex: Int) {\n val iterator = listIterator(fromIndex)\n repeat(toIndex - fromIndex) {\n iterator.next()\n iterator.remove()\n }\n }\n\n /**\n * Compares this list with another list instance with the ordered structural equality.\n *\n * @return true, if [other] instance is a [List] of the same size, which contains the same elements in the same order.\n */\n override fun equals(other: Any?): Boolean {\n if (other === this) return true\n if (other !is List<*>) return false\n\n return AbstractList.orderedEquals(this, other)\n }\n\n /**\n * Returns the hash code value for this list.\n */\n override fun hashCode(): Int = AbstractList.orderedHashCode(this)\n\n\n private open inner class IteratorImpl : MutableIterator {\n /** the index of the item that will be returned on the next call to [next]`()` */\n protected var index = 0\n /** the index of the item that was returned on the previous call to [next]`()`\n * or [ListIterator.previous]`()` (for `ListIterator`),\n * -1 if no such item exists\n */\n protected var last = -1\n\n override fun hasNext(): Boolean = index < size\n\n override fun next(): E {\n if (!hasNext()) throw NoSuchElementException()\n last = index++\n return get(last)\n }\n\n override fun remove() {\n check(last != -1) { \"Call next() or previous() before removing element from the iterator.\" }\n\n removeAt(last)\n index = last\n last = -1\n }\n }\n\n /**\n * Implementation of `MutableListIterator` for abstract lists.\n */\n private inner class ListIteratorImpl(index: Int) : IteratorImpl(), MutableListIterator {\n\n init {\n AbstractList.checkPositionIndex(index, this@AbstractMutableList.size)\n this.index = index\n }\n\n override fun hasPrevious(): Boolean = index > 0\n\n override fun nextIndex(): Int = index\n\n override fun previous(): E {\n if (!hasPrevious()) throw NoSuchElementException()\n\n last = --index\n return get(last)\n }\n\n override fun previousIndex(): Int = index - 1\n\n override fun add(element: E) {\n add(index, element)\n index++\n last = -1\n }\n\n override fun set(element: E) {\n check(last != -1) { \"Call next() or previous() before updating element value with the iterator.\" }\n set(last, element)\n }\n }\n\n private class SubList(private val list: AbstractMutableList, private val fromIndex: Int, toIndex: Int) : AbstractMutableList(), RandomAccess {\n private var _size: Int = 0\n\n init {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, list.size)\n this._size = toIndex - fromIndex\n }\n\n override fun add(index: Int, element: E) {\n AbstractList.checkPositionIndex(index, _size)\n\n list.add(fromIndex + index, element)\n _size++\n }\n\n override fun get(index: Int): E {\n AbstractList.checkElementIndex(index, _size)\n\n return list[fromIndex + index]\n }\n\n override fun removeAt(index: Int): E {\n AbstractList.checkElementIndex(index, _size)\n\n val result = list.removeAt(fromIndex + index)\n _size--\n return result\n }\n\n override fun set(index: Int, element: E): E {\n AbstractList.checkElementIndex(index, _size)\n\n return list.set(fromIndex + index, element)\n }\n\n override val size: Int get() = _size\n\n internal override fun checkIsMutable(): Unit = list.checkIsMutable()\n }\n\n}\n","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n/*\n * Based on GWT AbstractMap\n * Copyright 2007 Google Inc.\n */\n\npackage kotlin.collections\n\n/**\n * Provides a skeletal implementation of the [MutableMap] interface.\n *\n * The implementor is required to implement [entries] property, which should return mutable set of map entries, and [put] function.\n *\n * @param K the type of map keys. The map is invariant in its key type.\n * @param V the type of map values. The map is invariant in its value type.\n */\npublic actual abstract class AbstractMutableMap protected actual constructor() : AbstractMap(), MutableMap {\n\n /**\n * A mutable [Map.Entry] shared by several [Map] implementations.\n */\n internal open class SimpleEntry(override val key: K, value: V) : MutableMap.MutableEntry {\n constructor(entry: Map.Entry) : this(entry.key, entry.value)\n\n private var _value = value\n\n override val value: V get() = _value\n\n override fun setValue(newValue: V): V {\n // Should check if the map containing this entry is mutable.\n // However, to not increase entry memory footprint it might be worthwhile not to check it here and\n // force subclasses that implement `build()` (freezing) operation to implement their own `MutableEntry`.\n// this@AbstractMutableMap.checkIsMutable()\n val oldValue = this._value\n this._value = newValue\n return oldValue\n }\n\n override fun hashCode(): Int = entryHashCode(this)\n override fun toString(): String = entryToString(this)\n override fun equals(other: Any?): Boolean = entryEquals(this, other)\n\n }\n\n // intermediate abstract class to workaround KT-43321\n internal abstract class AbstractEntrySet, K, V> : AbstractMutableSet() {\n final override fun contains(element: E): Boolean = containsEntry(element)\n abstract fun containsEntry(element: Map.Entry): Boolean\n final override fun remove(element: E): Boolean = removeEntry(element)\n abstract fun removeEntry(element: Map.Entry): Boolean\n }\n\n actual override fun clear() {\n entries.clear()\n }\n\n private var _keys: MutableSet? = null\n actual override val keys: MutableSet\n get() {\n if (_keys == null) {\n _keys = object : AbstractMutableSet() {\n override fun add(element: K): Boolean = throw UnsupportedOperationException(\"Add is not supported on keys\")\n override fun clear() {\n this@AbstractMutableMap.clear()\n }\n\n override operator fun contains(element: K): Boolean = containsKey(element)\n\n override operator fun iterator(): MutableIterator {\n val entryIterator = entries.iterator()\n return object : MutableIterator {\n override fun hasNext(): Boolean = entryIterator.hasNext()\n override fun next(): K = entryIterator.next().key\n override fun remove() = entryIterator.remove()\n }\n }\n\n override fun remove(element: K): Boolean {\n checkIsMutable()\n if (containsKey(element)) {\n this@AbstractMutableMap.remove(element)\n return true\n }\n return false\n }\n\n override val size: Int get() = this@AbstractMutableMap.size\n\n override fun checkIsMutable(): Unit = this@AbstractMutableMap.checkIsMutable()\n }\n }\n return _keys!!\n }\n\n actual abstract override fun put(key: K, value: V): V?\n\n actual override fun putAll(from: Map) {\n checkIsMutable()\n for ((key, value) in from) {\n put(key, value)\n }\n }\n\n private var _values: MutableCollection? = null\n actual override val values: MutableCollection\n get() {\n if (_values == null) {\n _values = object : AbstractMutableCollection() {\n override fun add(element: V): Boolean = throw UnsupportedOperationException(\"Add is not supported on values\")\n override fun clear() = this@AbstractMutableMap.clear()\n\n override operator fun contains(element: V): Boolean = containsValue(element)\n\n override operator fun iterator(): MutableIterator {\n val entryIterator = entries.iterator()\n return object : MutableIterator {\n override fun hasNext(): Boolean = entryIterator.hasNext()\n override fun next(): V = entryIterator.next().value\n override fun remove() = entryIterator.remove()\n }\n }\n\n override val size: Int get() = this@AbstractMutableMap.size\n\n override fun checkIsMutable(): Unit = this@AbstractMutableMap.checkIsMutable()\n }\n }\n return _values!!\n }\n\n actual override fun remove(key: K): V? {\n checkIsMutable()\n val iter = entries.iterator()\n while (iter.hasNext()) {\n val entry = iter.next()\n val k = entry.key\n if (key == k) {\n val value = entry.value\n iter.remove()\n return value\n }\n }\n return null\n }\n\n\n /**\n * This method is called every time when a mutating method is called on this mutable map.\n * Mutable maps that are built (frozen) must throw `UnsupportedOperationException`.\n */\n internal open fun checkIsMutable(): Unit {}\n}\n","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\npackage kotlin.collections\n\n/**\n * Provides a skeletal implementation of the [MutableSet] interface.\n *\n * @param E the type of elements contained in the set. The set is invariant in its element type.\n */\npublic actual abstract class AbstractMutableSet protected actual constructor() : AbstractMutableCollection(), MutableSet {\n\n /**\n * Compares this set with another set instance with the unordered structural equality.\n *\n * @return `true`, if [other] instance is a [Set] of the same size, all elements of which are contained in this set.\n */\n override fun equals(other: Any?): Boolean {\n if (other === this) return true\n if (other !is Set<*>) return false\n return AbstractSet.setEquals(this, other)\n }\n\n /**\n * Returns the hash code value for this set.\n */\n override fun hashCode(): Int = AbstractSet.unorderedHashCode(this)\n\n}","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.collections\n\n/**\n * Provides a [MutableList] implementation, which uses a resizable array as its backing storage.\n *\n * This implementation doesn't provide a way to manage capacity, as backing JS array is resizeable itself.\n * There is no speed advantage to pre-allocating array sizes in JavaScript, so this implementation does not include any of the\n * capacity and \"growth increment\" concepts.\n */\npublic actual open class ArrayList internal constructor(private var array: Array) : AbstractMutableList(), MutableList, RandomAccess {\n private var isReadOnly: Boolean = false\n\n /**\n * Creates an empty [ArrayList].\n */\n public actual constructor() : this(emptyArray()) {}\n\n /**\n * Creates an empty [ArrayList].\n * @param initialCapacity initial capacity (ignored)\n */\n public actual constructor(initialCapacity: Int) : this(emptyArray()) {}\n\n /**\n * Creates an [ArrayList] filled from the [elements] collection.\n */\n public actual constructor(elements: Collection) : this(elements.toTypedArray()) {}\n\n @PublishedApi\n internal fun build(): List {\n checkIsMutable()\n isReadOnly = true\n return this\n }\n\n /** Does nothing in this ArrayList implementation. */\n public actual fun trimToSize() {}\n\n /** Does nothing in this ArrayList implementation. */\n public actual fun ensureCapacity(minCapacity: Int) {}\n\n actual override val size: Int get() = array.size\n @Suppress(\"UNCHECKED_CAST\")\n actual override fun get(index: Int): E = array[rangeCheck(index)] as E\n actual override fun set(index: Int, element: E): E {\n checkIsMutable()\n rangeCheck(index)\n @Suppress(\"UNCHECKED_CAST\")\n return array[index].apply { array[index] = element } as E\n }\n\n actual override fun add(element: E): Boolean {\n checkIsMutable()\n array.asDynamic().push(element)\n modCount++\n return true\n }\n\n actual override fun add(index: Int, element: E): Unit {\n checkIsMutable()\n array.asDynamic().splice(insertionRangeCheck(index), 0, element)\n modCount++\n }\n\n actual override fun addAll(elements: Collection): Boolean {\n checkIsMutable()\n if (elements.isEmpty()) return false\n\n array += elements.toTypedArray()\n modCount++\n return true\n }\n\n actual override fun addAll(index: Int, elements: Collection): Boolean {\n checkIsMutable()\n insertionRangeCheck(index)\n\n if (index == size) return addAll(elements)\n if (elements.isEmpty()) return false\n when (index) {\n size -> return addAll(elements)\n 0 -> array = elements.toTypedArray() + array\n else -> array = array.copyOfRange(0, index).asDynamic().concat(elements.toTypedArray(), array.copyOfRange(index, size))\n }\n\n modCount++\n return true\n }\n\n actual override fun removeAt(index: Int): E {\n checkIsMutable()\n rangeCheck(index)\n modCount++\n return if (index == lastIndex)\n array.asDynamic().pop()\n else\n array.asDynamic().splice(index, 1)[0]\n }\n\n actual override fun remove(element: E): Boolean {\n checkIsMutable()\n for (index in array.indices) {\n if (array[index] == element) {\n array.asDynamic().splice(index, 1)\n modCount++\n return true\n }\n }\n return false\n }\n\n override fun removeRange(fromIndex: Int, toIndex: Int) {\n checkIsMutable()\n modCount++\n array.asDynamic().splice(fromIndex, toIndex - fromIndex)\n }\n\n actual override fun clear() {\n checkIsMutable()\n array = emptyArray()\n modCount++\n }\n\n\n actual override fun indexOf(element: E): Int = array.indexOf(element)\n\n actual override fun lastIndexOf(element: E): Int = array.lastIndexOf(element)\n\n override fun toString() = arrayToString(array)\n\n @Suppress(\"UNCHECKED_CAST\")\n override fun toArray(array: Array): Array {\n if (array.size < size) {\n return toArray() as Array\n }\n\n (this.array as Array).copyInto(array)\n\n if (array.size > size) {\n array[size] = null as T // null-terminate\n }\n\n return array\n }\n\n override fun toArray(): Array {\n return js(\"[]\").slice.call(array)\n }\n\n\n internal override fun checkIsMutable() {\n if (isReadOnly) throw UnsupportedOperationException()\n }\n\n private fun rangeCheck(index: Int) = index.apply {\n AbstractList.checkElementIndex(index, size)\n }\n\n private fun insertionRangeCheck(index: Int) = index.apply {\n AbstractList.checkPositionIndex(index, size)\n }\n}","/*\n * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.collections\n\ninternal fun sortArrayWith(array: Array, comparison: (T, T) -> Int) {\n if (getStableSortingIsSupported()) {\n array.asDynamic().sort(comparison)\n } else {\n mergeSort(array.unsafeCast>(), 0, array.lastIndex, Comparator(comparison))\n }\n}\n\ninternal fun sortArrayWith(array: Array, comparator: Comparator) {\n if (getStableSortingIsSupported()) {\n val comparison = { a: T, b: T -> comparator.compare(a, b) }\n array.asDynamic().sort(comparison)\n } else {\n mergeSort(array.unsafeCast>(), 0, array.lastIndex, comparator)\n }\n}\n\ninternal fun sortArrayWith(array: Array, fromIndex: Int, toIndex: Int, comparator: Comparator) {\n if (fromIndex < toIndex - 1) {\n mergeSort(array.unsafeCast>(), fromIndex, toIndex - 1, comparator)\n }\n}\n\ninternal fun > sortArray(array: Array) {\n if (getStableSortingIsSupported()) {\n val comparison = { a: T, b: T -> a.compareTo(b) }\n array.asDynamic().sort(comparison)\n } else {\n mergeSort(array.unsafeCast>(), 0, array.lastIndex, naturalOrder())\n }\n}\n\nprivate var _stableSortingIsSupported: Boolean? = null\nprivate fun getStableSortingIsSupported(): Boolean {\n _stableSortingIsSupported?.let { return it }\n _stableSortingIsSupported = false\n\n val array = js(\"[]\").unsafeCast>()\n // known implementations may use stable sort for arrays of up to 512 elements\n // so we create slightly more elements to test stability\n for (index in 0 until 600) array.asDynamic().push(index)\n val comparison = { a: Int, b: Int -> (a and 3) - (b and 3) }\n array.asDynamic().sort(comparison)\n for (index in 1 until array.size) {\n val a = array[index - 1]\n val b = array[index]\n if ((a and 3) == (b and 3) && a >= b) return false\n }\n _stableSortingIsSupported = true\n return true\n}\n\n\nprivate fun mergeSort(array: Array, start: Int, endInclusive: Int, comparator: Comparator) {\n val buffer = arrayOfNulls(array.size).unsafeCast>()\n val result = mergeSort(array, buffer, start, endInclusive, comparator)\n if (result !== array) {\n for (i in start..endInclusive) array[i] = result[i]\n }\n}\n\n// Both start and end are inclusive indices.\nprivate fun mergeSort(array: Array, buffer: Array, start: Int, end: Int, comparator: Comparator): Array {\n if (start == end) {\n return array\n }\n\n val median = (start + end) / 2\n val left = mergeSort(array, buffer, start, median, comparator)\n val right = mergeSort(array, buffer, median + 1, end, comparator)\n\n val target = if (left === buffer) array else buffer\n\n // Merge.\n var leftIndex = start\n var rightIndex = median + 1\n for (i in start..end) {\n when {\n leftIndex <= median && rightIndex <= end -> {\n val leftValue = left[leftIndex]\n val rightValue = right[rightIndex]\n\n if (comparator.compare(leftValue, rightValue) <= 0) {\n target[i] = leftValue\n leftIndex++\n } else {\n target[i] = rightValue\n rightIndex++\n }\n }\n leftIndex <= median -> {\n target[i] = left[leftIndex]\n leftIndex++\n }\n else /* rightIndex <= end */ -> {\n target[i] = right[rightIndex]\n rightIndex++\n Unit // TODO: Fix KT-31506\n }\n }\n }\n\n return target\n}","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.collections\n\ninternal interface EqualityComparator {\n /**\n * Subclasses must override to return a value indicating\n * whether or not two keys or values are equal.\n */\n abstract fun equals(value1: Any?, value2: Any?): Boolean\n\n /**\n * Subclasses must override to return the hash code of a given key.\n */\n abstract fun getHashCode(value: Any?): Int\n\n\n object HashCode : EqualityComparator {\n override fun equals(value1: Any?, value2: Any?): Boolean = value1 == value2\n\n override fun getHashCode(value: Any?): Int = value?.hashCode() ?: 0\n }\n}","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n/*\n * Based on GWT AbstractHashMap\n * Copyright 2008 Google Inc.\n */\n\npackage kotlin.collections\n\nimport kotlin.collections.MutableMap.MutableEntry\n\n/**\n * Hash table based implementation of the [MutableMap] interface.\n *\n * This implementation makes no guarantees regarding the order of enumeration of [keys], [values] and [entries] collections.\n */\n// Classes that extend HashMap and implement `build()` (freezing) operation\n// have to make sure mutating methods check `checkIsMutable`.\npublic actual open class HashMap : AbstractMutableMap, MutableMap {\n\n private inner class EntrySet : AbstractEntrySet, K, V>() {\n\n override fun add(element: MutableEntry): Boolean = throw UnsupportedOperationException(\"Add is not supported on entries\")\n override fun clear() {\n this@HashMap.clear()\n }\n\n override fun containsEntry(element: Map.Entry): Boolean = this@HashMap.containsEntry(element)\n\n override operator fun iterator(): MutableIterator> = internalMap.iterator()\n\n override fun removeEntry(element: Map.Entry): Boolean {\n if (contains(element)) {\n this@HashMap.remove(element.key)\n return true\n }\n return false\n }\n\n override val size: Int get() = this@HashMap.size\n }\n\n\n /**\n * Internal implementation of the map: either string-based or hashcode-based.\n */\n private val internalMap: InternalMap\n\n private val equality: EqualityComparator\n\n internal constructor(internalMap: InternalMap) : super() {\n this.internalMap = internalMap\n this.equality = internalMap.equality\n }\n\n /**\n * Constructs an empty [HashMap] instance.\n */\n actual constructor() : this(InternalHashCodeMap(EqualityComparator.HashCode))\n\n /**\n * Constructs an empty [HashMap] instance.\n *\n * @param initialCapacity the initial capacity (ignored)\n * @param loadFactor the load factor (ignored)\n *\n * @throws IllegalArgumentException if the initial capacity or load factor are negative\n */\n actual constructor(initialCapacity: Int, loadFactor: Float) : this() {\n // This implementation of HashMap has no need of load factors or capacities.\n require(initialCapacity >= 0) { \"Negative initial capacity: $initialCapacity\" }\n require(loadFactor >= 0) { \"Non-positive load factor: $loadFactor\" }\n }\n\n actual constructor(initialCapacity: Int) : this(initialCapacity, 0.0f)\n\n\n /**\n * Constructs an instance of [HashMap] filled with the contents of the specified [original] map.\n */\n actual constructor(original: Map) : this() {\n this.putAll(original)\n }\n\n actual override fun clear() {\n internalMap.clear()\n// structureChanged(this)\n }\n\n actual override fun containsKey(key: K): Boolean = internalMap.contains(key)\n\n actual override fun containsValue(value: V): Boolean = internalMap.any { equality.equals(it.value, value) }\n\n private var _entries: MutableSet>? = null\n actual override val entries: MutableSet>\n get() {\n if (_entries == null) {\n _entries = createEntrySet()\n }\n return _entries!!\n }\n\n internal open fun createEntrySet(): MutableSet> = EntrySet()\n\n actual override operator fun get(key: K): V? = internalMap.get(key)\n\n actual override fun put(key: K, value: V): V? = internalMap.put(key, value)\n\n actual override fun remove(key: K): V? = internalMap.remove(key)\n\n actual override val size: Int get() = internalMap.size\n\n}\n\n/**\n * Constructs the specialized implementation of [HashMap] with [String] keys, which stores the keys as properties of\n * JS object without hashing them.\n */\npublic fun stringMapOf(vararg pairs: Pair): HashMap {\n return HashMap(InternalStringMap(EqualityComparator.HashCode)).apply { putAll(pairs) }\n}\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n/*\n * Based on GWT HashSet\n * Copyright 2008 Google Inc.\n */\n\npackage kotlin.collections\n\n/**\n * The implementation of the [MutableSet] interface, backed by a [HashMap] instance.\n */\n// Classes that extend HashSet and implement `build()` (freezing) operation\n// have to make sure mutating methods check `checkIsMutable`.\npublic actual open class HashSet : AbstractMutableSet, MutableSet {\n\n internal val map: HashMap\n\n /**\n * Constructs a new empty [HashSet].\n */\n actual constructor() {\n map = HashMap()\n }\n\n /**\n * Constructs a new [HashSet] filled with the elements of the specified collection.\n */\n actual constructor(elements: Collection) {\n map = HashMap(elements.size)\n addAll(elements)\n }\n\n /**\n * Constructs a new empty [HashSet].\n *\n * @param initialCapacity the initial capacity (ignored)\n * @param loadFactor the load factor (ignored)\n *\n * @throws IllegalArgumentException if the initial capacity or load factor are negative\n */\n actual constructor(initialCapacity: Int, loadFactor: Float) {\n map = HashMap(initialCapacity, loadFactor)\n }\n\n actual constructor(initialCapacity: Int) : this(initialCapacity, 0.0f)\n\n /**\n * Protected constructor to specify the underlying map. This is used by\n * LinkedHashSet.\n\n * @param map underlying map to use.\n */\n internal constructor(map: HashMap) {\n this.map = map\n }\n\n actual override fun add(element: E): Boolean {\n val old = map.put(element, this)\n return old == null\n }\n\n actual override fun clear() {\n map.clear()\n }\n\n// public override fun clone(): Any {\n// return HashSet(this)\n// }\n\n actual override operator fun contains(element: E): Boolean = map.containsKey(element)\n\n actual override fun isEmpty(): Boolean = map.isEmpty()\n\n actual override fun iterator(): MutableIterator = map.keys.iterator()\n\n actual override fun remove(element: E): Boolean = map.remove(element) != null\n\n actual override val size: Int get() = map.size\n\n}\n\n/**\n * Creates a new instance of the specialized implementation of [HashSet] with the specified [String] elements,\n * which elements the keys as properties of JS object without hashing them.\n */\npublic fun stringSetOf(vararg elements: String): HashSet {\n return HashSet(stringMapOf()).apply { addAll(elements) }\n}\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n/*\n * Based on GWT InternalHashCodeMap\n * Copyright 2008 Google Inc.\n */\n\npackage kotlin.collections\n\nimport kotlin.collections.MutableMap.MutableEntry\nimport kotlin.collections.AbstractMutableMap.SimpleEntry\n\n/**\n * A simple wrapper around JavaScriptObject to provide [java.util.Map]-like semantics for any\n * key type.\n *\n *\n * Implementation notes:\n *\n *\n * A key's hashCode is the index in backingMap which should contain that key. Since several keys may\n * have the same hash, each value in hashCodeMap is actually an array containing all entries whose\n * keys share the same hash.\n */\ninternal class InternalHashCodeMap(override val equality: EqualityComparator) : InternalMap {\n\n private var backingMap: dynamic = createJsMap()\n override var size: Int = 0\n private set\n\n override fun put(key: K, value: V): V? {\n val hashCode = equality.getHashCode(key)\n val chainOrEntry = getChainOrEntryOrNull(hashCode)\n if (chainOrEntry == null) {\n // This is a new chain, put it to the map.\n backingMap[hashCode] = SimpleEntry(key, value)\n } else {\n if (chainOrEntry !is Array<*>) {\n // It is an entry\n val entry: SimpleEntry = chainOrEntry\n if (equality.equals(entry.key, key)) {\n return entry.setValue(value)\n } else {\n backingMap[hashCode] = arrayOf(entry, SimpleEntry(key, value))\n size++\n return null\n }\n } else {\n // Chain already exists, perhaps key also exists.\n val chain: Array> = chainOrEntry\n val entry = chain.findEntryInChain(key)\n if (entry != null) {\n return entry.setValue(value)\n }\n chain.asDynamic().push(SimpleEntry(key, value))\n }\n }\n size++\n// structureChanged(host)\n return null\n }\n\n override fun remove(key: K): V? {\n val hashCode = equality.getHashCode(key)\n val chainOrEntry = getChainOrEntryOrNull(hashCode) ?: return null\n if (chainOrEntry !is Array<*>) {\n val entry: MutableEntry = chainOrEntry\n if (equality.equals(entry.key, key)) {\n jsDeleteProperty(backingMap, hashCode)\n size--\n return entry.value\n } else {\n return null\n }\n } else {\n val chain: Array> = chainOrEntry\n for (index in chain.indices) {\n val entry = chain[index]\n if (equality.equals(key, entry.key)) {\n if (chain.size == 1) {\n chain.asDynamic().length = 0\n // remove the whole array\n jsDeleteProperty(backingMap, hashCode)\n } else {\n // splice out the entry we're removing\n chain.asDynamic().splice(index, 1)\n }\n size--\n// structureChanged(host)\n return entry.value\n }\n }\n }\n return null\n }\n\n override fun clear() {\n backingMap = createJsMap()\n size = 0\n }\n\n override fun contains(key: K): Boolean = getEntry(key) != null\n\n override fun get(key: K): V? = getEntry(key)?.value\n\n private fun getEntry(key: K): MutableEntry? {\n val chainOrEntry = getChainOrEntryOrNull(equality.getHashCode(key)) ?: return null\n if (chainOrEntry !is Array<*>) {\n val entry: MutableEntry = chainOrEntry\n if (equality.equals(entry.key, key)) {\n return entry\n } else {\n return null\n }\n } else {\n val chain: Array> = chainOrEntry\n return chain.findEntryInChain(key)\n }\n }\n\n private fun Array>.findEntryInChain(key: K): MutableEntry? =\n firstOrNull { entry -> equality.equals(entry.key, key) }\n\n override fun iterator(): MutableIterator> {\n\n return object : MutableIterator> {\n var state = -1 // -1 not ready, 0 - ready, 1 - done\n\n val keys: Array = js(\"Object\").keys(backingMap)\n var keyIndex = -1\n\n var chainOrEntry: dynamic = null\n var isChain = false\n var itemIndex = -1\n var lastEntry: MutableEntry? = null\n\n private fun computeNext(): Int {\n if (chainOrEntry != null && isChain) {\n val chainSize: Int = chainOrEntry.unsafeCast>>().size\n if (++itemIndex < chainSize)\n return 0\n }\n\n if (++keyIndex < keys.size) {\n chainOrEntry = backingMap[keys[keyIndex]]\n isChain = chainOrEntry is Array<*>\n itemIndex = 0\n return 0\n } else {\n chainOrEntry = null\n return 1\n }\n }\n\n override fun hasNext(): Boolean {\n if (state == -1)\n state = computeNext()\n return state == 0\n }\n\n override fun next(): MutableEntry {\n if (!hasNext()) throw NoSuchElementException()\n val lastEntry = if (isChain) {\n chainOrEntry.unsafeCast>>()[itemIndex]\n } else {\n chainOrEntry.unsafeCast>()\n }\n this.lastEntry = lastEntry\n state = -1\n return lastEntry\n }\n\n override fun remove() {\n checkNotNull(lastEntry)\n this@InternalHashCodeMap.remove(lastEntry!!.key)\n lastEntry = null\n // the chain being iterated just got modified by InternalHashCodeMap.remove\n itemIndex--\n }\n }\n }\n\n private fun getChainOrEntryOrNull(hashCode: Int): dynamic {\n val chainOrEntry = backingMap[hashCode]\n return if (chainOrEntry === undefined) null else chainOrEntry\n }\n\n}\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n/*\n * Based on GWT InternalStringMap\n * Copyright 2008 Google Inc.\n */\npackage kotlin.collections\n\nimport kotlin.collections.MutableMap.MutableEntry\n\n/**\n * A simple wrapper around JavaScript Map for key type is string.\n *\n * Though this map is instantiated only with K=String, the K type is not fixed to String statically,\n * because we want to have it erased to Any? in order not to generate type-safe override bridges for\n * [get], [contains], [remove] etc, if they ever are generated.\n */\ninternal class InternalStringMap(override val equality: EqualityComparator) : InternalMap {\n\n private var backingMap: dynamic = createJsMap()\n override var size: Int = 0\n private set\n\n// /**\n// * A mod count to track 'value' replacements in map to ensure that the 'value' that we have in the\n// * iterator entry is guaranteed to be still correct.\n// * This is to optimize for the common scenario where the values are not modified during\n// * iterations where the entries are never stale.\n// */\n// private var valueMod: Int = 0\n\n override operator fun contains(key: K): Boolean {\n if (key !is String) return false\n return backingMap[key] !== undefined\n }\n\n override operator fun get(key: K): V? {\n if (key !is String) return null\n val value = backingMap[key]\n return if (value !== undefined) value.unsafeCast() else null\n }\n\n\n override fun put(key: K, value: V): V? {\n require(key is String)\n val oldValue = backingMap[key]\n backingMap[key] = value\n\n if (oldValue === undefined) {\n size++\n// structureChanged(host)\n return null\n } else {\n// valueMod++\n return oldValue.unsafeCast()\n }\n }\n\n override fun remove(key: K): V? {\n if (key !is String) return null\n val value = backingMap[key]\n if (value !== undefined) {\n jsDeleteProperty(backingMap, key)\n size--\n// structureChanged(host)\n return value.unsafeCast()\n } else {\n// valueMod++\n return null\n }\n }\n\n\n override fun clear() {\n backingMap = createJsMap()\n size = 0\n }\n\n\n override fun iterator(): MutableIterator> {\n return object : MutableIterator> {\n private val keys: Array = js(\"Object\").keys(backingMap)\n private val iterator = keys.iterator()\n private var lastKey: String? = null\n\n override fun hasNext(): Boolean = iterator.hasNext()\n\n override fun next(): MutableEntry {\n val key = iterator.next()\n lastKey = key\n @Suppress(\"UNCHECKED_CAST\")\n return newMapEntry(key as K)\n }\n\n override fun remove() {\n @Suppress(\"UNCHECKED_CAST\")\n this@InternalStringMap.remove(checkNotNull(lastKey) as K)\n }\n }\n }\n\n private fun newMapEntry(key: K): MutableEntry = object : MutableEntry {\n override val key: K get() = key\n override val value: V get() = this@InternalStringMap[key].unsafeCast()\n\n override fun setValue(newValue: V): V = this@InternalStringMap.put(key, newValue).unsafeCast()\n\n override fun hashCode(): Int = AbstractMap.entryHashCode(this)\n override fun toString(): String = AbstractMap.entryToString(this)\n override fun equals(other: Any?): Boolean = AbstractMap.entryEquals(this, other)\n }\n}\n","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n/*\n * Based on GWT LinkedHashMap\n * Copyright 2008 Google Inc.\n */\npackage kotlin.collections\n\nimport kotlin.collections.MutableMap.MutableEntry\n\n/**\n * Hash table based implementation of the [MutableMap] interface, which additionally preserves the insertion order\n * of entries during the iteration.\n *\n * The insertion order is preserved by maintaining a doubly-linked list of all of its entries.\n */\npublic actual open class LinkedHashMap : HashMap, MutableMap {\n\n /**\n * The entry we use includes next/prev pointers for a doubly-linked circular\n * list with a head node. This reduces the special cases we have to deal with\n * in the list operations.\n\n * Note that we duplicate the key from the underlying hash map so we can find\n * the eldest entry. The alternative would have been to modify HashMap so more\n * of the code was directly usable here, but this would have added some\n * overhead to HashMap, or to reimplement most of the HashMap code here with\n * small modifications. Paying a small storage cost only if you use\n * LinkedHashMap and minimizing code size seemed like a better tradeoff\n */\n private inner class ChainEntry(key: K, value: V) : AbstractMutableMap.SimpleEntry(key, value) {\n internal var next: ChainEntry? = null\n internal var prev: ChainEntry? = null\n\n override fun setValue(newValue: V): V {\n this@LinkedHashMap.checkIsMutable()\n return super.setValue(newValue)\n }\n }\n\n private inner class EntrySet : AbstractEntrySet, K, V>() {\n\n private inner class EntryIterator : MutableIterator> {\n // The last entry that was returned from this iterator.\n private var last: ChainEntry? = null\n\n // The next entry to return from this iterator.\n private var next: ChainEntry? = null\n\n init {\n next = head\n// recordLastKnownStructure(map, this)\n }\n\n override fun hasNext(): Boolean {\n return next !== null\n }\n\n override fun next(): MutableEntry {\n// checkStructuralChange(map, this)\n if (!hasNext()) throw NoSuchElementException()\n\n val current = next!!\n last = current\n next = current.next.takeIf { it !== head }\n return current\n }\n\n override fun remove() {\n check(last != null)\n this@EntrySet.checkIsMutable()\n// checkStructuralChange(map, this)\n\n last!!.remove()\n map.remove(last!!.key)\n// recordLastKnownStructure(map, this)\n last = null\n }\n }\n\n override fun add(element: MutableEntry): Boolean = throw UnsupportedOperationException(\"Add is not supported on entries\")\n override fun clear() {\n this@LinkedHashMap.clear()\n }\n\n override fun containsEntry(element: Map.Entry): Boolean = this@LinkedHashMap.containsEntry(element)\n\n override operator fun iterator(): MutableIterator> = EntryIterator()\n\n override fun removeEntry(element: Map.Entry): Boolean {\n checkIsMutable()\n if (contains(element)) {\n this@LinkedHashMap.remove(element.key)\n return true\n }\n return false\n }\n\n override val size: Int get() = this@LinkedHashMap.size\n\n override fun checkIsMutable(): Unit = this@LinkedHashMap.checkIsMutable()\n }\n\n\n /*\n * The head of the insert order chain, which is a doubly-linked circular\n * list.\n *\n * The most recently inserted node is at the end of the chain, ie.\n * chain.prev.\n */\n private var head: ChainEntry? = null\n\n /**\n * Add this node to the end of the chain.\n */\n private fun ChainEntry.addToEnd() {\n // This entry is not in the list.\n check(next == null && prev == null)\n\n val _head = head\n if (_head == null) {\n head = this\n next = this\n prev = this\n } else {\n // Chain is valid.\n val _tail = checkNotNull(_head.prev)\n // Update me.\n prev = _tail\n next = _head\n // Update my new siblings: current head and old tail\n _head.prev = this\n _tail.next = this\n }\n }\n\n /**\n * Remove this node from the chain it is a part of.\n */\n private fun ChainEntry.remove() {\n if (this.next === this) {\n // if this is single element, remove head\n head = null\n } else {\n if (head === this) {\n // if this is first element, move head to next\n head = next\n }\n next!!.prev = prev\n prev!!.next = next\n }\n next = null\n prev = null\n }\n\n /*\n * The hashmap that keeps track of our entries and the chain. Note that we\n * duplicate the key here to eliminate changes to HashMap and minimize the\n * code here, at the expense of additional space.\n */\n private val map: HashMap>\n\n private var isReadOnly: Boolean = false\n\n /**\n * Constructs an empty [LinkedHashMap] instance.\n */\n actual constructor() : super() {\n map = HashMap>()\n }\n\n internal constructor(backingMap: HashMap) : super() {\n @Suppress(\"UNCHECKED_CAST\") // expected to work due to erasure\n map = backingMap as HashMap>\n }\n\n /**\n * Constructs an empty [LinkedHashMap] instance.\n *\n * @param initialCapacity the initial capacity (ignored)\n * @param loadFactor the load factor (ignored)\n *\n * @throws IllegalArgumentException if the initial capacity or load factor are negative\n */\n actual constructor(initialCapacity: Int, loadFactor: Float) : super(initialCapacity, loadFactor) {\n map = HashMap>()\n }\n\n actual constructor(initialCapacity: Int) : this(initialCapacity, 0.0f)\n\n /**\n * Constructs an instance of [LinkedHashMap] filled with the contents of the specified [original] map.\n */\n actual constructor(original: Map) {\n map = HashMap>()\n this.putAll(original)\n }\n\n @PublishedApi\n internal fun build(): Map {\n checkIsMutable()\n isReadOnly = true\n return this\n }\n\n actual override fun clear() {\n checkIsMutable()\n map.clear()\n head = null\n }\n\n\n// override fun clone(): Any {\n// return LinkedHashMap(this)\n// }\n\n\n actual override fun containsKey(key: K): Boolean = map.containsKey(key)\n\n actual override fun containsValue(value: V): Boolean {\n var node: ChainEntry = head ?: return false\n do {\n if (node.value == value) {\n return true\n }\n node = node.next!!\n } while (node !== head)\n return false\n }\n\n\n internal override fun createEntrySet(): MutableSet> = EntrySet()\n\n actual override operator fun get(key: K): V? = map.get(key)?.value\n\n actual override fun put(key: K, value: V): V? {\n checkIsMutable()\n\n val old = map.get(key)\n if (old == null) {\n val newEntry = ChainEntry(key, value)\n map.put(key, newEntry)\n newEntry.addToEnd()\n return null\n } else {\n return old.setValue(value)\n }\n }\n\n actual override fun remove(key: K): V? {\n checkIsMutable()\n\n val entry = map.remove(key)\n if (entry != null) {\n entry.remove()\n return entry.value\n }\n return null\n }\n\n actual override val size: Int get() = map.size\n\n internal override fun checkIsMutable() {\n if (isReadOnly) throw UnsupportedOperationException()\n }\n}\n\n/**\n * Constructs the specialized implementation of [LinkedHashMap] with [String] keys, which stores the keys as properties of\n * JS object without hashing them.\n */\npublic fun linkedStringMapOf(vararg pairs: Pair): LinkedHashMap {\n return LinkedHashMap(stringMapOf()).apply { putAll(pairs) }\n}\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n/*\n * Based on GWT LinkedHashSet\n * Copyright 2008 Google Inc.\n */\n\npackage kotlin.collections\n\n/**\n * The implementation of the [MutableSet] interface, backed by a [LinkedHashMap] instance.\n *\n * This implementation preserves the insertion order of elements during the iteration.\n */\npublic actual open class LinkedHashSet : HashSet, MutableSet {\n\n internal constructor(map: LinkedHashMap) : super(map)\n\n /**\n * Constructs a new empty [LinkedHashSet].\n */\n actual constructor() : super(LinkedHashMap())\n\n /**\n * Constructs a new [LinkedHashSet] filled with the elements of the specified collection.\n */\n actual constructor(elements: Collection) : super(LinkedHashMap()) {\n addAll(elements)\n }\n\n /**\n * Constructs a new empty [LinkedHashSet].\n *\n * @param initialCapacity the initial capacity (ignored)\n * @param loadFactor the load factor (ignored)\n *\n * @throws IllegalArgumentException if the initial capacity or load factor are negative\n */\n actual constructor(initialCapacity: Int, loadFactor: Float) : super(LinkedHashMap(initialCapacity, loadFactor))\n\n actual constructor(initialCapacity: Int) : this(initialCapacity, 0.0f)\n\n @PublishedApi\n internal fun build(): Set {\n (map as LinkedHashMap).build()\n return this\n }\n\n internal override fun checkIsMutable(): Unit = map.checkIsMutable()\n\n// public override fun clone(): Any {\n// return LinkedHashSet(this)\n// }\n\n}\n\n/**\n * Creates a new instance of the specialized implementation of [LinkedHashSet] with the specified [String] elements,\n * which elements the keys as properties of JS object without hashing them.\n */\npublic fun linkedStringSetOf(vararg elements: String): LinkedHashSet {\n return LinkedHashSet(linkedStringMapOf()).apply { addAll(elements) }\n}\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.io\n\ninternal abstract class BaseOutput {\n open fun println() {\n print(\"\\n\")\n }\n\n open fun println(message: Any?) {\n print(message)\n println()\n }\n\n abstract fun print(message: Any?)\n\n open fun flush() {}\n}\n\n/** JsName used to make the declaration available outside of module to test it */\n@JsName(\"NodeJsOutput\")\ninternal class NodeJsOutput(val outputStream: dynamic) : BaseOutput() {\n override fun print(message: Any?) {\n // TODO: Using local variable because of bug in block decomposition lowering in IR backend\n val messageString = String(message)\n outputStream.write(messageString)\n }\n}\n\n/** JsName used to make the declaration available outside of module to test it */\n@JsName(\"OutputToConsoleLog\")\ninternal class OutputToConsoleLog : BaseOutput() {\n override fun print(message: Any?) {\n console.log(message)\n }\n\n override fun println(message: Any?) {\n console.log(message)\n }\n\n override fun println() {\n console.log(\"\")\n }\n}\n\n/** JsName used to make the declaration available outside of module to test it and use at try.kotl.in */\n@JsName(\"BufferedOutput\")\ninternal open class BufferedOutput : BaseOutput() {\n var buffer = \"\"\n\n override fun print(message: Any?) {\n buffer += String(message)\n }\n\n override fun flush() {\n buffer = \"\"\n }\n}\n\n/** JsName used to make the declaration available outside of module to test it */\n@JsName(\"BufferedOutputToConsoleLog\")\ninternal class BufferedOutputToConsoleLog : BufferedOutput() {\n override fun print(message: Any?) {\n var s = String(message)\n val i = s.nativeLastIndexOf(\"\\n\", 0)\n if (i >= 0) {\n buffer += s.substring(0, i)\n flush()\n s = s.substring(i + 1)\n }\n buffer += s\n }\n\n override fun flush() {\n console.log(buffer)\n buffer = \"\"\n }\n}\n\n/** JsName used to make the declaration available outside of module to test it and use at try.kotl.in */\n@JsName(\"output\")\ninternal var output = run {\n val isNode: Boolean = js(\"typeof process !== 'undefined' && process.versions && !!process.versions.node\")\n if (isNode) NodeJsOutput(js(\"process.stdout\")) else BufferedOutputToConsoleLog()\n}\n\n@kotlin.internal.InlineOnly\nprivate inline fun String(value: Any?): String = js(\"String\")(value)\n\n/** Prints the line separator to the standard output stream. */\npublic actual fun println() {\n output.println()\n}\n\n/** Prints the given [message] and the line separator to the standard output stream. */\npublic actual fun println(message: Any?) {\n output.println(message)\n}\n\n/** Prints the given [message] to the standard output stream. */\npublic actual fun print(message: Any?) {\n output.print(message)\n}\n\n@SinceKotlin(\"1.6\")\npublic actual fun readln(): String = throw UnsupportedOperationException(\"readln is not supported in Kotlin/JS\")\n\n@SinceKotlin(\"1.6\")\npublic actual fun readlnOrNull(): String? = throw UnsupportedOperationException(\"readlnOrNull is not supported in Kotlin/JS\")","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.coroutines\n\nimport kotlin.coroutines.intrinsics.CoroutineSingletons.*\nimport kotlin.coroutines.intrinsics.COROUTINE_SUSPENDED\n\n@PublishedApi\n@SinceKotlin(\"1.3\")\ninternal actual class SafeContinuation\ninternal actual constructor(\n private val delegate: Continuation,\n initialResult: Any?\n) : Continuation {\n @PublishedApi\n internal actual constructor(delegate: Continuation) : this(delegate, UNDECIDED)\n\n public actual override val context: CoroutineContext\n get() = delegate.context\n\n private var result: Any? = initialResult\n\n public actual override fun resumeWith(result: Result) {\n val cur = this.result\n when {\n cur === UNDECIDED -> {\n this.result = result.value\n }\n cur === COROUTINE_SUSPENDED -> {\n this.result = RESUMED\n delegate.resumeWith(result)\n }\n else -> throw IllegalStateException(\"Already resumed\")\n }\n }\n\n @PublishedApi\n internal actual fun getOrThrow(): Any? {\n if (result === UNDECIDED) {\n result = COROUTINE_SUSPENDED\n return COROUTINE_SUSPENDED\n }\n val result = this.result\n return when {\n result === RESUMED -> COROUTINE_SUSPENDED // already called continuation, indicate COROUTINE_SUSPENDED upstream\n result is Result.Failure -> throw result.exception\n else -> result // either COROUTINE_SUSPENDED or data\n }\n }\n}\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n// a package is omitted to get declarations directly under the module\n\n@JsName(\"throwNPE\")\ninternal fun throwNPE(message: String) {\n throw NullPointerException(message)\n}\n\n@JsName(\"throwCCE\")\ninternal fun throwCCE() {\n throw ClassCastException(\"Illegal cast\")\n}\n\n@JsName(\"throwISE\")\ninternal fun throwISE(message: String) {\n throw IllegalStateException(message)\n}\n\n@JsName(\"throwUPAE\")\ninternal fun throwUPAE(propertyName: String) {\n throw UninitializedPropertyAccessException(\"lateinit property ${propertyName} has not been initialized\")\n}\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\npackage kotlin.math\n\n\nimport kotlin.internal.InlineOnly\nimport kotlin.js.JsMath as nativeMath\n\n\n// region ================ Double Math ========================================\n\n/** Computes the sine of the angle [x] given in radians.\n *\n * Special cases:\n * - `sin(NaN|+Inf|-Inf)` is `NaN`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun sin(x: Double): Double = nativeMath.sin(x)\n\n/** Computes the cosine of the angle [x] given in radians.\n *\n * Special cases:\n * - `cos(NaN|+Inf|-Inf)` is `NaN`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun cos(x: Double): Double = nativeMath.cos(x)\n\n/** Computes the tangent of the angle [x] given in radians.\n *\n * Special cases:\n * - `tan(NaN|+Inf|-Inf)` is `NaN`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun tan(x: Double): Double = nativeMath.tan(x)\n\n/**\n * Computes the arc sine of the value [x];\n * the returned value is an angle in the range from `-PI/2` to `PI/2` radians.\n *\n * Special cases:\n * - `asin(x)` is `NaN`, when `abs(x) > 1` or x is `NaN`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun asin(x: Double): Double = nativeMath.asin(x)\n\n/**\n * Computes the arc cosine of the value [x];\n * the returned value is an angle in the range from `0.0` to `PI` radians.\n *\n * Special cases:\n * - `acos(x)` is `NaN`, when `abs(x) > 1` or x is `NaN`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun acos(x: Double): Double = nativeMath.acos(x)\n\n/**\n * Computes the arc tangent of the value [x];\n * the returned value is an angle in the range from `-PI/2` to `PI/2` radians.\n *\n * Special cases:\n * - `atan(NaN)` is `NaN`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun atan(x: Double): Double = nativeMath.atan(x)\n\n/**\n * Returns the angle `theta` of the polar coordinates `(r, theta)` that correspond\n * to the rectangular coordinates `(x, y)` by computing the arc tangent of the value [y] / [x];\n * the returned value is an angle in the range from `-PI` to `PI` radians.\n *\n * Special cases:\n * - `atan2(0.0, 0.0)` is `0.0`\n * - `atan2(0.0, x)` is `0.0` for `x > 0` and `PI` for `x < 0`\n * - `atan2(-0.0, x)` is `-0.0` for 'x > 0` and `-PI` for `x < 0`\n * - `atan2(y, +Inf)` is `0.0` for `0 < y < +Inf` and `-0.0` for '-Inf < y < 0`\n * - `atan2(y, -Inf)` is `PI` for `0 < y < +Inf` and `-PI` for `-Inf < y < 0`\n * - `atan2(y, 0.0)` is `PI/2` for `y > 0` and `-PI/2` for `y < 0`\n * - `atan2(+Inf, x)` is `PI/2` for finite `x`y\n * - `atan2(-Inf, x)` is `-PI/2` for finite `x`\n * - `atan2(NaN, x)` and `atan2(y, NaN)` is `NaN`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun atan2(y: Double, x: Double): Double = nativeMath.atan2(y, x)\n\n/**\n * Computes the hyperbolic sine of the value [x].\n *\n * Special cases:\n * - `sinh(NaN)` is `NaN`\n * - `sinh(+Inf)` is `+Inf`\n * - `sinh(-Inf)` is `-Inf`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun sinh(x: Double): Double = nativeMath.sinh(x)\n\n/**\n * Computes the hyperbolic cosine of the value [x].\n *\n * Special cases:\n * - `cosh(NaN)` is `NaN`\n * - `cosh(+Inf|-Inf)` is `+Inf`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun cosh(x: Double): Double = nativeMath.cosh(x)\n\n/**\n * Computes the hyperbolic tangent of the value [x].\n *\n * Special cases:\n * - `tanh(NaN)` is `NaN`\n * - `tanh(+Inf)` is `1.0`\n * - `tanh(-Inf)` is `-1.0`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun tanh(x: Double): Double = nativeMath.tanh(x)\n\n/**\n * Computes the inverse hyperbolic sine of the value [x].\n *\n * The returned value is `y` such that `sinh(y) == x`.\n *\n * Special cases:\n * - `asinh(NaN)` is `NaN`\n * - `asinh(+Inf)` is `+Inf`\n * - `asinh(-Inf)` is `-Inf`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun asinh(x: Double): Double = nativeMath.asinh(x)\n\n/**\n * Computes the inverse hyperbolic cosine of the value [x].\n *\n * The returned value is positive `y` such that `cosh(y) == x`.\n *\n * Special cases:\n * - `acosh(NaN)` is `NaN`\n * - `acosh(x)` is `NaN` when `x < 1`\n * - `acosh(+Inf)` is `+Inf`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun acosh(x: Double): Double = nativeMath.acosh(x)\n\n/**\n * Computes the inverse hyperbolic tangent of the value [x].\n *\n * The returned value is `y` such that `tanh(y) == x`.\n *\n * Special cases:\n * - `tanh(NaN)` is `NaN`\n * - `tanh(x)` is `NaN` when `x > 1` or `x < -1`\n * - `tanh(1.0)` is `+Inf`\n * - `tanh(-1.0)` is `-Inf`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun atanh(x: Double): Double = nativeMath.atanh(x)\n\n/**\n * Computes `sqrt(x^2 + y^2)` without intermediate overflow or underflow.\n *\n * Special cases:\n * - returns `+Inf` if any of arguments is infinite\n * - returns `NaN` if any of arguments is `NaN` and the other is not infinite\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun hypot(x: Double, y: Double): Double = nativeMath.hypot(x, y)\n\n/**\n * Computes the positive square root of the value [x].\n *\n * Special cases:\n * - `sqrt(x)` is `NaN` when `x < 0` or `x` is `NaN`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun sqrt(x: Double): Double = nativeMath.sqrt(x)\n\n/**\n * Computes Euler's number `e` raised to the power of the value [x].\n *\n * Special cases:\n * - `exp(NaN)` is `NaN`\n * - `exp(+Inf)` is `+Inf`\n * - `exp(-Inf)` is `0.0`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun exp(x: Double): Double = nativeMath.exp(x)\n\n/**\n * Computes `exp(x) - 1`.\n *\n * This function can be implemented to produce more precise result for [x] near zero.\n *\n * Special cases:\n * - `expm1(NaN)` is `NaN`\n * - `expm1(+Inf)` is `+Inf`\n * - `expm1(-Inf)` is `-1.0`\n *\n * @see [exp] function.\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun expm1(x: Double): Double = nativeMath.expm1(x)\n\n/**\n * Computes the logarithm of the value [x] to the given [base].\n *\n * Special cases:\n * - `log(x, b)` is `NaN` if either `x` or `b` are `NaN`\n * - `log(x, b)` is `NaN` when `x < 0` or `b <= 0` or `b == 1.0`\n * - `log(+Inf, +Inf)` is `NaN`\n * - `log(+Inf, b)` is `+Inf` for `b > 1` and `-Inf` for `b < 1`\n * - `log(0.0, b)` is `-Inf` for `b > 1` and `+Inf` for `b > 1`\n *\n * See also logarithm functions for common fixed bases: [ln], [log10] and [log2].\n */\n@SinceKotlin(\"1.2\")\npublic actual fun log(x: Double, base: Double): Double {\n if (base <= 0.0 || base == 1.0) return Double.NaN\n return nativeMath.log(x) / nativeMath.log(base)\n}\n\n/**\n * Computes the natural logarithm (base `E`) of the value [x].\n *\n * Special cases:\n * - `ln(NaN)` is `NaN`\n * - `ln(x)` is `NaN` when `x < 0.0`\n * - `ln(+Inf)` is `+Inf`\n * - `ln(0.0)` is `-Inf`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun ln(x: Double): Double = nativeMath.log(x)\n\n/**\n * Computes the common logarithm (base 10) of the value [x].\n *\n * @see [ln] function for special cases.\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun log10(x: Double): Double = nativeMath.log10(x)\n\n/**\n * Computes the binary logarithm (base 2) of the value [x].\n *\n * @see [ln] function for special cases.\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun log2(x: Double): Double = nativeMath.log2(x)\n\n/**\n * Computes `ln(x + 1)`.\n *\n * This function can be implemented to produce more precise result for [x] near zero.\n *\n * Special cases:\n * - `ln1p(NaN)` is `NaN`\n * - `ln1p(x)` is `NaN` where `x < -1.0`\n * - `ln1p(-1.0)` is `-Inf`\n * - `ln1p(+Inf)` is `+Inf`\n *\n * @see [ln] function\n * @see [expm1] function\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun ln1p(x: Double): Double = nativeMath.log1p(x)\n\n/**\n * Rounds the given value [x] to an integer towards positive infinity.\n\n * @return the smallest double value that is greater than or equal to the given value [x] and is a mathematical integer.\n *\n * Special cases:\n * - `ceil(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer.\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun ceil(x: Double): Double = nativeMath.ceil(x)\n\n/**\n * Rounds the given value [x] to an integer towards negative infinity.\n\n * @return the largest double value that is smaller than or equal to the given value [x] and is a mathematical integer.\n *\n * Special cases:\n * - `floor(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer.\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun floor(x: Double): Double = nativeMath.floor(x)\n\n/**\n * Rounds the given value [x] to an integer towards zero.\n *\n * @return the value [x] having its fractional part truncated.\n *\n * Special cases:\n * - `truncate(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer.\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun truncate(x: Double): Double = nativeMath.trunc(x)\n\n/**\n * Rounds the given value [x] towards the closest integer with ties rounded towards even integer.\n *\n * Special cases:\n * - `round(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer.\n */\n@SinceKotlin(\"1.2\")\npublic actual fun round(x: Double): Double {\n if (x % 0.5 != 0.0) {\n return nativeMath.round(x)\n }\n val floor = floor(x)\n return if (floor % 2 == 0.0) floor else ceil(x)\n}\n\n/**\n * Returns the absolute value of the given value [x].\n *\n * Special cases:\n * - `abs(NaN)` is `NaN`\n *\n * @see absoluteValue extension property for [Double]\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun abs(x: Double): Double = nativeMath.abs(x)\n\n/**\n * Returns the sign of the given value [x]:\n * - `-1.0` if the value is negative,\n * - zero if the value is zero,\n * - `1.0` if the value is positive\n *\n * Special case:\n * - `sign(NaN)` is `NaN`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun sign(x: Double): Double = nativeMath.sign(x)\n\n\n/**\n * Returns the smaller of two values.\n *\n * If either value is `NaN`, then the result is `NaN`.\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun min(a: Double, b: Double): Double = nativeMath.min(a, b)\n\n/**\n * Returns the greater of two values.\n *\n * If either value is `NaN`, then the result is `NaN`.\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun max(a: Double, b: Double): Double = nativeMath.max(a, b)\n\n// extensions\n\n/**\n * Raises this value to the power [x].\n *\n * Special cases:\n * - `b.pow(0.0)` is `1.0`\n * - `b.pow(1.0) == b`\n * - `b.pow(NaN)` is `NaN`\n * - `NaN.pow(x)` is `NaN` for `x != 0.0`\n * - `b.pow(Inf)` is `NaN` for `abs(b) == 1.0`\n * - `b.pow(x)` is `NaN` for `b < 0` and `x` is finite and not an integer\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun Double.pow(x: Double): Double = nativeMath.pow(this, x)\n\n/**\n * Raises this value to the integer power [n].\n *\n * See the other overload of [pow] for details.\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun Double.pow(n: Int): Double = nativeMath.pow(this, n.toDouble())\n\n/**\n * Returns the absolute value of this value.\n *\n * Special cases:\n * - `NaN.absoluteValue` is `NaN`\n *\n * @see abs function\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline val Double.absoluteValue: Double get() = nativeMath.abs(this)\n\n/**\n * Returns the sign of this value:\n * - `-1.0` if the value is negative,\n * - zero if the value is zero,\n * - `1.0` if the value is positive\n *\n * Special case:\n * - `NaN.sign` is `NaN`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline val Double.sign: Double get() = nativeMath.sign(this)\n\n/**\n * Returns this value with the sign bit same as of the [sign] value.\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun Double.withSign(sign: Int): Double = this.withSign(sign.toDouble())\n\n/**\n * Returns the ulp (unit in the last place) of this value.\n *\n * An ulp is a positive distance between this value and the next nearest [Double] value larger in magnitude.\n *\n * Special Cases:\n * - `NaN.ulp` is `NaN`\n * - `x.ulp` is `+Inf` when `x` is `+Inf` or `-Inf`\n * - `0.0.ulp` is `Double.MIN_VALUE`\n */\n@SinceKotlin(\"1.2\")\npublic actual val Double.ulp: Double get() = when {\n this < 0 -> (-this).ulp\n this.isNaN() || this == Double.POSITIVE_INFINITY -> this\n this == Double.MAX_VALUE -> this - this.nextDown()\n else -> this.nextUp() - this\n}\n\n/**\n * Returns the [Double] value nearest to this value in direction of positive infinity.\n */\n@SinceKotlin(\"1.2\")\npublic actual fun Double.nextUp(): Double = when {\n this.isNaN() || this == Double.POSITIVE_INFINITY -> this\n this == 0.0 -> Double.MIN_VALUE\n else -> Double.fromBits(this.toRawBits() + if (this > 0) 1 else -1)\n}\n\n/**\n * Returns the [Double] value nearest to this value in direction of negative infinity.\n */\n@SinceKotlin(\"1.2\")\npublic actual fun Double.nextDown(): Double = when {\n this.isNaN() || this == Double.NEGATIVE_INFINITY -> this\n this == 0.0 -> -Double.MIN_VALUE\n else -> Double.fromBits(this.toRawBits() + if (this > 0) -1 else 1)\n}\n\n\n/**\n * Returns the [Double] value nearest to this value in direction from this value towards the value [to].\n *\n * Special cases:\n * - `x.nextTowards(y)` is `NaN` if either `x` or `y` are `NaN`\n * - `x.nextTowards(x) == x`\n *\n */\n@SinceKotlin(\"1.2\")\npublic actual fun Double.nextTowards(to: Double): Double = when {\n this.isNaN() || to.isNaN() -> Double.NaN\n to == this -> to\n to > this -> this.nextUp()\n else /* to < this */ -> this.nextDown()\n}\n\n\n/**\n * Rounds this [Double] value to the nearest integer and converts the result to [Int].\n * Ties are rounded towards positive infinity.\n *\n * Special cases:\n * - `x.roundToInt() == Int.MAX_VALUE` when `x > Int.MAX_VALUE`\n * - `x.roundToInt() == Int.MIN_VALUE` when `x < Int.MIN_VALUE`\n *\n * @throws IllegalArgumentException when this value is `NaN`\n */\n@SinceKotlin(\"1.2\")\npublic actual fun Double.roundToInt(): Int = when {\n isNaN() -> throw IllegalArgumentException(\"Cannot round NaN value.\")\n this > Int.MAX_VALUE -> Int.MAX_VALUE\n this < Int.MIN_VALUE -> Int.MIN_VALUE\n else -> nativeMath.round(this).toInt()\n}\n\n/**\n * Rounds this [Double] value to the nearest integer and converts the result to [Long].\n * Ties are rounded towards positive infinity.\n *\n * Special cases:\n * - `x.roundToLong() == Long.MAX_VALUE` when `x > Long.MAX_VALUE`\n * - `x.roundToLong() == Long.MIN_VALUE` when `x < Long.MIN_VALUE`\n *\n * @throws IllegalArgumentException when this value is `NaN`\n */\n@SinceKotlin(\"1.2\")\npublic actual fun Double.roundToLong(): Long = when {\n isNaN() -> throw IllegalArgumentException(\"Cannot round NaN value.\")\n this > Long.MAX_VALUE -> Long.MAX_VALUE\n this < Long.MIN_VALUE -> Long.MIN_VALUE\n else -> nativeMath.round(this).toLong()\n}\n\n// endregion\n\n\n\n// region ================ Float Math ========================================\n\n/** Computes the sine of the angle [x] given in radians.\n *\n * Special cases:\n * - `sin(NaN|+Inf|-Inf)` is `NaN`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun sin(x: Float): Float = nativeMath.sin(x.toDouble()).toFloat()\n\n/** Computes the cosine of the angle [x] given in radians.\n *\n * Special cases:\n * - `cos(NaN|+Inf|-Inf)` is `NaN`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun cos(x: Float): Float = nativeMath.cos(x.toDouble()).toFloat()\n\n/** Computes the tangent of the angle [x] given in radians.\n *\n * Special cases:\n * - `tan(NaN|+Inf|-Inf)` is `NaN`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun tan(x: Float): Float = nativeMath.tan(x.toDouble()).toFloat()\n\n/**\n * Computes the arc sine of the value [x];\n * the returned value is an angle in the range from `-PI/2` to `PI/2` radians.\n *\n * Special cases:\n * - `asin(x)` is `NaN`, when `abs(x) > 1` or x is `NaN`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun asin(x: Float): Float = nativeMath.asin(x.toDouble()).toFloat()\n\n/**\n * Computes the arc cosine of the value [x];\n * the returned value is an angle in the range from `0.0` to `PI` radians.\n *\n * Special cases:\n * - `acos(x)` is `NaN`, when `abs(x) > 1` or x is `NaN`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun acos(x: Float): Float = nativeMath.acos(x.toDouble()).toFloat()\n\n/**\n * Computes the arc tangent of the value [x];\n * the returned value is an angle in the range from `-PI/2` to `PI/2` radians.\n *\n * Special cases:\n * - `atan(NaN)` is `NaN`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun atan(x: Float): Float = nativeMath.atan(x.toDouble()).toFloat()\n\n/**\n * Returns the angle `theta` of the polar coordinates `(r, theta)` that correspond\n * to the rectangular coordinates `(x, y)` by computing the arc tangent of the value [y] / [x];\n * the returned value is an angle in the range from `-PI` to `PI` radians.\n *\n * Special cases:\n * - `atan2(0.0, 0.0)` is `0.0`\n * - `atan2(0.0, x)` is `0.0` for `x > 0` and `PI` for `x < 0`\n * - `atan2(-0.0, x)` is `-0.0` for 'x > 0` and `-PI` for `x < 0`\n * - `atan2(y, +Inf)` is `0.0` for `0 < y < +Inf` and `-0.0` for '-Inf < y < 0`\n * - `atan2(y, -Inf)` is `PI` for `0 < y < +Inf` and `-PI` for `-Inf < y < 0`\n * - `atan2(y, 0.0)` is `PI/2` for `y > 0` and `-PI/2` for `y < 0`\n * - `atan2(+Inf, x)` is `PI/2` for finite `x`y\n * - `atan2(-Inf, x)` is `-PI/2` for finite `x`\n * - `atan2(NaN, x)` and `atan2(y, NaN)` is `NaN`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun atan2(y: Float, x: Float): Float = nativeMath.atan2(y.toDouble(), x.toDouble()).toFloat()\n\n/**\n * Computes the hyperbolic sine of the value [x].\n *\n * Special cases:\n * - `sinh(NaN)` is `NaN`\n * - `sinh(+Inf)` is `+Inf`\n * - `sinh(-Inf)` is `-Inf`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun sinh(x: Float): Float = nativeMath.sinh(x.toDouble()).toFloat()\n\n/**\n * Computes the hyperbolic cosine of the value [x].\n *\n * Special cases:\n * - `cosh(NaN)` is `NaN`\n * - `cosh(+Inf|-Inf)` is `+Inf`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun cosh(x: Float): Float = nativeMath.cosh(x.toDouble()).toFloat()\n\n/**\n * Computes the hyperbolic tangent of the value [x].\n *\n * Special cases:\n * - `tanh(NaN)` is `NaN`\n * - `tanh(+Inf)` is `1.0`\n * - `tanh(-Inf)` is `-1.0`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun tanh(x: Float): Float = nativeMath.tanh(x.toDouble()).toFloat()\n\n/**\n * Computes the inverse hyperbolic sine of the value [x].\n *\n * The returned value is `y` such that `sinh(y) == x`.\n *\n * Special cases:\n * - `asinh(NaN)` is `NaN`\n * - `asinh(+Inf)` is `+Inf`\n * - `asinh(-Inf)` is `-Inf`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun asinh(x: Float): Float = nativeMath.asinh(x.toDouble()).toFloat()\n\n/**\n * Computes the inverse hyperbolic cosine of the value [x].\n *\n * The returned value is positive `y` such that `cosh(y) == x`.\n *\n * Special cases:\n * - `acosh(NaN)` is `NaN`\n * - `acosh(x)` is `NaN` when `x < 1`\n * - `acosh(+Inf)` is `+Inf`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun acosh(x: Float): Float = nativeMath.acosh(x.toDouble()).toFloat()\n\n/**\n * Computes the inverse hyperbolic tangent of the value [x].\n *\n * The returned value is `y` such that `tanh(y) == x`.\n *\n * Special cases:\n * - `tanh(NaN)` is `NaN`\n * - `tanh(x)` is `NaN` when `x > 1` or `x < -1`\n * - `tanh(1.0)` is `+Inf`\n * - `tanh(-1.0)` is `-Inf`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun atanh(x: Float): Float = nativeMath.atanh(x.toDouble()).toFloat()\n\n/**\n * Computes `sqrt(x^2 + y^2)` without intermediate overflow or underflow.\n *\n * Special cases:\n * - returns `+Inf` if any of arguments is infinite\n * - returns `NaN` if any of arguments is `NaN` and the other is not infinite\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun hypot(x: Float, y: Float): Float = nativeMath.hypot(x.toDouble(), y.toDouble()).toFloat()\n\n/**\n * Computes the positive square root of the value [x].\n *\n * Special cases:\n * - `sqrt(x)` is `NaN` when `x < 0` or `x` is `NaN`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun sqrt(x: Float): Float = nativeMath.sqrt(x.toDouble()).toFloat()\n\n/**\n * Computes Euler's number `e` raised to the power of the value [x].\n *\n * Special cases:\n * - `exp(NaN)` is `NaN`\n * - `exp(+Inf)` is `+Inf`\n * - `exp(-Inf)` is `0.0`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun exp(x: Float): Float = nativeMath.exp(x.toDouble()).toFloat()\n\n/**\n * Computes `exp(x) - 1`.\n *\n * This function can be implemented to produce more precise result for [x] near zero.\n *\n * Special cases:\n * - `expm1(NaN)` is `NaN`\n * - `expm1(+Inf)` is `+Inf`\n * - `expm1(-Inf)` is `-1.0`\n *\n * @see [exp] function.\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun expm1(x: Float): Float = nativeMath.expm1(x.toDouble()).toFloat()\n\n/**\n * Computes the logarithm of the value [x] to the given [base].\n *\n * Special cases:\n * - `log(x, b)` is `NaN` if either `x` or `b` are `NaN`\n * - `log(x, b)` is `NaN` when `x < 0` or `b <= 0` or `b == 1.0`\n * - `log(+Inf, +Inf)` is `NaN`\n * - `log(+Inf, b)` is `+Inf` for `b > 1` and `-Inf` for `b < 1`\n * - `log(0.0, b)` is `-Inf` for `b > 1` and `+Inf` for `b > 1`\n *\n * See also logarithm functions for common fixed bases: [ln], [log10] and [log2].\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun log(x: Float, base: Float): Float = log(x.toDouble(), base.toDouble()).toFloat()\n\n/**\n * Computes the natural logarithm (base `E`) of the value [x].\n *\n * Special cases:\n * - `ln(NaN)` is `NaN`\n * - `ln(x)` is `NaN` when `x < 0.0`\n * - `ln(+Inf)` is `+Inf`\n * - `ln(0.0)` is `-Inf`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun ln(x: Float): Float = nativeMath.log(x.toDouble()).toFloat()\n\n/**\n * Computes the common logarithm (base 10) of the value [x].\n *\n * @see [ln] function for special cases.\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun log10(x: Float): Float = nativeMath.log10(x.toDouble()).toFloat()\n\n/**\n * Computes the binary logarithm (base 2) of the value [x].\n *\n * @see [ln] function for special cases.\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun log2(x: Float): Float = nativeMath.log2(x.toDouble()).toFloat()\n\n/**\n * Computes `ln(a + 1)`.\n *\n * This function can be implemented to produce more precise result for [x] near zero.\n *\n * Special cases:\n * - `ln1p(NaN)` is `NaN`\n * - `ln1p(x)` is `NaN` where `x < -1.0`\n * - `ln1p(-1.0)` is `-Inf`\n * - `ln1p(+Inf)` is `+Inf`\n *\n * @see [ln] function\n * @see [expm1] function\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun ln1p(x: Float): Float = nativeMath.log1p(x.toDouble()).toFloat()\n\n/**\n * Rounds the given value [x] to an integer towards positive infinity.\n\n * @return the smallest Float value that is greater than or equal to the given value [x] and is a mathematical integer.\n *\n * Special cases:\n * - `ceil(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer.\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun ceil(x: Float): Float = nativeMath.ceil(x.toDouble()).toFloat()\n\n/**\n * Rounds the given value [x] to an integer towards negative infinity.\n\n * @return the largest Float value that is smaller than or equal to the given value [x] and is a mathematical integer.\n *\n * Special cases:\n * - `floor(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer.\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun floor(x: Float): Float = nativeMath.floor(x.toDouble()).toFloat()\n\n/**\n * Rounds the given value [x] to an integer towards zero.\n *\n * @return the value [x] having its fractional part truncated.\n *\n * Special cases:\n * - `truncate(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer.\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun truncate(x: Float): Float = truncate(x.toDouble()).toFloat()\n\n/**\n * Rounds the given value [x] towards the closest integer with ties rounded towards even integer.\n *\n * Special cases:\n * - `round(x)` is `x` where `x` is `NaN` or `+Inf` or `-Inf` or already a mathematical integer.\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun round(x: Float): Float = round(x.toDouble()).toFloat()\n\n\n/**\n * Returns the absolute value of the given value [x].\n *\n * Special cases:\n * - `abs(NaN)` is `NaN`\n *\n * @see absoluteValue extension property for [Float]\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun abs(x: Float): Float = nativeMath.abs(x.toDouble()).toFloat()\n\n/**\n * Returns the sign of the given value [x]:\n * - `-1.0` if the value is negative,\n * - zero if the value is zero,\n * - `1.0` if the value is positive\n *\n * Special case:\n * - `sign(NaN)` is `NaN`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun sign(x: Float): Float = nativeMath.sign(x.toDouble()).toFloat()\n\n\n\n/**\n * Returns the smaller of two values.\n *\n * If either value is `NaN`, then the result is `NaN`.\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun min(a: Float, b: Float): Float = nativeMath.min(a, b)\n\n/**\n * Returns the greater of two values.\n *\n * If either value is `NaN`, then the result is `NaN`.\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun max(a: Float, b: Float): Float = nativeMath.max(a, b)\n\n// extensions\n\n\n/**\n * Raises this value to the power [x].\n *\n * Special cases:\n * - `b.pow(0.0)` is `1.0`\n * - `b.pow(1.0) == b`\n * - `b.pow(NaN)` is `NaN`\n * - `NaN.pow(x)` is `NaN` for `x != 0.0`\n * - `b.pow(Inf)` is `NaN` for `abs(b) == 1.0`\n * - `b.pow(x)` is `NaN` for `b < 0` and `x` is finite and not an integer\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun Float.pow(x: Float): Float = nativeMath.pow(this.toDouble(), x.toDouble()).toFloat()\n\n/**\n * Raises this value to the integer power [n].\n *\n * See the other overload of [pow] for details.\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun Float.pow(n: Int): Float = nativeMath.pow(this.toDouble(), n.toDouble()).toFloat()\n\n/**\n * Returns the absolute value of this value.\n *\n * Special cases:\n * - `NaN.absoluteValue` is `NaN`\n *\n * @see abs function\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline val Float.absoluteValue: Float get() = nativeMath.abs(this.toDouble()).toFloat()\n\n/**\n * Returns the sign of this value:\n * - `-1.0` if the value is negative,\n * - zero if the value is zero,\n * - `1.0` if the value is positive\n *\n * Special case:\n * - `NaN.sign` is `NaN`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline val Float.sign: Float get() = nativeMath.sign(this.toDouble()).toFloat()\n\n/**\n * Returns this value with the sign bit same as of the [sign] value.\n *\n * If [sign] is `NaN` the sign of the result is undefined.\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun Float.withSign(sign: Float): Float = this.toDouble().withSign(sign.toDouble()).toFloat()\n\n/**\n * Returns this value with the sign bit same as of the [sign] value.\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun Float.withSign(sign: Int): Float = this.toDouble().withSign(sign.toDouble()).toFloat()\n\n\n/**\n * Rounds this [Float] value to the nearest integer and converts the result to [Int].\n * Ties are rounded towards positive infinity.\n *\n * Special cases:\n * - `x.roundToInt() == Int.MAX_VALUE` when `x > Int.MAX_VALUE`\n * - `x.roundToInt() == Int.MIN_VALUE` when `x < Int.MIN_VALUE`\n *\n * @throws IllegalArgumentException when this value is `NaN`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun Float.roundToInt(): Int = toDouble().roundToInt()\n\n/**\n * Rounds this [Float] value to the nearest integer and converts the result to [Long].\n * Ties are rounded towards positive infinity.\n *\n * Special cases:\n * - `x.roundToLong() == Long.MAX_VALUE` when `x > Long.MAX_VALUE`\n * - `x.roundToLong() == Long.MIN_VALUE` when `x < Long.MIN_VALUE`\n *\n * @throws IllegalArgumentException when this value is `NaN`\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun Float.roundToLong(): Long = toDouble().roundToLong()\n\n\n// endregion\n\n// region ================ Integer Math ========================================\n\n\n/**\n * Returns the absolute value of the given value [n].\n *\n * Special cases:\n * - `abs(Int.MIN_VALUE)` is `Int.MIN_VALUE` due to an overflow\n *\n * @see absoluteValue extension property for [Int]\n */\n// TODO: remove manual 'or' when KT-19290 is fixed\n@SinceKotlin(\"1.2\")\npublic actual fun abs(n: Int): Int = if (n < 0) (-n or 0) else n\n\n/**\n * Returns the smaller of two values.\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun min(a: Int, b: Int): Int = nativeMath.min(a, b)\n\n/**\n * Returns the greater of two values.\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline fun max(a: Int, b: Int): Int = nativeMath.max(a, b)\n\n/**\n * Returns the absolute value of this value.\n *\n * Special cases:\n * - `Int.MIN_VALUE.absoluteValue` is `Int.MIN_VALUE` due to an overflow\n *\n * @see abs function\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline val Int.absoluteValue: Int get() = abs(this)\n\n/**\n * Returns the sign of this value:\n * - `-1` if the value is negative,\n * - `0` if the value is zero,\n * - `1` if the value is positive\n */\n@SinceKotlin(\"1.2\")\npublic actual val Int.sign: Int get() = when {\n this < 0 -> -1\n this > 0 -> 1\n else -> 0\n}\n\n\n\n/**\n * Returns the absolute value of the given value [n].\n *\n * Special cases:\n * - `abs(Long.MIN_VALUE)` is `Long.MIN_VALUE` due to an overflow\n *\n * @see absoluteValue extension property for [Long]\n */\n@SinceKotlin(\"1.2\")\npublic actual fun abs(n: Long): Long = if (n < 0) -n else n\n\n/**\n * Returns the smaller of two values.\n */\n@SinceKotlin(\"1.2\")\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline fun min(a: Long, b: Long): Long = if (a <= b) a else b\n\n/**\n * Returns the greater of two values.\n */\n@SinceKotlin(\"1.2\")\n@Suppress(\"NOTHING_TO_INLINE\")\npublic actual inline fun max(a: Long, b: Long): Long = if (a >= b) a else b\n\n/**\n * Returns the absolute value of this value.\n *\n * Special cases:\n * - `Long.MIN_VALUE.absoluteValue` is `Long.MIN_VALUE` due to an overflow\n *\n * @see abs function\n */\n@SinceKotlin(\"1.2\")\n@InlineOnly\npublic actual inline val Long.absoluteValue: Long get() = abs(this)\n\n/**\n * Returns the sign of this value:\n * - `-1` if the value is negative,\n * - `0` if the value is zero,\n * - `1` if the value is positive\n */\n@SinceKotlin(\"1.2\")\npublic actual val Long.sign: Int get() = when {\n this < 0 -> -1\n this > 0 -> 1\n else -> 0\n}\n\n\n// endregion\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin\n\n/**\n * Returns `true` if the specified number is a\n * Not-a-Number (NaN) value, `false` otherwise.\n */\npublic actual fun Double.isNaN(): Boolean = this != this\n\n/**\n * Returns `true` if the specified number is a\n * Not-a-Number (NaN) value, `false` otherwise.\n */\npublic actual fun Float.isNaN(): Boolean = this != this\n\n/**\n * Returns `true` if this value is infinitely large in magnitude.\n */\npublic actual fun Double.isInfinite(): Boolean = this == Double.POSITIVE_INFINITY || this == Double.NEGATIVE_INFINITY\n\n/**\n * Returns `true` if this value is infinitely large in magnitude.\n */\npublic actual fun Float.isInfinite(): Boolean = this == Float.POSITIVE_INFINITY || this == Float.NEGATIVE_INFINITY\n\n/**\n * Returns `true` if the argument is a finite floating-point value; returns `false` otherwise (for `NaN` and infinity arguments).\n */\npublic actual fun Double.isFinite(): Boolean = !isInfinite() && !isNaN()\n\n/**\n * Returns `true` if the argument is a finite floating-point value; returns `false` otherwise (for `NaN` and infinity arguments).\n */\npublic actual fun Float.isFinite(): Boolean = !isInfinite() && !isNaN()\n\n\n/**\n * Counts the number of set bits in the binary representation of this [Int] number.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic actual fun Int.countOneBits(): Int {\n // Hacker's Delight 5-1 algorithm\n var v = this\n v = (v and 0x55555555) + (v.ushr(1) and 0x55555555)\n v = (v and 0x33333333) + (v.ushr(2) and 0x33333333)\n v = (v and 0x0F0F0F0F) + (v.ushr(4) and 0x0F0F0F0F)\n v = (v and 0x00FF00FF) + (v.ushr(8) and 0x00FF00FF)\n v = (v and 0x0000FFFF) + (v.ushr(16))\n return v\n}\n\n/**\n * Counts the number of consecutive most significant bits that are zero in the binary representation of this [Int] number.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic actual inline fun Int.countLeadingZeroBits(): Int = nativeClz32(this)\n\n/**\n * Counts the number of consecutive least significant bits that are zero in the binary representation of this [Int] number.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic actual fun Int.countTrailingZeroBits(): Int =\n // Hacker's Delight 5-4 algorithm for expressing countTrailingZeroBits with countLeadingZeroBits\n Int.SIZE_BITS - (this or -this).inv().countLeadingZeroBits()\n\n/**\n * Returns a number having a single bit set in the position of the most significant set bit of this [Int] number,\n * or zero, if this number is zero.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic actual fun Int.takeHighestOneBit(): Int =\n if (this == 0) 0 else 1.shl(Int.SIZE_BITS - 1 - countLeadingZeroBits())\n\n/**\n * Returns a number having a single bit set in the position of the least significant set bit of this [Int] number,\n * or zero, if this number is zero.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic actual fun Int.takeLowestOneBit(): Int =\n // Hacker's Delight 2-1 algorithm for isolating rightmost 1-bit\n this and -this\n\n/**\n * Rotates the binary representation of this [Int] number left by the specified [bitCount] number of bits.\n * The most significant bits pushed out from the left side reenter the number as the least significant bits on the right side.\n *\n * Rotating the number left by a negative bit count is the same as rotating it right by the negated bit count:\n * `number.rotateLeft(-n) == number.rotateRight(n)`\n *\n * Rotating by a multiple of [Int.SIZE_BITS] (32) returns the same number, or more generally\n * `number.rotateLeft(n) == number.rotateLeft(n % 32)`\n */\n@SinceKotlin(\"1.6\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic actual fun Int.rotateLeft(bitCount: Int): Int =\n shl(bitCount) or ushr(Int.SIZE_BITS - bitCount)\n\n\n/**\n * Rotates the binary representation of this [Int] number right by the specified [bitCount] number of bits.\n * The least significant bits pushed out from the right side reenter the number as the most significant bits on the left side.\n *\n * Rotating the number right by a negative bit count is the same as rotating it left by the negated bit count:\n * `number.rotateRight(-n) == number.rotateLeft(n)`\n *\n * Rotating by a multiple of [Int.SIZE_BITS] (32) returns the same number, or more generally\n * `number.rotateRight(n) == number.rotateRight(n % 32)`\n */\n@SinceKotlin(\"1.6\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic actual fun Int.rotateRight(bitCount: Int): Int =\n shl(Int.SIZE_BITS - bitCount) or ushr(bitCount)\n\n\n/**\n * Counts the number of set bits in the binary representation of this [Long] number.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic actual fun Long.countOneBits(): Int =\n high.countOneBits() + low.countOneBits()\n\n/**\n * Counts the number of consecutive most significant bits that are zero in the binary representation of this [Long] number.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic actual fun Long.countLeadingZeroBits(): Int =\n when (val high = this.high) {\n 0 -> Int.SIZE_BITS + low.countLeadingZeroBits()\n else -> high.countLeadingZeroBits()\n }\n\n/**\n * Counts the number of consecutive least significant bits that are zero in the binary representation of this [Long] number.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic actual fun Long.countTrailingZeroBits(): Int =\n when (val low = this.low) {\n 0 -> Int.SIZE_BITS + high.countTrailingZeroBits()\n else -> low.countTrailingZeroBits()\n }\n\n/**\n * Returns a number having a single bit set in the position of the most significant set bit of this [Long] number,\n * or zero, if this number is zero.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic actual fun Long.takeHighestOneBit(): Long =\n when (val high = this.high) {\n 0 -> Long(low.takeHighestOneBit(), 0)\n else -> Long(0, high.takeHighestOneBit())\n }\n\n/**\n * Returns a number having a single bit set in the position of the least significant set bit of this [Long] number,\n * or zero, if this number is zero.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic actual fun Long.takeLowestOneBit(): Long =\n when (val low = this.low) {\n 0 -> Long(0, high.takeLowestOneBit())\n else -> Long(low.takeLowestOneBit(), 0)\n }\n\n/**\n * Rotates the binary representation of this [Long] number left by the specified [bitCount] number of bits.\n * The most significant bits pushed out from the left side reenter the number as the least significant bits on the right side.\n *\n * Rotating the number left by a negative bit count is the same as rotating it right by the negated bit count:\n * `number.rotateLeft(-n) == number.rotateRight(n)`\n *\n * Rotating by a multiple of [Long.SIZE_BITS] (64) returns the same number, or more generally\n * `number.rotateLeft(n) == number.rotateLeft(n % 64)`\n */\n@SinceKotlin(\"1.6\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic actual fun Long.rotateLeft(bitCount: Int): Long {\n if ((bitCount and 31) != 0) {\n val low = this.low\n val high = this.high\n val newLow = low.shl(bitCount) or high.ushr(-bitCount)\n val newHigh = high.shl(bitCount) or low.ushr(-bitCount)\n return if ((bitCount and 32) == 0) Long(newLow, newHigh) else Long(newHigh, newLow)\n } else {\n return if ((bitCount and 32) == 0) this else Long(high, low)\n }\n}\n\n\n/**\n * Rotates the binary representation of this [Long] number right by the specified [bitCount] number of bits.\n * The least significant bits pushed out from the right side reenter the number as the most significant bits on the left side.\n *\n * Rotating the number right by a negative bit count is the same as rotating it left by the negated bit count:\n * `number.rotateRight(-n) == number.rotateLeft(n)`\n *\n * Rotating by a multiple of [Long.SIZE_BITS] (64) returns the same number, or more generally\n * `number.rotateRight(n) == number.rotateRight(n % 64)`\n */\n@SinceKotlin(\"1.6\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic actual inline fun Long.rotateRight(bitCount: Int): Long = rotateLeft(-bitCount)\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.random\n\nimport kotlin.math.pow\n\ninternal actual fun defaultPlatformRandom(): Random =\n Random(js(\"(Math.random() * Math.pow(2, 32)) | 0\").unsafeCast())\n\n\nprivate val INV_2_26: Double = 2.0.pow(-26)\nprivate val INV_2_53: Double = 2.0.pow(-53)\ninternal actual fun doubleFromParts(hi26: Int, low27: Int): Double =\n hi26 * INV_2_26 + low27 * INV_2_53","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.reflect.js.internal\n\nimport kotlin.reflect.*\n\ninternal abstract class KClassImpl(\n internal open val jClass: JsClass\n) : KClass {\n\n override val qualifiedName: String?\n get() = TODO()\n\n override fun equals(other: Any?): Boolean {\n return other is KClassImpl<*> && jClass == other.jClass\n }\n\n // TODO: use FQN\n override fun hashCode(): Int = simpleName?.hashCode() ?: 0\n\n override fun toString(): String {\n // TODO: use FQN\n return \"class $simpleName\"\n }\n}\n\ninternal class SimpleKClassImpl(jClass: JsClass) : KClassImpl(jClass) {\n override val simpleName: String? = jClass.asDynamic().`$metadata$`?.simpleName.unsafeCast()\n\n override fun isInstance(value: Any?): Boolean {\n return jsIsType(value, jClass)\n }\n}\n\ninternal class PrimitiveKClassImpl(\n jClass: JsClass,\n private val givenSimpleName: String,\n private val isInstanceFunction: (Any?) -> Boolean\n) : KClassImpl(jClass) {\n override fun equals(other: Any?): Boolean {\n if (other !is PrimitiveKClassImpl<*>) return false\n return super.equals(other) && givenSimpleName == other.givenSimpleName\n }\n\n override val simpleName: String? get() = givenSimpleName\n\n override fun isInstance(value: Any?): Boolean {\n return isInstanceFunction(value)\n }\n}\n\ninternal object NothingKClassImpl : KClassImpl(js(\"Object\")) {\n override val simpleName: String = \"Nothing\"\n\n override fun isInstance(value: Any?): Boolean = false\n\n override val jClass: JsClass\n get() = throw UnsupportedOperationException(\"There's no native JS class for Nothing type\")\n\n override fun equals(other: Any?): Boolean = other === this\n\n override fun hashCode(): Int = 0\n}\n\ninternal class ErrorKClass : KClass {\n override val simpleName: String? get() = error(\"Unknown simpleName for ErrorKClass\")\n override val qualifiedName: String? get() = error(\"Unknown qualifiedName for ErrorKClass\")\n\n override fun isInstance(value: Any?): Boolean = error(\"Can's check isInstance on ErrorKClass\")\n\n override fun equals(other: Any?): Boolean = other === this\n\n override fun hashCode(): Int = 0\n}","/*\n * Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license\n * that can be found in the license/LICENSE.txt file.\n */\n\n\n@file:Suppress(\"UNUSED_PARAMETER\")\n\npackage kotlin.js\n\n@kotlin.internal.InlineOnly\ninternal inline fun jsDeleteProperty(obj: Any, property: Any) {\n js(\"delete obj[property]\")\n}\n\n@kotlin.internal.InlineOnly\ninternal inline fun jsBitwiseOr(lhs: Any?, rhs: Any?): Int =\n js(\"lhs | rhs\").unsafeCast()","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.collections\n\n/**\n * The common interface of [InternalStringMap] and [InternalHashCodeMap].\n */\ninternal interface InternalMap : MutableIterable> {\n val equality: EqualityComparator\n val size: Int\n operator fun contains(key: K): Boolean\n operator fun get(key: K): V?\n\n fun put(key: K, value: V): V?\n fun remove(key: K): V?\n fun clear(): Unit\n\n fun createJsMap(): dynamic {\n val result = js(\"Object.create(null)\")\n // force to switch object representation to dictionary mode\n result[\"foo\"] = 1\n jsDeleteProperty(result, \"foo\")\n return result\n }\n}\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.text\n\nimport kotlin.js.RegExp\n\n/**\n * Converts the characters in the specified array to a string.\n */\n@SinceKotlin(\"1.2\")\n@Deprecated(\"Use CharArray.concatToString() instead\", ReplaceWith(\"chars.concatToString()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\")\npublic actual fun String(chars: CharArray): String {\n var result = \"\"\n for (char in chars) {\n result += char\n }\n return result\n}\n\n/**\n * Converts the characters from a portion of the specified array to a string.\n *\n * @throws IndexOutOfBoundsException if either [offset] or [length] are less than zero\n * or `offset + length` is out of [chars] array bounds.\n */\n@SinceKotlin(\"1.2\")\n@Deprecated(\"Use CharArray.concatToString(startIndex, endIndex) instead\", ReplaceWith(\"chars.concatToString(offset, offset + length)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.4\", errorSince = \"1.5\")\npublic actual fun String(chars: CharArray, offset: Int, length: Int): String {\n if (offset < 0 || length < 0 || chars.size - offset < length)\n throw IndexOutOfBoundsException(\"size: ${chars.size}; offset: $offset; length: $length\")\n var result = \"\"\n for (index in offset until offset + length) {\n result += chars[index]\n }\n return result\n}\n\n/**\n * Concatenates characters in this [CharArray] into a String.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic actual fun CharArray.concatToString(): String {\n var result = \"\"\n for (char in this) {\n result += char\n }\n return result\n}\n\n/**\n * Concatenates characters in this [CharArray] or its subrange into a String.\n *\n * @param startIndex the beginning (inclusive) of the subrange of characters, 0 by default.\n * @param endIndex the end (exclusive) of the subrange of characters, size of this array by default.\n *\n * @throws IndexOutOfBoundsException if [startIndex] is less than zero or [endIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [startIndex] is greater than [endIndex].\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun CharArray.concatToString(startIndex: Int = 0, endIndex: Int = this.size): String {\n AbstractList.checkBoundsIndexes(startIndex, endIndex, this.size)\n var result = \"\"\n for (index in startIndex until endIndex) {\n result += this[index]\n }\n return result\n}\n\n/**\n * Returns a [CharArray] containing characters of this string.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic actual fun String.toCharArray(): CharArray {\n return CharArray(length) { get(it) }\n}\n\n/**\n * Returns a [CharArray] containing characters of this string or its substring.\n *\n * @param startIndex the beginning (inclusive) of the substring, 0 by default.\n * @param endIndex the end (exclusive) of the substring, length of this string by default.\n *\n * @throws IndexOutOfBoundsException if [startIndex] is less than zero or [endIndex] is greater than the length of this string.\n * @throws IllegalArgumentException if [startIndex] is greater than [endIndex].\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun String.toCharArray(startIndex: Int = 0, endIndex: Int = this.length): CharArray {\n AbstractList.checkBoundsIndexes(startIndex, endIndex, length)\n return CharArray(endIndex - startIndex) { get(startIndex + it) }\n}\n\n/**\n * Decodes a string from the bytes in UTF-8 encoding in this array.\n *\n * Malformed byte sequences are replaced by the replacement char `\\uFFFD`.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic actual fun ByteArray.decodeToString(): String {\n return decodeUtf8(this, 0, size, false)\n}\n\n/**\n * Decodes a string from the bytes in UTF-8 encoding in this array or its subrange.\n *\n * @param startIndex the beginning (inclusive) of the subrange to decode, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to decode, size of this array by default.\n * @param throwOnInvalidSequence specifies whether to throw an exception on malformed byte sequence or replace it by the replacement char `\\uFFFD`.\n *\n * @throws IndexOutOfBoundsException if [startIndex] is less than zero or [endIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [startIndex] is greater than [endIndex].\n * @throws CharacterCodingException if the byte array contains malformed UTF-8 byte sequence and [throwOnInvalidSequence] is true.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun ByteArray.decodeToString(\n startIndex: Int = 0,\n endIndex: Int = this.size,\n throwOnInvalidSequence: Boolean = false\n): String {\n AbstractList.checkBoundsIndexes(startIndex, endIndex, this.size)\n return decodeUtf8(this, startIndex, endIndex, throwOnInvalidSequence)\n}\n\n/**\n * Encodes this string to an array of bytes in UTF-8 encoding.\n *\n * Any malformed char sequence is replaced by the replacement byte sequence.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic actual fun String.encodeToByteArray(): ByteArray {\n return encodeUtf8(this, 0, length, false)\n}\n\n/**\n * Encodes this string or its substring to an array of bytes in UTF-8 encoding.\n *\n * @param startIndex the beginning (inclusive) of the substring to encode, 0 by default.\n * @param endIndex the end (exclusive) of the substring to encode, length of this string by default.\n * @param throwOnInvalidSequence specifies whether to throw an exception on malformed char sequence or replace.\n *\n * @throws IndexOutOfBoundsException if [startIndex] is less than zero or [endIndex] is greater than the length of this string.\n * @throws IllegalArgumentException if [startIndex] is greater than [endIndex].\n * @throws CharacterCodingException if this string contains malformed char sequence and [throwOnInvalidSequence] is true.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun String.encodeToByteArray(\n startIndex: Int = 0,\n endIndex: Int = this.length,\n throwOnInvalidSequence: Boolean = false\n): ByteArray {\n AbstractList.checkBoundsIndexes(startIndex, endIndex, length)\n return encodeUtf8(this, startIndex, endIndex, throwOnInvalidSequence)\n}\n\n/**\n * Returns a copy of this string converted to upper case using the rules of the default locale.\n */\n@Deprecated(\"Use uppercase() instead.\", ReplaceWith(\"uppercase()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\n@kotlin.internal.InlineOnly\npublic actual inline fun String.toUpperCase(): String = asDynamic().toUpperCase()\n\n/**\n * Returns a copy of this string converted to upper case using Unicode mapping rules of the invariant locale.\n *\n * This function supports one-to-many and many-to-one character mapping,\n * thus the length of the returned string can be different from the length of the original string.\n *\n * @sample samples.text.Strings.uppercase\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic actual inline fun String.uppercase(): String = asDynamic().toUpperCase()\n\n/**\n * Returns a copy of this string converted to lower case using the rules of the default locale.\n */\n@Deprecated(\"Use lowercase() instead.\", ReplaceWith(\"lowercase()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\n@kotlin.internal.InlineOnly\npublic actual inline fun String.toLowerCase(): String = asDynamic().toLowerCase()\n\n/**\n * Returns a copy of this string converted to lower case using Unicode mapping rules of the invariant locale.\n *\n * This function supports one-to-many and many-to-one character mapping,\n * thus the length of the returned string can be different from the length of the original string.\n *\n * @sample samples.text.Strings.lowercase\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic actual inline fun String.lowercase(): String = asDynamic().toLowerCase()\n\n@kotlin.internal.InlineOnly\ninternal actual inline fun String.nativeIndexOf(str: String, fromIndex: Int): Int = asDynamic().indexOf(str, fromIndex)\n\n@kotlin.internal.InlineOnly\ninternal actual inline fun String.nativeLastIndexOf(str: String, fromIndex: Int): Int = asDynamic().lastIndexOf(str, fromIndex)\n\n@kotlin.internal.InlineOnly\ninternal inline fun String.nativeStartsWith(s: String, position: Int): Boolean = asDynamic().startsWith(s, position)\n\n@kotlin.internal.InlineOnly\ninternal inline fun String.nativeEndsWith(s: String): Boolean = asDynamic().endsWith(s)\n\n@kotlin.internal.InlineOnly\npublic actual inline fun String.substring(startIndex: Int): String = asDynamic().substring(startIndex)\n\n@kotlin.internal.InlineOnly\npublic actual inline fun String.substring(startIndex: Int, endIndex: Int): String = asDynamic().substring(startIndex, endIndex)\n\n@Deprecated(\"Use String.plus() instead\", ReplaceWith(\"this + str\"))\n@DeprecatedSinceKotlin(warningSince = \"1.6\")\n@kotlin.internal.InlineOnly\npublic inline fun String.concat(str: String): String = asDynamic().concat(str)\n\n@Deprecated(\"Use Regex.findAll() instead or invoke matches() on String dynamically: this.asDynamic().match(regex)\")\n@DeprecatedSinceKotlin(warningSince = \"1.6\")\n@kotlin.internal.InlineOnly\npublic inline fun String.match(regex: String): Array? = asDynamic().match(regex)\n\n//native public fun String.trim(): String\n//TODO: String.replace to implement effective trimLeading and trimTrailing\n\n@kotlin.internal.InlineOnly\ninternal inline fun String.nativeReplace(pattern: RegExp, replacement: String): String = asDynamic().replace(pattern, replacement)\n\n/**\n * Compares two strings lexicographically, optionally ignoring case differences.\n *\n * If [ignoreCase] is true, the result of `Char.uppercaseChar().lowercaseChar()` on each character is compared.\n */\n@SinceKotlin(\"1.2\")\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun String.compareTo(other: String, ignoreCase: Boolean = false): Int {\n if (ignoreCase) {\n val n1 = this.length\n val n2 = other.length\n val min = minOf(n1, n2)\n if (min == 0) return n1 - n2\n for (index in 0 until min) {\n var thisChar = this[index]\n var otherChar = other[index]\n\n if (thisChar != otherChar) {\n thisChar = thisChar.uppercaseChar()\n otherChar = otherChar.uppercaseChar()\n\n if (thisChar != otherChar) {\n thisChar = thisChar.lowercaseChar()\n otherChar = otherChar.lowercaseChar()\n\n if (thisChar != otherChar) {\n return thisChar.compareTo(otherChar)\n }\n }\n }\n }\n return n1 - n2\n } else {\n return compareTo(other)\n }\n}\n\n/**\n * Returns `true` if the contents of this char sequence are equal to the contents of the specified [other],\n * i.e. both char sequences contain the same number of the same characters in the same order.\n *\n * @sample samples.text.Strings.contentEquals\n */\n@SinceKotlin(\"1.5\")\npublic actual infix fun CharSequence?.contentEquals(other: CharSequence?): Boolean = contentEqualsImpl(other)\n\n/**\n * Returns `true` if the contents of this char sequence are equal to the contents of the specified [other], optionally ignoring case difference.\n *\n * @param ignoreCase `true` to ignore character case when comparing contents.\n *\n * @sample samples.text.Strings.contentEquals\n */\n@SinceKotlin(\"1.5\")\npublic actual fun CharSequence?.contentEquals(other: CharSequence?, ignoreCase: Boolean): Boolean {\n return if (ignoreCase)\n this.contentEqualsIgnoreCaseImpl(other)\n else\n this.contentEqualsImpl(other)\n}\n\n\nprivate val STRING_CASE_INSENSITIVE_ORDER = Comparator { a, b -> a.compareTo(b, ignoreCase = true) }\n\n@SinceKotlin(\"1.2\")\npublic actual val String.Companion.CASE_INSENSITIVE_ORDER: Comparator\n get() = STRING_CASE_INSENSITIVE_ORDER\n","/*\n * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.reflect.js.internal\n\nimport kotlin.reflect.*\n\ninternal class KTypeImpl(\n override val classifier: KClassifier,\n override val arguments: List,\n override val isMarkedNullable: Boolean\n) : KType {\n override fun equals(other: Any?): Boolean =\n other is KTypeImpl &&\n classifier == other.classifier && arguments == other.arguments && isMarkedNullable == other.isMarkedNullable\n\n override fun hashCode(): Int =\n (classifier.hashCode() * 31 + arguments.hashCode()) * 31 + isMarkedNullable.hashCode()\n\n override fun toString(): String {\n val kClass = (classifier as? KClass<*>)\n val classifierName = when {\n kClass == null -> classifier.toString()\n kClass.simpleName != null -> kClass.simpleName\n else -> \"(non-denotable type)\"\n }\n\n val args =\n if (arguments.isEmpty()) \"\"\n else arguments.joinToString(\", \", \"<\", \">\")\n val nullable = if (isMarkedNullable) \"?\" else \"\"\n\n return classifierName + args + nullable\n }\n}\n\ninternal object DynamicKType : KType {\n override val classifier: KClassifier? = null\n override val arguments: List = emptyList()\n override val isMarkedNullable: Boolean = false\n override fun toString(): String = \"dynamic\"\n}\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.reflect.js.internal\n\nimport kotlin.js.JsClass\n\n@JsName(\"PrimitiveClasses\")\ninternal object PrimitiveClasses {\n @JsName(\"anyClass\")\n val anyClass = PrimitiveKClassImpl(js(\"Object\").unsafeCast>(), \"Any\", { it is Any })\n\n @JsName(\"numberClass\")\n val numberClass = PrimitiveKClassImpl(js(\"Number\").unsafeCast>(), \"Number\", { it is Number })\n\n @JsName(\"nothingClass\")\n val nothingClass = NothingKClassImpl\n\n @JsName(\"booleanClass\")\n val booleanClass = PrimitiveKClassImpl(js(\"Boolean\").unsafeCast>(), \"Boolean\", { it is Boolean })\n\n @JsName(\"byteClass\")\n val byteClass = PrimitiveKClassImpl(js(\"Number\").unsafeCast>(), \"Byte\", { it is Byte })\n\n @JsName(\"shortClass\")\n val shortClass = PrimitiveKClassImpl(js(\"Number\").unsafeCast>(), \"Short\", { it is Short })\n\n @JsName(\"intClass\")\n val intClass = PrimitiveKClassImpl(js(\"Number\").unsafeCast>(), \"Int\", { it is Int })\n\n @JsName(\"floatClass\")\n val floatClass = PrimitiveKClassImpl(js(\"Number\").unsafeCast>(), \"Float\", { it is Float })\n\n @JsName(\"doubleClass\")\n val doubleClass = PrimitiveKClassImpl(js(\"Number\").unsafeCast>(), \"Double\", { it is Double })\n\n @JsName(\"arrayClass\")\n val arrayClass = PrimitiveKClassImpl(js(\"Array\").unsafeCast>>(), \"Array\", { it is Array<*> })\n\n @JsName(\"stringClass\")\n val stringClass = PrimitiveKClassImpl(js(\"String\").unsafeCast>(), \"String\", { it is String })\n\n @JsName(\"throwableClass\")\n val throwableClass = PrimitiveKClassImpl(js(\"Error\").unsafeCast>(), \"Throwable\", { it is Throwable })\n\n @JsName(\"booleanArrayClass\")\n val booleanArrayClass = PrimitiveKClassImpl(js(\"Array\").unsafeCast>(), \"BooleanArray\", { it is BooleanArray })\n\n @JsName(\"charArrayClass\")\n val charArrayClass = PrimitiveKClassImpl(js(\"Uint16Array\").unsafeCast>(), \"CharArray\", { it is CharArray })\n\n @JsName(\"byteArrayClass\")\n val byteArrayClass = PrimitiveKClassImpl(js(\"Int8Array\").unsafeCast>(), \"ByteArray\", { it is ByteArray })\n\n @JsName(\"shortArrayClass\")\n val shortArrayClass = PrimitiveKClassImpl(js(\"Int16Array\").unsafeCast>(), \"ShortArray\", { it is ShortArray })\n\n @JsName(\"intArrayClass\")\n val intArrayClass = PrimitiveKClassImpl(js(\"Int32Array\").unsafeCast>(), \"IntArray\", { it is IntArray })\n\n @JsName(\"longArrayClass\")\n val longArrayClass = PrimitiveKClassImpl(js(\"Array\").unsafeCast>(), \"LongArray\", { it is LongArray })\n\n @JsName(\"floatArrayClass\")\n val floatArrayClass = PrimitiveKClassImpl(js(\"Float32Array\").unsafeCast>(), \"FloatArray\", { it is FloatArray })\n\n @JsName(\"doubleArrayClass\")\n val doubleArrayClass = PrimitiveKClassImpl(js(\"Float64Array\").unsafeCast>(), \"DoubleArray\", { it is DoubleArray })\n\n @JsName(\"functionClass\")\n fun functionClass(arity: Int): KClassImpl {\n return functionClasses.get(arity) ?: run {\n val result = PrimitiveKClassImpl(js(\"Function\").unsafeCast>(), \"Function$arity\",\n { jsTypeOf(it) === \"function\" && it.asDynamic().length === arity })\n functionClasses.asDynamic()[arity] = result\n result\n }\n }\n}\n\nprivate val functionClasses = arrayOfNulls>(0)","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n// a package is omitted to get declarations directly under the module\n\nimport kotlin.reflect.*\nimport kotlin.reflect.js.internal.*\n\n@JsName(\"getKClass\")\ninternal fun getKClass(jClass: Any /* JsClass | Array> */): KClass {\n return if (js(\"Array\").isArray(jClass)) {\n getKClassM(jClass.unsafeCast>>())\n } else {\n getKClass1(jClass.unsafeCast>())\n }\n}\n\n@JsName(\"getKClassM\")\ninternal fun getKClassM(jClasses: Array>): KClass = when (jClasses.size) {\n 1 -> getKClass1(jClasses[0])\n 0 -> NothingKClassImpl.unsafeCast>()\n else -> ErrorKClass().unsafeCast>()\n}\n\n@JsName(\"getKClassFromExpression\")\ninternal fun getKClassFromExpression(e: T): KClass =\n when (jsTypeOf(e)) {\n \"string\" -> PrimitiveClasses.stringClass\n \"number\" -> if (jsBitwiseOr(e, 0).asDynamic() === e) PrimitiveClasses.intClass else PrimitiveClasses.doubleClass\n \"boolean\" -> PrimitiveClasses.booleanClass\n \"function\" -> PrimitiveClasses.functionClass(e.asDynamic().length)\n else -> {\n when {\n e is BooleanArray -> PrimitiveClasses.booleanArrayClass\n e is CharArray -> PrimitiveClasses.charArrayClass\n e is ByteArray -> PrimitiveClasses.byteArrayClass\n e is ShortArray -> PrimitiveClasses.shortArrayClass\n e is IntArray -> PrimitiveClasses.intArrayClass\n e is LongArray -> PrimitiveClasses.longArrayClass\n e is FloatArray -> PrimitiveClasses.floatArrayClass\n e is DoubleArray -> PrimitiveClasses.doubleArrayClass\n e is KClass<*> -> KClass::class\n e is Array<*> -> PrimitiveClasses.arrayClass\n else -> {\n val constructor = js(\"Object\").getPrototypeOf(e).constructor\n when {\n constructor === js(\"Object\") -> PrimitiveClasses.anyClass\n constructor === js(\"Error\") -> PrimitiveClasses.throwableClass\n else -> {\n val jsClass: JsClass = constructor\n getKClass1(jsClass)\n }\n }\n }\n }\n }\n }.unsafeCast>()\n\n@JsName(\"getKClass1\")\ninternal fun getKClass1(jClass: JsClass): KClass {\n if (jClass === js(\"String\")) return PrimitiveClasses.stringClass.unsafeCast>()\n\n val metadata = jClass.asDynamic().`$metadata$`\n\n return if (metadata != null) {\n if (metadata.`$kClass$` == null) {\n val kClass = SimpleKClassImpl(jClass)\n metadata.`$kClass$` = kClass\n kClass\n } else {\n metadata.`$kClass$`\n }\n } else {\n SimpleKClassImpl(jClass)\n }\n}","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.js\n\n/**\n * Exposes the JavaScript [RegExp object](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/RegExp) to Kotlin.\n */\n@Suppress(\"NOT_DOCUMENTED\")\npublic external class RegExp(pattern: String, flags: String? = definedExternally) {\n\n public fun test(str: String): Boolean\n\n public fun exec(str: String): RegExpMatch?\n\n public override fun toString(): String\n\n /**\n * The lastIndex is a read/write integer property of regular expressions that specifies the index at which to start the next match.\n */\n public var lastIndex: Int\n\n public val global: Boolean\n public val ignoreCase: Boolean\n public val multiline: Boolean\n}\n\n/**\n * Resets the regular expression so that subsequent [RegExp.test] and [RegExp.exec] calls will match starting with the beginning of the input string.\n */\npublic fun RegExp.reset() {\n lastIndex = 0\n}\n\n// TODO: Inherit from array or introduce asArray() extension\n/**\n * Represents the return value of [RegExp.exec].\n */\n@Suppress(\"NOT_DOCUMENTED\")\npublic external interface RegExpMatch {\n public val index: Int\n public val input: String\n public val length: Int\n}\n\n/**\n * Returns the entire text matched by [RegExp.exec] if the [index] parameter is 0, or the text matched by the capturing parenthesis\n * at the given index.\n */\npublic inline operator fun RegExpMatch.get(index: Int): String? = asDynamic()[index]\n\n/**\n * Converts the result of [RegExp.exec] to an array where the first element contains the entire matched text and each subsequent\n * element is the text matched by each capturing parenthesis.\n */\npublic inline fun RegExpMatch.asArray(): Array = unsafeCast>()\n","/*\n * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.text\n\n/**\n * The exception thrown when a character encoding or decoding error occurs.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic actual open class CharacterCodingException(message: String?) : Exception(message) {\n actual constructor() : this(null)\n}\n","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.text\n\n/**\n * A mutable sequence of characters.\n *\n * String builder can be used to efficiently perform multiple string manipulation operations.\n */\npublic actual class StringBuilder actual constructor(content: String) : Appendable, CharSequence {\n /**\n * Constructs an empty string builder with the specified initial [capacity].\n *\n * In Kotlin/JS implementation of StringBuilder the initial capacity has no effect on the further performance of operations.\n */\n actual constructor(capacity: Int) : this() {\n }\n\n /** Constructs a string builder that contains the same characters as the specified [content] char sequence. */\n actual constructor(content: CharSequence) : this(content.toString()) {}\n\n /** Constructs an empty string builder. */\n actual constructor() : this(\"\")\n\n private var string: String = if (content !== undefined) content else \"\"\n\n actual override val length: Int\n get() = string.asDynamic().length\n\n actual override fun get(index: Int): Char =\n string.getOrElse(index) { throw IndexOutOfBoundsException(\"index: $index, length: $length}\") }\n\n actual override fun subSequence(startIndex: Int, endIndex: Int): CharSequence = string.substring(startIndex, endIndex)\n\n actual override fun append(value: Char): StringBuilder {\n string += value\n return this\n }\n\n actual override fun append(value: CharSequence?): StringBuilder {\n string += value.toString()\n return this\n }\n\n actual override fun append(value: CharSequence?, startIndex: Int, endIndex: Int): StringBuilder =\n this.appendRange(value ?: \"null\", startIndex, endIndex)\n\n /**\n * Reverses the contents of this string builder and returns this instance.\n *\n * Surrogate pairs included in this string builder are treated as single characters.\n * Therefore, the order of the high-low surrogates is never reversed.\n *\n * Note that the reverse operation may produce new surrogate pairs that were unpaired low-surrogates and high-surrogates before the operation.\n * For example, reversing `\"\\uDC00\\uD800\"` produces `\"\\uD800\\uDC00\"` which is a valid surrogate pair.\n */\n actual fun reverse(): StringBuilder {\n var reversed = \"\"\n var index = string.length - 1\n while (index >= 0) {\n val low = string[index--]\n if (low.isLowSurrogate() && index >= 0) {\n val high = string[index--]\n if (high.isHighSurrogate()) {\n reversed = reversed + high + low\n } else {\n reversed = reversed + low + high\n }\n } else {\n reversed += low\n }\n }\n string = reversed\n return this\n }\n\n /**\n * Appends the string representation of the specified object [value] to this string builder and returns this instance.\n *\n * The overall effect is exactly as if the [value] were converted to a string by the `value.toString()` method,\n * and then that string was appended to this string builder.\n */\n actual fun append(value: Any?): StringBuilder {\n string += value.toString()\n return this\n }\n\n /**\n * Appends the string representation of the specified boolean [value] to this string builder and returns this instance.\n *\n * The overall effect is exactly as if the [value] were converted to a string by the `value.toString()` method,\n * and then that string was appended to this string builder.\n */\n @SinceKotlin(\"1.3\")\n actual fun append(value: Boolean): StringBuilder {\n string += value\n return this\n }\n\n /**\n * Appends characters in the specified character array [value] to this string builder and returns this instance.\n *\n * Characters are appended in order, starting at the index 0.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n actual fun append(value: CharArray): StringBuilder {\n string += value.concatToString()\n return this\n }\n\n @Deprecated(\"Provided for binary compatibility.\", level = DeprecationLevel.HIDDEN)\n fun append(value: String): StringBuilder = append(value)\n\n /**\n * Appends the specified string [value] to this string builder and returns this instance.\n *\n * If [value] is `null`, then the four characters `\"null\"` are appended.\n */\n @SinceKotlin(\"1.3\")\n actual fun append(value: String?): StringBuilder {\n this.string += value ?: \"null\"\n return this\n }\n\n /**\n * Returns the current capacity of this string builder.\n *\n * The capacity is the maximum length this string builder can have before an allocation occurs.\n *\n * In Kotlin/JS implementation of StringBuilder the value returned from this method may not indicate the actual size of the backing storage.\n */\n @SinceKotlin(\"1.3\")\n// @ExperimentalStdlibApi\n @Deprecated(\"Obtaining StringBuilder capacity is not supported in JS and common code.\", level = DeprecationLevel.ERROR)\n actual fun capacity(): Int = length\n\n /**\n * Ensures that the capacity of this string builder is at least equal to the specified [minimumCapacity].\n *\n * If the current capacity is less than the [minimumCapacity], a new backing storage is allocated with greater capacity.\n * Otherwise, this method takes no action and simply returns.\n *\n * In Kotlin/JS implementation of StringBuilder the size of the backing storage is not extended to comply the given [minimumCapacity],\n * thus calling this method has no effect on the further performance of operations.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n actual fun ensureCapacity(minimumCapacity: Int) {\n }\n\n /**\n * Returns the index within this string builder of the first occurrence of the specified [string].\n *\n * Returns `-1` if the specified [string] does not occur in this string builder.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n actual fun indexOf(string: String): Int = this.string.asDynamic().indexOf(string)\n\n /**\n * Returns the index within this string builder of the first occurrence of the specified [string],\n * starting at the specified [startIndex].\n *\n * Returns `-1` if the specified [string] does not occur in this string builder starting at the specified [startIndex].\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n actual fun indexOf(string: String, startIndex: Int): Int = this.string.asDynamic().indexOf(string, startIndex)\n\n /**\n * Returns the index within this string builder of the last occurrence of the specified [string].\n * The last occurrence of empty string `\"\"` is considered to be at the index equal to `this.length`.\n *\n * Returns `-1` if the specified [string] does not occur in this string builder.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n actual fun lastIndexOf(string: String): Int = this.string.asDynamic().lastIndexOf(string)\n\n /**\n * Returns the index within this string builder of the last occurrence of the specified [string],\n * starting from the specified [startIndex] toward the beginning.\n *\n * Returns `-1` if the specified [string] does not occur in this string builder starting at the specified [startIndex].\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n actual fun lastIndexOf(string: String, startIndex: Int): Int {\n if (string.isEmpty() && startIndex < 0) return -1\n return this.string.asDynamic().lastIndexOf(string, startIndex)\n }\n\n /**\n * Inserts the string representation of the specified boolean [value] into this string builder at the specified [index] and returns this instance.\n *\n * The overall effect is exactly as if the [value] were converted to a string by the `value.toString()` method,\n * and then that string was inserted into this string builder at the specified [index].\n *\n * @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n actual fun insert(index: Int, value: Boolean): StringBuilder {\n AbstractList.checkPositionIndex(index, length)\n\n string = string.substring(0, index) + value + string.substring(index)\n return this\n }\n\n /**\n * Inserts the specified character [value] into this string builder at the specified [index] and returns this instance.\n *\n * @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n actual fun insert(index: Int, value: Char): StringBuilder {\n AbstractList.checkPositionIndex(index, length)\n\n string = string.substring(0, index) + value + string.substring(index)\n return this\n }\n\n /**\n * Inserts characters in the specified character array [value] into this string builder at the specified [index] and returns this instance.\n *\n * The inserted characters go in same order as in the [value] character array, starting at [index].\n *\n * @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n actual fun insert(index: Int, value: CharArray): StringBuilder {\n AbstractList.checkPositionIndex(index, length)\n\n string = string.substring(0, index) + value.concatToString() + string.substring(index)\n return this\n }\n\n /**\n * Inserts characters in the specified character sequence [value] into this string builder at the specified [index] and returns this instance.\n *\n * The inserted characters go in the same order as in the [value] character sequence, starting at [index].\n *\n * @param index the position in this string builder to insert at.\n * @param value the character sequence from which characters are inserted. If [value] is `null`, then the four characters `\"null\"` are inserted.\n *\n * @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n actual fun insert(index: Int, value: CharSequence?): StringBuilder {\n AbstractList.checkPositionIndex(index, length)\n\n string = string.substring(0, index) + value.toString() + string.substring(index)\n return this\n }\n\n /**\n * Inserts the string representation of the specified object [value] into this string builder at the specified [index] and returns this instance.\n *\n * The overall effect is exactly as if the [value] were converted to a string by the `value.toString()` method,\n * and then that string was inserted into this string builder at the specified [index].\n *\n * @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n actual fun insert(index: Int, value: Any?): StringBuilder {\n AbstractList.checkPositionIndex(index, length)\n\n string = string.substring(0, index) + value.toString() + string.substring(index)\n return this\n }\n\n @Deprecated(\"Provided for binary compatibility.\", level = DeprecationLevel.HIDDEN)\n fun insert(index: Int, value: String): StringBuilder = insert(index, value)\n\n /**\n * Inserts the string [value] into this string builder at the specified [index] and returns this instance.\n *\n * If [value] is `null`, then the four characters `\"null\"` are inserted.\n *\n * @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n actual fun insert(index: Int, value: String?): StringBuilder {\n AbstractList.checkPositionIndex(index, length)\n\n val toInsert = value ?: \"null\"\n this.string = this.string.substring(0, index) + toInsert + this.string.substring(index)\n return this\n }\n\n /**\n * Sets the length of this string builder to the specified [newLength].\n *\n * If the [newLength] is less than the current length, it is changed to the specified [newLength].\n * Otherwise, null characters '\\u0000' are appended to this string builder until its length is less than the [newLength].\n *\n * Note that in Kotlin/JS [set] operator function has non-constant execution time complexity.\n * Therefore, increasing length of this string builder and then updating each character by index may slow down your program.\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] if [newLength] is less than zero.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n actual fun setLength(newLength: Int) {\n if (newLength < 0) {\n throw IllegalArgumentException(\"Negative new length: $newLength.\")\n }\n\n if (newLength <= length) {\n string = string.substring(0, newLength)\n } else {\n for (i in length until newLength) {\n string += '\\u0000'\n }\n }\n }\n\n /**\n * Returns a new [String] that contains characters in this string builder at [startIndex] (inclusive) and up to the [length] (exclusive).\n *\n * @throws IndexOutOfBoundsException if [startIndex] is less than zero or greater than the length of this string builder.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n actual fun substring(startIndex: Int): String {\n AbstractList.checkPositionIndex(startIndex, length)\n\n return string.substring(startIndex)\n }\n\n /**\n * Returns a new [String] that contains characters in this string builder at [startIndex] (inclusive) and up to the [endIndex] (exclusive).\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this string builder indices or when `startIndex > endIndex`.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n actual fun substring(startIndex: Int, endIndex: Int): String {\n AbstractList.checkBoundsIndexes(startIndex, endIndex, length)\n\n return string.substring(startIndex, endIndex)\n }\n\n /**\n * Attempts to reduce storage used for this string builder.\n *\n * If the backing storage of this string builder is larger than necessary to hold its current contents,\n * then it may be resized to become more space efficient.\n * Calling this method may, but is not required to, affect the value of the [capacity] property.\n *\n * In Kotlin/JS implementation of StringBuilder the size of the backing storage is always equal to the length of the string builder.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n actual fun trimToSize() {\n }\n\n override fun toString(): String = string\n\n /**\n * Clears the content of this string builder making it empty and returns this instance.\n *\n * @sample samples.text.Strings.clearStringBuilder\n */\n @SinceKotlin(\"1.3\")\n public fun clear(): StringBuilder {\n string = \"\"\n return this\n }\n\n /**\n * Sets the character at the specified [index] to the specified [value].\n *\n * @throws IndexOutOfBoundsException if [index] is out of bounds of this string builder.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n public operator fun set(index: Int, value: Char) {\n AbstractList.checkElementIndex(index, length)\n\n string = string.substring(0, index) + value + string.substring(index + 1)\n }\n\n /**\n * Replaces characters in the specified range of this string builder with characters in the specified string [value] and returns this instance.\n *\n * @param startIndex the beginning (inclusive) of the range to replace.\n * @param endIndex the end (exclusive) of the range to replace.\n * @param value the string to replace with.\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] if [startIndex] is less than zero, greater than the length of this string builder, or `startIndex > endIndex`.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n public fun setRange(startIndex: Int, endIndex: Int, value: String): StringBuilder {\n checkReplaceRange(startIndex, endIndex, length)\n\n this.string = this.string.substring(0, startIndex) + value + this.string.substring(endIndex)\n return this\n }\n\n private fun checkReplaceRange(startIndex: Int, endIndex: Int, length: Int) {\n if (startIndex < 0 || startIndex > length) {\n throw IndexOutOfBoundsException(\"startIndex: $startIndex, length: $length\")\n }\n if (startIndex > endIndex) {\n throw IllegalArgumentException(\"startIndex($startIndex) > endIndex($endIndex)\")\n }\n }\n\n /**\n * Removes the character at the specified [index] from this string builder and returns this instance.\n *\n * If the `Char` at the specified [index] is part of a supplementary code point, this method does not remove the entire supplementary character.\n *\n * @param index the index of `Char` to remove.\n *\n * @throws IndexOutOfBoundsException if [index] is out of bounds of this string builder.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n public fun deleteAt(index: Int): StringBuilder {\n AbstractList.checkElementIndex(index, length)\n\n string = string.substring(0, index) + string.substring(index + 1)\n return this\n }\n\n /**\n * Removes characters in the specified range from this string builder and returns this instance.\n *\n * @param startIndex the beginning (inclusive) of the range to remove.\n * @param endIndex the end (exclusive) of the range to remove.\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] is out of range of this string builder indices or when `startIndex > endIndex`.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n public fun deleteRange(startIndex: Int, endIndex: Int): StringBuilder {\n checkReplaceRange(startIndex, endIndex, length)\n\n string = string.substring(0, startIndex) + string.substring(endIndex)\n return this\n }\n\n /**\n * Copies characters from this string builder into the [destination] character array.\n *\n * @param destination the array to copy to.\n * @param destinationOffset the position in the array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the range to copy, 0 by default.\n * @param endIndex the end (exclusive) of the range to copy, length of this string builder by default.\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this string builder indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n public fun toCharArray(destination: CharArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = this.length) {\n AbstractList.checkBoundsIndexes(startIndex, endIndex, length)\n AbstractList.checkBoundsIndexes(destinationOffset, destinationOffset + endIndex - startIndex, destination.size)\n\n var dstIndex = destinationOffset\n for (index in startIndex until endIndex) {\n destination[dstIndex++] = string[index]\n }\n }\n\n /**\n * Appends characters in a subarray of the specified character array [value] to this string builder and returns this instance.\n *\n * Characters are appended in order, starting at specified [startIndex].\n *\n * @param value the array from which characters are appended.\n * @param startIndex the beginning (inclusive) of the subarray to append.\n * @param endIndex the end (exclusive) of the subarray to append.\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of the [value] array indices or when `startIndex > endIndex`.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n public fun appendRange(value: CharArray, startIndex: Int, endIndex: Int): StringBuilder {\n string += value.concatToString(startIndex, endIndex)\n return this\n }\n\n /**\n * Appends a subsequence of the specified character sequence [value] to this string builder and returns this instance.\n *\n * @param value the character sequence from which a subsequence is appended.\n * @param startIndex the beginning (inclusive) of the subsequence to append.\n * @param endIndex the end (exclusive) of the subsequence to append.\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of the [value] character sequence indices or when `startIndex > endIndex`.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n public fun appendRange(value: CharSequence, startIndex: Int, endIndex: Int): StringBuilder {\n val stringCsq = value.toString()\n AbstractList.checkBoundsIndexes(startIndex, endIndex, stringCsq.length)\n\n string += stringCsq.substring(startIndex, endIndex)\n return this\n }\n\n /**\n * Inserts characters in a subarray of the specified character array [value] into this string builder at the specified [index] and returns this instance.\n *\n * The inserted characters go in same order as in the [value] array, starting at [index].\n *\n * @param index the position in this string builder to insert at.\n * @param value the array from which characters are inserted.\n * @param startIndex the beginning (inclusive) of the subarray to insert.\n * @param endIndex the end (exclusive) of the subarray to insert.\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of the [value] array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n public fun insertRange(index: Int, value: CharArray, startIndex: Int, endIndex: Int): StringBuilder {\n AbstractList.checkPositionIndex(index, this.length)\n\n string = string.substring(0, index) + value.concatToString(startIndex, endIndex) + string.substring(index)\n return this\n }\n\n /**\n * Inserts characters in a subsequence of the specified character sequence [value] into this string builder at the specified [index] and returns this instance.\n *\n * The inserted characters go in the same order as in the [value] character sequence, starting at [index].\n *\n * @param index the position in this string builder to insert at.\n * @param value the character sequence from which a subsequence is inserted.\n * @param startIndex the beginning (inclusive) of the subsequence to insert.\n * @param endIndex the end (exclusive) of the subsequence to insert.\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of the [value] character sequence indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n public fun insertRange(index: Int, value: CharSequence, startIndex: Int, endIndex: Int): StringBuilder {\n AbstractList.checkPositionIndex(index, length)\n\n val stringCsq = value.toString()\n AbstractList.checkBoundsIndexes(startIndex, endIndex, stringCsq.length)\n\n string = string.substring(0, index) + stringCsq.substring(startIndex, endIndex) + string.substring(index)\n return this\n }\n}\n\n\n/**\n * Clears the content of this string builder making it empty and returns this instance.\n *\n * @sample samples.text.Strings.clearStringBuilder\n */\n@SinceKotlin(\"1.3\")\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\", \"NOTHING_TO_INLINE\")\npublic actual inline fun StringBuilder.clear(): StringBuilder = this.clear()\n\n/**\n * Sets the character at the specified [index] to the specified [value].\n *\n * @throws IndexOutOfBoundsException if [index] is out of bounds of this string builder.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\", \"NOTHING_TO_INLINE\")\npublic actual inline operator fun StringBuilder.set(index: Int, value: Char) = this.set(index, value)\n\n/**\n * Replaces characters in the specified range of this string builder with characters in the specified string [value] and returns this instance.\n *\n * @param startIndex the beginning (inclusive) of the range to replace.\n * @param endIndex the end (exclusive) of the range to replace.\n * @param value the string to replace with.\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] if [startIndex] is less than zero, greater than the length of this string builder, or `startIndex > endIndex`.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\", \"NOTHING_TO_INLINE\")\npublic actual inline fun StringBuilder.setRange(startIndex: Int, endIndex: Int, value: String): StringBuilder =\n this.setRange(startIndex, endIndex, value)\n\n/**\n * Removes the character at the specified [index] from this string builder and returns this instance.\n *\n * If the `Char` at the specified [index] is part of a supplementary code point, this method does not remove the entire supplementary character.\n *\n * @param index the index of `Char` to remove.\n *\n * @throws IndexOutOfBoundsException if [index] is out of bounds of this string builder.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\", \"NOTHING_TO_INLINE\")\npublic actual inline fun StringBuilder.deleteAt(index: Int): StringBuilder = this.deleteAt(index)\n\n/**\n * Removes characters in the specified range from this string builder and returns this instance.\n *\n * @param startIndex the beginning (inclusive) of the range to remove.\n * @param endIndex the end (exclusive) of the range to remove.\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] is out of range of this string builder indices or when `startIndex > endIndex`.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\", \"NOTHING_TO_INLINE\")\npublic actual inline fun StringBuilder.deleteRange(startIndex: Int, endIndex: Int): StringBuilder = this.deleteRange(startIndex, endIndex)\n\n/**\n * Copies characters from this string builder into the [destination] character array.\n *\n * @param destination the array to copy to.\n * @param destinationOffset the position in the array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the range to copy, 0 by default.\n * @param endIndex the end (exclusive) of the range to copy, length of this string builder by default.\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this string builder indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\", \"NOTHING_TO_INLINE\", \"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual inline fun StringBuilder.toCharArray(destination: CharArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = this.length) =\n this.toCharArray(destination, destinationOffset, startIndex, endIndex)\n\n/**\n * Appends characters in a subarray of the specified character array [value] to this string builder and returns this instance.\n *\n * Characters are appended in order, starting at specified [startIndex].\n *\n * @param value the array from which characters are appended.\n * @param startIndex the beginning (inclusive) of the subarray to append.\n * @param endIndex the end (exclusive) of the subarray to append.\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of the [value] array indices or when `startIndex > endIndex`.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\", \"NOTHING_TO_INLINE\")\npublic actual inline fun StringBuilder.appendRange(value: CharArray, startIndex: Int, endIndex: Int): StringBuilder =\n this.appendRange(value, startIndex, endIndex)\n\n/**\n * Appends a subsequence of the specified character sequence [value] to this string builder and returns this instance.\n *\n * @param value the character sequence from which a subsequence is appended.\n * @param startIndex the beginning (inclusive) of the subsequence to append.\n * @param endIndex the end (exclusive) of the subsequence to append.\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of the [value] character sequence indices or when `startIndex > endIndex`.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\", \"NOTHING_TO_INLINE\")\npublic actual inline fun StringBuilder.appendRange(value: CharSequence, startIndex: Int, endIndex: Int): StringBuilder =\n this.appendRange(value, startIndex, endIndex)\n\n/**\n * Inserts characters in a subarray of the specified character array [value] into this string builder at the specified [index] and returns this instance.\n *\n * The inserted characters go in same order as in the [value] array, starting at [index].\n *\n * @param index the position in this string builder to insert at.\n * @param value the array from which characters are inserted.\n * @param startIndex the beginning (inclusive) of the subarray to insert.\n * @param endIndex the end (exclusive) of the subarray to insert.\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of the [value] array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\", \"NOTHING_TO_INLINE\")\npublic actual inline fun StringBuilder.insertRange(index: Int, value: CharArray, startIndex: Int, endIndex: Int): StringBuilder =\n this.insertRange(index, value, startIndex, endIndex)\n\n/**\n * Inserts characters in a subsequence of the specified character sequence [value] into this string builder at the specified [index] and returns this instance.\n *\n * The inserted characters go in the same order as in the [value] character sequence, starting at [index].\n *\n * @param index the position in this string builder to insert at.\n * @param value the character sequence from which a subsequence is inserted.\n * @param startIndex the beginning (inclusive) of the subsequence to insert.\n * @param endIndex the end (exclusive) of the subsequence to insert.\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of the [value] character sequence indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\", \"NOTHING_TO_INLINE\")\npublic actual inline fun StringBuilder.insertRange(index: Int, value: CharSequence, startIndex: Int, endIndex: Int): StringBuilder =\n this.insertRange(index, value, startIndex, endIndex)\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.text\n\n/**\n * Converts this character to lower case using Unicode mapping rules of the invariant locale.\n */\n@Deprecated(\"Use lowercaseChar() instead.\", ReplaceWith(\"lowercaseChar()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\n@kotlin.internal.InlineOnly\npublic actual inline fun Char.toLowerCase(): Char = lowercaseChar()\n\n/**\n * Converts this character to lower case using Unicode mapping rules of the invariant locale.\n *\n * This function performs one-to-one character mapping.\n * To support one-to-many character mapping use the [lowercase] function.\n * If this character has no mapping equivalent, the character itself is returned.\n *\n * @sample samples.text.Chars.lowercase\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic actual inline fun Char.lowercaseChar(): Char = lowercase()[0]\n\n/**\n * Converts this character to lower case using Unicode mapping rules of the invariant locale.\n *\n * This function supports one-to-many character mapping, thus the length of the returned string can be greater than one.\n * For example, `'\\u0130'.lowercase()` returns `\"\\u0069\\u0307\"`,\n * where `'\\u0130'` is the LATIN CAPITAL LETTER I WITH DOT ABOVE character (`İ`).\n * If this character has no lower case mapping, the result of `toString()` of this char is returned.\n *\n * @sample samples.text.Chars.lowercase\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic actual inline fun Char.lowercase(): String = toString().asDynamic().toLowerCase().unsafeCast()\n\n/**\n * Converts this character to upper case using Unicode mapping rules of the invariant locale.\n */\n@Deprecated(\"Use uppercaseChar() instead.\", ReplaceWith(\"uppercaseChar()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\n@kotlin.internal.InlineOnly\npublic actual inline fun Char.toUpperCase(): Char = uppercaseChar()\n\n/**\n * Converts this character to upper case using Unicode mapping rules of the invariant locale.\n *\n * This function performs one-to-one character mapping.\n * To support one-to-many character mapping use the [uppercase] function.\n * If this character has no mapping equivalent, the character itself is returned.\n *\n * @sample samples.text.Chars.uppercase\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic actual fun Char.uppercaseChar(): Char {\n val uppercase = uppercase()\n return if (uppercase.length > 1) this else uppercase[0]\n}\n\n/**\n * Converts this character to upper case using Unicode mapping rules of the invariant locale.\n *\n * This function supports one-to-many character mapping, thus the length of the returned string can be greater than one.\n * For example, `'\\uFB00'.uppercase()` returns `\"\\u0046\\u0046\"`,\n * where `'\\uFB00'` is the LATIN SMALL LIGATURE FF character (`ff`).\n * If this character has no upper case mapping, the result of `toString()` of this char is returned.\n *\n * @sample samples.text.Chars.uppercase\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic actual inline fun Char.uppercase(): String = toString().asDynamic().toUpperCase().unsafeCast()\n\n/**\n * Converts this character to title case using Unicode mapping rules of the invariant locale.\n *\n * This function performs one-to-one character mapping.\n * To support one-to-many character mapping use the [titlecase] function.\n * If this character has no mapping equivalent, the result of calling [uppercaseChar] is returned.\n *\n * @sample samples.text.Chars.titlecase\n */\n@SinceKotlin(\"1.5\")\npublic actual fun Char.titlecaseChar(): Char = titlecaseCharImpl()\n\n/**\n * Returns `true` if this character is a Unicode high-surrogate code unit (also known as leading-surrogate code unit).\n */\npublic actual fun Char.isHighSurrogate(): Boolean = this in Char.MIN_HIGH_SURROGATE..Char.MAX_HIGH_SURROGATE\n\n/**\n * Returns `true` if this character is a Unicode low-surrogate code unit (also known as trailing-surrogate code unit).\n */\npublic actual fun Char.isLowSurrogate(): Boolean = this in Char.MIN_LOW_SURROGATE..Char.MAX_LOW_SURROGATE\n\n/**\n * Returns the Unicode general category of this character.\n */\n@SinceKotlin(\"1.5\")\npublic actual val Char.category: CharCategory\n get() = CharCategory.valueOf(getCategoryValue())\n\n/**\n * Returns `true` if this character (Unicode code point) is defined in Unicode.\n *\n * A character is considered to be defined in Unicode if its [category] is not [CharCategory.UNASSIGNED].\n */\n@SinceKotlin(\"1.5\")\npublic actual fun Char.isDefined(): Boolean {\n if (this < '\\u0080') {\n return true\n }\n return getCategoryValue() != CharCategory.UNASSIGNED.value\n}\n\n/**\n * Returns `true` if this character is a letter.\n *\n * A character is considered to be a letter if its [category] is [CharCategory.UPPERCASE_LETTER],\n * [CharCategory.LOWERCASE_LETTER], [CharCategory.TITLECASE_LETTER], [CharCategory.MODIFIER_LETTER], or [CharCategory.OTHER_LETTER].\n *\n * @sample samples.text.Chars.isLetter\n */\n@SinceKotlin(\"1.5\")\npublic actual fun Char.isLetter(): Boolean {\n if (this in 'a'..'z' || this in 'A'..'Z') {\n return true\n }\n if (this < '\\u0080') {\n return false\n }\n return isLetterImpl()\n}\n\n/**\n * Returns `true` if this character is a letter or digit.\n *\n * @see isLetter\n * @see isDigit\n *\n * @sample samples.text.Chars.isLetterOrDigit\n */\n@SinceKotlin(\"1.5\")\npublic actual fun Char.isLetterOrDigit(): Boolean {\n if (this in 'a'..'z' || this in 'A'..'Z' || this in '0'..'9') {\n return true\n }\n if (this < '\\u0080') {\n return false\n }\n\n return isDigitImpl() || isLetterImpl()\n}\n\n/**\n * Returns `true` if this character is a digit.\n *\n * A character is considered to be a digit if its [category] is [CharCategory.DECIMAL_DIGIT_NUMBER].\n *\n * @sample samples.text.Chars.isDigit\n */\n@SinceKotlin(\"1.5\")\npublic actual fun Char.isDigit(): Boolean {\n if (this in '0'..'9') {\n return true\n }\n if (this < '\\u0080') {\n return false\n }\n return isDigitImpl()\n}\n\n/**\n * Returns `true` if this character is upper case.\n *\n * A character is considered to be an upper case character if its [category] is [CharCategory.UPPERCASE_LETTER],\n * or it has contributory property `Other_Uppercase` as defined by the Unicode Standard.\n *\n * @sample samples.text.Chars.isUpperCase\n */\n@SinceKotlin(\"1.5\")\npublic actual fun Char.isUpperCase(): Boolean {\n if (this in 'A'..'Z') {\n return true\n }\n if (this < '\\u0080') {\n return false\n }\n return isUpperCaseImpl()\n}\n\n/**\n * Returns `true` if this character is lower case.\n *\n * A character is considered to be a lower case character if its [category] is [CharCategory.LOWERCASE_LETTER],\n * or it has contributory property `Other_Lowercase` as defined by the Unicode Standard.\n *\n * @sample samples.text.Chars.isLowerCase\n */\n@SinceKotlin(\"1.5\")\npublic actual fun Char.isLowerCase(): Boolean {\n if (this in 'a'..'z') {\n return true\n }\n if (this < '\\u0080') {\n return false\n }\n return isLowerCaseImpl()\n}\n\n/**\n * Returns `true` if this character is a title case letter.\n *\n * A character is considered to be a title case letter if its [category] is [CharCategory.TITLECASE_LETTER].\n *\n * @sample samples.text.Chars.isTitleCase\n */\n@SinceKotlin(\"1.5\")\npublic actual fun Char.isTitleCase(): Boolean {\n if (this < '\\u0080') {\n return false\n }\n return getCategoryValue() == CharCategory.TITLECASE_LETTER.value\n}\n\n/**\n * Returns `true` if this character is an ISO control character.\n *\n * A character is considered to be an ISO control character if its [category] is [CharCategory.CONTROL],\n * meaning the Char is in the range `'\\u0000'..'\\u001F'` or in the range `'\\u007F'..'\\u009F'`.\n *\n * @sample samples.text.Chars.isISOControl\n */\n@SinceKotlin(\"1.5\")\npublic actual fun Char.isISOControl(): Boolean {\n return this <= '\\u001F' || this in '\\u007F'..'\\u009F'\n}\n\n/**\n * Determines whether a character is whitespace according to the Unicode standard.\n * Returns `true` if the character is whitespace.\n *\n * @sample samples.text.Chars.isWhitespace\n */\npublic actual fun Char.isWhitespace(): Boolean = isWhitespaceImpl()","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.text\n\n\n/**\n * Returns `true` if the content of this string is equal to the word \"true\", ignoring case, and `false` otherwise.\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\n@kotlin.internal.InlineOnly\npublic actual inline fun String.toBoolean(): Boolean = this.toBoolean()\n\n/**\n * Returns `true` if this string is not `null` and its content is equal to the word \"true\", ignoring case, and `false` otherwise.\n *\n * There are also strict versions of the function available on non-nullable String, [toBooleanStrict] and [toBooleanStrictOrNull].\n */\n@SinceKotlin(\"1.4\")\npublic actual fun String?.toBoolean(): Boolean = this != null && this.lowercase() == \"true\"\n\n/**\n * Parses the string as a signed [Byte] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n */\npublic actual fun String.toByte(): Byte = toByteOrNull() ?: numberFormatError(this)\n\n/**\n * Parses the string as a signed [Byte] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n * @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion.\n */\npublic actual fun String.toByte(radix: Int): Byte = toByteOrNull(radix) ?: numberFormatError(this)\n\n\n/**\n * Parses the string as a [Short] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n */\npublic actual fun String.toShort(): Short = toShortOrNull() ?: numberFormatError(this)\n\n/**\n * Parses the string as a [Short] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n * @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion.\n */\npublic actual fun String.toShort(radix: Int): Short = toShortOrNull(radix) ?: numberFormatError(this)\n\n/**\n * Parses the string as an [Int] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n */\npublic actual fun String.toInt(): Int = toIntOrNull() ?: numberFormatError(this)\n\n/**\n * Parses the string as an [Int] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n * @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion.\n */\npublic actual fun String.toInt(radix: Int): Int = toIntOrNull(radix) ?: numberFormatError(this)\n\n/**\n * Parses the string as a [Long] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n */\npublic actual fun String.toLong(): Long = toLongOrNull() ?: numberFormatError(this)\n\n/**\n * Parses the string as a [Long] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n * @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion.\n */\npublic actual fun String.toLong(radix: Int): Long = toLongOrNull(radix) ?: numberFormatError(this)\n\n/**\n * Parses the string as a [Double] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n */\npublic actual fun String.toDouble(): Double = (+(this.asDynamic())).unsafeCast().also {\n if (it.isNaN() && !this.isNaN() || it == 0.0 && this.isBlank())\n numberFormatError(this)\n}\n\n/**\n * Parses the string as a [Float] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n */\n@kotlin.internal.InlineOnly\npublic actual inline fun String.toFloat(): Float = toDouble().unsafeCast()\n\n/**\n * Parses the string as a [Double] number and returns the result\n * or `null` if the string is not a valid representation of a number.\n */\npublic actual fun String.toDoubleOrNull(): Double? = (+(this.asDynamic())).unsafeCast().takeIf {\n !(it.isNaN() && !this.isNaN() || it == 0.0 && this.isBlank())\n}\n\n/**\n * Parses the string as a [Float] number and returns the result\n * or `null` if the string is not a valid representation of a number.\n */\n@kotlin.internal.InlineOnly\npublic actual inline fun String.toFloatOrNull(): Float? = toDoubleOrNull().unsafeCast()\n\n/**\n * Returns a string representation of this [Byte] value in the specified [radix].\n *\n * @throws IllegalArgumentException when [radix] is not a valid radix for number to string conversion.\n */\n@SinceKotlin(\"1.2\")\n@kotlin.internal.InlineOnly\npublic actual inline fun Byte.toString(radix: Int): String = this.toInt().toString(radix)\n\n/**\n * Returns a string representation of this [Short] value in the specified [radix].\n *\n * @throws IllegalArgumentException when [radix] is not a valid radix for number to string conversion.\n */\n@SinceKotlin(\"1.2\")\n@kotlin.internal.InlineOnly\npublic actual inline fun Short.toString(radix: Int): String = this.toInt().toString(radix)\n\n/**\n * Returns a string representation of this [Int] value in the specified [radix].\n *\n * @throws IllegalArgumentException when [radix] is not a valid radix for number to string conversion.\n */\n@SinceKotlin(\"1.2\")\npublic actual fun Int.toString(radix: Int): String = asDynamic().toString(checkRadix(radix))\n\nprivate fun String.isNaN(): Boolean = when (this.lowercase()) {\n \"nan\", \"+nan\", \"-nan\" -> true\n else -> false\n}\n\n/**\n * Checks whether the given [radix] is valid radix for string to number and number to string conversion.\n */\n@PublishedApi\ninternal actual fun checkRadix(radix: Int): Int {\n if (radix !in 2..36) {\n throw IllegalArgumentException(\"radix $radix was not in valid range 2..36\")\n }\n return radix\n}\n\ninternal actual fun digitOf(char: Char, radix: Int): Int = when {\n char >= '0' && char <= '9' -> char - '0'\n char >= 'A' && char <= 'Z' -> char - 'A' + 10\n char >= 'a' && char <= 'z' -> char - 'a' + 10\n char < '\\u0080' -> -1\n char >= '\\uFF21' && char <= '\\uFF3A' -> char - '\\uFF21' + 10 // full-width latin capital letter\n char >= '\\uFF41' && char <= '\\uFF5A' -> char - '\\uFF41' + 10 // full-width latin small letter\n else -> char.digitToIntImpl()\n}.let { if (it >= radix) -1 else it }\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.text\n\nimport kotlin.js.RegExp\n\n/**\n * Provides enumeration values to use to set regular expression options.\n */\npublic actual enum class RegexOption(val value: String) {\n /** Enables case-insensitive matching. */\n IGNORE_CASE(\"i\"),\n /** Enables multiline mode.\n *\n * In multiline mode the expressions `^` and `$` match just after or just before,\n * respectively, a line terminator or the end of the input sequence. */\n MULTILINE(\"m\")\n}\n\nprivate fun Iterable.toFlags(prepend: String): String = joinToString(\"\", prefix = prepend) { it.value }\n\n\n/**\n * Represents the results from a single capturing group within a [MatchResult] of [Regex].\n *\n * @param value The value of captured group.\n */\npublic actual data class MatchGroup(actual val value: String)\n\n\n/**\n * Returns a named group with the specified [name].\n *\n * @return An instance of [MatchGroup] if the group with the specified [name] was matched or `null` otherwise.\n * @throws IllegalArgumentException if there is no group with the specified [name] defined in the regex pattern.\n * @throws UnsupportedOperationException if this match group collection doesn't support getting match groups by name,\n * for example, when it's not supported by the current platform.\n */\n@SinceKotlin(\"1.7\")\npublic operator fun MatchGroupCollection.get(name: String): MatchGroup? {\n val namedGroups = this as? MatchNamedGroupCollection\n ?: throw UnsupportedOperationException(\"Retrieving groups by name is not supported on this platform.\")\n\n return namedGroups[name]\n}\n\n\n/**\n * Represents a compiled regular expression.\n * Provides functions to match strings in text with a pattern, replace the found occurrences and split text around matches.\n *\n * For pattern syntax reference see [MDN RegExp](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#Special_characters_meaning_in_regular_expressions)\n * and [http://www.w3schools.com/jsref/jsref_obj_regexp.asp](https://www.w3schools.com/jsref/jsref_obj_regexp.asp).\n *\n * Note that `RegExp` objects under the hood are constructed with [the \"u\" flag](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode)\n * that enables Unicode-related features in regular expressions. This also makes the pattern syntax more strict,\n * for example, prohibiting unnecessary escape sequences.\n *\n * @constructor Creates a regular expression from the specified [pattern] string and the specified set of [options].\n */\npublic actual class Regex actual constructor(pattern: String, options: Set) {\n\n /** Creates a regular expression from the specified [pattern] string and the specified single [option]. */\n public actual constructor(pattern: String, option: RegexOption) : this(pattern, setOf(option))\n\n /** Creates a regular expression from the specified [pattern] string and the default options. */\n public actual constructor(pattern: String) : this(pattern, emptySet())\n\n\n /** The pattern string of this regular expression. */\n public actual val pattern: String = pattern\n /** The set of options that were used to create this regular expression. */\n public actual val options: Set = options.toSet()\n private val nativePattern: RegExp = RegExp(pattern, options.toFlags(\"gu\"))\n private var nativeStickyPattern: RegExp? = null\n private fun initStickyPattern(): RegExp =\n nativeStickyPattern ?: RegExp(pattern, options.toFlags(\"yu\")).also { nativeStickyPattern = it }\n\n private var nativeMatchesEntirePattern: RegExp? = null\n private fun initMatchesEntirePattern(): RegExp =\n nativeMatchesEntirePattern ?: run {\n if (pattern.startsWith('^') && pattern.endsWith('$'))\n nativePattern\n else\n return RegExp(\"^${pattern.trimStart('^').trimEnd('$')}$\", options.toFlags(\"gu\"))\n }.also { nativeMatchesEntirePattern = it }\n\n\n /** Indicates whether the regular expression matches the entire [input]. */\n public actual infix fun matches(input: CharSequence): Boolean {\n nativePattern.reset()\n val match = nativePattern.exec(input.toString())\n return match != null && match.index == 0 && nativePattern.lastIndex == input.length\n }\n\n /** Indicates whether the regular expression can find at least one match in the specified [input]. */\n public actual fun containsMatchIn(input: CharSequence): Boolean {\n nativePattern.reset()\n return nativePattern.test(input.toString())\n }\n\n @SinceKotlin(\"1.7\")\n @WasExperimental(ExperimentalStdlibApi::class)\n public actual fun matchesAt(input: CharSequence, index: Int): Boolean {\n if (index < 0 || index > input.length) {\n throw IndexOutOfBoundsException(\"index out of bounds: $index, input length: ${input.length}\")\n }\n val pattern = initStickyPattern()\n pattern.lastIndex = index\n return pattern.test(input.toString())\n }\n\n /**\n * Returns the first match of a regular expression in the [input], beginning at the specified [startIndex].\n *\n * @param startIndex An index to start search with, by default 0. Must be not less than zero and not greater than `input.length()`\n * @return An instance of [MatchResult] if match was found or `null` otherwise.\n * @throws IndexOutOfBoundsException if [startIndex] is less than zero or greater than the length of the [input] char sequence.\n * @sample samples.text.Regexps.find\n */\n @Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\n public actual fun find(input: CharSequence, startIndex: Int = 0): MatchResult? {\n if (startIndex < 0 || startIndex > input.length) {\n throw IndexOutOfBoundsException(\"Start index out of bounds: $startIndex, input length: ${input.length}\")\n }\n return nativePattern.findNext(input.toString(), startIndex, nativePattern)\n }\n\n /**\n * Returns a sequence of all occurrences of a regular expression within the [input] string, beginning at the specified [startIndex].\n *\n * @throws IndexOutOfBoundsException if [startIndex] is less than zero or greater than the length of the [input] char sequence.\n *\n * @sample samples.text.Regexps.findAll\n */\n @Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\n public actual fun findAll(input: CharSequence, startIndex: Int = 0): Sequence {\n if (startIndex < 0 || startIndex > input.length) {\n throw IndexOutOfBoundsException(\"Start index out of bounds: $startIndex, input length: ${input.length}\")\n }\n return generateSequence({ find(input, startIndex) }, { match -> match.next() })\n }\n\n /**\n * Attempts to match the entire [input] CharSequence against the pattern.\n *\n * @return An instance of [MatchResult] if the entire input matches or `null` otherwise.\n */\n public actual fun matchEntire(input: CharSequence): MatchResult? =\n initMatchesEntirePattern().findNext(input.toString(), 0, nativePattern)\n\n @SinceKotlin(\"1.7\")\n @WasExperimental(ExperimentalStdlibApi::class)\n public actual fun matchAt(input: CharSequence, index: Int): MatchResult? {\n if (index < 0 || index > input.length) {\n throw IndexOutOfBoundsException(\"index out of bounds: $index, input length: ${input.length}\")\n }\n return initStickyPattern().findNext(input.toString(), index, nativePattern)\n }\n\n\n /**\n * Replaces all occurrences of this regular expression in the specified [input] string with specified [replacement] expression.\n *\n * The replacement string may contain references to the captured groups during a match. Occurrences of `${name}` or `$index`\n * in the replacement string will be substituted with the subsequences corresponding to the captured groups with the specified name or index.\n * In case of `$index`, the first digit after '$' is always treated as a part of group reference. Subsequent digits are incorporated\n * into `index` only if they would form a valid group reference. Only the digits '0'..'9' are considered as potential components\n * of the group reference. Note that indexes of captured groups start from 1, and the group with index 0 is the whole match.\n * In case of `${name}`, the `name` can consist of latin letters 'a'..'z' and 'A'..'Z', or digits '0'..'9'. The first character must be\n * a letter.\n *\n * Backslash character '\\' can be used to include the succeeding character as a literal in the replacement string, e.g, `\\$` or `\\\\`.\n * [Regex.escapeReplacement] can be used if [replacement] have to be treated as a literal string.\n *\n * @param input the char sequence to find matches of this regular expression in\n * @param replacement the expression to replace found matches with\n * @return the result of replacing each occurrence of this regular expression in [input] with the result of evaluating the [replacement] expression\n * @throws RuntimeException if [replacement] expression is malformed, or capturing group with specified `name` or `index` does not exist\n */\n public actual fun replace(input: CharSequence, replacement: String): String {\n if (!replacement.contains('\\\\') && !replacement.contains('$')) {\n return input.toString().nativeReplace(nativePattern, replacement)\n }\n return replace(input) { substituteGroupRefs(it, replacement) }\n }\n\n /**\n * Replaces all occurrences of this regular expression in the specified [input] string with the result of\n * the given function [transform] that takes [MatchResult] and returns a string to be used as a\n * replacement for that match.\n */\n public actual fun replace(input: CharSequence, transform: (MatchResult) -> CharSequence): String {\n var match = find(input)\n if (match == null) return input.toString()\n\n var lastStart = 0\n val length = input.length\n val sb = StringBuilder(length)\n do {\n val foundMatch = match!!\n sb.append(input, lastStart, foundMatch.range.start)\n sb.append(transform(foundMatch))\n lastStart = foundMatch.range.endInclusive + 1\n match = foundMatch.next()\n } while (lastStart < length && match != null)\n\n if (lastStart < length) {\n sb.append(input, lastStart, length)\n }\n\n return sb.toString()\n }\n\n /**\n * Replaces the first occurrence of this regular expression in the specified [input] string with specified [replacement] expression.\n *\n * The replacement string may contain references to the captured groups during a match. Occurrences of `${name}` or `$index`\n * in the replacement string will be substituted with the subsequences corresponding to the captured groups with the specified name or index.\n * In case of `$index`, the first digit after '$' is always treated as a part of group reference. Subsequent digits are incorporated\n * into `index` only if they would form a valid group reference. Only the digits '0'..'9' are considered as potential components\n * of the group reference. Note that indexes of captured groups start from 1, and the group with index 0 is the whole match.\n * In case of `${name}`, the `name` can consist of latin letters 'a'..'z' and 'A'..'Z', or digits '0'..'9'. The first character must be\n * a letter.\n *\n * Backslash character '\\' can be used to include the succeeding character as a literal in the replacement string, e.g, `\\$` or `\\\\`.\n * [Regex.escapeReplacement] can be used if [replacement] have to be treated as a literal string.\n *\n * @param input the char sequence to find a match of this regular expression in\n * @param replacement the expression to replace the found match with\n * @return the result of replacing the first occurrence of this regular expression in [input] with the result of evaluating the [replacement] expression\n * @throws RuntimeException if [replacement] expression is malformed, or capturing group with specified `name` or `index` does not exist\n */\n public actual fun replaceFirst(input: CharSequence, replacement: String): String {\n if (!replacement.contains('\\\\') && !replacement.contains('$')) {\n val nonGlobalOptions = options.toFlags(\"u\")\n return input.toString().nativeReplace(RegExp(pattern, nonGlobalOptions), replacement)\n }\n\n val match = find(input) ?: return input.toString()\n\n return buildString {\n append(input.substring(0, match.range.first))\n append(substituteGroupRefs(match, replacement))\n append(input.substring(match.range.last + 1, input.length))\n }\n }\n\n /**\n * Splits the [input] CharSequence to a list of strings around matches of this regular expression.\n *\n * @param limit Non-negative value specifying the maximum number of substrings the string can be split to.\n * Zero by default means no limit is set.\n */\n @Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\n public actual fun split(input: CharSequence, limit: Int = 0): List {\n requireNonNegativeLimit(limit)\n val matches = findAll(input).let { if (limit == 0) it else it.take(limit - 1) }\n val result = mutableListOf()\n var lastStart = 0\n\n for (match in matches) {\n result.add(input.subSequence(lastStart, match.range.start).toString())\n lastStart = match.range.endInclusive + 1\n }\n result.add(input.subSequence(lastStart, input.length).toString())\n return result\n }\n\n /**\n * Splits the [input] CharSequence to a sequence of strings around matches of this regular expression.\n *\n * @param limit Non-negative value specifying the maximum number of substrings the string can be split to.\n * Zero by default means no limit is set.\n * @sample samples.text.Regexps.splitToSequence\n */\n @SinceKotlin(\"1.6\")\n @WasExperimental(ExperimentalStdlibApi::class)\n @Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\n public actual fun splitToSequence(input: CharSequence, limit: Int = 0): Sequence {\n requireNonNegativeLimit(limit)\n\n return sequence {\n var match = find(input)\n if (match == null || limit == 1) {\n yield(input.toString())\n return@sequence\n }\n\n var nextStart = 0\n var splitCount = 0\n\n do {\n val foundMatch = match!!\n yield(input.substring(nextStart, foundMatch.range.first))\n nextStart = foundMatch.range.endInclusive + 1\n match = foundMatch.next()\n } while (++splitCount != limit - 1 && match != null)\n\n yield(input.substring(nextStart, input.length))\n }\n }\n\n\n /**\n * Returns the string representation of this regular expression, namely the [pattern] of this regular expression.\n *\n * Note that another regular expression constructed from the same pattern string may have different [options]\n * and may match strings differently.\n */\n public override fun toString(): String = nativePattern.toString()\n\n actual companion object {\n /**\n * Returns a regular expression that matches the specified [literal] string literally.\n * No characters of that string will have special meaning when searching for an occurrence of the regular expression.\n */\n public actual fun fromLiteral(literal: String): Regex = Regex(escape(literal))\n\n /**\n * Returns a regular expression pattern string that matches the specified [literal] string literally.\n * No characters of that string will have special meaning when searching for an occurrence of the regular expression.\n */\n public actual fun escape(literal: String): String = literal.nativeReplace(patternEscape, \"\\\\$&\")\n\n /**\n * Returns a literal replacement expression for the specified [literal] string.\n * No characters of that string will have special meaning when it is used as a replacement string in [Regex.replace] function.\n */\n public actual fun escapeReplacement(literal: String): String = literal.nativeReplace(replacementEscape, \"\\\\$&\")\n\n private val patternEscape = RegExp(\"\"\"[\\\\^$*+?.()|[\\]{}]\"\"\", \"g\")\n private val replacementEscape = RegExp(\"\"\"[\\\\$]\"\"\", \"g\")\n\n internal fun nativeEscapeReplacement(literal: String): String = literal.nativeReplace(nativeReplacementEscape, \"$$$$\")\n private val nativeReplacementEscape = RegExp(\"\"\"\\$\"\"\", \"g\")\n }\n}\n\n\n\nprivate fun RegExp.findNext(input: String, from: Int, nextPattern: RegExp): MatchResult? {\n this.lastIndex = from\n val match = exec(input)\n if (match == null) return null\n val range = match.index..lastIndex - 1\n\n return object : MatchResult {\n override val range: IntRange = range\n override val value: String\n get() = match[0]!!\n\n override val groups: MatchGroupCollection = object : MatchNamedGroupCollection, AbstractCollection() {\n override val size: Int get() = match.length\n override fun iterator(): Iterator = indices.asSequence().map { this[it] }.iterator()\n override fun get(index: Int): MatchGroup? = match[index]?.let { MatchGroup(it) }\n\n override fun get(name: String): MatchGroup? {\n // An object of named capturing groups whose keys are the names and values are the capturing groups\n // or undefined if no named capturing groups were defined.\n val groups = match.asDynamic().groups\n ?: throw IllegalArgumentException(\"Capturing group with name {$name} does not exist. No named capturing group was defined in Regex\")\n\n // If the match was successful but the group specified failed to match any part of the input sequence,\n // the associated value is 'undefined'. Value for a non-existent key is also 'undefined'. Thus, explicitly check if the key exists.\n if (!hasOwnPrototypeProperty(groups, name))\n throw IllegalArgumentException(\"Capturing group with name {$name} does not exist\")\n\n val value = groups[name]\n return if (value == undefined) null else MatchGroup(value as String)\n }\n }\n\n private fun hasOwnPrototypeProperty(o: Any?, name: String): Boolean {\n return js(\"Object\").prototype.hasOwnProperty.call(o, name).unsafeCast()\n }\n\n\n private var groupValues_: List? = null\n\n override val groupValues: List\n get() {\n if (groupValues_ == null) {\n groupValues_ = object : AbstractList() {\n override val size: Int get() = match.length\n override fun get(index: Int): String = match[index] ?: \"\"\n }\n }\n return groupValues_!!\n }\n\n override fun next(): MatchResult? =\n nextPattern.findNext(input, if (range.isEmpty()) advanceToNextCharacter(range.start) else range.endInclusive + 1, nextPattern)\n\n private fun advanceToNextCharacter(index: Int): Int {\n if (index < input.lastIndex) {\n val code1 = input.asDynamic().charCodeAt(index).unsafeCast()\n if (code1 in 0xD800..0xDBFF) {\n val code2 = input.asDynamic().charCodeAt(index + 1).unsafeCast()\n if (code2 in 0xDC00..0xDFFF) {\n return index + 2\n }\n }\n }\n return index + 1\n }\n }\n}\n\n// The same code from K/N Regex.kt\nprivate fun substituteGroupRefs(match: MatchResult, replacement: String): String {\n var index = 0\n val result = StringBuilder()\n\n while (index < replacement.length) {\n val char = replacement[index++]\n if (char == '\\\\') {\n if (index == replacement.length)\n throw IllegalArgumentException(\"The Char to be escaped is missing\")\n\n result.append(replacement[index++])\n } else if (char == '$') {\n if (index == replacement.length)\n throw IllegalArgumentException(\"Capturing group index is missing\")\n\n if (replacement[index] == '{') {\n val endIndex = replacement.readGroupName(++index)\n\n if (index == endIndex)\n throw IllegalArgumentException(\"Named capturing group reference should have a non-empty name\")\n if (endIndex == replacement.length || replacement[endIndex] != '}')\n throw IllegalArgumentException(\"Named capturing group reference is missing trailing '}'\")\n\n val groupName = replacement.substring(index, endIndex)\n\n result.append(match.groups[groupName]?.value ?: \"\")\n index = endIndex + 1 // skip past '}'\n } else {\n if (replacement[index] !in '0'..'9')\n throw IllegalArgumentException(\"Invalid capturing group reference\")\n\n val groups = match.groups\n val endIndex = replacement.readGroupIndex(index, groups.size)\n val groupIndex = replacement.substring(index, endIndex).toInt()\n\n if (groupIndex >= groups.size)\n throw IndexOutOfBoundsException(\"Group with index $groupIndex does not exist\")\n\n result.append(groups[groupIndex]?.value ?: \"\")\n index = endIndex\n }\n } else {\n result.append(char)\n }\n }\n return result.toString()\n}\n\n// The name must be a legal JavaScript identifier. See https://262.ecma-international.org/5.1/#sec-7.6\n// Don't try to validate the referenced group name as it may be time-consuming.\n// If the name is invalid, it won't be found in `match.groups` anyway and will throw.\n// Group names in the target Regex are validated at creation time.\nprivate fun String.readGroupName(startIndex: Int): Int {\n var index = startIndex\n while (index < length) {\n if (this[index] == '}') {\n break\n } else {\n index++\n }\n }\n return index\n}\n\nprivate fun String.readGroupIndex(startIndex: Int, groupCount: Int): Int {\n // at least one digit after '$' is always captured\n var index = startIndex + 1\n var groupIndex = this[startIndex] - '0'\n\n // capture the largest valid group index\n while (index < length && this[index] in '0'..'9') {\n val newGroupIndex = (groupIndex * 10) + (this[index] - '0')\n if (newGroupIndex in 0 until groupCount) {\n groupIndex = newGroupIndex\n index++\n } else {\n break\n }\n }\n return index\n}","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"StringsKt\")\n@file:Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\n\npackage kotlin.text\n\nimport kotlin.contracts.*\n\n/**\n * A mutable sequence of characters.\n *\n * String builder can be used to efficiently perform multiple string manipulation operations.\n */\nexpect class StringBuilder : Appendable, CharSequence {\n /** Constructs an empty string builder. */\n constructor()\n\n /** Constructs an empty string builder with the specified initial [capacity]. */\n constructor(capacity: Int)\n\n /** Constructs a string builder that contains the same characters as the specified [content] char sequence. */\n constructor(content: CharSequence)\n\n /** Constructs a string builder that contains the same characters as the specified [content] string. */\n @SinceKotlin(\"1.3\")\n// @ExperimentalStdlibApi\n constructor(content: String)\n\n override val length: Int\n\n override operator fun get(index: Int): Char\n\n override fun subSequence(startIndex: Int, endIndex: Int): CharSequence\n\n override fun append(value: Char): StringBuilder\n override fun append(value: CharSequence?): StringBuilder\n override fun append(value: CharSequence?, startIndex: Int, endIndex: Int): StringBuilder\n\n /**\n * Reverses the contents of this string builder and returns this instance.\n *\n * Surrogate pairs included in this string builder are treated as single characters.\n * Therefore, the order of the high-low surrogates is never reversed.\n *\n * Note that the reverse operation may produce new surrogate pairs that were unpaired low-surrogates and high-surrogates before the operation.\n * For example, reversing `\"\\uDC00\\uD800\"` produces `\"\\uD800\\uDC00\"` which is a valid surrogate pair.\n */\n fun reverse(): StringBuilder\n\n /**\n * Appends the string representation of the specified object [value] to this string builder and returns this instance.\n *\n * The overall effect is exactly as if the [value] were converted to a string by the `value.toString()` method,\n * and then that string was appended to this string builder.\n */\n fun append(value: Any?): StringBuilder\n\n /**\n * Appends the string representation of the specified boolean [value] to this string builder and returns this instance.\n *\n * The overall effect is exactly as if the [value] were converted to a string by the `value.toString()` method,\n * and then that string was appended to this string builder.\n */\n @SinceKotlin(\"1.3\")\n fun append(value: Boolean): StringBuilder\n\n /**\n * Appends characters in the specified character array [value] to this string builder and returns this instance.\n *\n * Characters are appended in order, starting at the index 0.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n fun append(value: CharArray): StringBuilder\n\n /**\n * Appends the specified string [value] to this string builder and returns this instance.\n *\n * If [value] is `null`, then the four characters `\"null\"` are appended.\n */\n @SinceKotlin(\"1.3\")\n fun append(value: String?): StringBuilder\n\n /**\n * Returns the current capacity of this string builder.\n *\n * The capacity is the maximum length this string builder can have before an allocation occurs.\n */\n @SinceKotlin(\"1.3\")\n// @ExperimentalStdlibApi\n @Deprecated(\"Obtaining StringBuilder capacity is not supported in JS and common code.\", level = DeprecationLevel.ERROR)\n fun capacity(): Int\n\n /**\n * Ensures that the capacity of this string builder is at least equal to the specified [minimumCapacity].\n *\n * If the current capacity is less than the [minimumCapacity], a new backing storage is allocated with greater capacity.\n * Otherwise, this method takes no action and simply returns.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n fun ensureCapacity(minimumCapacity: Int)\n\n /**\n * Returns the index within this string builder of the first occurrence of the specified [string].\n *\n * Returns `-1` if the specified [string] does not occur in this string builder.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n fun indexOf(string: String): Int\n\n /**\n * Returns the index within this string builder of the first occurrence of the specified [string],\n * starting at the specified [startIndex].\n *\n * Returns `-1` if the specified [string] does not occur in this string builder starting at the specified [startIndex].\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n fun indexOf(string: String, startIndex: Int): Int\n\n /**\n * Returns the index within this string builder of the last occurrence of the specified [string].\n * The last occurrence of empty string `\"\"` is considered to be at the index equal to `this.length`.\n *\n * Returns `-1` if the specified [string] does not occur in this string builder.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n fun lastIndexOf(string: String): Int\n\n /**\n * Returns the index within this string builder of the last occurrence of the specified [string],\n * starting from the specified [startIndex] toward the beginning.\n *\n * Returns `-1` if the specified [string] does not occur in this string builder starting at the specified [startIndex].\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n fun lastIndexOf(string: String, startIndex: Int): Int\n\n /**\n * Inserts the string representation of the specified boolean [value] into this string builder at the specified [index] and returns this instance.\n *\n * The overall effect is exactly as if the [value] were converted to a string by the `value.toString()` method,\n * and then that string was inserted into this string builder at the specified [index].\n *\n * @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n fun insert(index: Int, value: Boolean): StringBuilder\n\n /**\n * Inserts the specified character [value] into this string builder at the specified [index] and returns this instance.\n *\n * @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n fun insert(index: Int, value: Char): StringBuilder\n\n /**\n * Inserts characters in the specified character array [value] into this string builder at the specified [index] and returns this instance.\n *\n * The inserted characters go in same order as in the [value] character array, starting at [index].\n *\n * @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n fun insert(index: Int, value: CharArray): StringBuilder\n\n /**\n * Inserts characters in the specified character sequence [value] into this string builder at the specified [index] and returns this instance.\n *\n * The inserted characters go in the same order as in the [value] character sequence, starting at [index].\n *\n * @param index the position in this string builder to insert at.\n * @param value the character sequence from which characters are inserted. If [value] is `null`, then the four characters `\"null\"` are inserted.\n *\n * @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n fun insert(index: Int, value: CharSequence?): StringBuilder\n\n /**\n * Inserts the string representation of the specified object [value] into this string builder at the specified [index] and returns this instance.\n *\n * The overall effect is exactly as if the [value] were converted to a string by the `value.toString()` method,\n * and then that string was inserted into this string builder at the specified [index].\n *\n * @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n fun insert(index: Int, value: Any?): StringBuilder\n\n /**\n * Inserts the string [value] into this string builder at the specified [index] and returns this instance.\n *\n * If [value] is `null`, then the four characters `\"null\"` are inserted.\n *\n * @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n fun insert(index: Int, value: String?): StringBuilder\n\n /**\n * Sets the length of this string builder to the specified [newLength].\n *\n * If the [newLength] is less than the current length, it is changed to the specified [newLength].\n * Otherwise, null characters '\\u0000' are appended to this string builder until its length is less than the [newLength].\n *\n * Note that in Kotlin/JS [set] operator function has non-constant execution time complexity.\n * Therefore, increasing length of this string builder and then updating each character by index may slow down your program.\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] if [newLength] is less than zero.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n fun setLength(newLength: Int)\n\n /**\n * Returns a new [String] that contains characters in this string builder at [startIndex] (inclusive) and up to the [length] (exclusive).\n *\n * @throws IndexOutOfBoundsException if [startIndex] is less than zero or greater than the length of this string builder.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n fun substring(startIndex: Int): String\n\n /**\n * Returns a new [String] that contains characters in this string builder at [startIndex] (inclusive) and up to the [endIndex] (exclusive).\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this string builder indices or when `startIndex > endIndex`.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n fun substring(startIndex: Int, endIndex: Int): String\n\n /**\n * Attempts to reduce storage used for this string builder.\n *\n * If the backing storage of this string builder is larger than necessary to hold its current contents,\n * then it may be resized to become more space efficient.\n * Calling this method may, but is not required to, affect the value of the [capacity] property.\n */\n @SinceKotlin(\"1.4\")\n @WasExperimental(ExperimentalStdlibApi::class)\n fun trimToSize()\n}\n\n\n/**\n * Clears the content of this string builder making it empty and returns this instance.\n *\n * @sample samples.text.Strings.clearStringBuilder\n */\n@SinceKotlin(\"1.3\")\npublic expect fun StringBuilder.clear(): StringBuilder\n\n/**\n * Sets the character at the specified [index] to the specified [value].\n *\n * @throws IndexOutOfBoundsException if [index] is out of bounds of this string builder.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic expect operator fun StringBuilder.set(index: Int, value: Char)\n\n/**\n * Replaces characters in the specified range of this string builder with characters in the specified string [value] and returns this instance.\n *\n * @param startIndex the beginning (inclusive) of the range to replace.\n * @param endIndex the end (exclusive) of the range to replace.\n * @param value the string to replace with.\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] if [startIndex] is less than zero, greater than the length of this string builder, or `startIndex > endIndex`.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic expect fun StringBuilder.setRange(startIndex: Int, endIndex: Int, value: String): StringBuilder\n\n/**\n * Removes the character at the specified [index] from this string builder and returns this instance.\n *\n * If the `Char` at the specified [index] is part of a supplementary code point, this method does not remove the entire supplementary character.\n *\n * @param index the index of `Char` to remove.\n *\n * @throws IndexOutOfBoundsException if [index] is out of bounds of this string builder.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic expect fun StringBuilder.deleteAt(index: Int): StringBuilder\n\n/**\n * Removes characters in the specified range from this string builder and returns this instance.\n *\n * @param startIndex the beginning (inclusive) of the range to remove.\n * @param endIndex the end (exclusive) of the range to remove.\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] is out of range of this string builder indices or when `startIndex > endIndex`.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic expect fun StringBuilder.deleteRange(startIndex: Int, endIndex: Int): StringBuilder\n\n/**\n * Copies characters from this string builder into the [destination] character array.\n *\n * @param destination the array to copy to.\n * @param destinationOffset the position in the array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the range to copy, 0 by default.\n * @param endIndex the end (exclusive) of the range to copy, length of this string builder by default.\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this string builder indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic expect fun StringBuilder.toCharArray(destination: CharArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = this.length)\n\n/**\n * Appends characters in a subarray of the specified character array [value] to this string builder and returns this instance.\n *\n * Characters are appended in order, starting at specified [startIndex].\n *\n * @param value the array from which characters are appended.\n * @param startIndex the beginning (inclusive) of the subarray to append.\n * @param endIndex the end (exclusive) of the subarray to append.\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of the [value] array indices or when `startIndex > endIndex`.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic expect fun StringBuilder.appendRange(value: CharArray, startIndex: Int, endIndex: Int): StringBuilder\n\n/**\n * Appends a subsequence of the specified character sequence [value] to this string builder and returns this instance.\n *\n * @param value the character sequence from which a subsequence is appended.\n * @param startIndex the beginning (inclusive) of the subsequence to append.\n * @param endIndex the end (exclusive) of the subsequence to append.\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of the [value] character sequence indices or when `startIndex > endIndex`.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic expect fun StringBuilder.appendRange(value: CharSequence, startIndex: Int, endIndex: Int): StringBuilder\n\n/**\n * Inserts characters in a subarray of the specified character array [value] into this string builder at the specified [index] and returns this instance.\n *\n * The inserted characters go in same order as in the [value] array, starting at [index].\n *\n * @param index the position in this string builder to insert at.\n * @param value the array from which characters are inserted.\n * @param startIndex the beginning (inclusive) of the subarray to insert.\n * @param endIndex the end (exclusive) of the subarray to insert.\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of the [value] array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic expect fun StringBuilder.insertRange(index: Int, value: CharArray, startIndex: Int, endIndex: Int): StringBuilder\n\n/**\n * Inserts characters in a subsequence of the specified character sequence [value] into this string builder at the specified [index] and returns this instance.\n *\n * The inserted characters go in the same order as in the [value] character sequence, starting at [index].\n *\n * @param index the position in this string builder to insert at.\n * @param value the character sequence from which a subsequence is inserted.\n * @param startIndex the beginning (inclusive) of the subsequence to insert.\n * @param endIndex the end (exclusive) of the subsequence to insert.\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of the [value] character sequence indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException if [index] is less than zero or greater than the length of this string builder.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic expect fun StringBuilder.insertRange(index: Int, value: CharSequence, startIndex: Int, endIndex: Int): StringBuilder\n\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\n@Deprecated(\"Use append(value: Any?) instead\", ReplaceWith(\"append(value = obj)\"), DeprecationLevel.WARNING)\n@kotlin.internal.InlineOnly\npublic inline fun StringBuilder.append(obj: Any?): StringBuilder = this.append(obj)\n\n/**\n * Builds new string by populating newly created [StringBuilder] using provided [builderAction]\n * and then converting it to [String].\n */\n@kotlin.internal.InlineOnly\npublic inline fun buildString(builderAction: StringBuilder.() -> Unit): String {\n contract { callsInPlace(builderAction, InvocationKind.EXACTLY_ONCE) }\n return StringBuilder().apply(builderAction).toString()\n}\n\n/**\n * Builds new string by populating newly created [StringBuilder] initialized with the given [capacity]\n * using provided [builderAction] and then converting it to [String].\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline fun buildString(capacity: Int, builderAction: StringBuilder.() -> Unit): String {\n contract { callsInPlace(builderAction, InvocationKind.EXACTLY_ONCE) }\n return StringBuilder(capacity).apply(builderAction).toString()\n}\n\n/**\n * Appends all arguments to the given StringBuilder.\n */\npublic fun StringBuilder.append(vararg value: String?): StringBuilder {\n for (item in value)\n append(item)\n return this\n}\n\n/**\n * Appends all arguments to the given StringBuilder.\n */\npublic fun StringBuilder.append(vararg value: Any?): StringBuilder {\n for (item in value)\n append(item)\n return this\n}\n\n/** Appends a line feed character (`\\n`) to this StringBuilder. */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun StringBuilder.appendLine(): StringBuilder = append('\\n')\n\n/** Appends [value] to this [StringBuilder], followed by a line feed character (`\\n`). */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun StringBuilder.appendLine(value: CharSequence?): StringBuilder = append(value).appendLine()\n\n/** Appends [value] to this [StringBuilder], followed by a line feed character (`\\n`). */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun StringBuilder.appendLine(value: String?): StringBuilder = append(value).appendLine()\n\n/** Appends [value] to this [StringBuilder], followed by a line feed character (`\\n`). */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun StringBuilder.appendLine(value: Any?): StringBuilder = append(value).appendLine()\n\n/** Appends [value] to this [StringBuilder], followed by a line feed character (`\\n`). */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun StringBuilder.appendLine(value: CharArray): StringBuilder = append(value).appendLine()\n\n/** Appends [value] to this [StringBuilder], followed by a line feed character (`\\n`). */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun StringBuilder.appendLine(value: Char): StringBuilder = append(value).appendLine()\n\n/** Appends [value] to this [StringBuilder], followed by a line feed character (`\\n`). */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun StringBuilder.appendLine(value: Boolean): StringBuilder = append(value).appendLine()\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.text\n\nimport kotlin.js.RegExp\n\n@kotlin.internal.InlineOnly\ninternal actual inline fun String.nativeIndexOf(ch: Char, fromIndex: Int): Int = nativeIndexOf(ch.toString(), fromIndex)\n\n@kotlin.internal.InlineOnly\ninternal actual inline fun String.nativeLastIndexOf(ch: Char, fromIndex: Int): Int = nativeLastIndexOf(ch.toString(), fromIndex)\n\n/**\n * Returns `true` if this string starts with the specified prefix.\n */\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun String.startsWith(prefix: String, ignoreCase: Boolean = false): Boolean {\n if (!ignoreCase)\n return nativeStartsWith(prefix, 0)\n else\n return regionMatches(0, prefix, 0, prefix.length, ignoreCase)\n}\n\n/**\n * Returns `true` if a substring of this string starting at the specified offset [startIndex] starts with the specified prefix.\n */\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun String.startsWith(prefix: String, startIndex: Int, ignoreCase: Boolean = false): Boolean {\n if (!ignoreCase)\n return nativeStartsWith(prefix, startIndex)\n else\n return regionMatches(startIndex, prefix, 0, prefix.length, ignoreCase)\n}\n\n/**\n * Returns `true` if this string ends with the specified suffix.\n */\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun String.endsWith(suffix: String, ignoreCase: Boolean = false): Boolean {\n if (!ignoreCase)\n return nativeEndsWith(suffix)\n else\n return regionMatches(length - suffix.length, suffix, 0, suffix.length, ignoreCase)\n}\n\n@Deprecated(\"Use Regex.matches() instead\", ReplaceWith(\"regex.toRegex().matches(this)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.6\")\npublic fun String.matches(regex: String): Boolean {\n @Suppress(\"DEPRECATION\")\n val result = this.match(regex)\n return result != null && result.size != 0\n}\n\n/**\n * Returns `true` if this string is empty or consists solely of whitespace characters.\n *\n * @sample samples.text.Strings.stringIsBlank\n */\npublic actual fun CharSequence.isBlank(): Boolean = length == 0 || indices.all { this[it].isWhitespace() }\n\n/**\n * Returns `true` if this string is equal to [other], optionally ignoring character case.\n *\n * Two strings are considered to be equal if they have the same length and the same character at the same index.\n * If [ignoreCase] is true, the result of `Char.uppercaseChar().lowercaseChar()` on each character is compared.\n *\n * @param ignoreCase `true` to ignore character case when comparing strings. By default `false`.\n */\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun String?.equals(other: String?, ignoreCase: Boolean = false): Boolean {\n if (this == null) return other == null\n if (other == null) return false\n if (!ignoreCase) return this == other\n\n if (this.length != other.length) return false\n\n for (index in 0 until this.length) {\n val thisChar = this[index]\n val otherChar = other[index]\n if (!thisChar.equals(otherChar, ignoreCase)) {\n return false\n }\n }\n\n return true\n}\n\n\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun CharSequence.regionMatches(thisOffset: Int, other: CharSequence, otherOffset: Int, length: Int, ignoreCase: Boolean = false): Boolean =\n regionMatchesImpl(thisOffset, other, otherOffset, length, ignoreCase)\n\n\n/**\n * Returns a copy of this string having its first letter titlecased using the rules of the default locale,\n * or the original string if it's empty or already starts with a title case letter.\n *\n * The title case of a character is usually the same as its upper case with several exceptions.\n * The particular list of characters with the special title case form depends on the underlying platform.\n *\n * @sample samples.text.Strings.capitalize\n */\n@Deprecated(\"Use replaceFirstChar instead.\", ReplaceWith(\"replaceFirstChar { if (it.isLowerCase()) it.titlecase() else it.toString() }\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic actual fun String.capitalize(): String {\n return if (isNotEmpty()) substring(0, 1).uppercase() + substring(1) else this\n}\n\n/**\n * Returns a copy of this string having its first letter lowercased using the rules of the default locale,\n * or the original string if it's empty or already starts with a lower case letter.\n *\n * @sample samples.text.Strings.decapitalize\n */\n@Deprecated(\"Use replaceFirstChar instead.\", ReplaceWith(\"replaceFirstChar { it.lowercase() }\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic actual fun String.decapitalize(): String {\n return if (isNotEmpty()) substring(0, 1).lowercase() + substring(1) else this\n}\n\n/**\n * Returns a string containing this char sequence repeated [n] times.\n * @throws [IllegalArgumentException] when n < 0.\n * @sample samples.text.Strings.repeat\n */\npublic actual fun CharSequence.repeat(n: Int): String {\n require(n >= 0) { \"Count 'n' must be non-negative, but was $n.\" }\n return when (n) {\n 0 -> \"\"\n 1 -> this.toString()\n else -> {\n var result = \"\"\n if (!isEmpty()) {\n var s = this.toString()\n var count = n\n while (true) {\n if ((count and 1) == 1) {\n result += s\n }\n count = count ushr 1\n if (count == 0) {\n break\n }\n s += s\n }\n }\n return result\n }\n }\n}\n\n/**\n * Returns a new string obtained by replacing all occurrences of the [oldValue] substring in this string\n * with the specified [newValue] string.\n *\n * @sample samples.text.Strings.replace\n */\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun String.replace(oldValue: String, newValue: String, ignoreCase: Boolean = false): String =\n nativeReplace(RegExp(Regex.escape(oldValue), if (ignoreCase) \"gui\" else \"gu\"), Regex.nativeEscapeReplacement(newValue))\n\n/**\n * Returns a new string with all occurrences of [oldChar] replaced with [newChar].\n *\n * @sample samples.text.Strings.replace\n */\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun String.replace(oldChar: Char, newChar: Char, ignoreCase: Boolean = false): String =\n nativeReplace(RegExp(Regex.escape(oldChar.toString()), if (ignoreCase) \"gui\" else \"gu\"), newChar.toString())\n\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun String.replaceFirst(oldValue: String, newValue: String, ignoreCase: Boolean = false): String =\n nativeReplace(RegExp(Regex.escape(oldValue), if (ignoreCase) \"ui\" else \"u\"), Regex.nativeEscapeReplacement(newValue))\n\n@Suppress(\"ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS\")\npublic actual fun String.replaceFirst(oldChar: Char, newChar: Char, ignoreCase: Boolean = false): String =\n nativeReplace(RegExp(Regex.escape(oldChar.toString()), if (ignoreCase) \"ui\" else \"u\"), newChar.toString())\n","/*\n * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.text\n\n/** Returns the negative [size] if [throwOnMalformed] is false, throws [CharacterCodingException] otherwise. */\nprivate fun malformed(size: Int, index: Int, throwOnMalformed: Boolean): Int {\n if (throwOnMalformed) throw CharacterCodingException(\"Malformed sequence starting at ${index - 1}\")\n return -size\n}\n\n/**\n * Returns code point corresponding to UTF-16 surrogate pair,\n * where the first of the pair is the [high] and the second is in the [string] at the [index].\n * Returns zero if the pair is malformed and [throwOnMalformed] is false.\n *\n * @throws CharacterCodingException if the pair is malformed and [throwOnMalformed] is true.\n */\nprivate fun codePointFromSurrogate(string: String, high: Int, index: Int, endIndex: Int, throwOnMalformed: Boolean): Int {\n if (high !in 0xD800..0xDBFF || index >= endIndex) {\n return malformed(0, index, throwOnMalformed)\n }\n val low = string[index].code\n if (low !in 0xDC00..0xDFFF) {\n return malformed(0, index, throwOnMalformed)\n }\n return 0x10000 + ((high and 0x3FF) shl 10) or (low and 0x3FF)\n}\n\n/**\n * Returns code point corresponding to UTF-8 sequence of two bytes,\n * where the first byte of the sequence is the [byte1] and the second byte is in the [bytes] array at the [index].\n * Returns zero if the sequence is malformed and [throwOnMalformed] is false.\n *\n * @throws CharacterCodingException if the sequence of two bytes is malformed and [throwOnMalformed] is true.\n */\nprivate fun codePointFrom2(bytes: ByteArray, byte1: Int, index: Int, endIndex: Int, throwOnMalformed: Boolean): Int {\n if (byte1 and 0x1E == 0 || index >= endIndex) {\n return malformed(0, index, throwOnMalformed)\n }\n val byte2 = bytes[index].toInt()\n if (byte2 and 0xC0 != 0x80) {\n return malformed(0, index, throwOnMalformed)\n }\n return (byte1 shl 6) xor byte2 xor 0xF80\n}\n\n/**\n * Returns code point corresponding to UTF-8 sequence of three bytes,\n * where the first byte of the sequence is the [byte1] and the others are in the [bytes] array starting from the [index].\n * Returns a non-positive value indicating number of bytes from [bytes] included in malformed sequence\n * if the sequence is malformed and [throwOnMalformed] is false.\n *\n * @throws CharacterCodingException if the sequence of three bytes is malformed and [throwOnMalformed] is true.\n */\nprivate fun codePointFrom3(bytes: ByteArray, byte1: Int, index: Int, endIndex: Int, throwOnMalformed: Boolean): Int {\n if (index >= endIndex) {\n return malformed(0, index, throwOnMalformed)\n }\n\n val byte2 = bytes[index].toInt()\n if (byte1 and 0xF == 0) {\n if (byte2 and 0xE0 != 0xA0) {\n // Non-shortest form\n return malformed(0, index, throwOnMalformed)\n }\n } else if (byte1 and 0xF == 0xD) {\n if (byte2 and 0xE0 != 0x80) {\n // Surrogate code point\n return malformed(0, index, throwOnMalformed)\n }\n } else if (byte2 and 0xC0 != 0x80) {\n return malformed(0, index, throwOnMalformed)\n }\n\n if (index + 1 == endIndex) {\n return malformed(1, index, throwOnMalformed)\n }\n val byte3 = bytes[index + 1].toInt()\n if (byte3 and 0xC0 != 0x80) {\n return malformed(1, index, throwOnMalformed)\n }\n\n return (byte1 shl 12) xor (byte2 shl 6) xor byte3 xor -0x1E080\n}\n\n/**\n * Returns code point corresponding to UTF-8 sequence of four bytes,\n * where the first byte of the sequence is the [byte1] and the others are in the [bytes] array starting from the [index].\n * Returns a non-positive value indicating number of bytes from [bytes] included in malformed sequence\n * if the sequence is malformed and [throwOnMalformed] is false.\n *\n * @throws CharacterCodingException if the sequence of four bytes is malformed and [throwOnMalformed] is true.\n */\nprivate fun codePointFrom4(bytes: ByteArray, byte1: Int, index: Int, endIndex: Int, throwOnMalformed: Boolean): Int {\n if (index >= endIndex) {\n malformed(0, index, throwOnMalformed)\n }\n\n val byte2 = bytes[index].toInt()\n if (byte1 and 0xF == 0x0) {\n if (byte2 and 0xF0 <= 0x80) {\n // Non-shortest form\n return malformed(0, index, throwOnMalformed)\n }\n } else if (byte1 and 0xF == 0x4) {\n if (byte2 and 0xF0 != 0x80) {\n // Out of Unicode code points domain (larger than U+10FFFF)\n return malformed(0, index, throwOnMalformed)\n }\n } else if (byte1 and 0xF > 0x4) {\n return malformed(0, index, throwOnMalformed)\n } else if (byte2 and 0xC0 != 0x80) {\n return malformed(0, index, throwOnMalformed)\n }\n\n if (index + 1 == endIndex) {\n return malformed(1, index, throwOnMalformed)\n }\n val byte3 = bytes[index + 1].toInt()\n if (byte3 and 0xC0 != 0x80) {\n return malformed(1, index, throwOnMalformed)\n }\n\n if (index + 2 == endIndex) {\n return malformed(2, index, throwOnMalformed)\n }\n val byte4 = bytes[index + 2].toInt()\n if (byte4 and 0xC0 != 0x80) {\n return malformed(2, index, throwOnMalformed)\n }\n return (byte1 shl 18) xor (byte2 shl 12) xor (byte3 shl 6) xor byte4 xor 0x381F80\n}\n\n/**\n * Maximum number of bytes needed to encode a single char.\n *\n * Code points in `0..0x7F` are encoded in a single byte.\n * Code points in `0x80..0x7FF` are encoded in two bytes.\n * Code points in `0x800..0xD7FF` or in `0xE000..0xFFFF` are encoded in three bytes.\n * Surrogate code points in `0xD800..0xDFFF` are not Unicode scalar values, therefore aren't encoded.\n * Code points in `0x10000..0x10FFFF` are represented by a pair of surrogate `Char`s and are encoded in four bytes.\n */\nprivate const val MAX_BYTES_PER_CHAR = 3\n\n/**\n * The byte sequence a malformed UTF-16 char sequence is replaced by.\n */\nprivate val REPLACEMENT_BYTE_SEQUENCE: ByteArray = byteArrayOf(0xEF.toByte(), 0xBF.toByte(), 0xBD.toByte())\n\n/**\n * Encodes the [string] using UTF-8 and returns the resulting [ByteArray].\n *\n * @param string the string to encode.\n * @param startIndex the start offset (inclusive) of the substring to encode.\n * @param endIndex the end offset (exclusive) of the substring to encode.\n * @param throwOnMalformed whether to throw on malformed char sequence or replace by the [REPLACEMENT_BYTE_SEQUENCE].\n *\n * @throws CharacterCodingException if the char sequence is malformed and [throwOnMalformed] is true.\n */\ninternal fun encodeUtf8(string: String, startIndex: Int, endIndex: Int, throwOnMalformed: Boolean): ByteArray {\n require(startIndex >= 0 && endIndex <= string.length && startIndex <= endIndex)\n\n val bytes = ByteArray((endIndex - startIndex) * MAX_BYTES_PER_CHAR)\n var byteIndex = 0\n var charIndex = startIndex\n\n while (charIndex < endIndex) {\n val code = string[charIndex++].code\n when {\n code < 0x80 ->\n bytes[byteIndex++] = code.toByte()\n code < 0x800 -> {\n bytes[byteIndex++] = ((code shr 6) or 0xC0).toByte()\n bytes[byteIndex++] = ((code and 0x3F) or 0x80).toByte()\n }\n code < 0xD800 || code >= 0xE000 -> {\n bytes[byteIndex++] = ((code shr 12) or 0xE0).toByte()\n bytes[byteIndex++] = (((code shr 6) and 0x3F) or 0x80).toByte()\n bytes[byteIndex++] = ((code and 0x3F) or 0x80).toByte()\n }\n else -> { // Surrogate char value\n val codePoint = codePointFromSurrogate(string, code, charIndex, endIndex, throwOnMalformed)\n if (codePoint <= 0) {\n bytes[byteIndex++] = REPLACEMENT_BYTE_SEQUENCE[0]\n bytes[byteIndex++] = REPLACEMENT_BYTE_SEQUENCE[1]\n bytes[byteIndex++] = REPLACEMENT_BYTE_SEQUENCE[2]\n } else {\n bytes[byteIndex++] = ((codePoint shr 18) or 0xF0).toByte()\n bytes[byteIndex++] = (((codePoint shr 12) and 0x3F) or 0x80).toByte()\n bytes[byteIndex++] = (((codePoint shr 6) and 0x3F) or 0x80).toByte()\n bytes[byteIndex++] = ((codePoint and 0x3F) or 0x80).toByte()\n charIndex++\n }\n }\n }\n }\n\n return if (bytes.size == byteIndex) bytes else bytes.copyOf(byteIndex)\n}\n\n/**\n * The character a malformed UTF-8 byte sequence is replaced by.\n */\nprivate const val REPLACEMENT_CHAR = '\\uFFFD'\n\n/**\n * Decodes the UTF-8 [bytes] array and returns the resulting [String].\n *\n * @param bytes the byte array to decode.\n * @param startIndex the start offset (inclusive) of the array to be decoded.\n * @param endIndex the end offset (exclusive) of the array to be encoded.\n * @param throwOnMalformed whether to throw on malformed byte sequence or replace by the [REPLACEMENT_CHAR].\n *\n * @throws CharacterCodingException if the array is malformed UTF-8 byte sequence and [throwOnMalformed] is true.\n */\ninternal fun decodeUtf8(bytes: ByteArray, startIndex: Int, endIndex: Int, throwOnMalformed: Boolean): String {\n require(startIndex >= 0 && endIndex <= bytes.size && startIndex <= endIndex)\n\n var byteIndex = startIndex\n val stringBuilder = StringBuilder()\n\n while (byteIndex < endIndex) {\n val byte = bytes[byteIndex++].toInt()\n when {\n byte >= 0 ->\n stringBuilder.append(byte.toChar())\n byte shr 5 == -2 -> {\n val code = codePointFrom2(bytes, byte, byteIndex, endIndex, throwOnMalformed)\n if (code <= 0) {\n stringBuilder.append(REPLACEMENT_CHAR)\n byteIndex += -code\n } else {\n stringBuilder.append(code.toChar())\n byteIndex += 1\n }\n }\n byte shr 4 == -2 -> {\n val code = codePointFrom3(bytes, byte, byteIndex, endIndex, throwOnMalformed)\n if (code <= 0) {\n stringBuilder.append(REPLACEMENT_CHAR)\n byteIndex += -code\n } else {\n stringBuilder.append(code.toChar())\n byteIndex += 2\n }\n }\n byte shr 3 == -2 -> {\n val code = codePointFrom4(bytes, byte, byteIndex, endIndex, throwOnMalformed)\n if (code <= 0) {\n stringBuilder.append(REPLACEMENT_CHAR)\n byteIndex += -code\n } else {\n val high = (code - 0x10000) shr 10 or 0xD800\n val low = (code and 0x3FF) or 0xDC00\n stringBuilder.append(high.toChar())\n stringBuilder.append(low.toChar())\n byteIndex += 3\n }\n }\n else -> {\n malformed(0, byteIndex, throwOnMalformed)\n stringBuilder.append(REPLACEMENT_CHAR)\n }\n }\n }\n\n return stringBuilder.toString()\n}","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.time\n\nimport kotlin.js.json\nimport kotlin.math.*\n\ninternal actual inline val durationAssertionsEnabled: Boolean get() = true\n\ninternal actual fun formatToExactDecimals(value: Double, decimals: Int): String {\n val rounded = if (decimals == 0) {\n value\n } else {\n val pow = 10.0.pow(decimals)\n JsMath.round(abs(value) * pow) / pow * sign(value)\n }\n return if (abs(rounded) < 1e21) {\n // toFixed switches to scientific format after 1e21\n rounded.asDynamic().toFixed(decimals).unsafeCast()\n } else {\n // toPrecision outputs the specified number of digits, but only for positive numbers\n val positive = abs(rounded)\n val positiveString = positive.asDynamic().toPrecision(ceil(log10(positive)) + decimals).unsafeCast()\n if (rounded < 0) \"-$positiveString\" else positiveString\n }\n}\n\ninternal actual fun formatUpToDecimals(value: Double, decimals: Int): String {\n return value.asDynamic().toLocaleString(\"en-us\", json(\"maximumFractionDigits\" to decimals)).unsafeCast()\n}\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.time\n\n@SinceKotlin(\"1.6\")\n@WasExperimental(ExperimentalTime::class)\npublic actual enum class DurationUnit(internal val scale: Double) {\n /**\n * Time unit representing one nanosecond, which is 1/1000 of a microsecond.\n */\n NANOSECONDS(1e0),\n /**\n * Time unit representing one microsecond, which is 1/1000 of a millisecond.\n */\n MICROSECONDS(1e3),\n /**\n * Time unit representing one millisecond, which is 1/1000 of a second.\n */\n MILLISECONDS(1e6),\n /**\n * Time unit representing one second.\n */\n SECONDS(1e9),\n /**\n * Time unit representing one minute.\n */\n MINUTES(60e9),\n /**\n * Time unit representing one hour.\n */\n HOURS(3600e9),\n /**\n * Time unit representing one day, which is always equal to 24 hours.\n */\n DAYS(86400e9);\n}\n\n@SinceKotlin(\"1.3\")\ninternal actual fun convertDurationUnit(value: Double, sourceUnit: DurationUnit, targetUnit: DurationUnit): Double {\n val sourceCompareTarget = sourceUnit.scale.compareTo(targetUnit.scale)\n return when {\n sourceCompareTarget > 0 -> value * (sourceUnit.scale / targetUnit.scale)\n sourceCompareTarget < 0 -> value / (targetUnit.scale / sourceUnit.scale)\n else -> value\n }\n}\n\n@SinceKotlin(\"1.5\")\ninternal actual fun convertDurationUnitOverflow(value: Long, sourceUnit: DurationUnit, targetUnit: DurationUnit): Long {\n val sourceCompareTarget = sourceUnit.scale.compareTo(targetUnit.scale)\n return when {\n sourceCompareTarget > 0 -> value * (sourceUnit.scale / targetUnit.scale).toLong()\n sourceCompareTarget < 0 -> value / (targetUnit.scale / sourceUnit.scale).toLong()\n else -> value\n }\n}\n\n@SinceKotlin(\"1.5\")\ninternal actual fun convertDurationUnit(value: Long, sourceUnit: DurationUnit, targetUnit: DurationUnit): Long {\n val sourceCompareTarget = sourceUnit.scale.compareTo(targetUnit.scale)\n return when {\n sourceCompareTarget > 0 -> {\n val scale = (sourceUnit.scale / targetUnit.scale).toLong()\n val result = value * scale\n when {\n result / scale == value -> result\n value > 0 -> Long.MAX_VALUE\n else -> Long.MIN_VALUE\n }\n }\n sourceCompareTarget < 0 -> value / (targetUnit.scale / sourceUnit.scale).toLong()\n else -> value\n }\n}\n\n\n","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n/*\n * Based on GWT AbstractList\n * Copyright 2007 Google Inc.\n*/\n\npackage kotlin.collections\n\n/**\n * Provides a skeletal implementation of the read-only [List] interface.\n *\n * This class is intended to help implementing read-only lists so it doesn't support concurrent modification tracking.\n *\n * @param E the type of elements contained in the list. The list is covariant in its element type.\n */\n@SinceKotlin(\"1.1\")\npublic abstract class AbstractList protected constructor() : AbstractCollection(), List {\n abstract override val size: Int\n abstract override fun get(index: Int): E\n\n override fun iterator(): Iterator = IteratorImpl()\n\n override fun indexOf(element: @UnsafeVariance E): Int = indexOfFirst { it == element }\n\n override fun lastIndexOf(element: @UnsafeVariance E): Int = indexOfLast { it == element }\n\n override fun listIterator(): ListIterator = ListIteratorImpl(0)\n\n override fun listIterator(index: Int): ListIterator = ListIteratorImpl(index)\n\n override fun subList(fromIndex: Int, toIndex: Int): List = SubList(this, fromIndex, toIndex)\n\n private class SubList(private val list: AbstractList, private val fromIndex: Int, toIndex: Int) : AbstractList(), RandomAccess {\n private var _size: Int = 0\n\n init {\n checkRangeIndexes(fromIndex, toIndex, list.size)\n this._size = toIndex - fromIndex\n }\n\n override fun get(index: Int): E {\n checkElementIndex(index, _size)\n\n return list[fromIndex + index]\n }\n\n override val size: Int get() = _size\n }\n\n /**\n * Compares this list with other list instance with the ordered structural equality.\n *\n * @return true, if [other] instance is a [List] of the same size, which contains the same elements in the same order.\n */\n override fun equals(other: Any?): Boolean {\n if (other === this) return true\n if (other !is List<*>) return false\n\n return orderedEquals(this, other)\n }\n\n /**\n * Returns the hash code value for this list.\n */\n override fun hashCode(): Int = orderedHashCode(this)\n\n private open inner class IteratorImpl : Iterator {\n /** the index of the item that will be returned on the next call to [next]`()` */\n protected var index = 0\n\n override fun hasNext(): Boolean = index < size\n\n override fun next(): E {\n if (!hasNext()) throw NoSuchElementException()\n return get(index++)\n }\n }\n\n /**\n * Implementation of [ListIterator] for abstract lists.\n */\n private open inner class ListIteratorImpl(index: Int) : IteratorImpl(), ListIterator {\n\n init {\n checkPositionIndex(index, this@AbstractList.size)\n this.index = index\n }\n\n override fun hasPrevious(): Boolean = index > 0\n\n override fun nextIndex(): Int = index\n\n override fun previous(): E {\n if (!hasPrevious()) throw NoSuchElementException()\n return get(--index)\n }\n\n override fun previousIndex(): Int = index - 1\n }\n\n internal companion object {\n internal fun checkElementIndex(index: Int, size: Int) {\n if (index < 0 || index >= size) {\n throw IndexOutOfBoundsException(\"index: $index, size: $size\")\n }\n }\n\n internal fun checkPositionIndex(index: Int, size: Int) {\n if (index < 0 || index > size) {\n throw IndexOutOfBoundsException(\"index: $index, size: $size\")\n }\n }\n\n internal fun checkRangeIndexes(fromIndex: Int, toIndex: Int, size: Int) {\n if (fromIndex < 0 || toIndex > size) {\n throw IndexOutOfBoundsException(\"fromIndex: $fromIndex, toIndex: $toIndex, size: $size\")\n }\n if (fromIndex > toIndex) {\n throw IllegalArgumentException(\"fromIndex: $fromIndex > toIndex: $toIndex\")\n }\n }\n\n internal fun checkBoundsIndexes(startIndex: Int, endIndex: Int, size: Int) {\n if (startIndex < 0 || endIndex > size) {\n throw IndexOutOfBoundsException(\"startIndex: $startIndex, endIndex: $endIndex, size: $size\")\n }\n if (startIndex > endIndex) {\n throw IllegalArgumentException(\"startIndex: $startIndex > endIndex: $endIndex\")\n }\n }\n\n internal fun orderedHashCode(c: Collection<*>): Int {\n var hashCode = 1\n for (e in c) {\n hashCode = 31 * hashCode + (e?.hashCode() ?: 0)\n }\n return hashCode\n }\n\n internal fun orderedEquals(c: Collection<*>, other: Collection<*>): Boolean {\n if (c.size != other.size) return false\n\n val otherIterator = other.iterator()\n for (elem in c) {\n val elemOther = otherIterator.next()\n if (elem != elemOther) {\n return false\n }\n }\n return true\n }\n }\n}","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\npackage kotlin.collections\n\nimport kotlin.js.JsName\n\n/**\n * Provides a skeletal implementation of the read-only [Collection] interface.\n *\n * @param E the type of elements contained in the collection. The collection is covariant in its element type.\n */\n@SinceKotlin(\"1.1\")\npublic abstract class AbstractCollection protected constructor() : Collection {\n abstract override val size: Int\n abstract override fun iterator(): Iterator\n\n override fun contains(element: @UnsafeVariance E): Boolean = any { it == element }\n\n override fun containsAll(elements: Collection<@UnsafeVariance E>): Boolean =\n elements.all { contains(it) } // use when js will support bound refs: elements.all(this::contains)\n\n override fun isEmpty(): Boolean = size == 0\n\n override fun toString(): String = joinToString(\", \", \"[\", \"]\") {\n if (it === this) \"(this Collection)\" else it.toString()\n }\n\n /**\n * Returns new array of type `Array` with the elements of this collection.\n */\n @JsName(\"toArray\")\n protected open fun toArray(): Array = copyToArrayImpl(this)\n\n /**\n * Fills the provided [array] or creates new array of the same type\n * and fills it with the elements of this collection.\n */\n protected open fun toArray(array: Array): Array = copyToArrayImpl(this, array)\n}\n","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n/*\n * Based on GWT AbstractMap\n * Copyright 2007 Google Inc.\n */\n\npackage kotlin.collections\n\n/**\n * Provides a skeletal implementation of the read-only [Map] interface.\n *\n * The implementor is required to implement [entries] property, which should return read-only set of map entries.\n *\n * @param K the type of map keys. The map is invariant in its key type.\n * @param V the type of map values. The map is covariant in its value type.\n */\n@SinceKotlin(\"1.1\")\npublic abstract class AbstractMap protected constructor() : Map {\n\n override fun containsKey(key: K): Boolean {\n return implFindEntry(key) != null\n }\n\n override fun containsValue(value: @UnsafeVariance V): Boolean = entries.any { it.value == value }\n\n internal fun containsEntry(entry: Map.Entry<*, *>?): Boolean {\n // since entry comes from @UnsafeVariance parameters it can be virtually anything\n if (entry !is Map.Entry<*, *>) return false\n val key = entry.key\n val value = entry.value\n val ourValue = get(key)\n\n if (value != ourValue) {\n return false\n }\n\n // Perhaps it was null and we don't contain the key?\n if (ourValue == null && !containsKey(key)) {\n return false\n }\n\n return true\n }\n\n\n /**\n * Compares this map with other instance with the ordered structural equality.\n *\n * @return true, if [other] instance is a [Map] of the same size, all entries of which are contained in the [entries] set of this map.\n */\n override fun equals(other: Any?): Boolean {\n if (other === this) return true\n if (other !is Map<*, *>) return false\n if (size != other.size) return false\n\n return other.entries.all { containsEntry(it) }\n }\n\n override operator fun get(key: K): V? = implFindEntry(key)?.value\n\n\n /**\n * Returns the hash code value for this map.\n *\n * It is the same as the hashCode of [entries] set.\n */\n override fun hashCode(): Int = entries.hashCode()\n\n override fun isEmpty(): Boolean = size == 0\n override val size: Int get() = entries.size\n\n /**\n * Returns a read-only [Set] of all keys in this map.\n *\n * Accessing this property first time creates a keys view from [entries].\n * All subsequent accesses just return the created instance.\n */\n override val keys: Set\n get() {\n if (_keys == null) {\n _keys = object : AbstractSet() {\n override operator fun contains(element: K): Boolean = containsKey(element)\n\n override operator fun iterator(): Iterator {\n val entryIterator = entries.iterator()\n return object : Iterator {\n override fun hasNext(): Boolean = entryIterator.hasNext()\n override fun next(): K = entryIterator.next().key\n }\n }\n\n override val size: Int get() = this@AbstractMap.size\n }\n }\n return _keys!!\n }\n\n @kotlin.jvm.Volatile\n private var _keys: Set? = null\n\n\n override fun toString(): String = entries.joinToString(\", \", \"{\", \"}\") { toString(it) }\n\n private fun toString(entry: Map.Entry): String = toString(entry.key) + \"=\" + toString(entry.value)\n\n private fun toString(o: Any?): String = if (o === this) \"(this Map)\" else o.toString()\n\n /**\n * Returns a read-only [Collection] of all values in this map.\n *\n * Accessing this property first time creates a values view from [entries].\n * All subsequent accesses just return the created instance.\n */\n override val values: Collection\n get() {\n if (_values == null) {\n _values = object : AbstractCollection() {\n override operator fun contains(element: @UnsafeVariance V): Boolean = containsValue(element)\n\n override operator fun iterator(): Iterator {\n val entryIterator = entries.iterator()\n return object : Iterator {\n override fun hasNext(): Boolean = entryIterator.hasNext()\n override fun next(): V = entryIterator.next().value\n }\n }\n\n override val size: Int get() = this@AbstractMap.size\n }\n }\n return _values!!\n }\n\n @kotlin.jvm.Volatile\n private var _values: Collection? = null\n\n private fun implFindEntry(key: K): Map.Entry? = entries.firstOrNull { it.key == key }\n\n internal companion object {\n\n internal fun entryHashCode(e: Map.Entry<*, *>): Int = with(e) { (key?.hashCode() ?: 0) xor (value?.hashCode() ?: 0) }\n internal fun entryToString(e: Map.Entry<*, *>): String = with(e) { \"$key=$value\" }\n internal fun entryEquals(e: Map.Entry<*, *>, other: Any?): Boolean {\n if (other !is Map.Entry<*, *>) return false\n return e.key == other.key && e.value == other.value\n }\n }\n}\n","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\npackage kotlin.collections\n\n/**\n * Provides a skeletal implementation of the read-only [Set] interface.\n *\n * This class is intended to help implementing read-only sets so it doesn't support concurrent modification tracking.\n *\n * @param E the type of elements contained in the set. The set is covariant in its element type.\n */\n@SinceKotlin(\"1.1\")\npublic abstract class AbstractSet protected constructor() : AbstractCollection(), Set {\n\n /**\n * Compares this set with other set instance with the unordered structural equality.\n *\n * @return true, if [other] instance is a [Set] of the same size, all elements of which are contained in this set.\n */\n override fun equals(other: Any?): Boolean {\n if (other === this) return true\n if (other !is Set<*>) return false\n return setEquals(this, other)\n }\n\n /**\n * Returns the hash code value for this set.\n */\n override fun hashCode(): Int = unorderedHashCode(this)\n\n internal companion object {\n internal fun unorderedHashCode(c: Collection<*>): Int {\n var hashCode = 0\n for (element in c) {\n hashCode += (element?.hashCode() ?: 0)\n }\n return hashCode\n }\n\n internal fun setEquals(c: Set<*>, other: Set<*>): Boolean {\n if (c.size != other.size) return false\n return c.containsAll(other)\n }\n }\n\n}","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.collections\n\n/**\n * Data class representing a value from a collection or sequence, along with its index in that collection or sequence.\n *\n * @property value the underlying value.\n * @property index the index of the value in the collection or sequence.\n */\npublic data class IndexedValue(public val index: Int, public val value: T)\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"CollectionsKt\")\n\npackage kotlin.collections\n\n\n/**\n * Returns the given iterator itself. This allows to use an instance of iterator in a `for` loop.\n * @sample samples.collections.Iterators.iterator\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun Iterator.iterator(): Iterator = this\n\n/**\n * Returns an [Iterator] that wraps each element produced by the original iterator\n * into an [IndexedValue] containing the index of that element and the element itself.\n *\n * @sample samples.collections.Iterators.withIndexIterator\n */\npublic fun Iterator.withIndex(): Iterator> = IndexingIterator(this)\n\n/**\n * Performs the given [operation] on each element of this [Iterator].\n * @sample samples.collections.Iterators.forEachIterator\n */\npublic inline fun Iterator.forEach(operation: (T) -> Unit): Unit {\n for (element in this) operation(element)\n}\n\n/**\n * Iterator transforming original `iterator` into iterator of [IndexedValue], counting index from zero.\n */\ninternal class IndexingIterator(private val iterator: Iterator) : Iterator> {\n private var index = 0\n final override fun hasNext(): Boolean = iterator.hasNext()\n final override fun next(): IndexedValue = IndexedValue(checkIndexOverflow(index++), iterator.next())\n}\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"MapsKt\")\n\npackage kotlin.collections\n\n/**\n * Returns the value for the given key, or the implicit default value for this map.\n * By default no implicit value is provided for maps and a [NoSuchElementException] is thrown.\n * To create a map with implicit default value use [withDefault] method.\n *\n * @throws NoSuchElementException when the map doesn't contain a value for the specified key and no implicit default was provided for that map.\n */\n@kotlin.jvm.JvmName(\"getOrImplicitDefaultNullable\")\n@PublishedApi\ninternal fun Map.getOrImplicitDefault(key: K): V {\n if (this is MapWithDefault)\n return this.getOrImplicitDefault(key)\n\n return getOrElseNullable(key, { throw NoSuchElementException(\"Key $key is missing in the map.\") })\n}\n\n/**\n * Returns a wrapper of this read-only map, having the implicit default value provided with the specified function [defaultValue].\n *\n * This implicit default value is used when the original map doesn't contain a value for the key specified\n * and a value is obtained with [Map.getValue] function, for example when properties are delegated to the map.\n *\n * When this map already has an implicit default value provided with a former call to [withDefault], it is being replaced by this call.\n */\npublic fun Map.withDefault(defaultValue: (key: K) -> V): Map =\n when (this) {\n is MapWithDefault -> this.map.withDefault(defaultValue)\n else -> MapWithDefaultImpl(this, defaultValue)\n }\n\n/**\n * Returns a wrapper of this mutable map, having the implicit default value provided with the specified function [defaultValue].\n *\n * This implicit default value is used when the original map doesn't contain a value for the key specified\n * and a value is obtained with [Map.getValue] function, for example when properties are delegated to the map.\n *\n * When this map already has an implicit default value provided with a former call to [withDefault], it is being replaced by this call.\n */\n@kotlin.jvm.JvmName(\"withDefaultMutable\")\npublic fun MutableMap.withDefault(defaultValue: (key: K) -> V): MutableMap =\n when (this) {\n is MutableMapWithDefault -> this.map.withDefault(defaultValue)\n else -> MutableMapWithDefaultImpl(this, defaultValue)\n }\n\n\nprivate interface MapWithDefault : Map {\n public val map: Map\n public fun getOrImplicitDefault(key: K): V\n}\n\nprivate interface MutableMapWithDefault : MutableMap, MapWithDefault {\n public override val map: MutableMap\n}\n\n\nprivate class MapWithDefaultImpl(public override val map: Map, private val default: (key: K) -> V) : MapWithDefault {\n override fun equals(other: Any?): Boolean = map.equals(other)\n override fun hashCode(): Int = map.hashCode()\n override fun toString(): String = map.toString()\n override val size: Int get() = map.size\n override fun isEmpty(): Boolean = map.isEmpty()\n override fun containsKey(key: K): Boolean = map.containsKey(key)\n override fun containsValue(value: @UnsafeVariance V): Boolean = map.containsValue(value)\n override fun get(key: K): V? = map.get(key)\n override val keys: Set get() = map.keys\n override val values: Collection get() = map.values\n override val entries: Set> get() = map.entries\n\n override fun getOrImplicitDefault(key: K): V = map.getOrElseNullable(key, { default(key) })\n}\n\nprivate class MutableMapWithDefaultImpl(public override val map: MutableMap, private val default: (key: K) -> V) : MutableMapWithDefault {\n override fun equals(other: Any?): Boolean = map.equals(other)\n override fun hashCode(): Int = map.hashCode()\n override fun toString(): String = map.toString()\n override val size: Int get() = map.size\n override fun isEmpty(): Boolean = map.isEmpty()\n override fun containsKey(key: K): Boolean = map.containsKey(key)\n override fun containsValue(value: @UnsafeVariance V): Boolean = map.containsValue(value)\n override fun get(key: K): V? = map.get(key)\n override val keys: MutableSet get() = map.keys\n override val values: MutableCollection get() = map.values\n override val entries: MutableSet> get() = map.entries\n\n override fun put(key: K, value: V): V? = map.put(key, value)\n override fun remove(key: K): V? = map.remove(key)\n override fun putAll(from: Map) = map.putAll(from)\n override fun clear() = map.clear()\n\n override fun getOrImplicitDefault(key: K): V = map.getOrElseNullable(key, { default(key) })\n}\n\n","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"CollectionsKt\")\n\npackage kotlin.collections\n\nimport kotlin.random.Random\n\n/**\n * Removes a single instance of the specified element from this\n * collection, if it is present.\n *\n * Allows to overcome type-safety restriction of `remove` that requires to pass an element of type `E`.\n *\n * @return `true` if the element has been successfully removed; `false` if it was not present in the collection.\n */\n@kotlin.internal.InlineOnly\npublic inline fun <@kotlin.internal.OnlyInputTypes T> MutableCollection.remove(element: T): Boolean =\n @Suppress(\"UNCHECKED_CAST\") (this as MutableCollection).remove(element)\n\n/**\n * Removes all of this collection's elements that are also contained in the specified collection.\n\n * Allows to overcome type-safety restriction of `removeAll` that requires to pass a collection of type `Collection`.\n *\n * @return `true` if any of the specified elements was removed from the collection, `false` if the collection was not modified.\n */\n@kotlin.internal.InlineOnly\npublic inline fun <@kotlin.internal.OnlyInputTypes T> MutableCollection.removeAll(elements: Collection): Boolean =\n @Suppress(\"UNCHECKED_CAST\") (this as MutableCollection).removeAll(elements)\n\n/**\n * Retains only the elements in this collection that are contained in the specified collection.\n *\n * Allows to overcome type-safety restriction of `retainAll` that requires to pass a collection of type `Collection`.\n *\n * @return `true` if any element was removed from the collection, `false` if the collection was not modified.\n */\n@kotlin.internal.InlineOnly\npublic inline fun <@kotlin.internal.OnlyInputTypes T> MutableCollection.retainAll(elements: Collection): Boolean =\n @Suppress(\"UNCHECKED_CAST\") (this as MutableCollection).retainAll(elements)\n\n/**\n * Adds the specified [element] to this mutable collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun MutableCollection.plusAssign(element: T) {\n this.add(element)\n}\n\n/**\n * Adds all elements of the given [elements] collection to this mutable collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun MutableCollection.plusAssign(elements: Iterable) {\n this.addAll(elements)\n}\n\n/**\n * Adds all elements of the given [elements] array to this mutable collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun MutableCollection.plusAssign(elements: Array) {\n this.addAll(elements)\n}\n\n/**\n * Adds all elements of the given [elements] sequence to this mutable collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun MutableCollection.plusAssign(elements: Sequence) {\n this.addAll(elements)\n}\n\n/**\n * Removes a single instance of the specified [element] from this mutable collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun MutableCollection.minusAssign(element: T) {\n this.remove(element)\n}\n\n/**\n * Removes all elements contained in the given [elements] collection from this mutable collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun MutableCollection.minusAssign(elements: Iterable) {\n this.removeAll(elements)\n}\n\n/**\n * Removes all elements contained in the given [elements] array from this mutable collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun MutableCollection.minusAssign(elements: Array) {\n this.removeAll(elements)\n}\n\n/**\n * Removes all elements contained in the given [elements] sequence from this mutable collection.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun MutableCollection.minusAssign(elements: Sequence) {\n this.removeAll(elements)\n}\n\n/**\n * Adds all elements of the given [elements] collection to this [MutableCollection].\n */\npublic fun MutableCollection.addAll(elements: Iterable): Boolean {\n when (elements) {\n is Collection -> return addAll(elements)\n else -> {\n var result: Boolean = false\n for (item in elements)\n if (add(item)) result = true\n return result\n }\n }\n}\n\n/**\n * Adds all elements of the given [elements] sequence to this [MutableCollection].\n */\npublic fun MutableCollection.addAll(elements: Sequence): Boolean {\n var result: Boolean = false\n for (item in elements) {\n if (add(item)) result = true\n }\n return result\n}\n\n/**\n * Adds all elements of the given [elements] array to this [MutableCollection].\n */\npublic fun MutableCollection.addAll(elements: Array): Boolean {\n return addAll(elements.asList())\n}\n\n/**\n * Removes all elements from this [MutableCollection] that are also contained in the given [elements] collection.\n */\npublic fun MutableCollection.removeAll(elements: Iterable): Boolean {\n return removeAll(elements.convertToSetForSetOperationWith(this))\n}\n\n/**\n * Removes all elements from this [MutableCollection] that are also contained in the given [elements] sequence.\n */\npublic fun MutableCollection.removeAll(elements: Sequence): Boolean {\n val set = elements.convertToSetForSetOperation()\n return set.isNotEmpty() && removeAll(set)\n}\n\n/**\n * Removes all elements from this [MutableCollection] that are also contained in the given [elements] array.\n */\npublic fun MutableCollection.removeAll(elements: Array): Boolean {\n return elements.isNotEmpty() && removeAll(elements.convertToSetForSetOperation())\n}\n\n/**\n * Retains only elements of this [MutableCollection] that are contained in the given [elements] collection.\n */\npublic fun MutableCollection.retainAll(elements: Iterable): Boolean {\n return retainAll(elements.convertToSetForSetOperationWith(this))\n}\n\n/**\n * Retains only elements of this [MutableCollection] that are contained in the given [elements] array.\n */\npublic fun MutableCollection.retainAll(elements: Array): Boolean {\n if (elements.isNotEmpty())\n return retainAll(elements.convertToSetForSetOperation())\n else\n return retainNothing()\n}\n\n/**\n * Retains only elements of this [MutableCollection] that are contained in the given [elements] sequence.\n */\npublic fun MutableCollection.retainAll(elements: Sequence): Boolean {\n val set = elements.convertToSetForSetOperation()\n if (set.isNotEmpty())\n return retainAll(set)\n else\n return retainNothing()\n}\n\nprivate fun MutableCollection<*>.retainNothing(): Boolean {\n val result = isNotEmpty()\n clear()\n return result\n}\n\n\n/**\n * Removes all elements from this [MutableIterable] that match the given [predicate].\n *\n * @return `true` if any element was removed from this collection, or `false` when no elements were removed and collection was not modified.\n */\npublic fun MutableIterable.removeAll(predicate: (T) -> Boolean): Boolean = filterInPlace(predicate, true)\n\n/**\n * Retains only elements of this [MutableIterable] that match the given [predicate].\n *\n * @return `true` if any element was removed from this collection, or `false` when all elements were retained and collection was not modified.\n */\npublic fun MutableIterable.retainAll(predicate: (T) -> Boolean): Boolean = filterInPlace(predicate, false)\n\nprivate fun MutableIterable.filterInPlace(predicate: (T) -> Boolean, predicateResultToRemove: Boolean): Boolean {\n var result = false\n with(iterator()) {\n while (hasNext())\n if (predicate(next()) == predicateResultToRemove) {\n remove()\n result = true\n }\n }\n return result\n}\n\n\n/**\n * Removes the element at the specified [index] from this list.\n * In Kotlin one should use the [MutableList.removeAt] function instead.\n */\n@Deprecated(\"Use removeAt(index) instead.\", ReplaceWith(\"removeAt(index)\"), level = DeprecationLevel.ERROR)\n@kotlin.internal.InlineOnly\npublic inline fun MutableList.remove(index: Int): T = removeAt(index)\n\n/**\n * Removes the first element from this mutable list and returns that removed element, or throws [NoSuchElementException] if this list is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun MutableList.removeFirst(): T = if (isEmpty()) throw NoSuchElementException(\"List is empty.\") else removeAt(0)\n\n/**\n * Removes the first element from this mutable list and returns that removed element, or returns `null` if this list is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun MutableList.removeFirstOrNull(): T? = if (isEmpty()) null else removeAt(0)\n\n/**\n * Removes the last element from this mutable list and returns that removed element, or throws [NoSuchElementException] if this list is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun MutableList.removeLast(): T = if (isEmpty()) throw NoSuchElementException(\"List is empty.\") else removeAt(lastIndex)\n\n/**\n * Removes the last element from this mutable list and returns that removed element, or returns `null` if this list is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun MutableList.removeLastOrNull(): T? = if (isEmpty()) null else removeAt(lastIndex)\n\n/**\n * Removes all elements from this [MutableList] that match the given [predicate].\n *\n * @return `true` if any element was removed from this collection, or `false` when no elements were removed and collection was not modified.\n */\npublic fun MutableList.removeAll(predicate: (T) -> Boolean): Boolean = filterInPlace(predicate, true)\n\n/**\n * Retains only elements of this [MutableList] that match the given [predicate].\n *\n * @return `true` if any element was removed from this collection, or `false` when all elements were retained and collection was not modified.\n */\npublic fun MutableList.retainAll(predicate: (T) -> Boolean): Boolean = filterInPlace(predicate, false)\n\nprivate fun MutableList.filterInPlace(predicate: (T) -> Boolean, predicateResultToRemove: Boolean): Boolean {\n if (this !is RandomAccess)\n return (this as MutableIterable).filterInPlace(predicate, predicateResultToRemove)\n\n var writeIndex: Int = 0\n for (readIndex in 0..lastIndex) {\n val element = this[readIndex]\n if (predicate(element) == predicateResultToRemove)\n continue\n\n if (writeIndex != readIndex)\n this[writeIndex] = element\n\n writeIndex++\n }\n if (writeIndex < size) {\n for (removeIndex in lastIndex downTo writeIndex)\n removeAt(removeIndex)\n\n return true\n } else {\n return false\n }\n}\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"SequencesKt\")\n@file:OptIn(ExperimentalTypeInference::class)\n\npackage kotlin.sequences\n\nimport kotlin.coroutines.*\nimport kotlin.coroutines.intrinsics.*\nimport kotlin.experimental.ExperimentalTypeInference\n\n/**\n * Builds a [Sequence] lazily yielding values one by one.\n *\n * @see kotlin.sequences.generateSequence\n *\n * @sample samples.collections.Sequences.Building.buildSequenceYieldAll\n * @sample samples.collections.Sequences.Building.buildFibonacciSequence\n */\n@SinceKotlin(\"1.3\")\n@Suppress(\"DEPRECATION\")\npublic fun sequence(@BuilderInference block: suspend SequenceScope.() -> Unit): Sequence = Sequence { iterator(block) }\n\n/**\n * Builds an [Iterator] lazily yielding values one by one.\n *\n * @sample samples.collections.Sequences.Building.buildIterator\n * @sample samples.collections.Iterables.Building.iterable\n */\n@SinceKotlin(\"1.3\")\n@Suppress(\"DEPRECATION\")\npublic fun iterator(@BuilderInference block: suspend SequenceScope.() -> Unit): Iterator {\n val iterator = SequenceBuilderIterator()\n iterator.nextStep = block.createCoroutineUnintercepted(receiver = iterator, completion = iterator)\n return iterator\n}\n\n/**\n * The scope for yielding values of a [Sequence] or an [Iterator], provides [yield] and [yieldAll] suspension functions.\n *\n * @see sequence\n * @see iterator\n *\n * @sample samples.collections.Sequences.Building.buildSequenceYieldAll\n * @sample samples.collections.Sequences.Building.buildFibonacciSequence\n */\n@RestrictsSuspension\n@SinceKotlin(\"1.3\")\npublic abstract class SequenceScope internal constructor() {\n /**\n * Yields a value to the [Iterator] being built and suspends\n * until the next value is requested.\n *\n * @sample samples.collections.Sequences.Building.buildSequenceYieldAll\n * @sample samples.collections.Sequences.Building.buildFibonacciSequence\n */\n public abstract suspend fun yield(value: T)\n\n /**\n * Yields all values from the `iterator` to the [Iterator] being built\n * and suspends until all these values are iterated and the next one is requested.\n *\n * The sequence of values returned by the given iterator can be potentially infinite.\n *\n * @sample samples.collections.Sequences.Building.buildSequenceYieldAll\n */\n public abstract suspend fun yieldAll(iterator: Iterator)\n\n /**\n * Yields a collections of values to the [Iterator] being built\n * and suspends until all these values are iterated and the next one is requested.\n *\n * @sample samples.collections.Sequences.Building.buildSequenceYieldAll\n */\n public suspend fun yieldAll(elements: Iterable) {\n if (elements is Collection && elements.isEmpty()) return\n return yieldAll(elements.iterator())\n }\n\n /**\n * Yields potentially infinite sequence of values to the [Iterator] being built\n * and suspends until all these values are iterated and the next one is requested.\n *\n * The sequence can be potentially infinite.\n *\n * @sample samples.collections.Sequences.Building.buildSequenceYieldAll\n */\n public suspend fun yieldAll(sequence: Sequence) = yieldAll(sequence.iterator())\n}\n\nprivate typealias State = Int\n\nprivate const val State_NotReady: State = 0\nprivate const val State_ManyNotReady: State = 1\nprivate const val State_ManyReady: State = 2\nprivate const val State_Ready: State = 3\nprivate const val State_Done: State = 4\nprivate const val State_Failed: State = 5\n\nprivate class SequenceBuilderIterator : SequenceScope(), Iterator, Continuation {\n private var state = State_NotReady\n private var nextValue: T? = null\n private var nextIterator: Iterator? = null\n var nextStep: Continuation? = null\n\n override fun hasNext(): Boolean {\n while (true) {\n when (state) {\n State_NotReady -> {}\n State_ManyNotReady ->\n if (nextIterator!!.hasNext()) {\n state = State_ManyReady\n return true\n } else {\n nextIterator = null\n }\n State_Done -> return false\n State_Ready, State_ManyReady -> return true\n else -> throw exceptionalState()\n }\n\n state = State_Failed\n val step = nextStep!!\n nextStep = null\n step.resume(Unit)\n }\n }\n\n override fun next(): T {\n when (state) {\n State_NotReady, State_ManyNotReady -> return nextNotReady()\n State_ManyReady -> {\n state = State_ManyNotReady\n return nextIterator!!.next()\n }\n State_Ready -> {\n state = State_NotReady\n @Suppress(\"UNCHECKED_CAST\")\n val result = nextValue as T\n nextValue = null\n return result\n }\n else -> throw exceptionalState()\n }\n }\n\n private fun nextNotReady(): T {\n if (!hasNext()) throw NoSuchElementException() else return next()\n }\n\n private fun exceptionalState(): Throwable = when (state) {\n State_Done -> NoSuchElementException()\n State_Failed -> IllegalStateException(\"Iterator has failed.\")\n else -> IllegalStateException(\"Unexpected state of the iterator: $state\")\n }\n\n\n override suspend fun yield(value: T) {\n nextValue = value\n state = State_Ready\n return suspendCoroutineUninterceptedOrReturn { c ->\n nextStep = c\n COROUTINE_SUSPENDED\n }\n }\n\n override suspend fun yieldAll(iterator: Iterator) {\n if (!iterator.hasNext()) return\n nextIterator = iterator\n state = State_ManyReady\n return suspendCoroutineUninterceptedOrReturn { c ->\n nextStep = c\n COROUTINE_SUSPENDED\n }\n }\n\n // Completion continuation implementation\n override fun resumeWith(result: Result) {\n result.getOrThrow() // just rethrow exception if it is there\n state = State_Done\n }\n\n override val context: CoroutineContext\n get() = EmptyCoroutineContext\n}\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"SetsKt\")\n@file:OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n\npackage kotlin.collections\n\nimport kotlin.contracts.*\n\ninternal object EmptySet : Set, Serializable {\n private const val serialVersionUID: Long = 3406603774387020532\n\n override fun equals(other: Any?): Boolean = other is Set<*> && other.isEmpty()\n override fun hashCode(): Int = 0\n override fun toString(): String = \"[]\"\n\n override val size: Int get() = 0\n override fun isEmpty(): Boolean = true\n override fun contains(element: Nothing): Boolean = false\n override fun containsAll(elements: Collection): Boolean = elements.isEmpty()\n\n override fun iterator(): Iterator = EmptyIterator\n\n private fun readResolve(): Any = EmptySet\n}\n\n\n/**\n * Returns an empty read-only set. The returned set is serializable (JVM).\n * @sample samples.collections.Collections.Sets.emptyReadOnlySet\n */\npublic fun emptySet(): Set = EmptySet\n\n/**\n * Returns a new read-only set with the given elements.\n * Elements of the set are iterated in the order they were specified.\n * The returned set is serializable (JVM).\n * @sample samples.collections.Collections.Sets.readOnlySet\n */\npublic fun setOf(vararg elements: T): Set = if (elements.size > 0) elements.toSet() else emptySet()\n\n/**\n * Returns an empty read-only set. The returned set is serializable (JVM).\n * @sample samples.collections.Collections.Sets.emptyReadOnlySet\n */\n@kotlin.internal.InlineOnly\npublic inline fun setOf(): Set = emptySet()\n\n/**\n * Returns an empty new [MutableSet].\n *\n * The returned set preserves the element iteration order.\n * @sample samples.collections.Collections.Sets.emptyMutableSet\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline fun mutableSetOf(): MutableSet = LinkedHashSet()\n\n/**\n * Returns a new [MutableSet] with the given elements.\n * Elements of the set are iterated in the order they were specified.\n * @sample samples.collections.Collections.Sets.mutableSet\n */\npublic fun mutableSetOf(vararg elements: T): MutableSet = elements.toCollection(LinkedHashSet(mapCapacity(elements.size)))\n\n/** Returns an empty new [HashSet]. */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline fun hashSetOf(): HashSet = HashSet()\n\n/** Returns a new [HashSet] with the given elements. */\npublic fun hashSetOf(vararg elements: T): HashSet = elements.toCollection(HashSet(mapCapacity(elements.size)))\n\n/**\n * Returns an empty new [LinkedHashSet].\n * @sample samples.collections.Collections.Sets.emptyLinkedHashSet\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline fun linkedSetOf(): LinkedHashSet = LinkedHashSet()\n\n/**\n * Returns a new [LinkedHashSet] with the given elements.\n * Elements of the set are iterated in the order they were specified.\n * @sample samples.collections.Collections.Sets.linkedHashSet\n */\npublic fun linkedSetOf(vararg elements: T): LinkedHashSet = elements.toCollection(LinkedHashSet(mapCapacity(elements.size)))\n\n/**\n * Returns a new read-only set either with single given element, if it is not null, or empty set if the element is null.\n * The returned set is serializable (JVM).\n * @sample samples.collections.Collections.Sets.setOfNotNull\n */\n@SinceKotlin(\"1.4\")\npublic fun setOfNotNull(element: T?): Set = if (element != null) setOf(element) else emptySet()\n\n/**\n * Returns a new read-only set only with those given elements, that are not null.\n * Elements of the set are iterated in the order they were specified.\n * The returned set is serializable (JVM).\n * @sample samples.collections.Collections.Sets.setOfNotNull\n */\n@SinceKotlin(\"1.4\")\npublic fun setOfNotNull(vararg elements: T?): Set {\n return elements.filterNotNullTo(LinkedHashSet())\n}\n\n/**\n * Builds a new read-only [Set] by populating a [MutableSet] using the given [builderAction]\n * and returning a read-only set with the same elements.\n *\n * The set passed as a receiver to the [builderAction] is valid only inside that function.\n * Using it outside of the function produces an unspecified behavior.\n *\n * Elements of the set are iterated in the order they were added by the [builderAction].\n *\n * The returned set is serializable (JVM).\n *\n * @sample samples.collections.Builders.Sets.buildSetSample\n */\n@SinceKotlin(\"1.6\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun buildSet(@BuilderInference builderAction: MutableSet.() -> Unit): Set {\n contract { callsInPlace(builderAction, InvocationKind.EXACTLY_ONCE) }\n return buildSetInternal(builderAction)\n}\n\n@PublishedApi\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\ninternal expect inline fun buildSetInternal(builderAction: MutableSet.() -> Unit): Set\n\n/**\n * Builds a new read-only [Set] by populating a [MutableSet] using the given [builderAction]\n * and returning a read-only set with the same elements.\n *\n * The set passed as a receiver to the [builderAction] is valid only inside that function.\n * Using it outside of the function produces an unspecified behavior.\n *\n * [capacity] is used to hint the expected number of elements added in the [builderAction].\n *\n * Elements of the set are iterated in the order they were added by the [builderAction].\n *\n * The returned set is serializable (JVM).\n *\n * @throws IllegalArgumentException if the given [capacity] is negative.\n *\n * @sample samples.collections.Builders.Sets.buildSetSample\n */\n@SinceKotlin(\"1.6\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun buildSet(capacity: Int, @BuilderInference builderAction: MutableSet.() -> Unit): Set {\n contract { callsInPlace(builderAction, InvocationKind.EXACTLY_ONCE) }\n return buildSetInternal(capacity, builderAction)\n}\n\n@PublishedApi\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\ninternal expect inline fun buildSetInternal(capacity: Int, builderAction: MutableSet.() -> Unit): Set\n\n\n/** Returns this Set if it's not `null` and the empty set otherwise. */\n@kotlin.internal.InlineOnly\npublic inline fun Set?.orEmpty(): Set = this ?: emptySet()\n\ninternal fun Set.optimizeReadOnlySet() = when (size) {\n 0 -> emptySet()\n 1 -> setOf(iterator().next())\n else -> this\n}\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.coroutines\n\n/**\n * Marks coroutine context element that intercepts coroutine continuations.\n * The coroutines framework uses [ContinuationInterceptor.Key] to retrieve the interceptor and\n * intercepts all coroutine continuations with [interceptContinuation] invocations.\n *\n * [ContinuationInterceptor] behaves like a [polymorphic element][AbstractCoroutineContextKey], meaning that\n * its implementation delegates [get][CoroutineContext.Element.get] and [minusKey][CoroutineContext.Element.minusKey]\n * to [getPolymorphicElement] and [minusPolymorphicKey] respectively.\n * [ContinuationInterceptor] subtypes can be extracted from the coroutine context using either [ContinuationInterceptor.Key]\n * or subtype key if it extends [AbstractCoroutineContextKey].\n */\n@SinceKotlin(\"1.3\")\npublic interface ContinuationInterceptor : CoroutineContext.Element {\n /**\n * The key that defines *the* context interceptor.\n */\n companion object Key : CoroutineContext.Key\n\n /**\n * Returns continuation that wraps the original [continuation], thus intercepting all resumptions.\n * This function is invoked by coroutines framework when needed and the resulting continuations are\n * cached internally per each instance of the original [continuation].\n *\n * This function may simply return original [continuation] if it does not want to intercept this particular continuation.\n *\n * When the original [continuation] completes, coroutine framework invokes [releaseInterceptedContinuation]\n * with the resulting continuation if it was intercepted, that is if `interceptContinuation` had previously\n * returned a different continuation instance.\n */\n public fun interceptContinuation(continuation: Continuation): Continuation\n\n /**\n * Invoked for the continuation instance returned by [interceptContinuation] when the original\n * continuation completes and will not be used anymore. This function is invoked only if [interceptContinuation]\n * had returned a different continuation instance from the one it was invoked with.\n *\n * Default implementation does nothing.\n *\n * @param continuation Continuation instance returned by this interceptor's [interceptContinuation] invocation.\n */\n public fun releaseInterceptedContinuation(continuation: Continuation<*>) {\n /* do nothing by default */\n }\n\n public override operator fun get(key: CoroutineContext.Key): E? {\n // getPolymorphicKey specialized for ContinuationInterceptor key\n @OptIn(ExperimentalStdlibApi::class)\n if (key is AbstractCoroutineContextKey<*, *>) {\n @Suppress(\"UNCHECKED_CAST\")\n return if (key.isSubKey(this.key)) key.tryCast(this) as? E else null\n }\n @Suppress(\"UNCHECKED_CAST\")\n return if (ContinuationInterceptor === key) this as E else null\n }\n\n\n public override fun minusKey(key: CoroutineContext.Key<*>): CoroutineContext {\n // minusPolymorphicKey specialized for ContinuationInterceptor key\n @OptIn(ExperimentalStdlibApi::class)\n if (key is AbstractCoroutineContextKey<*, *>) {\n return if (key.isSubKey(this.key) && key.tryCast(this) != null) EmptyCoroutineContext else this\n }\n return if (ContinuationInterceptor === key) EmptyCoroutineContext else this\n }\n}\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.coroutines\n\n/**\n * Persistent context for the coroutine. It is an indexed set of [Element] instances.\n * An indexed set is a mix between a set and a map.\n * Every element in this set has a unique [Key].\n */\n@SinceKotlin(\"1.3\")\npublic interface CoroutineContext {\n /**\n * Returns the element with the given [key] from this context or `null`.\n */\n public operator fun get(key: Key): E?\n\n /**\n * Accumulates entries of this context starting with [initial] value and applying [operation]\n * from left to right to current accumulator value and each element of this context.\n */\n public fun fold(initial: R, operation: (R, Element) -> R): R\n\n /**\n * Returns a context containing elements from this context and elements from other [context].\n * The elements from this context with the same key as in the other one are dropped.\n */\n public operator fun plus(context: CoroutineContext): CoroutineContext =\n if (context === EmptyCoroutineContext) this else // fast path -- avoid lambda creation\n context.fold(this) { acc, element ->\n val removed = acc.minusKey(element.key)\n if (removed === EmptyCoroutineContext) element else {\n // make sure interceptor is always last in the context (and thus is fast to get when present)\n val interceptor = removed[ContinuationInterceptor]\n if (interceptor == null) CombinedContext(removed, element) else {\n val left = removed.minusKey(ContinuationInterceptor)\n if (left === EmptyCoroutineContext) CombinedContext(element, interceptor) else\n CombinedContext(CombinedContext(left, element), interceptor)\n }\n }\n }\n\n /**\n * Returns a context containing elements from this context, but without an element with\n * the specified [key].\n */\n public fun minusKey(key: Key<*>): CoroutineContext\n\n /**\n * Key for the elements of [CoroutineContext]. [E] is a type of element with this key.\n */\n public interface Key\n\n /**\n * An element of the [CoroutineContext]. An element of the coroutine context is a singleton context by itself.\n */\n public interface Element : CoroutineContext {\n /**\n * A key of this coroutine context element.\n */\n public val key: Key<*>\n\n public override operator fun get(key: Key): E? =\n @Suppress(\"UNCHECKED_CAST\")\n if (this.key == key) this as E else null\n\n public override fun fold(initial: R, operation: (R, Element) -> R): R =\n operation(initial, this)\n\n public override fun minusKey(key: Key<*>): CoroutineContext =\n if (this.key == key) EmptyCoroutineContext else this\n }\n}\n","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.coroutines\n\nimport kotlin.coroutines.CoroutineContext.Element\nimport kotlin.coroutines.CoroutineContext.Key\n\n/**\n * Base class for [CoroutineContext.Element] implementations.\n */\n@SinceKotlin(\"1.3\")\npublic abstract class AbstractCoroutineContextElement(public override val key: Key<*>) : Element\n\n/**\n * Base class for [CoroutineContext.Key] associated with polymorphic [CoroutineContext.Element] implementation.\n * Polymorphic element implementation implies delegating its [get][Element.get] and [minusKey][Element.minusKey]\n * to [getPolymorphicElement] and [minusPolymorphicKey] respectively.\n *\n * Polymorphic elements can be extracted from the coroutine context using both element key and its supertype key.\n * Example of polymorphic elements:\n * ```\n * open class BaseElement : CoroutineContext.Element {\n * companion object Key : CoroutineContext.Key\n * override val key: CoroutineContext.Key<*> get() = Key\n * // It is important to use getPolymorphicKey and minusPolymorphicKey\n * override fun get(key: CoroutineContext.Key): E? = getPolymorphicElement(key)\n * override fun minusKey(key: CoroutineContext.Key<*>): CoroutineContext = minusPolymorphicKey(key)\n * }\n *\n * class DerivedElement : BaseElement() {\n * companion object Key : AbstractCoroutineContextKey(BaseElement, { it as? DerivedElement })\n * }\n * // Now it is possible to query both `BaseElement` and `DerivedElement`\n * someContext[BaseElement] // Returns BaseElement?, non-null both for BaseElement and DerivedElement instances\n * someContext[DerivedElement] // Returns DerivedElement?, non-null only for DerivedElement instance\n * ```\n * @param B base class of a polymorphic element\n * @param baseKey an instance of base key\n * @param E element type associated with the current key\n * @param safeCast a function that can safely cast abstract [CoroutineContext.Element] to the concrete [E] type\n * and return the element if it is a subtype of [E] or `null` otherwise.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalStdlibApi\npublic abstract class AbstractCoroutineContextKey(\n baseKey: Key,\n private val safeCast: (element: Element) -> E?\n) : Key {\n private val topmostKey: Key<*> = if (baseKey is AbstractCoroutineContextKey<*, *>) baseKey.topmostKey else baseKey\n\n internal fun tryCast(element: Element): E? = safeCast(element)\n internal fun isSubKey(key: Key<*>): Boolean = key === this || topmostKey === key\n}\n\n/**\n * Returns the current element if it is associated with the given [key] in a polymorphic manner or `null` otherwise.\n * This method returns non-null value if either [Element.key] is equal to the given [key] or if the [key] is associated\n * with [Element.key] via [AbstractCoroutineContextKey].\n * See [AbstractCoroutineContextKey] for the example of usage.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalStdlibApi\npublic fun Element.getPolymorphicElement(key: Key): E? {\n if (key is AbstractCoroutineContextKey<*, *>) {\n @Suppress(\"UNCHECKED_CAST\")\n return if (key.isSubKey(this.key)) key.tryCast(this) as? E else null\n }\n @Suppress(\"UNCHECKED_CAST\")\n return if (this.key === key) this as E else null\n}\n\n/**\n * Returns empty coroutine context if the element is associated with the given [key] in a polymorphic manner\n * or `null` otherwise.\n * This method returns empty context if either [Element.key] is equal to the given [key] or if the [key] is associated\n * with [Element.key] via [AbstractCoroutineContextKey].\n * See [AbstractCoroutineContextKey] for the example of usage.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalStdlibApi\npublic fun Element.minusPolymorphicKey(key: Key<*>): CoroutineContext {\n if (key is AbstractCoroutineContextKey<*, *>) {\n return if (key.isSubKey(this.key) && key.tryCast(this) != null) EmptyCoroutineContext else this\n }\n return if (this.key === key) EmptyCoroutineContext else this\n}\n\n/**\n * An empty coroutine context.\n */\n@SinceKotlin(\"1.3\")\npublic object EmptyCoroutineContext : CoroutineContext, Serializable {\n private const val serialVersionUID: Long = 0\n private fun readResolve(): Any = EmptyCoroutineContext\n\n public override fun get(key: Key): E? = null\n public override fun fold(initial: R, operation: (R, Element) -> R): R = initial\n public override fun plus(context: CoroutineContext): CoroutineContext = context\n public override fun minusKey(key: Key<*>): CoroutineContext = this\n public override fun hashCode(): Int = 0\n public override fun toString(): String = \"EmptyCoroutineContext\"\n}\n\n//--------------------- internal impl ---------------------\n\n// this class is not exposed, but is hidden inside implementations\n// this is a left-biased list, so that `plus` works naturally\n@SinceKotlin(\"1.3\")\ninternal class CombinedContext(\n private val left: CoroutineContext,\n private val element: Element\n) : CoroutineContext, Serializable {\n\n override fun get(key: Key): E? {\n var cur = this\n while (true) {\n cur.element[key]?.let { return it }\n val next = cur.left\n if (next is CombinedContext) {\n cur = next\n } else {\n return next[key]\n }\n }\n }\n\n public override fun fold(initial: R, operation: (R, Element) -> R): R =\n operation(left.fold(initial, operation), element)\n\n public override fun minusKey(key: Key<*>): CoroutineContext {\n element[key]?.let { return left }\n val newLeft = left.minusKey(key)\n return when {\n newLeft === left -> this\n newLeft === EmptyCoroutineContext -> element\n else -> CombinedContext(newLeft, element)\n }\n }\n\n private fun size(): Int {\n var cur = this\n var size = 2\n while (true) {\n cur = cur.left as? CombinedContext ?: return size\n size++\n }\n }\n\n private fun contains(element: Element): Boolean =\n get(element.key) == element\n\n private fun containsAll(context: CombinedContext): Boolean {\n var cur = context\n while (true) {\n if (!contains(cur.element)) return false\n val next = cur.left\n if (next is CombinedContext) {\n cur = next\n } else {\n return contains(next as Element)\n }\n }\n }\n\n override fun equals(other: Any?): Boolean =\n this === other || other is CombinedContext && other.size() == size() && other.containsAll(this)\n\n override fun hashCode(): Int = left.hashCode() + element.hashCode()\n\n override fun toString(): String =\n \"[\" + fold(\"\") { acc, element ->\n if (acc.isEmpty()) element.toString() else \"$acc, $element\"\n } + \"]\"\n\n private fun writeReplace(): Any {\n val n = size()\n val elements = arrayOfNulls(n)\n var index = 0\n fold(Unit) { _, element -> elements[index++] = element }\n check(index == n)\n @Suppress(\"UNCHECKED_CAST\")\n return Serialized(elements as Array)\n }\n\n private class Serialized(val elements: Array) : Serializable {\n companion object {\n private const val serialVersionUID: Long = 0L\n }\n\n private fun readResolve(): Any = elements.fold(EmptyCoroutineContext, CoroutineContext::plus)\n }\n}\n","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmName(\"IntrinsicsKt\")\n@file:kotlin.jvm.JvmMultifileClass\n\npackage kotlin.coroutines.intrinsics\n\nimport kotlin.contracts.*\nimport kotlin.coroutines.*\nimport kotlin.internal.InlineOnly\n\n/**\n * Obtains the current continuation instance inside suspend functions and either suspends\n * currently running coroutine or returns result immediately without suspension.\n *\n * If the [block] returns the special [COROUTINE_SUSPENDED] value, it means that suspend function did suspend the execution and will\n * not return any result immediately. In this case, the [Continuation] provided to the [block] shall be\n * resumed by invoking [Continuation.resumeWith] at some moment in the\n * future when the result becomes available to resume the computation.\n *\n * Otherwise, the return value of the [block] must have a type assignable to [T] and represents the result of this suspend function.\n * It means that the execution was not suspended and the [Continuation] provided to the [block] shall not be invoked.\n * As the result type of the [block] is declared as `Any?` and cannot be correctly type-checked,\n * its proper return type remains on the conscience of the suspend function's author.\n *\n * Invocation of [Continuation.resumeWith] resumes coroutine directly in the invoker's thread without going through the\n * [ContinuationInterceptor] that might be present in the coroutine's [CoroutineContext].\n * It is the invoker's responsibility to ensure that a proper invocation context is established.\n * [Continuation.intercepted] can be used to acquire the intercepted continuation.\n *\n * Note that it is not recommended to call either [Continuation.resume] nor [Continuation.resumeWithException] functions synchronously\n * in the same stackframe where suspension function is run. Use [suspendCoroutine] as a safer way to obtain current\n * continuation instance.\n */\n@SinceKotlin(\"1.3\")\n@InlineOnly\n@Suppress(\"UNUSED_PARAMETER\", \"RedundantSuspendModifier\")\npublic suspend inline fun suspendCoroutineUninterceptedOrReturn(crossinline block: (Continuation) -> Any?): T {\n contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) }\n throw NotImplementedError(\"Implementation of suspendCoroutineUninterceptedOrReturn is intrinsic\")\n}\n\n/**\n * This value is used as a return value of [suspendCoroutineUninterceptedOrReturn] `block` argument to state that\n * the execution was suspended and will not return any result immediately.\n *\n * **Note: this value should not be used in general code.** Using it outside of the context of\n * `suspendCoroutineUninterceptedOrReturn` function return value (including, but not limited to,\n * storing this value in other properties, returning it from other functions, etc)\n * can lead to unspecified behavior of the code.\n */\n// It is implemented as property with getter to avoid ProGuard problem with multifile IntrinsicsKt class\n@SinceKotlin(\"1.3\")\npublic val COROUTINE_SUSPENDED: Any get() = CoroutineSingletons.COROUTINE_SUSPENDED\n\n// Using enum here ensures two important properties:\n// 1. It makes SafeContinuation serializable with all kinds of serialization frameworks (since all of them natively support enums)\n// 2. It improves debugging experience, since you clearly see toString() value of those objects and what package they come from\n@SinceKotlin(\"1.3\")\n@PublishedApi // This class is Published API via serialized representation of SafeContinuation, don't rename/move\ninternal enum class CoroutineSingletons { COROUTINE_SUSPENDED, UNDECIDED, RESUMED }\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.internal\n\n// a mod b (in arithmetical sense)\nprivate fun mod(a: Int, b: Int): Int {\n val mod = a % b\n return if (mod >= 0) mod else mod + b\n}\n\nprivate fun mod(a: Long, b: Long): Long {\n val mod = a % b\n return if (mod >= 0) mod else mod + b\n}\n\n// (a - b) mod c\nprivate fun differenceModulo(a: Int, b: Int, c: Int): Int {\n return mod(mod(a, c) - mod(b, c), c)\n}\n\nprivate fun differenceModulo(a: Long, b: Long, c: Long): Long {\n return mod(mod(a, c) - mod(b, c), c)\n}\n\n/**\n * Calculates the final element of a bounded arithmetic progression, i.e. the last element of the progression which is in the range\n * from [start] to [end] in case of a positive [step], or from [end] to [start] in case of a negative\n * [step].\n *\n * No validation on passed parameters is performed. The given parameters should satisfy the condition:\n *\n * - either `step > 0` and `start <= end`,\n * - or `step < 0` and `start >= end`.\n *\n * @param start first element of the progression\n * @param end ending bound for the progression\n * @param step increment, or difference of successive elements in the progression\n * @return the final element of the progression\n * @suppress\n */\n@PublishedApi\ninternal fun getProgressionLastElement(start: Int, end: Int, step: Int): Int = when {\n step > 0 -> if (start >= end) end else end - differenceModulo(end, start, step)\n step < 0 -> if (start <= end) end else end + differenceModulo(start, end, -step)\n else -> throw kotlin.IllegalArgumentException(\"Step is zero.\")\n}\n\n/**\n * Calculates the final element of a bounded arithmetic progression, i.e. the last element of the progression which is in the range\n * from [start] to [end] in case of a positive [step], or from [end] to [start] in case of a negative\n * [step].\n *\n * No validation on passed parameters is performed. The given parameters should satisfy the condition:\n *\n * - either `step > 0` and `start <= end`,\n * - or `step < 0` and `start >= end`.\n *\n * @param start first element of the progression\n * @param end ending bound for the progression\n * @param step increment, or difference of successive elements in the progression\n * @return the final element of the progression\n * @suppress\n */\n@PublishedApi\ninternal fun getProgressionLastElement(start: Long, end: Long, step: Long): Long = when {\n step > 0 -> if (start >= end) end else end - differenceModulo(end, start, step)\n step < 0 -> if (start <= end) end else end + differenceModulo(start, end, -step)\n else -> throw kotlin.IllegalArgumentException(\"Step is zero.\")\n}\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.random\n\nimport kotlin.math.nextDown\n\n/**\n * An abstract class that is implemented by random number generator algorithms.\n *\n * The companion object [Random.Default] is the default instance of [Random].\n *\n * To get a seeded instance of random generator use [Random] function.\n *\n * @sample samples.random.Randoms.defaultRandom\n */\n@SinceKotlin(\"1.3\")\npublic abstract class Random {\n\n /**\n * Gets the next random [bitCount] number of bits.\n *\n * Generates an `Int` whose lower [bitCount] bits are filled with random values and the remaining upper bits are zero.\n *\n * @param bitCount number of bits to generate, must be in range 0..32, otherwise the behavior is unspecified.\n *\n * @sample samples.random.Randoms.nextBits\n */\n public abstract fun nextBits(bitCount: Int): Int\n\n /**\n * Gets the next random `Int` from the random number generator.\n *\n * Generates an `Int` random value uniformly distributed between `Int.MIN_VALUE` and `Int.MAX_VALUE` (inclusive).\n *\n * @sample samples.random.Randoms.nextInt\n */\n public open fun nextInt(): Int = nextBits(32)\n\n /**\n * Gets the next random non-negative `Int` from the random number generator less than the specified [until] bound.\n *\n * Generates an `Int` random value uniformly distributed between `0` (inclusive) and the specified [until] bound (exclusive).\n *\n * @param until must be positive.\n *\n * @throws IllegalArgumentException if [until] is negative or zero.\n *\n * @sample samples.random.Randoms.nextIntFromUntil\n */\n public open fun nextInt(until: Int): Int = nextInt(0, until)\n\n /**\n * Gets the next random `Int` from the random number generator in the specified range.\n *\n * Generates an `Int` random value uniformly distributed between the specified [from] (inclusive) and [until] (exclusive) bounds.\n *\n * @throws IllegalArgumentException if [from] is greater than or equal to [until].\n *\n * @sample samples.random.Randoms.nextIntFromUntil\n */\n public open fun nextInt(from: Int, until: Int): Int {\n checkRangeBounds(from, until)\n val n = until - from\n if (n > 0 || n == Int.MIN_VALUE) {\n val rnd = if (n and -n == n) {\n val bitCount = fastLog2(n)\n nextBits(bitCount)\n } else {\n var v: Int\n do {\n val bits = nextInt().ushr(1)\n v = bits % n\n } while (bits - v + (n - 1) < 0)\n v\n }\n return from + rnd\n } else {\n while (true) {\n val rnd = nextInt()\n if (rnd in from until until) return rnd\n }\n }\n }\n\n /**\n * Gets the next random `Long` from the random number generator.\n *\n * Generates a `Long` random value uniformly distributed between `Long.MIN_VALUE` and `Long.MAX_VALUE` (inclusive).\n *\n * @sample samples.random.Randoms.nextLong\n */\n public open fun nextLong(): Long = nextInt().toLong().shl(32) + nextInt()\n\n /**\n * Gets the next random non-negative `Long` from the random number generator less than the specified [until] bound.\n *\n * Generates a `Long` random value uniformly distributed between `0` (inclusive) and the specified [until] bound (exclusive).\n *\n * @param until must be positive.\n *\n * @throws IllegalArgumentException if [until] is negative or zero.\n *\n * @sample samples.random.Randoms.nextLongFromUntil\n */\n public open fun nextLong(until: Long): Long = nextLong(0, until)\n\n /**\n * Gets the next random `Long` from the random number generator in the specified range.\n *\n * Generates a `Long` random value uniformly distributed between the specified [from] (inclusive) and [until] (exclusive) bounds.\n *\n * @throws IllegalArgumentException if [from] is greater than or equal to [until].\n *\n * @sample samples.random.Randoms.nextLongFromUntil\n */\n public open fun nextLong(from: Long, until: Long): Long {\n checkRangeBounds(from, until)\n val n = until - from\n if (n > 0) {\n val rnd: Long\n if (n and -n == n) {\n val nLow = n.toInt()\n val nHigh = (n ushr 32).toInt()\n rnd = when {\n nLow != 0 -> {\n val bitCount = fastLog2(nLow)\n // toUInt().toLong()\n nextBits(bitCount).toLong() and 0xFFFF_FFFF\n }\n nHigh == 1 ->\n // toUInt().toLong()\n nextInt().toLong() and 0xFFFF_FFFF\n else -> {\n val bitCount = fastLog2(nHigh)\n nextBits(bitCount).toLong().shl(32) + (nextInt().toLong() and 0xFFFF_FFFF)\n }\n }\n } else {\n var v: Long\n do {\n val bits = nextLong().ushr(1)\n v = bits % n\n } while (bits - v + (n - 1) < 0)\n rnd = v\n }\n return from + rnd\n } else {\n while (true) {\n val rnd = nextLong()\n if (rnd in from until until) return rnd\n }\n }\n }\n\n /**\n * Gets the next random [Boolean] value.\n *\n * @sample samples.random.Randoms.nextBoolean\n */\n public open fun nextBoolean(): Boolean = nextBits(1) != 0\n\n /**\n * Gets the next random [Double] value uniformly distributed between 0 (inclusive) and 1 (exclusive).\n *\n * @sample samples.random.Randoms.nextDouble\n */\n public open fun nextDouble(): Double = doubleFromParts(nextBits(26), nextBits(27))\n\n /**\n * Gets the next random non-negative `Double` from the random number generator less than the specified [until] bound.\n *\n * Generates a `Double` random value uniformly distributed between 0 (inclusive) and [until] (exclusive).\n *\n * @throws IllegalArgumentException if [until] is negative or zero.\n *\n * @sample samples.random.Randoms.nextDoubleFromUntil\n */\n public open fun nextDouble(until: Double): Double = nextDouble(0.0, until)\n\n /**\n * Gets the next random `Double` from the random number generator in the specified range.\n *\n * Generates a `Double` random value uniformly distributed between the specified [from] (inclusive) and [until] (exclusive) bounds.\n *\n * [from] and [until] must be finite otherwise the behavior is unspecified.\n *\n * @throws IllegalArgumentException if [from] is greater than or equal to [until].\n *\n * @sample samples.random.Randoms.nextDoubleFromUntil\n */\n public open fun nextDouble(from: Double, until: Double): Double {\n checkRangeBounds(from, until)\n val size = until - from\n val r = if (size.isInfinite() && from.isFinite() && until.isFinite()) {\n val r1 = nextDouble() * (until / 2 - from / 2)\n from + r1 + r1\n } else {\n from + nextDouble() * size\n }\n return if (r >= until) until.nextDown() else r\n }\n\n /**\n * Gets the next random [Float] value uniformly distributed between 0 (inclusive) and 1 (exclusive).\n *\n * @sample samples.random.Randoms.nextFloat\n */\n public open fun nextFloat(): Float = nextBits(24) / (1 shl 24).toFloat()\n\n /**\n * Fills a subrange of the specified byte [array] starting from [fromIndex] inclusive and ending [toIndex] exclusive\n * with random bytes.\n *\n * @return [array] with the subrange filled with random bytes.\n *\n * @sample samples.random.Randoms.nextBytes\n */\n public open fun nextBytes(array: ByteArray, fromIndex: Int = 0, toIndex: Int = array.size): ByteArray {\n require(fromIndex in 0..array.size && toIndex in 0..array.size) { \"fromIndex ($fromIndex) or toIndex ($toIndex) are out of range: 0..${array.size}.\" }\n require(fromIndex <= toIndex) { \"fromIndex ($fromIndex) must be not greater than toIndex ($toIndex).\" }\n\n val steps = (toIndex - fromIndex) / 4\n\n var position = fromIndex\n repeat(steps) {\n val v = nextInt()\n array[position] = v.toByte()\n array[position + 1] = v.ushr(8).toByte()\n array[position + 2] = v.ushr(16).toByte()\n array[position + 3] = v.ushr(24).toByte()\n position += 4\n }\n\n val remainder = toIndex - position\n val vr = nextBits(remainder * 8)\n for (i in 0 until remainder) {\n array[position + i] = vr.ushr(i * 8).toByte()\n }\n\n return array\n }\n\n /**\n * Fills the specified byte [array] with random bytes and returns it.\n *\n * @return [array] filled with random bytes.\n *\n * @sample samples.random.Randoms.nextBytes\n */\n public open fun nextBytes(array: ByteArray): ByteArray = nextBytes(array, 0, array.size)\n\n /**\n * Creates a byte array of the specified [size], filled with random bytes.\n *\n * @sample samples.random.Randoms.nextBytes\n */\n public open fun nextBytes(size: Int): ByteArray = nextBytes(ByteArray(size))\n\n\n /**\n * The default random number generator.\n *\n * On JVM this generator is thread-safe, its methods can be invoked from multiple threads.\n *\n * @sample samples.random.Randoms.defaultRandom\n */\n companion object Default : Random(), Serializable {\n private val defaultRandom: Random = defaultPlatformRandom()\n\n private object Serialized : Serializable {\n private const val serialVersionUID = 0L\n\n private fun readResolve(): Any = Random\n }\n\n private fun writeReplace(): Any = Serialized\n\n override fun nextBits(bitCount: Int): Int = defaultRandom.nextBits(bitCount)\n override fun nextInt(): Int = defaultRandom.nextInt()\n override fun nextInt(until: Int): Int = defaultRandom.nextInt(until)\n override fun nextInt(from: Int, until: Int): Int = defaultRandom.nextInt(from, until)\n\n override fun nextLong(): Long = defaultRandom.nextLong()\n override fun nextLong(until: Long): Long = defaultRandom.nextLong(until)\n override fun nextLong(from: Long, until: Long): Long = defaultRandom.nextLong(from, until)\n\n override fun nextBoolean(): Boolean = defaultRandom.nextBoolean()\n\n override fun nextDouble(): Double = defaultRandom.nextDouble()\n override fun nextDouble(until: Double): Double = defaultRandom.nextDouble(until)\n override fun nextDouble(from: Double, until: Double): Double = defaultRandom.nextDouble(from, until)\n\n override fun nextFloat(): Float = defaultRandom.nextFloat()\n\n override fun nextBytes(array: ByteArray): ByteArray = defaultRandom.nextBytes(array)\n override fun nextBytes(size: Int): ByteArray = defaultRandom.nextBytes(size)\n override fun nextBytes(array: ByteArray, fromIndex: Int, toIndex: Int): ByteArray =\n defaultRandom.nextBytes(array, fromIndex, toIndex)\n }\n}\n\n/**\n * Returns a repeatable random number generator seeded with the given [seed] `Int` value.\n *\n * Two generators with the same seed produce the same sequence of values within the same version of Kotlin runtime.\n *\n * *Note:* Future versions of Kotlin may change the algorithm of this seeded number generator so that it will return\n * a sequence of values different from the current one for a given seed.\n *\n * On JVM the returned generator is NOT thread-safe. Do not invoke it from multiple threads without proper synchronization.\n *\n * @sample samples.random.Randoms.seededRandom\n */\n@SinceKotlin(\"1.3\")\npublic fun Random(seed: Int): Random = XorWowRandom(seed, seed.shr(31))\n\n/**\n * Returns a repeatable random number generator seeded with the given [seed] `Long` value.\n *\n * Two generators with the same seed produce the same sequence of values within the same version of Kotlin runtime.\n *\n * *Note:* Future versions of Kotlin may change the algorithm of this seeded number generator so that it will return\n * a sequence of values different from the current one for a given seed.\n *\n * On JVM the returned generator is NOT thread-safe. Do not invoke it from multiple threads without proper synchronization.\n *\n * @sample samples.random.Randoms.seededRandom\n */\n@SinceKotlin(\"1.3\")\npublic fun Random(seed: Long): Random = XorWowRandom(seed.toInt(), seed.shr(32).toInt())\n\n\n/**\n * Gets the next random `Int` from the random number generator in the specified [range].\n *\n * Generates an `Int` random value uniformly distributed in the specified [range]:\n * from `range.start` inclusive to `range.endInclusive` inclusive.\n *\n * @throws IllegalArgumentException if [range] is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun Random.nextInt(range: IntRange): Int = when {\n range.isEmpty() -> throw IllegalArgumentException(\"Cannot get random in empty range: $range\")\n range.last < Int.MAX_VALUE -> nextInt(range.first, range.last + 1)\n range.first > Int.MIN_VALUE -> nextInt(range.first - 1, range.last) + 1\n else -> nextInt()\n}\n\n/**\n * Gets the next random `Long` from the random number generator in the specified [range].\n *\n * Generates a `Long` random value uniformly distributed in the specified [range]:\n * from `range.start` inclusive to `range.endInclusive` inclusive.\n *\n * @throws IllegalArgumentException if [range] is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun Random.nextLong(range: LongRange): Long = when {\n range.isEmpty() -> throw IllegalArgumentException(\"Cannot get random in empty range: $range\")\n range.last < Long.MAX_VALUE -> nextLong(range.first, range.last + 1)\n range.first > Long.MIN_VALUE -> nextLong(range.first - 1, range.last) + 1\n else -> nextLong()\n}\n\n\ninternal expect fun defaultPlatformRandom(): Random\ninternal expect fun doubleFromParts(hi26: Int, low27: Int): Double\n\ninternal fun fastLog2(value: Int): Int = 31 - value.countLeadingZeroBits()\n\n/** Takes upper [bitCount] bits (0..32) from this number. */\ninternal fun Int.takeUpperBits(bitCount: Int): Int =\n this.ushr(32 - bitCount) and (-bitCount).shr(31)\n\ninternal fun checkRangeBounds(from: Int, until: Int) = require(until > from) { boundsErrorMessage(from, until) }\ninternal fun checkRangeBounds(from: Long, until: Long) = require(until > from) { boundsErrorMessage(from, until) }\ninternal fun checkRangeBounds(from: Double, until: Double) = require(until > from) { boundsErrorMessage(from, until) }\n\ninternal fun boundsErrorMessage(from: Any, until: Any) = \"Random range is empty: [$from, $until).\"\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.random\n\n/**\n * Random number generator, using Marsaglia's \"xorwow\" algorithm\n *\n * Cycles after 2^192 - 2^32 repetitions.\n *\n * For more details, see Marsaglia, George (July 2003). \"Xorshift RNGs\". Journal of Statistical Software. 8 (14). doi:10.18637/jss.v008.i14\n *\n * Available at https://www.jstatsoft.org/v08/i14/paper\n *\n */\ninternal class XorWowRandom internal constructor(\n private var x: Int,\n private var y: Int,\n private var z: Int,\n private var w: Int,\n private var v: Int,\n private var addend: Int\n) : Random(), Serializable {\n\n internal constructor(seed1: Int, seed2: Int) :\n this(seed1, seed2, 0, 0, seed1.inv(), (seed1 shl 10) xor (seed2 ushr 4))\n\n init {\n require((x or y or z or w or v) != 0) { \"Initial state must have at least one non-zero element.\" }\n\n // some trivial seeds can produce several values with zeroes in upper bits, so we discard first 64\n repeat(64) { nextInt() }\n }\n\n override fun nextInt(): Int {\n // Equivalent to the xorxow algorithm\n // From Marsaglia, G. 2003. Xorshift RNGs. J. Statis. Soft. 8, 14, p. 5\n var t = x\n t = t xor (t ushr 2)\n x = y\n y = z\n z = w\n val v0 = v\n w = v0\n t = (t xor (t shl 1)) xor v0 xor (v0 shl 4)\n v = t\n addend += 362437\n return t + addend\n }\n\n override fun nextBits(bitCount: Int): Int =\n nextInt().takeUpperBits(bitCount)\n\n private companion object {\n private const val serialVersionUID: Long = 0L\n }\n}\n","/*\n * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n// Auto-generated file. DO NOT EDIT!\n\npackage kotlin.ranges\n\n/**\n * A range of values of type `Char`.\n */\n@OptIn(ExperimentalStdlibApi::class)\npublic class CharRange(start: Char, endInclusive: Char) : CharProgression(start, endInclusive, 1), ClosedRange, OpenEndRange {\n override val start: Char get() = first\n override val endInclusive: Char get() = last\n \n @Deprecated(\"Can throw an exception when it's impossible to represent the value with Char type, for example, when the range includes MAX_VALUE. It's recommended to use 'endInclusive' property that doesn't throw.\")\n @SinceKotlin(\"1.7\")\n @ExperimentalStdlibApi\n override val endExclusive: Char get() {\n if (last == Char.MAX_VALUE) error(\"Cannot return the exclusive upper bound of a range that includes MAX_VALUE.\")\n return last + 1\n }\n\n override fun contains(value: Char): Boolean = first <= value && value <= last\n\n /** \n * Checks whether the range is empty.\n *\n * The range is empty if its start value is greater than the end value.\n */\n override fun isEmpty(): Boolean = first > last\n\n override fun equals(other: Any?): Boolean =\n other is CharRange && (isEmpty() && other.isEmpty() ||\n first == other.first && last == other.last)\n\n override fun hashCode(): Int =\n if (isEmpty()) -1 else (31 * first.code + last.code)\n\n override fun toString(): String = \"$first..$last\"\n\n companion object {\n /** An empty range of values of type Char. */\n public val EMPTY: CharRange = CharRange(1.toChar(), 0.toChar())\n }\n}\n\n/**\n * A range of values of type `Int`.\n */\n@OptIn(ExperimentalStdlibApi::class)\npublic class IntRange(start: Int, endInclusive: Int) : IntProgression(start, endInclusive, 1), ClosedRange, OpenEndRange {\n override val start: Int get() = first\n override val endInclusive: Int get() = last\n \n @Deprecated(\"Can throw an exception when it's impossible to represent the value with Int type, for example, when the range includes MAX_VALUE. It's recommended to use 'endInclusive' property that doesn't throw.\")\n @SinceKotlin(\"1.7\")\n @ExperimentalStdlibApi\n override val endExclusive: Int get() {\n if (last == Int.MAX_VALUE) error(\"Cannot return the exclusive upper bound of a range that includes MAX_VALUE.\")\n return last + 1\n }\n\n override fun contains(value: Int): Boolean = first <= value && value <= last\n\n /** \n * Checks whether the range is empty.\n *\n * The range is empty if its start value is greater than the end value.\n */\n override fun isEmpty(): Boolean = first > last\n\n override fun equals(other: Any?): Boolean =\n other is IntRange && (isEmpty() && other.isEmpty() ||\n first == other.first && last == other.last)\n\n override fun hashCode(): Int =\n if (isEmpty()) -1 else (31 * first + last)\n\n override fun toString(): String = \"$first..$last\"\n\n companion object {\n /** An empty range of values of type Int. */\n public val EMPTY: IntRange = IntRange(1, 0)\n }\n}\n\n/**\n * A range of values of type `Long`.\n */\n@OptIn(ExperimentalStdlibApi::class)\npublic class LongRange(start: Long, endInclusive: Long) : LongProgression(start, endInclusive, 1), ClosedRange, OpenEndRange {\n override val start: Long get() = first\n override val endInclusive: Long get() = last\n \n @Deprecated(\"Can throw an exception when it's impossible to represent the value with Long type, for example, when the range includes MAX_VALUE. It's recommended to use 'endInclusive' property that doesn't throw.\")\n @SinceKotlin(\"1.7\")\n @ExperimentalStdlibApi\n override val endExclusive: Long get() {\n if (last == Long.MAX_VALUE) error(\"Cannot return the exclusive upper bound of a range that includes MAX_VALUE.\")\n return last + 1\n }\n\n override fun contains(value: Long): Boolean = first <= value && value <= last\n\n /** \n * Checks whether the range is empty.\n *\n * The range is empty if its start value is greater than the end value.\n */\n override fun isEmpty(): Boolean = first > last\n\n override fun equals(other: Any?): Boolean =\n other is LongRange && (isEmpty() && other.isEmpty() ||\n first == other.first && last == other.last)\n\n override fun hashCode(): Int =\n if (isEmpty()) -1 else (31 * (first xor (first ushr 32)) + (last xor (last ushr 32))).toInt()\n\n override fun toString(): String = \"$first..$last\"\n\n companion object {\n /** An empty range of values of type Long. */\n public val EMPTY: LongRange = LongRange(1, 0)\n }\n}\n\n","/*\n * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n// Auto-generated file. DO NOT EDIT!\n\npackage kotlin.ranges\n\n/**\n * An iterator over a progression of values of type `Char`.\n * @property step the number by which the value is incremented on each step.\n */\ninternal class CharProgressionIterator(first: Char, last: Char, val step: Int) : CharIterator() {\n private val finalElement: Int = last.code\n private var hasNext: Boolean = if (step > 0) first <= last else first >= last\n private var next: Int = if (hasNext) first.code else finalElement\n\n override fun hasNext(): Boolean = hasNext\n\n override fun nextChar(): Char {\n val value = next\n if (value == finalElement) {\n if (!hasNext) throw kotlin.NoSuchElementException()\n hasNext = false\n }\n else {\n next += step\n }\n return value.toChar()\n }\n}\n\n/**\n * An iterator over a progression of values of type `Int`.\n * @property step the number by which the value is incremented on each step.\n */\ninternal class IntProgressionIterator(first: Int, last: Int, val step: Int) : IntIterator() {\n private val finalElement: Int = last\n private var hasNext: Boolean = if (step > 0) first <= last else first >= last\n private var next: Int = if (hasNext) first else finalElement\n\n override fun hasNext(): Boolean = hasNext\n\n override fun nextInt(): Int {\n val value = next\n if (value == finalElement) {\n if (!hasNext) throw kotlin.NoSuchElementException()\n hasNext = false\n }\n else {\n next += step\n }\n return value\n }\n}\n\n/**\n * An iterator over a progression of values of type `Long`.\n * @property step the number by which the value is incremented on each step.\n */\ninternal class LongProgressionIterator(first: Long, last: Long, val step: Long) : LongIterator() {\n private val finalElement: Long = last\n private var hasNext: Boolean = if (step > 0) first <= last else first >= last\n private var next: Long = if (hasNext) first else finalElement\n\n override fun hasNext(): Boolean = hasNext\n\n override fun nextLong(): Long {\n val value = next\n if (value == finalElement) {\n if (!hasNext) throw kotlin.NoSuchElementException()\n hasNext = false\n }\n else {\n next += step\n }\n return value\n }\n}\n\n","/*\n * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n// Auto-generated file. DO NOT EDIT!\n\npackage kotlin.ranges\n\nimport kotlin.internal.getProgressionLastElement\n\n/**\n * A progression of values of type `Char`.\n */\npublic open class CharProgression\n internal constructor\n (\n start: Char,\n endInclusive: Char,\n step: Int\n ) : Iterable {\n init {\n if (step == 0) throw kotlin.IllegalArgumentException(\"Step must be non-zero.\")\n if (step == Int.MIN_VALUE) throw kotlin.IllegalArgumentException(\"Step must be greater than Int.MIN_VALUE to avoid overflow on negation.\")\n }\n\n /**\n * The first element in the progression.\n */\n public val first: Char = start\n\n /**\n * The last element in the progression.\n */\n public val last: Char = getProgressionLastElement(start.code, endInclusive.code, step).toChar()\n\n /**\n * The step of the progression.\n */\n public val step: Int = step\n\n override fun iterator(): CharIterator = CharProgressionIterator(first, last, step)\n\n /**\n * Checks if the progression is empty.\n *\n * Progression with a positive step is empty if its first element is greater than the last element.\n * Progression with a negative step is empty if its first element is less than the last element.\n */\n public open fun isEmpty(): Boolean = if (step > 0) first > last else first < last\n\n override fun equals(other: Any?): Boolean =\n other is CharProgression && (isEmpty() && other.isEmpty() ||\n first == other.first && last == other.last && step == other.step)\n\n override fun hashCode(): Int =\n if (isEmpty()) -1 else (31 * (31 * first.code + last.code) + step)\n\n override fun toString(): String = if (step > 0) \"$first..$last step $step\" else \"$first downTo $last step ${-step}\"\n\n companion object {\n /**\n * Creates CharProgression within the specified bounds of a closed range.\n *\n * The progression starts with the [rangeStart] value and goes toward the [rangeEnd] value not excluding it, with the specified [step].\n * In order to go backwards the [step] must be negative.\n *\n * [step] must be greater than `Int.MIN_VALUE` and not equal to zero.\n */\n public fun fromClosedRange(rangeStart: Char, rangeEnd: Char, step: Int): CharProgression = CharProgression(rangeStart, rangeEnd, step)\n }\n}\n\n/**\n * A progression of values of type `Int`.\n */\npublic open class IntProgression\n internal constructor\n (\n start: Int,\n endInclusive: Int,\n step: Int\n ) : Iterable {\n init {\n if (step == 0) throw kotlin.IllegalArgumentException(\"Step must be non-zero.\")\n if (step == Int.MIN_VALUE) throw kotlin.IllegalArgumentException(\"Step must be greater than Int.MIN_VALUE to avoid overflow on negation.\")\n }\n\n /**\n * The first element in the progression.\n */\n public val first: Int = start\n\n /**\n * The last element in the progression.\n */\n public val last: Int = getProgressionLastElement(start, endInclusive, step)\n\n /**\n * The step of the progression.\n */\n public val step: Int = step\n\n override fun iterator(): IntIterator = IntProgressionIterator(first, last, step)\n\n /**\n * Checks if the progression is empty.\n *\n * Progression with a positive step is empty if its first element is greater than the last element.\n * Progression with a negative step is empty if its first element is less than the last element.\n */\n public open fun isEmpty(): Boolean = if (step > 0) first > last else first < last\n\n override fun equals(other: Any?): Boolean =\n other is IntProgression && (isEmpty() && other.isEmpty() ||\n first == other.first && last == other.last && step == other.step)\n\n override fun hashCode(): Int =\n if (isEmpty()) -1 else (31 * (31 * first + last) + step)\n\n override fun toString(): String = if (step > 0) \"$first..$last step $step\" else \"$first downTo $last step ${-step}\"\n\n companion object {\n /**\n * Creates IntProgression within the specified bounds of a closed range.\n *\n * The progression starts with the [rangeStart] value and goes toward the [rangeEnd] value not excluding it, with the specified [step].\n * In order to go backwards the [step] must be negative.\n *\n * [step] must be greater than `Int.MIN_VALUE` and not equal to zero.\n */\n public fun fromClosedRange(rangeStart: Int, rangeEnd: Int, step: Int): IntProgression = IntProgression(rangeStart, rangeEnd, step)\n }\n}\n\n/**\n * A progression of values of type `Long`.\n */\npublic open class LongProgression\n internal constructor\n (\n start: Long,\n endInclusive: Long,\n step: Long\n ) : Iterable {\n init {\n if (step == 0L) throw kotlin.IllegalArgumentException(\"Step must be non-zero.\")\n if (step == Long.MIN_VALUE) throw kotlin.IllegalArgumentException(\"Step must be greater than Long.MIN_VALUE to avoid overflow on negation.\")\n }\n\n /**\n * The first element in the progression.\n */\n public val first: Long = start\n\n /**\n * The last element in the progression.\n */\n public val last: Long = getProgressionLastElement(start, endInclusive, step)\n\n /**\n * The step of the progression.\n */\n public val step: Long = step\n\n override fun iterator(): LongIterator = LongProgressionIterator(first, last, step)\n\n /**\n * Checks if the progression is empty.\n *\n * Progression with a positive step is empty if its first element is greater than the last element.\n * Progression with a negative step is empty if its first element is less than the last element.\n */\n public open fun isEmpty(): Boolean = if (step > 0) first > last else first < last\n\n override fun equals(other: Any?): Boolean =\n other is LongProgression && (isEmpty() && other.isEmpty() ||\n first == other.first && last == other.last && step == other.step)\n\n override fun hashCode(): Int =\n if (isEmpty()) -1 else (31 * (31 * (first xor (first ushr 32)) + (last xor (last ushr 32))) + (step xor (step ushr 32))).toInt()\n\n override fun toString(): String = if (step > 0) \"$first..$last step $step\" else \"$first downTo $last step ${-step}\"\n\n companion object {\n /**\n * Creates LongProgression within the specified bounds of a closed range.\n *\n * The progression starts with the [rangeStart] value and goes toward the [rangeEnd] value not excluding it, with the specified [step].\n * In order to go backwards the [step] must be negative.\n *\n * [step] must be greater than `Long.MIN_VALUE` and not equal to zero.\n */\n public fun fromClosedRange(rangeStart: Long, rangeEnd: Long, step: Long): LongProgression = LongProgression(rangeStart, rangeEnd, step)\n }\n}\n\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"RangesKt\")\n\npackage kotlin.ranges\n\n/**\n * Represents a range of [Comparable] values.\n */\nprivate open class ComparableRange>(\n override val start: T,\n override val endInclusive: T\n) : ClosedRange {\n\n override fun equals(other: Any?): Boolean {\n return other is ComparableRange<*> && (isEmpty() && other.isEmpty() ||\n start == other.start && endInclusive == other.endInclusive)\n }\n\n override fun hashCode(): Int {\n return if (isEmpty()) -1 else 31 * start.hashCode() + endInclusive.hashCode()\n }\n\n override fun toString(): String = \"$start..$endInclusive\"\n}\n\n/**\n * Creates a range from this [Comparable] value to the specified [that] value.\n *\n * This value needs to be smaller than or equal to [that] value, otherwise the returned range will be empty.\n * @sample samples.ranges.Ranges.rangeFromComparable\n */\npublic operator fun > T.rangeTo(that: T): ClosedRange = ComparableRange(this, that)\n\n/**\n * Represents a range of [Comparable] values.\n */\n@OptIn(ExperimentalStdlibApi::class)\nprivate open class ComparableOpenEndRange>(\n override val start: T,\n override val endExclusive: T\n) : OpenEndRange {\n\n override fun equals(other: Any?): Boolean {\n return other is ComparableOpenEndRange<*> && (isEmpty() && other.isEmpty() ||\n start == other.start && endExclusive == other.endExclusive)\n }\n\n override fun hashCode(): Int {\n return if (isEmpty()) -1 else 31 * start.hashCode() + endExclusive.hashCode()\n }\n\n override fun toString(): String = \"$start..<$endExclusive\"\n}\n\n/**\n * Creates an open-ended range from this [Comparable] value to the specified [that] value.\n *\n * This value needs to be smaller than [that] value, otherwise the returned range will be empty.\n * @sample samples.ranges.Ranges.rangeFromComparable\n */\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\npublic operator fun > T.rangeUntil(that: T): OpenEndRange = ComparableOpenEndRange(this, that)\n\n\n/**\n * Represents a range of floating point numbers.\n * Extends [ClosedRange] interface providing custom operation [lessThanOrEquals] for comparing values of range domain type.\n *\n * This interface is implemented by floating point ranges returned by [Float.rangeTo] and [Double.rangeTo] operators to\n * achieve IEEE-754 comparison order instead of total order of floating point numbers.\n */\n@SinceKotlin(\"1.1\")\npublic interface ClosedFloatingPointRange> : ClosedRange {\n override fun contains(value: T): Boolean = lessThanOrEquals(start, value) && lessThanOrEquals(value, endInclusive)\n override fun isEmpty(): Boolean = !lessThanOrEquals(start, endInclusive)\n\n /**\n * Compares two values of range domain type and returns true if first is less than or equal to second.\n */\n fun lessThanOrEquals(a: T, b: T): Boolean\n}\n\n\n/**\n * A closed range of values of type `Double`.\n *\n * Numbers are compared with the ends of this range according to IEEE-754.\n */\nprivate class ClosedDoubleRange(\n start: Double,\n endInclusive: Double\n) : ClosedFloatingPointRange {\n private val _start = start\n private val _endInclusive = endInclusive\n override val start: Double get() = _start\n override val endInclusive: Double get() = _endInclusive\n\n override fun lessThanOrEquals(a: Double, b: Double): Boolean = a <= b\n\n override fun contains(value: Double): Boolean = value >= _start && value <= _endInclusive\n override fun isEmpty(): Boolean = !(_start <= _endInclusive)\n\n override fun equals(other: Any?): Boolean {\n return other is ClosedDoubleRange && (isEmpty() && other.isEmpty() ||\n _start == other._start && _endInclusive == other._endInclusive)\n }\n\n override fun hashCode(): Int {\n return if (isEmpty()) -1 else 31 * _start.hashCode() + _endInclusive.hashCode()\n }\n\n override fun toString(): String = \"$_start..$_endInclusive\"\n}\n\n/**\n * Creates a range from this [Double] value to the specified [that] value.\n *\n * Numbers are compared with the ends of this range according to IEEE-754.\n * @sample samples.ranges.Ranges.rangeFromDouble\n */\n@SinceKotlin(\"1.1\")\npublic operator fun Double.rangeTo(that: Double): ClosedFloatingPointRange = ClosedDoubleRange(this, that)\n\n/**\n * An open-ended range of values of type `Double`.\n *\n * Numbers are compared with the ends of this range according to IEEE-754.\n */\n@OptIn(ExperimentalStdlibApi::class)\nprivate class OpenEndDoubleRange(\n start: Double,\n endExclusive: Double\n) : OpenEndRange {\n private val _start = start\n private val _endExclusive = endExclusive\n override val start: Double get() = _start\n override val endExclusive: Double get() = _endExclusive\n\n private fun lessThanOrEquals(a: Double, b: Double): Boolean = a <= b\n\n override fun contains(value: Double): Boolean = value >= _start && value < _endExclusive\n override fun isEmpty(): Boolean = !(_start < _endExclusive)\n\n override fun equals(other: Any?): Boolean {\n return other is OpenEndDoubleRange && (isEmpty() && other.isEmpty() ||\n _start == other._start && _endExclusive == other._endExclusive)\n }\n\n override fun hashCode(): Int {\n return if (isEmpty()) -1 else 31 * _start.hashCode() + _endExclusive.hashCode()\n }\n\n override fun toString(): String = \"$_start..<$_endExclusive\"\n}\n\n/**\n * Creates an open-ended range from this [Double] value to the specified [that] value.\n *\n * Numbers are compared with the ends of this range according to IEEE-754.\n */\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\npublic operator fun Double.rangeUntil(that: Double): OpenEndRange = OpenEndDoubleRange(this, that)\n\n\n/**\n * A closed range of values of type `Float`.\n *\n * Numbers are compared with the ends of this range according to IEEE-754.\n */\nprivate class ClosedFloatRange(\n start: Float,\n endInclusive: Float\n) : ClosedFloatingPointRange {\n private val _start = start\n private val _endInclusive = endInclusive\n override val start: Float get() = _start\n override val endInclusive: Float get() = _endInclusive\n\n override fun lessThanOrEquals(a: Float, b: Float): Boolean = a <= b\n\n override fun contains(value: Float): Boolean = value >= _start && value <= _endInclusive\n override fun isEmpty(): Boolean = !(_start <= _endInclusive)\n\n override fun equals(other: Any?): Boolean {\n return other is ClosedFloatRange && (isEmpty() && other.isEmpty() ||\n _start == other._start && _endInclusive == other._endInclusive)\n }\n\n override fun hashCode(): Int {\n return if (isEmpty()) -1 else 31 * _start.hashCode() + _endInclusive.hashCode()\n }\n\n override fun toString(): String = \"$_start..$_endInclusive\"\n}\n\n/**\n * Creates a range from this [Float] value to the specified [that] value.\n *\n * Numbers are compared with the ends of this range according to IEEE-754.\n * @sample samples.ranges.Ranges.rangeFromFloat\n */\n@SinceKotlin(\"1.1\")\npublic operator fun Float.rangeTo(that: Float): ClosedFloatingPointRange = ClosedFloatRange(this, that)\n\n\n/**\n * An open-ended range of values of type `Float`.\n *\n * Numbers are compared with the ends of this range according to IEEE-754.\n */\n@OptIn(ExperimentalStdlibApi::class)\nprivate class OpenEndFloatRange(\n start: Float,\n endExclusive: Float\n) : OpenEndRange {\n private val _start = start\n private val _endExclusive = endExclusive\n override val start: Float get() = _start\n override val endExclusive: Float get() = _endExclusive\n\n private fun lessThanOrEquals(a: Float, b: Float): Boolean = a <= b\n\n override fun contains(value: Float): Boolean = value >= _start && value < _endExclusive\n override fun isEmpty(): Boolean = !(_start < _endExclusive)\n\n override fun equals(other: Any?): Boolean {\n return other is OpenEndFloatRange && (isEmpty() && other.isEmpty() ||\n _start == other._start && _endExclusive == other._endExclusive)\n }\n\n override fun hashCode(): Int {\n return if (isEmpty()) -1 else 31 * _start.hashCode() + _endExclusive.hashCode()\n }\n\n override fun toString(): String = \"$_start..<$_endExclusive\"\n}\n\n/**\n * Creates an open-ended range from this [Float] value to the specified [that] value.\n *\n * Numbers are compared with the ends of this range according to IEEE-754.\n */\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\npublic operator fun Float.rangeUntil(that: Float): OpenEndRange = OpenEndFloatRange(this, that)\n\n\n/**\n * Returns `true` if this iterable range contains the specified [element].\n *\n * Always returns `false` if the [element] is `null`.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline operator fun R.contains(element: T?): Boolean where T : Any, R : ClosedRange, R : Iterable =\n element != null && contains(element)\n\n/**\n * Returns `true` if this iterable range contains the specified [element].\n *\n * Always returns `false` if the [element] is `null`.\n */\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\n@kotlin.internal.InlineOnly\npublic inline operator fun R.contains(element: T?): Boolean where T : Any, R : OpenEndRange, R : Iterable =\n element != null && contains(element)\n\ninternal fun checkStepIsPositive(isPositive: Boolean, step: Number) {\n if (!isPositive) throw IllegalArgumentException(\"Step must be positive, was: $step.\")\n}\n","/*\n * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"StringsKt\")\n\npackage kotlin.text\n\n/**\n * An object to which char sequences and values can be appended.\n */\nexpect interface Appendable {\n /**\n * Appends the specified character [value] to this Appendable and returns this instance.\n *\n * @param value the character to append.\n */\n fun append(value: Char): Appendable\n\n /**\n * Appends the specified character sequence [value] to this Appendable and returns this instance.\n *\n * @param value the character sequence to append. If [value] is `null`, then the four characters `\"null\"` are appended to this Appendable.\n */\n fun append(value: CharSequence?): Appendable\n\n /**\n * Appends a subsequence of the specified character sequence [value] to this Appendable and returns this instance.\n *\n * @param value the character sequence from which a subsequence is appended. If [value] is `null`,\n * then characters are appended as if [value] contained the four characters `\"null\"`.\n * @param startIndex the beginning (inclusive) of the subsequence to append.\n * @param endIndex the end (exclusive) of the subsequence to append.\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of the [value] character sequence indices or when `startIndex > endIndex`.\n */\n fun append(value: CharSequence?, startIndex: Int, endIndex: Int): Appendable\n}\n\n/**\n * Appends a subsequence of the specified character sequence [value] to this Appendable and returns this instance.\n *\n * @param value the character sequence from which a subsequence is appended.\n * @param startIndex the beginning (inclusive) of the subsequence to append.\n * @param endIndex the end (exclusive) of the subsequence to append.\n *\n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of the [value] character sequence indices or when `startIndex > endIndex`.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun T.appendRange(value: CharSequence, startIndex: Int, endIndex: Int): T {\n @Suppress(\"UNCHECKED_CAST\")\n return append(value, startIndex, endIndex) as T\n}\n\n/**\n * Appends all arguments to the given [Appendable].\n */\npublic fun T.append(vararg value: CharSequence?): T {\n for (item in value)\n append(item)\n return this\n}\n\n/** Appends a line feed character (`\\n`) to this Appendable. */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun Appendable.appendLine(): Appendable = append('\\n')\n\n/** Appends value to the given Appendable and a line feed character (`\\n`) after it. */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun Appendable.appendLine(value: CharSequence?): Appendable = append(value).appendLine()\n\n/** Appends value to the given Appendable and a line feed character (`\\n`) after it. */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun Appendable.appendLine(value: Char): Appendable = append(value).appendLine()\n\n\ninternal fun Appendable.appendElement(element: T, transform: ((T) -> CharSequence)?) {\n when {\n transform != null -> append(transform(element))\n element is CharSequence? -> append(element)\n element is Char -> append(element)\n else -> append(element.toString())\n }\n}\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"CharsKt\")\n\npackage kotlin.text\n\n/**\n * Returns the numeric value of the decimal digit that this Char represents.\n * Throws an exception if this Char is not a valid decimal digit.\n *\n * A Char is considered to represent a decimal digit if [isDigit] is true for the Char.\n * In this case, the Unicode decimal digit value of the character is returned.\n *\n * @sample samples.text.Chars.digitToInt\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun Char.digitToInt(): Int {\n return digitOf(this, 10).also {\n if (it < 0) throw IllegalArgumentException(\"Char $this is not a decimal digit\")\n }\n}\n\n/**\n * Returns the numeric value of the digit that this Char represents in the specified [radix].\n * Throws an exception if the [radix] is not in the range `2..36` or if this Char is not a valid digit in the specified [radix].\n *\n * A Char is considered to represent a digit in the specified [radix] if at least one of the following is true:\n * - [isDigit] is `true` for the Char and the Unicode decimal digit value of the character is less than the specified [radix]. In this case the decimal digit value is returned.\n * - The Char is one of the uppercase Latin letters 'A' through 'Z' and its [code] is less than `radix + 'A'.code - 10`. In this case, `this.code - 'A'.code + 10` is returned.\n * - The Char is one of the lowercase Latin letters 'a' through 'z' and its [code] is less than `radix + 'a'.code - 10`. In this case, `this.code - 'a'.code + 10` is returned.\n * - The Char is one of the fullwidth Latin capital letters '\\uFF21' through '\\uFF3A' and its [code] is less than `radix + 0xFF21 - 10`. In this case, `this.code - 0xFF21 + 10` is returned.\n * - The Char is one of the fullwidth Latin small letters '\\uFF41' through '\\uFF5A' and its [code] is less than `radix + 0xFF41 - 10`. In this case, `this.code - 0xFF41 + 10` is returned.\n *\n * @sample samples.text.Chars.digitToInt\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun Char.digitToInt(radix: Int): Int {\n return digitToIntOrNull(radix) ?: throw IllegalArgumentException(\"Char $this is not a digit in the given radix=$radix\")\n}\n\n/**\n *\n * Returns the numeric value of the decimal digit that this Char represents, or `null` if this Char is not a valid decimal digit.\n *\n * A Char is considered to represent a decimal digit if [isDigit] is true for the Char.\n * In this case, the Unicode decimal digit value of the character is returned.\n *\n * @sample samples.text.Chars.digitToIntOrNull\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun Char.digitToIntOrNull(): Int? {\n return digitOf(this, 10).takeIf { it >= 0 }\n}\n\n/**\n * Returns the numeric value of the digit that this Char represents in the specified [radix], or `null` if this Char is not a valid digit in the specified [radix].\n * Throws an exception if the [radix] is not in the range `2..36`.\n *\n * A Char is considered to represent a digit in the specified [radix] if at least one of the following is true:\n * - [isDigit] is `true` for the Char and the Unicode decimal digit value of the character is less than the specified [radix]. In this case the decimal digit value is returned.\n * - The Char is one of the uppercase Latin letters 'A' through 'Z' and its [code] is less than `radix + 'A'.code - 10`. In this case, `this.code - 'A'.code + 10` is returned.\n * - The Char is one of the lowercase Latin letters 'a' through 'z' and its [code] is less than `radix + 'a'.code - 10`. In this case, `this.code - 'a'.code + 10` is returned.\n * - The Char is one of the fullwidth Latin capital letters '\\uFF21' through '\\uFF3A' and its [code] is less than `radix + 0xFF21 - 10`. In this case, `this.code - 0xFF21 + 10` is returned.\n * - The Char is one of the fullwidth Latin small letters '\\uFF41' through '\\uFF5A' and its [code] is less than `radix + 0xFF41 - 10`. In this case, `this.code - 0xFF41 + 10` is returned.\n *\n * @sample samples.text.Chars.digitToIntOrNull\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun Char.digitToIntOrNull(radix: Int): Int? {\n checkRadix(radix)\n return digitOf(this, radix).takeIf { it >= 0 }\n}\n\n/**\n * Returns the Char that represents this decimal digit.\n * Throws an exception if this value is not in the range `0..9`.\n *\n * If this value is in `0..9`, the decimal digit Char with code `'0'.code + this` is returned.\n *\n * @sample samples.text.Chars.digitToChar\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun Int.digitToChar(): Char {\n if (this in 0..9) {\n return '0' + this\n }\n throw IllegalArgumentException(\"Int $this is not a decimal digit\")\n}\n\n/**\n * Returns the Char that represents this numeric digit value in the specified [radix].\n * Throws an exception if the [radix] is not in the range `2..36` or if this value is not in the range `0 until radix`.\n *\n * If this value is less than `10`, the decimal digit Char with code `'0'.code + this` is returned.\n * Otherwise, the uppercase Latin letter with code `'A'.code + this - 10` is returned.\n *\n * @sample samples.text.Chars.digitToChar\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun Int.digitToChar(radix: Int): Char {\n if (radix !in 2..36) {\n throw IllegalArgumentException(\"Invalid radix: $radix. Valid radix values are in range 2..36\")\n }\n if (this < 0 || this >= radix) {\n throw IllegalArgumentException(\"Digit $this does not represent a valid digit in radix $radix\")\n }\n return if (this < 10) {\n '0' + this\n } else {\n 'A' + this - 10\n }\n}\n\n/**\n * Converts this character to lower case using Unicode mapping rules of the invariant locale.\n */\n@Deprecated(\"Use lowercaseChar() instead.\", ReplaceWith(\"lowercaseChar()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic expect fun Char.toLowerCase(): Char\n\n/**\n * Converts this character to lower case using Unicode mapping rules of the invariant locale.\n *\n * This function performs one-to-one character mapping.\n * To support one-to-many character mapping use the [lowercase] function.\n * If this character has no mapping equivalent, the character itself is returned.\n *\n * @sample samples.text.Chars.lowercase\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic expect fun Char.lowercaseChar(): Char\n\n/**\n * Converts this character to lower case using Unicode mapping rules of the invariant locale.\n *\n * This function supports one-to-many character mapping, thus the length of the returned string can be greater than one.\n * For example, `'\\u0130'.lowercase()` returns `\"\\u0069\\u0307\"`,\n * where `'\\u0130'` is the LATIN CAPITAL LETTER I WITH DOT ABOVE character (`İ`).\n * If this character has no lower case mapping, the result of `toString()` of this char is returned.\n *\n * @sample samples.text.Chars.lowercase\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic expect fun Char.lowercase(): String\n\n/**\n * Converts this character to upper case using Unicode mapping rules of the invariant locale.\n */\n@Deprecated(\"Use uppercaseChar() instead.\", ReplaceWith(\"uppercaseChar()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic expect fun Char.toUpperCase(): Char\n\n/**\n * Converts this character to upper case using Unicode mapping rules of the invariant locale.\n *\n * This function performs one-to-one character mapping.\n * To support one-to-many character mapping use the [uppercase] function.\n * If this character has no mapping equivalent, the character itself is returned.\n *\n * @sample samples.text.Chars.uppercase\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic expect fun Char.uppercaseChar(): Char\n\n/**\n * Converts this character to upper case using Unicode mapping rules of the invariant locale.\n *\n * This function supports one-to-many character mapping, thus the length of the returned string can be greater than one.\n * For example, `'\\uFB00'.uppercase()` returns `\"\\u0046\\u0046\"`,\n * where `'\\uFB00'` is the LATIN SMALL LIGATURE FF character (`ff`).\n * If this character has no upper case mapping, the result of `toString()` of this char is returned.\n *\n * @sample samples.text.Chars.uppercase\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic expect fun Char.uppercase(): String\n\n/**\n * Converts this character to title case using Unicode mapping rules of the invariant locale.\n *\n * This function performs one-to-one character mapping.\n * To support one-to-many character mapping use the [titlecase] function.\n * If this character has no mapping equivalent, the result of calling [uppercaseChar] is returned.\n *\n * @sample samples.text.Chars.titlecase\n */\n@SinceKotlin(\"1.5\")\npublic expect fun Char.titlecaseChar(): Char\n\n/**\n * Converts this character to title case using Unicode mapping rules of the invariant locale.\n *\n * This function supports one-to-many character mapping, thus the length of the returned string can be greater than one.\n * For example, `'\\uFB00'.titlecase()` returns `\"\\u0046\\u0066\"`,\n * where `'\\uFB00'` is the LATIN SMALL LIGATURE FF character (`ff`).\n * If this character has no title case mapping, the result of [uppercase] is returned instead.\n *\n * @sample samples.text.Chars.titlecase\n */\n@SinceKotlin(\"1.5\")\npublic fun Char.titlecase(): String = titlecaseImpl()\n\n/**\n * Concatenates this Char and a String.\n *\n * @sample samples.text.Chars.plus\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun Char.plus(other: String): String = this.toString() + other\n\n/**\n * Returns `true` if this character is equal to the [other] character, optionally ignoring character case.\n *\n * Two characters are considered equal ignoring case if `Char.uppercaseChar().lowercaseChar()` on each character produces the same result.\n *\n * @param ignoreCase `true` to ignore character case when comparing characters. By default `false`.\n * @sample samples.text.Chars.equals\n */\npublic fun Char.equals(other: Char, ignoreCase: Boolean = false): Boolean {\n if (this == other) return true\n if (!ignoreCase) return false\n\n val thisUpper = this.uppercaseChar()\n val otherUpper = other.uppercaseChar()\n\n return thisUpper == otherUpper || thisUpper.lowercaseChar() == otherUpper.lowercaseChar()\n}\n\n/**\n * Returns `true` if this character is a Unicode surrogate code unit.\n */\npublic fun Char.isSurrogate(): Boolean = this in Char.MIN_SURROGATE..Char.MAX_SURROGATE\n\n/**\n * Returns the Unicode general category of this character.\n */\n@SinceKotlin(\"1.5\")\npublic expect val Char.category: CharCategory\n\n/**\n * Returns `true` if this character (Unicode code point) is defined in Unicode.\n *\n * A character is considered to be defined in Unicode if its [category] is not [CharCategory.UNASSIGNED].\n */\n@SinceKotlin(\"1.5\")\npublic expect fun Char.isDefined(): Boolean\n\n/**\n * Returns `true` if this character is a letter.\n *\n * A character is considered to be a letter if its [category] is [CharCategory.UPPERCASE_LETTER],\n * [CharCategory.LOWERCASE_LETTER], [CharCategory.TITLECASE_LETTER], [CharCategory.MODIFIER_LETTER], or [CharCategory.OTHER_LETTER].\n *\n * @sample samples.text.Chars.isLetter\n */\n@SinceKotlin(\"1.5\")\npublic expect fun Char.isLetter(): Boolean\n\n/**\n * Returns `true` if this character is a letter or digit.\n *\n * @see isLetter\n * @see isDigit\n *\n * @sample samples.text.Chars.isLetterOrDigit\n */\n@SinceKotlin(\"1.5\")\npublic expect fun Char.isLetterOrDigit(): Boolean\n\n/**\n * Returns `true` if this character is a digit.\n *\n * A character is considered to be a digit if its [category] is [CharCategory.DECIMAL_DIGIT_NUMBER].\n *\n * @sample samples.text.Chars.isDigit\n */\n@SinceKotlin(\"1.5\")\npublic expect fun Char.isDigit(): Boolean\n\n/**\n * Returns `true` if this character is upper case.\n *\n * A character is considered to be an upper case character if its [category] is [CharCategory.UPPERCASE_LETTER],\n * or it has contributory property `Other_Uppercase` as defined by the Unicode Standard.\n *\n * @sample samples.text.Chars.isUpperCase\n */\n@SinceKotlin(\"1.5\")\npublic expect fun Char.isUpperCase(): Boolean\n\n/**\n * Returns `true` if this character is lower case.\n *\n * A character is considered to be a lower case character if its [category] is [CharCategory.LOWERCASE_LETTER],\n * or it has contributory property `Other_Lowercase` as defined by the Unicode Standard.\n *\n * @sample samples.text.Chars.isLowerCase\n */\n@SinceKotlin(\"1.5\")\npublic expect fun Char.isLowerCase(): Boolean\n\n/**\n * Returns `true` if this character is a title case letter.\n *\n * A character is considered to be a title case letter if its [category] is [CharCategory.TITLECASE_LETTER].\n *\n * @sample samples.text.Chars.isTitleCase\n */\n@SinceKotlin(\"1.5\")\npublic expect fun Char.isTitleCase(): Boolean\n\n/**\n * Returns `true` if this character is an ISO control character.\n *\n * A character is considered to be an ISO control character if its [category] is [CharCategory.CONTROL],\n * meaning the Char is in the range `'\\u0000'..'\\u001F'` or in the range `'\\u007F'..'\\u009F'`.\n *\n * @sample samples.text.Chars.isISOControl\n */\n@SinceKotlin(\"1.5\")\npublic expect fun Char.isISOControl(): Boolean\n\n/**\n * Determines whether a character is whitespace according to the Unicode standard.\n * Returns `true` if the character is whitespace.\n *\n * @sample samples.text.Chars.isWhitespace\n */\npublic expect fun Char.isWhitespace(): Boolean\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"StringsKt\")\n\npackage kotlin.text\n\n/**\n * Trims leading whitespace characters followed by [marginPrefix] from every line of a source string and removes\n * the first and the last lines if they are blank (notice difference blank vs empty).\n *\n * Doesn't affect a line if it doesn't contain [marginPrefix] except the first and the last blank lines.\n *\n * Doesn't preserve the original line endings.\n *\n * @param marginPrefix non-blank string, which is used as a margin delimiter. Default is `|` (pipe character).\n *\n * @sample samples.text.Strings.trimMargin\n * @see trimIndent\n * @see kotlin.text.isWhitespace\n */\n@kotlin.internal.IntrinsicConstEvaluation\npublic fun String.trimMargin(marginPrefix: String = \"|\"): String =\n replaceIndentByMargin(\"\", marginPrefix)\n\n/**\n * Detects indent by [marginPrefix] as it does [trimMargin] and replace it with [newIndent].\n *\n * @param marginPrefix non-blank string, which is used as a margin delimiter. Default is `|` (pipe character).\n */\npublic fun String.replaceIndentByMargin(newIndent: String = \"\", marginPrefix: String = \"|\"): String {\n require(marginPrefix.isNotBlank()) { \"marginPrefix must be non-blank string.\" }\n val lines = lines()\n\n return lines.reindent(length + newIndent.length * lines.size, getIndentFunction(newIndent), { line ->\n val firstNonWhitespaceIndex = line.indexOfFirst { !it.isWhitespace() }\n\n when {\n firstNonWhitespaceIndex == -1 -> null\n line.startsWith(marginPrefix, firstNonWhitespaceIndex) -> line.substring(firstNonWhitespaceIndex + marginPrefix.length)\n else -> null\n }\n })\n}\n\n/**\n * Detects a common minimal indent of all the input lines, removes it from every line and also removes the first and the last\n * lines if they are blank (notice difference blank vs empty).\n *\n * Note that blank lines do not affect the detected indent level.\n *\n * In case if there are non-blank lines with no leading whitespace characters (no indent at all) then the\n * common indent is 0, and therefore this function doesn't change the indentation.\n *\n * Doesn't preserve the original line endings.\n *\n * @sample samples.text.Strings.trimIndent\n * @see trimMargin\n * @see kotlin.text.isBlank\n */\n@kotlin.internal.IntrinsicConstEvaluation\npublic fun String.trimIndent(): String = replaceIndent(\"\")\n\n/**\n * Detects a common minimal indent like it does [trimIndent] and replaces it with the specified [newIndent].\n */\npublic fun String.replaceIndent(newIndent: String = \"\"): String {\n val lines = lines()\n\n val minCommonIndent = lines\n .filter(String::isNotBlank)\n .map(String::indentWidth)\n .minOrNull() ?: 0\n\n return lines.reindent(length + newIndent.length * lines.size, getIndentFunction(newIndent), { line -> line.drop(minCommonIndent) })\n}\n\n/**\n * Prepends [indent] to every line of the original string.\n *\n * Doesn't preserve the original line endings.\n */\npublic fun String.prependIndent(indent: String = \" \"): String =\n lineSequence()\n .map {\n when {\n it.isBlank() -> {\n when {\n it.length < indent.length -> indent\n else -> it\n }\n }\n else -> indent + it\n }\n }\n .joinToString(\"\\n\")\n\nprivate fun String.indentWidth(): Int = indexOfFirst { !it.isWhitespace() }.let { if (it == -1) length else it }\n\nprivate fun getIndentFunction(indent: String) = when {\n indent.isEmpty() -> { line: String -> line }\n else -> { line: String -> indent + line }\n}\n\nprivate inline fun List.reindent(\n resultSizeEstimate: Int,\n indentAddFunction: (String) -> String,\n indentCutFunction: (String) -> String?\n): String {\n val lastIndex = lastIndex\n return mapIndexedNotNull { index, value ->\n if ((index == 0 || index == lastIndex) && value.isBlank())\n null\n else\n indentCutFunction(value)?.let(indentAddFunction) ?: value\n }\n .joinTo(StringBuilder(resultSizeEstimate), \"\\n\")\n .toString()\n}\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.text\n\n/**\n * Represents a collection of captured groups in a single match of a regular expression.\n *\n * This collection has size of `groupCount + 1` where `groupCount` is the count of groups in the regular expression.\n * Groups are indexed from 1 to `groupCount` and group with the index 0 corresponds to the entire match.\n *\n * An element of the collection at the particular index can be `null`,\n * if the corresponding group in the regular expression is optional and\n * there was no match captured by that group.\n */\npublic interface MatchGroupCollection : Collection {\n\n /** Returns a group with the specified [index].\n *\n * @return An instance of [MatchGroup] if the group with the specified [index] was matched or `null` otherwise.\n *\n * Groups are indexed from 1 to the count of groups in the regular expression. A group with the index 0\n * corresponds to the entire match.\n */\n public operator fun get(index: Int): MatchGroup?\n}\n\n/**\n * Extends [MatchGroupCollection] by introducing a way to get matched groups by name, when regex supports it.\n */\n@SinceKotlin(\"1.1\")\npublic interface MatchNamedGroupCollection : MatchGroupCollection {\n /**\n * Returns a named group with the specified [name].\n * @return An instance of [MatchGroup] if the group with the specified [name] was matched or `null` otherwise.\n * @throws IllegalArgumentException if there is no group with the specified [name] defined in the regex pattern.\n * @throws UnsupportedOperationException if this match group collection doesn't support getting match groups by name,\n * for example, when it's not supported by the current platform.\n */\n public operator fun get(name: String): MatchGroup?\n}\n\n/**\n * Represents the results from a single regular expression match.\n */\npublic interface MatchResult {\n /** The range of indices in the original string where match was captured. */\n public val range: IntRange\n /** The substring from the input string captured by this match. */\n public val value: String\n /**\n * A collection of groups matched by the regular expression.\n *\n * This collection has size of `groupCount + 1` where `groupCount` is the count of groups in the regular expression.\n * Groups are indexed from 1 to `groupCount` and group with the index 0 corresponds to the entire match.\n */\n public val groups: MatchGroupCollection\n /**\n * A list of matched indexed group values.\n *\n * This list has size of `groupCount + 1` where `groupCount` is the count of groups in the regular expression.\n * Groups are indexed from 1 to `groupCount` and group with the index 0 corresponds to the entire match.\n *\n * If the group in the regular expression is optional and there were no match captured by that group,\n * corresponding item in [groupValues] is an empty string.\n *\n * @sample samples.text.Regexps.matchDestructuringToGroupValues\n */\n public val groupValues: List\n\n /**\n * An instance of [MatchResult.Destructured] wrapper providing components for destructuring assignment of group values.\n *\n * component1 corresponds to the value of the first group, component2 — of the second, and so on.\n *\n * @sample samples.text.Regexps.matchDestructuringToGroupValues\n */\n public val destructured: Destructured get() = Destructured(this)\n\n /** Returns a new [MatchResult] with the results for the next match, starting at the position\n * at which the last match ended (at the character after the last matched character).\n */\n public fun next(): MatchResult?\n\n /**\n * Provides components for destructuring assignment of group values.\n *\n * [component1] corresponds to the value of the first group, [component2] — of the second, and so on.\n *\n * If the group in the regular expression is optional and there were no match captured by that group,\n * corresponding component value is an empty string.\n *\n * @sample samples.text.Regexps.matchDestructuringToGroupValues\n */\n public class Destructured internal constructor(public val match: MatchResult) {\n @kotlin.internal.InlineOnly\n public operator inline fun component1(): String = match.groupValues[1]\n @kotlin.internal.InlineOnly\n public operator inline fun component2(): String = match.groupValues[2]\n @kotlin.internal.InlineOnly\n public operator inline fun component3(): String = match.groupValues[3]\n @kotlin.internal.InlineOnly\n public operator inline fun component4(): String = match.groupValues[4]\n @kotlin.internal.InlineOnly\n public operator inline fun component5(): String = match.groupValues[5]\n @kotlin.internal.InlineOnly\n public operator inline fun component6(): String = match.groupValues[6]\n @kotlin.internal.InlineOnly\n public operator inline fun component7(): String = match.groupValues[7]\n @kotlin.internal.InlineOnly\n public operator inline fun component8(): String = match.groupValues[8]\n @kotlin.internal.InlineOnly\n public operator inline fun component9(): String = match.groupValues[9]\n @kotlin.internal.InlineOnly\n public operator inline fun component10(): String = match.groupValues[10]\n\n /**\n * Returns destructured group values as a list of strings.\n * First value in the returned list corresponds to the value of the first group, and so on.\n *\n * @sample samples.text.Regexps.matchDestructuringToGroupValues\n */\n public fun toList(): List = match.groupValues.subList(1, match.groupValues.size)\n }\n}","/*\n * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.ranges\n\n/**\n * Represents a range of values (for example, numbers or characters) where both the lower and upper bounds are included in the range.\n * See the [Kotlin language documentation](https://kotlinlang.org/docs/reference/ranges.html) for more information.\n */\npublic interface ClosedRange> {\n /**\n * The minimum value in the range.\n */\n public val start: T\n\n /**\n * The maximum value in the range (inclusive).\n */\n public val endInclusive: T\n\n /**\n * Checks whether the specified [value] belongs to the range.\n *\n * A value belongs to the closed range if it is greater than or equal to the [start] bound and less than or equal to the [endInclusive] bound.\n */\n public operator fun contains(value: T): Boolean = value >= start && value <= endInclusive\n\n /**\n * Checks whether the range is empty.\n *\n * The range is empty if its start value is greater than the end value.\n */\n public fun isEmpty(): Boolean = start > endInclusive\n}\n\n/**\n * Represents a range of values (for example, numbers or characters) where the upper bound is not included in the range.\n * See the [Kotlin language documentation](https://kotlinlang.org/docs/reference/ranges.html) for more information.\n */\n@SinceKotlin(\"1.7\")\n@ExperimentalStdlibApi\npublic interface OpenEndRange> {\n /**\n * The minimum value in the range.\n */\n public val start: T\n\n /**\n * The maximum value in the range (exclusive).\n *\n * @throws IllegalStateException can be thrown if the exclusive end bound cannot be represented\n * with a value of type [T].\n */\n public val endExclusive: T\n\n /**\n * Checks whether the specified [value] belongs to the range.\n *\n * A value belongs to the open-ended range if it is greater than or equal to the [start] bound and strictly less than the [endExclusive] bound.\n */\n public operator fun contains(value: T): Boolean = value >= start && value < endExclusive\n\n /**\n * Checks whether the range is empty.\n *\n * The open-ended range is empty if its start value is greater than or equal to the end value.\n */\n public fun isEmpty(): Boolean = start >= endExclusive\n}","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass()\n@file:kotlin.jvm.JvmName(\"DurationUnitKt\")\n\npackage kotlin.time\n\n\n/**\n * The list of possible time measurement units, in which a duration can be expressed.\n *\n * The smallest time unit is [NANOSECONDS] and the largest is [DAYS], which corresponds to exactly 24 [HOURS].\n */\n@SinceKotlin(\"1.6\")\n@WasExperimental(ExperimentalTime::class)\npublic expect enum class DurationUnit {\n /**\n * Time unit representing one nanosecond, which is 1/1000 of a microsecond.\n */\n NANOSECONDS,\n /**\n * Time unit representing one microsecond, which is 1/1000 of a millisecond.\n */\n MICROSECONDS,\n /**\n * Time unit representing one millisecond, which is 1/1000 of a second.\n */\n MILLISECONDS,\n /**\n * Time unit representing one second.\n */\n SECONDS,\n /**\n * Time unit representing one minute.\n */\n MINUTES,\n /**\n * Time unit representing one hour.\n */\n HOURS,\n /**\n * Time unit representing one day, which is always equal to 24 hours.\n */\n DAYS;\n}\n\n/** Converts the given time duration [value] expressed in the specified [sourceUnit] into the specified [targetUnit]. */\n@SinceKotlin(\"1.3\")\ninternal expect fun convertDurationUnit(value: Double, sourceUnit: DurationUnit, targetUnit: DurationUnit): Double\n\n// overflown result is unspecified\n@SinceKotlin(\"1.5\")\ninternal expect fun convertDurationUnitOverflow(value: Long, sourceUnit: DurationUnit, targetUnit: DurationUnit): Long\n\n// overflown result is coerced in the Long range boundaries\n@SinceKotlin(\"1.5\")\ninternal expect fun convertDurationUnit(value: Long, sourceUnit: DurationUnit, targetUnit: DurationUnit): Long\n\n\n@SinceKotlin(\"1.3\")\n@Suppress(\"REDUNDANT_ELSE_IN_WHEN\")\ninternal fun DurationUnit.shortName(): String = when (this) {\n DurationUnit.NANOSECONDS -> \"ns\"\n DurationUnit.MICROSECONDS -> \"us\"\n DurationUnit.MILLISECONDS -> \"ms\"\n DurationUnit.SECONDS -> \"s\"\n DurationUnit.MINUTES -> \"m\"\n DurationUnit.HOURS -> \"h\"\n DurationUnit.DAYS -> \"d\"\n else -> error(\"Unknown unit: $this\")\n}\n\n@SinceKotlin(\"1.5\")\ninternal fun durationUnitByShortName(shortName: String): DurationUnit = when (shortName) {\n \"ns\" -> DurationUnit.NANOSECONDS\n \"us\" -> DurationUnit.MICROSECONDS\n \"ms\" -> DurationUnit.MILLISECONDS\n \"s\" -> DurationUnit.SECONDS\n \"m\" -> DurationUnit.MINUTES\n \"h\" -> DurationUnit.HOURS\n \"d\" -> DurationUnit.DAYS\n else -> throw IllegalArgumentException(\"Unknown duration unit short name: $shortName\")\n}\n\n@SinceKotlin(\"1.5\")\ninternal fun durationUnitByIsoChar(isoChar: Char, isTimeComponent: Boolean): DurationUnit =\n when {\n !isTimeComponent -> {\n when (isoChar) {\n 'D' -> DurationUnit.DAYS\n else -> throw IllegalArgumentException(\"Invalid or unsupported duration ISO non-time unit: $isoChar\")\n }\n }\n else -> {\n when (isoChar) {\n 'H' -> DurationUnit.HOURS\n 'M' -> DurationUnit.MINUTES\n 'S' -> DurationUnit.SECONDS\n else -> throw IllegalArgumentException(\"Invalid duration ISO time unit: $isoChar\")\n }\n }\n }","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmName(\"LazyKt\")\n@file:kotlin.jvm.JvmMultifileClass\n\npackage kotlin\n\nimport kotlin.reflect.KProperty\n\n/**\n * Represents a value with lazy initialization.\n *\n * To create an instance of [Lazy] use the [lazy] function.\n */\npublic interface Lazy {\n /**\n * Gets the lazily initialized value of the current Lazy instance.\n * Once the value was initialized it must not change during the rest of lifetime of this Lazy instance.\n */\n public val value: T\n\n /**\n * Returns `true` if a value for this Lazy instance has been already initialized, and `false` otherwise.\n * Once this function has returned `true` it stays `true` for the rest of lifetime of this Lazy instance.\n */\n public fun isInitialized(): Boolean\n}\n\n/**\n * Creates a new instance of the [Lazy] that is already initialized with the specified [value].\n */\npublic fun lazyOf(value: T): Lazy = InitializedLazyImpl(value)\n\n/**\n * An extension to delegate a read-only property of type [T] to an instance of [Lazy].\n *\n * This extension allows to use instances of Lazy for property delegation:\n * `val property: String by lazy { initializer }`\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun Lazy.getValue(thisRef: Any?, property: KProperty<*>): T = value\n\n/**\n * Specifies how a [Lazy] instance synchronizes initialization among multiple threads.\n */\npublic enum class LazyThreadSafetyMode {\n\n /**\n * Locks are used to ensure that only a single thread can initialize the [Lazy] instance.\n */\n SYNCHRONIZED,\n\n /**\n * Initializer function can be called several times on concurrent access to uninitialized [Lazy] instance value,\n * but only the first returned value will be used as the value of [Lazy] instance.\n */\n PUBLICATION,\n\n /**\n * No locks are used to synchronize an access to the [Lazy] instance value; if the instance is accessed from multiple threads, its behavior is undefined.\n *\n * This mode should not be used unless the [Lazy] instance is guaranteed never to be initialized from more than one thread.\n */\n NONE,\n}\n\n\ninternal object UNINITIALIZED_VALUE\n\n// internal to be called from lazy in JS\ninternal class UnsafeLazyImpl(initializer: () -> T) : Lazy, Serializable {\n private var initializer: (() -> T)? = initializer\n private var _value: Any? = UNINITIALIZED_VALUE\n\n override val value: T\n get() {\n if (_value === UNINITIALIZED_VALUE) {\n _value = initializer!!()\n initializer = null\n }\n @Suppress(\"UNCHECKED_CAST\")\n return _value as T\n }\n\n override fun isInitialized(): Boolean = _value !== UNINITIALIZED_VALUE\n\n override fun toString(): String = if (isInitialized()) value.toString() else \"Lazy value not initialized yet.\"\n\n private fun writeReplace(): Any = InitializedLazyImpl(value)\n}\n\ninternal class InitializedLazyImpl(override val value: T) : Lazy, Serializable {\n\n override fun isInitialized(): Boolean = true\n\n override fun toString(): String = value.toString()\n\n}\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmName(\"TuplesKt\")\n\npackage kotlin\n\n\n/**\n * Represents a generic pair of two values.\n *\n * There is no meaning attached to values in this class, it can be used for any purpose.\n * Pair exhibits value semantics, i.e. two pairs are equal if both components are equal.\n *\n * An example of decomposing it into values:\n * @sample samples.misc.Tuples.pairDestructuring\n *\n * @param A type of the first value.\n * @param B type of the second value.\n * @property first First value.\n * @property second Second value.\n * @constructor Creates a new instance of Pair.\n */\npublic data class Pair(\n public val first: A,\n public val second: B\n) : Serializable {\n\n /**\n * Returns string representation of the [Pair] including its [first] and [second] values.\n */\n public override fun toString(): String = \"($first, $second)\"\n}\n\n/**\n * Creates a tuple of type [Pair] from this and [that].\n *\n * This can be useful for creating [Map] literals with less noise, for example:\n * @sample samples.collections.Maps.Instantiation.mapFromPairs\n */\npublic infix fun A.to(that: B): Pair = Pair(this, that)\n\n/**\n * Converts this pair into a list.\n * @sample samples.misc.Tuples.pairToList\n */\npublic fun Pair.toList(): List = listOf(first, second)\n\n/**\n * Represents a triad of values\n *\n * There is no meaning attached to values in this class, it can be used for any purpose.\n * Triple exhibits value semantics, i.e. two triples are equal if all three components are equal.\n * An example of decomposing it into values:\n * @sample samples.misc.Tuples.tripleDestructuring\n *\n * @param A type of the first value.\n * @param B type of the second value.\n * @param C type of the third value.\n * @property first First value.\n * @property second Second value.\n * @property third Third value.\n */\npublic data class Triple(\n public val first: A,\n public val second: B,\n public val third: C\n) : Serializable {\n\n /**\n * Returns string representation of the [Triple] including its [first], [second] and [third] values.\n */\n public override fun toString(): String = \"($first, $second, $third)\"\n}\n\n/**\n * Converts this triple into a list.\n * @sample samples.misc.Tuples.tripleToList\n */\npublic fun Triple.toList(): List = listOf(first, second, third)\n","/*\n * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n// Auto-generated file. DO NOT EDIT!\n\npackage kotlin\n\nimport kotlin.jvm.*\n\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@JvmInline\npublic value class UByteArray\n@PublishedApi\ninternal constructor(@PublishedApi internal val storage: ByteArray) : Collection {\n\n /** Creates a new array of the specified [size], with all elements initialized to zero. */\n public constructor(size: Int) : this(ByteArray(size))\n\n /**\n * Returns the array element at the given [index]. This method can be called using the index operator.\n *\n * If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n public operator fun get(index: Int): UByte = storage[index].toUByte()\n\n /**\n * Sets the element at the given [index] to the given [value]. This method can be called using the index operator.\n *\n * If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n public operator fun set(index: Int, value: UByte) {\n storage[index] = value.toByte()\n }\n\n /** Returns the number of elements in the array. */\n public override val size: Int get() = storage.size\n\n /** Creates an iterator over the elements of the array. */\n public override operator fun iterator(): kotlin.collections.Iterator = Iterator(storage)\n\n private class Iterator(private val array: ByteArray) : kotlin.collections.Iterator {\n private var index = 0\n override fun hasNext() = index < array.size\n override fun next() = if (index < array.size) array[index++].toUByte() else throw NoSuchElementException(index.toString())\n }\n\n override fun contains(element: UByte): Boolean {\n // TODO: Eliminate this check after KT-30016 gets fixed.\n // Currently JS BE does not generate special bridge method for this method.\n @Suppress(\"USELESS_CAST\")\n if ((element as Any?) !is UByte) return false\n\n return storage.contains(element.toByte())\n }\n\n override fun containsAll(elements: Collection): Boolean {\n return (elements as Collection<*>).all { it is UByte && storage.contains(it.toByte()) }\n }\n\n override fun isEmpty(): Boolean = this.storage.size == 0\n}\n\n/**\n * Creates a new array of the specified [size], where each element is calculated by calling the specified\n * [init] function.\n *\n * The function [init] is called for each array element sequentially starting from the first one.\n * It should return the value for an array element given its index.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray(size: Int, init: (Int) -> UByte): UByteArray {\n return UByteArray(ByteArray(size) { index -> init(index).toByte() })\n}\n\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ubyteArrayOf(vararg elements: UByte): UByteArray = elements\n","/*\n * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n// Auto-generated file. DO NOT EDIT!\n\npackage kotlin\n\nimport kotlin.experimental.*\nimport kotlin.jvm.*\n\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@JvmInline\npublic value class ULong @kotlin.internal.IntrinsicConstEvaluation @PublishedApi internal constructor(@PublishedApi internal val data: Long) : Comparable {\n\n companion object {\n /**\n * A constant holding the minimum value an instance of ULong can have.\n */\n public const val MIN_VALUE: ULong = ULong(0)\n\n /**\n * A constant holding the maximum value an instance of ULong can have.\n */\n public const val MAX_VALUE: ULong = ULong(-1)\n\n /**\n * The number of bytes used to represent an instance of ULong in a binary form.\n */\n public const val SIZE_BYTES: Int = 8\n\n /**\n * The number of bits used to represent an instance of ULong in a binary form.\n */\n public const val SIZE_BITS: Int = 64\n }\n\n /**\n * Compares this value with the specified value for order.\n * Returns zero if this value is equal to the specified other value, a negative number if it's less than other,\n * or a positive number if it's greater than other.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun compareTo(other: UByte): Int = this.compareTo(other.toULong())\n\n /**\n * Compares this value with the specified value for order.\n * Returns zero if this value is equal to the specified other value, a negative number if it's less than other,\n * or a positive number if it's greater than other.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun compareTo(other: UShort): Int = this.compareTo(other.toULong())\n\n /**\n * Compares this value with the specified value for order.\n * Returns zero if this value is equal to the specified other value, a negative number if it's less than other,\n * or a positive number if it's greater than other.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun compareTo(other: UInt): Int = this.compareTo(other.toULong())\n\n /**\n * Compares this value with the specified value for order.\n * Returns zero if this value is equal to the specified other value, a negative number if it's less than other,\n * or a positive number if it's greater than other.\n */\n @kotlin.internal.InlineOnly\n @Suppress(\"OVERRIDE_BY_INLINE\")\n public override inline operator fun compareTo(other: ULong): Int = ulongCompare(this.data, other.data)\n\n /** Adds the other value to this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun plus(other: UByte): ULong = this.plus(other.toULong())\n /** Adds the other value to this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun plus(other: UShort): ULong = this.plus(other.toULong())\n /** Adds the other value to this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun plus(other: UInt): ULong = this.plus(other.toULong())\n /** Adds the other value to this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun plus(other: ULong): ULong = ULong(this.data.plus(other.data))\n\n /** Subtracts the other value from this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun minus(other: UByte): ULong = this.minus(other.toULong())\n /** Subtracts the other value from this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun minus(other: UShort): ULong = this.minus(other.toULong())\n /** Subtracts the other value from this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun minus(other: UInt): ULong = this.minus(other.toULong())\n /** Subtracts the other value from this value. */\n @kotlin.internal.InlineOnly\n public inline operator fun minus(other: ULong): ULong = ULong(this.data.minus(other.data))\n\n /** Multiplies this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun times(other: UByte): ULong = this.times(other.toULong())\n /** Multiplies this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun times(other: UShort): ULong = this.times(other.toULong())\n /** Multiplies this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun times(other: UInt): ULong = this.times(other.toULong())\n /** Multiplies this value by the other value. */\n @kotlin.internal.InlineOnly\n public inline operator fun times(other: ULong): ULong = ULong(this.data.times(other.data))\n\n /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */\n @kotlin.internal.InlineOnly\n public inline operator fun div(other: UByte): ULong = this.div(other.toULong())\n /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */\n @kotlin.internal.InlineOnly\n public inline operator fun div(other: UShort): ULong = this.div(other.toULong())\n /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */\n @kotlin.internal.InlineOnly\n public inline operator fun div(other: UInt): ULong = this.div(other.toULong())\n /** Divides this value by the other value, truncating the result to an integer that is closer to zero. */\n @kotlin.internal.InlineOnly\n public inline operator fun div(other: ULong): ULong = ulongDivide(this, other)\n\n /**\n * Calculates the remainder of truncating division of this value by the other value.\n * \n * The result is always less than the divisor.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun rem(other: UByte): ULong = this.rem(other.toULong())\n /**\n * Calculates the remainder of truncating division of this value by the other value.\n * \n * The result is always less than the divisor.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun rem(other: UShort): ULong = this.rem(other.toULong())\n /**\n * Calculates the remainder of truncating division of this value by the other value.\n * \n * The result is always less than the divisor.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun rem(other: UInt): ULong = this.rem(other.toULong())\n /**\n * Calculates the remainder of truncating division of this value by the other value.\n * \n * The result is always less than the divisor.\n */\n @kotlin.internal.InlineOnly\n public inline operator fun rem(other: ULong): ULong = ulongRemainder(this, other)\n\n /**\n * Divides this value by the other value, flooring the result to an integer that is closer to negative infinity.\n * \n * For unsigned types, the results of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun floorDiv(other: UByte): ULong = this.floorDiv(other.toULong())\n /**\n * Divides this value by the other value, flooring the result to an integer that is closer to negative infinity.\n * \n * For unsigned types, the results of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun floorDiv(other: UShort): ULong = this.floorDiv(other.toULong())\n /**\n * Divides this value by the other value, flooring the result to an integer that is closer to negative infinity.\n * \n * For unsigned types, the results of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun floorDiv(other: UInt): ULong = this.floorDiv(other.toULong())\n /**\n * Divides this value by the other value, flooring the result to an integer that is closer to negative infinity.\n * \n * For unsigned types, the results of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun floorDiv(other: ULong): ULong = div(other)\n\n /**\n * Calculates the remainder of flooring division of this value by the other value.\n * \n * The result is always less than the divisor.\n * \n * For unsigned types, the remainders of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun mod(other: UByte): UByte = this.mod(other.toULong()).toUByte()\n /**\n * Calculates the remainder of flooring division of this value by the other value.\n * \n * The result is always less than the divisor.\n * \n * For unsigned types, the remainders of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun mod(other: UShort): UShort = this.mod(other.toULong()).toUShort()\n /**\n * Calculates the remainder of flooring division of this value by the other value.\n * \n * The result is always less than the divisor.\n * \n * For unsigned types, the remainders of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun mod(other: UInt): UInt = this.mod(other.toULong()).toUInt()\n /**\n * Calculates the remainder of flooring division of this value by the other value.\n * \n * The result is always less than the divisor.\n * \n * For unsigned types, the remainders of flooring division and truncating division are the same.\n */\n @kotlin.internal.InlineOnly\n public inline fun mod(other: ULong): ULong = rem(other)\n\n /**\n * Returns this value incremented by one.\n *\n * @sample samples.misc.Builtins.inc\n */\n @kotlin.internal.InlineOnly\n public inline operator fun inc(): ULong = ULong(data.inc())\n\n /**\n * Returns this value decremented by one.\n *\n * @sample samples.misc.Builtins.dec\n */\n @kotlin.internal.InlineOnly\n public inline operator fun dec(): ULong = ULong(data.dec())\n\n /** Creates a range from this value to the specified [other] value. */\n @kotlin.internal.InlineOnly\n public inline operator fun rangeTo(other: ULong): ULongRange = ULongRange(this, other)\n\n /**\n * Shifts this value left by the [bitCount] number of bits.\n *\n * Note that only the six lowest-order bits of the [bitCount] are used as the shift distance.\n * The shift distance actually used is therefore always in the range `0..63`.\n */\n @kotlin.internal.InlineOnly\n public inline infix fun shl(bitCount: Int): ULong = ULong(data shl bitCount)\n\n /**\n * Shifts this value right by the [bitCount] number of bits, filling the leftmost bits with zeros.\n *\n * Note that only the six lowest-order bits of the [bitCount] are used as the shift distance.\n * The shift distance actually used is therefore always in the range `0..63`.\n */\n @kotlin.internal.InlineOnly\n public inline infix fun shr(bitCount: Int): ULong = ULong(data ushr bitCount)\n\n /** Performs a bitwise AND operation between the two values. */\n @kotlin.internal.InlineOnly\n public inline infix fun and(other: ULong): ULong = ULong(this.data and other.data)\n /** Performs a bitwise OR operation between the two values. */\n @kotlin.internal.InlineOnly\n public inline infix fun or(other: ULong): ULong = ULong(this.data or other.data)\n /** Performs a bitwise XOR operation between the two values. */\n @kotlin.internal.InlineOnly\n public inline infix fun xor(other: ULong): ULong = ULong(this.data xor other.data)\n /** Inverts the bits in this value. */\n @kotlin.internal.InlineOnly\n public inline fun inv(): ULong = ULong(data.inv())\n\n /**\n * Converts this [ULong] value to [Byte].\n *\n * If this value is less than or equals to [Byte.MAX_VALUE], the resulting `Byte` value represents\n * the same numerical value as this `ULong`.\n *\n * The resulting `Byte` value is represented by the least significant 8 bits of this `ULong` value.\n * Note that the resulting `Byte` value may be negative.\n */\n @kotlin.internal.InlineOnly\n public inline fun toByte(): Byte = data.toByte()\n /**\n * Converts this [ULong] value to [Short].\n *\n * If this value is less than or equals to [Short.MAX_VALUE], the resulting `Short` value represents\n * the same numerical value as this `ULong`.\n *\n * The resulting `Short` value is represented by the least significant 16 bits of this `ULong` value.\n * Note that the resulting `Short` value may be negative.\n */\n @kotlin.internal.InlineOnly\n public inline fun toShort(): Short = data.toShort()\n /**\n * Converts this [ULong] value to [Int].\n *\n * If this value is less than or equals to [Int.MAX_VALUE], the resulting `Int` value represents\n * the same numerical value as this `ULong`.\n *\n * The resulting `Int` value is represented by the least significant 32 bits of this `ULong` value.\n * Note that the resulting `Int` value may be negative.\n */\n @kotlin.internal.InlineOnly\n public inline fun toInt(): Int = data.toInt()\n /**\n * Converts this [ULong] value to [Long].\n *\n * If this value is less than or equals to [Long.MAX_VALUE], the resulting `Long` value represents\n * the same numerical value as this `ULong`. Otherwise the result is negative.\n *\n * The resulting `Long` value has the same binary representation as this `ULong` value.\n */\n @kotlin.internal.InlineOnly\n public inline fun toLong(): Long = data\n\n /**\n * Converts this [ULong] value to [UByte].\n *\n * If this value is less than or equals to [UByte.MAX_VALUE], the resulting `UByte` value represents\n * the same numerical value as this `ULong`.\n *\n * The resulting `UByte` value is represented by the least significant 8 bits of this `ULong` value.\n */\n @kotlin.internal.InlineOnly\n public inline fun toUByte(): UByte = data.toUByte()\n /**\n * Converts this [ULong] value to [UShort].\n *\n * If this value is less than or equals to [UShort.MAX_VALUE], the resulting `UShort` value represents\n * the same numerical value as this `ULong`.\n *\n * The resulting `UShort` value is represented by the least significant 16 bits of this `ULong` value.\n */\n @kotlin.internal.InlineOnly\n public inline fun toUShort(): UShort = data.toUShort()\n /**\n * Converts this [ULong] value to [UInt].\n *\n * If this value is less than or equals to [UInt.MAX_VALUE], the resulting `UInt` value represents\n * the same numerical value as this `ULong`.\n *\n * The resulting `UInt` value is represented by the least significant 32 bits of this `ULong` value.\n */\n @kotlin.internal.InlineOnly\n public inline fun toUInt(): UInt = data.toUInt()\n /** Returns this value. */\n @kotlin.internal.InlineOnly\n public inline fun toULong(): ULong = this\n\n /**\n * Converts this [ULong] value to [Float].\n *\n * The resulting value is the closest `Float` to this `ULong` value.\n * In case when this `ULong` value is exactly between two `Float`s,\n * the one with zero at least significant bit of mantissa is selected.\n */\n @kotlin.internal.InlineOnly\n public inline fun toFloat(): Float = this.toDouble().toFloat()\n /**\n * Converts this [ULong] value to [Double].\n *\n * The resulting value is the closest `Double` to this `ULong` value.\n * In case when this `ULong` value is exactly between two `Double`s,\n * the one with zero at least significant bit of mantissa is selected.\n */\n @kotlin.internal.InlineOnly\n public inline fun toDouble(): Double = ulongToDouble(data)\n\n public override fun toString(): String = ulongToString(data)\n\n}\n\n/**\n * Converts this [Byte] value to [ULong].\n *\n * If this value is positive, the resulting `ULong` value represents the same numerical value as this `Byte`.\n *\n * The least significant 8 bits of the resulting `ULong` value are the same as the bits of this `Byte` value,\n * whereas the most significant 56 bits are filled with the sign bit of this value.\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Byte.toULong(): ULong = ULong(this.toLong())\n/**\n * Converts this [Short] value to [ULong].\n *\n * If this value is positive, the resulting `ULong` value represents the same numerical value as this `Short`.\n *\n * The least significant 16 bits of the resulting `ULong` value are the same as the bits of this `Short` value,\n * whereas the most significant 48 bits are filled with the sign bit of this value.\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Short.toULong(): ULong = ULong(this.toLong())\n/**\n * Converts this [Int] value to [ULong].\n *\n * If this value is positive, the resulting `ULong` value represents the same numerical value as this `Int`.\n *\n * The least significant 32 bits of the resulting `ULong` value are the same as the bits of this `Int` value,\n * whereas the most significant 32 bits are filled with the sign bit of this value.\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Int.toULong(): ULong = ULong(this.toLong())\n/**\n * Converts this [Long] value to [ULong].\n *\n * If this value is positive, the resulting `ULong` value represents the same numerical value as this `Long`.\n *\n * The resulting `ULong` value has the same binary representation as this `Long` value.\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Long.toULong(): ULong = ULong(this)\n\n/**\n * Converts this [Float] value to [ULong].\n *\n * The fractional part, if any, is rounded down towards zero.\n * Returns zero if this `Float` value is negative or `NaN`, [ULong.MAX_VALUE] if it's bigger than `ULong.MAX_VALUE`.\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Float.toULong(): ULong = doubleToULong(this.toDouble())\n/**\n * Converts this [Double] value to [ULong].\n *\n * The fractional part, if any, is rounded down towards zero.\n * Returns zero if this `Double` value is negative or `NaN`, [ULong.MAX_VALUE] if it's bigger than `ULong.MAX_VALUE`.\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Double.toULong(): ULong = doubleToULong(this)\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.experimental\n\n/** Performs a bitwise AND operation between the two values. */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline infix fun Byte.and(other: Byte): Byte = (this.toInt() and other.toInt()).toByte()\n\n/** Performs a bitwise OR operation between the two values. */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline infix fun Byte.or(other: Byte): Byte = (this.toInt() or other.toInt()).toByte()\n\n/** Performs a bitwise XOR operation between the two values. */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline infix fun Byte.xor(other: Byte): Byte = (this.toInt() xor other.toInt()).toByte()\n\n/** Inverts the bits in this value. */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline fun Byte.inv(): Byte = (this.toInt().inv()).toByte()\n\n\n/** Performs a bitwise AND operation between the two values. */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline infix fun Short.and(other: Short): Short = (this.toInt() and other.toInt()).toShort()\n\n/** Performs a bitwise OR operation between the two values. */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline infix fun Short.or(other: Short): Short = (this.toInt() or other.toInt()).toShort()\n\n/** Performs a bitwise XOR operation between the two values. */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline infix fun Short.xor(other: Short): Short = (this.toInt() xor other.toInt()).toShort()\n\n/** Inverts the bits in this value. */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline fun Short.inv(): Short = (this.toInt().inv()).toShort()\n\n\n","/*\n * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n// Auto-generated file. DO NOT EDIT!\n\npackage kotlin\n\nimport kotlin.jvm.*\n\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@JvmInline\npublic value class UIntArray\n@PublishedApi\ninternal constructor(@PublishedApi internal val storage: IntArray) : Collection {\n\n /** Creates a new array of the specified [size], with all elements initialized to zero. */\n public constructor(size: Int) : this(IntArray(size))\n\n /**\n * Returns the array element at the given [index]. This method can be called using the index operator.\n *\n * If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n public operator fun get(index: Int): UInt = storage[index].toUInt()\n\n /**\n * Sets the element at the given [index] to the given [value]. This method can be called using the index operator.\n *\n * If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n public operator fun set(index: Int, value: UInt) {\n storage[index] = value.toInt()\n }\n\n /** Returns the number of elements in the array. */\n public override val size: Int get() = storage.size\n\n /** Creates an iterator over the elements of the array. */\n public override operator fun iterator(): kotlin.collections.Iterator = Iterator(storage)\n\n private class Iterator(private val array: IntArray) : kotlin.collections.Iterator {\n private var index = 0\n override fun hasNext() = index < array.size\n override fun next() = if (index < array.size) array[index++].toUInt() else throw NoSuchElementException(index.toString())\n }\n\n override fun contains(element: UInt): Boolean {\n // TODO: Eliminate this check after KT-30016 gets fixed.\n // Currently JS BE does not generate special bridge method for this method.\n @Suppress(\"USELESS_CAST\")\n if ((element as Any?) !is UInt) return false\n\n return storage.contains(element.toInt())\n }\n\n override fun containsAll(elements: Collection): Boolean {\n return (elements as Collection<*>).all { it is UInt && storage.contains(it.toInt()) }\n }\n\n override fun isEmpty(): Boolean = this.storage.size == 0\n}\n\n/**\n * Creates a new array of the specified [size], where each element is calculated by calling the specified\n * [init] function.\n *\n * The function [init] is called for each array element sequentially starting from the first one.\n * It should return the value for an array element given its index.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray(size: Int, init: (Int) -> UInt): UIntArray {\n return UIntArray(IntArray(size) { index -> init(index).toInt() })\n}\n\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun uintArrayOf(vararg elements: UInt): UIntArray = elements\n","/*\n * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n// Auto-generated file. DO NOT EDIT!\n\npackage kotlin.ranges\n\n\n\nimport kotlin.internal.*\n\n/**\n * A range of values of type `UInt`.\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@OptIn(ExperimentalStdlibApi::class)\npublic class UIntRange(start: UInt, endInclusive: UInt) : UIntProgression(start, endInclusive, 1), ClosedRange, OpenEndRange {\n override val start: UInt get() = first\n override val endInclusive: UInt get() = last\n \n @SinceKotlin(\"1.7\")\n @ExperimentalStdlibApi\n @Deprecated(\"Can throw an exception when it's impossible to represent the value with UInt type, for example, when the range includes MAX_VALUE. It's recommended to use 'endInclusive' property that doesn't throw.\")\n override val endExclusive: UInt get() {\n if (last == UInt.MAX_VALUE) error(\"Cannot return the exclusive upper bound of a range that includes MAX_VALUE.\")\n return last + 1u\n }\n\n override fun contains(value: UInt): Boolean = first <= value && value <= last\n\n /** \n * Checks if the range is empty.\n \n * The range is empty if its start value is greater than the end value.\n */\n override fun isEmpty(): Boolean = first > last\n\n override fun equals(other: Any?): Boolean =\n other is UIntRange && (isEmpty() && other.isEmpty() ||\n first == other.first && last == other.last)\n\n override fun hashCode(): Int =\n if (isEmpty()) -1 else (31 * first.toInt() + last.toInt())\n\n override fun toString(): String = \"$first..$last\"\n\n companion object {\n /** An empty range of values of type UInt. */\n public val EMPTY: UIntRange = UIntRange(UInt.MAX_VALUE, UInt.MIN_VALUE)\n }\n}\n\n/**\n * A progression of values of type `UInt`.\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\npublic open class UIntProgression\ninternal constructor(\n start: UInt,\n endInclusive: UInt,\n step: Int\n) : Iterable {\n init {\n if (step == 0.toInt()) throw kotlin.IllegalArgumentException(\"Step must be non-zero.\")\n if (step == Int.MIN_VALUE) throw kotlin.IllegalArgumentException(\"Step must be greater than Int.MIN_VALUE to avoid overflow on negation.\")\n }\n\n /**\n * The first element in the progression.\n */\n public val first: UInt = start\n\n /**\n * The last element in the progression.\n */\n public val last: UInt = getProgressionLastElement(start, endInclusive, step)\n\n /**\n * The step of the progression.\n */\n public val step: Int = step\n\n final override fun iterator(): Iterator = UIntProgressionIterator(first, last, step)\n\n /** \n * Checks if the progression is empty.\n \n * Progression with a positive step is empty if its first element is greater than the last element.\n * Progression with a negative step is empty if its first element is less than the last element.\n */\n public open fun isEmpty(): Boolean = if (step > 0) first > last else first < last\n\n override fun equals(other: Any?): Boolean =\n other is UIntProgression && (isEmpty() && other.isEmpty() ||\n first == other.first && last == other.last && step == other.step)\n\n override fun hashCode(): Int =\n if (isEmpty()) -1 else (31 * (31 * first.toInt() + last.toInt()) + step.toInt())\n\n override fun toString(): String = if (step > 0) \"$first..$last step $step\" else \"$first downTo $last step ${-step}\"\n\n companion object {\n /**\n * Creates UIntProgression within the specified bounds of a closed range.\n\n * The progression starts with the [rangeStart] value and goes toward the [rangeEnd] value not excluding it, with the specified [step].\n * In order to go backwards the [step] must be negative.\n *\n * [step] must be greater than `Int.MIN_VALUE` and not equal to zero.\n */\n public fun fromClosedRange(rangeStart: UInt, rangeEnd: UInt, step: Int): UIntProgression = UIntProgression(rangeStart, rangeEnd, step)\n }\n}\n\n\n/**\n * An iterator over a progression of values of type `UInt`.\n * @property step the number by which the value is incremented on each step.\n */\n@SinceKotlin(\"1.3\")\nprivate class UIntProgressionIterator(first: UInt, last: UInt, step: Int) : Iterator {\n private val finalElement = last\n private var hasNext: Boolean = if (step > 0) first <= last else first >= last\n private val step = step.toUInt() // use 2-complement math for negative steps\n private var next = if (hasNext) first else finalElement\n\n override fun hasNext(): Boolean = hasNext\n\n override fun next(): UInt {\n val value = next\n if (value == finalElement) {\n if (!hasNext) throw kotlin.NoSuchElementException()\n hasNext = false\n } else {\n next += step\n }\n return value\n }\n}\n\n","/*\n * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n// Auto-generated file. DO NOT EDIT!\n\npackage kotlin\n\nimport kotlin.jvm.*\n\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@JvmInline\npublic value class ULongArray\n@PublishedApi\ninternal constructor(@PublishedApi internal val storage: LongArray) : Collection {\n\n /** Creates a new array of the specified [size], with all elements initialized to zero. */\n public constructor(size: Int) : this(LongArray(size))\n\n /**\n * Returns the array element at the given [index]. This method can be called using the index operator.\n *\n * If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n public operator fun get(index: Int): ULong = storage[index].toULong()\n\n /**\n * Sets the element at the given [index] to the given [value]. This method can be called using the index operator.\n *\n * If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n public operator fun set(index: Int, value: ULong) {\n storage[index] = value.toLong()\n }\n\n /** Returns the number of elements in the array. */\n public override val size: Int get() = storage.size\n\n /** Creates an iterator over the elements of the array. */\n public override operator fun iterator(): kotlin.collections.Iterator = Iterator(storage)\n\n private class Iterator(private val array: LongArray) : kotlin.collections.Iterator {\n private var index = 0\n override fun hasNext() = index < array.size\n override fun next() = if (index < array.size) array[index++].toULong() else throw NoSuchElementException(index.toString())\n }\n\n override fun contains(element: ULong): Boolean {\n // TODO: Eliminate this check after KT-30016 gets fixed.\n // Currently JS BE does not generate special bridge method for this method.\n @Suppress(\"USELESS_CAST\")\n if ((element as Any?) !is ULong) return false\n\n return storage.contains(element.toLong())\n }\n\n override fun containsAll(elements: Collection): Boolean {\n return (elements as Collection<*>).all { it is ULong && storage.contains(it.toLong()) }\n }\n\n override fun isEmpty(): Boolean = this.storage.size == 0\n}\n\n/**\n * Creates a new array of the specified [size], where each element is calculated by calling the specified\n * [init] function.\n *\n * The function [init] is called for each array element sequentially starting from the first one.\n * It should return the value for an array element given its index.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray(size: Int, init: (Int) -> ULong): ULongArray {\n return ULongArray(LongArray(size) { index -> init(index).toLong() })\n}\n\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ulongArrayOf(vararg elements: ULong): ULongArray = elements\n","/*\n * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n// Auto-generated file. DO NOT EDIT!\n\npackage kotlin.ranges\n\n\n\nimport kotlin.internal.*\n\n/**\n * A range of values of type `ULong`.\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@OptIn(ExperimentalStdlibApi::class)\npublic class ULongRange(start: ULong, endInclusive: ULong) : ULongProgression(start, endInclusive, 1), ClosedRange, OpenEndRange {\n override val start: ULong get() = first\n override val endInclusive: ULong get() = last\n \n @SinceKotlin(\"1.7\")\n @ExperimentalStdlibApi\n @Deprecated(\"Can throw an exception when it's impossible to represent the value with ULong type, for example, when the range includes MAX_VALUE. It's recommended to use 'endInclusive' property that doesn't throw.\")\n override val endExclusive: ULong get() {\n if (last == ULong.MAX_VALUE) error(\"Cannot return the exclusive upper bound of a range that includes MAX_VALUE.\")\n return last + 1u\n }\n\n override fun contains(value: ULong): Boolean = first <= value && value <= last\n\n /** \n * Checks if the range is empty.\n \n * The range is empty if its start value is greater than the end value.\n */\n override fun isEmpty(): Boolean = first > last\n\n override fun equals(other: Any?): Boolean =\n other is ULongRange && (isEmpty() && other.isEmpty() ||\n first == other.first && last == other.last)\n\n override fun hashCode(): Int =\n if (isEmpty()) -1 else (31 * (first xor (first shr 32)).toInt() + (last xor (last shr 32)).toInt())\n\n override fun toString(): String = \"$first..$last\"\n\n companion object {\n /** An empty range of values of type ULong. */\n public val EMPTY: ULongRange = ULongRange(ULong.MAX_VALUE, ULong.MIN_VALUE)\n }\n}\n\n/**\n * A progression of values of type `ULong`.\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\npublic open class ULongProgression\ninternal constructor(\n start: ULong,\n endInclusive: ULong,\n step: Long\n) : Iterable {\n init {\n if (step == 0.toLong()) throw kotlin.IllegalArgumentException(\"Step must be non-zero.\")\n if (step == Long.MIN_VALUE) throw kotlin.IllegalArgumentException(\"Step must be greater than Long.MIN_VALUE to avoid overflow on negation.\")\n }\n\n /**\n * The first element in the progression.\n */\n public val first: ULong = start\n\n /**\n * The last element in the progression.\n */\n public val last: ULong = getProgressionLastElement(start, endInclusive, step)\n\n /**\n * The step of the progression.\n */\n public val step: Long = step\n\n final override fun iterator(): Iterator = ULongProgressionIterator(first, last, step)\n\n /** \n * Checks if the progression is empty.\n \n * Progression with a positive step is empty if its first element is greater than the last element.\n * Progression with a negative step is empty if its first element is less than the last element.\n */\n public open fun isEmpty(): Boolean = if (step > 0) first > last else first < last\n\n override fun equals(other: Any?): Boolean =\n other is ULongProgression && (isEmpty() && other.isEmpty() ||\n first == other.first && last == other.last && step == other.step)\n\n override fun hashCode(): Int =\n if (isEmpty()) -1 else (31 * (31 * (first xor (first shr 32)).toInt() + (last xor (last shr 32)).toInt()) + (step xor (step ushr 32)).toInt())\n\n override fun toString(): String = if (step > 0) \"$first..$last step $step\" else \"$first downTo $last step ${-step}\"\n\n companion object {\n /**\n * Creates ULongProgression within the specified bounds of a closed range.\n\n * The progression starts with the [rangeStart] value and goes toward the [rangeEnd] value not excluding it, with the specified [step].\n * In order to go backwards the [step] must be negative.\n *\n * [step] must be greater than `Long.MIN_VALUE` and not equal to zero.\n */\n public fun fromClosedRange(rangeStart: ULong, rangeEnd: ULong, step: Long): ULongProgression = ULongProgression(rangeStart, rangeEnd, step)\n }\n}\n\n\n/**\n * An iterator over a progression of values of type `ULong`.\n * @property step the number by which the value is incremented on each step.\n */\n@SinceKotlin(\"1.3\")\nprivate class ULongProgressionIterator(first: ULong, last: ULong, step: Long) : Iterator {\n private val finalElement = last\n private var hasNext: Boolean = if (step > 0) first <= last else first >= last\n private val step = step.toULong() // use 2-complement math for negative steps\n private var next = if (hasNext) first else finalElement\n\n override fun hasNext(): Boolean = hasNext\n\n override fun next(): ULong {\n val value = next\n if (value == finalElement) {\n if (!hasNext) throw kotlin.NoSuchElementException()\n hasNext = false\n } else {\n next += step\n }\n return value\n }\n}\n\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.internal\n\n// (a - b) mod c\nprivate fun differenceModulo(a: UInt, b: UInt, c: UInt): UInt {\n val ac = a % c\n val bc = b % c\n return if (ac >= bc) ac - bc else ac - bc + c\n}\n\nprivate fun differenceModulo(a: ULong, b: ULong, c: ULong): ULong {\n val ac = a % c\n val bc = b % c\n return if (ac >= bc) ac - bc else ac - bc + c\n}\n\n/**\n * Calculates the final element of a bounded arithmetic progression, i.e. the last element of the progression which is in the range\n * from [start] to [end] in case of a positive [step], or from [end] to [start] in case of a negative\n * [step].\n *\n * No validation on passed parameters is performed. The given parameters should satisfy the condition:\n *\n * - either `step > 0` and `start <= end`,\n * - or `step < 0` and `start >= end`.\n *\n * @param start first element of the progression\n * @param end ending bound for the progression\n * @param step increment, or difference of successive elements in the progression\n * @return the final element of the progression\n * @suppress\n */\n@PublishedApi\n@SinceKotlin(\"1.3\")\ninternal fun getProgressionLastElement(start: UInt, end: UInt, step: Int): UInt = when {\n step > 0 -> if (start >= end) end else end - differenceModulo(end, start, step.toUInt())\n step < 0 -> if (start <= end) end else end + differenceModulo(start, end, (-step).toUInt())\n else -> throw kotlin.IllegalArgumentException(\"Step is zero.\")\n}\n\n/**\n * Calculates the final element of a bounded arithmetic progression, i.e. the last element of the progression which is in the range\n * from [start] to [end] in case of a positive [step], or from [end] to [start] in case of a negative\n * [step].\n *\n * No validation on passed parameters is performed. The given parameters should satisfy the condition:\n *\n * - either `step > 0` and `start <= end`,\n * - or `step < 0` and `start >= end`.\n *\n * @param start first element of the progression\n * @param end ending bound for the progression\n * @param step increment, or difference of successive elements in the progression\n * @return the final element of the progression\n * @suppress\n */\n@PublishedApi\n@SinceKotlin(\"1.3\")\ninternal fun getProgressionLastElement(start: ULong, end: ULong, step: Long): ULong = when {\n step > 0 -> if (start >= end) end else end - differenceModulo(end, start, step.toULong())\n step < 0 -> if (start <= end) end else end + differenceModulo(start, end, (-step).toULong())\n else -> throw kotlin.IllegalArgumentException(\"Step is zero.\")\n}\n","/*\n * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n// Auto-generated file. DO NOT EDIT!\n\npackage kotlin\n\nimport kotlin.jvm.*\n\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@JvmInline\npublic value class UShortArray\n@PublishedApi\ninternal constructor(@PublishedApi internal val storage: ShortArray) : Collection {\n\n /** Creates a new array of the specified [size], with all elements initialized to zero. */\n public constructor(size: Int) : this(ShortArray(size))\n\n /**\n * Returns the array element at the given [index]. This method can be called using the index operator.\n *\n * If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n public operator fun get(index: Int): UShort = storage[index].toUShort()\n\n /**\n * Sets the element at the given [index] to the given [value]. This method can be called using the index operator.\n *\n * If the [index] is out of bounds of this array, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n public operator fun set(index: Int, value: UShort) {\n storage[index] = value.toShort()\n }\n\n /** Returns the number of elements in the array. */\n public override val size: Int get() = storage.size\n\n /** Creates an iterator over the elements of the array. */\n public override operator fun iterator(): kotlin.collections.Iterator = Iterator(storage)\n\n private class Iterator(private val array: ShortArray) : kotlin.collections.Iterator {\n private var index = 0\n override fun hasNext() = index < array.size\n override fun next() = if (index < array.size) array[index++].toUShort() else throw NoSuchElementException(index.toString())\n }\n\n override fun contains(element: UShort): Boolean {\n // TODO: Eliminate this check after KT-30016 gets fixed.\n // Currently JS BE does not generate special bridge method for this method.\n @Suppress(\"USELESS_CAST\")\n if ((element as Any?) !is UShort) return false\n\n return storage.contains(element.toShort())\n }\n\n override fun containsAll(elements: Collection): Boolean {\n return (elements as Collection<*>).all { it is UShort && storage.contains(it.toShort()) }\n }\n\n override fun isEmpty(): Boolean = this.storage.size == 0\n}\n\n/**\n * Creates a new array of the specified [size], where each element is calculated by calling the specified\n * [init] function.\n *\n * The function [init] is called for each array element sequentially starting from the first one.\n * It should return the value for an array element given its index.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray(size: Int, init: (Int) -> UShort): UShortArray {\n return UShortArray(ShortArray(size) { index -> init(index).toShort() })\n}\n\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ushortArrayOf(vararg elements: UShort): UShortArray = elements\n","/*\n * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"SetsKt\")\n\npackage kotlin.collections\n\n//\n// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt\n// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib\n//\n\nimport kotlin.random.*\nimport kotlin.ranges.contains\nimport kotlin.ranges.reversed\n\n/**\n * Returns a set containing all elements of the original set except the given [element].\n * \n * The returned set preserves the element iteration order of the original set.\n */\npublic operator fun Set.minus(element: T): Set {\n val result = LinkedHashSet(mapCapacity(size))\n var removed = false\n return this.filterTo(result) { if (!removed && it == element) { removed = true; false } else true }\n}\n\n/**\n * Returns a set containing all elements of the original set except the elements contained in the given [elements] array.\n * \n * The returned set preserves the element iteration order of the original set.\n * \n * Before Kotlin 1.6, the [elements] array may have been converted to a [HashSet] to speed up the operation, thus the elements were required to have\n * a correct and stable implementation of `hashCode()` that didn't change between successive invocations.\n * On JVM, you can enable this behavior back with the system property `kotlin.collections.convert_arg_to_set_in_removeAll` set to `true`.\n */\npublic operator fun Set.minus(elements: Array): Set {\n val result = LinkedHashSet(this)\n result.removeAll(elements)\n return result\n}\n\n/**\n * Returns a set containing all elements of the original set except the elements contained in the given [elements] collection.\n * \n * The returned set preserves the element iteration order of the original set.\n * \n * Before Kotlin 1.6, the [elements] collection may have been converted to a [HashSet] to speed up the operation, thus the elements were required to have\n * a correct and stable implementation of `hashCode()` that didn't change between successive invocations.\n * On JVM, you can enable this behavior back with the system property `kotlin.collections.convert_arg_to_set_in_removeAll` set to `true`.\n */\npublic operator fun Set.minus(elements: Iterable): Set {\n val other = elements.convertToSetForSetOperationWith(this)\n if (other.isEmpty())\n return this.toSet()\n if (other is Set)\n return this.filterNotTo(LinkedHashSet()) { it in other }\n val result = LinkedHashSet(this)\n result.removeAll(other)\n return result\n}\n\n/**\n * Returns a set containing all elements of the original set except the elements contained in the given [elements] sequence.\n * \n * The returned set preserves the element iteration order of the original set.\n * \n * Before Kotlin 1.6, the [elements] sequence may have been converted to a [HashSet] to speed up the operation, thus the elements were required to have\n * a correct and stable implementation of `hashCode()` that didn't change between successive invocations.\n * On JVM, you can enable this behavior back with the system property `kotlin.collections.convert_arg_to_set_in_removeAll` set to `true`.\n */\npublic operator fun Set.minus(elements: Sequence): Set {\n val result = LinkedHashSet(this)\n result.removeAll(elements)\n return result\n}\n\n/**\n * Returns a set containing all elements of the original set except the given [element].\n * \n * The returned set preserves the element iteration order of the original set.\n */\n@kotlin.internal.InlineOnly\npublic inline fun Set.minusElement(element: T): Set {\n return minus(element)\n}\n\n/**\n * Returns a set containing all elements of the original set and then the given [element] if it isn't already in this set.\n * \n * The returned set preserves the element iteration order of the original set.\n */\npublic operator fun Set.plus(element: T): Set {\n val result = LinkedHashSet(mapCapacity(size + 1))\n result.addAll(this)\n result.add(element)\n return result\n}\n\n/**\n * Returns a set containing all elements of the original set and the given [elements] array,\n * which aren't already in this set.\n * \n * The returned set preserves the element iteration order of the original set.\n */\npublic operator fun Set.plus(elements: Array): Set {\n val result = LinkedHashSet(mapCapacity(this.size + elements.size))\n result.addAll(this)\n result.addAll(elements)\n return result\n}\n\n/**\n * Returns a set containing all elements of the original set and the given [elements] collection,\n * which aren't already in this set.\n * The returned set preserves the element iteration order of the original set.\n */\npublic operator fun Set.plus(elements: Iterable): Set {\n val result = LinkedHashSet(mapCapacity(elements.collectionSizeOrNull()?.let { this.size + it } ?: this.size * 2))\n result.addAll(this)\n result.addAll(elements)\n return result\n}\n\n/**\n * Returns a set containing all elements of the original set and the given [elements] sequence,\n * which aren't already in this set.\n * \n * The returned set preserves the element iteration order of the original set.\n */\npublic operator fun Set.plus(elements: Sequence): Set {\n val result = LinkedHashSet(mapCapacity(this.size * 2))\n result.addAll(this)\n result.addAll(elements)\n return result\n}\n\n/**\n * Returns a set containing all elements of the original set and then the given [element] if it isn't already in this set.\n * \n * The returned set preserves the element iteration order of the original set.\n */\n@kotlin.internal.InlineOnly\npublic inline fun Set.plusElement(element: T): Set {\n return plus(element)\n}\n\n","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\nimport kotlin.reflect.KClass\n\n@PublishedApi\ninternal fun KClass<*>.findAssociatedObject(@Suppress(\"UNUSED_PARAMETER\") annotationClass: KClass): Any? {\n // This API is not supported in js-v1. Return `null` to be source-compatible with js-ir.\n return null\n}\n","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.coroutines.cancellation\n\n@SinceKotlin(\"1.4\")\npublic actual open class CancellationException : IllegalStateException {\n actual constructor() : super()\n actual constructor(message: String?) : super(message)\n constructor(message: String?, cause: Throwable?) : super(message, cause)\n constructor(cause: Throwable?) : super(cause)\n}","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.js\n\nimport getKClass\nimport kotlin.reflect.KClass\nimport kotlin.reflect.js.internal.KClassImpl\n\n/**\n * Represents the constructor of a class. Instances of `JsClass` can be passed to JavaScript APIs that expect a constructor reference.\n */\nexternal interface JsClass {\n /**\n * Returns the unqualified name of the class represented by this instance.\n */\n val name: String\n}\n\n/**\n * Obtains a constructor reference for the given `KClass`.\n */\nval KClass.js: JsClass\n get() = (this as KClassImpl).jClass\n\n/**\n * Obtains a `KClass` instance for the given constructor reference.\n */\nval JsClass.kotlin: KClass\n get() = getKClass(this)\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n// a package is omitted to get declarations directly under the module\n\n// TODO: Remove once JsReflectionAPICallChecker supports more reflection types\n@file:Suppress(\"Unsupported\")\n\nimport kotlin.reflect.*\nimport kotlin.reflect.js.internal.*\n\n@JsName(\"createKType\")\ninternal fun createKType(\n classifier: KClassifier,\n arguments: Array,\n isMarkedNullable: Boolean\n) =\n KTypeImpl(classifier, arguments.asList(), isMarkedNullable)\n\n@JsName(\"createDynamicKType\")\ninternal fun createDynamicKType(): KType = DynamicKType\n\n@JsName(\"markKTypeNullable\")\ninternal fun markKTypeNullable(kType: KType) = KTypeImpl(kType.classifier!!, kType.arguments, true)\n\n@JsName(\"createKTypeParameter\")\ninternal fun createKTypeParameter(\n name: String,\n upperBounds: Array,\n variance: String\n): KTypeParameter {\n val kVariance = when (variance) {\n \"in\" -> KVariance.IN\n \"out\" -> KVariance.OUT\n else -> KVariance.INVARIANT\n }\n\n return KTypeParameterImpl(name, upperBounds.asList(), kVariance, false)\n}\n\n@JsName(\"getStarKTypeProjection\")\ninternal fun getStarKTypeProjection(): KTypeProjection =\n KTypeProjection.STAR\n\n@JsName(\"createCovariantKTypeProjection\")\ninternal fun createCovariantKTypeProjection(type: KType): KTypeProjection =\n KTypeProjection.covariant(type)\n\n@JsName(\"createInvariantKTypeProjection\")\ninternal fun createInvariantKTypeProjection(type: KType): KTypeProjection =\n KTypeProjection.invariant(type)\n\n@JsName(\"createContravariantKTypeProjection\")\ninternal fun createContravariantKTypeProjection(type: KType): KTypeProjection =\n KTypeProjection.contravariant(type)\n","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin\n\n/**\n * Returns the detailed description of this throwable with its stack trace.\n *\n * The detailed description includes:\n * - the short description (see [Throwable.toString]) of this throwable;\n * - the complete stack trace;\n * - detailed descriptions of the exceptions that were [suppressed][suppressedExceptions] in order to deliver this exception;\n * - the detailed description of each throwable in the [Throwable.cause] chain.\n */\n@SinceKotlin(\"1.4\")\npublic actual fun Throwable.stackTraceToString(): String = ExceptionTraceBuilder().buildFor(this)\n\n/**\n * Prints the [detailed description][Throwable.stackTraceToString] of this throwable to console error output.\n */\n@SinceKotlin(\"1.4\")\npublic actual fun Throwable.printStackTrace() {\n console.error(this.stackTraceToString())\n}\n\n/**\n * Adds the specified exception to the list of exceptions that were\n * suppressed in order to deliver this exception.\n */\n@SinceKotlin(\"1.4\")\npublic actual fun Throwable.addSuppressed(exception: Throwable) {\n if (this !== exception) {\n val suppressed = this.asDynamic()._suppressed.unsafeCast?>()\n if (suppressed == null) {\n this.asDynamic()._suppressed = mutableListOf(exception)\n } else {\n suppressed.add(exception)\n }\n }\n}\n\n/**\n * Returns a list of all exceptions that were suppressed in order to deliver this exception.\n */\n@SinceKotlin(\"1.4\")\npublic actual val Throwable.suppressedExceptions: List\n get() {\n return this.asDynamic()._suppressed?.unsafeCast>() ?: emptyList()\n }\n\n\nprivate class ExceptionTraceBuilder {\n private val target = StringBuilder()\n private val visited = arrayOf()\n private var topStack: String = \"\"\n private var topStackStart: Int = 0\n\n fun buildFor(exception: Throwable): String {\n exception.dumpFullTrace(\"\", \"\")\n return target.toString()\n }\n\n private fun hasSeen(exception: Throwable): Boolean = visited.any { it === exception }\n\n private fun Throwable.dumpFullTrace(indent: String, qualifier: String) {\n this.dumpSelfTrace(indent, qualifier) || return\n\n var cause = this.cause\n while (cause != null) {\n cause.dumpSelfTrace(indent, \"Caused by: \") || return\n cause = cause.cause\n }\n }\n\n private fun Throwable.dumpSelfTrace(indent: String, qualifier: String): Boolean {\n target.append(indent).append(qualifier)\n val shortInfo = this.toString()\n if (hasSeen(this)) {\n target.append(\"[CIRCULAR REFERENCE, SEE ABOVE: \").append(shortInfo).append(\"]\\n\")\n return false\n }\n visited.asDynamic().push(this)\n\n var stack = this.asDynamic().stack as String?\n if (stack != null) {\n val stackStart = stack.indexOf(shortInfo).let { if (it < 0) 0 else it + shortInfo.length }\n if (stackStart == 0) target.append(shortInfo).append(\"\\n\")\n if (topStack.isEmpty()) {\n topStack = stack\n topStackStart = stackStart\n } else {\n stack = dropCommonFrames(stack, stackStart)\n }\n if (indent.isNotEmpty()) {\n // indent stack, but avoid indenting exception message lines\n val messageLines = if (stackStart == 0) 0 else 1 + shortInfo.count { c -> c == '\\n' }\n stack.lineSequence().forEachIndexed { index: Int, line: String ->\n if (index >= messageLines) target.append(indent)\n target.append(line).append(\"\\n\")\n }\n } else {\n target.append(stack).append(\"\\n\")\n }\n } else {\n target.append(shortInfo).append(\"\\n\")\n }\n\n val suppressed = suppressedExceptions\n if (suppressed.isNotEmpty()) {\n val suppressedIndent = indent + \" \"\n for (s in suppressed) {\n s.dumpFullTrace(suppressedIndent, \"Suppressed: \")\n }\n }\n return true\n }\n\n private fun dropCommonFrames(stack: String, stackStart: Int): String {\n var commonFrames: Int = 0\n var lastBreak: Int = 0\n var preLastBreak: Int = 0\n for (pos in 0 until minOf(topStack.length - topStackStart, stack.length - stackStart)) {\n val c = stack[stack.lastIndex - pos]\n if (c != topStack[topStack.lastIndex - pos]) break\n if (c == '\\n') {\n commonFrames += 1\n preLastBreak = lastBreak\n lastBreak = pos\n }\n }\n if (commonFrames <= 1) return stack\n while (preLastBreak > 0 && stack[stack.lastIndex - (preLastBreak - 1)] == ' ')\n preLastBreak -= 1\n\n // leave 1 common frame to ease matching with the top exception stack\n return stack.dropLast(preLastBreak) + \"... and ${commonFrames - 1} more common stack frames skipped\"\n }\n}","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n@file:kotlin.jvm.JvmName(\"ComparisonsKt\")\n@file:kotlin.jvm.JvmMultifileClass\n\npackage kotlin.comparisons\n\n/**\n * Compares two values using the specified functions [selectors] to calculate the result of the comparison.\n * The functions are called sequentially, receive the given values [a] and [b] and return [Comparable]\n * objects. As soon as the [Comparable] instances returned by a function for [a] and [b] values do not\n * compare as equal, the result of that comparison is returned.\n *\n * @sample samples.comparisons.Comparisons.compareValuesByWithSelectors\n */\npublic fun compareValuesBy(a: T, b: T, vararg selectors: (T) -> Comparable<*>?): Int {\n require(selectors.size > 0)\n return compareValuesByImpl(a, b, selectors)\n}\n\nprivate fun compareValuesByImpl(a: T, b: T, selectors: Array Comparable<*>?>): Int {\n for (fn in selectors) {\n val v1 = fn(a)\n val v2 = fn(b)\n val diff = compareValues(v1, v2)\n if (diff != 0) return diff\n }\n return 0\n}\n\n/**\n * Compares two values using the specified [selector] function to calculate the result of the comparison.\n * The function is applied to the given values [a] and [b] and return [Comparable] objects.\n * The result of comparison of these [Comparable] instances is returned.\n *\n * @sample samples.comparisons.Comparisons.compareValuesByWithSingleSelector\n */\n@kotlin.internal.InlineOnly\npublic inline fun compareValuesBy(a: T, b: T, selector: (T) -> Comparable<*>?): Int {\n return compareValues(selector(a), selector(b))\n}\n\n/**\n * Compares two values using the specified [selector] function to calculate the result of the comparison.\n * The function is applied to the given values [a] and [b] and return objects of type K which are then being\n * compared with the given [comparator].\n *\n * @sample samples.comparisons.Comparisons.compareValuesByWithComparator\n */\n@kotlin.internal.InlineOnly\npublic inline fun compareValuesBy(a: T, b: T, comparator: Comparator, selector: (T) -> K): Int {\n return comparator.compare(selector(a), selector(b))\n}\n\n//// Not so useful without type inference for receiver of expression\n//// compareValuesWith(v1, v2, compareBy { it.prop1 } thenByDescending { it.prop2 })\n///**\n// * Compares two values using the specified [comparator].\n// */\n//@Suppress(\"NOTHING_TO_INLINE\")\n//public inline fun compareValuesWith(a: T, b: T, comparator: Comparator): Int = comparator.compare(a, b)\n//\n\n\n/**\n * Compares two nullable [Comparable] values. Null is considered less than any value.\n *\n * @sample samples.comparisons.Comparisons.compareValues\n */\npublic fun > compareValues(a: T?, b: T?): Int {\n if (a === b) return 0\n if (a == null) return -1\n if (b == null) return 1\n\n @Suppress(\"UNCHECKED_CAST\")\n return (a as Comparable).compareTo(b)\n}\n\n/**\n * Creates a comparator using the sequence of functions to calculate a result of comparison.\n * The functions are called sequentially, receive the given values `a` and `b` and return [Comparable]\n * objects. As soon as the [Comparable] instances returned by a function for `a` and `b` values do not\n * compare as equal, the result of that comparison is returned from the [Comparator].\n *\n * @sample samples.comparisons.Comparisons.compareByWithSelectors\n */\npublic fun compareBy(vararg selectors: (T) -> Comparable<*>?): Comparator {\n require(selectors.size > 0)\n return Comparator { a, b -> compareValuesByImpl(a, b, selectors) }\n}\n\n\n/**\n * Creates a comparator using the function to transform value to a [Comparable] instance for comparison.\n *\n * @sample samples.comparisons.Comparisons.compareByWithSingleSelector\n */\n@kotlin.internal.InlineOnly\npublic inline fun compareBy(crossinline selector: (T) -> Comparable<*>?): Comparator =\n Comparator { a, b -> compareValuesBy(a, b, selector) }\n\n/**\n * Creates a comparator using the [selector] function to transform values being compared and then applying\n * the specified [comparator] to compare transformed values.\n *\n * @sample samples.comparisons.Comparisons.compareByWithComparator\n */\n@kotlin.internal.InlineOnly\npublic inline fun compareBy(comparator: Comparator, crossinline selector: (T) -> K): Comparator =\n Comparator { a, b -> compareValuesBy(a, b, comparator, selector) }\n\n/**\n * Creates a descending comparator using the function to transform value to a [Comparable] instance for comparison.\n *\n * @sample samples.comparisons.Comparisons.compareByDescendingWithSingleSelector\n */\n@kotlin.internal.InlineOnly\npublic inline fun compareByDescending(crossinline selector: (T) -> Comparable<*>?): Comparator =\n Comparator { a, b -> compareValuesBy(b, a, selector) }\n\n/**\n * Creates a descending comparator using the [selector] function to transform values being compared and then applying\n * the specified [comparator] to compare transformed values.\n *\n * Note that an order of [comparator] is reversed by this wrapper.\n *\n * @sample samples.comparisons.Comparisons.compareByDescendingWithComparator\n */\n@kotlin.internal.InlineOnly\npublic inline fun compareByDescending(comparator: Comparator, crossinline selector: (T) -> K): Comparator =\n Comparator { a, b -> compareValuesBy(b, a, comparator, selector) }\n\n/**\n * Creates a comparator comparing values after the primary comparator defined them equal. It uses\n * the function to transform value to a [Comparable] instance for comparison.\n *\n * @sample samples.comparisons.Comparisons.thenBy\n */\n@kotlin.internal.InlineOnly\npublic inline fun Comparator.thenBy(crossinline selector: (T) -> Comparable<*>?): Comparator =\n Comparator { a, b ->\n val previousCompare = this@thenBy.compare(a, b)\n if (previousCompare != 0) previousCompare else compareValuesBy(a, b, selector)\n }\n\n/**\n * Creates a comparator comparing values after the primary comparator defined them equal. It uses\n * the [selector] function to transform values and then compares them with the given [comparator].\n *\n * @sample samples.comparisons.Comparisons.thenByWithComparator\n */\n@kotlin.internal.InlineOnly\npublic inline fun Comparator.thenBy(comparator: Comparator, crossinline selector: (T) -> K): Comparator =\n Comparator { a, b ->\n val previousCompare = this@thenBy.compare(a, b)\n if (previousCompare != 0) previousCompare else compareValuesBy(a, b, comparator, selector)\n }\n\n/**\n * Creates a descending comparator using the primary comparator and\n * the function to transform value to a [Comparable] instance for comparison.\n *\n * @sample samples.comparisons.Comparisons.thenByDescending\n */\n@kotlin.internal.InlineOnly\npublic inline fun Comparator.thenByDescending(crossinline selector: (T) -> Comparable<*>?): Comparator =\n Comparator { a, b ->\n val previousCompare = this@thenByDescending.compare(a, b)\n if (previousCompare != 0) previousCompare else compareValuesBy(b, a, selector)\n }\n\n/**\n * Creates a descending comparator comparing values after the primary comparator defined them equal. It uses\n * the [selector] function to transform values and then compares them with the given [comparator].\n *\n * @sample samples.comparisons.Comparisons.thenByDescendingWithComparator\n */\n@kotlin.internal.InlineOnly\npublic inline fun Comparator.thenByDescending(comparator: Comparator, crossinline selector: (T) -> K): Comparator =\n Comparator { a, b ->\n val previousCompare = this@thenByDescending.compare(a, b)\n if (previousCompare != 0) previousCompare else compareValuesBy(b, a, comparator, selector)\n }\n\n\n/**\n * Creates a comparator using the primary comparator and function to calculate a result of comparison.\n *\n * @sample samples.comparisons.Comparisons.thenComparator\n */\n@kotlin.internal.InlineOnly\npublic inline fun Comparator.thenComparator(crossinline comparison: (a: T, b: T) -> Int): Comparator =\n Comparator { a, b ->\n val previousCompare = this@thenComparator.compare(a, b)\n if (previousCompare != 0) previousCompare else comparison(a, b)\n }\n\n/**\n * Combines this comparator and the given [comparator] such that the latter is applied only\n * when the former considered values equal.\n *\n * @sample samples.comparisons.Comparisons.then\n */\npublic infix fun Comparator.then(comparator: Comparator): Comparator =\n Comparator { a, b ->\n val previousCompare = this@then.compare(a, b)\n if (previousCompare != 0) previousCompare else comparator.compare(a, b)\n }\n\n/**\n * Combines this comparator and the given [comparator] such that the latter is applied only\n * when the former considered values equal.\n *\n * @sample samples.comparisons.Comparisons.thenDescending\n */\npublic infix fun Comparator.thenDescending(comparator: Comparator): Comparator =\n Comparator { a, b ->\n val previousCompare = this@thenDescending.compare(a, b)\n if (previousCompare != 0) previousCompare else comparator.compare(b, a)\n }\n\n// Not so useful without type inference for receiver of expression\n/**\n * Extends the given [comparator] of non-nullable values to a comparator of nullable values\n * considering `null` value less than any other value.\n *\n * @sample samples.comparisons.Comparisons.nullsFirstLastWithComparator\n */\npublic fun nullsFirst(comparator: Comparator): Comparator =\n Comparator { a, b ->\n when {\n a === b -> 0\n a == null -> -1\n b == null -> 1\n else -> comparator.compare(a, b)\n }\n }\n\n/**\n * Provides a comparator of nullable [Comparable] values\n * considering `null` value less than any other value.\n *\n * @sample samples.comparisons.Comparisons.nullsFirstLastComparator\n */\n@kotlin.internal.InlineOnly\npublic inline fun > nullsFirst(): Comparator = nullsFirst(naturalOrder())\n\n/**\n * Extends the given [comparator] of non-nullable values to a comparator of nullable values\n * considering `null` value greater than any other value.\n *\n * @sample samples.comparisons.Comparisons.nullsFirstLastWithComparator\n */\npublic fun nullsLast(comparator: Comparator): Comparator =\n Comparator { a, b ->\n when {\n a === b -> 0\n a == null -> 1\n b == null -> -1\n else -> comparator.compare(a, b)\n }\n }\n\n/**\n * Provides a comparator of nullable [Comparable] values\n * considering `null` value greater than any other value.\n *\n * @sample samples.comparisons.Comparisons.nullsFirstLastComparator\n */\n@kotlin.internal.InlineOnly\npublic inline fun > nullsLast(): Comparator = nullsLast(naturalOrder())\n\n/**\n * Returns a comparator that compares [Comparable] objects in natural order.\n *\n * @sample samples.comparisons.Comparisons.naturalOrderComparator\n */\npublic fun > naturalOrder(): Comparator = @Suppress(\"UNCHECKED_CAST\") (NaturalOrderComparator as Comparator)\n\n/**\n * Returns a comparator that compares [Comparable] objects in reversed natural order.\n *\n * @sample samples.comparisons.Comparisons.nullsFirstLastWithComparator\n */\npublic fun > reverseOrder(): Comparator = @Suppress(\"UNCHECKED_CAST\") (ReverseOrderComparator as Comparator)\n\n/**\n * Returns a comparator that imposes the reverse ordering of this comparator.\n *\n * @sample samples.comparisons.Comparisons.reversed\n */\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\npublic fun Comparator.reversed(): Comparator = when (this) {\n is ReversedComparator -> this.comparator\n NaturalOrderComparator -> @Suppress(\"UNCHECKED_CAST\") (ReverseOrderComparator as Comparator)\n ReverseOrderComparator -> @Suppress(\"UNCHECKED_CAST\") (NaturalOrderComparator as Comparator)\n else -> ReversedComparator(this)\n}\n\n\nprivate class ReversedComparator(public val comparator: Comparator) : Comparator {\n override fun compare(a: T, b: T): Int = comparator.compare(b, a)\n @Suppress(\"VIRTUAL_MEMBER_HIDDEN\")\n fun reversed(): Comparator = comparator\n}\n\nprivate object NaturalOrderComparator : Comparator> {\n override fun compare(a: Comparable, b: Comparable): Int = a.compareTo(b)\n @Suppress(\"VIRTUAL_MEMBER_HIDDEN\")\n fun reversed(): Comparator> = ReverseOrderComparator\n}\n\nprivate object ReverseOrderComparator : Comparator> {\n override fun compare(a: Comparable, b: Comparable): Int = b.compareTo(a)\n @Suppress(\"VIRTUAL_MEMBER_HIDDEN\")\n fun reversed(): Comparator> = NaturalOrderComparator\n}\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.coroutines.js.internal\n\nimport kotlin.coroutines.Continuation\nimport kotlin.coroutines.EmptyCoroutineContext\n\n@PublishedApi\n@SinceKotlin(\"1.3\")\ninternal val EmptyContinuation = Continuation(EmptyCoroutineContext) { result ->\n result.getOrThrow()\n}","/*\n * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.js\n\n/**\n * Exposes the JavaScript [Math object](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Math) to Kotlin.\n */\n@PublishedApi\n@JsName(\"Math\")\ninternal external object JsMath {\n val LN2: Double\n fun abs(value: Double): Double\n fun acos(value: Double): Double\n fun asin(value: Double): Double\n fun atan(value: Double): Double\n fun atan2(y: Double, x: Double): Double\n fun cos(value: Double): Double\n fun sin(value: Double): Double\n fun exp(value: Double): Double\n fun max(vararg values: Int): Int\n fun max(vararg values: Float): Float\n fun max(vararg values: Double): Double\n fun min(vararg values: Int): Int\n fun min(vararg values: Float): Float\n fun min(vararg values: Double): Double\n fun sqrt(value: Double): Double\n fun tan(value: Double): Double\n fun log(value: Double): Double\n fun cbrt(value: Double): Double\n fun pow(base: Double, exp: Double): Double\n fun round(value: Number): Double\n fun floor(value: Number): Double\n fun ceil(value: Number): Double\n}\n\ninternal const val defineTaylorNBound = \"\"\"\n var epsilon = 2.220446049250313E-16;\n var taylor_2_bound = Math.sqrt(epsilon);\n var taylor_n_bound = Math.sqrt(taylor_2_bound);\n\"\"\"\n\ninternal const val defineUpperTaylor2Bound = \"\"\"\n $defineTaylorNBound\n var upper_taylor_2_bound = 1/taylor_2_bound;\n\"\"\"\n\ninternal const val defineUpperTaylorNBound = \"\"\"\n $defineUpperTaylor2Bound\n var upper_taylor_n_bound = 1/taylor_n_bound;\n\"\"\"\n",null,null,"/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin\n\nimport kotlin.internal.InlineOnly\n\n\n/**\n * Returns a hash code value for the object or zero if the object is `null`.\n *\n * @see Any.hashCode\n */\n@SinceKotlin(\"1.3\")\n@InlineOnly\npublic inline fun Any?.hashCode(): Int = this?.hashCode() ?: 0\n",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"package io.ktor.utils.io\n\nimport io.ktor.utils.io.bits.*\nimport io.ktor.utils.io.core.*\nimport io.ktor.utils.io.core.internal.*\nimport io.ktor.utils.io.internal.*\nimport io.ktor.utils.io.pool.*\nimport kotlinx.atomicfu.*\nimport kotlinx.atomicfu.locks.*\nimport kotlin.math.*\n\nprivate const val EXPECTED_CAPACITY: Long = 4088L\n\n/**\n * Sequential (non-concurrent) byte channel implementation\n */\n@Suppress(\"OverridingDeprecatedMember\", \"DEPRECATION\")\npublic abstract class ByteChannelSequentialBase(\n initial: ChunkBuffer,\n override val autoFlush: Boolean,\n pool: ObjectPool = ChunkBuffer.Pool\n) : ByteChannel, ByteReadChannel, ByteWriteChannel, SuspendableReadSession, HasReadSession, HasWriteSession {\n private val _lastReadView: AtomicRef = atomic(ChunkBuffer.Empty)\n\n private val _totalBytesRead = atomic(0L)\n private val _totalBytesWritten = atomic(0L)\n private val _availableForRead = atomic(0)\n private val channelSize = atomic(0)\n\n private val _closed = atomic(null)\n private val isCancelled: Boolean get() = _closed.value?.cause != null\n\n protected var closed: Boolean\n get() = _closed.value != null\n set(_) {\n error(\"Setting is not allowed for closed\")\n }\n\n protected val writable: BytePacketBuilder = BytePacketBuilder(pool)\n protected val readable: ByteReadPacket = ByteReadPacket(initial, pool)\n\n private var lastReadAvailable: Int by atomic(0)\n private var lastReadView: ChunkBuffer by atomic(ChunkBuffer.Empty)\n\n private val slot = AwaitingSlot()\n\n override val availableForRead: Int get() = _availableForRead.value\n\n override val availableForWrite: Int\n get() = maxOf(0, EXPECTED_CAPACITY.toInt() - channelSize.value)\n\n override val isClosedForRead: Boolean\n get() = isCancelled || (closed && channelSize.value == 0)\n\n override val isClosedForWrite: Boolean\n get() = closed\n\n override val totalBytesRead: Long\n get() = _totalBytesRead.value\n\n override val totalBytesWritten: Long get() = _totalBytesWritten.value\n\n final override var closedCause: Throwable?\n get() = _closed.value?.cause\n set(_) {\n error(\"Closed cause shouldn't be changed directly\")\n }\n\n private val flushMutex = SynchronizedObject()\n private val flushBuffer: BytePacketBuilder = BytePacketBuilder()\n\n init {\n val count = initial.remainingAll().toInt()\n afterWrite(count)\n _availableForRead.addAndGet(count)\n }\n\n internal suspend fun awaitAtLeastNBytesAvailableForWrite(count: Int) {\n while (availableForWrite < count && !closed) {\n if (!flushImpl()) {\n slot.sleep { availableForWrite < count && !closed }\n }\n }\n }\n\n internal suspend fun awaitAtLeastNBytesAvailableForRead(count: Int) {\n while (availableForRead < count && !isClosedForRead) {\n slot.sleep { availableForRead < count && !isClosedForRead }\n }\n }\n\n override fun flush() {\n flushImpl()\n }\n\n private fun flushImpl(): Boolean {\n if (writable.isEmpty) {\n slot.resume()\n return false\n }\n\n flushWrittenBytes()\n slot.resume()\n return true\n }\n\n /**\n * Send bytes to thread-safe storage.\n *\n * This method is writer-only safe.\n */\n private fun flushWrittenBytes() {\n synchronized(flushMutex) {\n val size = writable.size\n val buffer = writable.stealAll()!!\n flushBuffer.writeChunkBuffer(buffer)\n _availableForRead.addAndGet(size)\n }\n }\n\n /**\n * Take flushed bytes before read.\n *\n * This method is reader-only safe.\n */\n protected fun prepareFlushedBytes() {\n synchronized(flushMutex) {\n readable.unsafeAppend(flushBuffer)\n }\n }\n\n private fun ensureNotClosed() {\n if (closed) {\n throw closedCause ?: ClosedWriteChannelException(\"Channel $this is already closed\")\n }\n }\n\n private fun ensureNotFailed() {\n closedCause?.let { throw it }\n }\n\n private fun ensureNotFailed(closeable: BytePacketBuilder) {\n closedCause?.let { cause ->\n closeable.release()\n throw cause\n }\n }\n\n override suspend fun writeByte(b: Byte) {\n awaitAtLeastNBytesAvailableForWrite(1)\n writable.writeByte(b)\n afterWrite(1)\n }\n\n override suspend fun writeShort(s: Short) {\n awaitAtLeastNBytesAvailableForWrite(2)\n writable.writeShort(s)\n afterWrite(2)\n }\n\n override suspend fun writeInt(i: Int) {\n awaitAtLeastNBytesAvailableForWrite(4)\n writable.writeInt(i)\n afterWrite(4)\n }\n\n override suspend fun writeLong(l: Long) {\n awaitAtLeastNBytesAvailableForWrite(8)\n writable.writeLong(l)\n afterWrite(8)\n }\n\n override suspend fun writeFloat(f: Float) {\n awaitAtLeastNBytesAvailableForWrite(4)\n writable.writeFloat(f)\n afterWrite(4)\n }\n\n override suspend fun writeDouble(d: Double) {\n awaitAtLeastNBytesAvailableForWrite(8)\n writable.writeDouble(d)\n afterWrite(8)\n }\n\n override suspend fun writePacket(packet: ByteReadPacket) {\n awaitAtLeastNBytesAvailableForWrite(1)\n val size = packet.remaining.toInt()\n writable.writePacket(packet)\n afterWrite(size)\n }\n\n override suspend fun writeFully(src: Buffer) {\n awaitAtLeastNBytesAvailableForWrite(1)\n val count = src.readRemaining\n writable.writeFully(src)\n afterWrite(count)\n }\n\n override suspend fun writeFully(src: ByteArray, offset: Int, length: Int) {\n var currentIndex = offset\n val endIndex = offset + length\n\n while (currentIndex < endIndex) {\n awaitAtLeastNBytesAvailableForWrite(1)\n\n val bytesCount = min(availableForWrite, endIndex - currentIndex)\n writable.writeFully(src, currentIndex, bytesCount)\n\n currentIndex += bytesCount\n afterWrite(bytesCount)\n }\n }\n\n override suspend fun writeFully(memory: Memory, startIndex: Int, endIndex: Int) {\n var currentIndex = startIndex\n\n while (currentIndex < endIndex) {\n awaitAtLeastNBytesAvailableForWrite(1)\n\n val bytesCount = min(availableForWrite, endIndex - currentIndex)\n writable.writeFully(memory, currentIndex, bytesCount)\n\n currentIndex += bytesCount\n afterWrite(bytesCount)\n }\n }\n\n override suspend fun writeAvailable(src: ChunkBuffer): Int {\n val srcRemaining = src.readRemaining\n if (srcRemaining == 0) return 0\n val size = minOf(srcRemaining, availableForWrite)\n\n return if (size == 0) writeAvailableSuspend(src)\n else {\n writable.writeFully(src, size)\n afterWrite(size)\n size\n }\n }\n\n override suspend fun writeAvailable(src: ByteArray, offset: Int, length: Int): Int {\n if (length == 0) return 0\n val size = minOf(length, availableForWrite)\n\n return if (size == 0) writeAvailableSuspend(src, offset, length)\n else {\n writable.writeFully(src, offset, size)\n afterWrite(size)\n size\n }\n }\n\n @Suppress(\"DEPRECATION\")\n @Deprecated(\"Use write { } instead.\")\n override suspend fun writeSuspendSession(visitor: suspend WriterSuspendSession.() -> Unit) {\n val session = beginWriteSession()\n visitor(session)\n }\n\n @Suppress(\"DEPRECATION\")\n override fun beginWriteSession(): WriterSuspendSession {\n return object : WriterSuspendSession {\n override fun request(min: Int): ChunkBuffer? {\n if (availableForWrite == 0) return null\n return writable.prepareWriteHead(min)\n }\n\n override fun written(n: Int) {\n writable.afterHeadWrite()\n afterWrite(n)\n }\n\n override fun flush() {\n this@ByteChannelSequentialBase.flush()\n }\n\n override suspend fun tryAwait(n: Int) {\n if (availableForWrite < n) {\n awaitAtLeastNBytesAvailableForWrite(n)\n }\n }\n }\n }\n\n override fun endWriteSession(written: Int) {\n writable.afterHeadWrite()\n afterWrite(written)\n }\n\n override suspend fun readByte(): Byte {\n return if (readable.isNotEmpty) {\n readable.readByte().also { afterRead(1) }\n } else {\n readByteSlow()\n }\n }\n\n private fun checkClosed(remaining: Int, closeable: BytePacketBuilder? = null) {\n closedCause?.let {\n closeable?.close()\n throw it\n }\n if (closed && availableForRead < remaining) {\n closeable?.close()\n throw EOFException(\"$remaining bytes required but EOF reached\")\n }\n }\n\n private suspend fun readByteSlow(): Byte {\n do {\n awaitSuspend(1)\n\n if (readable.isNotEmpty) return readable.readByte().also { afterRead(1) }\n checkClosed(1)\n } while (true)\n }\n\n override suspend fun readShort(): Short {\n return if (readable.hasBytes(2)) {\n readable.readShort().also { afterRead(2) }\n } else {\n readShortSlow()\n }\n }\n\n private suspend fun readShortSlow(): Short {\n awaitSuspend(2)\n val result = readable.readShort()\n afterRead(2)\n return result\n }\n\n protected fun afterRead(count: Int) {\n addBytesRead(count)\n slot.resume()\n }\n\n override suspend fun readInt(): Int {\n return if (readable.hasBytes(4)) {\n readable.readInt().also { afterRead(4) }\n } else {\n readIntSlow()\n }\n }\n\n private suspend fun readIntSlow(): Int {\n awaitSuspend(4)\n val result = readable.readInt()\n afterRead(4)\n return result\n }\n\n override suspend fun readLong(): Long {\n return if (readable.hasBytes(8)) {\n readable.readLong().also { afterRead(8) }\n } else {\n readLongSlow()\n }\n }\n\n private suspend fun readLongSlow(): Long {\n awaitSuspend(8)\n val result = readable.readLong()\n afterRead(8)\n return result\n }\n\n override suspend fun readFloat(): Float = if (readable.hasBytes(4)) {\n readable.readFloat().also { afterRead(4) }\n } else {\n readFloatSlow()\n }\n\n private suspend fun readFloatSlow(): Float {\n awaitSuspend(4)\n val result = readable.readFloat()\n afterRead(4)\n return result\n }\n\n override suspend fun readDouble(): Double = if (readable.hasBytes(8)) {\n readable.readDouble().also { afterRead(8) }\n } else {\n readDoubleSlow()\n }\n\n private suspend fun readDoubleSlow(): Double {\n awaitSuspend(8)\n val result = readable.readDouble()\n afterRead(8)\n return result\n }\n\n override suspend fun readRemaining(limit: Long): ByteReadPacket {\n ensureNotFailed()\n\n val builder = BytePacketBuilder()\n\n val size = minOf(limit, readable.remaining)\n builder.writePacket(readable, size)\n afterRead(size.toInt())\n\n val newLimit = limit - builder.size\n return if (newLimit == 0L || isClosedForRead) {\n ensureNotFailed(builder)\n builder.build()\n } else {\n readRemainingSuspend(builder, limit)\n }\n }\n\n private suspend fun readRemainingSuspend(builder: BytePacketBuilder, limit: Long): ByteReadPacket {\n while (builder.size < limit) {\n val partLimit = minOf(limit - builder.size, readable.remaining)\n builder.writePacket(readable, partLimit)\n afterRead(partLimit.toInt())\n ensureNotFailed(builder)\n\n if (isClosedForRead || builder.size == limit.toInt()) {\n break\n }\n\n awaitSuspend(1)\n }\n\n ensureNotFailed(builder)\n return builder.build()\n }\n\n override suspend fun readPacket(size: Int): ByteReadPacket {\n checkClosed(size)\n\n val builder = BytePacketBuilder()\n\n var remaining = size\n val partSize = minOf(remaining.toLong(), readable.remaining).toInt()\n remaining -= partSize\n builder.writePacket(readable, partSize)\n afterRead(partSize)\n checkClosed(remaining, builder)\n\n return if (remaining > 0) readPacketSuspend(builder, remaining)\n else builder.build()\n }\n\n private suspend fun readPacketSuspend(builder: BytePacketBuilder, size: Int): ByteReadPacket {\n var remaining = size\n while (remaining > 0) {\n val partSize = minOf(remaining.toLong(), readable.remaining).toInt()\n remaining -= partSize\n builder.writePacket(readable, partSize)\n afterRead(partSize)\n checkClosed(remaining, builder)\n\n if (remaining > 0) {\n awaitSuspend(1)\n }\n }\n\n checkClosed(remaining, builder)\n return builder.build()\n }\n\n protected fun readAvailableClosed(): Int {\n closedCause?.let { throw it }\n\n if (availableForRead > 0) {\n prepareFlushedBytes()\n }\n\n return -1\n }\n\n override suspend fun readAvailable(dst: ChunkBuffer): Int = readAvailable(dst as Buffer)\n\n internal suspend fun readAvailable(dst: Buffer): Int {\n closedCause?.let { throw it }\n if (closed && availableForRead == 0) return -1\n\n if (dst.writeRemaining == 0) return 0\n\n if (availableForRead == 0) {\n awaitSuspend(1)\n }\n\n if (!readable.canRead()) {\n prepareFlushedBytes()\n }\n\n val size = minOf(dst.writeRemaining.toLong(), readable.remaining).toInt()\n readable.readFully(dst, size)\n afterRead(size)\n return size\n }\n\n override suspend fun readFully(dst: ChunkBuffer, n: Int) {\n readFully(dst as Buffer, n)\n }\n\n private suspend fun readFully(dst: Buffer, n: Int) {\n require(n <= dst.writeRemaining) { \"Not enough space in the destination buffer to write $n bytes\" }\n require(n >= 0) { \"n shouldn't be negative\" }\n\n return when {\n closedCause != null -> throw closedCause!!\n readable.remaining >= n -> readable.readFully(dst, n).also { afterRead(n) }\n closed -> throw EOFException(\n \"Channel is closed and not enough bytes available: required $n but $availableForRead available\"\n )\n\n else -> readFullySuspend(dst, n)\n }\n }\n\n private suspend fun readFullySuspend(dst: Buffer, n: Int) {\n awaitSuspend(n)\n return readFully(dst, n)\n }\n\n override suspend fun readAvailable(dst: ByteArray, offset: Int, length: Int): Int {\n closedCause?.let { throw it }\n if (closed && availableForRead == 0) return -1\n\n if (length == 0) return 0\n\n if (availableForRead == 0) {\n awaitSuspend(1)\n }\n\n if (!readable.canRead()) {\n prepareFlushedBytes()\n }\n\n val size = minOf(length.toLong(), readable.remaining).toInt()\n readable.readFully(dst, offset, size)\n afterRead(size)\n return size\n }\n\n override suspend fun readFully(dst: ByteArray, offset: Int, length: Int) {\n val rc = readAvailable(dst, offset, length)\n if (rc == length) return\n if (rc == -1) throw EOFException(\"Unexpected end of stream\")\n\n return readFullySuspend(dst, offset + rc, length - rc)\n }\n\n private suspend fun readFullySuspend(dst: ByteArray, offset: Int, length: Int) {\n var written = 0\n\n while (written < length) {\n val rc = readAvailable(dst, offset + written, length - written)\n if (rc == -1) throw EOFException(\"Unexpected end of stream\")\n written += rc\n }\n }\n\n override suspend fun readBoolean(): Boolean {\n return if (readable.canRead()) (readable.readByte() == 1.toByte()).also { afterRead(1) }\n else readBooleanSlow()\n }\n\n private suspend fun readBooleanSlow(): Boolean {\n awaitSuspend(1)\n checkClosed(1)\n return readBoolean()\n }\n\n private fun completeReading() {\n val remaining = lastReadView.readRemaining\n val delta = lastReadAvailable - remaining\n if (lastReadView !== Buffer.Empty) {\n readable.completeReadHead(lastReadView)\n }\n if (delta > 0) {\n afterRead(delta)\n }\n lastReadAvailable = 0\n lastReadView = ChunkBuffer.Empty\n }\n\n override suspend fun await(atLeast: Int): Boolean {\n require(atLeast >= 0) { \"atLeast parameter shouldn't be negative: $atLeast\" }\n require(atLeast <= EXPECTED_CAPACITY) {\n \"atLeast parameter shouldn't be larger than max buffer size of $EXPECTED_CAPACITY: $atLeast\"\n }\n\n completeReading()\n\n if (atLeast == 0) return !isClosedForRead\n if (readable.remaining >= atLeast) return true\n\n return awaitSuspend(atLeast)\n }\n\n internal suspend fun awaitInternalAtLeast1(): Boolean = if (readable.isNotEmpty) {\n true\n } else {\n awaitSuspend(1)\n }\n\n protected suspend fun awaitSuspend(atLeast: Int): Boolean {\n require(atLeast >= 0)\n\n awaitAtLeastNBytesAvailableForRead(atLeast)\n prepareFlushedBytes()\n\n closedCause?.let { throw it }\n return !isClosedForRead && availableForRead >= atLeast\n }\n\n override fun discard(n: Int): Int {\n closedCause?.let { throw it }\n\n if (n == 0) {\n return 0\n }\n\n return readable.discard(n).also {\n afterRead(n)\n requestNextView(1)\n }\n }\n\n override fun request(atLeast: Int): ChunkBuffer? {\n closedCause?.let { throw it }\n\n completeReading()\n\n return requestNextView(atLeast)\n }\n\n private fun requestNextView(atLeast: Int): ChunkBuffer? {\n if (readable.isEmpty) {\n prepareFlushedBytes()\n }\n\n val view = readable.prepareReadHead(atLeast)\n\n if (view == null) {\n lastReadView = ChunkBuffer.Empty\n lastReadAvailable = 0\n } else {\n lastReadView = view\n lastReadAvailable = view.readRemaining\n }\n\n return view\n }\n\n override suspend fun discard(max: Long): Long {\n val discarded = readable.discard(max)\n afterRead(discarded.toInt())\n\n return if (discarded == max || isClosedForRead) {\n ensureNotFailed()\n return discarded\n } else {\n discardSuspend(max, discarded)\n }\n }\n\n private suspend fun discardSuspend(max: Long, discarded0: Long): Long {\n var discarded = discarded0\n\n do {\n if (!await(1)) break\n val count = readable.discard(max - discarded)\n afterRead(count.toInt())\n discarded += count\n } while (discarded < max && !isClosedForRead)\n\n ensureNotFailed()\n\n return discarded\n }\n\n @Suppress(\"DEPRECATION\")\n @Deprecated(\"Use read instead.\")\n override fun readSession(consumer: ReadSession.() -> Unit) {\n try {\n consumer(this)\n } finally {\n completeReading()\n }\n }\n\n override fun startReadSession(): SuspendableReadSession = this\n\n override fun endReadSession() {\n completeReading()\n }\n\n @Suppress(\"DEPRECATION\")\n @Deprecated(\"Use read instead.\")\n override suspend fun readSuspendableSession(consumer: suspend SuspendableReadSession.() -> Unit) {\n try {\n consumer(this)\n } finally {\n completeReading()\n }\n }\n\n override suspend fun readUTF8LineTo(out: A, limit: Int): Boolean {\n if (isClosedForRead) {\n val cause = closedCause\n if (cause != null) {\n throw cause\n }\n\n return false\n }\n\n return decodeUTF8LineLoopSuspend(out, limit, { size ->\n if (await(size)) readable\n else null\n }) { afterRead(it) }\n }\n\n override suspend fun readUTF8Line(limit: Int): String? {\n val builder = StringBuilder()\n if (!readUTF8LineTo(builder, limit)) {\n return null\n }\n\n return builder.toString()\n }\n\n override fun cancel(cause: Throwable?): Boolean {\n if (closedCause != null || closed) {\n return false\n }\n\n return close(cause ?: io.ktor.utils.io.CancellationException(\"Channel cancelled\"))\n }\n\n override fun close(cause: Throwable?): Boolean {\n val closeElement = if (cause == null) CLOSED_SUCCESS else CloseElement(cause)\n if (!_closed.compareAndSet(null, closeElement)) return false\n\n if (cause != null) {\n readable.release()\n writable.release()\n flushBuffer.release()\n } else {\n flush()\n }\n\n slot.cancel(cause)\n return true\n }\n\n internal fun transferTo(dst: ByteChannelSequentialBase, limit: Long): Long {\n val size = readable.remaining\n return if (size <= limit) {\n dst.writable.writePacket(readable)\n dst.afterWrite(size.toInt())\n afterRead(size.toInt())\n size\n } else {\n 0\n }\n }\n\n @Suppress(\"DEPRECATION\")\n private suspend fun writeAvailableSuspend(src: ChunkBuffer): Int {\n awaitAtLeastNBytesAvailableForWrite(1)\n return writeAvailable(src)\n }\n\n private suspend fun writeAvailableSuspend(src: ByteArray, offset: Int, length: Int): Int {\n awaitAtLeastNBytesAvailableForWrite(1)\n return writeAvailable(src, offset, length)\n }\n\n protected fun afterWrite(count: Int) {\n addBytesWritten(count)\n\n if (closed) {\n writable.release()\n ensureNotClosed()\n }\n if (autoFlush || availableForWrite == 0) {\n flush()\n }\n }\n\n override suspend fun awaitFreeSpace() {\n flush()\n awaitAtLeastNBytesAvailableForWrite(1)\n ensureNotClosed()\n }\n\n /**\n * Suspend until the channel has bytes to read or gets closed. Throws exception if the channel was closed with an error.\n */\n override suspend fun awaitContent() {\n await(1)\n }\n\n final override suspend fun peekTo(\n destination: Memory,\n destinationOffset: Long,\n offset: Long,\n min: Long,\n max: Long\n ): Long {\n var bytesCopied = 0L\n\n @Suppress(\"DEPRECATION\")\n readSuspendableSession {\n val desiredSize = (min + offset).coerceAtMost(EXPECTED_CAPACITY).toInt()\n\n await(desiredSize)\n\n val buffer = request(1) ?: ChunkBuffer.Empty\n if (buffer.readRemaining > offset) {\n bytesCopied = minOf(buffer.readRemaining.toLong() - offset, max, destination.size - destinationOffset)\n buffer.memory.copyTo(destination, offset, bytesCopied, destinationOffset)\n }\n }\n\n return bytesCopied\n }\n\n private fun addBytesRead(count: Int) {\n require(count >= 0) { \"Can't read negative amount of bytes: $count\" }\n\n channelSize.minusAssign(count)\n _totalBytesRead.addAndGet(count.toLong())\n _availableForRead.minusAssign(count)\n\n check(channelSize.value >= 0) { \"Readable bytes count is negative: $availableForRead, $count in $this\" }\n check(availableForRead >= 0) { \"Readable bytes count is negative: $availableForRead, $count in $this\" }\n }\n\n private fun addBytesWritten(count: Int) {\n require(count >= 0) { \"Can't write negative amount of bytes: $count\" }\n\n channelSize.plusAssign(count)\n _totalBytesWritten.addAndGet(count.toLong())\n\n check(channelSize.value >= 0) { \"Readable bytes count is negative: ${channelSize.value}, $count in $this\" }\n }\n}\n","package io.ktor.utils.io\n\nimport io.ktor.utils.io.bits.*\nimport io.ktor.utils.io.core.*\nimport io.ktor.utils.io.core.internal.*\n\n/**\n * Channel for asynchronous reading of sequences of bytes.\n * This is a **single-reader channel**.\n *\n * Operations on this channel cannot be invoked concurrently.\n */\npublic expect interface ByteReadChannel {\n /**\n * Returns number of bytes that can be read without suspension. Read operations do no suspend and return\n * immediately when this number is at least the number of bytes requested for read.\n */\n public val availableForRead: Int\n\n /**\n * Returns `true` if the channel is closed and no remaining bytes are available for read.\n * It implies that [availableForRead] is zero.\n */\n public val isClosedForRead: Boolean\n\n public val isClosedForWrite: Boolean\n\n /**\n * A closure causes exception or `null` if closed successfully or not yet closed\n */\n public val closedCause: Throwable?\n\n /**\n * Number of bytes read from the channel.\n * It is not guaranteed to be atomic so could be updated in the middle of long-running read operation.\n */\n public val totalBytesRead: Long\n\n /**\n * Reads all available bytes to [dst] buffer and returns immediately or suspends if no bytes available\n * @return number of bytes were read or `-1` if the channel has been closed\n */\n public suspend fun readAvailable(dst: ByteArray, offset: Int, length: Int): Int\n public suspend fun readAvailable(dst: ChunkBuffer): Int\n\n /**\n * Reads all [length] bytes to [dst] buffer or fails if channel has been closed.\n * Suspends if not enough bytes available.\n */\n public suspend fun readFully(dst: ByteArray, offset: Int, length: Int)\n public suspend fun readFully(dst: ChunkBuffer, n: Int)\n\n /**\n * Reads the specified amount of bytes and makes a byte packet from them. Fails if channel has been closed\n * and not enough bytes available.\n */\n public suspend fun readPacket(size: Int): ByteReadPacket\n\n /**\n * Reads up to [limit] bytes and makes a byte packet or until end of stream encountered.\n */\n public suspend fun readRemaining(limit: Long = Long.MAX_VALUE): ByteReadPacket\n\n /**\n * Reads a long number (suspending if not enough bytes available) or fails if channel has been closed\n * and not enough bytes.\n */\n public suspend fun readLong(): Long\n\n /**\n * Reads an int number (suspending if not enough bytes available) or fails if channel has been closed\n * and not enough bytes.\n */\n public suspend fun readInt(): Int\n\n /**\n * Reads a short number (suspending if not enough bytes available) or fails if channel has been closed\n * and not enough bytes.\n */\n public suspend fun readShort(): Short\n\n /**\n * Reads a byte (suspending if no bytes available yet) or fails if channel has been closed\n * and not enough bytes.\n */\n public suspend fun readByte(): Byte\n\n /**\n * Reads a boolean value (suspending if no bytes available yet) or fails if channel has been closed\n * and not enough bytes.\n */\n public suspend fun readBoolean(): Boolean\n\n /**\n * Reads double number (suspending if not enough bytes available) or fails if channel has been closed\n * and not enough bytes.\n */\n public suspend fun readDouble(): Double\n\n /**\n * Reads float number (suspending if not enough bytes available) or fails if channel has been closed\n * and not enough bytes.\n */\n public suspend fun readFloat(): Float\n\n /**\n * Starts non-suspendable read session. After channel preparation [consumer] lambda will be invoked immediately\n * event if there are no bytes available for read yet.\n */\n @Suppress(\"DEPRECATION\")\n @Deprecated(\"Use read { } instead.\")\n public fun readSession(consumer: ReadSession.() -> Unit)\n\n /**\n * Starts a suspendable read session. After channel preparation [consumer] lambda will be invoked immediately\n * even if there are no bytes available for read yet. [consumer] lambda could suspend as much as needed.\n */\n @Suppress(\"DEPRECATION\")\n @Deprecated(\"Use read { } instead.\")\n public suspend fun readSuspendableSession(consumer: suspend SuspendableReadSession.() -> Unit)\n\n /**\n * Reads a line of UTF-8 characters to the specified [out] buffer up to [limit] characters.\n * Supports both CR-LF and LF line endings. No line ending characters will be appended to [out] buffer.\n * Throws an exception if the specified [limit] has been exceeded.\n *\n * @return `true` if line has been read (possibly empty) or `false` if channel has been closed\n * and no characters were read.\n */\n public suspend fun readUTF8LineTo(out: A, limit: Int): Boolean\n\n /**\n * Reads a line of UTF-8 characters up to [limit] characters.\n * Supports both CR-LF and LF line endings.\n * Throws an exception if the specified [limit] has been exceeded.\n *\n * @return a line string with no line endings or `null` of channel has been closed\n * and no characters were read.\n */\n public suspend fun readUTF8Line(limit: Int): String?\n\n /**\n * Close channel with optional [cause] cancellation. Unlike [ByteWriteChannel.close] that could close channel\n * normally, cancel does always close with error so any operations on this channel will always fail\n * and all suspensions will be resumed with exception.\n *\n * Please note that if the channel has been provided by [reader] or [writer] then the corresponding owning\n * coroutine will be cancelled as well\n *\n * @see ByteWriteChannel.close\n */\n public fun cancel(cause: Throwable?): Boolean\n\n /**\n * Discard up to [max] bytes\n *\n * @return number of bytes were discarded\n */\n public suspend fun discard(max: Long): Long\n\n /**\n * Suspend until the channel has bytes to read or gets closed. Throws exception if the channel was closed with an error.\n */\n public suspend fun awaitContent()\n\n /**\n * Try to copy at least [min] but up to [max] bytes to the specified [destination] buffer from this input\n * skipping [offset] bytes. If there are not enough bytes available to provide [min] bytes after skipping [offset]\n * bytes then it will trigger the underlying source reading first and after that will\n * simply copy available bytes even if EOF encountered so [min] is not a requirement but a desired number of bytes.\n * It is safe to specify [max] greater than the destination free space.\n * `min` shouldn't be bigger than the [destination] free space.\n * This function could trigger the underlying source suspending reading.\n * It is allowed to specify too big [offset] so in this case this function will always return `0` after prefetching\n * all underlying bytes but note that it may lead to significant memory consumption.\n * This function usually copy more bytes than [min] (unless `max = min`) but it is not guaranteed.\n * When `0` is returned with `offset = 0` then it makes sense to check [isClosedForRead].\n *\n * @param destination to write bytes\n * @param offset to skip input\n * @param min bytes to be copied, shouldn't be greater than the buffer free space. Could be `0`.\n * @param max bytes to be copied even if there are more bytes buffered, could be [Int.MAX_VALUE].\n * @return number of bytes copied to the [destination] possibly `0`\n */\n public suspend fun peekTo(\n destination: Memory,\n destinationOffset: Long,\n offset: Long = 0,\n min: Long = 1,\n max: Long = Long.MAX_VALUE\n ): Long\n\n public companion object {\n public val Empty: ByteReadChannel\n }\n}\n\n/**\n * Reads all remaining bytes and makes a byte packet\n */\npublic suspend fun ByteReadChannel.readRemaining(): ByteReadPacket = readRemaining(Long.MAX_VALUE)\n\npublic suspend fun ByteReadChannel.readFully(dst: ChunkBuffer) {\n readFully(dst, dst.writeRemaining)\n}\n\npublic suspend fun ByteReadChannel.readUTF8LineTo(out: Appendable): Boolean {\n return readUTF8LineTo(out, Int.MAX_VALUE)\n}\n\npublic suspend fun ByteReadChannel.readUTF8Line(): String? {\n return readUTF8Line(Int.MAX_VALUE)\n}\n\npublic fun ByteReadChannel.cancel(): Boolean = cancel(null)\n\n/**\n * Discards all bytes in the channel and suspends until end of stream.\n */\npublic suspend fun ByteReadChannel.discard(): Long = discard(Long.MAX_VALUE)\n\n/**\n * Discards exactly [n] bytes or fails if not enough bytes in the channel\n */\npublic suspend inline fun ByteReadChannel.discardExact(n: Long) {\n if (discard(n) != n) throw EOFException(\"Unable to discard $n bytes\")\n}\n\npublic suspend fun ByteReadChannel.readAvailable(dst: ByteArray): Int = readAvailable(dst, 0, dst.size)\n\npublic suspend fun ByteReadChannel.readFully(dst: ByteArray): Unit = readFully(dst, 0, dst.size)\n\npublic expect suspend fun ByteReadChannel.joinTo(dst: ByteWriteChannel, closeOnEnd: Boolean)\n\n/**\n * Reads bytes from receiver channel and writes them to [dst] channel.\n * Closes [dst] channel if fails to read or write with cause exception.\n * @return a number of copied bytes\n */\npublic suspend fun ByteReadChannel.copyTo(dst: ByteWriteChannel): Long = copyTo(dst, limit = Long.MAX_VALUE)\n\n/**\n * Reads up to [limit] bytes from receiver channel and writes them to [dst] channel.\n * Closes [dst] channel if fails to read or write with cause exception.\n * @return a number of copied bytes\n */\npublic expect suspend fun ByteReadChannel.copyTo(dst: ByteWriteChannel, limit: Long): Long\n\n/**\n * Reads all the bytes from receiver channel and writes them to [dst] channel and then closes it.\n * Closes [dst] channel if fails to read or write with cause exception.\n * @return a number of copied bytes\n */\npublic suspend fun ByteReadChannel.copyAndClose(dst: ByteWriteChannel, limit: Long = Long.MAX_VALUE): Long {\n val count = copyTo(dst, limit)\n dst.close()\n return count\n}\n","package io.ktor.utils.io.charsets\n\nimport io.ktor.utils.io.core.*\nimport io.ktor.utils.io.core.internal.*\n\npublic expect abstract class Charset {\n public abstract fun newEncoder(): CharsetEncoder\n\n public abstract fun newDecoder(): CharsetDecoder\n\n public companion object {\n public fun forName(name: String): Charset\n public fun isSupported(charset: String): Boolean\n }\n}\n\npublic expect val Charset.name: String\n\n// ----------------------------- ENCODER -------------------------------------------------------------------------------\npublic expect abstract class CharsetEncoder\n\npublic expect val CharsetEncoder.charset: Charset\n\n@Deprecated(\n \"Use writeText on Output instead.\",\n level = DeprecationLevel.ERROR,\n replaceWith = ReplaceWith(\n \"dst.writeText(input, fromIndex, toIndex, charset)\",\n \"io.ktor.utils.io.core.writeText\"\n )\n)\npublic fun CharsetEncoder.encode(input: CharSequence, fromIndex: Int, toIndex: Int, dst: Output) {\n encodeToImpl(dst, input, fromIndex, toIndex)\n}\n\npublic expect fun CharsetEncoder.encodeToByteArray(\n input: CharSequence,\n fromIndex: Int = 0,\n toIndex: Int = input.length\n): ByteArray\n\n@Deprecated(\n \"Internal API. Will be hidden in future releases. Use encodeToByteArray instead.\",\n level = DeprecationLevel.ERROR,\n replaceWith = ReplaceWith(\"encodeToByteArray(input, fromIndex, toIndex)\")\n)\npublic fun CharsetEncoder.encodeToByteArrayImpl(\n input: CharSequence,\n fromIndex: Int = 0,\n toIndex: Int = input.length\n): ByteArray {\n return encodeToByteArray(input, fromIndex, toIndex)\n}\n\npublic expect fun CharsetEncoder.encodeUTF8(input: ByteReadPacket, dst: Output)\n\npublic fun CharsetEncoder.encode(\n input: CharSequence,\n fromIndex: Int = 0,\n toIndex: Int = input.length\n): ByteReadPacket = buildPacket {\n encodeToImpl(this, input, fromIndex, toIndex)\n}\n\npublic fun CharsetEncoder.encodeUTF8(input: ByteReadPacket): ByteReadPacket = buildPacket {\n encodeUTF8(input, this)\n}\n\npublic fun CharsetEncoder.encode(input: CharArray, fromIndex: Int, toIndex: Int, dst: Output) {\n var start = fromIndex\n\n if (start >= toIndex) return\n dst.writeWhileSize(1) { view: Buffer ->\n val rc = encodeArrayImpl(input, start, toIndex, view)\n check(rc >= 0)\n start += rc\n\n when {\n start >= toIndex -> 0\n rc == 0 -> 8\n else -> 1\n }\n }\n\n encodeCompleteImpl(dst)\n}\n\n// ----------------------------- DECODER -------------------------------------------------------------------------------\n\npublic expect abstract class CharsetDecoder\n\n/**\n * Decoder's charset it is created for.\n */\npublic expect val CharsetDecoder.charset: Charset\n\npublic fun CharsetDecoder.decode(input: Input, max: Int = Int.MAX_VALUE): String =\n buildString(minOf(max.toLong(), input.sizeEstimate()).toInt()) {\n decode(input, this, max)\n }\n\npublic expect fun CharsetDecoder.decode(input: Input, dst: Appendable, max: Int): Int\n\npublic expect fun CharsetDecoder.decodeExactBytes(input: Input, inputLength: Int): String\n\n// ----------------------------- REGISTRY ------------------------------------------------------------------------------\npublic expect object Charsets {\n public val UTF_8: Charset\n public val ISO_8859_1: Charset\n}\n\npublic expect open class MalformedInputException(message: String) : Throwable\n\npublic class TooLongLineException(message: String) : MalformedInputException(message)\n\n// ----------------------------- INTERNALS -----------------------------------------------------------------------------\n\ninternal fun CharsetEncoder.encodeArrayImpl(input: CharArray, fromIndex: Int, toIndex: Int, dst: Buffer): Int {\n val length = toIndex - fromIndex\n return encodeImpl(CharArraySequence(input, fromIndex, length), 0, length, dst)\n}\n\ninternal expect fun CharsetEncoder.encodeImpl(input: CharSequence, fromIndex: Int, toIndex: Int, dst: Buffer): Int\n\ninternal expect fun CharsetEncoder.encodeComplete(dst: Buffer): Boolean\n\ninternal expect fun CharsetDecoder.decodeBuffer(\n input: Buffer,\n out: Appendable,\n lastBuffer: Boolean,\n max: Int = Int.MAX_VALUE\n): Int\n\ninternal fun CharsetEncoder.encodeToByteArrayImpl1(\n input: CharSequence,\n fromIndex: Int = 0,\n toIndex: Int = input.length\n): ByteArray {\n var start = fromIndex\n if (start >= toIndex) return EmptyByteArray\n val single = ChunkBuffer.Pool.borrow()\n\n try {\n val rc = encodeImpl(input, start, toIndex, single)\n start += rc\n if (start == toIndex) {\n val result = ByteArray(single.readRemaining)\n single.readFully(result)\n return result\n }\n\n return buildPacket {\n appendSingleChunk(single.duplicate())\n encodeToImpl(this, input, start, toIndex)\n }.readBytes()\n } finally {\n single.release(ChunkBuffer.Pool)\n }\n}\n\ninternal fun Input.sizeEstimate(): Long = when (this) {\n is ByteReadPacket -> remaining\n else -> maxOf(remaining, 16)\n}\n\nprivate fun CharsetEncoder.encodeCompleteImpl(dst: Output): Int {\n var size = 1\n var bytesWritten = 0\n\n dst.writeWhile { view ->\n val before = view.writeRemaining\n if (encodeComplete(view)) {\n size = 0\n } else {\n size++\n }\n bytesWritten += before - view.writeRemaining\n size > 0\n }\n\n return bytesWritten\n}\n\ninternal fun CharsetEncoder.encodeToImpl(\n destination: Output,\n input: CharSequence,\n fromIndex: Int,\n toIndex: Int\n): Int {\n var start = fromIndex\n if (start >= toIndex) return 0\n\n var bytesWritten = 0\n\n destination.writeWhileSize(1) { view: Buffer ->\n val before = view.writeRemaining\n val rc = encodeImpl(input, start, toIndex, view)\n check(rc >= 0)\n start += rc\n bytesWritten += before - view.writeRemaining\n\n when {\n start >= toIndex -> 0\n rc == 0 -> 8\n else -> 1\n }\n }\n\n bytesWritten += encodeCompleteImpl(destination)\n return bytesWritten\n}\n","@file:Suppress(\"NOTHING_TO_INLINE\")\n\npackage io.ktor.utils.io.bits\n\nimport io.ktor.utils.io.core.internal.*\n\npublic actual inline fun Memory.loadShortAt(offset: Int): Short = view.getInt16(offset, false)\n\npublic actual inline fun Memory.loadShortAt(offset: Long): Short = loadShortAt(offset.toIntOrFail(\"offset\"))\n\npublic actual inline fun Memory.loadIntAt(offset: Int): Int = view.getInt32(offset, false)\n\npublic actual inline fun Memory.loadIntAt(offset: Long): Int = loadIntAt(offset.toIntOrFail(\"offset\"))\n\npublic actual inline fun Memory.loadLongAt(offset: Int): Long =\n (view.getUint32(offset, false).toLong() shl 32) or\n view.getUint32(offset + 4, false).toLong()\n\npublic actual inline fun Memory.loadLongAt(offset: Long): Long = loadLongAt(offset.toIntOrFail(\"offset\"))\n\npublic actual inline fun Memory.loadFloatAt(offset: Int): Float = view.getFloat32(offset, false)\n\npublic actual inline fun Memory.loadFloatAt(offset: Long): Float = loadFloatAt(offset.toIntOrFail(\"offset\"))\n\npublic actual inline fun Memory.loadDoubleAt(offset: Int): Double = view.getFloat64(offset, false)\n\npublic actual inline fun Memory.loadDoubleAt(offset: Long): Double = loadDoubleAt(offset.toIntOrFail(\"offset\"))\n\n/**\n * Write regular signed 32bit integer in the network byte order (Big Endian)\n */\npublic actual inline fun Memory.storeIntAt(offset: Int, value: Int) {\n view.setInt32(offset, value, littleEndian = false)\n}\n\n/**\n * Write regular signed 32bit integer in the network byte order (Big Endian)\n */\npublic actual inline fun Memory.storeIntAt(offset: Long, value: Int) {\n view.setInt32(offset.toIntOrFail(\"offset\"), value, littleEndian = false)\n}\n\n/**\n * Write short signed 16bit integer in the network byte order (Big Endian)\n */\npublic actual inline fun Memory.storeShortAt(offset: Int, value: Short) {\n view.setInt16(offset, value, littleEndian = false)\n}\n\n/**\n * Write short signed 16bit integer in the network byte order (Big Endian)\n */\npublic actual inline fun Memory.storeShortAt(offset: Long, value: Short) {\n view.setInt16(offset.toIntOrFail(\"offset\"), value, littleEndian = false)\n}\n\n/**\n * Write short signed 64bit integer in the network byte order (Big Endian)\n */\npublic actual inline fun Memory.storeLongAt(offset: Int, value: Long) {\n view.setInt32(offset, (value shr 32).toInt(), littleEndian = false)\n view.setInt32(offset + 4, (value and 0xffffffffL).toInt(), littleEndian = false)\n}\n\n/**\n * Write short signed 64bit integer in the network byte order (Big Endian)\n */\npublic actual inline fun Memory.storeLongAt(offset: Long, value: Long) {\n storeLongAt(offset.toIntOrFail(\"offset\"), value)\n}\n\n/**\n * Write short signed 32bit floating point number in the network byte order (Big Endian)\n */\npublic actual inline fun Memory.storeFloatAt(offset: Int, value: Float) {\n view.setFloat32(offset, value, littleEndian = false)\n}\n\n/**\n * Write short signed 32bit floating point number in the network byte order (Big Endian)\n */\npublic actual inline fun Memory.storeFloatAt(offset: Long, value: Float) {\n view.setFloat32(offset.toIntOrFail(\"offset\"), value, littleEndian = false)\n}\n\n/**\n * Write short signed 64bit floating point number in the network byte order (Big Endian)\n */\npublic actual inline fun Memory.storeDoubleAt(offset: Int, value: Double) {\n view.setFloat64(offset, value, littleEndian = false)\n}\n\n/**\n * Write short signed 64bit floating point number in the network byte order (Big Endian)\n */\npublic actual inline fun Memory.storeDoubleAt(offset: Long, value: Double) {\n view.setFloat64(offset.toIntOrFail(\"offset\"), value, littleEndian = false)\n}\n","package io.ktor.utils.io.core\n\nimport io.ktor.utils.io.bits.*\nimport io.ktor.utils.io.core.internal.*\nimport io.ktor.utils.io.pool.*\n\n/**\n * Usually shouldn't be implemented directly. Inherit [Input] instead.\n */\npublic abstract class Input(\n head: ChunkBuffer = ChunkBuffer.Empty,\n remaining: Long = head.remainingAll(),\n public val pool: ObjectPool = ChunkBuffer.Pool\n) : Closeable {\n\n /**\n * It is `true` when it is known that no more bytes will be available. When it is `false` then this means that\n * it is not known yet or there are available bytes.\n * Please note that `false` value doesn't guarantee that there are available bytes so `readByte()` may fail.\n */\n public val endOfInput: Boolean\n get() = headRemaining == 0 && tailRemaining == 0L && (noMoreChunksAvailable || doFill() == null)\n\n /**\n * Read the next bytes into the [destination] starting at [offset] at most [length] bytes.\n * May block until at least one byte is available.\n * Usually bypass all exceptions from the underlying source.\n *\n * @param offset in bytes where result should be written\n * @param length should be at least one byte\n *\n * @return number of bytes were copied or `0` if EOF encountered\n */\n protected abstract fun fill(destination: Memory, offset: Int, length: Int): Int\n\n /**\n * Should close the underlying bytes source. Could do nothing or throw exceptions.\n */\n protected abstract fun closeSource()\n\n /**\n * Current head chunk reference\n */\n private var _head: ChunkBuffer = head\n set(newHead) {\n field = newHead\n headMemory = newHead.memory\n headPosition = newHead.readPosition\n headEndExclusive = newHead.writePosition\n }\n\n @PublishedApi\n internal val head: ChunkBuffer\n get() = _head.also { it.discardUntilIndex(headPosition) }\n\n @PublishedApi\n internal var headMemory: Memory = head.memory\n\n @PublishedApi\n internal var headPosition: Int = head.readPosition\n\n @PublishedApi\n internal var headEndExclusive: Int = head.writePosition\n\n @PublishedApi\n internal var tailRemaining: Long = remaining - (headEndExclusive - headPosition)\n set(newValue) {\n require(newValue >= 0) { \"tailRemaining shouldn't be negative: $newValue\" }\n field = newValue\n }\n\n @PublishedApi\n internal val headRemaining: Int\n inline get() = headEndExclusive - headPosition\n\n internal fun prefetch(min: Long): Boolean {\n if (min <= 0) return true\n val headRemaining = headRemaining\n if (headRemaining >= min || headRemaining + tailRemaining >= min) return true\n\n return doPrefetch(min)\n }\n\n /**\n * Try to copy at least [min] but up to [max] bytes to the specified [destination] buffer from this input\n * skipping [offset] bytes. If there are not enough bytes available to provide [min] bytes after skipping [offset]\n * bytes then it will trigger the underlying source reading first and after that will\n * simply copy available bytes even if EOF encountered so [min] is not a requirement but a desired number of bytes.\n * It is safe to specify [max] greater than the destination free space.\n * `min` shouldn't be bigger than the [destination] free space.\n * This function could trigger the underlying source reading that may lead to blocking I/O.\n * It is allowed to specify too big [offset] so in this case this function will always return `0` after prefetching\n * all underlying bytes but note that it may lead to significant memory consumption.\n * This function usually copy more bytes than [min] (unless `max = min`) but it is not guaranteed.\n * When `0` is returned with `offset = 0` then it makes sense to check [endOfInput].\n *\n * @param destination to write bytes\n * @param offset to skip input\n * @param min bytes to be copied, shouldn't be greater than the buffer free space. Could be `0`.\n * @param max bytes to be copied even if there are more bytes buffered, could be [Int.MAX_VALUE].\n * @return number of bytes copied to the [destination] possibly `0`\n */\n public fun peekTo(\n destination: Memory,\n destinationOffset: Long,\n offset: Long = 0,\n min: Long = 1,\n max: Long = Long.MAX_VALUE\n ): Long {\n prefetch(min + offset)\n\n var current: ChunkBuffer = head\n var copied = 0L\n var skip = offset\n var writePosition = destinationOffset\n val maxCopySize = minOf(max, destination.size - destinationOffset)\n\n while (copied < min && copied < maxCopySize) {\n val chunkSize = current.readRemaining\n if (chunkSize > skip) {\n val size = minOf(chunkSize - skip, maxCopySize - copied)\n current.memory.copyTo(\n destination,\n current.readPosition + skip,\n size,\n writePosition\n )\n skip = 0\n copied += size\n writePosition += size\n } else {\n skip -= chunkSize\n }\n\n current = current.next ?: break\n }\n\n return copied\n }\n\n /**\n * @see doFill for similar logic\n * @see appendView for similar logic\n */\n private fun doPrefetch(min: Long): Boolean {\n var tail = _head.findTail()\n var available = headRemaining + tailRemaining\n\n do {\n val next = fill()\n if (next == null) {\n noMoreChunksAvailable = true\n return false\n }\n\n val chunkSize = next.readRemaining\n if (tail === ChunkBuffer.Empty) {\n _head = next\n tail = next\n } else {\n tail.next = next\n tailRemaining += chunkSize\n }\n\n available += chunkSize\n } while (available < min)\n\n return true\n }\n\n /**\n * Number of bytes available for read\n */\n public val remaining: Long get() = headRemaining.toLong() + tailRemaining\n\n /**\n * @return `true` if there is at least one byte to read\n */\n public fun canRead(): Boolean = headPosition != headEndExclusive || tailRemaining != 0L\n\n /**\n * @return `true` if there are at least [n] bytes to read\n */\n public fun hasBytes(n: Int): Boolean = headRemaining + tailRemaining >= n\n\n private var noMoreChunksAvailable = false\n\n /**\n * Release packet. After this function invocation the packet becomes empty.\n * If it has been copied via [ByteReadPacket.copy]\n * then the copy should be released as well.\n */\n public fun release() {\n val head = head\n val empty = ChunkBuffer.Empty\n\n if (head !== empty) {\n this._head = empty\n tailRemaining = 0\n head.releaseAll(pool)\n }\n }\n\n /**\n * Close input including the underlying source. All pending bytes will be discarded.\n * It is not recommended to invoke it with read operations in-progress concurrently.\n */\n override fun close() {\n release()\n if (!noMoreChunksAvailable) {\n noMoreChunksAvailable = true\n }\n closeSource()\n }\n\n internal fun stealAll(): ChunkBuffer? {\n val head = head\n val empty = ChunkBuffer.Empty\n\n if (head === empty) return null\n this._head = empty\n tailRemaining = 0\n return head\n }\n\n internal fun steal(): ChunkBuffer? {\n val head = head\n val next = head.next\n val empty = ChunkBuffer.Empty\n if (head === empty) return null\n\n if (next == null) {\n this._head = empty\n this.tailRemaining = 0\n } else {\n this._head = next\n this.tailRemaining -= next.readRemaining\n }\n\n head.next = null\n return head\n }\n\n internal fun append(chain: ChunkBuffer) {\n if (chain === ChunkBuffer.Empty) return\n\n val size = chain.remainingAll()\n if (_head === ChunkBuffer.Empty) {\n _head = chain\n tailRemaining = size - headRemaining\n } else {\n _head.findTail().next = chain\n tailRemaining += size\n }\n }\n\n internal fun tryWriteAppend(chain: ChunkBuffer): Boolean {\n val tail = head.findTail()\n val size = chain.readRemaining\n\n if (size == 0 || tail.writeRemaining < size) return false\n tail.writeBufferAppend(chain, size)\n\n if (head === tail) {\n headEndExclusive = tail.writePosition\n } else {\n tailRemaining += size\n }\n\n return true\n }\n\n /**\n * Read the next upcoming byte\n * @throws EOFException if no more bytes available.\n */\n public fun readByte(): Byte {\n val index = headPosition\n val nextIndex = index + 1\n if (nextIndex < headEndExclusive) {\n // fast-path when we are not reading the last byte\n headPosition = nextIndex\n return headMemory[index]\n }\n\n return readByteSlow()\n }\n\n private fun readByteSlow(): Byte {\n val index = headPosition\n if (index < headEndExclusive) {\n val value = headMemory[index]\n headPosition = index\n val head = _head\n head.discardUntilIndex(index)\n ensureNext(head)\n return value\n }\n\n val head = prepareRead(1) ?: prematureEndOfStream(1)\n val byte = head.readByte()\n completeReadHead(head)\n return byte\n }\n\n /**\n * Discards at most [n] bytes\n * @return number of bytes has been discarded\n */\n public fun discard(n: Int): Int {\n require(n >= 0) { \"Negative discard is not allowed: $n\" }\n return discardAsMuchAsPossible(n, 0)\n }\n\n /**\n * Discards exactly [n] bytes or fails with [EOFException]\n */\n public fun discardExact(n: Int) {\n if (discard(n) != n) throw EOFException(\"Unable to discard $n bytes due to end of packet\")\n }\n\n /**\n * Returns next byte (unsigned) or `-1` if no more bytes available\n */\n public fun tryPeek(): Int {\n val head = head\n if (headRemaining > 0) {\n return head.tryPeekByte()\n }\n\n if (tailRemaining == 0L && noMoreChunksAvailable) return -1\n\n return prepareReadLoop(1, head)?.tryPeekByte() ?: -1\n }\n\n public fun peekTo(buffer: ChunkBuffer): Int {\n val head = prepareReadHead(1) ?: return -1\n\n val size = minOf(buffer.writeRemaining, head.readRemaining)\n (buffer as Buffer).writeFully(head, size)\n\n return size\n }\n\n /**\n * Discard at most [n] bytes\n */\n public fun discard(n: Long): Long {\n if (n <= 0) return 0L\n return discardAsMuchAsPossible(n, 0)\n }\n\n internal fun readAvailableCharacters(destination: CharArray, off: Int, len: Int): Int {\n if (endOfInput) return -1\n\n val out = object : Appendable {\n private var idx = off\n\n override fun append(value: Char): Appendable {\n destination[idx++] = value\n return this\n }\n\n override fun append(value: CharSequence?): Appendable {\n if (value is String) {\n value.getCharsInternal(destination, idx)\n idx += value.length\n } else if (value != null) {\n for (i in 0 until value.length) {\n destination[idx++] = value[i]\n }\n }\n\n return this\n }\n\n override fun append(value: CharSequence?, startIndex: Int, endIndex: Int): Appendable {\n throw UnsupportedOperationException()\n }\n }\n\n return readText(out, 0, len)\n }\n\n /**\n * Read at least [min] and at most [max] characters and append them to [out]\n * @return number of characters appended\n */\n public fun readText(out: Appendable, min: Int = 0, max: Int = Int.MAX_VALUE): Int {\n if (max.toLong() >= remaining) {\n val s = readTextExactBytes(bytesCount = remaining.toInt())\n out.append(s)\n return s.length\n }\n return readASCII(out, min, max)\n }\n\n /**\n * Read exactly [exactCharacters] characters and append them to [out]\n */\n public fun readTextExact(out: Appendable, exactCharacters: Int) {\n readText(out, exactCharacters, exactCharacters)\n }\n\n /**\n * Read a string at last [min] and at most [max] characters length\n */\n public fun readText(min: Int = 0, max: Int = Int.MAX_VALUE): String {\n if (min == 0 && (max == 0 || endOfInput)) return \"\"\n val remaining = remaining\n if (remaining > 0 && max.toLong() >= remaining) return readTextExactBytes(bytesCount = remaining.toInt())\n\n return buildString(min.coerceAtLeast(16).coerceAtMost(max)) {\n readASCII(this, min, max)\n }\n }\n\n /**\n * Read a string exactly [exactCharacters] length\n */\n public fun readTextExact(exactCharacters: Int): String {\n return readText(exactCharacters, exactCharacters)\n }\n\n private fun readASCII(out: Appendable, min: Int, max: Int): Int {\n when {\n max == 0 && min == 0 -> return 0\n endOfInput -> if (min == 0) return 0 else atLeastMinCharactersRequire(min)\n max < min -> minShouldBeLess(min, max)\n }\n\n var copied = 0\n var utf8 = false\n\n takeWhile { buffer ->\n val rc = buffer.decodeASCII {\n if (copied == max) false\n else {\n out.append(it)\n copied++\n true\n }\n }\n\n when {\n rc -> true\n copied == max -> false\n else -> {\n utf8 = true\n false\n }\n }\n }\n\n if (utf8) {\n return copied + readUtf8(out, min - copied, max - copied)\n }\n if (copied < min) prematureEndOfStreamChars(min, copied)\n return copied\n }\n\n private fun atLeastMinCharactersRequire(min: Int): Nothing =\n throw EOFException(\"at least $min characters required but no bytes available\")\n\n private fun minShouldBeLess(min: Int, max: Int): Nothing =\n throw IllegalArgumentException(\"min should be less or equal to max but min = $min, max = $max\")\n\n private fun prematureEndOfStreamChars(min: Int, copied: Int): Nothing = throw MalformedUTF8InputException(\n \"Premature end of stream: expected at least $min chars but had only $copied\"\n )\n\n private fun readUtf8(out: Appendable, min: Int, max: Int): Int {\n var copied = 0\n\n takeWhileSize { buffer ->\n val size = buffer.decodeUTF8 {\n if (copied == max) false\n else {\n out.append(it)\n copied++\n true\n }\n }\n\n when {\n size == 0 -> 1\n size > 0 -> size\n else -> 0\n }\n }\n\n if (copied < min) prematureEndOfStreamChars(min, copied)\n\n return copied\n }\n\n private tailrec fun discardAsMuchAsPossible(n: Long, skipped: Long): Long {\n if (n == 0L) return skipped\n val current = prepareRead(1) ?: return skipped\n val size = minOf(current.readRemaining.toLong(), n).toInt()\n current.discardExact(size)\n headPosition += size\n afterRead(current)\n\n return discardAsMuchAsPossible(n - size, skipped + size)\n }\n\n private fun discardAsMuchAsPossible(n: Int, skipped: Int): Int {\n var currentCount = n\n var currentSkipped = skipped\n\n while (true) {\n if (currentCount == 0) {\n return currentSkipped\n }\n\n val current = prepareRead(1) ?: return currentSkipped\n\n val size = minOf(current.readRemaining, currentCount)\n current.discardExact(size)\n headPosition += size\n afterRead(current)\n\n currentCount -= size\n currentSkipped += size\n }\n }\n\n private tailrec fun readAsMuchAsPossible(array: ByteArray, offset: Int, length: Int, copied: Int): Int {\n if (length == 0) return copied\n val current = prepareRead(1) ?: return copied\n val size = minOf(length, current.readRemaining)\n\n current.readFully(array, offset, size)\n headPosition = current.readPosition\n\n return if (size != length || current.readRemaining == 0) {\n afterRead(current)\n readAsMuchAsPossible(array, offset + size, length - size, copied + size)\n } else {\n copied + size\n }\n }\n\n private fun notEnoughBytesAvailable(n: Int): Nothing {\n throw EOFException(\"Not enough data in packet ($remaining) to read $n byte(s)\")\n }\n\n internal fun prepareReadHead(minSize: Int): ChunkBuffer? = prepareReadLoop(minSize, head)\n\n internal fun ensureNextHead(current: ChunkBuffer): ChunkBuffer? = ensureNext(current)\n\n @PublishedApi\n internal fun ensureNext(current: ChunkBuffer): ChunkBuffer? = ensureNext(\n current,\n ChunkBuffer.Empty\n )\n\n internal fun fixGapAfterRead(current: ChunkBuffer) {\n val next = current.next ?: return fixGapAfterReadFallback(current)\n\n val remaining = current.readRemaining\n val overrunSize = minOf(remaining, Buffer.ReservedSize - current.endGap)\n if (next.startGap < overrunSize) {\n return fixGapAfterReadFallback(current)\n }\n\n next.restoreStartGap(overrunSize)\n\n if (remaining > overrunSize) {\n current.releaseEndGap()\n\n this.headEndExclusive = current.writePosition\n this.tailRemaining += overrunSize\n } else {\n this._head = next\n this.tailRemaining -= next.readRemaining - overrunSize\n current.cleanNext()\n current.release(pool)\n }\n }\n\n private fun fixGapAfterReadFallback(current: ChunkBuffer) {\n if (noMoreChunksAvailable && current.next == null) {\n this.headPosition = current.readPosition\n this.headEndExclusive = current.writePosition\n this.tailRemaining = 0\n return\n }\n\n val size = current.readRemaining\n val overrun = minOf(size, Buffer.ReservedSize - current.endGap)\n\n if (size > overrun) {\n fixGapAfterReadFallbackUnreserved(current, size, overrun)\n } else {\n val new = pool.borrow()\n new.reserveEndGap(Buffer.ReservedSize)\n new.next = current.cleanNext()\n\n new.writeBufferAppend(current, size)\n this._head = new\n }\n\n current.release(pool)\n }\n\n private fun fixGapAfterReadFallbackUnreserved(current: ChunkBuffer, size: Int, overrun: Int) {\n // if we have a chunk with no end reservation\n // we can split it into two to fix it\n\n val chunk1 = pool.borrow()\n val chunk2 = pool.borrow()\n\n chunk1.reserveEndGap(Buffer.ReservedSize)\n chunk2.reserveEndGap(Buffer.ReservedSize)\n chunk1.next = chunk2\n chunk2.next = current.cleanNext()\n\n chunk1.writeBufferAppend(current, size - overrun)\n chunk2.writeBufferAppend(current, overrun)\n\n this._head = chunk1\n this.tailRemaining = chunk2.remainingAll()\n }\n\n private tailrec fun ensureNext(current: ChunkBuffer, empty: ChunkBuffer): ChunkBuffer? {\n if (current === empty) {\n return doFill()\n }\n\n val next = current.cleanNext()\n current.release(pool)\n\n return when {\n next == null -> {\n this._head = empty\n this.tailRemaining = 0L\n ensureNext(empty, empty)\n }\n next.canRead() -> {\n _head = next\n tailRemaining -= next.readRemaining\n next\n }\n else -> ensureNext(next, empty)\n }\n }\n\n /**\n * Reads the next chunk suitable for reading or `null` if no more chunks available. It is also allowed\n * to return a chain of chunks linked through [ChunkBuffer.next]. The last chunk should have `null` next reference.\n * Could rethrow exceptions from the underlying source.\n */\n protected open fun fill(): ChunkBuffer? {\n val buffer = pool.borrow()\n try {\n buffer.reserveEndGap(Buffer.ReservedSize)\n val copied = fill(buffer.memory, buffer.writePosition, buffer.writeRemaining)\n\n if (copied == 0) {\n noMoreChunksAvailable = true\n\n if (!buffer.canRead()) {\n buffer.release(pool)\n return null\n }\n }\n\n buffer.commitWritten(copied)\n\n return buffer\n } catch (t: Throwable) {\n buffer.release(pool)\n throw t\n }\n }\n\n protected fun markNoMoreChunksAvailable() {\n if (!noMoreChunksAvailable) {\n noMoreChunksAvailable = true\n }\n }\n\n /**\n * see [prefetch] for similar logic\n */\n private fun doFill(): ChunkBuffer? {\n if (noMoreChunksAvailable) return null\n val chunk = fill()\n if (chunk == null) {\n noMoreChunksAvailable = true\n return null\n }\n appendView(chunk)\n return chunk\n }\n\n private fun appendView(chunk: ChunkBuffer) {\n val tail = _head.findTail()\n if (tail === ChunkBuffer.Empty) {\n _head = chunk\n require(tailRemaining == 0L) {\n throw IllegalStateException(\"It should be no tail remaining bytes if current tail is EmptyBuffer\")\n }\n tailRemaining = chunk.next?.remainingAll() ?: 0L\n } else {\n tail.next = chunk\n tailRemaining += chunk.remainingAll()\n }\n }\n\n @PublishedApi\n internal fun prepareRead(minSize: Int): ChunkBuffer? {\n val head = head\n if (headEndExclusive - headPosition >= minSize) return head\n return prepareReadLoop(minSize, head)\n }\n\n @PublishedApi\n internal fun prepareRead(minSize: Int, head: ChunkBuffer): ChunkBuffer? {\n if (headEndExclusive - headPosition >= minSize) return head\n return prepareReadLoop(minSize, head)\n }\n\n private tailrec fun prepareReadLoop(minSize: Int, head: ChunkBuffer): ChunkBuffer? {\n val headSize = headRemaining\n if (headSize >= minSize) return head\n\n val next = head.next ?: doFill() ?: return null\n\n if (headSize == 0) {\n if (head !== ChunkBuffer.Empty) {\n releaseHead(head)\n }\n\n return prepareReadLoop(minSize, next)\n } else {\n val desiredExtraBytes = minSize - headSize\n val copied = head.writeBufferAppend(next, desiredExtraBytes)\n headEndExclusive = head.writePosition\n tailRemaining -= copied\n if (!next.canRead()) {\n head.next = null\n head.next = next.cleanNext()\n next.release(pool)\n } else {\n next.reserveStartGap(copied)\n }\n }\n\n if (head.readRemaining >= minSize) return head\n if (minSize > Buffer.ReservedSize) minSizeIsTooBig(minSize)\n\n return prepareReadLoop(minSize, head)\n }\n\n private fun minSizeIsTooBig(minSize: Int): Nothing {\n throw IllegalStateException(\"minSize of $minSize is too big (should be less than ${Buffer.ReservedSize})\")\n }\n\n private fun afterRead(head: ChunkBuffer) {\n if (head.readRemaining == 0) {\n releaseHead(head)\n }\n }\n\n internal fun releaseHead(head: ChunkBuffer): ChunkBuffer {\n val next = head.cleanNext() ?: ChunkBuffer.Empty\n this._head = next\n this.tailRemaining -= next.readRemaining\n head.release(pool)\n\n return next\n }\n\n public companion object\n}\n\n/**\n * Discard all remaining bytes.\n * @return number of bytes were discarded\n */\npublic fun Input.discard(): Long {\n return discard(Long.MAX_VALUE)\n}\n\n/**\n * Discard exactly [n] bytes or fail if not enough bytes in the input to be discarded.\n */\npublic fun Input.discardExact(n: Long) {\n val discarded = discard(n)\n if (discarded != n) {\n throw IllegalStateException(\"Only $discarded bytes were discarded of $n requested\")\n }\n}\n\n/**\n * Discard exactly [n] bytes or fail if not enough bytes in the input to be discarded.\n */\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\npublic fun Input.discardExact(n: Int) {\n discardExact(n.toLong())\n}\n\n/**\n * Invoke [block] function for every chunk until end of input or [block] function return `false`\n * [block] function returns `true` to request more chunks or `false` to stop loop\n *\n * It is not guaranteed that every chunk will have fixed size but it will be never empty.\n * [block] function should never release provided buffer and should not write to it otherwise an undefined behaviour\n * could be observed\n */\npublic inline fun Input.takeWhile(block: (Buffer) -> Boolean) {\n var release = true\n var current = prepareReadFirstHead(1) ?: return\n\n try {\n do {\n if (!block(current)) {\n break\n }\n release = false\n val next = prepareReadNextHead(current) ?: break\n current = next\n release = true\n } while (true)\n } finally {\n if (release) {\n completeReadHead(current)\n }\n }\n}\n\n/**\n * Invoke [block] function for every chunk until end of input or [block] function return zero\n * [block] function returns number of bytes required to read next primitive and shouldn't require too many bytes at once\n * otherwise it could fail with an exception.\n * It is not guaranteed that every chunk will have fixed size but it will be always at least requested bytes length.\n * [block] function should never release provided buffer and should not write to it otherwise an undefined behaviour\n * could be observed\n */\ninternal inline fun Input.takeWhileSize(initialSize: Int = 1, block: (Buffer) -> Int) {\n var release = true\n var current = prepareReadFirstHead(initialSize) ?: return\n var size = initialSize\n\n try {\n do {\n val before = current.readRemaining\n val after: Int\n\n if (before >= size) {\n try {\n size = block(current)\n } finally {\n after = current.readRemaining\n }\n } else {\n after = before\n }\n\n release = false\n\n val next = when {\n after == 0 -> prepareReadNextHead(current)\n after < size || current.endGap < Buffer.ReservedSize -> {\n completeReadHead(current)\n prepareReadFirstHead(size)\n }\n else -> current\n } ?: break\n\n current = next\n release = true\n } while (size > 0)\n } finally {\n if (release) {\n completeReadHead(current)\n }\n }\n}\n\npublic fun Input.peekCharUtf8(): Char {\n val rc = tryPeek()\n if (rc and 0x80 == 0) return rc.toChar()\n if (rc == -1) throw EOFException(\"Failed to peek a char: end of input\")\n\n return peekCharUtf8Impl(rc)\n}\n\n/**\n * For every byte from this input invokes [block] function giving it as parameter.\n */\ninternal inline fun Input.forEach(block: (Byte) -> Unit) {\n takeWhile { buffer ->\n buffer.forEach(block)\n true\n }\n}\n\nprivate fun Input.peekCharUtf8Impl(first: Int): Char {\n var rc = '?'\n var found = false\n\n takeWhileSize(byteCountUtf8(first)) {\n it.decodeUTF8 { ch ->\n found = true\n rc = ch\n false\n }\n }\n\n if (!found) {\n throw MalformedUTF8InputException(\"No UTF-8 character found\")\n }\n\n return rc\n}\n","package io.ktor.utils.io.core\n\nimport io.ktor.utils.io.bits.Memory\n\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\npublic fun Input.readFully(dst: ByteArray, offset: Int = 0, length: Int = dst.size - offset) {\n readFullyBytesTemplate(offset, length) { src, dstOffset, count ->\n src.readFully(dst, dstOffset, count)\n }.requireNoRemaining()\n}\n\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\npublic fun Input.readFully(dst: ShortArray, offset: Int = 0, length: Int = dst.size - offset) {\n readFullyTemplate(offset, length, 2) { src, dstOffset, count ->\n src.readFully(dst, dstOffset, count)\n }.requireNoRemaining()\n}\n\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\npublic fun Input.readFully(dst: IntArray, offset: Int = 0, length: Int = dst.size - offset) {\n readFullyTemplate(offset, length, 4) { src, dstOffset, count ->\n src.readFully(dst, dstOffset, count)\n }.requireNoRemaining()\n}\n\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\npublic fun Input.readFully(dst: LongArray, offset: Int = 0, length: Int = dst.size - offset) {\n readFullyTemplate(offset, length, 8) { src, dstOffset, count ->\n src.readFully(dst, dstOffset, count)\n }.requireNoRemaining()\n}\n\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\npublic fun Input.readFully(dst: FloatArray, offset: Int = 0, length: Int = dst.size - offset) {\n readFullyTemplate(offset, length, 4) { src, dstOffset, count ->\n src.readFully(dst, dstOffset, count)\n }.requireNoRemaining()\n}\n\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\npublic fun Input.readFully(dst: DoubleArray, offset: Int = 0, length: Int = dst.size - offset) {\n readFullyTemplate(offset, length, 8) { src, dstOffset, count ->\n src.readFully(dst, dstOffset, count)\n }.requireNoRemaining()\n}\n\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\npublic fun Input.readFully(dst: Buffer, length: Int = dst.writeRemaining) {\n readFullyBytesTemplate(0, length) { src, _, count ->\n src.readFully(dst, count)\n }.requireNoRemaining()\n}\n\npublic fun Input.readFully(destination: Memory, destinationOffset: Int, length: Int) {\n readFully(destination, destinationOffset.toLong(), length.toLong())\n}\n\npublic fun Input.readFully(destination: Memory, destinationOffset: Long, length: Long) {\n if (readAvailable(destination, destinationOffset, length) != length) {\n prematureEndOfStream(length)\n }\n}\n\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\npublic fun Input.readAvailable(dst: ByteArray, offset: Int = 0, length: Int = dst.size - offset): Int {\n return length - readFullyBytesTemplate(offset, length) { src, dstOffset, count ->\n src.readFully(dst, dstOffset, count)\n }\n}\n\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\npublic fun Input.readAvailable(dst: ShortArray, offset: Int = 0, length: Int = dst.size - offset): Int {\n return length - readFullyTemplate(offset, length, 2) { src, dstOffset, count ->\n src.readFully(dst, dstOffset, count)\n }\n}\n\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\npublic fun Input.readAvailable(dst: IntArray, offset: Int = 0, length: Int = dst.size - offset): Int {\n return length - readFullyTemplate(offset, length, 4) { src, dstOffset, count ->\n src.readFully(dst, dstOffset, count)\n }\n}\n\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\npublic fun Input.readAvailable(dst: LongArray, offset: Int = 0, length: Int = dst.size - offset): Int {\n return length - readFullyTemplate(offset, length, 8) { src, dstOffset, count ->\n src.readFully(dst, dstOffset, count)\n }\n}\n\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\npublic fun Input.readAvailable(dst: FloatArray, offset: Int = 0, length: Int = dst.size - offset): Int {\n return length - readFullyTemplate(offset, length, 4) { src, dstOffset, count ->\n src.readFully(dst, dstOffset, count)\n }\n}\n\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\npublic fun Input.readAvailable(dst: DoubleArray, offset: Int = 0, length: Int = dst.size - offset): Int {\n return length - readFullyTemplate(offset, length, 8) { src, dstOffset, count ->\n src.readFully(dst, dstOffset, count)\n }\n}\n\npublic fun Input.readAvailable(dst: Buffer, length: Int = dst.writeRemaining): Int {\n return length - readFullyBytesTemplate(0, length) { src, _, count ->\n src.readFully(dst, count)\n }\n}\n\npublic fun Input.readAvailable(destination: Memory, destinationOffset: Int, length: Int): Int {\n return readAvailable(destination, destinationOffset.toLong(), length.toLong()).toInt()\n}\n\npublic fun Input.readAvailable(destination: Memory, destinationOffset: Long, length: Long): Long {\n val remaining = readFullyBytesTemplate(destinationOffset, length) { src, srcOffset, dstOffset, count ->\n src.copyTo(destination, srcOffset, count.toLong(), dstOffset)\n }\n val result = length - remaining\n return when {\n result == 0L && endOfInput -> -1\n else -> result\n }\n}\n\n/**\n * @return number of bytes remaining or 0 if all [length] bytes were copied\n */\nprivate inline fun Input.readFullyBytesTemplate(\n initialDstOffset: Int,\n length: Int,\n readBlock: (src: Buffer, dstOffset: Int, count: Int) -> Unit\n): Int {\n var remaining = length\n var dstOffset = initialDstOffset\n\n takeWhile { buffer ->\n val count = minOf(remaining, buffer.readRemaining)\n readBlock(buffer, dstOffset, count)\n remaining -= count\n dstOffset += count\n\n remaining > 0\n }\n\n return remaining\n}\n\n/**\n * @return number of bytes remaining or 0 if all [length] bytes were copied\n */\nprivate inline fun Input.readFullyBytesTemplate(\n initialDstOffset: Long,\n length: Long,\n readBlock: (src: Memory, srcOffset: Long, dstOffset: Long, count: Int) -> Unit\n): Long {\n var remaining = length\n var dstOffset = initialDstOffset\n\n takeWhile { buffer ->\n val count = minOf(remaining, buffer.readRemaining.toLong()).toInt()\n readBlock(buffer.memory, buffer.readPosition.toLong(), dstOffset, count)\n buffer.discardExact(count)\n remaining -= count\n dstOffset += count\n\n remaining > 0\n }\n\n return remaining\n}\n\n/**\n * @return number of elements remaining or 0 if all [length] elements were copied\n */\nprivate inline fun Input.readFullyTemplate(\n offset: Int,\n length: Int,\n componentSize: Int,\n readBlock: (src: Buffer, dstOffset: Int, count: Int) -> Unit\n): Int {\n var remaining = length\n var dstOffset = offset\n\n takeWhileSize { buffer ->\n val count = minOf(remaining, buffer.readRemaining / componentSize)\n readBlock(buffer, dstOffset, count)\n remaining -= count\n dstOffset += count\n\n when {\n remaining > 0 -> componentSize\n else -> 0\n }\n }\n\n return remaining\n}\n\n@Suppress(\"NOTHING_TO_INLINE\")\nprivate inline fun Int.requireNoRemaining() {\n if (this > 0) {\n prematureEndOfStream(this)\n }\n}\n","package io.ktor.utils.io.core\n\nimport io.ktor.utils.io.bits.*\nimport io.ktor.utils.io.core.internal.*\nimport io.ktor.utils.io.pool.*\nimport kotlin.contracts.*\n\n/**\n * Read the specified number of bytes specified (optional, read all remaining by default)\n */\npublic fun Buffer.readBytes(count: Int = readRemaining): ByteArray {\n if (count == 0) {\n return EmptyByteArray\n }\n\n val result = ByteArray(count)\n readFully(result)\n return result\n}\n\ninternal fun ChunkBuffer?.releaseAll(pool: ObjectPool) {\n var current = this\n while (current != null) {\n val next = current.cleanNext()\n current.release(pool)\n current = next\n }\n}\n\n@OptIn(ExperimentalContracts::class)\ninternal inline fun ChunkBuffer.forEachChunk(block: (ChunkBuffer) -> Unit) {\n contract {\n callsInPlace(block, InvocationKind.AT_LEAST_ONCE)\n }\n var current = this\n do {\n block(current)\n current = current.next ?: break\n } while (true)\n}\n\n/**\n * Copy every element of the chain starting from this and setup next links.\n */\ninternal fun ChunkBuffer.copyAll(): ChunkBuffer {\n val copied = duplicate()\n val next = this.next ?: return copied\n\n return next.copyAll(copied, copied)\n}\n\nprivate tailrec fun ChunkBuffer.copyAll(head: ChunkBuffer, prev: ChunkBuffer): ChunkBuffer {\n val copied = duplicate()\n prev.next = copied\n\n val next = this.next ?: return head\n\n return next.copyAll(head, copied)\n}\n\ninternal tailrec fun ChunkBuffer.findTail(): ChunkBuffer {\n val next = this.next ?: return this\n return next.findTail()\n}\n\n/**\n * Summarize remainings of all elements of the chain\n */\ninternal fun ChunkBuffer.remainingAll(): Long = remainingAll(0L)\n\nprivate tailrec fun ChunkBuffer.remainingAll(n: Long): Long {\n val rem = readRemaining.toLong() + n\n val next = this.next ?: return rem\n\n return next.remainingAll(rem)\n}\n\ninternal tailrec fun ChunkBuffer.isEmpty(): Boolean {\n if (readRemaining > 0) return false\n val next = this.next ?: return true\n return next.isEmpty()\n}\n\n@Suppress(\"NOTHING_TO_INLINE\")\ninternal inline fun Long.coerceAtMostMaxInt(): Int = minOf(this, Int.MAX_VALUE.toLong()).toInt()\n\n@Suppress(\"NOTHING_TO_INLINE\")\ninternal inline fun Long.coerceAtMostMaxIntOrFail(message: String): Int {\n if (this > Int.MAX_VALUE.toLong()) throw IllegalArgumentException(message)\n return this.toInt()\n}\n\ninternal fun Buffer.peekTo(destination: Memory, destinationOffset: Long, offset: Long, max: Long): Long {\n val size = minOf(\n destination.size - destinationOffset,\n max,\n readRemaining.toLong()\n )\n\n memory.copyTo(\n destination,\n readPosition + offset,\n size,\n destinationOffset\n )\n\n return size\n}\n\npublic class BufferLimitExceededException(message: String) : Exception(message)\n","package io.ktor.utils.io\n\nimport io.ktor.utils.io.bits.*\nimport io.ktor.utils.io.core.*\nimport io.ktor.utils.io.core.internal.*\n\n/**\n * Channel for asynchronous writing of sequences of bytes.\n * This is a **single-writer channel**.\n *\n * Operations on this channel cannot be invoked concurrently, unless explicitly specified otherwise\n * in description. Exceptions are [close] and [flush].\n */\npublic expect interface ByteWriteChannel {\n /**\n * Returns number of bytes that can be written without suspension. Write operations do no suspend and return\n * immediately when this number is at least the number of bytes requested for write.\n */\n public val availableForWrite: Int\n\n /**\n * Returns `true` is channel has been closed and attempting to write to the channel will cause an exception.\n */\n public val isClosedForWrite: Boolean\n\n /**\n * Returns `true` if channel flushes automatically all pending bytes after every write function call.\n * If `false` then flush only happens at manual [flush] invocation or when the buffer is full.\n */\n public val autoFlush: Boolean\n\n /**\n * Number of bytes written to the channel.\n * It is not guaranteed to be atomic so could be updated in the middle of write operation.\n */\n public val totalBytesWritten: Long\n\n /**\n * A closure causes exception or `null` if closed successfully or not yet closed\n */\n public val closedCause: Throwable?\n\n /**\n * Writes as much as possible and only suspends if buffer is full\n */\n public suspend fun writeAvailable(src: ByteArray, offset: Int, length: Int): Int\n\n public suspend fun writeAvailable(src: ChunkBuffer): Int\n\n /**\n * Writes all [src] bytes and suspends until all bytes written. Causes flush if buffer filled up or when [autoFlush]\n * Crashes if channel get closed while writing.\n */\n public suspend fun writeFully(src: ByteArray, offset: Int, length: Int)\n\n public suspend fun writeFully(src: Buffer)\n\n public suspend fun writeFully(memory: Memory, startIndex: Int, endIndex: Int)\n\n @Suppress(\"DEPRECATION\")\n @Deprecated(\"Use write { } instead.\")\n public suspend fun writeSuspendSession(visitor: suspend WriterSuspendSession.() -> Unit)\n\n /**\n * Writes a [packet] fully or fails if channel get closed before the whole packet has been written\n */\n public suspend fun writePacket(packet: ByteReadPacket)\n\n /**\n * Writes long number and suspends until written.\n * Crashes if channel get closed while writing.\n */\n public suspend fun writeLong(l: Long)\n\n /**\n * Writes int number and suspends until written.\n * Crashes if channel get closed while writing.\n */\n public suspend fun writeInt(i: Int)\n\n /**\n * Writes short number and suspends until written.\n * Crashes if channel get closed while writing.\n */\n public suspend fun writeShort(s: Short)\n\n /**\n * Writes byte and suspends until written.\n * Crashes if channel get closed while writing.\n */\n public suspend fun writeByte(b: Byte)\n\n /**\n * Writes double number and suspends until written.\n * Crashes if channel get closed while writing.\n */\n public suspend fun writeDouble(d: Double)\n\n /**\n * Writes float number and suspends until written.\n * Crashes if channel get closed while writing.\n */\n public suspend fun writeFloat(f: Float)\n\n /**\n * Invokes [block] when at least 1 byte is available for write.\n */\n public suspend fun awaitFreeSpace()\n\n /**\n * Closes this channel with an optional exceptional [cause].\n * It flushes all pending write bytes (via [flush]).\n * This is an idempotent operation -- repeated invocations of this function have no effect and return `false`.\n *\n * A channel that was closed without a [cause], is considered to be _closed normally_.\n * A channel that was closed with non-null [cause] is called a _failed channel_. Attempts to read or\n * write on a failed channel throw this cause exception.\n *\n * After invocation of this operation [isClosedForWrite] starts returning `true` and\n * all subsequent write operations throw [ClosedWriteChannelException] or the specified [cause].\n * However, [isClosedForRead][ByteReadChannel.isClosedForRead] on the side of [ByteReadChannel]\n * starts returning `true` only after all written bytes have been read.\n *\n * Please note that if the channel has been closed with cause and it has been provided by [reader] or [writer]\n * coroutine then the corresponding coroutine will be cancelled with [cause]. If no [cause] provided then no\n * cancellation will be propagated.\n */\n public fun close(cause: Throwable?): Boolean\n\n /**\n * Flushes all pending write bytes making them available for read.\n *\n * This function is thread-safe and can be invoked in any thread at any time.\n * It does nothing when invoked on a closed channel.\n */\n public fun flush()\n}\n\npublic suspend fun ByteWriteChannel.writeAvailable(src: ByteArray): Int = writeAvailable(src, 0, src.size)\npublic suspend fun ByteWriteChannel.writeFully(src: ByteArray): Unit = writeFully(src, 0, src.size)\n\npublic suspend fun ByteWriteChannel.writeShort(s: Int) {\n return writeShort((s and 0xffff).toShort())\n}\n\npublic suspend fun ByteWriteChannel.writeShort(s: Int, byteOrder: ByteOrder) {\n return writeShort((s and 0xffff).toShort(), byteOrder)\n}\n\npublic suspend fun ByteWriteChannel.writeByte(b: Int) {\n return writeByte((b and 0xff).toByte())\n}\n\npublic suspend fun ByteWriteChannel.writeInt(i: Long) {\n return writeInt(i.toInt())\n}\n\npublic suspend fun ByteWriteChannel.writeInt(i: Long, byteOrder: ByteOrder) {\n return writeInt(i.toInt(), byteOrder)\n}\n\n/**\n * Closes this channel with no failure (successfully)\n */\npublic fun ByteWriteChannel.close(): Boolean = close(null)\n\npublic suspend fun ByteWriteChannel.writeStringUtf8(s: CharSequence) {\n val packet = buildPacket {\n writeText(s)\n }\n\n return writePacket(packet)\n}\n\npublic suspend fun ByteWriteChannel.writeStringUtf8(s: String) {\n val packet = buildPacket {\n writeText(s)\n }\n\n return writePacket(packet)\n}\n\npublic suspend fun ByteWriteChannel.writeBoolean(b: Boolean) {\n return writeByte(if (b) 1 else 0)\n}\n\n/**\n * Writes UTF16 character\n */\npublic suspend fun ByteWriteChannel.writeChar(ch: Char) {\n return writeShort(ch.code)\n}\n\npublic suspend inline fun ByteWriteChannel.writePacket(builder: BytePacketBuilder.() -> Unit) {\n return writePacket(buildPacket(builder))\n}\n\npublic suspend fun ByteWriteChannel.writePacketSuspend(builder: suspend BytePacketBuilder.() -> Unit) {\n return writePacket(buildPacket { builder() })\n}\n\n/**\n * Indicates attempt to write on [isClosedForWrite][ByteWriteChannel.isClosedForWrite] channel\n * that was closed without a cause. A _failed_ channel rethrows the original [close][ByteWriteChannel.close] cause\n * exception on send attempts.\n */\npublic class ClosedWriteChannelException(message: String?) : CancellationException(message)\n","/*\n * Copyright 2014-2022 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.utils.io\n\ninternal val CLOSED_SUCCESS = CloseElement(null)\n\ninternal class CloseElement(val cause: Throwable?)\n","package io.ktor.utils.io\n\nimport kotlinx.coroutines.*\nimport kotlin.coroutines.*\n\n/**\n * A coroutine job that is reading from a byte channel\n */\npublic interface ReaderJob : Job {\n /**\n * A reference to the channel that this coroutine is reading from\n */\n public val channel: ByteWriteChannel\n}\n\n/**\n * A coroutine job that is writing to a byte channel\n */\npublic interface WriterJob : Job {\n /**\n * A reference to the channel that this coroutine is writing to\n */\n public val channel: ByteReadChannel\n}\n\npublic interface ReaderScope : CoroutineScope {\n public val channel: ByteReadChannel\n}\n\npublic interface WriterScope : CoroutineScope {\n public val channel: ByteWriteChannel\n}\n\npublic fun CoroutineScope.reader(\n coroutineContext: CoroutineContext = EmptyCoroutineContext,\n channel: ByteChannel,\n block: suspend ReaderScope.() -> Unit\n): ReaderJob = launchChannel(coroutineContext, channel, attachJob = false, block = block)\n\npublic fun CoroutineScope.reader(\n coroutineContext: CoroutineContext = EmptyCoroutineContext,\n autoFlush: Boolean = false,\n block: suspend ReaderScope.() -> Unit\n): ReaderJob = launchChannel(coroutineContext, ByteChannel(autoFlush), attachJob = true, block = block)\n\n@OptIn(DelicateCoroutinesApi::class, ExperimentalCoroutinesApi::class)\n@Deprecated(\"Use scope.reader instead\")\npublic fun reader(\n coroutineContext: CoroutineContext,\n channel: ByteChannel,\n parent: Job? = null,\n block: suspend ReaderScope.() -> Unit\n): ReaderJob {\n val newContext = if (parent != null) GlobalScope.newCoroutineContext(coroutineContext + parent)\n else GlobalScope.newCoroutineContext(coroutineContext)\n\n return CoroutineScope(newContext).reader(EmptyCoroutineContext, channel, block)\n}\n\n@Suppress(\"DEPRECATION\")\n@Deprecated(\"Use scope.reader instead\")\npublic fun reader(\n coroutineContext: CoroutineContext,\n autoFlush: Boolean = false,\n parent: Job? = null,\n block: suspend ReaderScope.() -> Unit\n): ReaderJob {\n val channel = ByteChannel(autoFlush)\n return reader(coroutineContext, channel, parent, block).also {\n channel.attachJob(it)\n }\n}\n\npublic fun CoroutineScope.writer(\n coroutineContext: CoroutineContext = EmptyCoroutineContext,\n channel: ByteChannel,\n block: suspend WriterScope.() -> Unit\n): WriterJob = launchChannel(coroutineContext, channel, attachJob = false, block = block)\n\npublic fun CoroutineScope.writer(\n coroutineContext: CoroutineContext = EmptyCoroutineContext,\n autoFlush: Boolean = false,\n block: suspend WriterScope.() -> Unit\n): WriterJob = launchChannel(coroutineContext, ByteChannel(autoFlush), attachJob = true, block = block)\n\n@OptIn(DelicateCoroutinesApi::class, ExperimentalCoroutinesApi::class)\n@Deprecated(\"Use scope.writer instead\")\npublic fun writer(\n coroutineContext: CoroutineContext,\n channel: ByteChannel,\n parent: Job? = null,\n block: suspend WriterScope.() -> Unit\n): WriterJob {\n val newContext = if (parent != null) GlobalScope.newCoroutineContext(coroutineContext + parent)\n else GlobalScope.newCoroutineContext(coroutineContext)\n\n return CoroutineScope(newContext).writer(EmptyCoroutineContext, channel, block)\n}\n\n@Suppress(\"DEPRECATION\")\n@Deprecated(\"Use scope.writer instead\")\npublic fun writer(\n coroutineContext: CoroutineContext,\n autoFlush: Boolean = false,\n parent: Job? = null,\n block: suspend WriterScope.() -> Unit\n): WriterJob {\n val channel = ByteChannel(autoFlush)\n return writer(coroutineContext, channel, parent, block).also {\n channel.attachJob(it)\n }\n}\n\n/**\n * @param S not exactly safe (unchecked cast is used) so should be [ReaderScope] or [WriterScope]\n */\n@OptIn(ExperimentalStdlibApi::class)\nprivate fun CoroutineScope.launchChannel(\n context: CoroutineContext,\n channel: ByteChannel,\n attachJob: Boolean,\n block: suspend S.() -> Unit\n): ChannelJob {\n val dispatcher = coroutineContext[CoroutineDispatcher]\n val job = launch(context) {\n if (attachJob) {\n channel.attachJob(coroutineContext[Job]!!)\n }\n\n @Suppress(\"UNCHECKED_CAST\")\n val scope = ChannelScope(this, channel) as S\n\n try {\n block(scope)\n } catch (cause: Throwable) {\n if (dispatcher != Dispatchers.Unconfined && dispatcher != null) {\n throw cause\n }\n\n channel.cancel(cause)\n }\n }\n\n job.invokeOnCompletion { cause ->\n channel.close(cause)\n }\n\n return ChannelJob(job, channel)\n}\n\nprivate class ChannelScope(\n delegate: CoroutineScope,\n override val channel: ByteChannel\n) : ReaderScope, WriterScope, CoroutineScope by delegate\n\nprivate class ChannelJob(\n private val delegate: Job,\n override val channel: ByteChannel\n) : ReaderJob, WriterJob, Job by delegate {\n override fun toString(): String = \"ChannelJob[$delegate]\"\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.utils.io\n\n/**\n * Print exception stacktrace.\n */\npublic expect fun Throwable.printStack()\n\ninternal fun Throwable.unwrapCancellationException(): Throwable {\n var exception: Throwable = this\n while (exception is CancellationException) {\n if (exception == exception.cause) {\n return this\n }\n\n exception = exception.cause ?: return exception\n }\n\n return exception\n}\n","package io.ktor.utils.io\n\nimport io.ktor.utils.io.bits.Memory\nimport io.ktor.utils.io.core.*\nimport io.ktor.utils.io.core.internal.*\n\n/**\n * Await until at least [desiredSize] is available for read or EOF and invoke [block] function. The block function\n * should never capture a provided [Memory] instance outside otherwise an undefined behaviour may occur including\n * accidental crash or data corruption. Block function should return number of bytes consumed or 0.\n *\n * Specifying [desiredSize] larger than the channel's capacity leads to block function invocation earlier\n * when the channel is full. So specifying too big [desiredSize] is identical to specifying [desiredSize] equal to\n * the channel's capacity. The other case when a provided memory range could be less than [desiredSize] is that\n * all the requested bytes couldn't be represented as a single memory range due to internal implementation reasons.\n *\n * @return number of bytes consumed, possibly 0\n */\npublic suspend inline fun ByteReadChannel.read(\n desiredSize: Int = 1,\n block: (source: Memory, start: Long, endExclusive: Long) -> Int\n): Int {\n val buffer = requestBuffer(desiredSize) ?: Buffer.Empty\n\n try {\n val bytesRead = block(buffer.memory, buffer.readPosition.toLong(), buffer.writePosition.toLong())\n completeReadingFromBuffer(buffer, bytesRead)\n return bytesRead\n } catch (cause: Throwable) {\n completeReadingFromBuffer(buffer, 0)\n throw cause\n }\n\n // we don't use finally here because of KT-37279\n}\n\n@Deprecated(\"Use read { } instead.\")\npublic interface ReadSession {\n /**\n * Number of bytes available for read. However it does not necessarily mean that all available bytes could be\n * requested at once\n */\n public val availableForRead: Int\n\n /**\n * Discard at most [n] available bytes or 0 if no bytes available yet\n * @return number of bytes actually discarded, could be 0\n */\n public fun discard(n: Int): Int\n\n /**\n * Request buffer range [atLeast] bytes length\n *\n * There are the following reasons for this function to return `null`:\n * - not enough bytes available yet (should be at least `atLeast` bytes available)\n * - due to buffer fragmentation it is impossible to represent the requested range as a single buffer range\n * - end of stream encountered and all bytes were consumed\n *\n * @return buffer for the requested range or `null` if it is impossible to provide such a buffer view\n * @throws Throwable if the channel has been closed with an exception or cancelled\n */\n @Suppress(\"DEPRECATION\")\n public fun request(atLeast: Int = 1): ChunkBuffer?\n}\n\n@Suppress(\"DEPRECATION\")\n@Deprecated(\"Use read { } instead.\")\npublic interface SuspendableReadSession : ReadSession {\n /**\n * Suspend until [atLeast] bytes become available or end of stream encountered (possibly due to exceptional close)\n *\n * @return true if there are [atLeast] bytes available or false if end of stream encountered (there still could be\n * bytes available but less than [atLeast])\n * @throws Throwable if the channel has been closed with an exception or cancelled\n * @throws IllegalArgumentException if [atLeast] is negative to too big (usually bigger than 4088)\n */\n public suspend fun await(atLeast: Int = 1): Boolean\n}\n\n@PublishedApi\ninternal suspend fun ByteReadChannel.requestBuffer(desiredSize: Int): Buffer? {\n @Suppress(\"DEPRECATION\")\n val readSession: SuspendableReadSession? = when {\n this is SuspendableReadSession -> this\n this is HasReadSession -> startReadSession()\n else -> null\n }\n\n if (readSession != null) {\n val buffer = readSession.request(desiredSize.coerceAtMost(Buffer.ReservedSize))\n if (buffer != null) {\n return buffer\n }\n\n return readSession.requestBufferSuspend(desiredSize)\n }\n\n return requestBufferFallback(desiredSize)\n}\n\n@PublishedApi\ninternal suspend fun ByteReadChannel.completeReadingFromBuffer(buffer: Buffer?, bytesRead: Int) {\n check(bytesRead >= 0) { \"bytesRead shouldn't be negative: $bytesRead\" }\n @Suppress(\"DEPRECATION\")\n val readSession: SuspendableReadSession? = readSessionFor()\n\n if (readSession != null) {\n readSession.discard(bytesRead)\n if (this is HasReadSession) {\n endReadSession()\n }\n return\n }\n\n if (buffer is ChunkBuffer && buffer !== ChunkBuffer.Empty) {\n buffer.release(ChunkBuffer.Pool)\n discard(bytesRead.toLong())\n }\n}\n\n@Suppress(\"DEPRECATION\")\nprivate suspend fun SuspendableReadSession.requestBufferSuspend(desiredSize: Int): Buffer? {\n await(desiredSize)\n return request(1)\n}\n\nprivate suspend fun ByteReadChannel.requestBufferFallback(desiredSize: Int): ChunkBuffer {\n val chunk = ChunkBuffer.Pool.borrow()\n val copied =\n peekTo(chunk.memory, chunk.writePosition.toLong(), 0L, desiredSize.toLong(), chunk.writeRemaining.toLong())\n chunk.commitWritten(copied.toInt())\n\n return chunk\n}\n\ninternal interface HasReadSession {\n @Suppress(\"DEPRECATION\")\n public fun startReadSession(): SuspendableReadSession\n\n public fun endReadSession()\n}\n\n@Suppress(\"DEPRECATION\", \"NOTHING_TO_INLINE\")\nprivate inline fun ByteReadChannel.readSessionFor(): SuspendableReadSession? = when {\n this is HasReadSession -> startReadSession()\n else -> null\n}\n","package io.ktor.utils.io\n\nimport io.ktor.utils.io.bits.*\nimport io.ktor.utils.io.core.*\nimport io.ktor.utils.io.core.internal.*\n\n/**\n * Await for [desiredSpace] will be available for write and invoke [block] function providing [Memory] instance and\n * the corresponding range suitable for wiring in the memory. The block function should return number of bytes were\n * written, possibly 0.\n *\n * Similar to [ByteReadChannel.read], this function may invoke block function with lesser memory range when the\n * specified [desiredSpace] is bigger that the buffer's capacity\n * or when it is impossible to represent all [desiredSpace] bytes as a single memory range\n * due to internal implementation reasons.\n */\npublic suspend inline fun ByteWriteChannel.write(\n desiredSpace: Int = 1,\n block: (freeSpace: Memory, startOffset: Long, endExclusive: Long) -> Int\n): Int {\n val buffer = requestWriteBuffer(desiredSpace) ?: Buffer.Empty\n var bytesWritten = 0\n try {\n bytesWritten = block(buffer.memory, buffer.writePosition.toLong(), buffer.limit.toLong())\n buffer.commitWritten(bytesWritten)\n return bytesWritten\n } finally {\n completeWriting(buffer, bytesWritten)\n }\n}\n\n@Suppress(\"DEPRECATION\")\n@Deprecated(\"Use writeMemory instead.\")\npublic interface WriterSession {\n public fun request(min: Int): ChunkBuffer?\n public fun written(n: Int)\n public fun flush()\n}\n\n@Suppress(\"DEPRECATION\")\n@Deprecated(\"Use writeMemory instead.\")\npublic interface WriterSuspendSession : WriterSession {\n public suspend fun tryAwait(n: Int)\n}\n\n@Suppress(\"DEPRECATION\")\ninternal interface HasWriteSession {\n public fun beginWriteSession(): WriterSuspendSession?\n public fun endWriteSession(written: Int)\n}\n\n@PublishedApi\ninternal suspend fun ByteWriteChannel.requestWriteBuffer(desiredSpace: Int): Buffer? {\n val session = writeSessionFor()\n if (session != null) {\n val buffer = session.request(desiredSpace)\n if (buffer != null) {\n return buffer\n }\n\n return writeBufferSuspend(session, desiredSpace)\n }\n\n return writeBufferFallback()\n}\n\n@PublishedApi\ninternal suspend fun ByteWriteChannel.completeWriting(buffer: Buffer, written: Int) {\n if (this is HasWriteSession) {\n endWriteSession(written)\n return\n }\n\n return completeWritingFallback(buffer)\n}\n\n@Suppress(\"DEPRECATION\")\nprivate suspend fun ByteWriteChannel.completeWritingFallback(buffer: Buffer) {\n if (buffer is ChunkBuffer) {\n writeFully(buffer)\n buffer.release(ChunkBuffer.Pool)\n return\n }\n\n throw UnsupportedOperationException(\"Only ChunkBuffer instance is supported.\")\n}\n\n@Suppress(\"DEPRECATION\")\nprivate suspend fun writeBufferSuspend(session: WriterSuspendSession, desiredSpace: Int): Buffer? {\n session.tryAwait(desiredSpace)\n return session.request(desiredSpace) ?: session.request(1)\n}\n\nprivate fun writeBufferFallback(): Buffer = ChunkBuffer.Pool.borrow().also {\n it.resetForWrite()\n it.reserveEndGap(Buffer.ReservedSize)\n}\n\n@Suppress(\"DEPRECATION\", \"NOTHING_TO_INLINE\")\nprivate inline fun ByteWriteChannel.writeSessionFor(): WriterSuspendSession? = when {\n this is HasWriteSession -> beginWriteSession()\n else -> null\n}\n","package io.ktor.utils.io.core\n\nimport io.ktor.utils.io.bits.*\nimport io.ktor.utils.io.charsets.*\nimport io.ktor.utils.io.core.internal.*\nimport io.ktor.utils.io.pool.*\n\n/**\n * This shouldn't be implemented directly. Inherit [Output] instead.\n */\npublic abstract class Output public constructor(\n protected val pool: ObjectPool\n) : Appendable, Closeable {\n\n public constructor() : this(ChunkBuffer.Pool)\n\n protected val _size: Int\n get() = chainedSize + (tailPosition - tailInitialPosition)\n\n /**\n * An implementation should write [source] to the destination exactly [length] bytes.\n * It should never capture the [source] instance\n * longer than this method execution since it may be disposed after return.\n */\n protected abstract fun flush(source: Memory, offset: Int, length: Int)\n\n /**\n * An implementation should only close the destination.\n */\n protected abstract fun closeDestination()\n\n private var _head: ChunkBuffer? = null\n\n private var _tail: ChunkBuffer? = null\n\n internal val head: ChunkBuffer\n get() = _head ?: ChunkBuffer.Empty\n\n internal var tailMemory: Memory = Memory.Empty\n\n internal var tailPosition: Int = 0\n\n internal var tailEndExclusive: Int = 0\n\n private var tailInitialPosition = 0\n\n /**\n * Number of bytes buffered in the chain except the tail chunk\n */\n private var chainedSize: Int = 0\n\n internal inline val tailRemaining: Int get() = tailEndExclusive - tailPosition\n\n public fun flush() {\n flushChain()\n }\n\n private fun flushChain() {\n val oldTail = stealAll() ?: return\n\n try {\n oldTail.forEachChunk { chunk ->\n flush(chunk.memory, chunk.readPosition, chunk.readRemaining)\n }\n } finally {\n oldTail.releaseAll(pool)\n }\n }\n\n /**\n * Detach all chunks and cleanup all internal state so builder could be reusable again\n * @return a chain of buffer views or `null` of it is empty\n */\n internal fun stealAll(): ChunkBuffer? {\n val head = this._head ?: return null\n\n _tail?.commitWrittenUntilIndex(tailPosition)\n\n this._head = null\n this._tail = null\n tailPosition = 0\n tailEndExclusive = 0\n tailInitialPosition = 0\n chainedSize = 0\n tailMemory = Memory.Empty\n\n return head\n }\n\n internal fun appendSingleChunk(buffer: ChunkBuffer) {\n check(buffer.next == null) { \"It should be a single buffer chunk.\" }\n appendChainImpl(buffer, buffer, 0)\n }\n\n internal fun appendChain(head: ChunkBuffer) {\n val tail = head.findTail()\n val chainedSizeDelta = (head.remainingAll() - tail.readRemaining).toIntOrFail(\"total size increase\")\n appendChainImpl(head, tail, chainedSizeDelta)\n }\n\n private fun appendNewChunk(): ChunkBuffer {\n val new = pool.borrow()\n new.reserveEndGap(Buffer.ReservedSize)\n\n appendSingleChunk(new)\n\n return new\n }\n\n private fun appendChainImpl(head: ChunkBuffer, newTail: ChunkBuffer, chainedSizeDelta: Int) {\n val _tail = _tail\n if (_tail == null) {\n _head = head\n chainedSize = 0\n } else {\n _tail.next = head\n val tailPosition = tailPosition\n _tail.commitWrittenUntilIndex(tailPosition)\n chainedSize += tailPosition - tailInitialPosition\n }\n\n this._tail = newTail\n chainedSize += chainedSizeDelta\n tailMemory = newTail.memory\n tailPosition = newTail.writePosition\n tailInitialPosition = newTail.readPosition\n tailEndExclusive = newTail.limit\n }\n\n public fun writeByte(v: Byte) {\n val index = tailPosition\n if (index < tailEndExclusive) {\n tailPosition = index + 1\n tailMemory[index] = v\n return\n }\n\n return writeByteFallback(v)\n }\n\n private fun writeByteFallback(v: Byte) {\n appendNewChunk().writeByte(v)\n tailPosition++\n }\n\n /**\n * Should flush and close the destination\n */\n final override fun close() {\n try {\n flush()\n } finally {\n closeDestination() // TODO check what should be done here\n }\n }\n\n /**\n * Append single UTF-8 character\n */\n override fun append(value: Char): Output {\n val tailPosition = tailPosition\n if (tailEndExclusive - tailPosition >= 3) {\n val size = tailMemory.putUtf8Char(tailPosition, value.code)\n this.tailPosition = tailPosition + size\n return this\n }\n\n appendCharFallback(value)\n return this\n }\n\n private fun appendCharFallback(c: Char) {\n write(3) { buffer ->\n val size = buffer.memory.putUtf8Char(buffer.writePosition, c.code)\n buffer.commitWritten(size)\n size\n }\n }\n\n override fun append(value: CharSequence?): Output {\n if (value == null) {\n append(\"null\", 0, 4)\n } else {\n append(value, 0, value.length)\n }\n return this\n }\n\n override fun append(value: CharSequence?, startIndex: Int, endIndex: Int): Output {\n if (value == null) {\n return append(\"null\", startIndex, endIndex)\n }\n\n writeText(value, startIndex, endIndex, Charsets.UTF_8)\n\n return this\n }\n\n /**\n * Writes another packet to the end. Please note that the instance [packet] gets consumed so you don't need to release it\n */\n public fun writePacket(packet: ByteReadPacket) {\n val foreignStolen = packet.stealAll()\n if (foreignStolen == null) {\n packet.release()\n return\n }\n\n val tail = _tail\n if (tail == null) {\n appendChain(foreignStolen)\n return\n }\n\n writePacketMerging(tail, foreignStolen, packet.pool)\n }\n\n /**\n * Write chunk buffer to current [Output]. Assuming that chunk buffer is from current pool.\n */\n internal fun writeChunkBuffer(chunkBuffer: ChunkBuffer) {\n val _tail = _tail\n if (_tail == null) {\n appendChain(chunkBuffer)\n return\n }\n\n writePacketMerging(_tail, chunkBuffer, pool)\n }\n\n private fun writePacketMerging(tail: ChunkBuffer, foreignStolen: ChunkBuffer, pool: ObjectPool) {\n tail.commitWrittenUntilIndex(tailPosition)\n\n val lastSize = tail.readRemaining\n val nextSize = foreignStolen.readRemaining\n\n // at first we evaluate if it is reasonable to merge chunks\n val maxCopySize = PACKET_MAX_COPY_SIZE\n val appendSize = if (nextSize < maxCopySize && nextSize <= (tail.endGap + tail.writeRemaining)) {\n nextSize\n } else -1\n\n val prependSize =\n if (lastSize < maxCopySize && lastSize <= foreignStolen.startGap && foreignStolen.isExclusivelyOwned()) {\n lastSize\n } else -1\n\n if (appendSize == -1 && prependSize == -1) {\n // simply enqueue if there is no reason to merge\n appendChain(foreignStolen)\n } else if (prependSize == -1 || appendSize <= prependSize) {\n // do append\n tail.writeBufferAppend(foreignStolen, tail.writeRemaining + tail.endGap)\n afterHeadWrite()\n foreignStolen.cleanNext()?.let { next ->\n appendChain(next)\n }\n\n foreignStolen.release(pool)\n } else if (appendSize == -1 || prependSize < appendSize) {\n writePacketSlowPrepend(foreignStolen, tail)\n } else {\n throw IllegalStateException(\"prep = $prependSize, app = $appendSize\")\n }\n }\n\n /**\n * Do prepend current [tail] to the beginning of [foreignStolen].\n */\n private fun writePacketSlowPrepend(foreignStolen: ChunkBuffer, tail: ChunkBuffer) {\n foreignStolen.writeBufferPrepend(tail)\n\n val _head = _head ?: error(\"head should't be null since it is already handled in the fast-path\")\n if (_head === tail) {\n this._head = foreignStolen\n } else {\n // we need to fix next reference of the previous chunk before the tail\n // we have to traverse from the beginning to find it\n var pre = _head\n while (true) {\n val next = pre.next!!\n if (next === tail) break\n pre = next\n }\n\n pre.next = foreignStolen\n }\n\n tail.release(pool)\n\n this._tail = foreignStolen.findTail()\n }\n\n /**\n * Write exact [n] bytes from packet to the builder\n */\n public fun writePacket(p: ByteReadPacket, n: Int) {\n var remaining = n\n\n while (remaining > 0) {\n val headRemaining = p.headRemaining\n if (headRemaining <= remaining) {\n remaining -= headRemaining\n appendSingleChunk(p.steal() ?: throw EOFException(\"Unexpected end of packet\"))\n } else {\n p.read { view ->\n writeFully(view, remaining)\n }\n break\n }\n }\n }\n\n /**\n * Write exact [n] bytes from packet to the builder\n */\n public fun writePacket(p: ByteReadPacket, n: Long) {\n var remaining = n\n\n while (remaining > 0L) {\n val headRemaining = p.headRemaining.toLong()\n if (headRemaining <= remaining) {\n remaining -= headRemaining\n appendSingleChunk(p.steal() ?: throw EOFException(\"Unexpected end of packet\"))\n } else {\n p.read { view ->\n writeFully(view, remaining.toInt())\n }\n break\n }\n }\n }\n\n public fun append(csq: CharArray, start: Int, end: Int): Appendable {\n writeText(csq, start, end, Charsets.UTF_8)\n return this\n }\n\n /**\n * Release any resources that the builder holds. Builder shouldn't be used after release\n */\n public fun release() {\n close()\n }\n\n @PublishedApi\n internal fun prepareWriteHead(n: Int): ChunkBuffer {\n if (tailRemaining >= n) {\n _tail?.let {\n it.commitWrittenUntilIndex(tailPosition)\n return it\n }\n }\n return appendNewChunk()\n }\n\n @PublishedApi\n internal fun afterHeadWrite() {\n _tail?.let { tailPosition = it.writePosition }\n }\n\n @PublishedApi\n internal inline fun write(size: Int, block: (Buffer) -> Int): Int {\n val buffer = prepareWriteHead(size)\n try {\n val result = block(buffer)\n check(result >= 0) { \"The returned value shouldn't be negative\" }\n\n return result\n } finally {\n afterHeadWrite()\n }\n }\n\n internal open fun last(buffer: ChunkBuffer) {\n appendSingleChunk(buffer)\n }\n\n internal fun afterBytesStolen() {\n val head = head\n if (head !== ChunkBuffer.Empty) {\n check(head.next == null)\n head.resetForWrite()\n head.reserveEndGap(Buffer.ReservedSize)\n tailPosition = head.writePosition\n tailInitialPosition = tailPosition\n tailEndExclusive = head.limit\n }\n }\n}\n\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\npublic fun Output.append(csq: CharSequence, start: Int = 0, end: Int = csq.length): Appendable {\n return append(csq, start, end)\n}\n\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\npublic fun Output.append(csq: CharArray, start: Int = 0, end: Int = csq.size): Appendable {\n return append(csq, start, end)\n}\n\npublic fun Output.writeFully(src: ByteArray, offset: Int = 0, length: Int = src.size - offset) {\n writeFullyBytesTemplate(offset, length) { buffer, currentOffset, count ->\n buffer.writeFully(src, currentOffset, count)\n }\n}\n\npublic fun Output.writeFully(src: ShortArray, offset: Int = 0, length: Int = src.size - offset) {\n writeFullyTemplate(2, offset, length) { buffer, currentOffset, count ->\n buffer.writeFully(src, currentOffset, count)\n }\n}\n\npublic fun Output.writeFully(src: IntArray, offset: Int = 0, length: Int = src.size - offset) {\n writeFullyTemplate(4, offset, length) { buffer, currentOffset, count ->\n buffer.writeFully(src, currentOffset, count)\n }\n}\n\npublic fun Output.writeFully(src: LongArray, offset: Int = 0, length: Int = src.size - offset) {\n writeFullyTemplate(8, offset, length) { buffer, currentOffset, count ->\n buffer.writeFully(src, currentOffset, count)\n }\n}\n\npublic fun Output.writeFully(src: FloatArray, offset: Int = 0, length: Int = src.size - offset) {\n writeFullyTemplate(4, offset, length) { buffer, currentOffset, count ->\n buffer.writeFully(src, currentOffset, count)\n }\n}\n\npublic fun Output.writeFully(src: DoubleArray, offset: Int = 0, length: Int = src.size - offset) {\n writeFullyTemplate(8, offset, length) { buffer, currentOffset, count ->\n buffer.writeFully(src, currentOffset, count)\n }\n}\n\npublic fun Output.writeFully(src: Buffer, length: Int = src.readRemaining) {\n writeFullyBytesTemplate(0, length) { buffer, _, count ->\n buffer.writeFully(src, count)\n }\n}\n\npublic fun Output.writeFully(src: Memory, offset: Int, length: Int) {\n writeFully(src, offset.toLong(), length.toLong())\n}\n\npublic fun Output.writeFully(src: Memory, offset: Long, length: Long) {\n writeFullyBytesTemplate(offset, length) { memory, destinationOffset, sourceOffset, count ->\n src.copyTo(memory, sourceOffset, count, destinationOffset)\n }\n}\n\npublic fun Output.fill(times: Long, value: Byte = 0) {\n var written = 0L\n writeWhile { buffer ->\n val partTimes = minOf(buffer.writeRemaining.toLong(), times - written).toInt()\n buffer.fill(partTimes, value)\n written += partTimes\n written < times\n }\n}\n\n/**\n * Append number of chunks invoking [block] function while the returned value is true.\n * Depending on the output underlying implementation it could invoke [block] function with the same buffer several times\n * however it is guaranteed that it is always non-empty.\n */\ninternal inline fun Output.writeWhile(block: (Buffer) -> Boolean) {\n var tail: ChunkBuffer = prepareWriteHead(1, null)\n try {\n while (true) {\n if (!block(tail)) break\n tail = prepareWriteHead(1, tail)\n }\n } finally {\n afterHeadWrite()\n }\n}\n\n/**\n * Append number of chunks invoking [block] function while the returned value is positive.\n * If returned value is positive then it will be invoked again with a buffer having at least requested number of\n * bytes space (could be the same buffer as before if it complies to the restriction).\n * @param initialSize for the first buffer passed to [block] function\n */\ninternal inline fun Output.writeWhileSize(initialSize: Int = 1, block: (Buffer) -> Int) {\n var tail = prepareWriteHead(initialSize, null)\n\n try {\n var size: Int\n while (true) {\n size = block(tail)\n if (size <= 0) break\n tail = prepareWriteHead(size, tail)\n }\n } finally {\n afterHeadWrite()\n }\n}\n\nprivate inline fun Output.writeFullyBytesTemplate(\n offset: Int,\n length: Int,\n block: (Buffer, currentOffset: Int, count: Int) -> Unit\n) {\n var currentOffset = offset\n var remaining = length\n\n writeWhile { buffer ->\n val size = minOf(remaining, buffer.writeRemaining)\n block(buffer, currentOffset, size)\n currentOffset += size\n remaining -= size\n remaining > 0\n }\n}\n\nprivate inline fun Output.writeFullyBytesTemplate(\n initialOffset: Long,\n length: Long,\n block: (destination: Memory, destinationOffset: Long, currentOffset: Long, count: Long) -> Unit\n) {\n var currentOffset = initialOffset\n var remaining = length\n\n writeWhile { buffer ->\n val size = minOf(remaining, buffer.writeRemaining.toLong())\n block(buffer.memory, buffer.writePosition.toLong(), currentOffset, size)\n buffer.commitWritten(size.toInt())\n currentOffset += size\n remaining -= size\n remaining > 0\n }\n}\n\nprivate inline fun Output.writeFullyTemplate(\n componentSize: Int,\n offset: Int,\n length: Int,\n block: (Buffer, currentOffset: Int, count: Int) -> Unit\n) {\n var currentOffset = offset\n var remaining = length\n\n writeWhileSize(componentSize) { buffer ->\n val size = minOf(remaining, buffer.writeRemaining)\n block(buffer, currentOffset, size)\n currentOffset += size\n remaining -= size\n remaining * componentSize\n }\n}\n","@file:Suppress(\"NOTHING_TO_INLINE\")\n\npackage io.ktor.utils.io.core\n\nimport io.ktor.utils.io.bits.*\nimport io.ktor.utils.io.core.internal.*\nimport kotlin.contracts.*\n\n/**\n * For every byte from this buffer invokes [block] function giving it as parameter.\n */\npublic inline fun Buffer.forEach(block: (Byte) -> Unit) {\n read { memory, start, endExclusive ->\n for (index in start until endExclusive) {\n block(memory[index])\n }\n endExclusive - start\n }\n}\n\n/**\n * Read an unsigned byte or fail if no bytes available for reading.\n */\npublic fun Buffer.readUByte(): UByte = readByte().toUByte()\n\npublic inline fun ChunkBuffer.readUByte(): UByte = (this as Buffer).readUByte()\n\n/**\n * Write an unsigned byte or fail if not enough space available for writing.\n */\npublic fun Buffer.writeUByte(value: UByte) {\n writeByte(value.toByte())\n}\n\npublic fun ChunkBuffer.writeUByte(value: UByte) {\n (this as Buffer).writeUByte(value)\n}\n\n/**\n * Read a short integer or fail if no bytes available for reading.\n * The numeric value is decoded in the network order (Big Endian).\n */\npublic fun Buffer.readShort(): Short = readExact(2, \"short integer\") { memory, offset ->\n memory.loadShortAt(offset)\n}\n\npublic inline fun ChunkBuffer.readShort(): Short = (this as Buffer).readShort()\n\n/**\n * Read an unsigned short integer or fail if not enough bytes available for reading.\n * The numeric value is decoded in the network order (Big Endian).\n */\npublic fun Buffer.readUShort(): UShort = readExact(2, \"short unsigned integer\") { memory, offset ->\n memory.loadUShortAt(offset)\n}\n\npublic inline fun ChunkBuffer.readUShort(): UShort = (this as Buffer).readUShort()\n\n/**\n * Read an integer or fail if not enough bytes available for reading.\n * The numeric value is decoded in the network order (Big Endian).\n */\npublic fun Buffer.readInt(): Int = readExact(4, \"regular integer\") { memory, offset ->\n memory.loadIntAt(offset)\n}\n\npublic inline fun ChunkBuffer.readInt(): Int = (this as Buffer).readInt()\n\n/**\n * Read an unsigned integer or fail if not enough bytes available for reading.\n * The numeric value is decoded in the network order (Big Endian).\n */\npublic fun Buffer.readUInt(): UInt = readExact(4, \"regular unsigned integer\") { memory, offset ->\n memory.loadUIntAt(offset)\n}\n\npublic inline fun ChunkBuffer.readUInt(): UInt = (this as Buffer).readUInt()\n\n/**\n * Read a long integer or fail if not enough bytes available for reading.\n * The numeric value is decoded in the network order (Big Endian).\n */\npublic fun Buffer.readLong(): Long = readExact(8, \"long integer\") { memory, offset ->\n memory.loadLongAt(offset)\n}\n\npublic inline fun ChunkBuffer.readLong(): Long = (this as Buffer).readLong()\n\n/**\n * Read an unsigned long integer or fail if not enough bytes available for reading.\n * The numeric value is decoded in the network order (Big Endian).\n */\npublic fun Buffer.readULong(): ULong = readExact(8, \"long unsigned integer\") { memory, offset ->\n memory.loadULongAt(offset)\n}\n\npublic inline fun ChunkBuffer.readULong(): ULong = (this as Buffer).readULong()\n\n/**\n * Read a floating point number or fail if not enough bytes available for reading.\n * The numeric value is decoded in the network order (Big Endian).\n */\npublic fun Buffer.readFloat(): Float = readExact(4, \"floating point number\") { memory, offset ->\n memory.loadFloatAt(offset)\n}\n\npublic inline fun ChunkBuffer.readFloat(): Float = (this as Buffer).readFloat()\n\n/**\n * Read a floating point number or fail if not enough bytes available for reading.\n * The numeric value is decoded in the network order (Big Endian).\n */\npublic fun Buffer.readDouble(): Double = readExact(8, \"long floating point number\") { memory, offset ->\n memory.loadDoubleAt(offset)\n}\n\npublic inline fun ChunkBuffer.readDouble(): Double = (this as Buffer).readDouble()\n\n/**\n * Write a short integer or fail if not enough space available for writing.\n * The numeric value is encoded in the network order (Big Endian).\n */\npublic fun Buffer.writeShort(value: Short): Unit = writeExact(2, \"short integer\") { memory, offset ->\n memory.storeShortAt(offset, value)\n}\n\npublic inline fun ChunkBuffer.writeShort(value: Short): Unit = (this as Buffer).writeShort(value)\n\n/**\n * Write an unsigned short integer or fail if not enough space available for writing.\n * The numeric value is encoded in the network order (Big Endian).\n */\npublic fun Buffer.writeUShort(value: UShort): Unit =\n writeExact(2, \"short unsigned integer\") { memory, offset ->\n memory.storeUShortAt(offset, value)\n }\n\npublic inline fun ChunkBuffer.writeUShort(value: UShort): Unit = (this as Buffer).writeUShort(value)\n\n/**\n * Write an integer or fail if not enough space available for writing.\n * The numeric value is encoded in the network order (Big Endian).\n */\npublic fun Buffer.writeInt(value: Int): Unit = writeExact(4, \"regular integer\") { memory, offset ->\n memory.storeIntAt(offset, value)\n}\n\npublic inline fun ChunkBuffer.writeInt(value: Int): Unit = (this as Buffer).writeInt(value)\n\n/**\n * Write an unsigned integer or fail if not enough space available for writing.\n * The numeric value is encoded in the network order (Big Endian).\n */\npublic fun Buffer.writeUInt(value: UInt): Unit = writeExact(4, \"regular unsigned integer\") { memory, offset ->\n memory.storeUIntAt(offset, value)\n}\n\npublic inline fun ChunkBuffer.writeUInt(value: UInt): Unit = (this as Buffer).writeUInt(value)\n\n/**\n * Write a long integer or fail if not enough space available for writing.\n * The numeric value is encoded in the network order (Big Endian).\n */\npublic fun Buffer.writeLong(value: Long): Unit = writeExact(8, \"long integer\") { memory, offset ->\n memory.storeLongAt(offset, value)\n}\n\npublic inline fun ChunkBuffer.writeLong(value: Long): Unit = (this as Buffer).writeLong(value)\n\n/**\n * Write an unsigned long integer or fail if not enough space available for writing.\n * The numeric value is encoded in the network order (Big Endian).\n */\npublic fun Buffer.writeULong(value: ULong): Unit = writeExact(8, \"long unsigned integer\") { memory, offset ->\n memory.storeULongAt(offset, value)\n}\n\npublic inline fun ChunkBuffer.writeULong(value: ULong): Unit = (this as Buffer).writeULong(value)\n\n/**\n * Write a floating point number or fail if not enough space available for writing.\n * The numeric value is encoded in the network order (Big Endian).\n */\npublic fun Buffer.writeFloat(value: Float) {\n writeExact(4, \"floating point number\") { memory, offset ->\n memory.storeFloatAt(offset, value)\n }\n}\n\npublic inline fun ChunkBuffer.writeFloat(value: Float) {\n (this as Buffer).writeFloat(value)\n}\n\n/**\n * Write a floating point number or fail if not enough space available for writing.\n * The numeric value is encoded in the network order (Big Endian).\n */\npublic fun Buffer.writeDouble(value: Double) {\n writeExact(8, \"long floating point number\") { memory, offset ->\n memory.storeDoubleAt(offset, value)\n }\n}\n\npublic inline fun ChunkBuffer.writeDouble(value: Double) {\n (this as Buffer).writeDouble(value)\n}\n\n/**\n * Read from this buffer to the [destination] array to [offset] and [length] bytes.\n */\npublic fun Buffer.readFully(destination: ByteArray, offset: Int = 0, length: Int = destination.size - offset) {\n readExact(length, \"byte array\") { memory, srcOffset ->\n memory.loadByteArray(srcOffset, destination, offset, length)\n }\n}\n\npublic inline fun ChunkBuffer.readFully(\n destination: ByteArray,\n offset: Int = 0,\n length: Int = destination.size - offset\n) {\n (this as Buffer).readFully(destination, offset, length)\n}\n\n/**\n * Read from this buffer to the [destination] array to [offset] and [length] bytes.\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic fun Buffer.readFully(destination: UByteArray, offset: Int = 0, length: Int = destination.size - offset) {\n readFully(destination.asByteArray(), offset, length)\n}\n\n/**\n * Read available for read bytes to the [destination] array range starting at array [offset] and [length] bytes.\n * If less than [length] bytes available then less bytes will be copied and the corresponding number\n * will be returned as result.\n * @return number of bytes copied to the [destination] or `-1` if the buffer is empty\n */\npublic fun Buffer.readAvailable(destination: ByteArray, offset: Int = 0, length: Int = destination.size - offset): Int {\n require(offset >= 0) { \"offset shouldn't be negative: $offset\" }\n require(length >= 0) { \"length shouldn't be negative: $length\" }\n require(offset + length <= destination.size) {\n \"offset + length should be less than the destination size: $offset\" +\n \" + $length > ${destination.size}\"\n }\n\n if (!canRead()) return -1\n val toBeRead = minOf(length, readRemaining)\n readFully(destination, offset, toBeRead)\n return toBeRead\n}\n\npublic inline fun ChunkBuffer.readAvailable(\n destination: ByteArray,\n offset: Int = 0,\n length: Int = destination.size - offset\n): Int {\n return (this as Buffer).readAvailable(destination, offset, length)\n}\n\n/**\n * Read available for read bytes to the [destination] array range starting at array [offset] and [length] bytes.\n * If less than [length] bytes available then less bytes will be copied and the corresponding number\n * will be returned as result.\n * @return number of bytes copied to the [destination] or `-1` if the buffer is empty\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic fun Buffer.readAvailable(\n destination: UByteArray,\n offset: Int = 0,\n length: Int = destination.size - offset\n): Int {\n return readAvailable(destination.asByteArray(), offset, length)\n}\n\n/**\n * Write the whole [source] array range staring at [offset] and having the specified bytes [length].\n */\npublic fun Buffer.writeFully(source: ByteArray, offset: Int = 0, length: Int = source.size - offset) {\n writeExact(length, \"byte array\") { memory, dstOffset ->\n memory.storeByteArray(dstOffset, source, offset, length)\n }\n}\n\npublic inline fun ChunkBuffer.writeFully(source: ByteArray, offset: Int = 0, length: Int = source.size - offset) {\n (this as Buffer).writeFully(source, offset, length)\n}\n\n/**\n * Write the whole [source] array range staring at [offset] and having the specified bytes [length].\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic fun Buffer.writeFully(source: UByteArray, offset: Int = 0, length: Int = source.size - offset) {\n writeFully(source.asByteArray(), offset, length)\n}\n\n/**\n * Read from this buffer to the [destination] array to [offset] and [length] bytes.\n * Numeric values are interpreted in the network byte order (Big Endian).\n */\npublic fun Buffer.readFully(destination: ShortArray, offset: Int = 0, length: Int = destination.size - offset) {\n readExact(length * 2, \"short integers array\") { memory, srcOffset ->\n memory.loadShortArray(srcOffset, destination, offset, length)\n }\n}\n\n/**\n * Read from this buffer to the [destination] array to [offset] and [length] bytes.\n * Numeric values are interpreted in the network byte order (Big Endian).\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic fun Buffer.readFully(destination: UShortArray, offset: Int = 0, length: Int = destination.size - offset) {\n readFully(destination.asShortArray(), offset, length)\n}\n\n/**\n * Read available for read bytes to the [destination] array range starting at array [offset] and [length] elements.\n * If less than [length] elements available then less elements will be copied and the corresponding number\n * will be returned as result (possibly zero).\n *\n * @return number of elements copied to the [destination] or `-1` if the buffer is empty,\n * `0` - not enough bytes for at least an element\n */\npublic fun Buffer.readAvailable(\n destination: ShortArray,\n offset: Int = 0,\n length: Int = destination.size - offset\n): Int {\n require(offset >= 0) { \"offset shouldn't be negative: $offset\" }\n require(length >= 0) { \"length shouldn't be negative: $length\" }\n require(offset + length <= destination.size) {\n \"offset + length should be less than the destination size: $offset\" +\n \" + $length > ${destination.size}\"\n }\n\n if (!canRead()) return -1\n val toBeRead = minOf(length / 2, readRemaining)\n readFully(destination, offset, toBeRead)\n return toBeRead\n}\n\n/**\n * Read available for read bytes to the [destination] array range starting at array [offset] and [length] elements.\n * If less than [length] elements available then less elements will be copied and the corresponding number\n * will be returned as result (possibly zero).\n *\n * @return number of elements copied to the [destination] or `-1` if the buffer is empty,\n * `0` - not enough bytes for at least an element\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic fun Buffer.readAvailable(\n destination: UShortArray,\n offset: Int = 0,\n length: Int = destination.size - offset\n): Int {\n return readAvailable(destination.asShortArray(), offset, length)\n}\n\n/**\n * Write the whole [source] array range staring at [offset] and having the specified items [length].\n * Numeric values are interpreted in the network byte order (Big Endian).\n */\npublic fun Buffer.writeFully(source: ShortArray, offset: Int = 0, length: Int = source.size - offset) {\n writeExact(length * 2, \"short integers array\") { memory, dstOffset ->\n memory.storeShortArray(dstOffset, source, offset, length)\n }\n}\n\n/**\n * Write the whole [source] array range staring at [offset] and having the specified items [length].\n * Numeric values are interpreted in the network byte order (Big Endian).\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic fun Buffer.writeFully(source: UShortArray, offset: Int = 0, length: Int = source.size - offset) {\n writeFully(source.asShortArray(), offset, length)\n}\n\n/**\n * Read from this buffer to the [destination] array to [offset] and [length] bytes.\n * Numeric values are interpreted in the network byte order (Big Endian).\n */\npublic fun Buffer.readFully(destination: IntArray, offset: Int = 0, length: Int = destination.size - offset) {\n readExact(length * 4, \"integers array\") { memory, srcOffset ->\n memory.loadIntArray(srcOffset, destination, offset, length)\n }\n}\n\n/**\n * Read from this buffer to the [destination] array to [offset] and [length] bytes.\n * Numeric values are interpreted in the network byte order (Big Endian).\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic fun Buffer.readFully(destination: UIntArray, offset: Int = 0, length: Int = destination.size - offset) {\n readFully(destination.asIntArray(), offset, length)\n}\n\n/**\n * Read available for read bytes to the [destination] array range starting at array [offset] and [length] elements.\n * If less than [length] elements available then less elements will be copied and the corresponding number\n * will be returned as result (possibly zero).\n *\n * @return number of elements copied to the [destination] or `-1` if the buffer is empty,\n * `0` - not enough bytes for at least an element\n */\npublic fun Buffer.readAvailable(destination: IntArray, offset: Int = 0, length: Int = destination.size - offset): Int {\n require(offset >= 0) { \"offset shouldn't be negative: $offset\" }\n require(length >= 0) { \"length shouldn't be negative: $length\" }\n require(offset + length <= destination.size) {\n \"offset + length should be less than the destination size: $offset\" +\n \" + $length > ${destination.size}\"\n }\n\n if (!canRead()) return -1\n val toBeRead = minOf(length / 4, readRemaining)\n readFully(destination, offset, toBeRead)\n return toBeRead\n}\n\n/**\n * Read available for read bytes to the [destination] array range starting at array [offset] and [length] elements.\n * If less than [length] elements available then less elements will be copied and the corresponding number\n * will be returned as result (possibly zero).\n *\n * @return number of elements copied to the [destination] or `-1` if the buffer is empty,\n * `0` - not enough bytes for at least an element\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic fun Buffer.readAvailable(destination: UIntArray, offset: Int = 0, length: Int = destination.size - offset): Int {\n return readAvailable(destination.asIntArray(), offset, length)\n}\n\n/**\n * Write the whole [source] array range staring at [offset] and having the specified items [length].\n * Numeric values are interpreted in the network byte order (Big Endian).\n */\npublic fun Buffer.writeFully(source: IntArray, offset: Int = 0, length: Int = source.size - offset) {\n writeExact(length * 4, \"integers array\") { memory, dstOffset ->\n memory.storeIntArray(dstOffset, source, offset, length)\n }\n}\n\n/**\n * Write the whole [source] array range staring at [offset] and having the specified items [length].\n * Numeric values are interpreted in the network byte order (Big Endian).\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic fun Buffer.writeFully(source: UIntArray, offset: Int = 0, length: Int = source.size - offset) {\n writeFully(source.asIntArray(), offset, length)\n}\n\n/**\n * Read from this buffer to the [destination] array to [offset] and [length] bytes.\n * Numeric values are interpreted in the network byte order (Big Endian).\n */\npublic fun Buffer.readFully(destination: LongArray, offset: Int = 0, length: Int = destination.size - offset) {\n readExact(length * 8, \"long integers array\") { memory, srcOffset ->\n memory.loadLongArray(srcOffset, destination, offset, length)\n }\n}\n\n/**\n * Read from this buffer to the [destination] array to [offset] and [length] bytes.\n * Numeric values are interpreted in the network byte order (Big Endian).\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic fun Buffer.readFully(destination: ULongArray, offset: Int = 0, length: Int = destination.size - offset) {\n readFully(destination.asLongArray(), offset, length)\n}\n\n/**\n * Read available for read bytes to the [destination] array range starting at array [offset] and [length] elements.\n * If less than [length] elements available then less elements will be copied and the corresponding number\n * will be returned as result (possibly zero).\n *\n * @return number of elements copied to the [destination] or `-1` if the buffer is empty,\n * `0` - not enough bytes for at least an element\n */\npublic fun Buffer.readAvailable(destination: LongArray, offset: Int = 0, length: Int = destination.size - offset): Int {\n require(offset >= 0) { \"offset shouldn't be negative: $offset\" }\n require(length >= 0) { \"length shouldn't be negative: $length\" }\n require(offset + length <= destination.size) {\n \"offset + length should be less than the destination size: $offset\" +\n \" + $length > ${destination.size}\"\n }\n\n if (!canRead()) return -1\n val toBeRead = minOf(length / 8, readRemaining)\n readFully(destination, offset, toBeRead)\n return toBeRead\n}\n\n/**\n * Read available for read bytes to the [destination] array range starting at array [offset] and [length] elements.\n * If less than [length] elements available then less elements will be copied and the corresponding number\n * will be returned as result (possibly zero).\n *\n * @return number of elements copied to the [destination] or `-1` if the buffer is empty,\n * `0` - not enough bytes for at least an element\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic fun Buffer.readAvailable(\n destination: ULongArray,\n offset: Int = 0,\n length: Int = destination.size - offset\n): Int {\n return readAvailable(destination.asLongArray(), offset, length)\n}\n\n/**\n * Write the whole [source] array range staring at [offset] and having the specified items [length].\n * Numeric values are interpreted in the network byte order (Big Endian).\n */\npublic fun Buffer.writeFully(source: LongArray, offset: Int = 0, length: Int = source.size - offset) {\n writeExact(length * 8, \"long integers array\") { memory, dstOffset ->\n memory.storeLongArray(dstOffset, source, offset, length)\n }\n}\n\n/**\n * Write the whole [source] array range staring at [offset] and having the specified items [length].\n * Numeric values are interpreted in the network byte order (Big Endian).\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic fun Buffer.writeFully(source: ULongArray, offset: Int = 0, length: Int = source.size - offset) {\n writeFully(source.asLongArray(), offset, length)\n}\n\n/**\n * Read from this buffer to the [destination] array to [offset] and [length] bytes.\n * Numeric values are interpreted in the network byte order (Big Endian).\n */\npublic fun Buffer.readFully(destination: FloatArray, offset: Int = 0, length: Int = destination.size - offset) {\n readExact(length * 4, \"floating point numbers array\") { memory, srcOffset ->\n memory.loadFloatArray(srcOffset, destination, offset, length)\n }\n}\n\n/**\n * Read available for read bytes to the [destination] array range starting at array [offset] and [length] elements.\n * If less than [length] elements available then less elements will be copied and the corresponding number\n * will be returned as result (possibly zero).\n *\n * @return number of elements copied to the [destination] or `-1` if the buffer is empty,\n * `0` - not enough bytes for at least an element\n */\npublic fun Buffer.readAvailable(\n destination: FloatArray,\n offset: Int = 0,\n length: Int = destination.size - offset\n): Int {\n require(offset >= 0) { \"offset shouldn't be negative: $offset\" }\n require(length >= 0) { \"length shouldn't be negative: $length\" }\n require(offset + length <= destination.size) {\n \"offset + length should be less than the destination size: $offset\" +\n \" + $length > ${destination.size}\"\n }\n\n if (!canRead()) return -1\n val toBeRead = minOf(length / 4, readRemaining)\n readFully(destination, offset, toBeRead)\n return toBeRead\n}\n\n/**\n * Write the whole [source] array range staring at [offset] and having the specified items [length].\n * Numeric values are interpreted in the network byte order (Big Endian).\n */\npublic fun Buffer.writeFully(source: FloatArray, offset: Int = 0, length: Int = source.size - offset) {\n writeExact(length * 4, \"floating point numbers array\") { memory, dstOffset ->\n memory.storeFloatArray(dstOffset, source, offset, length)\n }\n}\n\n/**\n * Read from this buffer to the [destination] array to [offset] and [length] bytes.\n * Numeric values are interpreted in the network byte order (Big Endian).\n */\npublic fun Buffer.readFully(destination: DoubleArray, offset: Int = 0, length: Int = destination.size - offset) {\n readExact(length * 8, \"floating point numbers array\") { memory, srcOffset ->\n memory.loadDoubleArray(srcOffset, destination, offset, length)\n }\n}\n\n/**\n * Read available for read bytes to the [destination] array range starting at array [offset] and [length] elements.\n * If less than [length] elements available then less elements will be copied and the corresponding number\n * will be returned as result (possibly zero).\n *\n * @return number of elements copied to the [destination] or `-1` if the buffer is empty,\n * `0` - not enough bytes for at least an element\n */\npublic fun Buffer.readAvailable(\n destination: DoubleArray,\n offset: Int = 0,\n length: Int = destination.size - offset\n): Int {\n require(offset >= 0) { \"offset shouldn't be negative: $offset\" }\n require(length >= 0) { \"length shouldn't be negative: $length\" }\n require(offset + length <= destination.size) {\n \"offset + length should be less than the destination size: $offset\" +\n \" + $length > ${destination.size}\"\n }\n\n if (!canRead()) return -1\n val toBeRead = minOf(length / 8, readRemaining)\n readFully(destination, offset, toBeRead)\n return toBeRead\n}\n\n/**\n * Write the whole [source] array range staring at [offset] and having the specified items [length].\n * Numeric values are interpreted in the network byte order (Big Endian).\n */\npublic fun Buffer.writeFully(source: DoubleArray, offset: Int = 0, length: Int = source.size - offset) {\n writeExact(length * 8, \"floating point numbers array\") { memory, dstOffset ->\n memory.storeDoubleArray(dstOffset, source, offset, length)\n }\n}\n\n/**\n * Read at most [length] bytes from this buffer to the [dst] buffer.\n * @return number of bytes copied\n */\npublic fun Buffer.readFully(dst: Buffer, length: Int = dst.writeRemaining): Int {\n require(length >= 0)\n require(length <= dst.writeRemaining)\n\n readExact(length, \"buffer content\") { memory, offset ->\n memory.copyTo(dst.memory, offset, length, dst.writePosition)\n dst.commitWritten(length)\n }\n\n return length\n}\n\n/**\n * Read at most [length] available bytes to the [dst] buffer or `-1` if no bytes available for read.\n * @return number of bytes copied or `-1` if empty\n */\npublic fun Buffer.readAvailable(dst: Buffer, length: Int = dst.writeRemaining): Int {\n if (!canRead()) return -1\n\n val readSize = minOf(dst.writeRemaining, readRemaining, length)\n\n readExact(readSize, \"buffer content\") { memory, offset ->\n memory.copyTo(dst.memory, offset, readSize, dst.writePosition)\n dst.commitWritten(readSize)\n }\n\n return readSize\n}\n\n/**\n * Write all readable bytes from [src] to this buffer. Fails if not enough space available to write all bytes.\n */\npublic fun Buffer.writeFully(src: Buffer) {\n val length = src.readRemaining\n\n writeExact(length, \"buffer readable content\") { memory, offset ->\n src.memory.copyTo(memory, src.readPosition, length, offset)\n src.discardExact(length)\n }\n}\n\n/**\n * Write at most [length] readable bytes from [src] to this buffer.\n * Fails if not enough space available to write all bytes.\n */\npublic fun Buffer.writeFully(src: Buffer, length: Int) {\n require(length >= 0) { \"length shouldn't be negative: $length\" }\n require(length <= src.readRemaining) {\n \"length shouldn't be greater than the source read remaining: $length > ${src.readRemaining}\"\n }\n require(length <= writeRemaining) {\n \"length shouldn't be greater than the destination write remaining space: $length > $writeRemaining\"\n }\n\n writeExact(length, \"buffer readable content\") { memory, offset ->\n src.memory.copyTo(memory, src.readPosition, length, offset)\n src.discardExact(length)\n }\n}\n\n@OptIn(ExperimentalContracts::class)\n@PublishedApi\ninternal inline fun Buffer.readExact(size: Int, name: String, block: (memory: Memory, offset: Int) -> R): R {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n\n var value: R\n\n read { memory, start, endExclusive ->\n if (endExclusive - start < size) {\n throw EOFException(\"Not enough bytes to read a $name of size $size.\")\n }\n\n value = block(memory, start)\n size\n }\n\n return value\n}\n\n@OptIn(ExperimentalContracts::class)\n@PublishedApi\ninternal inline fun Buffer.writeExact(size: Int, name: String, block: (memory: Memory, offset: Int) -> Unit) {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n\n write { memory, start, endExclusive ->\n val writeRemaining = endExclusive - start\n if (writeRemaining < size) {\n throw InsufficientSpaceException(name, size, writeRemaining)\n }\n block(memory, start)\n size\n }\n}\n","@file:Suppress(\"NOTHING_TO_INLINE\")\n\npackage io.ktor.utils.io.core\n\nimport io.ktor.utils.io.bits.*\nimport io.ktor.utils.io.core.internal.*\nimport io.ktor.utils.io.errors.EOFException\nimport kotlin.contracts.*\n\n/**\n * Represents a buffer with read and write positions.\n *\n * Concurrent unsafe: the same memory could be shared between different instances of [Buffer] however you can't\n * read/write using the same [Buffer] instance from different threads.\n */\npublic open class Buffer(public val memory: Memory) {\n\n /**\n * Current read position. It is always non-negative and will never run ahead of the [writePosition].\n * It is usually greater or equal to [startGap] reservation.\n * This position is affected by [discard], [rewind], [resetForRead], [resetForWrite], [reserveStartGap]\n * and [reserveEndGap].\n */\n public var readPosition: Int = 0\n private set\n\n /**\n * Current write position. It is always non-negative and will never run ahead of the [limit].\n * It is always greater or equal to the [readPosition].\n * * This position is affected by [resetForRead], [resetForWrite], [reserveStartGap]\n * and [reserveEndGap].\n */\n public var writePosition: Int = 0\n private set\n\n /**\n * Start gap is a reserved space in the beginning. The reserved space is usually used to write a packet length\n * in the case when it's not known before the packet constructed.\n */\n public var startGap: Int = 0\n private set\n\n /**\n * Write position limit. No bytes could be written ahead of this limit. When the limit is less than the [capacity]\n * then this means that there are reserved bytes in the end ([endGap]). Such a reserved space in the end could be used\n * to write size, hash and so on. Also it is useful when several buffers are connected into a chain and some\n * primitive value (e.g. `kotlin.Int`) is separated into two chunks so bytes from the second chain could be copied\n * to the reserved space of the first chunk and then the whole value could be read at once.\n */\n public var limit: Int = memory.size32\n private set\n\n /**\n * Number of bytes reserved in the end.\n */\n public inline val endGap: Int get() = capacity - limit\n\n /**\n * Buffer's capacity (including reserved [startGap] and [endGap]). Value for released buffer is unspecified.\n */\n public val capacity: Int = memory.size32\n\n /**\n * Number of bytes available for reading.\n */\n public inline val readRemaining: Int get() = writePosition - readPosition\n\n /**\n * Size of the free space available for writing in bytes.\n */\n public inline val writeRemaining: Int get() = limit - writePosition\n\n /**\n * Discard [count] readable bytes.\n *\n * @throws EOFException if [count] is bigger than available bytes.\n */\n public fun discardExact(count: Int = readRemaining) {\n if (count == 0) return\n\n val newReadPosition = readPosition + count\n if (count < 0 || newReadPosition > writePosition) {\n discardFailed(count, readRemaining)\n }\n readPosition = newReadPosition\n }\n\n public fun commitWritten(count: Int) {\n val newWritePosition = writePosition + count\n if (count < 0 || newWritePosition > limit) {\n commitWrittenFailed(count, writeRemaining)\n }\n writePosition = newWritePosition\n }\n\n /**\n * @return `true` if there is free space\n */\n @PublishedApi\n internal fun commitWrittenUntilIndex(position: Int): Boolean {\n val limit = limit\n if (position < writePosition) {\n commitWrittenFailed(position - writePosition, writeRemaining)\n }\n if (position >= limit) {\n if (position == limit) {\n writePosition = position\n return false\n }\n commitWrittenFailed(position - writePosition, writeRemaining)\n }\n\n writePosition = position\n return true\n }\n\n internal fun discardUntilIndex(position: Int) {\n if (position < 0 || position > writePosition) {\n discardFailed(position - readPosition, readRemaining)\n }\n\n if (readPosition != position) {\n readPosition = position\n }\n }\n\n /**\n * Rewind [readPosition] backward to make [count] bytes available for reading again.\n * @throws IllegalArgumentException when [count] is too big and not enough bytes available before the [readPosition]\n */\n public fun rewind(count: Int = readPosition - startGap) {\n val newReadPosition = readPosition - count\n if (newReadPosition < startGap) {\n rewindFailed(count, readPosition - startGap)\n }\n readPosition = newReadPosition\n }\n\n /**\n * Reserve [startGap] bytes in the beginning.\n * May move [readPosition] and [writePosition] if no bytes available for reading.\n */\n public fun reserveStartGap(startGap: Int) {\n require(startGap >= 0) { \"startGap shouldn't be negative: $startGap\" }\n\n if (readPosition >= startGap) {\n this.startGap = startGap\n return\n }\n\n if (readPosition == writePosition) {\n if (startGap > limit) {\n startGapReservationFailedDueToLimit(startGap)\n }\n\n this.writePosition = startGap\n this.readPosition = startGap\n this.startGap = startGap\n return\n }\n\n startGapReservationFailed(startGap)\n }\n\n /**\n * Reserve [endGap] bytes in the end.\n * Could move [readPosition] and [writePosition] to reserve space but only when no bytes were written or\n * all written bytes are marked as consumed (were read or discarded).\n */\n public fun reserveEndGap(endGap: Int) {\n require(endGap >= 0) { \"endGap shouldn't be negative: $endGap\" }\n\n val newLimit = capacity - endGap\n if (newLimit >= writePosition) {\n limit = newLimit\n return\n }\n\n if (newLimit < 0) {\n endGapReservationFailedDueToCapacity(endGap)\n }\n if (newLimit < startGap) {\n endGapReservationFailedDueToStartGap(endGap)\n }\n\n if (readPosition == writePosition) {\n limit = newLimit\n readPosition = newLimit\n writePosition = newLimit\n return\n }\n\n endGapReservationFailedDueToContent(endGap)\n }\n\n /**\n * Marks the whole buffer available for read and no for write\n */\n public fun resetForRead() {\n startGap = 0\n readPosition = 0\n\n val capacity = capacity\n writePosition = capacity\n }\n\n /**\n * Marks all capacity writable except the start gap reserved before. The end gap reservation is discarded.\n */\n public fun resetForWrite() {\n resetForWrite(capacity - startGap)\n }\n\n /**\n * Marks up to [limit] bytes of the buffer available for write and no bytes for read.\n * It does respect [startGap] already reserved. All extra bytes after the specified [limit]\n * are considered as [endGap].\n */\n public fun resetForWrite(limit: Int) {\n val startGap = startGap\n readPosition = startGap\n writePosition = startGap\n this.limit = limit\n }\n\n /**\n * Forget start/end gap reservations.\n */\n internal fun releaseGaps() {\n releaseStartGap(0)\n releaseEndGap()\n }\n\n internal fun releaseEndGap() {\n limit = capacity\n }\n\n internal fun releaseStartGap(newReadPosition: Int) {\n require(newReadPosition >= 0) { \"newReadPosition shouldn't be negative: $newReadPosition\" }\n require(newReadPosition <= readPosition) {\n \"newReadPosition shouldn't be ahead of the read position: $newReadPosition > $readPosition\"\n }\n\n readPosition = newReadPosition\n if (startGap > newReadPosition) {\n startGap = newReadPosition\n }\n }\n\n protected open fun duplicateTo(copy: Buffer) {\n copy.limit = limit\n copy.startGap = startGap\n copy.readPosition = readPosition\n copy.writePosition = writePosition\n }\n\n /**\n * Create a new [Buffer] instance pointing to the same memory and having the same positions.\n */\n public open fun duplicate(): Buffer = Buffer(memory).apply {\n duplicateTo(this)\n }\n\n /**\n * Peek the next unsigned byte or return `-1` if no more bytes available for reading. No bytes will be marked\n * as consumed in any case.\n * @return an unsigned byte or `-1` if not even a byte is available for reading.\n * @see tryReadByte\n * @see readByte\n */\n public fun tryPeekByte(): Int {\n val readPosition = readPosition\n if (readPosition == writePosition) return -1\n return memory[readPosition].toInt() and 0xff\n }\n\n /**\n * Read the next unsigned byte or return `-1` if no more bytes available for reading. The returned byte is marked\n * as consumed.\n * @return an unsigned byte or `-1` if not even a byte is available for reading.\n * @see tryPeekByte\n * @see readByte\n */\n public fun tryReadByte(): Int {\n val readPosition = readPosition\n if (readPosition == writePosition) return -1\n this.readPosition = readPosition + 1\n return memory[readPosition].toInt() and 0xff\n }\n\n /**\n * Read the next byte or fail with [EOFException] if it's not available. The returned byte is marked\n * as consumed.\n * @throws EOFException when not even a byte is available for reading.\n * @see tryPeekByte\n * @see tryReadByte\n */\n public fun readByte(): Byte {\n val readPosition = readPosition\n if (readPosition == writePosition) {\n throw EOFException(\"No readable bytes available.\")\n }\n this.readPosition = readPosition + 1\n return memory[readPosition]\n }\n\n /**\n * Write a byte [value] at [writePosition] (incremented when written successfully).\n * @throws InsufficientSpaceException when no free space in the buffer.\n */\n public fun writeByte(value: Byte) {\n val writePosition = writePosition\n if (writePosition == limit) {\n throw InsufficientSpaceException(\"No free space in the buffer to write a byte\")\n }\n memory[writePosition] = value\n this.writePosition = writePosition + 1\n }\n\n /**\n * Clear buffer's state: read/write positions, gaps and so on. Byte content is not cleaned-up.\n */\n public open fun reset() {\n releaseGaps()\n resetForWrite()\n }\n\n override fun toString(): String {\n return \"Buffer($readRemaining used, $writeRemaining free, ${startGap + endGap} reserved of $capacity)\"\n }\n\n public companion object {\n /**\n * Number of bytes usually reserved in the end of chunk\n * when several instances of [io.ktor.utils.io.core.internal.ChunkBuffer] are connected into a chain (usually inside of [ByteReadPacket]\n * or [BytePacketBuilder])\n */\n public const val ReservedSize: Int = 8\n\n /**\n * The empty buffer singleton: it has zero capacity for read and write.\n */\n public val Empty: Buffer get() = ChunkBuffer.Empty\n }\n}\n\n/**\n * @return `true` if there are available bytes to be read\n */\npublic inline fun Buffer.canRead(): Boolean = writePosition > readPosition\n\n/**\n * @return `true` if there is free room to for write\n */\npublic inline fun Buffer.canWrite(): Boolean = limit > writePosition\n\n/**\n * Apply [block] of code with buffer's memory providing read range indices. The returned value of [block] lambda should\n * return number of bytes to be marked as consumed.\n * No read/write functions on this buffer should be called inside of [block] otherwise an undefined behaviour may occur\n * including data damage.\n */\n@OptIn(ExperimentalContracts::class)\npublic inline fun Buffer.read(block: (memory: Memory, start: Int, endExclusive: Int) -> Int): Int {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n\n val rc = block(memory, readPosition, writePosition)\n discardExact(rc)\n return rc\n}\n\n/**\n * Apply [block] of code with buffer's memory providing write range indices. The returned value of [block] lambda should\n * return number of bytes were written.\n * o read/write functions on this buffer should be called inside of [block] otherwise an undefined behaviour may occur\n * including data damage.\n */\n@OptIn(ExperimentalContracts::class)\npublic inline fun Buffer.write(block: (memory: Memory, start: Int, endExclusive: Int) -> Int): Int {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n\n val rc = block(memory, writePosition, limit)\n commitWritten(rc)\n return rc\n}\n\ninternal fun discardFailed(count: Int, readRemaining: Int): Nothing {\n throw EOFException(\"Unable to discard $count bytes: only $readRemaining available for reading\")\n}\n\ninternal fun commitWrittenFailed(count: Int, writeRemaining: Int): Nothing {\n throw EOFException(\"Unable to discard $count bytes: only $writeRemaining available for writing\")\n}\n\ninternal fun rewindFailed(count: Int, rewindRemaining: Int): Nothing {\n throw IllegalArgumentException(\"Unable to rewind $count bytes: only $rewindRemaining could be rewinded\")\n}\n\ninternal fun Buffer.startGapReservationFailedDueToLimit(startGap: Int): Nothing {\n if (startGap > capacity) {\n throw IllegalArgumentException(\"Start gap $startGap is bigger than the capacity $capacity\")\n }\n\n throw IllegalStateException(\n \"Unable to reserve $startGap start gap: there are already $endGap bytes reserved in the end\"\n )\n}\n\ninternal fun Buffer.startGapReservationFailed(startGap: Int): Nothing {\n throw IllegalStateException(\n \"Unable to reserve $startGap start gap: \" +\n \"there are already $readRemaining content bytes starting at offset $readPosition\"\n )\n}\n\ninternal fun Buffer.endGapReservationFailedDueToCapacity(endGap: Int) {\n throw IllegalArgumentException(\"End gap $endGap is too big: capacity is $capacity\")\n}\n\ninternal fun Buffer.endGapReservationFailedDueToStartGap(endGap: Int) {\n throw IllegalArgumentException(\n \"End gap $endGap is too big: there are already $startGap bytes reserved in the beginning\"\n )\n}\n\ninternal fun Buffer.endGapReservationFailedDueToContent(endGap: Int) {\n throw IllegalArgumentException(\n \"Unable to reserve end gap $endGap:\" +\n \" there are already $readRemaining content bytes at offset $readPosition\"\n )\n}\n\ninternal fun Buffer.restoreStartGap(size: Int) {\n releaseStartGap(readPosition - size)\n}\n\npublic class InsufficientSpaceException(message: String = \"Not enough free space\") : Exception(message) {\n public constructor(\n size: Int,\n availableSpace: Int\n ) : this(\"Not enough free space to write $size bytes, available $availableSpace bytes.\")\n\n public constructor(\n name: String,\n size: Int,\n availableSpace: Int\n ) : this(\"Not enough free space to write $name of $size bytes, available $availableSpace bytes.\")\n\n public constructor(\n size: Long,\n availableSpace: Long\n ) : this(\"Not enough free space to write $size bytes, available $availableSpace bytes.\")\n}\n","package io.ktor.utils.io.core\n\nimport kotlin.contracts.*\n\npublic expect val PACKET_MAX_COPY_SIZE: Int\n\n/**\n * Build a byte packet in [block] lambda. Creates a temporary builder and releases it in case of failure\n */\n@OptIn(ExperimentalContracts::class)\npublic inline fun buildPacket(block: BytePacketBuilder.() -> Unit): ByteReadPacket {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n\n val builder = BytePacketBuilder()\n try {\n block(builder)\n return builder.build()\n } catch (t: Throwable) {\n builder.release()\n throw t\n }\n}\n\n/**\n * Discard all written bytes and prepare to build another packet.\n */\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\npublic fun BytePacketBuilder.reset() {\n release()\n}\n","@file:Suppress(\"NOTHING_TO_INLINE\")\n\npackage io.ktor.utils.io.bits\n\nimport io.ktor.utils.io.core.internal.*\nimport org.khronos.webgl.*\nimport kotlin.require\n\n/**\n * Represents a linear range of bytes.\n */\npublic actual class Memory constructor(public val view: DataView) {\n /**\n * Size of memory range in bytes.\n */\n public actual inline val size: Long get() = view.byteLength.toLong()\n\n /**\n * Size of memory range in bytes represented as signed 32bit integer\n * @throws IllegalStateException when size doesn't fit into a signed 32bit integer\n */\n public actual inline val size32: Int get() = view.byteLength\n\n /**\n * Returns byte at [index] position.\n */\n public actual inline fun loadAt(index: Int): Byte {\n return view.getInt8(index)\n }\n\n /**\n * Returns byte at [index] position.\n */\n public actual inline fun loadAt(index: Long): Byte {\n return view.getInt8(index.toIntOrFail(\"index\"))\n }\n\n /**\n * Write [value] at the specified [index].\n */\n public actual inline fun storeAt(index: Int, value: Byte) {\n view.setInt8(index, value)\n }\n\n /**\n * Write [value] at the specified [index]\n */\n public actual inline fun storeAt(index: Long, value: Byte) {\n view.setInt8(index.toIntOrFail(\"index\"), value)\n }\n\n /**\n * Returns memory's subrange. On some platforms it could do range checks but it is not guaranteed to be safe.\n * It also could lead to memory allocations on some platforms.\n */\n public actual fun slice(offset: Int, length: Int): Memory {\n require(offset >= 0) { \"offset shouldn't be negative: $offset\" }\n require(length >= 0) { \"length shouldn't be negative: $length\" }\n if (offset + length > size) {\n throw IndexOutOfBoundsException(\"offset + length > size: $offset + $length > $size\")\n }\n\n return Memory(\n DataView(\n view.buffer,\n view.byteOffset + offset,\n length\n )\n )\n }\n\n /**\n * Returns memory's subrange. On some platforms it could do range checks but it is not guaranteed to be safe.\n * It also could lead to memory allocations on some platforms.\n */\n public actual fun slice(offset: Long, length: Long): Memory {\n return slice(offset.toIntOrFail(\"offset\"), length.toIntOrFail(\"length\"))\n }\n\n /**\n * Copies bytes from this memory range from the specified [offset] and [length]\n * to the [destination] at [destinationOffset].\n * Copying bytes from a memory to itself is allowed.\n */\n public actual fun copyTo(\n destination: Memory,\n offset: Int,\n length: Int,\n destinationOffset: Int\n ) {\n val src = Int8Array(view.buffer, view.byteOffset + offset, length)\n val dst = Int8Array(destination.view.buffer, destination.view.byteOffset + destinationOffset, length)\n\n dst.set(src)\n }\n\n /**\n * Copies bytes from this memory range from the specified [offset] and [length]\n * to the [destination] at [destinationOffset].\n * Copying bytes from a memory to itself is allowed.\n */\n public actual fun copyTo(\n destination: Memory,\n offset: Long,\n length: Long,\n destinationOffset: Long\n ) {\n copyTo(\n destination,\n offset.toIntOrFail(\"offset\"),\n length.toIntOrFail(\"length\"),\n destinationOffset.toIntOrFail(\"destinationOffset\")\n )\n }\n\n public actual companion object {\n /**\n * Represents an empty memory region\n */\n public actual val Empty: Memory = Memory(DataView(ArrayBuffer(0)))\n }\n}\n\n/**\n * Copies bytes from this memory range from the specified [offset] and [length]\n * to the [destination] at [destinationOffset].\n */\npublic actual fun Memory.copyTo(\n destination: ByteArray,\n offset: Int,\n length: Int,\n destinationOffset: Int\n) {\n @Suppress(\"UnsafeCastFromDynamic\")\n val to: Int8Array = destination.asDynamic()\n\n val from = Int8Array(view.buffer, view.byteOffset + offset, length)\n\n to.set(from, destinationOffset)\n}\n\n/**\n * Copies bytes from this memory range from the specified [offset] and [length]\n * to the [destination] at [destinationOffset].\n */\npublic actual fun Memory.copyTo(\n destination: ByteArray,\n offset: Long,\n length: Int,\n destinationOffset: Int\n) {\n copyTo(destination, offset.toIntOrFail(\"offset\"), length, destinationOffset)\n}\n\n/**\n * Fill memory range starting at the specified [offset] with [value] repeated [count] times.\n */\npublic actual fun Memory.fill(offset: Int, count: Int, value: Byte) {\n for (index in offset until offset + count) {\n this[index] = value\n }\n}\n\n/**\n * Fill memory range starting at the specified [offset] with [value] repeated [count] times.\n */\npublic actual fun Memory.fill(offset: Long, count: Long, value: Byte) {\n fill(offset.toIntOrFail(\"offset\"), count.toIntOrFail(\"count\"), value)\n}\n\n/**\n * Copies bytes from this memory range from the specified [offset] and [length]\n * to the [destination] at [destinationOffset].\n */\npublic fun Memory.copyTo(destination: ArrayBuffer, offset: Int, length: Int, destinationOffset: Int) {\n @Suppress(\"UnsafeCastFromDynamic\")\n val to = Int8Array(destination, destinationOffset, length)\n val from = Int8Array(view.buffer, view.byteOffset + offset, length)\n\n to.set(from, 0)\n}\n\n/**\n * Copies bytes from this memory range from the specified [offset] and [length]\n * to the [destination] at [destinationOffset].\n */\npublic fun Memory.copyTo(destination: ArrayBufferView, offset: Int, length: Int, destinationOffset: Int) {\n @Suppress(\"UnsafeCastFromDynamic\")\n val to = Int8Array(destination.buffer, destinationOffset + destination.byteOffset, length)\n val from = Int8Array(view.buffer, view.byteOffset + offset, length)\n\n to.set(from, 0)\n}\n\n/**\n * Copies bytes from this memory range from the specified [offset] and [length]\n * to the [destination] at [destinationOffset].\n */\npublic fun ArrayBuffer.copyTo(destination: Memory, offset: Int, length: Int, destinationOffset: Int) {\n val from = Int8Array(this, offset, length)\n val to = Int8Array(destination.view.buffer, destination.view.byteOffset + destinationOffset, length)\n\n to.set(from, 0)\n}\n\n/**\n * Copies bytes from this memory range from the specified [offset] and [length]\n * to the [destination] at [destinationOffset].\n */\npublic fun ArrayBufferView.copyTo(destination: Memory, offset: Int, length: Int, destinationOffset: Int) {\n buffer.copyTo(destination, offset + byteOffset, length, destinationOffset)\n}\n\ninternal val Memory.Int8ArrayView: Int8Array get() = Int8Array(view.buffer, view.byteOffset, view.byteLength)\n","@file:Suppress(\"RedundantModalityModifier\")\n\npackage io.ktor.utils.io.core\n\nimport io.ktor.utils.io.core.internal.*\nimport io.ktor.utils.io.errors.*\nimport io.ktor.utils.io.pool.*\n\npublic expect class EOFException(message: String) : IOException\n\n/**\n * For streaming input it should be [Input.endOfInput] instead.\n */\n@Deprecated(\"Use endOfInput property instead\", ReplaceWith(\"endOfInput\"))\npublic inline val Input.isEmpty: Boolean\n get() = endOfInput\n\n/**\n * For streaming input there is no reliable way to detect it without triggering bytes population from the underlying\n * source. Consider using [Input.endOfInput] or use [ByteReadPacket] instead.\n */\n@Deprecated(\n \"This makes no sense for streaming inputs. Some use-cases are covered by endOfInput property\",\n ReplaceWith(\"!endOfInput\")\n)\npublic val Input.isNotEmpty: Boolean\n get() {\n if (endOfInput) return false\n prepareReadFirstHead(1)?.let { found ->\n completeReadHead(found)\n return true\n }\n return false\n }\n\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\npublic inline val ByteReadPacket.isEmpty: Boolean\n get() = endOfInput\n\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\npublic inline val ByteReadPacket.isNotEmpty: Boolean\n get() = !endOfInput\n","package io.ktor.utils.io\n\nimport io.ktor.utils.io.bits.*\nimport io.ktor.utils.io.core.*\n\npublic suspend inline fun ByteReadChannel.readShort(byteOrder: ByteOrder): Short {\n return readShort().reverseIfNeeded(byteOrder) { reverseByteOrder() }\n}\n\npublic suspend inline fun ByteReadChannel.readInt(byteOrder: ByteOrder): Int {\n return readInt().reverseIfNeeded(byteOrder) { reverseByteOrder() }\n}\n\npublic suspend inline fun ByteReadChannel.readLong(byteOrder: ByteOrder): Long {\n return readLong().reverseIfNeeded(byteOrder) { reverseByteOrder() }\n}\n\npublic suspend inline fun ByteReadChannel.readFloat(byteOrder: ByteOrder): Float {\n return readFloat().reverseIfNeeded(byteOrder) { reverseByteOrder() }\n}\n\npublic suspend inline fun ByteReadChannel.readDouble(byteOrder: ByteOrder): Double {\n return readDouble().reverseIfNeeded(byteOrder) { reverseByteOrder() }\n}\n\npublic suspend inline fun ByteReadChannel.readShortLittleEndian(): Short {\n return toLittleEndian(readShort()) { reverseByteOrder() }\n}\n\npublic suspend inline fun ByteReadChannel.readIntLittleEndian(): Int {\n return toLittleEndian(readInt()) { reverseByteOrder() }\n}\n\npublic suspend inline fun ByteReadChannel.readLongLittleEndian(): Long {\n return toLittleEndian(readLong()) { reverseByteOrder() }\n}\n\npublic suspend inline fun ByteReadChannel.readFloatLittleEndian(): Float {\n return toLittleEndian(readFloat()) { reverseByteOrder() }\n}\n\npublic suspend inline fun ByteReadChannel.readDoubleLittleEndian(): Double {\n return toLittleEndian(readDouble()) { reverseByteOrder() }\n}\n\npublic suspend fun ByteWriteChannel.writeShort(value: Short, byteOrder: ByteOrder) {\n writeShort(value.reverseIfNeeded(byteOrder) { reverseByteOrder() })\n}\n\npublic suspend fun ByteWriteChannel.writeInt(value: Int, byteOrder: ByteOrder) {\n writeInt(value.reverseIfNeeded(byteOrder) { reverseByteOrder() })\n}\n\npublic suspend fun ByteWriteChannel.writeLong(value: Long, byteOrder: ByteOrder) {\n writeLong(value.reverseIfNeeded(byteOrder) { reverseByteOrder() })\n}\n\npublic suspend fun ByteWriteChannel.writeFloat(value: Float, byteOrder: ByteOrder) {\n writeFloat(value.reverseIfNeeded(byteOrder) { reverseByteOrder() })\n}\n\npublic suspend fun ByteWriteChannel.writeDouble(value: Double, byteOrder: ByteOrder) {\n writeDouble(value.reverseIfNeeded(byteOrder) { reverseByteOrder() })\n}\n\npublic suspend fun ByteWriteChannel.writeShortLittleEndian(value: Short) {\n writeShort(toLittleEndian(value) { reverseByteOrder() })\n}\n\npublic suspend fun ByteWriteChannel.writeIntLittleEndian(value: Int) {\n writeInt(toLittleEndian(value) { reverseByteOrder() })\n}\n\npublic suspend fun ByteWriteChannel.writeLongLittleEndian(value: Long) {\n writeLong(toLittleEndian(value) { reverseByteOrder() })\n}\n\npublic suspend fun ByteWriteChannel.writeFloatLittleEndian(value: Float) {\n writeFloat(toLittleEndian(value) { reverseByteOrder() })\n}\n\npublic suspend fun ByteWriteChannel.writeDoubleLittleEndian(value: Double) {\n writeDouble(toLittleEndian(value) { reverseByteOrder() })\n}\n\n@PublishedApi\ninternal inline fun ByteReadChannel.toLittleEndian(value: T, reverseBlock: T.() -> T): T = value.reverseBlock()\n\nprivate inline fun ByteWriteChannel.toLittleEndian(value: T, reverseBlock: T.() -> T): T = value.reverseBlock()\n\n@PublishedApi\ninternal inline fun T.reverseIfNeeded(byteOrder: ByteOrder, reverseBlock: T.() -> T): T {\n return when (byteOrder) {\n ByteOrder.BIG_ENDIAN -> this\n else -> reverseBlock()\n }\n}\n","package io.ktor.utils.io.core\n\n/**\n * Append at most [maxSize] bytes from the specified [other] buffer into this using the end gap reservation if required.\n * @return number of bytes copied\n * @throws IllegalArgumentException if not enough space including end gap\n */\ninternal fun Buffer.writeBufferAppend(other: Buffer, maxSize: Int): Int {\n val size = minOf(other.readRemaining, maxSize)\n\n if (writeRemaining <= size) {\n writeBufferAppendUnreserve(size)\n }\n\n return write { dst, dstOffset, _ ->\n other.read { src, srcOffset, _ ->\n src.copyTo(dst, srcOffset, size, dstOffset)\n size\n }\n }\n}\n\n/**\n * Prepend readable content of the specified [other] buffer to the beginning of this buffer using start gap reservation\n * if required.\n * @return number of bytes copied\n * @throws IllegalArgumentException if not enough space in the beginning to prepend bytes even with start gap\n */\ninternal fun Buffer.writeBufferPrepend(other: Buffer): Int {\n val size = other.readRemaining\n val readPosition = readPosition\n\n if (readPosition < size) {\n throw IllegalArgumentException(\"Not enough space in the beginning to prepend bytes\")\n }\n\n val newReadPosition = readPosition - size\n other.memory.copyTo(memory, other.readPosition, size, newReadPosition)\n other.discardExact(size)\n releaseStartGap(newReadPosition)\n\n return size\n}\n\nprivate fun Buffer.writeBufferAppendUnreserve(writeSize: Int) {\n if (writeRemaining + endGap < writeSize) {\n throw IllegalArgumentException(\"Can't append buffer: not enough free space at the end\")\n }\n val newWritePosition = writePosition + writeSize\n val overrunSize = newWritePosition - limit\n\n if (overrunSize > 0) {\n releaseEndGap()\n }\n}\n","package io.ktor.utils.io.core\n\nimport io.ktor.utils.io.bits.*\nimport io.ktor.utils.io.core.internal.*\nimport io.ktor.utils.io.pool.*\n\ninternal const val DEFAULT_BUFFER_SIZE: Int = 4096\n\n/**\n * Invoke [block] function with a temporary [Buffer] instance of the specified [size] in bytes.\n * The provided instance shouldn't be captured and used outside of the [block] otherwise an undefined behaviour\n * may occur including crash and/or data corruption.\n */\npublic inline fun withBuffer(size: Int, block: Buffer.() -> R): R {\n return with(Buffer(DefaultAllocator.alloc(size)), block)\n}\n\n/**\n * Invoke [block] function with a temporary [Buffer] instance taken from the specified [pool].\n * Depending on the pool it may be safe or unsafe to capture and use the provided buffer outside of the [block].\n * Usually it is always recommended to NOT capture an instance outside.\n */\npublic inline fun withBuffer(pool: ObjectPool, block: Buffer.() -> R): R {\n val instance = pool.borrow()\n return try {\n block(instance)\n } finally {\n pool.recycle(instance)\n }\n}\n\n/**\n * Invoke [block] function with a temporary [Buffer] instance taken from the specified [pool].\n * Depending on the pool it may be safe or unsafe to capture and use the provided buffer outside of the [block].\n * Usually it is always recommended to NOT capture an instance outside.\n * However since [ChunkBuffer] is reference counted, you can create a [Buffer.duplicate] (this is simply a view) and use\n * it outside of the [block] function but it is important to release the duplicate properly once not needed anymore\n * otherwise memory leak may occur on some platforms.\n */\ninternal inline fun withChunkBuffer(pool: ObjectPool, block: ChunkBuffer.() -> R): R {\n val instance = pool.borrow()\n return try {\n block(instance)\n } finally {\n instance.release(pool)\n }\n}\n\ninternal val DefaultChunkedBufferPool: ObjectPool = DefaultBufferPool()\n\npublic class DefaultBufferPool(\n private val bufferSize: Int = DEFAULT_BUFFER_SIZE,\n capacity: Int = 1000,\n private val allocator: Allocator = DefaultAllocator\n) : DefaultPool(capacity) {\n\n override fun produceInstance(): ChunkBuffer {\n return ChunkBuffer(allocator.alloc(bufferSize), null, this)\n }\n\n override fun disposeInstance(instance: ChunkBuffer) {\n allocator.free(instance.memory)\n super.disposeInstance(instance)\n instance.unlink()\n }\n\n override fun validateInstance(instance: ChunkBuffer) {\n super.validateInstance(instance)\n\n check(instance.memory.size == bufferSize.toLong()) {\n \"Buffer size mismatch. Expected: $bufferSize, actual: ${instance.memory.size}\"\n }\n\n check(instance !== ChunkBuffer.Empty) { \"ChunkBuffer.Empty couldn't be recycled\" }\n check(instance !== Buffer.Empty) { \"Empty instance couldn't be recycled\" }\n check(instance.referenceCount == 0) { \"Unable to clear buffer: it is still in use.\" }\n check(instance.next == null) { \"Recycled instance shouldn't be a part of a chain.\" }\n check(instance.origin == null) { \"Recycled instance shouldn't be a view or another buffer.\" }\n }\n\n override fun clearInstance(instance: ChunkBuffer): ChunkBuffer {\n return super.clearInstance(instance).apply {\n unpark()\n reset()\n }\n }\n}\n","@file:Suppress(\"NOTHING_TO_INLINE\")\n\npackage io.ktor.utils.io.bits\n\n/**\n * Copies bytes from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset].\n */\npublic inline fun Memory.loadByteArray(\n offset: Int,\n destination: ByteArray,\n destinationOffset: Int = 0,\n count: Int = destination.size - destinationOffset\n) {\n copyTo(destination, offset, count, destinationOffset)\n}\n\n/**\n * Copies unsigned shorts integers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\npublic inline fun Memory.loadByteArray(\n offset: Long,\n destination: ByteArray,\n destinationOffset: Int = 0,\n count: Int = destination.size - destinationOffset\n) {\n copyTo(destination, offset, count, destinationOffset)\n}\n\n/**\n * Copies unsigned shorts integers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic inline fun Memory.loadUByteArray(\n offset: Int,\n destination: UByteArray,\n destinationOffset: Int = 0,\n count: Int = destination.size - destinationOffset\n) {\n copyTo(destination.asByteArray(), offset, count, destinationOffset)\n}\n\n/**\n * Copies unsigned shorts integers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic inline fun Memory.loadUByteArray(\n offset: Long,\n destination: UByteArray,\n destinationOffset: Int = 0,\n count: Int = destination.size - destinationOffset\n) {\n copyTo(destination.asByteArray(), offset, count, destinationOffset)\n}\n\n/**\n * Copies short integers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\npublic expect fun Memory.loadShortArray(\n offset: Int,\n destination: ShortArray,\n destinationOffset: Int = 0,\n count: Int = destination.size - destinationOffset\n)\n\n/**\n * Copies short integers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\npublic expect fun Memory.loadShortArray(\n offset: Long,\n destination: ShortArray,\n destinationOffset: Int = 0,\n count: Int = destination.size - destinationOffset\n)\n\n/**\n * Copies unsigned shorts integers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic inline fun Memory.loadUShortArray(\n offset: Int,\n destination: UShortArray,\n destinationOffset: Int = 0,\n count: Int = destination.size - destinationOffset\n) {\n loadShortArray(offset, destination.asShortArray(), destinationOffset, count)\n}\n\n/**\n * Copies unsigned shorts integers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic inline fun Memory.loadUShortArray(\n offset: Long,\n destination: UShortArray,\n destinationOffset: Int = 0,\n count: Int = destination.size - destinationOffset\n) {\n loadShortArray(offset, destination.asShortArray(), destinationOffset, count)\n}\n\n/**\n * Copies regular integers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\npublic expect fun Memory.loadIntArray(\n offset: Int,\n destination: IntArray,\n destinationOffset: Int = 0,\n count: Int = destination.size - destinationOffset\n)\n\n/**\n * Copies regular integers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\npublic expect fun Memory.loadIntArray(\n offset: Long,\n destination: IntArray,\n destinationOffset: Int = 0,\n count: Int = destination.size - destinationOffset\n)\n\n/**\n * Copies unsigned integers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic inline fun Memory.loadUIntArray(\n offset: Int,\n destination: UIntArray,\n destinationOffset: Int = 0,\n count: Int = destination.size - destinationOffset\n) {\n loadIntArray(offset, destination.asIntArray(), destinationOffset, count)\n}\n\n/**\n * Copies unsigned integers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic inline fun Memory.loadUIntArray(\n offset: Long,\n destination: UIntArray,\n destinationOffset: Int = 0,\n count: Int = destination.size - destinationOffset\n) {\n loadIntArray(offset, destination.asIntArray(), destinationOffset, count)\n}\n\n/**\n * Copies long integers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\npublic expect fun Memory.loadLongArray(\n offset: Int,\n destination: LongArray,\n destinationOffset: Int = 0,\n count: Int = destination.size - destinationOffset\n)\n\n/**\n * Copies long integers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\npublic expect fun Memory.loadLongArray(\n offset: Long,\n destination: LongArray,\n destinationOffset: Int = 0,\n count: Int = destination.size - destinationOffset\n)\n\n/**\n * Copies unsigned long integers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic inline fun Memory.loadULongArray(\n offset: Int,\n destination: ULongArray,\n destinationOffset: Int = 0,\n count: Int = destination.size - destinationOffset\n) {\n loadLongArray(offset, destination.asLongArray(), destinationOffset, count)\n}\n\n/**\n * Copies unsigned long integers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic inline fun Memory.loadULongArray(\n offset: Long,\n destination: ULongArray,\n destinationOffset: Int = 0,\n count: Int = destination.size - destinationOffset\n) {\n loadLongArray(offset, destination.asLongArray(), destinationOffset, count)\n}\n\n/**\n * Copies floating point numbers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\npublic expect fun Memory.loadFloatArray(\n offset: Int,\n destination: FloatArray,\n destinationOffset: Int = 0,\n count: Int = destination.size - destinationOffset\n)\n\n/**\n * Copies floating point numbers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\npublic expect fun Memory.loadFloatArray(\n offset: Long,\n destination: FloatArray,\n destinationOffset: Int = 0,\n count: Int = destination.size - destinationOffset\n)\n\n/**\n * Copies floating point numbers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\npublic expect fun Memory.loadDoubleArray(\n offset: Int,\n destination: DoubleArray,\n destinationOffset: Int = 0,\n count: Int = destination.size - destinationOffset\n)\n\n/**\n * Copies floating point numbers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\npublic expect fun Memory.loadDoubleArray(\n offset: Long,\n destination: DoubleArray,\n destinationOffset: Int = 0,\n count: Int = destination.size - destinationOffset\n)\n\n/**\n * Copies unsigned shorts integers from the [source] array at [sourceOffset] to this memory at the specified [offset].\n * @param sourceOffset items\n */\npublic inline fun Memory.storeByteArray(\n offset: Int,\n source: ByteArray,\n sourceOffset: Int = 0,\n count: Int = source.size - sourceOffset\n) {\n source.useMemory(sourceOffset, count) { sourceMemory ->\n sourceMemory.copyTo(this, 0, count, offset)\n }\n}\n\n/**\n * Copies unsigned shorts integers from the [source] array at [sourceOffset] to this memory at the specified [offset].\n * @param sourceOffset items\n */\npublic inline fun Memory.storeByteArray(\n offset: Long,\n source: ByteArray,\n sourceOffset: Int = 0,\n count: Int = source.size - sourceOffset\n) {\n source.useMemory(sourceOffset, count) { sourceMemory ->\n sourceMemory.copyTo(this, 0L, count.toLong(), offset)\n }\n}\n\n/**\n * Copies unsigned shorts integers from the [source] array at [sourceOffset] to this memory at the specified [offset].\n * @param sourceOffset items\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic inline fun Memory.storeUByteArray(\n offset: Int,\n source: UByteArray,\n sourceOffset: Int = 0,\n count: Int = source.size - sourceOffset\n) {\n storeByteArray(offset, source.asByteArray(), sourceOffset, count)\n}\n\n/**\n * Copies unsigned shorts integers from the [source] array at [sourceOffset] to this memory at the specified [offset].\n * @param sourceOffset items\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic inline fun Memory.storeUByteArray(\n offset: Long,\n source: UByteArray,\n sourceOffset: Int = 0,\n count: Int = source.size - sourceOffset\n) {\n storeByteArray(offset, source.asByteArray(), sourceOffset, count)\n}\n\n/**\n * Copies short integers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\npublic expect fun Memory.storeShortArray(\n offset: Int,\n source: ShortArray,\n sourceOffset: Int = 0,\n count: Int = source.size - sourceOffset\n)\n\n/**\n * Copies short integers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\npublic expect fun Memory.storeShortArray(\n offset: Long,\n source: ShortArray,\n sourceOffset: Int = 0,\n count: Int = source.size - sourceOffset\n)\n\n/**\n * Copies unsigned shorts integers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic inline fun Memory.storeUShortArray(\n offset: Int,\n source: UShortArray,\n sourceOffset: Int = 0,\n count: Int = source.size - sourceOffset\n) {\n storeShortArray(offset, source.asShortArray(), sourceOffset, count)\n}\n\n/**\n * Copies unsigned shorts integers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic inline fun Memory.storeUShortArray(\n offset: Long,\n source: UShortArray,\n sourceOffset: Int = 0,\n count: Int = source.size - sourceOffset\n) {\n storeShortArray(offset, source.asShortArray(), sourceOffset, count)\n}\n\n/**\n * Copies regular integers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\npublic expect fun Memory.storeIntArray(\n offset: Int,\n source: IntArray,\n sourceOffset: Int = 0,\n count: Int = source.size - sourceOffset\n)\n\n/**\n * Copies regular integers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\npublic expect fun Memory.storeIntArray(\n offset: Long,\n source: IntArray,\n sourceOffset: Int = 0,\n count: Int = source.size - sourceOffset\n)\n\n/**\n * Copies unsigned integers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic inline fun Memory.storeUIntArray(\n offset: Int,\n source: UIntArray,\n sourceOffset: Int = 0,\n count: Int = source.size - sourceOffset\n) {\n storeIntArray(offset, source.asIntArray(), sourceOffset, count)\n}\n\n/**\n * Copies unsigned integers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic inline fun Memory.storeUIntArray(\n offset: Long,\n source: UIntArray,\n sourceOffset: Int = 0,\n count: Int = source.size - sourceOffset\n) {\n storeIntArray(offset, source.asIntArray(), sourceOffset, count)\n}\n\n/**\n * Copies long integers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\npublic expect fun Memory.storeLongArray(\n offset: Int,\n source: LongArray,\n sourceOffset: Int = 0,\n count: Int = source.size - sourceOffset\n)\n\n/**\n * Copies long integers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\npublic expect fun Memory.storeLongArray(\n offset: Long,\n source: LongArray,\n sourceOffset: Int = 0,\n count: Int = source.size - sourceOffset\n)\n\n/**\n * Copies unsigned long integers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic inline fun Memory.storeULongArray(\n offset: Int,\n source: ULongArray,\n sourceOffset: Int = 0,\n count: Int = source.size - sourceOffset\n) {\n storeLongArray(offset, source.asLongArray(), sourceOffset, count)\n}\n\n/**\n * Copies unsigned long integers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\n@OptIn(ExperimentalUnsignedTypes::class)\npublic inline fun Memory.storeULongArray(\n offset: Long,\n source: ULongArray,\n sourceOffset: Int = 0,\n count: Int = source.size - sourceOffset\n) {\n storeLongArray(offset, source.asLongArray(), sourceOffset, count)\n}\n\n/**\n * Copies floating point numbers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\npublic expect fun Memory.storeFloatArray(\n offset: Int,\n source: FloatArray,\n sourceOffset: Int = 0,\n count: Int = source.size - sourceOffset\n)\n\n/**\n * Copies floating point numbers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\npublic expect fun Memory.storeFloatArray(\n offset: Long,\n source: FloatArray,\n sourceOffset: Int = 0,\n count: Int = source.size - sourceOffset\n)\n\n/**\n * Copies floating point numbers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\npublic expect fun Memory.storeDoubleArray(\n offset: Int,\n source: DoubleArray,\n sourceOffset: Int = 0,\n count: Int = source.size - sourceOffset\n)\n\n/**\n * Copies floating point numbers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\npublic expect fun Memory.storeDoubleArray(\n offset: Long,\n source: DoubleArray,\n sourceOffset: Int = 0,\n count: Int = source.size - sourceOffset\n)\n","package io.ktor.utils.io.bits\n\nimport io.ktor.utils.io.core.internal.*\nimport org.khronos.webgl.*\nimport kotlin.contracts.*\n\n/**\n * Execute [block] of code providing a temporary instance of [Memory] view of this byte array range\n * starting at the specified [offset] and having the specified bytes [length].\n * By default, if neither [offset] nor [length] specified, the whole array is used.\n * An instance of [Memory] provided into the [block] should be never captured and used outside of lambda.\n */\n@OptIn(ExperimentalContracts::class)\npublic actual inline fun ByteArray.useMemory(offset: Int, length: Int, block: (Memory) -> R): R {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n return Memory.of(this, offset, length).let(block)\n}\n\n/**\n * Create [Memory] view for the specified [array] range starting at [offset] and the specified bytes [length].\n */\npublic fun Memory.Companion.of(array: ByteArray, offset: Int = 0, length: Int = array.size - offset): Memory {\n @Suppress(\"UnsafeCastFromDynamic\")\n val typedArray: Int8Array = array.asDynamic()\n return Memory.of(typedArray, offset, length)\n}\n\n/**\n * Create [Memory] view for the specified [buffer] range starting at [offset] and the specified bytes [length].\n */\npublic fun Memory.Companion.of(buffer: ArrayBuffer, offset: Int = 0, length: Int = buffer.byteLength - offset): Memory {\n return Memory(DataView(buffer, offset, length))\n}\n\n/**\n * Create [Memory] view for the specified [view].\n */\npublic fun Memory.Companion.of(view: DataView): Memory {\n return Memory(view)\n}\n\n/**\n * Create [Memory] view for the specified [view] range starting at [offset] and the specified bytes [length].\n */\npublic fun Memory.Companion.of(view: ArrayBufferView, offset: Int = 0, length: Int = view.byteLength): Memory {\n return Memory.of(view.buffer, view.byteOffset + offset, length)\n}\n\n@PublishedApi\ninternal actual object DefaultAllocator : Allocator {\n override fun alloc(size: Int): Memory = Memory(DataView(ArrayBuffer(size)))\n override fun alloc(size: Long): Memory = Memory(DataView(ArrayBuffer(size.toIntOrFail(\"size\"))))\n override fun free(instance: Memory) {\n }\n}\n","@file:Suppress(\"RedundantModalityModifier\")\n\npackage io.ktor.utils.io.core\n\nimport io.ktor.utils.io.bits.*\nimport io.ktor.utils.io.core.internal.*\nimport io.ktor.utils.io.pool.*\n\n/**\n * A builder that provides ability to build byte packets with no knowledge of it's size.\n * Unlike Java's ByteArrayOutputStream it doesn't copy the whole content every time it's internal buffer overflows\n * but chunks buffers instead. Packet building via [build] function is O(1) operation and only does instantiate\n * a new [ByteReadPacket]. Once a byte packet has been built via [build] function call, the builder could be\n * reused again. You also can discard all written bytes via [reset] or [release]. Please note that an instance of\n * builder need to be terminated either via [build] function invocation or via [release] call otherwise it will\n * cause byte buffer leak so that may have performance impact.\n *\n * Byte packet builder is also an [Appendable] so it does append UTF-8 characters to a packet\n *\n * ```\n * buildPacket {\n * listOf(1,2,3).joinTo(this, separator = \",\")\n * }\n * ```\n */\npublic class BytePacketBuilder(\n pool: ObjectPool = ChunkBuffer.Pool\n) : Output(pool) {\n\n /**\n * Number of bytes written to the builder after the creation or the last reset.\n */\n public val size: Int\n get() = _size\n\n /**\n * If no bytes were written or the builder has been reset.\n */\n public val isEmpty: Boolean\n get() = _size == 0\n\n /**\n * If at least one byte was written after the creation or the last reset.\n */\n public val isNotEmpty: Boolean\n get() = _size > 0\n\n @PublishedApi\n internal val _pool: ObjectPool\n get() = pool\n\n /**\n * Does nothing for memory-backed output\n */\n final override fun closeDestination() {\n }\n\n /**\n * Does nothing for memory-backed output\n */\n final override fun flush(source: Memory, offset: Int, length: Int) {\n }\n\n override fun append(value: Char): BytePacketBuilder {\n return super.append(value) as BytePacketBuilder\n }\n\n override fun append(value: CharSequence?): BytePacketBuilder {\n return super.append(value) as BytePacketBuilder\n }\n\n override fun append(value: CharSequence?, startIndex: Int, endIndex: Int): BytePacketBuilder {\n return super.append(value, startIndex, endIndex) as BytePacketBuilder\n }\n\n /**\n * Builds byte packet instance and resets builder's state to be able to build another one packet if needed\n */\n public fun build(): ByteReadPacket {\n val size = size\n\n return when (val head = stealAll()) {\n null -> ByteReadPacket.Empty\n else -> ByteReadPacket(head, size.toLong(), pool)\n }\n }\n\n override fun toString(): String {\n return \"BytePacketBuilder($size bytes written)\"\n }\n}\n","@file:Suppress(\"RedundantModalityModifier\", \"FunctionName\")\n\npackage io.ktor.utils.io.core\n\nimport io.ktor.utils.io.bits.*\nimport io.ktor.utils.io.core.internal.*\nimport io.ktor.utils.io.pool.*\n\n/**\n * Read-only immutable byte packet. Could be consumed only once however it does support [copy] that doesn't copy every byte\n * but creates a new view instead. Once packet created it should be either completely read (consumed) or released\n * via [release].\n */\npublic class ByteReadPacket internal constructor(\n head: ChunkBuffer,\n remaining: Long,\n pool: ObjectPool\n) : Input(head, remaining, pool) {\n public constructor(head: ChunkBuffer, pool: ObjectPool) : this(head, head.remainingAll(), pool)\n\n init {\n markNoMoreChunksAvailable()\n }\n\n /**\n * Returns a copy of the packet. The original packet and the copy could be used concurrently. Both need to be\n * either completely consumed or released via [release]\n */\n public final fun copy(): ByteReadPacket = ByteReadPacket(head.copyAll(), remaining, pool)\n\n final override fun fill(): ChunkBuffer? = null\n\n final override fun fill(destination: Memory, offset: Int, length: Int): Int {\n return 0\n }\n\n final override fun closeSource() {\n }\n\n override fun toString(): String {\n return \"ByteReadPacket($remaining bytes remaining)\"\n }\n\n public companion object {\n public val Empty: ByteReadPacket = ByteReadPacket(ChunkBuffer.Empty, 0L, ChunkBuffer.EmptyPool)\n }\n}\n\npublic expect fun ByteReadPacket(\n array: ByteArray,\n offset: Int = 0,\n length: Int = array.size,\n block: (ByteArray) -> Unit\n): ByteReadPacket\n\n@Suppress(\"NOTHING_TO_INLINE\")\npublic inline fun ByteReadPacket(array: ByteArray, offset: Int = 0, length: Int = array.size): ByteReadPacket {\n return ByteReadPacket(array, offset, length) {}\n}\n","package io.ktor.utils.io.core.internal\n\nimport io.ktor.utils.io.bits.*\nimport io.ktor.utils.io.charsets.*\nimport io.ktor.utils.io.core.*\nimport kotlin.jvm.*\n\ninternal inline fun Buffer.decodeASCII(consumer: (Char) -> Boolean): Boolean {\n read { memory, start, endExclusive ->\n for (index in start until endExclusive) {\n val codepoint = memory[index].toInt() and 0xff\n if (codepoint and 0x80 == 0x80 || !consumer(codepoint.toChar())) {\n discardExact(index - start)\n return false\n }\n }\n\n endExclusive - start\n }\n\n return true\n}\n\ninternal suspend fun decodeUTF8LineLoopSuspend(\n out: Appendable,\n limit: Int,\n nextChunk: suspend (Int) -> Input?,\n afterRead: (Int) -> Unit\n): Boolean {\n var decoded = 0\n var size = 1\n var cr = false\n var end = false\n\n while (!end && size != 0) {\n val chunk = nextChunk(size) ?: break\n val totalBytes = chunk.remaining\n\n chunk.takeWhileSize { buffer ->\n var skip = 0\n size = buffer.decodeUTF8 { ch ->\n when (ch) {\n '\\r' -> {\n if (cr) {\n end = true\n return@decodeUTF8 false\n }\n cr = true\n true\n }\n '\\n' -> {\n end = true\n skip = 1\n false\n }\n else -> {\n if (cr) {\n end = true\n return@decodeUTF8 false\n }\n\n if (decoded == limit) {\n throw TooLongLineException(\"Too many characters in line: limit $limit exceeded\")\n }\n decoded++\n out.append(ch)\n true\n }\n }\n }\n\n if (skip > 0) {\n buffer.discardExact(skip)\n }\n\n size = if (end) 0 else size.coerceAtLeast(1)\n\n size\n }\n\n afterRead((totalBytes - chunk.remaining).toInt())\n }\n\n if (size > 1) prematureEndOfStreamUtf(size)\n if (cr) {\n end = true\n }\n\n return decoded > 0 || end\n}\n\nprivate fun prematureEndOfStreamUtf(size: Int): Nothing =\n throw EOFException(\"Premature end of stream: expected $size bytes to decode UTF-8 char\")\n\ninternal fun byteCountUtf8(firstByte: Int): Int {\n var byteCount = 0\n var mask = 0x80\n var value = firstByte\n\n for (i in 1..6) {\n if (value and mask != 0) {\n value = value and mask.inv()\n mask = mask shr 1\n byteCount++\n } else {\n break\n }\n }\n\n return byteCount\n}\n\n/**\n * Decodes all the bytes to utf8 applying every character on [consumer] until or consumer return `false`.\n * If a consumer returned false then a character will be pushed back (including all surrogates will be pushed back as well)\n * and [decodeUTF8] returns -1\n * @return number of bytes required to decode incomplete utf8 character or 0 if all bytes were processed\n * or -1 if consumer rejected loop\n */\ninternal inline fun Buffer.decodeUTF8(consumer: (Char) -> Boolean): Int {\n var byteCount = 0\n var value = 0\n var lastByteCount = 0\n\n read { memory, start, endExclusive ->\n for (index in start until endExclusive) {\n val v = memory[index].toInt() and 0xff\n when {\n v and 0x80 == 0 -> {\n if (byteCount != 0) malformedByteCount(byteCount)\n if (!consumer(v.toChar())) {\n discardExact(index - start)\n return -1\n }\n }\n byteCount == 0 -> {\n // first unicode byte\n\n var mask = 0x80\n value = v\n\n for (i in 1..6) { // TODO do we support 6 bytes unicode?\n if (value and mask != 0) {\n value = value and mask.inv()\n mask = mask shr 1\n byteCount++\n } else {\n break\n }\n }\n\n lastByteCount = byteCount\n byteCount--\n\n if (lastByteCount > endExclusive - index) {\n discardExact(index - start)\n return lastByteCount\n }\n }\n else -> {\n // trailing unicode byte\n value = (value shl 6) or (v and 0x7f)\n byteCount--\n\n if (byteCount == 0) {\n if (isBmpCodePoint(value)) {\n if (!consumer(value.toChar())) {\n discardExact(index - start - lastByteCount + 1)\n return -1\n }\n } else if (!isValidCodePoint(value)) {\n malformedCodePoint(value)\n } else {\n if (!consumer(highSurrogate(value).toChar()) ||\n !consumer(lowSurrogate(value).toChar())\n ) {\n discardExact(index - start - lastByteCount + 1)\n return -1\n }\n }\n\n value = 0\n }\n }\n }\n }\n\n endExclusive - start\n }\n\n return 0\n}\n\ninternal fun Memory.encodeUTF8(text: CharSequence, from: Int, to: Int, dstOffset: Int, dstLimit: Int): EncodeResult {\n // encode single-byte characters\n val lastCharIndex = minOf(to, from + UShort.MAX_VALUE.toInt())\n val resultLimit = dstLimit.coerceAtMost(UShort.MAX_VALUE.toInt())\n var resultPosition = dstOffset\n var index = from\n\n do {\n if (resultPosition >= resultLimit || index >= lastCharIndex) {\n return EncodeResult((index - from).toUShort(), (resultPosition - dstOffset).toUShort())\n }\n\n val character = text[index++].code and 0xffff\n if (character and 0xff80 == 0) {\n storeAt(resultPosition++, character.toByte())\n } else {\n break\n }\n } while (true)\n\n index--\n return encodeUTF8Stage1(text, index, lastCharIndex, from, resultPosition, resultLimit, dstOffset)\n}\n\n/**\n * Encode UTF-8 multibytes characters when we for sure have enough free space\n */\nprivate fun Memory.encodeUTF8Stage1(\n text: CharSequence,\n index1: Int,\n lastCharIndex: Int,\n from: Int,\n resultPosition1: Int,\n resultLimit: Int,\n dstOffset: Int\n): EncodeResult {\n var index = index1\n var resultPosition: Int = resultPosition1\n val stage1Limit = resultLimit - 3\n\n do {\n val freeSpace = stage1Limit - resultPosition\n if (freeSpace <= 0 || index >= lastCharIndex) {\n break\n }\n\n val character = text[index++]\n val codepoint = when {\n character.isHighSurrogate() -> {\n if (index == lastCharIndex || !text[index].isLowSurrogate()) {\n 63\n } else {\n codePoint(character, text[index++])\n }\n }\n else -> character.code\n }\n val size = putUtf8Char(resultPosition, codepoint)\n\n resultPosition += size\n } while (true)\n\n if (resultPosition == stage1Limit) {\n return encodeUTF8Stage2(text, index, lastCharIndex, from, resultPosition, resultLimit, dstOffset)\n }\n\n return EncodeResult((index - from).toUShort(), (resultPosition - dstOffset).toUShort())\n}\n\nprivate fun Memory.encodeUTF8Stage2(\n text: CharSequence,\n index1: Int,\n lastCharIndex: Int,\n from: Int,\n resultPosition1: Int,\n resultLimit: Int,\n dstOffset: Int\n): EncodeResult {\n var index = index1\n var resultPosition: Int = resultPosition1\n\n do {\n val freeSpace = resultLimit - resultPosition\n if (freeSpace <= 0 || index >= lastCharIndex) {\n break\n }\n\n val character = text[index++]\n val codepoint = when {\n !character.isHighSurrogate() -> character.code\n else -> {\n if (index == lastCharIndex || !text[index].isLowSurrogate()) {\n 63\n } else {\n codePoint(character, text[index++])\n }\n }\n }\n if (charactersSize(codepoint) > freeSpace) {\n index--\n break\n }\n val size = putUtf8Char(resultPosition, codepoint)\n resultPosition += size\n } while (true)\n\n return EncodeResult((index - from).toUShort(), (resultPosition - dstOffset).toUShort())\n}\n\n@Suppress(\"NOTHING_TO_INLINE\")\nprivate inline fun charactersSize(v: Int) = when (v) {\n in 1..0x7f -> 1\n in 0x80..0x7ff -> 2\n in 0x800..0xffff -> 3\n in 0x10000..0x10ffff -> 4\n else -> malformedCodePoint(v)\n}\n\n// TODO optimize it, now we are simply do naive encoding here\n@Suppress(\"NOTHING_TO_INLINE\")\ninternal inline fun Memory.putUtf8Char(offset: Int, v: Int): Int = when (v) {\n in 0..0x7f -> {\n storeAt(offset, v.toByte())\n 1\n }\n in 0x80..0x7ff -> {\n this[offset] = (0xc0 or ((v shr 6) and 0x1f)).toByte()\n this[offset + 1] = (0x80 or (v and 0x3f)).toByte()\n 2\n }\n in 0x800..0xffff -> {\n this[offset] = (0xe0 or ((v shr 12) and 0x0f)).toByte()\n this[offset + 1] = (0x80 or ((v shr 6) and 0x3f)).toByte()\n this[offset + 2] = (0x80 or (v and 0x3f)).toByte()\n 3\n }\n in 0x10000..0x10ffff -> {\n this[offset] = (0xf0 or ((v shr 18) and 0x07)).toByte() // 3 bits\n this[offset + 1] = (0x80 or ((v shr 12) and 0x3f)).toByte() // 6 bits\n this[offset + 2] = (0x80 or ((v shr 6) and 0x3f)).toByte() // 6 bits\n this[offset + 3] = (0x80 or (v and 0x3f)).toByte() // 6 bits\n 4\n }\n else -> malformedCodePoint(v)\n}\n\n@PublishedApi\ninternal fun malformedByteCount(byteCount: Int): Nothing =\n throw MalformedUTF8InputException(\"Expected $byteCount more character bytes\")\n\n@PublishedApi\ninternal fun malformedCodePoint(value: Int): Nothing =\n throw IllegalArgumentException(\"Malformed code-point $value found\")\n\nprivate const val MaxCodePoint = 0x10ffff\nprivate const val MinLowSurrogate = 0xdc00\nprivate const val MinHighSurrogate = 0xd800\nprivate const val MinSupplementary = 0x10000\nprivate const val HighSurrogateMagic = MinHighSurrogate - (MinSupplementary ushr 10)\n\n@PublishedApi\ninternal fun isBmpCodePoint(cp: Int): Boolean = cp ushr 16 == 0\n\n@PublishedApi\ninternal fun isValidCodePoint(codePoint: Int): Boolean = codePoint <= MaxCodePoint\n\n@PublishedApi\ninternal fun lowSurrogate(cp: Int): Int = (cp and 0x3ff) + MinLowSurrogate\n\n@PublishedApi\ninternal fun highSurrogate(cp: Int): Int = (cp ushr 10) + HighSurrogateMagic\n\ninternal fun codePoint(high: Char, low: Char): Int {\n val highValue = high.code - HighSurrogateMagic\n val lowValue = low.code - MinLowSurrogate\n\n return highValue shl 10 or lowValue\n}\n\npublic class MalformedUTF8InputException(message: String) : Exception(message)\n","package io.ktor.utils.io.core\n\nimport io.ktor.utils.io.bits.*\nimport io.ktor.utils.io.core.internal.*\n\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\npublic fun Input.readShort(): Short {\n return readPrimitive(2, { memory, index -> memory.loadShortAt(index) }, { readShortFallback() })\n}\n\nprivate fun Input.readShortFallback(): Short {\n return readPrimitiveFallback(2) { it.readShort() }\n}\n\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\npublic fun Input.readInt(): Int {\n return readPrimitive(4, { memory, index -> memory.loadIntAt(index) }, { readIntFallback() })\n}\n\nprivate fun Input.readIntFallback(): Int {\n return readPrimitiveFallback(4) { it.readInt() }\n}\n\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\npublic fun Input.readLong(): Long {\n return readPrimitive(8, { memory, index -> memory.loadLongAt(index) }, { readLongFallback() })\n}\n\nprivate fun Input.readLongFallback(): Long {\n return readPrimitiveFallback(8) { it.readLong() }\n}\n\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\npublic fun Input.readFloat(): Float {\n return readPrimitive(4, { memory, index -> memory.loadFloatAt(index) }, { readFloatFallback() })\n}\n\npublic fun Input.readFloatFallback(): Float {\n return readPrimitiveFallback(4) { it.readFloat() }\n}\n\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\")\npublic fun Input.readDouble(): Double {\n return readPrimitive(8, { memory, index -> memory.loadDoubleAt(index) }, { readDoubleFallback() })\n}\n\npublic fun Input.readDoubleFallback(): Double {\n return readPrimitiveFallback(8) { it.readDouble() }\n}\n\nprivate inline fun Input.readPrimitive(size: Int, main: (Memory, Int) -> R, fallback: () -> R): R {\n if (headRemaining > size) {\n val index = headPosition\n headPosition = index + size\n return main(headMemory, index)\n }\n\n return fallback()\n}\n\nprivate inline fun Input.readPrimitiveFallback(size: Int, read: (Buffer) -> R): R {\n val head = prepareReadFirstHead(size) ?: prematureEndOfStream(size)\n val value = read(head)\n completeReadHead(head)\n return value\n}\n","package io.ktor.utils.io.core\n\nimport io.ktor.utils.io.bits.*\n\npublic fun Output.writeShort(value: Short) {\n if (!writePrimitiveTemplate(2) { memory, index -> memory.storeShortAt(index, value) }) {\n writeShortFallback(value)\n }\n}\n\nprivate fun Output.writeShortFallback(value: Short) {\n if (!writePrimitiveFallbackTemplate(2) { it.writeShort(value) }) {\n writeByte(value.highByte)\n writeByte(value.lowByte)\n }\n}\n\npublic fun Output.writeInt(value: Int) {\n if (!writePrimitiveTemplate(4) { memory, index -> memory.storeIntAt(index, value) }) {\n writeIntFallback(value)\n }\n}\n\nprivate fun Output.writeIntFallback(value: Int) {\n if (!writePrimitiveFallbackTemplate(4) { it.writeInt(value) }) {\n writeIntByteByByte(value)\n }\n}\n\nprivate fun Output.writeIntByteByByte(value: Int) {\n value.highShort.let {\n writeByte(it.highByte)\n writeByte(it.lowByte)\n }\n value.lowShort.let {\n writeByte(it.highByte)\n writeByte(it.lowByte)\n }\n}\n\npublic fun Output.writeLong(value: Long) {\n if (!writePrimitiveTemplate(8) { memory, index -> memory.storeLongAt(index, value) }) {\n writeLongFallback(value)\n }\n}\n\nprivate fun Output.writeLongFallback(value: Long) {\n if (!writePrimitiveFallbackTemplate(8) { it.writeLong(value) }) {\n writeIntByteByByte(value.highInt)\n writeIntByteByByte(value.lowInt)\n }\n}\n\npublic fun Output.writeFloat(value: Float) {\n if (!writePrimitiveTemplate(4) { memory, index -> memory.storeFloatAt(index, value) }) {\n writeIntFallback(value.toRawBits())\n }\n}\n\npublic fun Output.writeDouble(value: Double) {\n if (!writePrimitiveTemplate(8) { memory, index -> memory.storeDoubleAt(index, value) }) {\n writeLongFallback(value.toRawBits())\n }\n}\n\nprivate inline fun Output.writePrimitiveTemplate(\n componentSize: Int,\n block: (Memory, index: Int) -> Unit\n): Boolean {\n val index = tailPosition\n if (tailEndExclusive - index > componentSize) {\n tailPosition = index + componentSize\n block(tailMemory, index)\n return true\n }\n\n return false\n}\n\nprivate inline fun Output.writePrimitiveFallbackTemplate(\n componentSize: Int,\n writeOperation: (Buffer) -> Unit\n): Boolean {\n val tail = prepareWriteHead(componentSize)\n writeOperation(tail)\n afterHeadWrite()\n return true\n}\n","package io.ktor.utils.io.core\n\nimport io.ktor.utils.io.charsets.*\nimport io.ktor.utils.io.core.internal.*\n\n@Suppress(\"NOTHING_TO_INLINE\")\npublic inline fun String.toByteArray(charset: Charset = Charsets.UTF_8): ByteArray {\n if (charset == Charsets.UTF_8) return encodeToByteArray()\n\n return charset.newEncoder().encodeToByteArray(this, 0, length)\n}\n\n/**\n * Create an instance of [String] from the specified [bytes] range starting at [offset] and bytes [length]\n * interpreting characters in the specified [charset].\n */\n@Suppress(\"FunctionName\")\npublic expect fun String(\n bytes: ByteArray,\n offset: Int = 0,\n length: Int = bytes.size,\n charset: Charset = Charsets.UTF_8\n): String\n\n/**\n * Read a string line considering optionally specified [estimate] but up to optional [limit] characters length\n * (does fail once limit exceeded) or return `null` if the packet is empty\n */\npublic fun ByteReadPacket.readUTF8Line(estimate: Int = 16, limit: Int = Int.MAX_VALUE): String? {\n if (isEmpty) return null\n val sb = StringBuilder(estimate)\n return if (readUTF8LineTo(sb, limit)) sb.toString() else null\n}\n\n/**\n * Read a string line considering optionally specified [estimate] but up to optional [limit] characters length\n * (does fail once limit exceeded) or return `null` if the packet is empty\n */\npublic fun Input.readUTF8Line(estimate: Int = 16, limit: Int = Int.MAX_VALUE): String? {\n val sb = StringBuilder(estimate)\n return if (readUTF8LineTo(sb, limit)) sb.toString() else null\n}\n\n/**\n * Reads UTF-8 line and append all line characters to [out] except line endings. Supports CR, LF and CR+LF\n * @return `true` if some characters were appended or line ending reached (empty line) or `false` if packet\n * is empty\n */\npublic fun Input.readUTF8LineTo(out: Appendable, limit: Int): Boolean {\n var decoded = 0\n var size = 1\n var cr = false\n var end = false\n\n takeWhileSize { buffer ->\n var skip = 0\n size = buffer.decodeUTF8 { ch ->\n when (ch) {\n '\\r' -> {\n if (cr) {\n end = true\n return@decodeUTF8 false\n }\n cr = true\n true\n }\n '\\n' -> {\n end = true\n skip = 1\n false\n }\n else -> {\n if (cr) {\n end = true\n return@decodeUTF8 false\n }\n\n if (decoded == limit) bufferLimitExceeded(limit)\n decoded++\n out.append(ch)\n true\n }\n }\n }\n\n if (skip > 0) {\n buffer.discardExact(skip)\n }\n\n if (end) 0 else size.coerceAtLeast(1)\n }\n\n if (size > 1) prematureEndOfStream(size)\n\n return decoded > 0 || !endOfInput\n}\n\n/**\n * Reads UTF-8 characters until one of the specified [delimiters] found, [limit] exceeded or end of stream encountered\n *\n * @throws BufferLimitExceededException\n * @returns a string of characters read before delimiter\n */\n@Suppress(\"unused\")\npublic fun Input.readUTF8UntilDelimiter(delimiters: String, limit: Int = Int.MAX_VALUE): String {\n return buildString {\n readUTF8UntilDelimiterTo(this, delimiters, limit)\n }\n}\n\n/**\n * Reads UTF-8 characters to [out] buffer until one of the specified [delimiters] found, [limit] exceeded\n * or end of stream encountered\n *\n * @throws BufferLimitExceededException\n * @returns number of characters copied (possibly zero)\n */\npublic fun Input.readUTF8UntilDelimiterTo(out: Appendable, delimiters: String, limit: Int = Int.MAX_VALUE): Int {\n var decoded = 0\n var delimiter = false\n\n takeWhile { buffer ->\n buffer.decodeASCII { ch ->\n if (ch in delimiters) {\n delimiter = true\n false\n } else {\n if (decoded == limit) bufferLimitExceeded(limit)\n decoded++\n out.append(ch)\n true\n }\n }\n }\n\n if (!delimiter) {\n decoded = readUTF8UntilDelimiterToSlowUtf8(out, delimiters, limit, decoded)\n }\n\n return decoded\n}\n\n/**\n * Reads UTF-8 characters to [out] buffer until one of the specified [delimiters] found, [limit] exceeded\n * or end of stream encountered\n *\n * @throws BufferLimitExceededException\n * @returns number of characters copied (possibly zero)\n */\npublic fun Input.readUTF8UntilDelimiterTo(out: Output, delimiters: String, limit: Int = Int.MAX_VALUE): Int {\n val delimitersCount = delimiters.length\n if (delimitersCount == 1 && delimiters[0].isAsciiChar()) {\n return readUntilDelimiter(delimiters[0].code.toByte(), out).toInt()\n } else if (delimitersCount == 2 && delimiters[0].isAsciiChar() && delimiters[1].isAsciiChar()) {\n return readUntilDelimiters(delimiters[0].code.toByte(), delimiters[1].code.toByte(), out).toInt()\n }\n\n return readUTFUntilDelimiterToSlowAscii(delimiters, limit, out)\n}\n\n/**\n * Read exactly [n] bytes (consumes all remaining if [n] is not specified but up to [Int.MAX_VALUE] bytes).\n * Does fail if not enough bytes remaining.\n */\npublic fun ByteReadPacket.readBytes(\n n: Int = remaining.coerceAtMostMaxIntOrFail(\"Unable to convert to a ByteArray: packet is too big\")\n): ByteArray = when {\n n != 0 -> ByteArray(n).also { readFully(it, 0, n) }\n else -> EmptyByteArray\n}\n\n/**\n * Reads exactly [n] bytes from the input or fails if not enough bytes available.\n */\npublic fun Input.readBytes(n: Int): ByteArray = readBytesOf(n, n)\n\n/**\n * Reads all remaining bytes from the input\n */\npublic fun Input.readBytes(): ByteArray = readBytesOf()\n\n/**\n * Reads at least [min] but no more than [max] bytes from the input to a new byte array\n * @throws EOFException if not enough bytes available to get [min] bytes\n */\npublic fun Input.readBytesOf(min: Int = 0, max: Int = Int.MAX_VALUE): ByteArray = if (min == max && min == 0) {\n EmptyByteArray\n} else if (min == max) {\n ByteArray(min).also { readFully(it, 0, min) }\n} else {\n var array = ByteArray(max.toLong().coerceAtMost(sizeEstimate()).coerceAtLeast(min.toLong()).toInt())\n var size = 0\n\n while (size < max) {\n val partSize = minOf(max, array.size) - size\n val rc = readAvailable(array, size, partSize)\n if (rc <= 0) break\n size += rc\n if (array.size == size) {\n array = array.copyOf(size * 2)\n }\n }\n\n if (size < min) {\n throw EOFException(\"Not enough bytes available to read $min bytes: ${min - size} more required\")\n }\n\n if (size == array.size) array else array.copyOf(size)\n}\n\n/**\n * Reads at most [max] characters decoding bytes with specified [charset]. Extra character bytes will remain unconsumed\n * @return number of characters copied to [out]\n */\npublic fun Input.readText(out: Appendable, charset: Charset = Charsets.UTF_8, max: Int = Int.MAX_VALUE): Int {\n return charset.newDecoder().decode(this, out, max)\n}\n\n/**\n * Reads at most [max] characters decoding bytes with specified [decoder]. Extra character bytes will remain unconsumed\n * @return a decoded string\n */\n@Deprecated(\n \"Use CharsetDecoder.decode instead\",\n ReplaceWith(\"decoder.decode(this, max)\", \"io.ktor.utils.io.charsets.decode\")\n)\npublic fun Input.readText(decoder: CharsetDecoder, max: Int = Int.MAX_VALUE): String {\n return decoder.decode(this, max)\n}\n\n/**\n * Reads at most [max] characters decoding bytes with specified [charset]. Extra character bytes will remain unconsumed\n * @return a decoded string\n */\npublic fun Input.readText(charset: Charset = Charsets.UTF_8, max: Int = Int.MAX_VALUE): String {\n return charset.newDecoder().decode(this, max)\n}\n\n/**\n * Reads at most [max] characters decoding bytes with specified [charset]. Extra character bytes will remain unconsumed\n * @return a decoded string\n */\npublic fun Buffer.readText(charset: Charset = Charsets.UTF_8, max: Int = Int.MAX_VALUE): String = buildString {\n charset.newDecoder().decodeBuffer(this@readText, this, true, max)\n}\n\n/**\n * Read exactly [n] characters interpreting bytes in the specified [charset].\n */\n@Deprecated(\n \"Use readTextExactCharacters instead.\",\n ReplaceWith(\"readTextExactCharacters(n, charset)\")\n)\npublic fun Input.readTextExact(charset: Charset = Charsets.UTF_8, n: Int): String {\n return readTextExactCharacters(n, charset)\n}\n\n/**\n * Read exactly [charactersCount] characters interpreting bytes in the specified [charset].\n */\npublic fun Input.readTextExactCharacters(charactersCount: Int, charset: Charset = Charsets.UTF_8): String {\n val s = readText(charset, charactersCount)\n if (s.length < charactersCount) {\n prematureEndOfStreamToReadChars(charactersCount)\n }\n return s\n}\n\n/**\n * Read exactly the specified number of [bytes]\n * interpreting bytes in the specified [charset] (optional, UTF-8 by default).\n */\n@Deprecated(\"Parameters order is changed.\", ReplaceWith(\"readTextExactBytes(bytes, charset)\"))\npublic fun Input.readTextExactBytes(charset: Charset = Charsets.UTF_8, bytes: Int): String {\n return readTextExactBytes(bytes, charset)\n}\n\n/**\n * Read exactly [bytesCount] interpreting bytes in the specified [charset] (optional, UTF-8 by default).\n */\npublic fun Input.readTextExactBytes(bytesCount: Int, charset: Charset = Charsets.UTF_8): String {\n return charset.newDecoder().decodeExactBytes(this, inputLength = bytesCount)\n}\n\n/**\n * Writes [text] characters in range \\[[fromIndex] .. [toIndex]) with the specified [charset]\n */\npublic fun Output.writeText(\n text: CharSequence,\n fromIndex: Int = 0,\n toIndex: Int = text.length,\n charset: Charset = Charsets.UTF_8\n) {\n if (charset === Charsets.UTF_8) {\n return writeTextUtf8(text, fromIndex, toIndex)\n }\n\n charset.newEncoder().encodeToImpl(this, text, fromIndex, toIndex)\n}\n\n/**\n * Writes [text] characters in range \\[[fromIndex] .. [toIndex]) with the specified [charset]\n */\npublic fun Output.writeText(\n text: CharArray,\n fromIndex: Int = 0,\n toIndex: Int = text.size,\n charset: Charset = Charsets.UTF_8\n) {\n if (charset === Charsets.UTF_8) {\n return writeTextUtf8(CharArraySequence(text, 0, text.size), fromIndex, toIndex)\n }\n\n charset.newEncoder().encode(text, fromIndex, toIndex, this)\n}\n\nprivate fun Output.writeTextUtf8(text: CharSequence, fromIndex: Int, toIndex: Int) {\n var index = fromIndex\n writeWhileSize(1) { buffer ->\n val memory = buffer.memory\n val dstOffset = buffer.writePosition\n val dstLimit = buffer.limit\n\n val (characters, bytes) = memory.encodeUTF8(text, index, toIndex, dstOffset, dstLimit)\n\n index += characters.toInt()\n buffer.commitWritten(bytes.toInt())\n\n when {\n characters.toInt() == 0 && index < toIndex -> 8\n index < toIndex -> 1\n else -> 0\n }\n }\n}\n\ninternal expect fun String.getCharsInternal(dst: CharArray, dstOffset: Int)\n\n@Suppress(\"NOTHING_TO_INLINE\")\nprivate inline fun Char.isAsciiChar() = code <= 0x7f\n\nprivate fun Input.readUTFUntilDelimiterToSlowAscii(delimiters: String, limit: Int, out: Output): Int {\n var decoded = 0\n var delimiter = false\n\n takeWhile { buffer ->\n val before = buffer.readRemaining\n\n val rc = buffer.decodeASCII { ch ->\n if (ch in delimiters) {\n delimiter = true\n false\n } else {\n if (decoded == limit) bufferLimitExceeded(limit)\n decoded++\n true\n }\n }\n\n val delta = before - buffer.readRemaining\n if (delta > 0) {\n buffer.rewind(delta)\n out.writeFully(buffer, delta)\n }\n\n rc\n }\n\n if (!delimiter && !endOfInput) {\n decoded = readUTF8UntilDelimiterToSlowUtf8(out, delimiters, limit, decoded)\n }\n\n return decoded\n}\n\nprivate fun Input.readUTF8UntilDelimiterToSlowUtf8(\n out: Output,\n delimiters: String,\n limit: Int,\n decoded0: Int\n): Int {\n var decoded = decoded0\n var size = 1\n\n takeWhileSize { buffer ->\n val before = buffer.readRemaining\n\n size = buffer.decodeUTF8 { ch ->\n if (ch in delimiters) {\n false\n } else {\n if (decoded == limit) {\n bufferLimitExceeded(limit)\n }\n decoded++\n true\n }\n }\n\n val delta = before - buffer.readRemaining\n if (delta > 0) {\n buffer.rewind(delta)\n out.writeFully(buffer, delta)\n }\n\n size = if (size == -1) 0 else size.coerceAtLeast(1)\n size\n }\n\n if (size > 1) prematureEndOfStream(size)\n\n return decoded\n}\n\nprivate fun Input.readUTF8UntilDelimiterToSlowUtf8(\n out: Appendable,\n delimiters: String,\n limit: Int,\n decoded0: Int\n): Int {\n var decoded = decoded0\n var size = 1\n\n takeWhileSize { buffer ->\n size = buffer.decodeUTF8 { ch ->\n if (ch in delimiters) {\n false\n } else {\n if (decoded == limit) {\n bufferLimitExceeded(limit)\n }\n decoded++\n out.append(ch)\n true\n }\n }\n\n size = if (size == -1) 0 else size.coerceAtLeast(1)\n size\n }\n\n if (size > 1) prematureEndOfStream(size)\n\n return decoded\n}\n\nprivate fun bufferLimitExceeded(limit: Int): Nothing {\n throw BufferLimitExceededException(\"Too many characters before delimiter: limit $limit exceeded\")\n}\n\n@PublishedApi\ninternal fun prematureEndOfStream(size: Int): Nothing =\n throw EOFException(\"Premature end of stream: expected $size bytes\")\n\n@PublishedApi\ninternal fun prematureEndOfStream(size: Long): Nothing =\n throw EOFException(\"Premature end of stream: expected $size bytes\")\n\nprivate fun prematureEndOfStreamToReadChars(charactersCount: Int): Nothing =\n throw EOFException(\"Not enough input bytes to read $charactersCount characters.\")\n","/*\n * Copyright 2014-2022 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.utils.io.core.internal\n\n@Suppress(\"RedundantModalityModifier\")\ninternal class CharArraySequence(\n private val array: CharArray,\n private val offset: Int,\n final override val length: Int\n) : CharSequence {\n final override fun get(index: Int): Char {\n if (index >= length) {\n indexOutOfBounds(index)\n }\n return array[index + offset]\n }\n\n final override fun subSequence(startIndex: Int, endIndex: Int): CharSequence {\n require(startIndex >= 0) { \"startIndex shouldn't be negative: $startIndex\" }\n require(startIndex <= length) { \"startIndex is too large: $startIndex > $length\" }\n require(startIndex + endIndex <= length) { \"endIndex is too large: $endIndex > $length\" }\n require(endIndex >= startIndex) { \"endIndex should be greater or equal to startIndex: $startIndex > $endIndex\" }\n\n return CharArraySequence(array, offset + startIndex, endIndex - startIndex)\n }\n\n private fun indexOutOfBounds(index: Int): Nothing {\n throw IndexOutOfBoundsException(\"String index out of bounds: $index > $length\")\n }\n}\n","package io.ktor.utils.io.core.internal\n\nimport io.ktor.utils.io.bits.*\nimport io.ktor.utils.io.concurrent.*\nimport io.ktor.utils.io.core.*\nimport io.ktor.utils.io.pool.*\nimport kotlinx.atomicfu.*\n\npublic open class ChunkBuffer(\n memory: Memory,\n origin: ChunkBuffer?,\n internal val parentPool: ObjectPool?\n) : Buffer(memory) {\n init {\n require(origin !== this) { \"A chunk couldn't be a view of itself.\" }\n }\n\n private val nextRef: AtomicRef = atomic(null)\n private val refCount = atomic(1)\n\n /**\n * Reference to an origin buffer view this was copied from\n */\n public var origin: ChunkBuffer? = origin\n private set\n\n /**\n * Reference to next buffer view. Useful to chain multiple views.\n * @see appendNext\n * @see cleanNext\n */\n public var next: ChunkBuffer?\n get() = nextRef.value\n set(newValue) {\n if (newValue == null) {\n cleanNext()\n } else {\n appendNext(newValue)\n }\n }\n\n public val referenceCount: Int get() = refCount.value\n\n private fun appendNext(chunk: ChunkBuffer) {\n if (!nextRef.compareAndSet(null, chunk)) {\n throw IllegalStateException(\"This chunk has already a next chunk.\")\n }\n }\n\n public fun cleanNext(): ChunkBuffer? {\n return nextRef.getAndSet(null)\n }\n\n override fun duplicate(): ChunkBuffer = (origin ?: this).let { newOrigin ->\n newOrigin.acquire()\n ChunkBuffer(memory, newOrigin, parentPool).also { copy ->\n duplicateTo(copy)\n }\n }\n\n public open fun release(pool: ObjectPool) {\n if (release()) {\n val origin = origin\n if (origin != null) {\n unlink()\n origin.release(pool)\n } else {\n val poolToUse = parentPool ?: pool\n poolToUse.recycle(this)\n }\n }\n }\n\n internal fun unlink() {\n if (!refCount.compareAndSet(0, -1)) {\n throw IllegalStateException(\"Unable to unlink: buffer is in use.\")\n }\n\n cleanNext()\n origin = null\n }\n\n /**\n * Increase ref-count. May fail if already released.\n */\n internal fun acquire() {\n refCount.update { old ->\n if (old <= 0) throw IllegalStateException(\"Unable to acquire chunk: it is already released.\")\n old + 1\n }\n }\n\n /**\n * Invoked by a pool before return the instance to a user.\n */\n internal fun unpark() {\n refCount.update { old ->\n if (old < 0) {\n throw IllegalStateException(\"This instance is already disposed and couldn't be borrowed.\")\n }\n if (old > 0) {\n throw IllegalStateException(\"This instance is already in use but somehow appeared in the pool.\")\n }\n\n 1\n }\n }\n\n /**\n * Release ref-count.\n * @return `true` if the last usage was released\n */\n internal fun release(): Boolean {\n return refCount.updateAndGet { old ->\n if (old <= 0) throw IllegalStateException(\"Unable to release: it is already released.\")\n old - 1\n } == 0\n }\n\n final override fun reset() {\n require(origin == null) { \"Unable to reset buffer with origin\" }\n\n super.reset()\n nextRef.value = null\n }\n\n public companion object {\n public val Pool: ObjectPool = object : ObjectPool {\n override val capacity: Int\n get() = DefaultChunkedBufferPool.capacity\n\n override fun borrow(): ChunkBuffer {\n return DefaultChunkedBufferPool.borrow()\n }\n\n override fun recycle(instance: ChunkBuffer) {\n DefaultChunkedBufferPool.recycle(instance)\n }\n\n override fun dispose() {\n DefaultChunkedBufferPool.dispose()\n }\n }\n\n /**\n * A pool that always returns [ChunkBuffer.Empty]\n */\n public val EmptyPool: ObjectPool = object : ObjectPool {\n override val capacity: Int get() = 1\n\n override fun borrow() = Empty\n\n override fun recycle(instance: ChunkBuffer) {\n require(instance === Empty) { \"Only ChunkBuffer.Empty instance could be recycled.\" }\n }\n\n override fun dispose() {\n }\n }\n\n public val Empty: ChunkBuffer = ChunkBuffer(Memory.Empty, null, EmptyPool)\n\n internal val NoPool: ObjectPool = object : NoPoolImpl() {\n override fun borrow(): ChunkBuffer {\n return ChunkBuffer(DefaultAllocator.alloc(DEFAULT_BUFFER_SIZE), null, this)\n }\n\n override fun recycle(instance: ChunkBuffer) {\n DefaultAllocator.free(instance.memory)\n }\n }\n\n internal val NoPoolManuallyManaged: ObjectPool = object : NoPoolImpl() {\n override fun borrow(): ChunkBuffer {\n throw UnsupportedOperationException(\"This pool doesn't support borrow\")\n }\n\n override fun recycle(instance: ChunkBuffer) {\n // do nothing: manually managed objects should be disposed manually\n }\n }\n }\n}\n\n/**\n * @return `true` if and only if there are no buffer views that share the same actual buffer. This actually does\n * refcount and only work guaranteed if other views created/not created via [Buffer.duplicate] function.\n * One can instantiate multiple buffers with the same buffer and this function will return `true` in spite of\n * the fact that the buffer is actually shared.\n */\ninternal fun ChunkBuffer.isExclusivelyOwned(): Boolean = referenceCount == 1\n","package io.ktor.utils.io.core.internal\n\n@PublishedApi\n@Suppress(\"NOTHING_TO_INLINE\")\ninternal inline fun Long.toIntOrFail(name: String): Int {\n if (this >= Int.MAX_VALUE) failLongToIntConversion(this, name)\n return toInt()\n}\n\n@PublishedApi\ninternal fun failLongToIntConversion(value: Long, name: String): Nothing =\n throw IllegalArgumentException(\"Long value $value of $name doesn't fit into 32-bit integer\")\n","package io.ktor.utils.io.core\n\nimport kotlin.contracts.*\n\n@OptIn(ExperimentalContracts::class)\n@PublishedApi\ninternal inline fun Input.read(n: Int = 1, block: (Buffer) -> Unit) {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n\n val buffer = prepareRead(n) ?: prematureEndOfStream(n)\n val positionBefore = buffer.readPosition\n try {\n block(buffer)\n } finally {\n val positionAfter = buffer.readPosition\n if (positionAfter < positionBefore) {\n throw IllegalStateException(\"Buffer's position shouldn't be rewinded\")\n }\n if (positionAfter == buffer.writePosition) {\n ensureNext(buffer)\n } else {\n headPosition = positionAfter\n }\n }\n}\n","/*\n * Copyright 2014-2022 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.utils.io.core.internal\n\nimport io.ktor.utils.io.bits.*\nimport kotlin.jvm.*\n\n@JvmInline\ninternal value class EncodeResult(val value: Int) {\n constructor(characters: UShort, bytes: UShort) : this(characters.toInt() shl 16 or bytes.toInt())\n\n val characters: UShort get() = value.highShort.toUShort()\n val bytes: UShort get() = value.lowShort.toUShort()\n\n operator fun component1(): UShort = characters\n operator fun component2(): UShort = bytes\n}\n","@file:Suppress(\"KDocMissingDocumentation\")\n\npackage io.ktor.utils.io.core.internal\n\nimport io.ktor.utils.io.core.*\nimport kotlin.jvm.*\nimport kotlin.native.concurrent.*\n\n/**\n * API marked with this annotation is internal and extremely fragile and not intended to be used by library users.\n * Such API could be changed without notice including rename, removal and behaviour change.\n * Also using API marked with this annotation could cause data loss or any other damage.\n */\n@Suppress(\"DEPRECATION\")\n@RequiresOptIn(level = RequiresOptIn.Level.ERROR)\npublic annotation class DangerousInternalIoApi\n\ninternal fun ByteReadPacket.unsafeAppend(builder: BytePacketBuilder): Int {\n val builderSize = builder.size\n val builderHead = builder.stealAll() ?: return 0\n\n if (builderSize <= PACKET_MAX_COPY_SIZE && builderHead.next == null && tryWriteAppend(builderHead)) {\n builder.afterBytesStolen()\n return builderSize\n }\n\n append(builderHead)\n return builderSize\n}\n\n@PublishedApi\ninternal fun Input.prepareReadFirstHead(minSize: Int): ChunkBuffer? = prepareReadHead(minSize)\n\n@PublishedApi\ninternal fun Input.completeReadHead(current: ChunkBuffer) {\n when {\n current === this -> return\n !current.canRead() -> ensureNext(current)\n current.endGap < Buffer.ReservedSize -> fixGapAfterRead(current)\n else -> headPosition = current.readPosition\n }\n}\n\n@PublishedApi\ninternal fun Input.prepareReadNextHead(current: ChunkBuffer): ChunkBuffer? {\n if (current === this) {\n return if (canRead()) this else null\n }\n\n return ensureNextHead(current)\n}\n\ninternal fun Output.prepareWriteHead(capacity: Int, current: ChunkBuffer?): ChunkBuffer {\n if (current != null) {\n afterHeadWrite()\n }\n return prepareWriteHead(capacity)\n}\n\n@JvmField\n\ninternal val EmptyByteArray = ByteArray(0)\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.utils.io.internal\n\nimport io.ktor.utils.io.*\nimport kotlinx.atomicfu.*\nimport kotlinx.coroutines.*\n\n/**\n * Exclusive slot for waiting.\n * Only one waiter allowed.\n *\n * TODO: replace [Job] -> [Continuation] when all coroutines problems are fixed.\n */\ninternal class AwaitingSlot {\n private val suspension: AtomicRef = atomic(null)\n\n /**\n * Wait for other [sleep] or resume.\n */\n suspend fun sleep(sleepCondition: () -> Boolean) {\n if (trySuspend(sleepCondition)) {\n return\n }\n\n resume()\n }\n\n /**\n * Resume waiter.\n */\n fun resume() {\n suspension.getAndSet(null)?.complete()\n }\n\n /**\n * Cancel waiter.\n */\n fun cancel(cause: Throwable?) {\n val continuation = suspension.getAndSet(null) ?: return\n\n if (cause != null) {\n continuation.completeExceptionally(cause)\n } else {\n continuation.complete()\n }\n }\n\n private suspend fun trySuspend(sleepCondition: () -> Boolean): Boolean {\n var suspended = false\n\n val job = Job()\n if (suspension.compareAndSet(null, job) && sleepCondition()) {\n suspended = true\n job.join()\n }\n\n return suspended\n }\n}\n","package io.ktor.utils.io.internal\n\nimport io.ktor.utils.io.ByteChannelSequentialBase\nimport io.ktor.utils.io.close\nimport io.ktor.utils.io.core.internal.ChunkBuffer\n\ninternal suspend fun ByteChannelSequentialBase.joinToImpl(dst: ByteChannelSequentialBase, closeOnEnd: Boolean) {\n copyToSequentialImpl(dst, Long.MAX_VALUE)\n if (closeOnEnd) dst.close()\n}\n\n/**\n * Reads up to [limit] bytes from receiver channel and writes them to [dst] channel.\n * Closes [dst] channel if fails to read or write with cause exception.\n * @return a number of copied bytes\n */\ninternal suspend fun ByteChannelSequentialBase.copyToSequentialImpl(dst: ByteChannelSequentialBase, limit: Long): Long {\n require(this !== dst)\n if (closedCause != null) {\n dst.close(closedCause)\n return 0L\n }\n\n var remainingLimit = limit\n\n while (remainingLimit > 0) {\n if (!awaitInternalAtLeast1()) {\n break\n }\n val transferred = transferTo(dst, remainingLimit)\n val copied = if (transferred == 0L) {\n val tail = copyToTail(dst, remainingLimit)\n if (tail == 0L) {\n break\n }\n\n tail\n } else {\n if (dst.availableForWrite == 0) {\n dst.awaitAtLeastNBytesAvailableForWrite(1)\n }\n\n transferred\n }\n\n remainingLimit -= copied\n\n if (copied > 0) {\n dst.flush()\n }\n }\n\n return limit - remainingLimit\n}\n\nprivate suspend fun ByteChannelSequentialBase.copyToTail(dst: ByteChannelSequentialBase, limit: Long): Long {\n val lastPiece = ChunkBuffer.Pool.borrow()\n try {\n lastPiece.resetForWrite(limit.coerceAtMost(lastPiece.capacity.toLong()).toInt())\n val rc = readAvailable(lastPiece)\n if (rc == -1) {\n lastPiece.release(ChunkBuffer.Pool)\n return 0\n }\n\n dst.writeFully(lastPiece)\n return rc.toLong()\n } finally {\n lastPiece.release(ChunkBuffer.Pool)\n }\n}\n","/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.utils.io.pool\n\npublic val ByteArrayPool: ObjectPool = object : DefaultPool(128) {\n override fun produceInstance() = ByteArray(4096)\n}\n","package io.ktor.utils.io.pool\n\nimport io.ktor.utils.io.core.*\nimport kotlinx.atomicfu.*\n\npublic interface ObjectPool : Closeable {\n /**\n * Pool capacity\n */\n public val capacity: Int\n\n /**\n * borrow an instance. Pool can recycle an old instance or create a new one\n */\n public fun borrow(): T\n\n /**\n * Recycle an instance. Should be recycled what was borrowed before otherwise could fail\n */\n public fun recycle(instance: T)\n\n /**\n * Dispose the whole pool. None of borrowed objects could be used after the pool gets disposed\n * otherwise it can result in undefined behaviour\n */\n public fun dispose()\n\n /**\n * Does pool dispose\n */\n override fun close() {\n dispose()\n }\n}\n\n/**\n * A pool implementation of zero capacity that always creates new instances\n */\npublic abstract class NoPoolImpl : ObjectPool {\n override val capacity: Int\n get() = 0\n\n override fun recycle(instance: T) {\n }\n\n override fun dispose() {\n }\n}\n\n/**\n * A pool that produces at most one instance\n */\npublic abstract class SingleInstancePool : ObjectPool {\n private val borrowed = atomic(0)\n private val disposed = atomic(false)\n\n private val instance = atomic(null)\n\n /**\n * Creates a new instance of [T]\n */\n protected abstract fun produceInstance(): T\n\n /**\n * Dispose [instance] and release its resources\n */\n protected abstract fun disposeInstance(instance: T)\n\n final override val capacity: Int get() = 1\n\n final override fun borrow(): T {\n borrowed.update {\n if (it != 0) throw IllegalStateException(\"Instance is already consumed\")\n 1\n }\n\n val instance = produceInstance()\n this.instance.value = instance\n\n return instance\n }\n\n final override fun recycle(instance: T) {\n if (this.instance.value !== instance) {\n if (this.instance.value == null && borrowed.value != 0) {\n throw IllegalStateException(\"Already recycled or an irrelevant instance tried to be recycled\")\n }\n\n throw IllegalStateException(\"Unable to recycle irrelevant instance\")\n }\n\n this.instance.value = null\n\n if (!disposed.compareAndSet(false, true)) {\n throw IllegalStateException(\"An instance is already disposed\")\n }\n\n disposeInstance(instance)\n }\n\n final override fun dispose() {\n if (disposed.compareAndSet(false, true)) {\n val value = instance.value ?: return\n instance.value = null\n\n disposeInstance(value)\n }\n }\n}\n\n/**\n * Default object pool implementation.\n */\npublic expect abstract class DefaultPool(capacity: Int) : ObjectPool {\n /**\n * Pool capacity.\n */\n final override val capacity: Int\n\n /**\n * Creates a new instance of [T]\n */\n protected abstract fun produceInstance(): T\n\n /**\n * Dispose [instance] and release its resources\n */\n protected open fun disposeInstance(instance: T)\n\n /**\n * Clear [instance]'s state before reuse: reset pointers, counters and so on\n */\n protected open fun clearInstance(instance: T): T\n\n /**\n * Validate [instance] of [T]. Could verify that the object has been borrowed from this pool\n */\n protected open fun validateInstance(instance: T)\n\n final override fun borrow(): T\n\n final override fun recycle(instance: T)\n\n final override fun dispose()\n}\n\n/**\n * Borrows and instance of [T] from the pool, invokes [block] with it and finally recycles it\n */\n@Deprecated(\"Use useInstance instead\", ReplaceWith(\"useInstance(block)\"))\npublic inline fun ObjectPool.useBorrowed(block: (T) -> R): R {\n return useInstance(block)\n}\n\n/**\n * Borrows and instance of [T] from the pool, invokes [block] with it and finally recycles it\n */\npublic inline fun ObjectPool.useInstance(block: (T) -> R): R {\n val instance = borrow()\n try {\n return block(instance)\n } finally {\n recycle(instance)\n }\n}\n","package io.ktor.utils.io\n\nimport io.ktor.utils.io.core.*\nimport io.ktor.utils.io.core.internal.*\nimport io.ktor.utils.io.internal.*\nimport kotlinx.coroutines.*\nimport org.khronos.webgl.*\n\n/**\n * Creates buffered channel for asynchronous reading and writing of sequences of bytes.\n */\npublic actual fun ByteChannel(autoFlush: Boolean): ByteChannel {\n return ByteChannelJS(ChunkBuffer.Empty, autoFlush)\n}\n\n/**\n * Creates channel for reading from the specified byte array.\n */\npublic actual fun ByteReadChannel(content: ByteArray, offset: Int, length: Int): ByteReadChannel {\n if (content.isEmpty()) return ByteReadChannel.Empty\n val head = ChunkBuffer.Pool.borrow()\n var tail = head\n\n var start = offset\n val end = start + length\n while (true) {\n tail.reserveEndGap(8)\n val size = minOf(end - start, tail.writeRemaining)\n (tail as Buffer).writeFully(content, start, size)\n start += size\n\n if (start == end) break\n val current = tail\n tail = ChunkBuffer.Pool.borrow()\n current.next = tail\n }\n\n return ByteChannelJS(head, false).apply { close() }\n}\n\n/**\n * Creates channel for reading from the specified [ArrayBufferView]\n */\npublic fun ByteReadChannel(content: ArrayBufferView): ByteReadChannel {\n if (content.byteLength == 0) return ByteReadChannel.Empty\n val head = ChunkBuffer.Pool.borrow()\n var tail = head\n\n var start = 0\n var remaining = content.byteLength - content.byteOffset\n while (true) {\n tail.reserveEndGap(8)\n val size = minOf(remaining, tail.writeRemaining)\n tail.writeFully(content, start, size)\n start += size\n remaining -= size\n\n if (remaining == 0) break\n tail = ChunkBuffer.Pool.borrow()\n }\n\n return ByteChannelJS(head, false).apply { close() }\n}\n\npublic actual suspend fun ByteReadChannel.joinTo(dst: ByteWriteChannel, closeOnEnd: Boolean) {\n (this as ByteChannelSequentialBase).joinToImpl((dst as ByteChannelSequentialBase), closeOnEnd)\n}\n\n/**\n * Reads up to [limit] bytes from receiver channel and writes them to [dst] channel.\n * Closes [dst] channel if fails to read or write with cause exception.\n * @return a number of copied bytes\n */\npublic actual suspend fun ByteReadChannel.copyTo(dst: ByteWriteChannel, limit: Long): Long {\n return (this as ByteChannelSequentialBase).copyToSequentialImpl((dst as ByteChannelSequentialBase), limit)\n}\n\ninternal class ByteChannelJS(initial: ChunkBuffer, autoFlush: Boolean) : ByteChannelSequentialBase(initial, autoFlush) {\n private var attachedJob: Job? = null\n\n @OptIn(InternalCoroutinesApi::class)\n override fun attachJob(job: Job) {\n attachedJob?.cancel()\n attachedJob = job\n job.invokeOnCompletion(onCancelling = true) { cause ->\n attachedJob = null\n if (cause != null) {\n cancel(cause.unwrapCancellationException())\n }\n }\n }\n\n override suspend fun readAvailable(dst: ArrayBuffer, offset: Int, length: Int): Int = if (readable.isEmpty) {\n readAvailableSuspend(dst, offset, length)\n } else {\n closedCause?.let { throw it }\n val count = readable.readAvailable(dst, offset, length)\n afterRead(count)\n count\n }\n\n private suspend fun readAvailableSuspend(dst: ArrayBuffer, offset: Int, length: Int): Int {\n if (!await(1)) return -1\n return readAvailable(dst, offset, length)\n }\n\n override suspend fun readFully(dst: ArrayBuffer, offset: Int, length: Int) {\n if (availableForRead >= length) {\n closedCause?.let { throw it }\n readable.readFully(dst, offset, length)\n afterRead(length - offset)\n return\n }\n\n return readFullySuspend(dst, offset, length)\n }\n\n private suspend fun readFullySuspend(dst: ArrayBuffer, offset: Int, length: Int) {\n var start = offset\n val end = offset + length\n var remaining = length\n\n while (start < end) {\n val rc = readAvailable(dst, start, remaining)\n if (rc == -1) throw EOFException(\"Premature end of stream: required $remaining more bytes\")\n start += rc\n remaining -= rc\n }\n }\n\n override fun toString(): String = \"ByteChannel[$attachedJob, ${hashCode()}]\"\n}\n","/*\n * Copyright 2016-2017 JetBrains s.r.o.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage io.ktor.utils.io\n\nimport io.ktor.utils.io.charsets.*\nimport io.ktor.utils.io.core.*\nimport kotlinx.coroutines.*\n\n/**\n * Channel for asynchronous reading and writing of sequences of bytes.\n * This is a buffered **single-reader single-writer channel**.\n *\n * Read operations can be invoked concurrently with write operations, but multiple reads or multiple writes\n * cannot be invoked concurrently with themselves. Exceptions are [close] and [flush] which can be invoked\n * concurrently with any other operations and between themselves at any time.\n */\npublic interface ByteChannel : ByteReadChannel, ByteWriteChannel {\n public fun attachJob(job: Job)\n}\n\n/**\n * Creates buffered channel for asynchronous reading and writing of sequences of bytes.\n */\npublic expect fun ByteChannel(autoFlush: Boolean = false): ByteChannel\n\n/**\n * Creates channel for reading from the specified byte array. Please note that it could use [content] directly\n * or copy its bytes depending on the platform.\n */\npublic fun ByteReadChannel(content: ByteArray): ByteReadChannel =\n ByteReadChannel(content, 0, content.size)\n\n/**\n * Creates channel for reading from the specified byte array. Please note that it could use [content] directly\n * or copy its bytes depending on the platform.\n */\npublic fun ByteReadChannel(content: ByteArray, offset: Int): ByteReadChannel =\n ByteReadChannel(content, offset, content.size)\n\n/**\n * Creates channel for reading from the specified byte array. Please note that it could use [content] directly\n * or copy its bytes depending on the platform\n */\npublic expect fun ByteReadChannel(content: ByteArray, offset: Int, length: Int): ByteReadChannel\n\npublic fun ByteReadChannel(text: String, charset: Charset = Charsets.UTF_8): ByteReadChannel =\n ByteReadChannel(text.toByteArray(charset)) // TODO optimize to encode parts on demand\n","// ktlint-disable filename\npackage io.ktor.utils.io\n\nimport io.ktor.utils.io.bits.*\nimport io.ktor.utils.io.core.*\nimport io.ktor.utils.io.core.internal.*\nimport org.khronos.webgl.*\n\n/**\n * Channel for asynchronous reading of sequences of bytes.\n * This is a **single-reader channel**.\n *\n * Operations on this channel cannot be invoked concurrently.\n */\npublic actual interface ByteReadChannel {\n /**\n * Returns number of bytes that can be read without suspension. Read operations do no suspend and return\n * immediately when this number is at least the number of bytes requested for read.\n */\n public actual val availableForRead: Int\n\n /**\n * Returns `true` if the channel is closed and no remaining bytes are available for read.\n * It implies that [availableForRead] is zero.\n */\n public actual val isClosedForRead: Boolean\n\n public actual val isClosedForWrite: Boolean\n\n /**\n * A closure causes exception or `null` if closed successfully or not yet closed\n */\n public actual val closedCause: Throwable?\n\n /**\n * Number of bytes read from the channel.\n * It is not guaranteed to be atomic so could be updated in the middle of long-running read operation.\n */\n public actual val totalBytesRead: Long\n\n /**\n * Reads all available bytes to [dst] buffer and returns immediately or suspends if no bytes available\n * @return number of bytes were read or `-1` if the channel has been closed\n */\n public actual suspend fun readAvailable(dst: ByteArray, offset: Int, length: Int): Int\n\n public actual suspend fun readAvailable(dst: ChunkBuffer): Int\n\n public suspend fun readAvailable(dst: ArrayBuffer, offset: Int, length: Int): Int\n\n /**\n * Reads all [length] bytes to [dst] buffer or fails if channel has been closed.\n * Suspends if not enough bytes available.\n */\n public actual suspend fun readFully(dst: ByteArray, offset: Int, length: Int)\n\n public actual suspend fun readFully(dst: ChunkBuffer, n: Int)\n\n public suspend fun readFully(dst: ArrayBuffer, offset: Int, length: Int)\n\n /**\n * Reads the specified amount of bytes and makes a byte packet from them. Fails if channel has been closed\n * and not enough bytes available.\n */\n public actual suspend fun readPacket(size: Int): ByteReadPacket\n\n /**\n * Reads up to [limit] bytes and makes a byte packet or until end of stream encountered.\n */\n public actual suspend fun readRemaining(limit: Long): ByteReadPacket\n\n /**\n * Reads a long number (suspending if not enough bytes available) or fails if channel has been closed\n * and not enough bytes.\n */\n public actual suspend fun readLong(): Long\n\n /**\n * Reads an int number (suspending if not enough bytes available) or fails if channel has been closed\n * and not enough bytes.\n */\n public actual suspend fun readInt(): Int\n\n /**\n * Reads a short number (suspending if not enough bytes available) or fails if channel has been closed\n * and not enough bytes.\n */\n public actual suspend fun readShort(): Short\n\n /**\n * Reads a byte (suspending if no bytes available yet) or fails if channel has been closed\n * and not enough bytes.\n */\n public actual suspend fun readByte(): Byte\n\n /**\n * Reads a boolean value (suspending if no bytes available yet) or fails if channel has been closed\n * and not enough bytes.\n */\n public actual suspend fun readBoolean(): Boolean\n\n /**\n * Reads double number (suspending if not enough bytes available) or fails if channel has been closed\n * and not enough bytes.\n */\n public actual suspend fun readDouble(): Double\n\n /**\n * Reads float number (suspending if not enough bytes available) or fails if channel has been closed\n * and not enough bytes.\n */\n public actual suspend fun readFloat(): Float\n\n /**\n * Starts non-suspendable read session. After channel preparation [consumer] lambda will be invoked immediately\n * event if there are no bytes available for read yet.\n */\n @Suppress(\"DEPRECATION\")\n @Deprecated(\"Use read { } instead.\")\n public actual fun readSession(consumer: ReadSession.() -> Unit)\n\n /**\n * Starts a suspendable read session. After channel preparation [consumer] lambda will be invoked immediately\n * even if there are no bytes available for read yet. [consumer] lambda could suspend as much as needed.\n */\n @Suppress(\"DEPRECATION\")\n @Deprecated(\"Use read { } instead.\")\n public actual suspend fun readSuspendableSession(consumer: suspend SuspendableReadSession.() -> Unit)\n\n /**\n * Reads a line of UTF-8 characters to the specified [out] buffer up to [limit] characters.\n * Supports both CR-LF and LF line endings.\n * Throws an exception if the specified [limit] has been exceeded.\n *\n * @return `true` if line has been read (possibly empty) or `false` if channel has been closed\n * and no characters were read.\n */\n public actual suspend fun readUTF8LineTo(out: A, limit: Int): Boolean\n\n /**\n * Reads a line of UTF-8 characters up to [limit] characters.\n * Supports both CR-LF and LF line endings.\n * Throws an exception if the specified [limit] has been exceeded.\n *\n * @return a line string with no line endings or `null` of channel has been closed\n * and no characters were read.\n */\n public actual suspend fun readUTF8Line(limit: Int): String?\n\n /**\n * Close channel with optional [cause] cancellation. Unlike [ByteWriteChannel.close] that could close channel\n * normally, cancel does always close with error so any operations on this channel will always fail\n * and all suspensions will be resumed with exception.\n *\n * Please note that if the channel has been provided by [reader] or [writer] then the corresponding owning\n * coroutine will be cancelled as well\n *\n * @see ByteWriteChannel.close\n */\n public actual fun cancel(cause: Throwable?): Boolean\n\n /**\n * Discard up to [max] bytes\n *\n * @return number of bytes were discarded\n */\n public actual suspend fun discard(max: Long): Long\n\n /**\n * Suspend until the channel has bytes to read or gets closed. Throws exception if the channel was closed with an error.\n */\n public actual suspend fun awaitContent()\n\n /**\n * Try to copy at least [min] but up to [max] bytes to the specified [destination] buffer from this input\n * skipping [offset] bytes. If there are not enough bytes available to provide [min] bytes after skipping [offset]\n * bytes then it will trigger the underlying source reading first and after that will\n * simply copy available bytes even if EOF encountered so [min] is not a requirement but a desired number of bytes.\n * It is safe to specify [max] greater than the destination free space.\n * `min` shouldn't be bigger than the [destination] free space.\n * This function could trigger the underlying source suspending reading.\n * It is allowed to specify too big [offset] so in this case this function will always return `0` after prefetching\n * all underlying bytes but note that it may lead to significant memory consumption.\n * This function usually copy more bytes than [min] (unless `max = min`) but it is not guaranteed.\n * When `0` is returned with `offset = 0` then it makes sense to check [endOfInput].\n *\n * @param destination to write bytes\n * @param offset to skip input\n * @param min bytes to be copied, shouldn't be greater than the buffer free space. Could be `0`.\n * @param max bytes to be copied even if there are more bytes buffered, could be [Int.MAX_VALUE].\n * @return number of bytes copied to the [destination] possibly `0`\n */\n public actual suspend fun peekTo(\n destination: Memory,\n destinationOffset: Long,\n offset: Long,\n min: Long,\n max: Long\n ): Long\n\n public actual companion object {\n public actual val Empty: ByteReadChannel by lazy {\n ByteChannelJS(ChunkBuffer.Empty, false).apply {\n close(null)\n }\n }\n }\n}\n","package io.ktor.utils.io.bits\n\n/**\n * Reverse number's byte order\n */\npublic expect fun Short.reverseByteOrder(): Short\n\n/**\n * Reverse number's byte order\n */\npublic expect fun Int.reverseByteOrder(): Int\n\n/**\n * Reverse number's byte order\n */\npublic expect fun Long.reverseByteOrder(): Long\n\n/**\n * Reverse number's byte order\n */\npublic expect fun Float.reverseByteOrder(): Float\n\n/**\n * Reverse number's byte order\n */\npublic expect fun Double.reverseByteOrder(): Double\n\n/**\n * Reverse number's byte order\n */\npublic fun UShort.reverseByteOrder(): UShort = toShort().reverseByteOrder().toUShort()\n\n/**\n * Reverse number's byte order\n */\npublic fun UInt.reverseByteOrder(): UInt = toInt().reverseByteOrder().toUInt()\n\n/**\n * Reverse number's byte order\n */\npublic fun ULong.reverseByteOrder(): ULong = toLong().reverseByteOrder().toULong()\n\npublic inline val Short.highByte: Byte get() = (toInt() ushr 8).toByte()\n\npublic inline val Short.lowByte: Byte get() = (toInt() and 0xff).toByte()\n\npublic inline val Int.highShort: Short get() = (this ushr 16).toShort()\n\npublic inline val Int.lowShort: Short get() = (this and 0xffff).toShort()\n\npublic inline val Long.highInt: Int get() = (this ushr 32).toInt()\n\npublic inline val Long.lowInt: Int get() = (this and 0xffffffffL).toInt()\n","package io.ktor.utils.io.charsets\n\nimport io.ktor.utils.io.core.*\nimport io.ktor.utils.io.js.*\nimport org.khronos.webgl.*\n\npublic actual abstract class Charset(internal val _name: String) {\n public actual abstract fun newEncoder(): CharsetEncoder\n public actual abstract fun newDecoder(): CharsetDecoder\n\n override fun equals(other: Any?): Boolean {\n if (this === other) return true\n if (other == null || this::class.js != other::class.js) return false\n\n other as Charset\n\n if (_name != other._name) return false\n\n return true\n }\n\n override fun hashCode(): Int {\n return _name.hashCode()\n }\n\n override fun toString(): String {\n return _name\n }\n\n public actual companion object {\n @Suppress(\"LocalVariableName\")\n public actual fun forName(name: String): Charset {\n if (name == \"UTF-8\" || name == \"utf-8\" || name == \"UTF8\" || name == \"utf8\") return Charsets.UTF_8\n if (name == \"ISO-8859-1\" || name == \"iso-8859-1\" ||\n name.replace('_', '-').let { it == \"iso-8859-1\" || it.lowercase() == \"iso-8859-1\" } ||\n name == \"latin1\" || name == \"Latin1\"\n ) {\n return Charsets.ISO_8859_1\n }\n throw IllegalArgumentException(\"Charset $name is not supported\")\n }\n\n public actual fun isSupported(charset: String): Boolean = when {\n charset == \"UTF-8\" || charset == \"utf-8\" || charset == \"UTF8\" || charset == \"utf8\" -> true\n charset == \"ISO-8859-1\" || charset == \"iso-8859-1\" || charset.replace('_', '-').let {\n it == \"iso-8859-1\" || it.lowercase() == \"iso-8859-1\"\n } || charset == \"latin1\" -> true\n else -> false\n }\n }\n}\n\npublic actual val Charset.name: String get() = _name\n\n// -----------------------\n\npublic actual abstract class CharsetEncoder(internal val _charset: Charset)\nprivate data class CharsetEncoderImpl(private val charset: Charset) : CharsetEncoder(charset)\n\npublic actual val CharsetEncoder.charset: Charset get() = _charset\n\npublic actual fun CharsetEncoder.encodeToByteArray(input: CharSequence, fromIndex: Int, toIndex: Int): ByteArray =\n encodeToByteArrayImpl1(input, fromIndex, toIndex)\n\ninternal actual fun CharsetEncoder.encodeImpl(input: CharSequence, fromIndex: Int, toIndex: Int, dst: Buffer): Int {\n require(fromIndex <= toIndex)\n if (charset == Charsets.ISO_8859_1) {\n return encodeISO88591(input, fromIndex, toIndex, dst)\n }\n\n require(charset === Charsets.UTF_8) { \"Only UTF-8 encoding is supported in JS\" }\n\n val encoder = TextEncoder() // Only UTF-8 is supported so we know that at most 6 bytes per character is used\n var start = fromIndex\n var dstRemaining = dst.writeRemaining\n\n while (start < toIndex && dstRemaining > 0) {\n val numChars = minOf(toIndex - start, dstRemaining / 6).coerceAtLeast(1)\n val dropLastChar = input[start + numChars - 1].isHighSurrogate()\n val endIndexExclusive = when {\n dropLastChar && numChars == 1 -> start + 2\n dropLastChar -> start + numChars - 1\n else -> start + numChars\n }\n\n val array1 = encoder.encode(input.substring(start, endIndexExclusive))\n if (array1.length > dstRemaining) break\n dst.writeFully(array1)\n start = endIndexExclusive\n dstRemaining -= array1.length\n }\n\n return start - fromIndex\n}\n\npublic actual fun CharsetEncoder.encodeUTF8(input: ByteReadPacket, dst: Output) {\n require(charset === Charsets.UTF_8)\n // we only support UTF-8 so as far as input is UTF-8 encoded string then we simply copy bytes\n dst.writePacket(input)\n}\n\ninternal actual fun CharsetEncoder.encodeComplete(dst: Buffer): Boolean = true\n\n// ----------------------------------------------------------------------\n\npublic actual abstract class CharsetDecoder(internal val _charset: Charset)\n\nprivate data class CharsetDecoderImpl(private val charset: Charset) : CharsetDecoder(charset)\n\npublic actual val CharsetDecoder.charset: Charset get() = _charset\n\ninternal actual fun CharsetDecoder.decodeBuffer(\n input: Buffer,\n out: Appendable,\n lastBuffer: Boolean,\n max: Int\n): Int {\n if (max == 0) return 0\n\n val decoder = Decoder(charset.name)\n val copied: Int\n\n input.readDirectInt8Array { view ->\n val result = view.decodeBufferImpl(decoder, max)\n out.append(result.charactersDecoded)\n copied = result.bytesConsumed\n\n result.bytesConsumed\n }\n\n return copied\n}\n\npublic actual fun CharsetDecoder.decode(input: Input, dst: Appendable, max: Int): Int {\n val decoder = Decoder(charset.name, true)\n var charactersCopied = 0\n\n // use decode stream while we have remaining characters count > buffer size in bytes\n // it is much faster than using decodeBufferImpl\n input.takeWhileSize { buffer ->\n val rem = max - charactersCopied\n val bufferSize = buffer.readRemaining\n if (rem < bufferSize) return@takeWhileSize 0\n\n buffer.readDirectInt8Array { view ->\n val decodedText = decodeWrap {\n decoder.decodeStream(view, stream = true)\n }\n dst.append(decodedText)\n charactersCopied += decodedText.length\n view.byteLength\n }\n\n when {\n charactersCopied == max -> {\n val tail = try {\n decoder.decode()\n } catch (_: dynamic) {\n \"\"\n }\n\n if (tail.isNotEmpty()) {\n // if we have a trailing byte then we can't handle this chunk via fast-path\n // because we don't know how many bytes in the end we need to preserve\n buffer.rewind(bufferSize)\n }\n 0\n }\n charactersCopied < max -> MAX_CHARACTERS_SIZE_IN_BYTES\n else -> 0\n }\n }\n\n if (charactersCopied < max) {\n var size = 1\n input.takeWhileSize(1) { buffer ->\n val rc = buffer.readDirectInt8Array { view ->\n val result = view.decodeBufferImpl(decoder, max - charactersCopied)\n dst.append(result.charactersDecoded)\n charactersCopied += result.charactersDecoded.length\n result.bytesConsumed\n }\n when {\n rc > 0 -> size = 1\n size == MAX_CHARACTERS_SIZE_IN_BYTES -> size = 0\n else -> size++\n }\n\n size\n }\n }\n\n return charactersCopied\n}\n\npublic actual fun CharsetDecoder.decodeExactBytes(input: Input, inputLength: Int): String {\n if (inputLength == 0) return \"\"\n if (input.headRemaining >= inputLength) {\n val decoder = Decoder(charset._name, true)\n\n val head = input.head\n val view = input.headMemory.view\n\n val text = decodeWrap {\n val subView: ArrayBufferView = when {\n head.readPosition == 0 && inputLength == view.byteLength -> view\n else -> DataView(view.buffer, view.byteOffset + head.readPosition, inputLength)\n }\n\n decoder.decode(subView)\n }\n\n input.discardExact(inputLength)\n return text\n }\n\n return decodeExactBytesSlow(input, inputLength)\n}\n\n// -----------------------------------------------------------\n\npublic actual object Charsets {\n public actual val UTF_8: Charset = CharsetImpl(\"UTF-8\")\n public actual val ISO_8859_1: Charset = CharsetImpl(\"ISO-8859-1\")\n}\n\nprivate data class CharsetImpl(val name: String) : Charset(name) {\n override fun newEncoder(): CharsetEncoder = CharsetEncoderImpl(this)\n override fun newDecoder(): CharsetDecoder = CharsetDecoderImpl(this)\n}\n\npublic actual open class MalformedInputException actual constructor(message: String) : Throwable(message)\n\nprivate fun CharsetDecoder.decodeExactBytesSlow(input: Input, inputLength: Int): String {\n val decoder = Decoder(charset.name, true)\n var inputRemaining = inputLength\n val sb = StringBuilder(inputLength)\n\n decodeWrap {\n input.takeWhileSize(6) { buffer ->\n val chunkSize = buffer.readRemaining\n val size = minOf(chunkSize, inputRemaining)\n val text = when {\n buffer.readPosition == 0 && buffer.memory.view.byteLength == size -> decoder.decodeStream(\n buffer.memory.view,\n true\n )\n else -> decoder.decodeStream(\n Int8Array(\n buffer.memory.view.buffer,\n buffer.memory.view.byteOffset + buffer.readPosition,\n size\n ),\n true\n )\n }\n sb.append(text)\n\n buffer.discardExact(size)\n inputRemaining -= size\n\n if (inputRemaining > 0) 6 else 0\n }\n\n if (inputRemaining > 0) {\n input.takeWhile { buffer ->\n val chunkSize = buffer.readRemaining\n val size = minOf(chunkSize, inputRemaining)\n val text = when {\n buffer.readPosition == 0 && buffer.memory.view.byteLength == size -> {\n decoder.decode(buffer.memory.view)\n }\n else -> decoder.decodeStream(\n Int8Array(\n buffer.memory.view.buffer,\n buffer.memory.view.byteOffset + buffer.readPosition,\n size\n ),\n true\n )\n }\n sb.append(text)\n buffer.discardExact(size)\n inputRemaining -= size\n true\n }\n }\n\n sb.append(decoder.decode())\n }\n\n if (inputRemaining > 0) {\n throw EOFException(\n \"Not enough bytes available: had only ${inputLength - inputRemaining} instead of $inputLength\"\n )\n }\n return sb.toString()\n}\n","package io.ktor.utils.io.js\n\nimport io.ktor.utils.io.charsets.*\nimport io.ktor.utils.io.core.*\nimport org.khronos.webgl.*\n\n@Deprecated(\n \"Use readText with charset instead\",\n ReplaceWith(\n \"readText(Charset.forName(encoding), max)\",\n \"io.ktor.utils.io.core.readText\",\n \"io.ktor.utils.io.charsets.Charset\"\n )\n)\npublic fun ByteReadPacket.readText(encoding: String, max: Int = Int.MAX_VALUE): String =\n readText(Charset.forName(encoding), max)\n\n@Deprecated(\n \"Use readText with charset instead\",\n ReplaceWith(\n \"readText(out, Charset.forName(encoding), max)\",\n \"io.ktor.utils.io.core.readText\",\n \"io.ktor.utils.io.charsets.Charset\"\n )\n)\npublic fun ByteReadPacket.readText(encoding: String = \"UTF-8\", out: Appendable, max: Int = Int.MAX_VALUE): Int {\n return readText(out, Charset.forName(encoding), max)\n}\n\ninternal inline fun decodeWrap(block: () -> R): R {\n try {\n return block()\n } catch (t: Throwable) {\n throw MalformedInputException(\"Failed to decode bytes: ${t.message ?: \"no cause provided\"}\")\n }\n}\n","@file:Suppress(\"ReplaceRangeToWithUntil\", \"RedundantModalityModifier\")\n\npackage io.ktor.utils.io.core\n\nimport io.ktor.utils.io.bits.*\nimport org.khronos.webgl.*\nimport kotlin.contracts.*\n\npublic fun Buffer.readFully(dst: ArrayBuffer, offset: Int = 0, length: Int = dst.byteLength - offset) {\n read { memory, start, endExclusive ->\n if (endExclusive - start < length) {\n throw EOFException(\"Not enough bytes available to read $length bytes\")\n }\n\n memory.copyTo(dst, start, length, offset)\n length\n }\n}\n\npublic fun Buffer.readFully(dst: ArrayBufferView, offset: Int = 0, length: Int = dst.byteLength - offset) {\n read { memory, start, endExclusive ->\n if (endExclusive - start < length) {\n throw EOFException(\"Not enough bytes available to read $length bytes\")\n }\n\n memory.copyTo(dst, start, length, offset)\n length\n }\n}\n\npublic fun Buffer.readAvailable(dst: ArrayBuffer, offset: Int = 0, length: Int = dst.byteLength - offset): Int {\n if (!canRead()) return -1\n val readSize = minOf(length, readRemaining)\n readFully(dst, offset, readSize)\n return readSize\n}\n\npublic fun Buffer.readAvailable(dst: ArrayBufferView, offset: Int = 0, length: Int = dst.byteLength - offset): Int {\n if (!canRead()) return -1\n val readSize = minOf(length, readRemaining)\n readFully(dst, offset, readSize)\n return readSize\n}\n\npublic fun Buffer.writeFully(src: ArrayBuffer, offset: Int = 0, length: Int = src.byteLength) {\n write { memory, start, endExclusive ->\n if (endExclusive - start < length) {\n throw InsufficientSpaceException(\"Not enough free space to write $length bytes\")\n }\n\n src.copyTo(memory, offset, length, start)\n length\n }\n}\n\npublic fun Buffer.writeFully(src: ArrayBufferView, offset: Int = 0, length: Int = src.byteLength - offset) {\n write { memory, dstOffset, endExclusive ->\n if (endExclusive - dstOffset < length) {\n throw InsufficientSpaceException(\"Not enough free space to write $length bytes\")\n }\n\n src.copyTo(memory, offset, length, dstOffset)\n length\n }\n}\n\n@OptIn(ExperimentalContracts::class)\npublic inline fun Buffer.writeDirect(block: (DataView) -> Int): Int {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n\n return write { memory, start, endExclusive ->\n block(memory.slice(start, endExclusive - start).view)\n }\n}\n\n@OptIn(ExperimentalContracts::class)\npublic inline fun Buffer.readDirect(block: (DataView) -> Int): Int {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n\n return read { memory, start, endExclusive ->\n block(memory.slice(start, endExclusive - start).view)\n }\n}\n\n@OptIn(ExperimentalContracts::class)\npublic inline fun Buffer.writeDirectInt8Array(block: (Int8Array) -> Int): Int {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n\n return write { memory, start, endExclusive ->\n block(Int8Array(memory.view.buffer, memory.view.byteOffset + start, endExclusive - start))\n }\n}\n\n@OptIn(ExperimentalContracts::class)\npublic inline fun Buffer.readDirectInt8Array(block: (Int8Array) -> Int): Int {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n\n return read { memory, start, endExclusive ->\n block(Int8Array(memory.view.buffer, memory.view.byteOffset + start, endExclusive - start))\n }\n}\n","/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.utils.io.js\n\nimport org.khronos.webgl.*\n\ninternal fun Decoder(encoding: String, fatal: Boolean = true): Decoder = try {\n TextDecoder(encoding, textDecoderOptions(fatal)).toKtor()\n} catch (cause: Throwable) {\n TextDecoderFallback(encoding, fatal)\n}\n\ninternal interface Decoder {\n fun decode(): String\n fun decode(buffer: ArrayBufferView): String\n fun decode(buffer: ArrayBufferView, options: dynamic): String\n}\n\n@Suppress(\"NOTHING_TO_INLINE\")\ninternal inline fun Decoder.decodeStream(buffer: ArrayBufferView, stream: Boolean): String {\n decodeWrap {\n return decode(buffer, decodeOptions(stream))\n }\n}\n\ninternal fun decodeOptions(stream: Boolean): dynamic = Any().apply {\n with(this.asDynamic()) {\n this.stream = stream\n }\n}\n","package io.ktor.utils.io.charsets\n\nimport io.ktor.utils.io.js.*\nimport org.khronos.webgl.*\n\n// I don't know any characters that have longer characters\ninternal const val MAX_CHARACTERS_SIZE_IN_BYTES: Int = 8\nprivate const val MAX_CHARACTERS_COUNT = Int.MAX_VALUE / MAX_CHARACTERS_SIZE_IN_BYTES\n\ninternal data class DecodeBufferResult(val charactersDecoded: String, val bytesConsumed: Int)\n\ninternal fun Int8Array.decodeBufferImpl(nativeDecoder: Decoder, maxCharacters: Int): DecodeBufferResult {\n if (maxCharacters == 0) {\n return DecodeBufferResult(\"\", 0)\n }\n\n // fast-path: try to assume that we have 1 byte per character content\n try {\n val sizeInBytes = maxCharacters.coerceAtMost(byteLength)\n val text = nativeDecoder.decode(subarray(0, sizeInBytes))\n if (text.length <= maxCharacters) {\n return DecodeBufferResult(text, sizeInBytes)\n }\n } catch (_: dynamic) {\n }\n\n return decodeBufferImplSlow(nativeDecoder, maxCharacters)\n}\n\nprivate fun Int8Array.decodeBufferImplSlow(nativeDecoder: Decoder, maxCharacters: Int): DecodeBufferResult {\n val maxBytes = when {\n maxCharacters >= MAX_CHARACTERS_COUNT -> Int.MAX_VALUE\n else -> maxCharacters * MAX_CHARACTERS_SIZE_IN_BYTES\n }.coerceAtMost(byteLength)\n\n var sizeInBytes = maxBytes\n while (sizeInBytes > MAX_CHARACTERS_SIZE_IN_BYTES) {\n try {\n val text = nativeDecoder.decode(subarray(0, sizeInBytes))\n if (text.length <= maxCharacters) {\n return DecodeBufferResult(text, sizeInBytes)\n }\n } catch (_: dynamic) {\n }\n\n sizeInBytes /= 2\n }\n\n sizeInBytes = MAX_CHARACTERS_SIZE_IN_BYTES\n while (sizeInBytes > 0) {\n try {\n val text = nativeDecoder.decode(subarray(0, sizeInBytes))\n if (text.length <= maxCharacters) {\n return DecodeBufferResult(text, sizeInBytes)\n }\n } catch (_: dynamic) {\n }\n\n sizeInBytes--\n }\n\n // all attempts were failed so most likely we have a broken character but we can't find it for some reason\n // so the following decode most likely will fail\n decodeWrap {\n nativeDecoder.decode(this)\n }\n\n // if it didn't for some reason we have no idea what to do\n throw MalformedInputException(\"Unable to decode buffer\")\n}\n","package io.ktor.utils.io.charsets\n\nimport io.ktor.utils.io.core.*\nimport org.khronos.webgl.*\n\ninternal fun encodeISO88591(input: CharSequence, fromIndex: Int, toIndex: Int, dst: Buffer): Int {\n if (fromIndex >= toIndex) return 0\n\n dst.writeDirect { view ->\n val i8 = Int8Array(view.buffer, view.byteOffset, view.byteLength)\n var writeIndex = 0\n for (index in fromIndex until toIndex) {\n val character = input[index].code\n if (character > 0xff) {\n failedToMapError(character)\n }\n i8[writeIndex++] = character.toByte()\n }\n writeIndex\n }\n return toIndex - fromIndex\n}\n\nprivate fun failedToMapError(ch: Int): Nothing {\n throw MalformedInputException(\"The character with unicode point $ch couldn't be mapped to ISO-8859-1 character\")\n}\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n// NOTE: THIS FILE IS AUTO-GENERATED, DO NOT EDIT!\n// See github.com/kotlin/dukat for details\n\npackage org.khronos.webgl\n\nimport kotlin.js.*\nimport org.w3c.dom.*\nimport org.w3c.dom.events.*\n\npublic external interface WebGLContextAttributes {\n var alpha: Boolean? /* = true */\n get() = definedExternally\n set(value) = definedExternally\n var depth: Boolean? /* = true */\n get() = definedExternally\n set(value) = definedExternally\n var stencil: Boolean? /* = false */\n get() = definedExternally\n set(value) = definedExternally\n var antialias: Boolean? /* = true */\n get() = definedExternally\n set(value) = definedExternally\n var premultipliedAlpha: Boolean? /* = true */\n get() = definedExternally\n set(value) = definedExternally\n var preserveDrawingBuffer: Boolean? /* = false */\n get() = definedExternally\n set(value) = definedExternally\n var preferLowPowerToHighPerformance: Boolean? /* = false */\n get() = definedExternally\n set(value) = definedExternally\n var failIfMajorPerformanceCaveat: Boolean? /* = false */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun WebGLContextAttributes(alpha: Boolean? = true, depth: Boolean? = true, stencil: Boolean? = false, antialias: Boolean? = true, premultipliedAlpha: Boolean? = true, preserveDrawingBuffer: Boolean? = false, preferLowPowerToHighPerformance: Boolean? = false, failIfMajorPerformanceCaveat: Boolean? = false): WebGLContextAttributes {\n val o = js(\"({})\")\n o[\"alpha\"] = alpha\n o[\"depth\"] = depth\n o[\"stencil\"] = stencil\n o[\"antialias\"] = antialias\n o[\"premultipliedAlpha\"] = premultipliedAlpha\n o[\"preserveDrawingBuffer\"] = preserveDrawingBuffer\n o[\"preferLowPowerToHighPerformance\"] = preferLowPowerToHighPerformance\n o[\"failIfMajorPerformanceCaveat\"] = failIfMajorPerformanceCaveat\n return o\n}\n\npublic external abstract class WebGLObject\n\n/**\n * Exposes the JavaScript [WebGLBuffer](https://developer.mozilla.org/en/docs/Web/API/WebGLBuffer) to Kotlin\n */\npublic external abstract class WebGLBuffer : WebGLObject\n\n/**\n * Exposes the JavaScript [WebGLFramebuffer](https://developer.mozilla.org/en/docs/Web/API/WebGLFramebuffer) to Kotlin\n */\npublic external abstract class WebGLFramebuffer : WebGLObject\n\n/**\n * Exposes the JavaScript [WebGLProgram](https://developer.mozilla.org/en/docs/Web/API/WebGLProgram) to Kotlin\n */\npublic external abstract class WebGLProgram : WebGLObject\n\n/**\n * Exposes the JavaScript [WebGLRenderbuffer](https://developer.mozilla.org/en/docs/Web/API/WebGLRenderbuffer) to Kotlin\n */\npublic external abstract class WebGLRenderbuffer : WebGLObject\n\n/**\n * Exposes the JavaScript [WebGLShader](https://developer.mozilla.org/en/docs/Web/API/WebGLShader) to Kotlin\n */\npublic external abstract class WebGLShader : WebGLObject\n\n/**\n * Exposes the JavaScript [WebGLTexture](https://developer.mozilla.org/en/docs/Web/API/WebGLTexture) to Kotlin\n */\npublic external abstract class WebGLTexture : WebGLObject\n\n/**\n * Exposes the JavaScript [WebGLUniformLocation](https://developer.mozilla.org/en/docs/Web/API/WebGLUniformLocation) to Kotlin\n */\npublic external abstract class WebGLUniformLocation\n\n/**\n * Exposes the JavaScript [WebGLActiveInfo](https://developer.mozilla.org/en/docs/Web/API/WebGLActiveInfo) to Kotlin\n */\npublic external abstract class WebGLActiveInfo {\n open val size: Int\n open val type: Int\n open val name: String\n}\n\n/**\n * Exposes the JavaScript [WebGLShaderPrecisionFormat](https://developer.mozilla.org/en/docs/Web/API/WebGLShaderPrecisionFormat) to Kotlin\n */\npublic external abstract class WebGLShaderPrecisionFormat {\n open val rangeMin: Int\n open val rangeMax: Int\n open val precision: Int\n}\n\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface WebGLRenderingContextBase {\n val canvas: HTMLCanvasElement\n val drawingBufferWidth: Int\n val drawingBufferHeight: Int\n fun getContextAttributes(): WebGLContextAttributes?\n fun isContextLost(): Boolean\n fun getSupportedExtensions(): Array?\n fun getExtension(name: String): dynamic\n fun activeTexture(texture: Int)\n fun attachShader(program: WebGLProgram?, shader: WebGLShader?)\n fun bindAttribLocation(program: WebGLProgram?, index: Int, name: String)\n fun bindBuffer(target: Int, buffer: WebGLBuffer?)\n fun bindFramebuffer(target: Int, framebuffer: WebGLFramebuffer?)\n fun bindRenderbuffer(target: Int, renderbuffer: WebGLRenderbuffer?)\n fun bindTexture(target: Int, texture: WebGLTexture?)\n fun blendColor(red: Float, green: Float, blue: Float, alpha: Float)\n fun blendEquation(mode: Int)\n fun blendEquationSeparate(modeRGB: Int, modeAlpha: Int)\n fun blendFunc(sfactor: Int, dfactor: Int)\n fun blendFuncSeparate(srcRGB: Int, dstRGB: Int, srcAlpha: Int, dstAlpha: Int)\n fun bufferData(target: Int, size: Int, usage: Int)\n fun bufferData(target: Int, data: BufferDataSource?, usage: Int)\n fun bufferSubData(target: Int, offset: Int, data: BufferDataSource?)\n fun checkFramebufferStatus(target: Int): Int\n fun clear(mask: Int)\n fun clearColor(red: Float, green: Float, blue: Float, alpha: Float)\n fun clearDepth(depth: Float)\n fun clearStencil(s: Int)\n fun colorMask(red: Boolean, green: Boolean, blue: Boolean, alpha: Boolean)\n fun compileShader(shader: WebGLShader?)\n fun compressedTexImage2D(target: Int, level: Int, internalformat: Int, width: Int, height: Int, border: Int, data: ArrayBufferView)\n fun compressedTexSubImage2D(target: Int, level: Int, xoffset: Int, yoffset: Int, width: Int, height: Int, format: Int, data: ArrayBufferView)\n fun copyTexImage2D(target: Int, level: Int, internalformat: Int, x: Int, y: Int, width: Int, height: Int, border: Int)\n fun copyTexSubImage2D(target: Int, level: Int, xoffset: Int, yoffset: Int, x: Int, y: Int, width: Int, height: Int)\n fun createBuffer(): WebGLBuffer?\n fun createFramebuffer(): WebGLFramebuffer?\n fun createProgram(): WebGLProgram?\n fun createRenderbuffer(): WebGLRenderbuffer?\n fun createShader(type: Int): WebGLShader?\n fun createTexture(): WebGLTexture?\n fun cullFace(mode: Int)\n fun deleteBuffer(buffer: WebGLBuffer?)\n fun deleteFramebuffer(framebuffer: WebGLFramebuffer?)\n fun deleteProgram(program: WebGLProgram?)\n fun deleteRenderbuffer(renderbuffer: WebGLRenderbuffer?)\n fun deleteShader(shader: WebGLShader?)\n fun deleteTexture(texture: WebGLTexture?)\n fun depthFunc(func: Int)\n fun depthMask(flag: Boolean)\n fun depthRange(zNear: Float, zFar: Float)\n fun detachShader(program: WebGLProgram?, shader: WebGLShader?)\n fun disable(cap: Int)\n fun disableVertexAttribArray(index: Int)\n fun drawArrays(mode: Int, first: Int, count: Int)\n fun drawElements(mode: Int, count: Int, type: Int, offset: Int)\n fun enable(cap: Int)\n fun enableVertexAttribArray(index: Int)\n fun finish()\n fun flush()\n fun framebufferRenderbuffer(target: Int, attachment: Int, renderbuffertarget: Int, renderbuffer: WebGLRenderbuffer?)\n fun framebufferTexture2D(target: Int, attachment: Int, textarget: Int, texture: WebGLTexture?, level: Int)\n fun frontFace(mode: Int)\n fun generateMipmap(target: Int)\n fun getActiveAttrib(program: WebGLProgram?, index: Int): WebGLActiveInfo?\n fun getActiveUniform(program: WebGLProgram?, index: Int): WebGLActiveInfo?\n fun getAttachedShaders(program: WebGLProgram?): Array?\n fun getAttribLocation(program: WebGLProgram?, name: String): Int\n fun getBufferParameter(target: Int, pname: Int): Any?\n fun getParameter(pname: Int): Any?\n fun getError(): Int\n fun getFramebufferAttachmentParameter(target: Int, attachment: Int, pname: Int): Any?\n fun getProgramParameter(program: WebGLProgram?, pname: Int): Any?\n fun getProgramInfoLog(program: WebGLProgram?): String?\n fun getRenderbufferParameter(target: Int, pname: Int): Any?\n fun getShaderParameter(shader: WebGLShader?, pname: Int): Any?\n fun getShaderPrecisionFormat(shadertype: Int, precisiontype: Int): WebGLShaderPrecisionFormat?\n fun getShaderInfoLog(shader: WebGLShader?): String?\n fun getShaderSource(shader: WebGLShader?): String?\n fun getTexParameter(target: Int, pname: Int): Any?\n fun getUniform(program: WebGLProgram?, location: WebGLUniformLocation?): Any?\n fun getUniformLocation(program: WebGLProgram?, name: String): WebGLUniformLocation?\n fun getVertexAttrib(index: Int, pname: Int): Any?\n fun getVertexAttribOffset(index: Int, pname: Int): Int\n fun hint(target: Int, mode: Int)\n fun isBuffer(buffer: WebGLBuffer?): Boolean\n fun isEnabled(cap: Int): Boolean\n fun isFramebuffer(framebuffer: WebGLFramebuffer?): Boolean\n fun isProgram(program: WebGLProgram?): Boolean\n fun isRenderbuffer(renderbuffer: WebGLRenderbuffer?): Boolean\n fun isShader(shader: WebGLShader?): Boolean\n fun isTexture(texture: WebGLTexture?): Boolean\n fun lineWidth(width: Float)\n fun linkProgram(program: WebGLProgram?)\n fun pixelStorei(pname: Int, param: Int)\n fun polygonOffset(factor: Float, units: Float)\n fun readPixels(x: Int, y: Int, width: Int, height: Int, format: Int, type: Int, pixels: ArrayBufferView?)\n fun renderbufferStorage(target: Int, internalformat: Int, width: Int, height: Int)\n fun sampleCoverage(value: Float, invert: Boolean)\n fun scissor(x: Int, y: Int, width: Int, height: Int)\n fun shaderSource(shader: WebGLShader?, source: String)\n fun stencilFunc(func: Int, ref: Int, mask: Int)\n fun stencilFuncSeparate(face: Int, func: Int, ref: Int, mask: Int)\n fun stencilMask(mask: Int)\n fun stencilMaskSeparate(face: Int, mask: Int)\n fun stencilOp(fail: Int, zfail: Int, zpass: Int)\n fun stencilOpSeparate(face: Int, fail: Int, zfail: Int, zpass: Int)\n fun texImage2D(target: Int, level: Int, internalformat: Int, width: Int, height: Int, border: Int, format: Int, type: Int, pixels: ArrayBufferView?)\n fun texImage2D(target: Int, level: Int, internalformat: Int, format: Int, type: Int, source: TexImageSource?)\n fun texParameterf(target: Int, pname: Int, param: Float)\n fun texParameteri(target: Int, pname: Int, param: Int)\n fun texSubImage2D(target: Int, level: Int, xoffset: Int, yoffset: Int, width: Int, height: Int, format: Int, type: Int, pixels: ArrayBufferView?)\n fun texSubImage2D(target: Int, level: Int, xoffset: Int, yoffset: Int, format: Int, type: Int, source: TexImageSource?)\n fun uniform1f(location: WebGLUniformLocation?, x: Float)\n fun uniform1fv(location: WebGLUniformLocation?, v: Float32Array)\n fun uniform1fv(location: WebGLUniformLocation?, v: Array)\n fun uniform1i(location: WebGLUniformLocation?, x: Int)\n fun uniform1iv(location: WebGLUniformLocation?, v: Int32Array)\n fun uniform1iv(location: WebGLUniformLocation?, v: Array)\n fun uniform2f(location: WebGLUniformLocation?, x: Float, y: Float)\n fun uniform2fv(location: WebGLUniformLocation?, v: Float32Array)\n fun uniform2fv(location: WebGLUniformLocation?, v: Array)\n fun uniform2i(location: WebGLUniformLocation?, x: Int, y: Int)\n fun uniform2iv(location: WebGLUniformLocation?, v: Int32Array)\n fun uniform2iv(location: WebGLUniformLocation?, v: Array)\n fun uniform3f(location: WebGLUniformLocation?, x: Float, y: Float, z: Float)\n fun uniform3fv(location: WebGLUniformLocation?, v: Float32Array)\n fun uniform3fv(location: WebGLUniformLocation?, v: Array)\n fun uniform3i(location: WebGLUniformLocation?, x: Int, y: Int, z: Int)\n fun uniform3iv(location: WebGLUniformLocation?, v: Int32Array)\n fun uniform3iv(location: WebGLUniformLocation?, v: Array)\n fun uniform4f(location: WebGLUniformLocation?, x: Float, y: Float, z: Float, w: Float)\n fun uniform4fv(location: WebGLUniformLocation?, v: Float32Array)\n fun uniform4fv(location: WebGLUniformLocation?, v: Array)\n fun uniform4i(location: WebGLUniformLocation?, x: Int, y: Int, z: Int, w: Int)\n fun uniform4iv(location: WebGLUniformLocation?, v: Int32Array)\n fun uniform4iv(location: WebGLUniformLocation?, v: Array)\n fun uniformMatrix2fv(location: WebGLUniformLocation?, transpose: Boolean, value: Float32Array)\n fun uniformMatrix2fv(location: WebGLUniformLocation?, transpose: Boolean, value: Array)\n fun uniformMatrix3fv(location: WebGLUniformLocation?, transpose: Boolean, value: Float32Array)\n fun uniformMatrix3fv(location: WebGLUniformLocation?, transpose: Boolean, value: Array)\n fun uniformMatrix4fv(location: WebGLUniformLocation?, transpose: Boolean, value: Float32Array)\n fun uniformMatrix4fv(location: WebGLUniformLocation?, transpose: Boolean, value: Array)\n fun useProgram(program: WebGLProgram?)\n fun validateProgram(program: WebGLProgram?)\n fun vertexAttrib1f(index: Int, x: Float)\n fun vertexAttrib1fv(index: Int, values: dynamic)\n fun vertexAttrib2f(index: Int, x: Float, y: Float)\n fun vertexAttrib2fv(index: Int, values: dynamic)\n fun vertexAttrib3f(index: Int, x: Float, y: Float, z: Float)\n fun vertexAttrib3fv(index: Int, values: dynamic)\n fun vertexAttrib4f(index: Int, x: Float, y: Float, z: Float, w: Float)\n fun vertexAttrib4fv(index: Int, values: dynamic)\n fun vertexAttribPointer(index: Int, size: Int, type: Int, normalized: Boolean, stride: Int, offset: Int)\n fun viewport(x: Int, y: Int, width: Int, height: Int)\n\n companion object {\n val DEPTH_BUFFER_BIT: Int\n val STENCIL_BUFFER_BIT: Int\n val COLOR_BUFFER_BIT: Int\n val POINTS: Int\n val LINES: Int\n val LINE_LOOP: Int\n val LINE_STRIP: Int\n val TRIANGLES: Int\n val TRIANGLE_STRIP: Int\n val TRIANGLE_FAN: Int\n val ZERO: Int\n val ONE: Int\n val SRC_COLOR: Int\n val ONE_MINUS_SRC_COLOR: Int\n val SRC_ALPHA: Int\n val ONE_MINUS_SRC_ALPHA: Int\n val DST_ALPHA: Int\n val ONE_MINUS_DST_ALPHA: Int\n val DST_COLOR: Int\n val ONE_MINUS_DST_COLOR: Int\n val SRC_ALPHA_SATURATE: Int\n val FUNC_ADD: Int\n val BLEND_EQUATION: Int\n val BLEND_EQUATION_RGB: Int\n val BLEND_EQUATION_ALPHA: Int\n val FUNC_SUBTRACT: Int\n val FUNC_REVERSE_SUBTRACT: Int\n val BLEND_DST_RGB: Int\n val BLEND_SRC_RGB: Int\n val BLEND_DST_ALPHA: Int\n val BLEND_SRC_ALPHA: Int\n val CONSTANT_COLOR: Int\n val ONE_MINUS_CONSTANT_COLOR: Int\n val CONSTANT_ALPHA: Int\n val ONE_MINUS_CONSTANT_ALPHA: Int\n val BLEND_COLOR: Int\n val ARRAY_BUFFER: Int\n val ELEMENT_ARRAY_BUFFER: Int\n val ARRAY_BUFFER_BINDING: Int\n val ELEMENT_ARRAY_BUFFER_BINDING: Int\n val STREAM_DRAW: Int\n val STATIC_DRAW: Int\n val DYNAMIC_DRAW: Int\n val BUFFER_SIZE: Int\n val BUFFER_USAGE: Int\n val CURRENT_VERTEX_ATTRIB: Int\n val FRONT: Int\n val BACK: Int\n val FRONT_AND_BACK: Int\n val CULL_FACE: Int\n val BLEND: Int\n val DITHER: Int\n val STENCIL_TEST: Int\n val DEPTH_TEST: Int\n val SCISSOR_TEST: Int\n val POLYGON_OFFSET_FILL: Int\n val SAMPLE_ALPHA_TO_COVERAGE: Int\n val SAMPLE_COVERAGE: Int\n val NO_ERROR: Int\n val INVALID_ENUM: Int\n val INVALID_VALUE: Int\n val INVALID_OPERATION: Int\n val OUT_OF_MEMORY: Int\n val CW: Int\n val CCW: Int\n val LINE_WIDTH: Int\n val ALIASED_POINT_SIZE_RANGE: Int\n val ALIASED_LINE_WIDTH_RANGE: Int\n val CULL_FACE_MODE: Int\n val FRONT_FACE: Int\n val DEPTH_RANGE: Int\n val DEPTH_WRITEMASK: Int\n val DEPTH_CLEAR_VALUE: Int\n val DEPTH_FUNC: Int\n val STENCIL_CLEAR_VALUE: Int\n val STENCIL_FUNC: Int\n val STENCIL_FAIL: Int\n val STENCIL_PASS_DEPTH_FAIL: Int\n val STENCIL_PASS_DEPTH_PASS: Int\n val STENCIL_REF: Int\n val STENCIL_VALUE_MASK: Int\n val STENCIL_WRITEMASK: Int\n val STENCIL_BACK_FUNC: Int\n val STENCIL_BACK_FAIL: Int\n val STENCIL_BACK_PASS_DEPTH_FAIL: Int\n val STENCIL_BACK_PASS_DEPTH_PASS: Int\n val STENCIL_BACK_REF: Int\n val STENCIL_BACK_VALUE_MASK: Int\n val STENCIL_BACK_WRITEMASK: Int\n val VIEWPORT: Int\n val SCISSOR_BOX: Int\n val COLOR_CLEAR_VALUE: Int\n val COLOR_WRITEMASK: Int\n val UNPACK_ALIGNMENT: Int\n val PACK_ALIGNMENT: Int\n val MAX_TEXTURE_SIZE: Int\n val MAX_VIEWPORT_DIMS: Int\n val SUBPIXEL_BITS: Int\n val RED_BITS: Int\n val GREEN_BITS: Int\n val BLUE_BITS: Int\n val ALPHA_BITS: Int\n val DEPTH_BITS: Int\n val STENCIL_BITS: Int\n val POLYGON_OFFSET_UNITS: Int\n val POLYGON_OFFSET_FACTOR: Int\n val TEXTURE_BINDING_2D: Int\n val SAMPLE_BUFFERS: Int\n val SAMPLES: Int\n val SAMPLE_COVERAGE_VALUE: Int\n val SAMPLE_COVERAGE_INVERT: Int\n val COMPRESSED_TEXTURE_FORMATS: Int\n val DONT_CARE: Int\n val FASTEST: Int\n val NICEST: Int\n val GENERATE_MIPMAP_HINT: Int\n val BYTE: Int\n val UNSIGNED_BYTE: Int\n val SHORT: Int\n val UNSIGNED_SHORT: Int\n val INT: Int\n val UNSIGNED_INT: Int\n val FLOAT: Int\n val DEPTH_COMPONENT: Int\n val ALPHA: Int\n val RGB: Int\n val RGBA: Int\n val LUMINANCE: Int\n val LUMINANCE_ALPHA: Int\n val UNSIGNED_SHORT_4_4_4_4: Int\n val UNSIGNED_SHORT_5_5_5_1: Int\n val UNSIGNED_SHORT_5_6_5: Int\n val FRAGMENT_SHADER: Int\n val VERTEX_SHADER: Int\n val MAX_VERTEX_ATTRIBS: Int\n val MAX_VERTEX_UNIFORM_VECTORS: Int\n val MAX_VARYING_VECTORS: Int\n val MAX_COMBINED_TEXTURE_IMAGE_UNITS: Int\n val MAX_VERTEX_TEXTURE_IMAGE_UNITS: Int\n val MAX_TEXTURE_IMAGE_UNITS: Int\n val MAX_FRAGMENT_UNIFORM_VECTORS: Int\n val SHADER_TYPE: Int\n val DELETE_STATUS: Int\n val LINK_STATUS: Int\n val VALIDATE_STATUS: Int\n val ATTACHED_SHADERS: Int\n val ACTIVE_UNIFORMS: Int\n val ACTIVE_ATTRIBUTES: Int\n val SHADING_LANGUAGE_VERSION: Int\n val CURRENT_PROGRAM: Int\n val NEVER: Int\n val LESS: Int\n val EQUAL: Int\n val LEQUAL: Int\n val GREATER: Int\n val NOTEQUAL: Int\n val GEQUAL: Int\n val ALWAYS: Int\n val KEEP: Int\n val REPLACE: Int\n val INCR: Int\n val DECR: Int\n val INVERT: Int\n val INCR_WRAP: Int\n val DECR_WRAP: Int\n val VENDOR: Int\n val RENDERER: Int\n val VERSION: Int\n val NEAREST: Int\n val LINEAR: Int\n val NEAREST_MIPMAP_NEAREST: Int\n val LINEAR_MIPMAP_NEAREST: Int\n val NEAREST_MIPMAP_LINEAR: Int\n val LINEAR_MIPMAP_LINEAR: Int\n val TEXTURE_MAG_FILTER: Int\n val TEXTURE_MIN_FILTER: Int\n val TEXTURE_WRAP_S: Int\n val TEXTURE_WRAP_T: Int\n val TEXTURE_2D: Int\n val TEXTURE: Int\n val TEXTURE_CUBE_MAP: Int\n val TEXTURE_BINDING_CUBE_MAP: Int\n val TEXTURE_CUBE_MAP_POSITIVE_X: Int\n val TEXTURE_CUBE_MAP_NEGATIVE_X: Int\n val TEXTURE_CUBE_MAP_POSITIVE_Y: Int\n val TEXTURE_CUBE_MAP_NEGATIVE_Y: Int\n val TEXTURE_CUBE_MAP_POSITIVE_Z: Int\n val TEXTURE_CUBE_MAP_NEGATIVE_Z: Int\n val MAX_CUBE_MAP_TEXTURE_SIZE: Int\n val TEXTURE0: Int\n val TEXTURE1: Int\n val TEXTURE2: Int\n val TEXTURE3: Int\n val TEXTURE4: Int\n val TEXTURE5: Int\n val TEXTURE6: Int\n val TEXTURE7: Int\n val TEXTURE8: Int\n val TEXTURE9: Int\n val TEXTURE10: Int\n val TEXTURE11: Int\n val TEXTURE12: Int\n val TEXTURE13: Int\n val TEXTURE14: Int\n val TEXTURE15: Int\n val TEXTURE16: Int\n val TEXTURE17: Int\n val TEXTURE18: Int\n val TEXTURE19: Int\n val TEXTURE20: Int\n val TEXTURE21: Int\n val TEXTURE22: Int\n val TEXTURE23: Int\n val TEXTURE24: Int\n val TEXTURE25: Int\n val TEXTURE26: Int\n val TEXTURE27: Int\n val TEXTURE28: Int\n val TEXTURE29: Int\n val TEXTURE30: Int\n val TEXTURE31: Int\n val ACTIVE_TEXTURE: Int\n val REPEAT: Int\n val CLAMP_TO_EDGE: Int\n val MIRRORED_REPEAT: Int\n val FLOAT_VEC2: Int\n val FLOAT_VEC3: Int\n val FLOAT_VEC4: Int\n val INT_VEC2: Int\n val INT_VEC3: Int\n val INT_VEC4: Int\n val BOOL: Int\n val BOOL_VEC2: Int\n val BOOL_VEC3: Int\n val BOOL_VEC4: Int\n val FLOAT_MAT2: Int\n val FLOAT_MAT3: Int\n val FLOAT_MAT4: Int\n val SAMPLER_2D: Int\n val SAMPLER_CUBE: Int\n val VERTEX_ATTRIB_ARRAY_ENABLED: Int\n val VERTEX_ATTRIB_ARRAY_SIZE: Int\n val VERTEX_ATTRIB_ARRAY_STRIDE: Int\n val VERTEX_ATTRIB_ARRAY_TYPE: Int\n val VERTEX_ATTRIB_ARRAY_NORMALIZED: Int\n val VERTEX_ATTRIB_ARRAY_POINTER: Int\n val VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: Int\n val IMPLEMENTATION_COLOR_READ_TYPE: Int\n val IMPLEMENTATION_COLOR_READ_FORMAT: Int\n val COMPILE_STATUS: Int\n val LOW_FLOAT: Int\n val MEDIUM_FLOAT: Int\n val HIGH_FLOAT: Int\n val LOW_INT: Int\n val MEDIUM_INT: Int\n val HIGH_INT: Int\n val FRAMEBUFFER: Int\n val RENDERBUFFER: Int\n val RGBA4: Int\n val RGB5_A1: Int\n val RGB565: Int\n val DEPTH_COMPONENT16: Int\n val STENCIL_INDEX: Int\n val STENCIL_INDEX8: Int\n val DEPTH_STENCIL: Int\n val RENDERBUFFER_WIDTH: Int\n val RENDERBUFFER_HEIGHT: Int\n val RENDERBUFFER_INTERNAL_FORMAT: Int\n val RENDERBUFFER_RED_SIZE: Int\n val RENDERBUFFER_GREEN_SIZE: Int\n val RENDERBUFFER_BLUE_SIZE: Int\n val RENDERBUFFER_ALPHA_SIZE: Int\n val RENDERBUFFER_DEPTH_SIZE: Int\n val RENDERBUFFER_STENCIL_SIZE: Int\n val FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: Int\n val FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: Int\n val FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: Int\n val FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: Int\n val COLOR_ATTACHMENT0: Int\n val DEPTH_ATTACHMENT: Int\n val STENCIL_ATTACHMENT: Int\n val DEPTH_STENCIL_ATTACHMENT: Int\n val NONE: Int\n val FRAMEBUFFER_COMPLETE: Int\n val FRAMEBUFFER_INCOMPLETE_ATTACHMENT: Int\n val FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: Int\n val FRAMEBUFFER_INCOMPLETE_DIMENSIONS: Int\n val FRAMEBUFFER_UNSUPPORTED: Int\n val FRAMEBUFFER_BINDING: Int\n val RENDERBUFFER_BINDING: Int\n val MAX_RENDERBUFFER_SIZE: Int\n val INVALID_FRAMEBUFFER_OPERATION: Int\n val UNPACK_FLIP_Y_WEBGL: Int\n val UNPACK_PREMULTIPLY_ALPHA_WEBGL: Int\n val CONTEXT_LOST_WEBGL: Int\n val UNPACK_COLORSPACE_CONVERSION_WEBGL: Int\n val BROWSER_DEFAULT_WEBGL: Int\n }\n}\n\n/**\n * Exposes the JavaScript [WebGLRenderingContext](https://developer.mozilla.org/en/docs/Web/API/WebGLRenderingContext) to Kotlin\n */\npublic external abstract class WebGLRenderingContext : WebGLRenderingContextBase, RenderingContext {\n companion object {\n val DEPTH_BUFFER_BIT: Int\n val STENCIL_BUFFER_BIT: Int\n val COLOR_BUFFER_BIT: Int\n val POINTS: Int\n val LINES: Int\n val LINE_LOOP: Int\n val LINE_STRIP: Int\n val TRIANGLES: Int\n val TRIANGLE_STRIP: Int\n val TRIANGLE_FAN: Int\n val ZERO: Int\n val ONE: Int\n val SRC_COLOR: Int\n val ONE_MINUS_SRC_COLOR: Int\n val SRC_ALPHA: Int\n val ONE_MINUS_SRC_ALPHA: Int\n val DST_ALPHA: Int\n val ONE_MINUS_DST_ALPHA: Int\n val DST_COLOR: Int\n val ONE_MINUS_DST_COLOR: Int\n val SRC_ALPHA_SATURATE: Int\n val FUNC_ADD: Int\n val BLEND_EQUATION: Int\n val BLEND_EQUATION_RGB: Int\n val BLEND_EQUATION_ALPHA: Int\n val FUNC_SUBTRACT: Int\n val FUNC_REVERSE_SUBTRACT: Int\n val BLEND_DST_RGB: Int\n val BLEND_SRC_RGB: Int\n val BLEND_DST_ALPHA: Int\n val BLEND_SRC_ALPHA: Int\n val CONSTANT_COLOR: Int\n val ONE_MINUS_CONSTANT_COLOR: Int\n val CONSTANT_ALPHA: Int\n val ONE_MINUS_CONSTANT_ALPHA: Int\n val BLEND_COLOR: Int\n val ARRAY_BUFFER: Int\n val ELEMENT_ARRAY_BUFFER: Int\n val ARRAY_BUFFER_BINDING: Int\n val ELEMENT_ARRAY_BUFFER_BINDING: Int\n val STREAM_DRAW: Int\n val STATIC_DRAW: Int\n val DYNAMIC_DRAW: Int\n val BUFFER_SIZE: Int\n val BUFFER_USAGE: Int\n val CURRENT_VERTEX_ATTRIB: Int\n val FRONT: Int\n val BACK: Int\n val FRONT_AND_BACK: Int\n val CULL_FACE: Int\n val BLEND: Int\n val DITHER: Int\n val STENCIL_TEST: Int\n val DEPTH_TEST: Int\n val SCISSOR_TEST: Int\n val POLYGON_OFFSET_FILL: Int\n val SAMPLE_ALPHA_TO_COVERAGE: Int\n val SAMPLE_COVERAGE: Int\n val NO_ERROR: Int\n val INVALID_ENUM: Int\n val INVALID_VALUE: Int\n val INVALID_OPERATION: Int\n val OUT_OF_MEMORY: Int\n val CW: Int\n val CCW: Int\n val LINE_WIDTH: Int\n val ALIASED_POINT_SIZE_RANGE: Int\n val ALIASED_LINE_WIDTH_RANGE: Int\n val CULL_FACE_MODE: Int\n val FRONT_FACE: Int\n val DEPTH_RANGE: Int\n val DEPTH_WRITEMASK: Int\n val DEPTH_CLEAR_VALUE: Int\n val DEPTH_FUNC: Int\n val STENCIL_CLEAR_VALUE: Int\n val STENCIL_FUNC: Int\n val STENCIL_FAIL: Int\n val STENCIL_PASS_DEPTH_FAIL: Int\n val STENCIL_PASS_DEPTH_PASS: Int\n val STENCIL_REF: Int\n val STENCIL_VALUE_MASK: Int\n val STENCIL_WRITEMASK: Int\n val STENCIL_BACK_FUNC: Int\n val STENCIL_BACK_FAIL: Int\n val STENCIL_BACK_PASS_DEPTH_FAIL: Int\n val STENCIL_BACK_PASS_DEPTH_PASS: Int\n val STENCIL_BACK_REF: Int\n val STENCIL_BACK_VALUE_MASK: Int\n val STENCIL_BACK_WRITEMASK: Int\n val VIEWPORT: Int\n val SCISSOR_BOX: Int\n val COLOR_CLEAR_VALUE: Int\n val COLOR_WRITEMASK: Int\n val UNPACK_ALIGNMENT: Int\n val PACK_ALIGNMENT: Int\n val MAX_TEXTURE_SIZE: Int\n val MAX_VIEWPORT_DIMS: Int\n val SUBPIXEL_BITS: Int\n val RED_BITS: Int\n val GREEN_BITS: Int\n val BLUE_BITS: Int\n val ALPHA_BITS: Int\n val DEPTH_BITS: Int\n val STENCIL_BITS: Int\n val POLYGON_OFFSET_UNITS: Int\n val POLYGON_OFFSET_FACTOR: Int\n val TEXTURE_BINDING_2D: Int\n val SAMPLE_BUFFERS: Int\n val SAMPLES: Int\n val SAMPLE_COVERAGE_VALUE: Int\n val SAMPLE_COVERAGE_INVERT: Int\n val COMPRESSED_TEXTURE_FORMATS: Int\n val DONT_CARE: Int\n val FASTEST: Int\n val NICEST: Int\n val GENERATE_MIPMAP_HINT: Int\n val BYTE: Int\n val UNSIGNED_BYTE: Int\n val SHORT: Int\n val UNSIGNED_SHORT: Int\n val INT: Int\n val UNSIGNED_INT: Int\n val FLOAT: Int\n val DEPTH_COMPONENT: Int\n val ALPHA: Int\n val RGB: Int\n val RGBA: Int\n val LUMINANCE: Int\n val LUMINANCE_ALPHA: Int\n val UNSIGNED_SHORT_4_4_4_4: Int\n val UNSIGNED_SHORT_5_5_5_1: Int\n val UNSIGNED_SHORT_5_6_5: Int\n val FRAGMENT_SHADER: Int\n val VERTEX_SHADER: Int\n val MAX_VERTEX_ATTRIBS: Int\n val MAX_VERTEX_UNIFORM_VECTORS: Int\n val MAX_VARYING_VECTORS: Int\n val MAX_COMBINED_TEXTURE_IMAGE_UNITS: Int\n val MAX_VERTEX_TEXTURE_IMAGE_UNITS: Int\n val MAX_TEXTURE_IMAGE_UNITS: Int\n val MAX_FRAGMENT_UNIFORM_VECTORS: Int\n val SHADER_TYPE: Int\n val DELETE_STATUS: Int\n val LINK_STATUS: Int\n val VALIDATE_STATUS: Int\n val ATTACHED_SHADERS: Int\n val ACTIVE_UNIFORMS: Int\n val ACTIVE_ATTRIBUTES: Int\n val SHADING_LANGUAGE_VERSION: Int\n val CURRENT_PROGRAM: Int\n val NEVER: Int\n val LESS: Int\n val EQUAL: Int\n val LEQUAL: Int\n val GREATER: Int\n val NOTEQUAL: Int\n val GEQUAL: Int\n val ALWAYS: Int\n val KEEP: Int\n val REPLACE: Int\n val INCR: Int\n val DECR: Int\n val INVERT: Int\n val INCR_WRAP: Int\n val DECR_WRAP: Int\n val VENDOR: Int\n val RENDERER: Int\n val VERSION: Int\n val NEAREST: Int\n val LINEAR: Int\n val NEAREST_MIPMAP_NEAREST: Int\n val LINEAR_MIPMAP_NEAREST: Int\n val NEAREST_MIPMAP_LINEAR: Int\n val LINEAR_MIPMAP_LINEAR: Int\n val TEXTURE_MAG_FILTER: Int\n val TEXTURE_MIN_FILTER: Int\n val TEXTURE_WRAP_S: Int\n val TEXTURE_WRAP_T: Int\n val TEXTURE_2D: Int\n val TEXTURE: Int\n val TEXTURE_CUBE_MAP: Int\n val TEXTURE_BINDING_CUBE_MAP: Int\n val TEXTURE_CUBE_MAP_POSITIVE_X: Int\n val TEXTURE_CUBE_MAP_NEGATIVE_X: Int\n val TEXTURE_CUBE_MAP_POSITIVE_Y: Int\n val TEXTURE_CUBE_MAP_NEGATIVE_Y: Int\n val TEXTURE_CUBE_MAP_POSITIVE_Z: Int\n val TEXTURE_CUBE_MAP_NEGATIVE_Z: Int\n val MAX_CUBE_MAP_TEXTURE_SIZE: Int\n val TEXTURE0: Int\n val TEXTURE1: Int\n val TEXTURE2: Int\n val TEXTURE3: Int\n val TEXTURE4: Int\n val TEXTURE5: Int\n val TEXTURE6: Int\n val TEXTURE7: Int\n val TEXTURE8: Int\n val TEXTURE9: Int\n val TEXTURE10: Int\n val TEXTURE11: Int\n val TEXTURE12: Int\n val TEXTURE13: Int\n val TEXTURE14: Int\n val TEXTURE15: Int\n val TEXTURE16: Int\n val TEXTURE17: Int\n val TEXTURE18: Int\n val TEXTURE19: Int\n val TEXTURE20: Int\n val TEXTURE21: Int\n val TEXTURE22: Int\n val TEXTURE23: Int\n val TEXTURE24: Int\n val TEXTURE25: Int\n val TEXTURE26: Int\n val TEXTURE27: Int\n val TEXTURE28: Int\n val TEXTURE29: Int\n val TEXTURE30: Int\n val TEXTURE31: Int\n val ACTIVE_TEXTURE: Int\n val REPEAT: Int\n val CLAMP_TO_EDGE: Int\n val MIRRORED_REPEAT: Int\n val FLOAT_VEC2: Int\n val FLOAT_VEC3: Int\n val FLOAT_VEC4: Int\n val INT_VEC2: Int\n val INT_VEC3: Int\n val INT_VEC4: Int\n val BOOL: Int\n val BOOL_VEC2: Int\n val BOOL_VEC3: Int\n val BOOL_VEC4: Int\n val FLOAT_MAT2: Int\n val FLOAT_MAT3: Int\n val FLOAT_MAT4: Int\n val SAMPLER_2D: Int\n val SAMPLER_CUBE: Int\n val VERTEX_ATTRIB_ARRAY_ENABLED: Int\n val VERTEX_ATTRIB_ARRAY_SIZE: Int\n val VERTEX_ATTRIB_ARRAY_STRIDE: Int\n val VERTEX_ATTRIB_ARRAY_TYPE: Int\n val VERTEX_ATTRIB_ARRAY_NORMALIZED: Int\n val VERTEX_ATTRIB_ARRAY_POINTER: Int\n val VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: Int\n val IMPLEMENTATION_COLOR_READ_TYPE: Int\n val IMPLEMENTATION_COLOR_READ_FORMAT: Int\n val COMPILE_STATUS: Int\n val LOW_FLOAT: Int\n val MEDIUM_FLOAT: Int\n val HIGH_FLOAT: Int\n val LOW_INT: Int\n val MEDIUM_INT: Int\n val HIGH_INT: Int\n val FRAMEBUFFER: Int\n val RENDERBUFFER: Int\n val RGBA4: Int\n val RGB5_A1: Int\n val RGB565: Int\n val DEPTH_COMPONENT16: Int\n val STENCIL_INDEX: Int\n val STENCIL_INDEX8: Int\n val DEPTH_STENCIL: Int\n val RENDERBUFFER_WIDTH: Int\n val RENDERBUFFER_HEIGHT: Int\n val RENDERBUFFER_INTERNAL_FORMAT: Int\n val RENDERBUFFER_RED_SIZE: Int\n val RENDERBUFFER_GREEN_SIZE: Int\n val RENDERBUFFER_BLUE_SIZE: Int\n val RENDERBUFFER_ALPHA_SIZE: Int\n val RENDERBUFFER_DEPTH_SIZE: Int\n val RENDERBUFFER_STENCIL_SIZE: Int\n val FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: Int\n val FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: Int\n val FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: Int\n val FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: Int\n val COLOR_ATTACHMENT0: Int\n val DEPTH_ATTACHMENT: Int\n val STENCIL_ATTACHMENT: Int\n val DEPTH_STENCIL_ATTACHMENT: Int\n val NONE: Int\n val FRAMEBUFFER_COMPLETE: Int\n val FRAMEBUFFER_INCOMPLETE_ATTACHMENT: Int\n val FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: Int\n val FRAMEBUFFER_INCOMPLETE_DIMENSIONS: Int\n val FRAMEBUFFER_UNSUPPORTED: Int\n val FRAMEBUFFER_BINDING: Int\n val RENDERBUFFER_BINDING: Int\n val MAX_RENDERBUFFER_SIZE: Int\n val INVALID_FRAMEBUFFER_OPERATION: Int\n val UNPACK_FLIP_Y_WEBGL: Int\n val UNPACK_PREMULTIPLY_ALPHA_WEBGL: Int\n val CONTEXT_LOST_WEBGL: Int\n val UNPACK_COLORSPACE_CONVERSION_WEBGL: Int\n val BROWSER_DEFAULT_WEBGL: Int\n }\n}\n\n/**\n * Exposes the JavaScript [WebGLContextEvent](https://developer.mozilla.org/en/docs/Web/API/WebGLContextEvent) to Kotlin\n */\npublic external open class WebGLContextEvent(type: String, eventInit: WebGLContextEventInit = definedExternally) : Event {\n open val statusMessage: String\n\n companion object {\n val NONE: Short\n val CAPTURING_PHASE: Short\n val AT_TARGET: Short\n val BUBBLING_PHASE: Short\n }\n}\n\npublic external interface WebGLContextEventInit : EventInit {\n var statusMessage: String? /* = \"\" */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun WebGLContextEventInit(statusMessage: String? = \"\", bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): WebGLContextEventInit {\n val o = js(\"({})\")\n o[\"statusMessage\"] = statusMessage\n o[\"bubbles\"] = bubbles\n o[\"cancelable\"] = cancelable\n o[\"composed\"] = composed\n return o\n}\n\n/**\n * Exposes the JavaScript [ArrayBuffer](https://developer.mozilla.org/en/docs/Web/API/ArrayBuffer) to Kotlin\n */\npublic external open class ArrayBuffer(length: Int) : BufferDataSource {\n open val byteLength: Int\n fun slice(begin: Int, end: Int = definedExternally): ArrayBuffer\n\n companion object {\n fun isView(value: Any?): Boolean\n }\n}\n\n/**\n * Exposes the JavaScript [ArrayBufferView](https://developer.mozilla.org/en/docs/Web/API/ArrayBufferView) to Kotlin\n */\npublic external interface ArrayBufferView : BufferDataSource {\n val buffer: ArrayBuffer\n val byteOffset: Int\n val byteLength: Int\n}\n\n/**\n * Exposes the JavaScript [Int8Array](https://developer.mozilla.org/en/docs/Web/API/Int8Array) to Kotlin\n */\npublic external open class Int8Array : ArrayBufferView {\n constructor(length: Int)\n constructor(array: Int8Array)\n constructor(array: Array)\n constructor(buffer: ArrayBuffer, byteOffset: Int = definedExternally, length: Int = definedExternally)\n open val length: Int\n override val buffer: ArrayBuffer\n override val byteOffset: Int\n override val byteLength: Int\n fun set(array: Int8Array, offset: Int = definedExternally)\n fun set(array: Array, offset: Int = definedExternally)\n fun subarray(start: Int, end: Int): Int8Array\n\n companion object {\n val BYTES_PER_ELEMENT: Int\n }\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun Int8Array.get(index: Int): Byte = asDynamic()[index]\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun Int8Array.set(index: Int, value: Byte) { asDynamic()[index] = value }\n\n/**\n * Exposes the JavaScript [Uint8Array](https://developer.mozilla.org/en/docs/Web/API/Uint8Array) to Kotlin\n */\npublic external open class Uint8Array : ArrayBufferView {\n constructor(length: Int)\n constructor(array: Uint8Array)\n constructor(array: Array)\n constructor(buffer: ArrayBuffer, byteOffset: Int = definedExternally, length: Int = definedExternally)\n open val length: Int\n override val buffer: ArrayBuffer\n override val byteOffset: Int\n override val byteLength: Int\n fun set(array: Uint8Array, offset: Int = definedExternally)\n fun set(array: Array, offset: Int = definedExternally)\n fun subarray(start: Int, end: Int): Uint8Array\n\n companion object {\n val BYTES_PER_ELEMENT: Int\n }\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun Uint8Array.get(index: Int): Byte = asDynamic()[index]\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun Uint8Array.set(index: Int, value: Byte) { asDynamic()[index] = value }\n\n/**\n * Exposes the JavaScript [Uint8ClampedArray](https://developer.mozilla.org/en/docs/Web/API/Uint8ClampedArray) to Kotlin\n */\npublic external open class Uint8ClampedArray : ArrayBufferView {\n constructor(length: Int)\n constructor(array: Uint8ClampedArray)\n constructor(array: Array)\n constructor(buffer: ArrayBuffer, byteOffset: Int = definedExternally, length: Int = definedExternally)\n open val length: Int\n override val buffer: ArrayBuffer\n override val byteOffset: Int\n override val byteLength: Int\n fun set(array: Uint8ClampedArray, offset: Int = definedExternally)\n fun set(array: Array, offset: Int = definedExternally)\n fun subarray(start: Int, end: Int): Uint8ClampedArray\n\n companion object {\n val BYTES_PER_ELEMENT: Int\n }\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun Uint8ClampedArray.get(index: Int): Byte = asDynamic()[index]\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun Uint8ClampedArray.set(index: Int, value: Byte) { asDynamic()[index] = value }\n\n/**\n * Exposes the JavaScript [Int16Array](https://developer.mozilla.org/en/docs/Web/API/Int16Array) to Kotlin\n */\npublic external open class Int16Array : ArrayBufferView {\n constructor(length: Int)\n constructor(array: Int16Array)\n constructor(array: Array)\n constructor(buffer: ArrayBuffer, byteOffset: Int = definedExternally, length: Int = definedExternally)\n open val length: Int\n override val buffer: ArrayBuffer\n override val byteOffset: Int\n override val byteLength: Int\n fun set(array: Int16Array, offset: Int = definedExternally)\n fun set(array: Array, offset: Int = definedExternally)\n fun subarray(start: Int, end: Int): Int16Array\n\n companion object {\n val BYTES_PER_ELEMENT: Int\n }\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun Int16Array.get(index: Int): Short = asDynamic()[index]\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun Int16Array.set(index: Int, value: Short) { asDynamic()[index] = value }\n\n/**\n * Exposes the JavaScript [Uint16Array](https://developer.mozilla.org/en/docs/Web/API/Uint16Array) to Kotlin\n */\npublic external open class Uint16Array : ArrayBufferView {\n constructor(length: Int)\n constructor(array: Uint16Array)\n constructor(array: Array)\n constructor(buffer: ArrayBuffer, byteOffset: Int = definedExternally, length: Int = definedExternally)\n open val length: Int\n override val buffer: ArrayBuffer\n override val byteOffset: Int\n override val byteLength: Int\n fun set(array: Uint16Array, offset: Int = definedExternally)\n fun set(array: Array, offset: Int = definedExternally)\n fun subarray(start: Int, end: Int): Uint16Array\n\n companion object {\n val BYTES_PER_ELEMENT: Int\n }\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun Uint16Array.get(index: Int): Short = asDynamic()[index]\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun Uint16Array.set(index: Int, value: Short) { asDynamic()[index] = value }\n\n/**\n * Exposes the JavaScript [Int32Array](https://developer.mozilla.org/en/docs/Web/API/Int32Array) to Kotlin\n */\npublic external open class Int32Array : ArrayBufferView {\n constructor(length: Int)\n constructor(array: Int32Array)\n constructor(array: Array)\n constructor(buffer: ArrayBuffer, byteOffset: Int = definedExternally, length: Int = definedExternally)\n open val length: Int\n override val buffer: ArrayBuffer\n override val byteOffset: Int\n override val byteLength: Int\n fun set(array: Int32Array, offset: Int = definedExternally)\n fun set(array: Array, offset: Int = definedExternally)\n fun subarray(start: Int, end: Int): Int32Array\n\n companion object {\n val BYTES_PER_ELEMENT: Int\n }\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun Int32Array.get(index: Int): Int = asDynamic()[index]\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun Int32Array.set(index: Int, value: Int) { asDynamic()[index] = value }\n\n/**\n * Exposes the JavaScript [Uint32Array](https://developer.mozilla.org/en/docs/Web/API/Uint32Array) to Kotlin\n */\npublic external open class Uint32Array : ArrayBufferView {\n constructor(length: Int)\n constructor(array: Uint32Array)\n constructor(array: Array)\n constructor(buffer: ArrayBuffer, byteOffset: Int = definedExternally, length: Int = definedExternally)\n open val length: Int\n override val buffer: ArrayBuffer\n override val byteOffset: Int\n override val byteLength: Int\n fun set(array: Uint32Array, offset: Int = definedExternally)\n fun set(array: Array, offset: Int = definedExternally)\n fun subarray(start: Int, end: Int): Uint32Array\n\n companion object {\n val BYTES_PER_ELEMENT: Int\n }\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun Uint32Array.get(index: Int): Int = asDynamic()[index]\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun Uint32Array.set(index: Int, value: Int) { asDynamic()[index] = value }\n\n/**\n * Exposes the JavaScript [Float32Array](https://developer.mozilla.org/en/docs/Web/API/Float32Array) to Kotlin\n */\npublic external open class Float32Array : ArrayBufferView {\n constructor(length: Int)\n constructor(array: Float32Array)\n constructor(array: Array)\n constructor(buffer: ArrayBuffer, byteOffset: Int = definedExternally, length: Int = definedExternally)\n open val length: Int\n override val buffer: ArrayBuffer\n override val byteOffset: Int\n override val byteLength: Int\n fun set(array: Float32Array, offset: Int = definedExternally)\n fun set(array: Array, offset: Int = definedExternally)\n fun subarray(start: Int, end: Int): Float32Array\n\n companion object {\n val BYTES_PER_ELEMENT: Int\n }\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun Float32Array.get(index: Int): Float = asDynamic()[index]\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun Float32Array.set(index: Int, value: Float) { asDynamic()[index] = value }\n\n/**\n * Exposes the JavaScript [Float64Array](https://developer.mozilla.org/en/docs/Web/API/Float64Array) to Kotlin\n */\npublic external open class Float64Array : ArrayBufferView {\n constructor(length: Int)\n constructor(array: Float64Array)\n constructor(array: Array)\n constructor(buffer: ArrayBuffer, byteOffset: Int = definedExternally, length: Int = definedExternally)\n open val length: Int\n override val buffer: ArrayBuffer\n override val byteOffset: Int\n override val byteLength: Int\n fun set(array: Float64Array, offset: Int = definedExternally)\n fun set(array: Array, offset: Int = definedExternally)\n fun subarray(start: Int, end: Int): Float64Array\n\n companion object {\n val BYTES_PER_ELEMENT: Int\n }\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun Float64Array.get(index: Int): Double = asDynamic()[index]\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun Float64Array.set(index: Int, value: Double) { asDynamic()[index] = value }\n\n/**\n * Exposes the JavaScript [DataView](https://developer.mozilla.org/en/docs/Web/API/DataView) to Kotlin\n */\npublic external open class DataView(buffer: ArrayBuffer, byteOffset: Int = definedExternally, byteLength: Int = definedExternally) : ArrayBufferView {\n override val buffer: ArrayBuffer\n override val byteOffset: Int\n override val byteLength: Int\n fun getInt8(byteOffset: Int): Byte\n fun getUint8(byteOffset: Int): Byte\n fun getInt16(byteOffset: Int, littleEndian: Boolean = definedExternally): Short\n fun getUint16(byteOffset: Int, littleEndian: Boolean = definedExternally): Short\n fun getInt32(byteOffset: Int, littleEndian: Boolean = definedExternally): Int\n fun getUint32(byteOffset: Int, littleEndian: Boolean = definedExternally): Int\n fun getFloat32(byteOffset: Int, littleEndian: Boolean = definedExternally): Float\n fun getFloat64(byteOffset: Int, littleEndian: Boolean = definedExternally): Double\n fun setInt8(byteOffset: Int, value: Byte)\n fun setUint8(byteOffset: Int, value: Byte)\n fun setInt16(byteOffset: Int, value: Short, littleEndian: Boolean = definedExternally)\n fun setUint16(byteOffset: Int, value: Short, littleEndian: Boolean = definedExternally)\n fun setInt32(byteOffset: Int, value: Int, littleEndian: Boolean = definedExternally)\n fun setUint32(byteOffset: Int, value: Int, littleEndian: Boolean = definedExternally)\n fun setFloat32(byteOffset: Int, value: Float, littleEndian: Boolean = definedExternally)\n fun setFloat64(byteOffset: Int, value: Double, littleEndian: Boolean = definedExternally)\n}\n\npublic external interface BufferDataSource\n\npublic external interface TexImageSource","// ktlint-disable filename\npackage io.ktor.utils.io.core\n\nimport org.khronos.webgl.*\n\npublic actual enum class ByteOrder {\n BIG_ENDIAN, LITTLE_ENDIAN;\n\n public actual companion object {\n private val native: ByteOrder\n\n init {\n val buffer = ArrayBuffer(4)\n val arr = Int32Array(buffer)\n val view = DataView(buffer)\n\n arr[0] = 0x11223344\n\n native = if (view.getInt32(0, true) == 0x11223344) LITTLE_ENDIAN else BIG_ENDIAN\n }\n\n public actual fun nativeOrder(): ByteOrder = native\n }\n}\n","package io.ktor.utils.io.core\n\nimport org.khronos.webgl.*\n\n@Suppress(\"UNCHECKED_CAST_TO_EXTERNAL_INTERFACE\")\npublic fun Input.readFully(dst: Int8Array, offset: Int = 0, length: Int = dst.length - offset) {\n readFully(dst as ArrayBufferView, offset, length)\n}\n\npublic fun Input.readFully(dst: ArrayBuffer, offset: Int = 0, length: Int = dst.byteLength - offset) {\n if (remaining < length) {\n throw IllegalArgumentException(\"Not enough bytes available ($remaining) to read $length bytes\")\n }\n\n var copied = 0\n takeWhile { buffer: Buffer ->\n val rc = buffer.readAvailable(dst, offset + copied, length - copied)\n if (rc > 0) copied += rc\n copied < length\n }\n}\n\npublic fun Input.readFully(dst: ArrayBufferView, byteOffset: Int = 0, byteLength: Int = dst.byteLength - byteOffset) {\n require(byteLength <= dst.byteLength) {\n throw IndexOutOfBoundsException(\"length $byteLength is greater than view size ${dst.byteLength}\")\n }\n\n return readFully(dst.buffer, dst.byteOffset + byteOffset, byteLength)\n}\n\n@Suppress(\"unused\")\npublic fun Input.readAvailable(dst: Int8Array, offset: Int = 0, length: Int = dst.length - offset): Int {\n val remaining = remaining\n if (remaining == 0L) return -1\n val size = minOf(remaining, length.toLong()).toInt()\n readFully(dst, offset, size)\n return size\n}\n\npublic fun Input.readAvailable(dst: ArrayBuffer, offset: Int = 0, length: Int = dst.byteLength - offset): Int {\n val remaining = remaining\n if (remaining == 0L) return -1\n val size = minOf(remaining, length.toLong()).toInt()\n readFully(dst, offset, size)\n return size\n}\n\n@Suppress(\"unused\")\npublic fun Input.readAvailable(\n dst: ArrayBufferView,\n byteOffset: Int = 0,\n byteLength: Int = dst.byteLength - byteOffset\n): Int {\n val remaining = remaining\n if (remaining == 0L) return -1\n val size = minOf(remaining, byteLength.toLong()).toInt()\n readFully(dst, byteOffset, size)\n return size\n}\n","package io.ktor.utils.io.core\n\nimport io.ktor.utils.io.bits.*\nimport io.ktor.utils.io.charsets.*\nimport io.ktor.utils.io.core.internal.*\nimport org.khronos.webgl.*\nimport kotlin.require\n\n/**\n * Create an instance of [String] from the specified [bytes] range starting at [offset] and bytes [length]\n * interpreting characters in the specified [charset].\n */\n@Suppress(\"FunctionName\")\npublic actual fun String(bytes: ByteArray, offset: Int, length: Int, charset: Charset): String {\n if (offset < 0 || length < 0 || offset + length > bytes.size) {\n checkIndices(offset, length, bytes)\n }\n\n @Suppress(\"UnsafeCastFromDynamic\")\n val i8: Int8Array = bytes.asDynamic() // we know that K/JS generates Int8Array for ByteBuffer\n val bufferOffset = i8.byteOffset + offset\n val buffer = i8.buffer.slice(bufferOffset, bufferOffset + length)\n\n @Suppress(\"DEPRECATION\")\n val view = ChunkBuffer(Memory.of(buffer), null, ChunkBuffer.NoPool)\n view.resetForRead()\n val packet = ByteReadPacket(view, ChunkBuffer.NoPoolManuallyManaged)\n\n return charset.newDecoder().decode(packet, Int.MAX_VALUE)\n}\n\npublic fun checkIndices(offset: Int, length: Int, bytes: ByteArray): Nothing {\n require(offset >= 0) { throw IndexOutOfBoundsException(\"offset ($offset) shouldn't be negative\") }\n require(length >= 0) { throw IndexOutOfBoundsException(\"length ($length) shouldn't be negative\") }\n require(offset + length <= bytes.size) {\n throw IndexOutOfBoundsException(\"offset ($offset) + length ($length) > bytes.size (${bytes.size})\")\n }\n\n throw IndexOutOfBoundsException()\n}\n\ninternal actual fun String.getCharsInternal(dst: CharArray, dstOffset: Int) {\n val length = length\n require(dstOffset + length <= dst.size)\n\n var dstIndex = dstOffset\n for (srcIndex in 0 until length) {\n dst[dstIndex++] = this[srcIndex]\n }\n}\n","package io.ktor.utils.io.errors\n\npublic actual open class IOException actual constructor(message: String, cause: Throwable?) :\n Exception(message, cause) {\n public actual constructor(message: String) : this(message, null)\n}\n\npublic actual open class EOFException actual constructor(message: String) : IOException(message)\n","/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.utils.io.js\n\nimport org.khronos.webgl.*\n\ninternal external class TextDecoder(encoding: String, options: dynamic = definedExternally) {\n val encoding: String\n\n fun decode(): String\n fun decode(buffer: ArrayBuffer): String\n fun decode(buffer: ArrayBuffer, options: dynamic): String\n fun decode(buffer: ArrayBufferView): String\n fun decode(buffer: ArrayBufferView, options: dynamic): String\n}\n\ninternal fun TextDecoder.toKtor(): Decoder = object : Decoder {\n override fun decode(): String = this@toKtor.decode()\n override fun decode(buffer: ArrayBufferView): String = this@toKtor.decode(buffer)\n override fun decode(buffer: ArrayBufferView, options: dynamic): String = this@toKtor.decode(buffer, options)\n}\n\ninternal fun textDecoderOptions(fatal: Boolean = false): Any = Any().apply {\n with(this.asDynamic()) {\n this.fatal = fatal\n }\n}\n","/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.utils.io.js\n\nimport io.ktor.utils.io.core.*\nimport org.khronos.webgl.*\n\nprivate val ENCODING_ALIASES = setOf(\n \"ansi_x3.4-1968\",\n \"ascii\",\n \"cp1252\",\n \"cp819\",\n \"csisolatin1\",\n \"ibm819\",\n \"iso-8859-1\",\n \"iso-ir-100\",\n \"iso8859-1\",\n \"iso88591\",\n \"iso_8859-1\",\n \"iso_8859-1:1987\",\n \"l1\",\n \"latin1\",\n \"us-ascii\",\n \"windows-1252\",\n \"x-cp1252\"\n)\n\nprivate val REPLACEMENT = byteArrayOf(0xEF.toByte(), 0xBF.toByte(), 0xBD.toByte())\n\n/**\n * Windows-1252 decoder.\n *\n * According to https://encoding.spec.whatwg.org/, ISO-8859-1 should be treated as windows-1252 for http.\n */\ninternal class TextDecoderFallback(\n encoding: String,\n val fatal: Boolean\n) : Decoder {\n\n init {\n val requestedEncoding = encoding.trim().lowercase()\n check(ENCODING_ALIASES.contains(requestedEncoding)) { \"$encoding is not supported.\" }\n }\n\n override fun decode(): String = \"\"\n\n override fun decode(buffer: ArrayBufferView): String = buildPacket {\n val bytes = buffer as Int8Array\n for (index in 0 until bytes.length) {\n val byte = bytes[index]\n val point: Int = byte.toCodePoint()\n\n if (point < 0) {\n check(!fatal) { \"Invalid character: $point\" }\n writeFully(REPLACEMENT)\n continue\n }\n\n if (point > 0xFF) {\n writeByte((point shr 8).toByte())\n }\n\n writeByte((point and 0xFF).toByte())\n }\n }.readBytes().decodeToString()\n\n override fun decode(buffer: ArrayBufferView, options: dynamic): String {\n return decode(buffer)\n }\n}\n\nprivate fun Byte.toCodePoint(): Int {\n val value = toInt() and 0xFF\n if (value.isASCII()) {\n return value\n }\n\n return WIN1252_TABLE[value - 0x80]\n}\n\nprivate fun Int.isASCII(): Boolean = this in 0..0x7F\n","package io.ktor.utils.io.pool\n\npublic actual abstract class DefaultPool\nactual constructor(actual final override val capacity: Int) : ObjectPool {\n\n private val instances = arrayOfNulls(capacity)\n private var size = 0\n\n protected actual abstract fun produceInstance(): T\n protected actual open fun disposeInstance(instance: T) {}\n\n protected actual open fun clearInstance(instance: T): T = instance\n protected actual open fun validateInstance(instance: T) {}\n\n actual final override fun borrow(): T {\n if (size == 0) return produceInstance()\n val idx = --size\n\n @Suppress(\"UNCHECKED_CAST\")\n val instance = instances[idx] as T\n instances[idx] = null\n\n return clearInstance(instance)\n }\n\n actual final override fun recycle(instance: T) {\n validateInstance(instance)\n if (size == capacity) {\n disposeInstance(instance)\n } else {\n instances[size++] = instance\n }\n }\n\n actual final override fun dispose() {\n for (i in 0 until size) {\n @Suppress(\"UNCHECKED_CAST\")\n val instance = instances[i] as T\n instances[i] = null\n disposeInstance(instance)\n }\n size = 0\n }\n}\n","@file:Suppress(\"NOTHING_TO_INLINE\")\n\npackage io.ktor.utils.io.bits\n\n/**\n * Reverse number's byte order\n */\npublic actual fun Short.reverseByteOrder(): Short = swap(this)\n\n/**\n * Reverse number's byte order\n */\npublic actual fun Int.reverseByteOrder(): Int = swap(this)\n\n/**\n * Reverse number's byte order\n */\npublic actual fun Long.reverseByteOrder(): Long = swap(this)\n\n/**\n * Reverse number's byte order\n */\npublic actual fun Float.reverseByteOrder(): Float = swap(this)\n\n/**\n * Reverse number's byte order\n */\npublic actual fun Double.reverseByteOrder(): Double = swap(this)\n\nprivate inline fun swap(s: Short): Short = (((s.toInt() and 0xff) shl 8) or ((s.toInt() and 0xffff) ushr 8)).toShort()\n\nprivate inline fun swap(s: Int): Int =\n (swap((s and 0xffff).toShort()).toInt() shl 16) or (swap((s ushr 16).toShort()).toInt() and 0xffff)\n\nprivate inline fun swap(s: Long): Long =\n (swap((s and 0xffffffff).toInt()).toLong() shl 32) or (swap((s ushr 32).toInt()).toLong() and 0xffffffff)\n\nprivate inline fun swap(s: Float): Float = Float.fromBits(swap(s.toRawBits()))\n\nprivate inline fun swap(s: Double): Double = Double.fromBits(swap(s.toRawBits()))\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin\n\n\n/**\n * Returns a bit representation of the specified floating-point value as [Long]\n * according to the IEEE 754 floating-point \"double format\" bit layout.\n */\n@SinceKotlin(\"1.2\")\n@library(\"doubleToBits\")\npublic actual fun Double.toBits(): Long = definedExternally\n\n/**\n * Returns a bit representation of the specified floating-point value as [Long]\n * according to the IEEE 754 floating-point \"double format\" bit layout,\n * preserving `NaN` values exact layout.\n */\n@SinceKotlin(\"1.2\")\n@library(\"doubleToRawBits\")\npublic actual fun Double.toRawBits(): Long = definedExternally\n\n/**\n * Returns the [Double] value corresponding to a given bit representation.\n */\n@SinceKotlin(\"1.2\")\n@kotlin.internal.InlineOnly\npublic actual inline fun Double.Companion.fromBits(bits: Long): Double = js(\"Kotlin\").doubleFromBits(bits).unsafeCast()\n\n/**\n * Returns a bit representation of the specified floating-point value as [Int]\n * according to the IEEE 754 floating-point \"single format\" bit layout.\n *\n * Note that in Kotlin/JS [Float] range is wider than \"single format\" bit layout can represent,\n * so some [Float] values may overflow, underflow or loose their accuracy after conversion to bits and back.\n */\n@SinceKotlin(\"1.2\")\n@library(\"floatToBits\")\npublic actual fun Float.toBits(): Int = definedExternally\n\n/**\n * Returns a bit representation of the specified floating-point value as [Int]\n * according to the IEEE 754 floating-point \"single format\" bit layout,\n * preserving `NaN` values exact layout.\n *\n * Note that in Kotlin/JS [Float] range is wider than \"single format\" bit layout can represent,\n * so some [Float] values may overflow, underflow or loose their accuracy after conversion to bits and back.\n */\n@SinceKotlin(\"1.2\")\n@library(\"floatToRawBits\")\npublic actual fun Float.toRawBits(): Int = definedExternally\n\n/**\n * Returns the [Float] value corresponding to a given bit representation.\n */\n@SinceKotlin(\"1.2\")\n@kotlin.internal.InlineOnly\npublic actual inline fun Float.Companion.fromBits(bits: Int): Float = js(\"Kotlin\").floatFromBits(bits).unsafeCast()\n\n\n@Suppress(\"NOTHING_TO_INLINE\")\ninternal inline fun Long(low: Int, high: Int) = js(\"Kotlin\").Long.fromBits(low, high).unsafeCast()\ninternal inline val Long.low: Int get() = this.asDynamic().getLowBits().unsafeCast()\ninternal inline val Long.high: Int get() = this.asDynamic().getHighBits().unsafeCast()\n","package io.ktor.utils.io.core\n\npublic actual interface Closeable {\n public actual fun close()\n}\n\n@PublishedApi\ninternal actual fun Throwable.addSuppressedInternal(other: Throwable) {\n}\n","@file:Suppress(\"NOTHING_TO_INLINE\")\n\npackage io.ktor.utils.io.bits\n\nimport io.ktor.utils.io.core.*\nimport io.ktor.utils.io.core.internal.*\nimport org.khronos.webgl.*\n\nprivate val isLittleEndianPlatform = ByteOrder.nativeOrder() === ByteOrder.LITTLE_ENDIAN\n\n/**\n * Copies short integers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\npublic actual fun Memory.loadShortArray(\n offset: Int,\n destination: ShortArray,\n destinationOffset: Int,\n count: Int\n) {\n val typed = Int16Array(view.buffer, view.byteOffset + offset, count)\n\n if (isLittleEndianPlatform) {\n // TODO investigate this implementation vs DataView.getInt16(...)\n repeat(count) { index ->\n destination[index + destinationOffset] = typed[index].reverseByteOrder()\n }\n } else {\n repeat(count) { index ->\n destination[index + destinationOffset] = typed[index]\n }\n }\n}\n\n/**\n * Copies short integers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\npublic actual fun Memory.loadShortArray(\n offset: Long,\n destination: ShortArray,\n destinationOffset: Int,\n count: Int\n) {\n loadShortArray(offset.toIntOrFail(\"offset\"), destination, destinationOffset, count)\n}\n\n/**\n * Copies regular integers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\npublic actual fun Memory.loadIntArray(\n offset: Int,\n destination: IntArray,\n destinationOffset: Int,\n count: Int\n) {\n val typed = Int32Array(view.buffer, view.byteOffset + offset, count)\n\n if (isLittleEndianPlatform) {\n repeat(count) { index ->\n destination[index + destinationOffset] = typed[index].reverseByteOrder()\n }\n } else {\n repeat(count) { index ->\n destination[index + destinationOffset] = typed[index]\n }\n }\n}\n\n/**\n * Copies regular integers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\npublic actual fun Memory.loadIntArray(\n offset: Long,\n destination: IntArray,\n destinationOffset: Int,\n count: Int\n) {\n loadIntArray(offset.toIntOrFail(\"offset\"), destination, destinationOffset, count)\n}\n\n/**\n * Copies regular integers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\npublic actual fun Memory.loadLongArray(\n offset: Int,\n destination: LongArray,\n destinationOffset: Int,\n count: Int\n) {\n val typed = Int32Array(view.buffer, view.byteOffset + offset, count * 2)\n\n if (isLittleEndianPlatform) {\n for (index in 0 until count * 2 step 2) {\n destination[index / 2 + destinationOffset] =\n (typed[index + 1].reverseByteOrder().toLong() and 0xffffffffL) or\n (typed[index].reverseByteOrder().toLong() shl 32)\n }\n } else {\n for (index in 0 until count * 2 step 2) {\n destination[index / 2 + destinationOffset] = (typed[index].toLong() and 0xffffffffL) or\n (typed[index + 1].toLong() shl 32)\n }\n }\n}\n\n/**\n * Copies regular integers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\npublic actual fun Memory.loadLongArray(\n offset: Long,\n destination: LongArray,\n destinationOffset: Int,\n count: Int\n) {\n loadLongArray(offset.toIntOrFail(\"offset\"), destination, destinationOffset, count)\n}\n\n/**\n * Copies floating point numbers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\npublic actual fun Memory.loadFloatArray(\n offset: Int,\n destination: FloatArray,\n destinationOffset: Int,\n count: Int\n) {\n val typed = Float32Array(view.buffer, view.byteOffset + offset, count)\n\n if (isLittleEndianPlatform) {\n repeat(count) { index ->\n destination[index + destinationOffset] = typed[index].reverseByteOrder()\n }\n } else {\n repeat(count) { index ->\n destination[index + destinationOffset] = typed[index]\n }\n }\n}\n\n/**\n * Copies floating point numbers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\npublic actual fun Memory.loadFloatArray(\n offset: Long,\n destination: FloatArray,\n destinationOffset: Int,\n count: Int\n) {\n loadFloatArray(offset.toIntOrFail(\"offset\"), destination, destinationOffset, count)\n}\n\n/**\n * Copies floating point numbers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\npublic actual fun Memory.loadDoubleArray(\n offset: Int,\n destination: DoubleArray,\n destinationOffset: Int,\n count: Int\n) {\n val typed = Float64Array(view.buffer, view.byteOffset + offset, count)\n\n if (isLittleEndianPlatform) {\n repeat(count) { index ->\n destination[index + destinationOffset] = typed[index].reverseByteOrder()\n }\n } else {\n repeat(count) { index ->\n destination[index + destinationOffset] = typed[index]\n }\n }\n}\n\n/**\n * Copies floating point numbers from this memory range from the specified [offset] and [count]\n * to the [destination] at [destinationOffset] interpreting numbers in the network order (Big Endian).\n * @param destinationOffset items\n */\npublic actual fun Memory.loadDoubleArray(\n offset: Long,\n destination: DoubleArray,\n destinationOffset: Int,\n count: Int\n) {\n loadDoubleArray(offset.toIntOrFail(\"offset\"), destination, destinationOffset, count)\n}\n\n/**\n * Copies short integers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\npublic actual fun Memory.storeShortArray(\n offset: Int,\n source: ShortArray,\n sourceOffset: Int,\n count: Int\n) {\n val typed = Int16Array(view.buffer, view.byteOffset + offset, count)\n\n if (isLittleEndianPlatform) {\n // TODO investigate this implementation vs DataView.getInt16(...)\n repeat(count) { index ->\n typed[index] = source[index + sourceOffset].reverseByteOrder()\n }\n } else {\n repeat(count) { index ->\n typed[index] = source[index + sourceOffset]\n }\n }\n}\n\n/**\n * Copies short integers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\npublic actual fun Memory.storeShortArray(\n offset: Long,\n source: ShortArray,\n sourceOffset: Int,\n count: Int\n) {\n storeShortArray(offset.toIntOrFail(\"offset\"), source, sourceOffset, count)\n}\n\n/**\n * Copies regular integers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\npublic actual fun Memory.storeIntArray(\n offset: Int,\n source: IntArray,\n sourceOffset: Int,\n count: Int\n) {\n val typed = Int32Array(view.buffer, view.byteOffset + offset, count)\n\n if (isLittleEndianPlatform) {\n repeat(count) { index ->\n typed[index] = source[index + sourceOffset].reverseByteOrder()\n }\n } else {\n repeat(count) { index ->\n typed[index] = source[index + sourceOffset]\n }\n }\n}\n\n/**\n * Copies regular integers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\npublic actual fun Memory.storeIntArray(\n offset: Long,\n source: IntArray,\n sourceOffset: Int,\n count: Int\n) {\n storeIntArray(offset.toIntOrFail(\"offset\"), source, sourceOffset, count)\n}\n\n/**\n * Copies regular integers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\npublic actual fun Memory.storeLongArray(\n offset: Int,\n source: LongArray,\n sourceOffset: Int,\n count: Int\n) {\n val typed = Int32Array(view.buffer, view.byteOffset + offset, count * 2)\n\n if (isLittleEndianPlatform) {\n for (index in 0 until count * 2 step 2) {\n val sourceIndex = index / 2 + sourceOffset\n val sourceValue = source[sourceIndex]\n typed[index] = (sourceValue ushr 32).toInt().reverseByteOrder()\n typed[index + 1] = (sourceValue and 0xffffffffL).toInt().reverseByteOrder()\n }\n } else {\n for (index in 0 until count * 2 step 2) {\n val sourceIndex = index / 2 + sourceOffset\n val sourceValue = source[sourceIndex]\n typed[index] = (sourceValue ushr 32).toInt()\n typed[index + 1] = (sourceValue and 0xffffffffL).toInt()\n }\n }\n}\n\n/**\n * Copies regular integers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\npublic actual fun Memory.storeLongArray(\n offset: Long,\n source: LongArray,\n sourceOffset: Int,\n count: Int\n) {\n storeLongArray(offset.toIntOrFail(\"offset\"), source, sourceOffset, count)\n}\n\n/**\n * Copies floating point numbers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\npublic actual fun Memory.storeFloatArray(\n offset: Int,\n source: FloatArray,\n sourceOffset: Int,\n count: Int\n) {\n val typed = Float32Array(view.buffer, view.byteOffset + offset, count)\n\n if (isLittleEndianPlatform) {\n repeat(count) { index ->\n typed[index] = source[index + sourceOffset].reverseByteOrder()\n }\n } else {\n repeat(count) { index ->\n typed[index] = source[index + sourceOffset]\n }\n }\n}\n\n/**\n * Copies floating point numbers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\npublic actual fun Memory.storeFloatArray(\n offset: Long,\n source: FloatArray,\n sourceOffset: Int,\n count: Int\n) {\n storeFloatArray(offset.toIntOrFail(\"offset\"), source, sourceOffset, count)\n}\n\n/**\n * Copies floating point numbers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\npublic actual fun Memory.storeDoubleArray(\n offset: Int,\n source: DoubleArray,\n sourceOffset: Int,\n count: Int\n) {\n val typed = Float64Array(view.buffer, view.byteOffset + offset, count)\n\n if (isLittleEndianPlatform) {\n repeat(count) { index ->\n typed[index] = source[index + sourceOffset].reverseByteOrder()\n }\n } else {\n repeat(count) { index ->\n typed[index] = source[index + sourceOffset]\n }\n }\n}\n\n/**\n * Copies floating point numbers from the [source] array at [sourceOffset] to this memory at the specified [offset]\n * interpreting numbers in the network order (Big Endian).\n * @param sourceOffset items\n */\npublic actual fun Memory.storeDoubleArray(\n offset: Long,\n source: DoubleArray,\n sourceOffset: Int,\n count: Int\n) {\n storeDoubleArray(offset.toIntOrFail(\"offset\"), source, sourceOffset, count)\n}\n","package io.ktor.utils.io.core\n\nimport io.ktor.utils.io.core.internal.*\n\npublic actual val PACKET_MAX_COPY_SIZE: Int = 200\n\npublic actual typealias EOFException = io.ktor.utils.io.errors.EOFException\n","/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.utils.io.js\n\n/**\n * Mapping for non-ascii characters for Windows-1252 encoding.\n *\n * https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT\n */\ninternal val WIN1252_TABLE = intArrayOf(\n 0x20AC,\n -1,\n 0x201A,\n 0x0192,\n 0x201E,\n 0x2026,\n 0x2020,\n 0x2021,\n 0x02C6,\n 0x2030,\n 0x0160,\n 0x2039,\n 0x0152,\n -1,\n 0x017D,\n -1,\n -1,\n 0x2018,\n 0x2019,\n 0x201C,\n 0x201D,\n 0x2022,\n 0x2013,\n 0x2014,\n 0x02DC,\n 0x2122,\n 0x0161,\n 0x203A,\n 0x0153,\n -1,\n 0x017E,\n 0x0178,\n 0x00A0,\n 0x00A1,\n 0x00A2,\n 0x00A3,\n 0x00A4,\n 0x00A5,\n 0x00A6,\n 0x00A7,\n 0x00A8,\n 0x00A9,\n 0x00AA,\n 0x00AB,\n 0x00AC,\n 0x00AD,\n 0x00AE,\n 0x00AF,\n 0x00B0,\n 0x00B1,\n 0x00B2,\n 0x00B3,\n 0x00B4,\n 0x00B5,\n 0x00B6,\n 0x00B7,\n 0x00B8,\n 0x00B9,\n 0x00BA,\n 0x00BB,\n 0x00BC,\n 0x00BD,\n 0x00BE,\n 0x00BF,\n 0x00C0,\n 0x00C1,\n 0x00C2,\n 0x00C3,\n 0x00C4,\n 0x00C5,\n 0x00C6,\n 0x00C7,\n 0x00C8,\n 0x00C9,\n 0x00CA,\n 0x00CB,\n 0x00CC,\n 0x00CD,\n 0x00CE,\n 0x00CF,\n 0x00D0,\n 0x00D1,\n 0x00D2,\n 0x00D3,\n 0x00D4,\n 0x00D5,\n 0x00D6,\n 0x00D7,\n 0x00D8,\n 0x00D9,\n 0x00DA,\n 0x00DB,\n 0x00DC,\n 0x00DD,\n 0x00DE,\n 0x00DF,\n 0x00E0,\n 0x00E1,\n 0x00E2,\n 0x00E3,\n 0x00E4,\n 0x00E5,\n 0x00E6,\n 0x00E7,\n 0x00E8,\n 0x00E9,\n 0x00EA,\n 0x00EB,\n 0x00EC,\n 0x00ED,\n 0x00EE,\n 0x00EF,\n 0x00F0,\n 0x00F1,\n 0x00F2,\n 0x00F3,\n 0x00F4,\n 0x00F5,\n 0x00F6,\n 0x00F7,\n 0x00F8,\n 0x00F9,\n 0x00FA,\n 0x00FB,\n 0x00FC,\n 0x00FD,\n 0x00FE,\n 0x00FF\n)\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.util\n\nimport io.ktor.utils.io.*\nimport io.ktor.utils.io.core.*\nimport kotlinx.coroutines.*\n\nprivate const val CHUNK_BUFFER_SIZE = 4096L\n\n/**\n * Split source [ByteReadChannel] into 2 new one.\n * Cancel of one channel in split(input or both outputs) cancels other channels.\n */\npublic fun ByteReadChannel.split(coroutineScope: CoroutineScope): Pair {\n val first = ByteChannel(autoFlush = true)\n val second = ByteChannel(autoFlush = true)\n\n coroutineScope.launch {\n try {\n while (!isClosedForRead) {\n this@split.readRemaining(CHUNK_BUFFER_SIZE).use { chunk ->\n listOf(\n async { first.writePacket(chunk.copy()) },\n async { second.writePacket(chunk.copy()) }\n ).awaitAll()\n }\n }\n\n closedCause?.let { throw it }\n } catch (cause: Throwable) {\n this@split.cancel(cause)\n first.cancel(cause)\n second.cancel(cause)\n } finally {\n first.close()\n second.close()\n }\n }.invokeOnCompletion {\n it ?: return@invokeOnCompletion\n first.cancel(it)\n second.cancel(it)\n }\n\n return first to second\n}\n\n/**\n * Copy source channel to both output channels chunk by chunk.\n */\n@OptIn(DelicateCoroutinesApi::class)\npublic fun ByteReadChannel.copyToBoth(first: ByteWriteChannel, second: ByteWriteChannel) {\n GlobalScope.launch(Dispatchers.Unconfined) {\n try {\n while (!isClosedForRead && (!first.isClosedForWrite || !second.isClosedForWrite)) {\n readRemaining(CHUNK_BUFFER_SIZE).use {\n try {\n first.writePacket(it.copy())\n second.writePacket(it.copy())\n } catch (cause: Throwable) {\n this@copyToBoth.cancel(cause)\n first.close(cause)\n second.close(cause)\n }\n }\n }\n\n if (this is ByteChannel) {\n closedCause?.let { throw it }\n }\n } catch (cause: Throwable) {\n first.close(cause)\n second.close(cause)\n } finally {\n first.close()\n second.close()\n }\n }.invokeOnCompletion {\n it ?: return@invokeOnCompletion\n first.close(it)\n second.close(it)\n }\n}\n\n/**\n * Read channel to byte array.\n */\npublic suspend fun ByteReadChannel.toByteArray(): ByteArray = readRemaining().readBytes()\n","package io.ktor.utils.io.core\n\npublic expect interface Closeable {\n public fun close()\n}\n\npublic inline fun C.use(block: (C) -> R): R {\n var closed = false\n\n return try {\n block(this)\n } catch (first: Throwable) {\n try {\n closed = true\n close()\n } catch (second: Throwable) {\n first.addSuppressedInternal(second)\n }\n\n throw first\n } finally {\n if (!closed) {\n close()\n }\n }\n}\n\n@PublishedApi\ninternal expect fun Throwable.addSuppressedInternal(other: Throwable)\n","/*\n * Copyright 2014-2022 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.util\n\ninternal interface HashFunction {\n fun update(input: ByteArray, offset: Int = 0, length: Int = input.size)\n fun digest(): ByteArray\n}\n\ninternal fun HashFunction.digest(input: ByteArray, offset: Int = 0, length: Int = input.size): ByteArray {\n update(input, offset, length)\n return digest()\n}\n\nprivate infix fun Int.leftRotate(bitCount: Int): Int {\n return (this shl bitCount) or (this ushr (32 - bitCount))\n}\n\ninternal class Sha1 : HashFunction {\n private var messageLength = 0L\n private val unprocessed = ByteArray(64)\n private var unprocessedLimit = 0\n private val words = IntArray(80)\n\n private var h0 = 1732584193\n private var h1 = -271733879\n private var h2 = -1732584194\n private var h3 = 271733878\n private var h4 = -1009589776\n\n override fun update(input: ByteArray, offset: Int, length: Int) {\n messageLength += length\n var pos = offset\n val limit = pos + length\n val unprocessed = this.unprocessed\n val unprocessedLimit = this.unprocessedLimit\n\n if (unprocessedLimit > 0) {\n if (unprocessedLimit + length < 64) {\n // Not enough bytes for a chunk.\n input.copyInto(unprocessed, unprocessedLimit, pos, limit)\n this.unprocessedLimit = unprocessedLimit + length\n return\n }\n\n // Process a chunk combining leftover bytes and the input.\n val consumeByteCount = 64 - unprocessedLimit\n input.copyInto(unprocessed, unprocessedLimit, pos, pos + consumeByteCount)\n processChunk(unprocessed, 0)\n this.unprocessedLimit = 0\n pos += consumeByteCount\n }\n\n while (pos < limit) {\n val nextPos = pos + 64\n\n if (nextPos > limit) {\n // Not enough bytes for a chunk.\n input.copyInto(unprocessed, 0, pos, limit)\n this.unprocessedLimit = limit - pos\n return\n }\n\n // Process a chunk.\n processChunk(input, pos)\n pos = nextPos\n }\n }\n\n private fun processChunk(input: ByteArray, pos: Int) {\n val words = this.words\n\n var currentPosition = pos\n for (w in 0 until 16) {\n words[w] =\n ((input[currentPosition++].toInt() and 0xff) shl 24) or\n ((input[currentPosition++].toInt() and 0xff) shl 16) or\n ((input[currentPosition++].toInt() and 0xff) shl 8) or\n ((input[currentPosition++].toInt() and 0xff))\n }\n\n for (w in 16 until 80) {\n words[w] = (words[w - 3] xor words[w - 8] xor words[w - 14] xor words[w - 16]) leftRotate 1\n }\n\n var a = h0\n var b = h1\n var c = h2\n var d = h3\n var e = h4\n\n for (i in 0 until 80) {\n val a2 = when {\n i < 20 -> {\n val f = d xor (b and (c xor d))\n val k = 1518500249\n (a leftRotate 5) + f + e + k + words[i]\n }\n i < 40 -> {\n val f = b xor c xor d\n val k = 1859775393\n (a leftRotate 5) + f + e + k + words[i]\n }\n i < 60 -> {\n val f = (b and c) or (b and d) or (c and d)\n val k = -1894007588\n (a leftRotate 5) + f + e + k + words[i]\n }\n else -> {\n val f = b xor c xor d\n val k = -899497514\n (a leftRotate 5) + f + e + k + words[i]\n }\n }\n\n e = d\n d = c\n c = b leftRotate 30\n b = a\n a = a2\n }\n\n h0 += a\n h1 += b\n h2 += c\n h3 += d\n h4 += e\n }\n\n override fun digest(): ByteArray {\n val unprocessed = this.unprocessed\n var unprocessedLimit = this.unprocessedLimit\n val messageLengthBits = messageLength * 8\n\n unprocessed[unprocessedLimit++] = 0x80.toByte()\n if (unprocessedLimit > 56) {\n unprocessed.fill(0, unprocessedLimit, 64)\n processChunk(unprocessed, 0)\n unprocessed.fill(0, 0, unprocessedLimit)\n } else {\n unprocessed.fill(0, unprocessedLimit, 56)\n }\n unprocessed[56] = (messageLengthBits ushr 56).toByte()\n unprocessed[57] = (messageLengthBits ushr 48).toByte()\n unprocessed[58] = (messageLengthBits ushr 40).toByte()\n unprocessed[59] = (messageLengthBits ushr 32).toByte()\n unprocessed[60] = (messageLengthBits ushr 24).toByte()\n unprocessed[61] = (messageLengthBits ushr 16).toByte()\n unprocessed[62] = (messageLengthBits ushr 8).toByte()\n unprocessed[63] = (messageLengthBits).toByte()\n processChunk(unprocessed, 0)\n\n val a = h0\n val b = h1\n val c = h2\n val d = h3\n val e = h4\n\n reset()\n\n return byteArrayOf(\n (a shr 24).toByte(),\n (a shr 16).toByte(),\n (a shr 8).toByte(),\n (a).toByte(),\n (b shr 24).toByte(),\n (b shr 16).toByte(),\n (b shr 8).toByte(),\n (b).toByte(),\n (c shr 24).toByte(),\n (c shr 16).toByte(),\n (c shr 8).toByte(),\n (c).toByte(),\n (d shr 24).toByte(),\n (d shr 16).toByte(),\n (d shr 8).toByte(),\n (d).toByte(),\n (e shr 24).toByte(),\n (e shr 16).toByte(),\n (e shr 8).toByte(),\n (e).toByte()\n )\n }\n\n private fun reset() {\n messageLength = 0L\n unprocessed.fill(0)\n unprocessedLimit = 0\n words.fill(0)\n\n h0 = 1732584193\n h1 = -271733879\n h2 = -1732584194\n h3 = 271733878\n h4 = -1009589776\n }\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.util\n\n/**\n * Specifies a key for an attribute in [Attributes]\n * @param T is a type of the value stored in the attribute\n * @param name is a name of the attribute for diagnostic purposes. Can't be blank\n */\npublic class AttributeKey(public val name: String) {\n init {\n if (name.isEmpty()) {\n throw IllegalStateException(\"Name can't be blank\")\n }\n }\n\n override fun toString(): String = \"AttributeKey: $name\"\n\n override fun equals(other: Any?): Boolean {\n if (this === other) return true\n if (other == null || this::class != other::class) return false\n\n other as AttributeKey<*>\n\n if (name != other.name) return false\n\n return true\n }\n\n override fun hashCode(): Int {\n return name.hashCode()\n }\n}\n\n/**\n * A version of [AttributeKey] that overrides [equals] and [hashCode] using [name]\n * @param T is a type of the value stored in the attribute\n * @param name is a name of the attribute\n */\n@Suppress(\"DEPRECATION\")\n@Deprecated(\n \"Please use `AttributeKey` class instead\",\n replaceWith = ReplaceWith(\"AttributeKey\")\n)\npublic typealias EquatableAttributeKey = AttributeKey\n\n/**\n * Creates an attributes instance suitable for the particular platform\n */\npublic expect fun Attributes(concurrent: Boolean = false): Attributes\n\n/**\n * Map of attributes accessible by [AttributeKey] in a typed manner\n */\npublic interface Attributes {\n /**\n * Gets a value of the attribute for the specified [key], or throws an exception if an attribute doesn't exist\n */\n public operator fun get(key: AttributeKey): T =\n getOrNull(key) ?: throw IllegalStateException(\"No instance for key $key\")\n\n /**\n * Gets a value of the attribute for the specified [key], or return `null` if an attribute doesn't exist\n */\n public fun getOrNull(key: AttributeKey): T?\n\n /**\n * Checks if an attribute with the specified [key] exists\n */\n public operator fun contains(key: AttributeKey<*>): Boolean\n\n /**\n * Creates or changes an attribute with the specified [key] using [value]\n */\n public fun put(key: AttributeKey, value: T)\n\n /**\n * Removes an attribute with the specified [key]\n */\n public fun remove(key: AttributeKey)\n\n /**\n * Removes an attribute with the specified [key] and returns its current value, throws an exception if an attribute doesn't exist\n */\n public fun take(key: AttributeKey): T = get(key).also { remove(key) }\n\n /**\n * Removes an attribute with the specified [key] and returns its current value, returns `null` if an attribute doesn't exist\n */\n public fun takeOrNull(key: AttributeKey): T? = getOrNull(key).also { remove(key) }\n\n /**\n * Gets a value of the attribute for the specified [key], or calls supplied [block] to compute its value\n */\n public fun computeIfAbsent(key: AttributeKey, block: () -> T): T\n\n /**\n * Returns [List] of all [AttributeKey] instances in this map\n */\n public val allKeys: List>\n}\n\n/**\n * Adds all attributes from another collection, replacing original values if any.\n */\npublic fun Attributes.putAll(other: Attributes) {\n other.allKeys.forEach {\n @Suppress(\"UNCHECKED_CAST\")\n put(it as AttributeKey, other[it])\n }\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.util\n\nimport io.ktor.utils.io.charsets.*\nimport io.ktor.utils.io.core.*\nimport kotlin.experimental.*\n\nprivate const val BASE64_ALPHABET = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\"\nprivate const val BASE64_MASK: Byte = 0x3f\nprivate const val BASE64_MASK_INT: Int = 0x3f\nprivate const val BASE64_PAD = '='\n\nprivate val BASE64_INVERSE_ALPHABET = IntArray(256) {\n BASE64_ALPHABET.indexOf(it.toChar())\n}\n\n/**\n * Encode [String] in base64 format and UTF-8 character encoding.\n */\npublic fun String.encodeBase64(): String = buildPacket {\n writeText(this@encodeBase64)\n}.encodeBase64()\n\n/**\n * Encode [ByteArray] in base64 format\n */\npublic fun ByteArray.encodeBase64(): String {\n val array = this@encodeBase64\n var position = 0\n var writeOffset = 0\n val charArray = CharArray(size * 8 / 6 + 3)\n\n while (position + 3 <= array.size) {\n val first = array[position].toInt()\n val second = array[position + 1].toInt()\n val third = array[position + 2].toInt()\n position += 3\n\n val chunk = ((first and 0xFF) shl 16) or ((second and 0xFF) shl 8) or (third and 0xFF)\n for (index in 3 downTo 0) {\n val char = (chunk shr (6 * index)) and BASE64_MASK_INT\n charArray[writeOffset++] = (char.toBase64())\n }\n }\n\n val remaining = array.size - position\n if (remaining == 0) return charArray.concatToString(0, writeOffset)\n\n val chunk = if (remaining == 1) {\n ((array[position].toInt() and 0xFF) shl 16) or ((0 and 0xFF) shl 8) or (0 and 0xFF)\n } else {\n ((array[position].toInt() and 0xFF) shl 16) or ((array[position + 1].toInt() and 0xFF) shl 8) or (0 and 0xFF)\n }\n\n val padSize = (3 - remaining) * 8 / 6\n for (index in 3 downTo padSize) {\n val char = (chunk shr (6 * index)) and BASE64_MASK_INT\n charArray[writeOffset++] = char.toBase64()\n }\n\n repeat(padSize) { charArray[writeOffset++] = BASE64_PAD }\n\n return charArray.concatToString(0, writeOffset)\n}\n\n/**\n * Encode [ByteReadPacket] in base64 format\n */\npublic fun ByteReadPacket.encodeBase64(): String = readBytes().encodeBase64()\n\n/**\n * Decode [String] from base64 format encoded in UTF-8.\n */\npublic fun String.decodeBase64String(): String = String(decodeBase64Bytes(), charset = Charsets.UTF_8)\n\n/**\n * Decode [String] from base64 format\n */\npublic fun String.decodeBase64Bytes(): ByteArray = buildPacket {\n writeText(dropLastWhile { it == BASE64_PAD })\n}.decodeBase64Bytes().readBytes()\n\n/**\n * Decode [ByteReadPacket] from base64 format\n */\npublic fun ByteReadPacket.decodeBase64Bytes(): Input = buildPacket {\n val data = ByteArray(4)\n\n while (remaining > 0) {\n val read = readAvailable(data)\n\n val chunk = data.foldIndexed(0) { index, result, current ->\n result or (current.fromBase64().toInt() shl ((3 - index) * 6))\n }\n\n for (index in data.size - 2 downTo (data.size - read)) {\n val origin = (chunk shr (8 * index)) and 0xff\n writeByte(origin.toByte())\n }\n }\n}\n\n@Suppress(\"NOTHING_TO_INLINE\")\ninternal inline fun Int.toBase64(): Char = BASE64_ALPHABET[this]\n\n@Suppress(\"NOTHING_TO_INLINE\")\ninternal inline fun Byte.fromBase64(): Byte = BASE64_INVERSE_ALPHABET[toInt() and 0xff].toByte() and BASE64_MASK\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.util\n\n/**\n * A map with case-insensitive [String] keys\n */\npublic class CaseInsensitiveMap : MutableMap {\n private val delegate = mutableMapOf()\n\n override val size: Int get() = delegate.size\n\n override fun containsKey(key: String): Boolean = delegate.containsKey(CaseInsensitiveString(key))\n\n override fun containsValue(value: Value): Boolean = delegate.containsValue(value)\n\n override fun get(key: String): Value? = delegate[key.caseInsensitive()]\n\n override fun isEmpty(): Boolean = delegate.isEmpty()\n\n override fun clear() {\n delegate.clear()\n }\n\n override fun put(key: String, value: Value): Value? = delegate.put(key.caseInsensitive(), value)\n\n override fun putAll(from: Map) {\n from.forEach { (key, value) -> put(key, value) }\n }\n\n override fun remove(key: String): Value? = delegate.remove(key.caseInsensitive())\n\n override val keys: MutableSet\n get() = DelegatingMutableSet(\n delegate.keys,\n { content },\n { caseInsensitive() }\n )\n\n override val entries: MutableSet>\n get() = DelegatingMutableSet(\n delegate.entries,\n { Entry(key.content, value) },\n { Entry(key.caseInsensitive(), value) }\n )\n\n override val values: MutableCollection get() = delegate.values\n\n override fun equals(other: Any?): Boolean {\n if (other == null || other !is CaseInsensitiveMap<*>) return false\n return other.delegate == delegate\n }\n\n override fun hashCode(): Int = delegate.hashCode()\n}\n\nprivate class Entry(\n override val key: Key,\n override var value: Value\n) : MutableMap.MutableEntry {\n\n override fun setValue(newValue: Value): Value {\n value = newValue\n return value\n }\n\n override fun hashCode(): Int = 17 * 31 + key!!.hashCode() + value!!.hashCode()\n\n override fun equals(other: Any?): Boolean {\n if (other == null || other !is Map.Entry<*, *>) return false\n return other.key == key && other.value == value\n }\n\n override fun toString(): String = \"$key=$value\"\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.util\n\n/**\n * Check if [Char] is in lower case\n */\npublic fun Char.isLowerCase(): Boolean = lowercaseChar() == this\n\n/**\n * Convert [String] to [CharArray]\n */\npublic fun String.toCharArray(): CharArray = CharArray(length) { get(it) }\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.util\n\n/**\n * Create an instance of case-insensitive mutable map. For internal use only.\n */\npublic fun caseInsensitiveMap(): MutableMap = CaseInsensitiveMap()\n\n/**\n * Freeze selected set. May do nothing on some platforms.\n */\npublic expect fun Set.unmodifiable(): Set\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"CryptoKt\")\n\npackage io.ktor.util\n\nimport io.ktor.utils.io.charsets.*\nimport io.ktor.utils.io.core.*\nimport kotlin.native.concurrent.*\n\nprivate val digits = \"0123456789abcdef\".toCharArray()\n\ninternal const val NONCE_SIZE_IN_BYTES = 16\n\n/**\n * Encode [bytes] as a HEX string with no spaces, newlines and `0x` prefixes.\n */\npublic fun hex(bytes: ByteArray): String {\n val result = CharArray(bytes.size * 2)\n var resultIndex = 0\n val digits = digits\n\n for (index in 0 until bytes.size) {\n val b = bytes[index].toInt() and 0xff\n result[resultIndex++] = digits[b shr 4]\n result[resultIndex++] = digits[b and 0x0f]\n }\n\n return result.concatToString()\n}\n\n/**\n * Decode bytes from HEX string. It should be no spaces and `0x` prefixes.\n */\npublic fun hex(s: String): ByteArray {\n val result = ByteArray(s.length / 2)\n for (idx in 0 until result.size) {\n val srcIdx = idx * 2\n val high = s[srcIdx].toString().toInt(16) shl 4\n val low = s[srcIdx + 1].toString().toInt(16)\n result[idx] = (high or low).toByte()\n }\n\n return result\n}\n\n/**\n * Generates a nonce string. Could block if the system's entropy source is empty\n */\npublic expect fun generateNonce(): String\n\n/**\n * Generates a nonce bytes of [size]. Could block if the system's entropy source is empty\n */\npublic fun generateNonce(size: Int): ByteArray = buildPacket {\n while (this.size < size) {\n writeText(generateNonce())\n }\n}.readBytes(size)\n\n/**\n * Compute SHA-1 hash for the specified [bytes]\n */\npublic expect fun sha1(bytes: ByteArray): ByteArray\n\n/**\n * Create [Digest] from specified hash [name].\n */\n@Suppress(\"FunctionName\")\npublic expect fun Digest(name: String): Digest\n\n/**\n * Stateful digest class specified to calculate digest.\n */\npublic interface Digest {\n /**\n * Add [bytes] to digest value.\n */\n public operator fun plusAssign(bytes: ByteArray)\n\n /**\n * Reset [Digest] state.\n */\n public fun reset()\n\n /**\n * Calculate digest bytes.\n */\n public suspend fun build(): ByteArray\n}\n\n/**\n * Calculate digest from current state and specified [bytes].\n */\n@InternalAPI\npublic suspend fun Digest.build(bytes: ByteArray): ByteArray {\n this += bytes\n return build()\n}\n\n/**\n * Calculate digest from current state and specified [string].\n */\n@InternalAPI\npublic suspend fun Digest.build(string: String, charset: Charset = Charsets.UTF_8): ByteArray {\n this += string.toByteArray(charset)\n return build()\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.util\n\ninternal open class DelegatingMutableSet(\n private val delegate: MutableSet,\n private val convertTo: From.() -> To,\n private val convert: To.() -> From\n) : MutableSet {\n\n public open fun Collection.convert(): Collection = map { it.convert() }\n public open fun Collection.convertTo(): Collection = map { it.convertTo() }\n\n override val size: Int = delegate.size\n\n override fun add(element: To): Boolean = delegate.add(element.convert())\n\n override fun addAll(elements: Collection): Boolean = delegate.addAll(elements.convert())\n\n override fun clear() {\n delegate.clear()\n }\n\n override fun remove(element: To): Boolean = delegate.remove(element.convert())\n\n override fun removeAll(elements: Collection): Boolean = delegate.removeAll(elements.convert())\n\n override fun retainAll(elements: Collection): Boolean = delegate.retainAll(elements.convert())\n\n override fun contains(element: To): Boolean = delegate.contains(element.convert())\n\n override fun containsAll(elements: Collection): Boolean = delegate.containsAll(elements.convert())\n\n override fun isEmpty(): Boolean = delegate.isEmpty()\n\n override fun iterator(): MutableIterator = object : MutableIterator {\n val delegateIterator = delegate.iterator()\n\n override fun hasNext(): Boolean = delegateIterator.hasNext()\n\n override fun next(): To = delegateIterator.next().convertTo()\n\n override fun remove() = delegateIterator.remove()\n }\n\n override fun hashCode(): Int = delegate.hashCode()\n\n override fun equals(other: Any?): Boolean {\n if (other == null || other !is Set<*>) return false\n\n val elements = delegate.convertTo()\n return other.containsAll(elements) && elements.containsAll(other)\n }\n\n override fun toString(): String = delegate.convertTo().toString()\n}\n","/*\n * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"MapsKt\")\n\npackage kotlin.collections\n\n//\n// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt\n// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib\n//\n\nimport kotlin.random.*\nimport kotlin.ranges.contains\nimport kotlin.ranges.reversed\n\n/**\n * Returns the first non-null value produced by [transform] function being applied to entries of this map in iteration order,\n * or throws [NoSuchElementException] if no non-null value was produced.\n * \n * @sample samples.collections.Collections.Transformations.firstNotNullOf\n */\n@SinceKotlin(\"1.5\")\n@kotlin.internal.InlineOnly\npublic inline fun Map.firstNotNullOf(transform: (Map.Entry) -> R?): R {\n return firstNotNullOfOrNull(transform) ?: throw NoSuchElementException(\"No element of the map was transformed to a non-null value.\")\n}\n\n/**\n * Returns the first non-null value produced by [transform] function being applied to entries of this map in iteration order,\n * or `null` if no non-null value was produced.\n * \n * @sample samples.collections.Collections.Transformations.firstNotNullOf\n */\n@SinceKotlin(\"1.5\")\n@kotlin.internal.InlineOnly\npublic inline fun Map.firstNotNullOfOrNull(transform: (Map.Entry) -> R?): R? {\n for (element in this) {\n val result = transform(element)\n if (result != null) {\n return result\n }\n }\n return null\n}\n\n/**\n * Returns a [List] containing all key-value pairs.\n */\npublic fun Map.toList(): List> {\n if (size == 0)\n return emptyList()\n val iterator = entries.iterator()\n if (!iterator.hasNext())\n return emptyList()\n val first = iterator.next()\n if (!iterator.hasNext())\n return listOf(first.toPair())\n val result = ArrayList>(size)\n result.add(first.toPair())\n do {\n result.add(iterator.next().toPair())\n } while (iterator.hasNext())\n return result\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each entry of original map.\n * \n * @sample samples.collections.Maps.Transformations.flatMap\n */\npublic inline fun Map.flatMap(transform: (Map.Entry) -> Iterable): List {\n return flatMapTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each entry of original map.\n * \n * @sample samples.collections.Collections.Transformations.flatMap\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapSequence\")\npublic inline fun Map.flatMap(transform: (Map.Entry) -> Sequence): List {\n return flatMapTo(ArrayList(), transform)\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each entry of original map, to the given [destination].\n */\npublic inline fun > Map.flatMapTo(destination: C, transform: (Map.Entry) -> Iterable): C {\n for (element in this) {\n val list = transform(element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each entry of original map, to the given [destination].\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapSequenceTo\")\npublic inline fun > Map.flatMapTo(destination: C, transform: (Map.Entry) -> Sequence): C {\n for (element in this) {\n val list = transform(element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each entry in the original map.\n * \n * @sample samples.collections.Maps.Transformations.mapToList\n */\npublic inline fun Map.map(transform: (Map.Entry) -> R): List {\n return mapTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing only the non-null results of applying the given [transform] function\n * to each entry in the original map.\n * \n * @sample samples.collections.Maps.Transformations.mapNotNull\n */\npublic inline fun Map.mapNotNull(transform: (Map.Entry) -> R?): List {\n return mapNotNullTo(ArrayList(), transform)\n}\n\n/**\n * Applies the given [transform] function to each entry in the original map\n * and appends only the non-null results to the given [destination].\n */\npublic inline fun > Map.mapNotNullTo(destination: C, transform: (Map.Entry) -> R?): C {\n forEach { element -> transform(element)?.let { destination.add(it) } }\n return destination\n}\n\n/**\n * Applies the given [transform] function to each entry of the original map\n * and appends the results to the given [destination].\n */\npublic inline fun > Map.mapTo(destination: C, transform: (Map.Entry) -> R): C {\n for (item in this)\n destination.add(transform(item))\n return destination\n}\n\n/**\n * Returns `true` if all entries match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.all\n */\npublic inline fun Map.all(predicate: (Map.Entry) -> Boolean): Boolean {\n if (isEmpty()) return true\n for (element in this) if (!predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if map has at least one entry.\n * \n * @sample samples.collections.Collections.Aggregates.any\n */\npublic fun Map.any(): Boolean {\n return !isEmpty()\n}\n\n/**\n * Returns `true` if at least one entry matches the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.anyWithPredicate\n */\npublic inline fun Map.any(predicate: (Map.Entry) -> Boolean): Boolean {\n if (isEmpty()) return false\n for (element in this) if (predicate(element)) return true\n return false\n}\n\n/**\n * Returns the number of entries in this map.\n */\n@kotlin.internal.InlineOnly\npublic inline fun Map.count(): Int {\n return size\n}\n\n/**\n * Returns the number of entries matching the given [predicate].\n */\npublic inline fun Map.count(predicate: (Map.Entry) -> Boolean): Int {\n if (isEmpty()) return 0\n var count = 0\n for (element in this) if (predicate(element)) ++count\n return count\n}\n\n/**\n * Performs the given [action] on each entry.\n */\n@kotlin.internal.HidesMembers\npublic inline fun Map.forEach(action: (Map.Entry) -> Unit): Unit {\n for (element in this) action(element)\n}\n\n/**\n * Returns the first entry yielding the largest value of the given function.\n * \n * @throws NoSuchElementException if the map is empty.\n * \n * @sample samples.collections.Collections.Aggregates.maxBy\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"maxByOrThrow\")\n@kotlin.internal.InlineOnly\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic inline fun > Map.maxBy(selector: (Map.Entry) -> R): Map.Entry {\n return entries.maxBy(selector)\n}\n\n/**\n * Returns the first entry yielding the largest value of the given function or `null` if there are no entries.\n * \n * @sample samples.collections.Collections.Aggregates.maxByOrNull\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun > Map.maxByOrNull(selector: (Map.Entry) -> R): Map.Entry? {\n return entries.maxByOrNull(selector)\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each entry in the map.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the map is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Map.maxOf(selector: (Map.Entry) -> Double): Double {\n return entries.maxOf(selector)\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each entry in the map.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the map is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Map.maxOf(selector: (Map.Entry) -> Float): Float {\n return entries.maxOf(selector)\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each entry in the map.\n * \n * @throws NoSuchElementException if the map is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > Map.maxOf(selector: (Map.Entry) -> R): R {\n return entries.maxOf(selector)\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each entry in the map or `null` if there are no entries.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Map.maxOfOrNull(selector: (Map.Entry) -> Double): Double? {\n return entries.maxOfOrNull(selector)\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each entry in the map or `null` if there are no entries.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Map.maxOfOrNull(selector: (Map.Entry) -> Float): Float? {\n return entries.maxOfOrNull(selector)\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each entry in the map or `null` if there are no entries.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > Map.maxOfOrNull(selector: (Map.Entry) -> R): R? {\n return entries.maxOfOrNull(selector)\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each entry in the map.\n * \n * @throws NoSuchElementException if the map is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Map.maxOfWith(comparator: Comparator, selector: (Map.Entry) -> R): R {\n return entries.maxOfWith(comparator, selector)\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each entry in the map or `null` if there are no entries.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Map.maxOfWithOrNull(comparator: Comparator, selector: (Map.Entry) -> R): R? {\n return entries.maxOfWithOrNull(comparator, selector)\n}\n\n/**\n * Returns the first entry having the largest value according to the provided [comparator].\n * \n * @throws NoSuchElementException if the map is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"maxWithOrThrow\")\n@kotlin.internal.InlineOnly\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic inline fun Map.maxWith(comparator: Comparator>): Map.Entry {\n return entries.maxWith(comparator)\n}\n\n/**\n * Returns the first entry having the largest value according to the provided [comparator] or `null` if there are no entries.\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun Map.maxWithOrNull(comparator: Comparator>): Map.Entry? {\n return entries.maxWithOrNull(comparator)\n}\n\n/**\n * Returns the first entry yielding the smallest value of the given function.\n * \n * @throws NoSuchElementException if the map is empty.\n * \n * @sample samples.collections.Collections.Aggregates.minBy\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"minByOrThrow\")\n@kotlin.internal.InlineOnly\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic inline fun > Map.minBy(selector: (Map.Entry) -> R): Map.Entry {\n return entries.minBy(selector)\n}\n\n/**\n * Returns the first entry yielding the smallest value of the given function or `null` if there are no entries.\n * \n * @sample samples.collections.Collections.Aggregates.minByOrNull\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun > Map.minByOrNull(selector: (Map.Entry) -> R): Map.Entry? {\n return entries.minByOrNull(selector)\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each entry in the map.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the map is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Map.minOf(selector: (Map.Entry) -> Double): Double {\n return entries.minOf(selector)\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each entry in the map.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the map is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Map.minOf(selector: (Map.Entry) -> Float): Float {\n return entries.minOf(selector)\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each entry in the map.\n * \n * @throws NoSuchElementException if the map is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > Map.minOf(selector: (Map.Entry) -> R): R {\n return entries.minOf(selector)\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each entry in the map or `null` if there are no entries.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Map.minOfOrNull(selector: (Map.Entry) -> Double): Double? {\n return entries.minOfOrNull(selector)\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each entry in the map or `null` if there are no entries.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Map.minOfOrNull(selector: (Map.Entry) -> Float): Float? {\n return entries.minOfOrNull(selector)\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each entry in the map or `null` if there are no entries.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > Map.minOfOrNull(selector: (Map.Entry) -> R): R? {\n return entries.minOfOrNull(selector)\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each entry in the map.\n * \n * @throws NoSuchElementException if the map is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Map.minOfWith(comparator: Comparator, selector: (Map.Entry) -> R): R {\n return entries.minOfWith(comparator, selector)\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each entry in the map or `null` if there are no entries.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Map.minOfWithOrNull(comparator: Comparator, selector: (Map.Entry) -> R): R? {\n return entries.minOfWithOrNull(comparator, selector)\n}\n\n/**\n * Returns the first entry having the smallest value according to the provided [comparator].\n * \n * @throws NoSuchElementException if the map is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"minWithOrThrow\")\n@kotlin.internal.InlineOnly\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic inline fun Map.minWith(comparator: Comparator>): Map.Entry {\n return entries.minWith(comparator)\n}\n\n/**\n * Returns the first entry having the smallest value according to the provided [comparator] or `null` if there are no entries.\n */\n@SinceKotlin(\"1.4\")\n@kotlin.internal.InlineOnly\npublic inline fun Map.minWithOrNull(comparator: Comparator>): Map.Entry? {\n return entries.minWithOrNull(comparator)\n}\n\n/**\n * Returns `true` if the map has no entries.\n * \n * @sample samples.collections.Collections.Aggregates.none\n */\npublic fun Map.none(): Boolean {\n return isEmpty()\n}\n\n/**\n * Returns `true` if no entries match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.noneWithPredicate\n */\npublic inline fun Map.none(predicate: (Map.Entry) -> Boolean): Boolean {\n if (isEmpty()) return true\n for (element in this) if (predicate(element)) return false\n return true\n}\n\n/**\n * Performs the given [action] on each entry and returns the map itself afterwards.\n */\n@SinceKotlin(\"1.1\")\npublic inline fun > M.onEach(action: (Map.Entry) -> Unit): M {\n return apply { for (element in this) action(element) }\n}\n\n/**\n * Performs the given [action] on each entry, providing sequential index with the entry,\n * and returns the map itself afterwards.\n * @param [action] function that takes the index of an entry and the entry itself\n * and performs the action on the entry.\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > M.onEachIndexed(action: (index: Int, Map.Entry) -> Unit): M {\n return apply { entries.forEachIndexed(action) }\n}\n\n/**\n * Creates an [Iterable] instance that wraps the original map returning its entries when being iterated.\n */\n@kotlin.internal.InlineOnly\npublic inline fun Map.asIterable(): Iterable> {\n return entries\n}\n\n/**\n * Creates a [Sequence] instance that wraps the original map returning its entries when being iterated.\n */\npublic fun Map.asSequence(): Sequence> {\n return entries.asSequence()\n}\n\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.util\n\n/**\n * Provides data structure for associating a [String] with a [List] of Strings\n */\npublic interface StringValues {\n public companion object {\n /**\n * Empty [StringValues] instance\n */\n public val Empty: StringValues = StringValuesImpl()\n\n /**\n * Builds a [StringValues] instance with the given [builder] function\n * @param caseInsensitiveName specifies if map should have case-sensitive or case-insensitive names\n * @param builder specifies a function to build a map\n */\n public inline fun build(\n caseInsensitiveName: Boolean = false,\n builder: StringValuesBuilder.() -> Unit\n ): StringValues = StringValuesBuilderImpl(caseInsensitiveName).apply(builder).build()\n }\n\n /**\n * Specifies if map has case-sensitive or case-insensitive names\n */\n public val caseInsensitiveName: Boolean\n\n /**\n * Gets first value from the list of values associated with a [name], or null if the name is not present\n */\n public operator fun get(name: String): String? = getAll(name)?.firstOrNull()\n\n /**\n * Gets all values associated with the [name], or null if the name is not present\n */\n public fun getAll(name: String): List?\n\n /**\n * Gets all names from the map\n */\n public fun names(): Set\n\n /**\n * Gets all entries from the map\n */\n public fun entries(): Set>>\n\n /**\n * Checks if the given [name] exists in the map\n */\n public operator fun contains(name: String): Boolean = getAll(name) != null\n\n /**\n * Checks if the given [name] and [value] pair exists in the map\n */\n public fun contains(name: String, value: String): Boolean = getAll(name)?.contains(value) ?: false\n\n /**\n * Iterates over all entries in this map and calls [body] for each pair\n *\n * Can be optimized in implementations\n */\n public fun forEach(body: (String, List) -> Unit): Unit = entries().forEach { (k, v) -> body(k, v) }\n\n /**\n * Checks if this map is empty\n */\n public fun isEmpty(): Boolean\n}\n\n@Suppress(\"KDocMissingDocumentation\")\npublic interface StringValuesBuilder {\n public val caseInsensitiveName: Boolean\n public fun getAll(name: String): List?\n\n public operator fun contains(name: String): Boolean\n public fun contains(name: String, value: String): Boolean\n public fun names(): Set\n public fun isEmpty(): Boolean\n public fun entries(): Set>>\n\n public operator fun set(name: String, value: String)\n\n public operator fun get(name: String): String?\n public fun append(name: String, value: String)\n public fun appendAll(stringValues: StringValues)\n public fun appendMissing(stringValues: StringValues)\n public fun appendAll(name: String, values: Iterable)\n public fun appendMissing(name: String, values: Iterable)\n public fun remove(name: String)\n public fun removeKeysWithNoEntries()\n public fun remove(name: String, value: String): Boolean\n public fun clear()\n\n public fun build(): StringValues\n}\n\n@Suppress(\"KDocMissingDocumentation\")\npublic open class StringValuesSingleImpl(\n override val caseInsensitiveName: Boolean,\n public val name: String,\n public val values: List\n) : StringValues {\n\n override fun getAll(name: String): List? = if (this.name.equals(name, caseInsensitiveName)) values else null\n\n override fun entries(): Set>> = setOf(\n object : Map.Entry> {\n override val key: String = name\n override val value: List = values\n override fun toString() = \"$key=$value\"\n\n override fun equals(other: Any?): Boolean =\n other is Map.Entry<*, *> &&\n other.key == key &&\n other.value == value\n\n override fun hashCode(): Int = key.hashCode() xor value.hashCode()\n }\n )\n\n override fun isEmpty(): Boolean = false\n\n override fun names(): Set = setOf(name)\n\n override fun toString(): String = \"StringValues(case=${!caseInsensitiveName}) ${entries()}\"\n\n override fun hashCode(): Int = entriesHashCode(entries(), 31 * caseInsensitiveName.hashCode())\n\n override fun equals(other: Any?): Boolean {\n if (this === other) return true\n if (other !is StringValues) return false\n if (caseInsensitiveName != other.caseInsensitiveName) return false\n return entriesEquals(entries(), other.entries())\n }\n\n override fun forEach(body: (String, List) -> Unit): Unit = body(name, values)\n\n override fun get(name: String): String? =\n if (name.equals(this.name, caseInsensitiveName)) values.firstOrNull() else null\n\n override fun contains(name: String): Boolean = name.equals(this.name, caseInsensitiveName)\n\n override fun contains(name: String, value: String): Boolean =\n name.equals(this.name, caseInsensitiveName) && values.contains(value)\n}\n\n@Suppress(\"KDocMissingDocumentation\")\npublic open class StringValuesImpl(\n final override val caseInsensitiveName: Boolean = false,\n values: Map> = emptyMap()\n) : StringValues {\n\n protected val values: Map>\n\n init {\n val newMap: MutableMap> = if (caseInsensitiveName) caseInsensitiveMap() else mutableMapOf()\n values.forEach { (key, value) -> newMap[key] = List(value.size) { value[it] } }\n this.values = newMap\n }\n\n override operator fun get(name: String): String? = listForKey(name)?.firstOrNull()\n\n override fun getAll(name: String): List? = listForKey(name)\n\n override operator fun contains(name: String): Boolean = listForKey(name) != null\n\n override fun contains(name: String, value: String): Boolean = listForKey(name)?.contains(value) ?: false\n\n override fun names(): Set = values.keys.unmodifiable()\n\n override fun isEmpty(): Boolean = values.isEmpty()\n\n override fun entries(): Set>> = values.entries.unmodifiable()\n\n override fun forEach(body: (String, List) -> Unit) {\n for ((key, value) in values) body(key, value)\n }\n\n private fun listForKey(name: String): List? = values[name]\n\n override fun toString(): String = \"StringValues(case=${!caseInsensitiveName}) ${entries()}\"\n\n override fun equals(other: Any?): Boolean {\n if (this === other) return true\n if (other !is StringValues) return false\n if (caseInsensitiveName != other.caseInsensitiveName) return false\n return entriesEquals(entries(), other.entries())\n }\n\n override fun hashCode(): Int = entriesHashCode(entries(), 31 * caseInsensitiveName.hashCode())\n}\n\n@Suppress(\"KDocMissingDocumentation\", \"DEPRECATION\")\npublic open class StringValuesBuilderImpl(\n final override val caseInsensitiveName: Boolean = false,\n size: Int = 8\n) : StringValuesBuilder {\n\n protected val values: MutableMap> =\n if (caseInsensitiveName) caseInsensitiveMap() else LinkedHashMap(size)\n\n override fun getAll(name: String): List? = values[name]\n\n override operator fun contains(name: String): Boolean = name in values\n\n override fun contains(name: String, value: String): Boolean = values[name]?.contains(value) ?: false\n\n override fun names(): Set = values.keys\n\n override fun isEmpty(): Boolean = values.isEmpty()\n\n override fun entries(): Set>> = values.entries.unmodifiable()\n\n override operator fun set(name: String, value: String) {\n validateValue(value)\n val list = ensureListForKey(name)\n list.clear()\n list.add(value)\n }\n\n override operator fun get(name: String): String? = getAll(name)?.firstOrNull()\n\n override fun append(name: String, value: String) {\n validateValue(value)\n ensureListForKey(name).add(value)\n }\n\n override fun appendAll(stringValues: StringValues) {\n stringValues.forEach { name, values ->\n appendAll(name, values)\n }\n }\n\n override fun appendMissing(stringValues: StringValues) {\n stringValues.forEach { name, values ->\n appendMissing(name, values)\n }\n }\n\n override fun appendAll(name: String, values: Iterable) {\n ensureListForKey(name).let { list ->\n values.forEach { value ->\n validateValue(value)\n list.add(value)\n }\n }\n }\n\n override fun appendMissing(name: String, values: Iterable) {\n val existing = this.values[name]?.toSet() ?: emptySet()\n\n appendAll(name, values.filter { it !in existing })\n }\n\n override fun remove(name: String) {\n values.remove(name)\n }\n\n override fun removeKeysWithNoEntries() {\n for ((k, _) in values.filter { it.value.isEmpty() }) {\n remove(k)\n }\n }\n\n override fun remove(name: String, value: String): Boolean = values[name]?.remove(value) ?: false\n\n override fun clear() {\n values.clear()\n }\n\n override fun build(): StringValues {\n return StringValuesImpl(caseInsensitiveName, values)\n }\n\n protected open fun validateName(name: String) {\n }\n\n protected open fun validateValue(value: String) {\n }\n\n @Suppress(\"DEPRECATION\")\n private fun ensureListForKey(name: String): MutableList {\n return values[name] ?: mutableListOf().also { validateName(name); values[name] = it }\n }\n}\n\n/**\n * Build an instance of [StringValues] from a vararg list of pairs\n */\npublic fun valuesOf(vararg pairs: Pair>, caseInsensitiveKey: Boolean = false): StringValues {\n return StringValuesImpl(caseInsensitiveKey, pairs.asList().toMap())\n}\n\n/**\n * Build an instance of [StringValues] from a single pair\n */\npublic fun valuesOf(name: String, value: String, caseInsensitiveKey: Boolean = false): StringValues {\n return StringValuesSingleImpl(caseInsensitiveKey, name, listOf(value))\n}\n\n/**\n * Build an instance of [StringValues] with a single [name] and multiple [values]\n */\npublic fun valuesOf(name: String, values: List, caseInsensitiveKey: Boolean = false): StringValues {\n return StringValuesSingleImpl(caseInsensitiveKey, name, values)\n}\n\n/**\n * Build an empty [StringValues] instance.\n */\npublic fun valuesOf(): StringValues = StringValues.Empty\n\n/**\n * Build an instance of [StringValues] from the specified [map]\n */\npublic fun valuesOf(map: Map>, caseInsensitiveKey: Boolean = false): StringValues {\n val size = map.size\n if (size == 1) {\n val entry = map.entries.single()\n return StringValuesSingleImpl(caseInsensitiveKey, entry.key, entry.value.toList())\n }\n val values: MutableMap> =\n if (caseInsensitiveKey) caseInsensitiveMap() else LinkedHashMap(size)\n map.entries.forEach { values.put(it.key, it.value.toList()) }\n return StringValuesImpl(caseInsensitiveKey, values)\n}\n\n/**\n * Copy values to a new independent map\n */\npublic fun StringValues.toMap(): Map> =\n entries().associateByTo(LinkedHashMap(), { it.key }, { it.value.toList() })\n\n/**\n * Copy values to a list of pairs\n */\npublic fun StringValues.flattenEntries(): List> = entries().flatMap { e ->\n e.value.map { e.key to it }\n}\n\n/**\n * Invoke [block] function for every value pair\n */\npublic fun StringValues.flattenForEach(block: (String, String) -> Unit): Unit = forEach { name, items ->\n items.forEach { block(name, it) }\n}\n\n/**\n * Create a new instance of [StringValues] filtered by the specified [predicate]\n * @param keepEmpty when `true` will keep empty lists otherwise keys with no values will be discarded\n */\npublic fun StringValues.filter(keepEmpty: Boolean = false, predicate: (String, String) -> Boolean): StringValues {\n val entries = entries()\n val values: MutableMap> =\n if (caseInsensitiveName) caseInsensitiveMap() else LinkedHashMap(entries.size)\n\n entries.forEach { entry ->\n val list = entry.value.filterTo(ArrayList(entry.value.size)) { predicate(entry.key, it) }\n if (keepEmpty || list.isNotEmpty()) {\n values.put(entry.key, list)\n }\n }\n\n return StringValuesImpl(caseInsensitiveName, values)\n}\n\n/**\n * Append values from [source] filtering values by the specified [predicate]\n * @param keepEmpty when `true` will keep empty lists otherwise keys with no values will be discarded\n */\npublic fun StringValuesBuilder.appendFiltered(\n source: StringValues,\n keepEmpty: Boolean = false,\n predicate: (String, String) -> Boolean\n) {\n source.forEach { name, value ->\n val list = value.filterTo(ArrayList(value.size)) { predicate(name, it) }\n if (keepEmpty || list.isNotEmpty()) {\n appendAll(name, list)\n }\n }\n}\n\n/**\n * Append all values from the specified [builder]\n */\npublic fun StringValuesBuilder.appendAll(builder: StringValuesBuilder): StringValuesBuilder = apply {\n builder.entries().forEach { (name, values) ->\n appendAll(name, values)\n }\n}\n\n/**\n * Appends [name] [value] pair if there are no values associated with [name]\n */\npublic fun StringValuesBuilder.appendIfNameAbsent(name: String, value: String): StringValuesBuilder = apply {\n if (contains(name)) return@apply\n append(name, value)\n}\n\n/**\n * Appends [name] [value] pair if there is no existing [name] [value] pair\n */\npublic fun StringValuesBuilder.appendIfNameAndValueAbsent(name: String, value: String): StringValuesBuilder = apply {\n if (contains(name, value)) return@apply\n append(name, value)\n}\n\nprivate fun entriesEquals(a: Set>>, b: Set>>): Boolean {\n return a == b\n}\n\nprivate fun entriesHashCode(entries: Set>>, seed: Int): Int {\n return seed * 31 + entries.hashCode()\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.util\n\n/**\n * Escapes the characters in a String using HTML entities\n */\npublic fun String.escapeHTML(): String {\n val text = this@escapeHTML\n if (text.isEmpty()) return text\n\n return buildString(length) {\n for (idx in 0 until text.length) {\n val ch = text[idx]\n when (ch) {\n '\\'' -> append(\"'\")\n '\\\"' -> append(\""\")\n '&' -> append(\"&\")\n '<' -> append(\"<\")\n '>' -> append(\">\")\n else -> append(ch)\n }\n }\n }\n}\n\n/**\n * Splits the given string into two parts before and after separator.\n *\n * Useful together with destructuring declarations\n */\npublic inline fun String.chomp(\n separator: String,\n onMissingDelimiter: () -> Pair\n): Pair {\n val idx = indexOf(separator)\n return when (idx) {\n -1 -> onMissingDelimiter()\n else -> substring(0, idx) to substring(idx + 1)\n }\n}\n\n/**\n * Does the same as the regular [toLowerCase] except that locale-specific rules are not applied to ASCII characters\n * so latin characters are converted by the original english rules.\n */\npublic fun String.toLowerCasePreservingASCIIRules(): String {\n val firstIndex = indexOfFirst {\n toLowerCasePreservingASCII(it) != it\n }\n\n if (firstIndex == -1) {\n return this\n }\n\n val original = this\n return buildString(length) {\n append(original, 0, firstIndex)\n\n for (index in firstIndex..original.lastIndex) {\n append(toLowerCasePreservingASCII(original[index]))\n }\n }\n}\n\n/**\n * Does the same as the regular [toUpperCase] except that locale-specific rules are not applied to ASCII characters\n * so latin characters are converted by the original english rules.\n */\npublic fun String.toUpperCasePreservingASCIIRules(): String {\n val firstIndex = indexOfFirst {\n toUpperCasePreservingASCII(it) != it\n }\n\n if (firstIndex == -1) {\n return this\n }\n\n val original = this\n return buildString(length) {\n append(original, 0, firstIndex)\n\n for (index in firstIndex..original.lastIndex) {\n append(toUpperCasePreservingASCII(original[index]))\n }\n }\n}\n\nprivate fun toLowerCasePreservingASCII(ch: Char): Char = when (ch) {\n in 'A'..'Z' -> ch + 32\n in '\\u0000'..'\\u007f' -> ch\n else -> ch.lowercaseChar()\n}\n\nprivate fun toUpperCasePreservingASCII(ch: Char): Char = when (ch) {\n in 'a'..'z' -> ch - 32\n in '\\u0000'..'\\u007f' -> ch\n else -> ch.lowercaseChar()\n}\n\ninternal fun String.caseInsensitive(): CaseInsensitiveString = CaseInsensitiveString(this)\n\ninternal class CaseInsensitiveString(val content: String) {\n private val hash = content.lowercase().hashCode()\n\n override fun equals(other: Any?): Boolean =\n (other as? CaseInsensitiveString)?.content?.equals(content, ignoreCase = true) == true\n\n override fun hashCode(): Int = hash\n\n override fun toString(): String = content\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.util.cio\n\nimport io.ktor.utils.io.errors.*\n\n/**\n * An exception thrown when an IO error occurred during reading or writing to/from the underlying channel.\n * The typical error is \"connection reset\" and so on.\n */\npublic open class ChannelIOException(message: String, exception: Throwable) : IOException(message, exception)\n\n/**\n * An exception that is thrown when an IO error occurred during writing to the destination channel.\n * Usually it happens when a remote client closed the connection.\n */\npublic class ChannelWriteException(message: String = \"Cannot write to a channel\", exception: Throwable) :\n ChannelIOException(message, exception)\n\n/**\n * An exception that is thrown when an IO error occurred during reading from the request channel.\n * Usually it happens when a remote client closed the connection.\n */\npublic class ChannelReadException(\n message: String = \"Cannot read from a channel\",\n exception: Throwable\n) : ChannelIOException(message, exception)\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.util.date\n\nimport kotlin.time.*\n\n/**\n * According to:\n * http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/time.h.html\n */\n\n/**\n * Day of week\n * [value] is 3 letter shortcut\n */\n@Suppress(\"KDocMissingDocumentation\")\npublic enum class WeekDay(public val value: String) {\n MONDAY(\"Mon\"),\n TUESDAY(\"Tue\"),\n WEDNESDAY(\"Wed\"),\n THURSDAY(\"Thu\"),\n FRIDAY(\"Fri\"),\n SATURDAY(\"Sat\"),\n SUNDAY(\"Sun\");\n\n public companion object {\n /**\n * Lookup an instance by [ordinal]\n */\n public fun from(ordinal: Int): WeekDay = values()[ordinal]\n\n /**\n * Lookup an instance by short week day name [WeekDay.value]\n */\n public fun from(value: String): WeekDay = values().find { it.value == value }\n ?: error(\"Invalid day of week: $value\")\n }\n}\n\n/**\n * Month\n * [value] is 3 letter shortcut\n */\n@Suppress(\"KDocMissingDocumentation\")\npublic enum class Month(public val value: String) {\n JANUARY(\"Jan\"),\n FEBRUARY(\"Feb\"),\n MARCH(\"Mar\"),\n APRIL(\"Apr\"),\n MAY(\"May\"),\n JUNE(\"Jun\"),\n JULY(\"Jul\"),\n AUGUST(\"Aug\"),\n SEPTEMBER(\"Sep\"),\n OCTOBER(\"Oct\"),\n NOVEMBER(\"Nov\"),\n DECEMBER(\"Dec\");\n\n public companion object {\n /**\n * Lookup an instance by [ordinal]\n */\n public fun from(ordinal: Int): Month = values()[ordinal]\n\n /**\n * Lookup an instance by short month name [Month.value]\n */\n public fun from(value: String): Month = values().find { it.value == value }\n ?: error(\"Invalid month: $value\")\n }\n}\n\n/**\n * Date in GMT timezone\n *\n * @property seconds: seconds from 0 to 60(last is for leap second)\n * @property minutes: minutes from 0 to 59\n * @property hours: hours from 0 to 23\n * @property dayOfWeek an instance of the corresponding day of week\n * @property dayOfMonth: day of month from 1 to 31\n * @property dayOfYear: day of year from 1 to 366\n * @property month an instance of the corresponding month\n * @property year: year in common era(CE: https://en.wikipedia.org/wiki/Common_Era)\n *\n * @property timestamp is a number of epoch milliseconds\n */\npublic data class GMTDate internal constructor(\n val seconds: Int,\n val minutes: Int,\n val hours: Int,\n\n val dayOfWeek: WeekDay,\n val dayOfMonth: Int,\n val dayOfYear: Int,\n\n val month: Month,\n val year: Int,\n\n val timestamp: Long\n) : Comparable {\n\n override fun compareTo(other: GMTDate): Int = timestamp.compareTo(other.timestamp)\n\n public companion object {\n /**\n * An instance of [GMTDate] corresponding to the epoch beginning\n */\n public val START: GMTDate = GMTDate(0)\n }\n}\n\n/**\n * Create new gmt date from the [timestamp].\n * @param timestamp is a number of epoch milliseconds (it is `now` by default).\n */\n@Suppress(\"FunctionName\")\npublic expect fun GMTDate(timestamp: Long? = null): GMTDate\n\n/**\n * Create an instance of [GMTDate] from the specified date/time components\n */\n@Suppress(\"FunctionName\")\npublic expect fun GMTDate(seconds: Int, minutes: Int, hours: Int, dayOfMonth: Int, month: Month, year: Int): GMTDate\n\n/**\n * Adds the specified number of [milliseconds]\n */\npublic operator fun GMTDate.plus(milliseconds: Long): GMTDate = GMTDate(timestamp + milliseconds)\n\n/**\n * Subtracts the specified number of [milliseconds]\n */\npublic operator fun GMTDate.minus(milliseconds: Long): GMTDate = GMTDate(timestamp - milliseconds)\n\n/**\n * Adds the specified [duration]\n */\npublic operator fun GMTDate.plus(duration: Duration): GMTDate = GMTDate(timestamp + duration.inWholeMilliseconds)\n\n/**\n * Subtracts the specified [duration]\n */\npublic operator fun GMTDate.minus(duration: Duration): GMTDate = GMTDate(timestamp - duration.inWholeMilliseconds)\n\n/**\n * Truncate to seconds by discarding sub-second part\n */\npublic fun GMTDate.truncateToSeconds(): GMTDate = GMTDate(seconds, minutes, hours, dayOfMonth, month, year)\n\n/**\n * Gets current system time in milliseconds since certain moment in the past, only delta between two subsequent calls makes sense.\n */\npublic expect fun getTimeMillis(): Long\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.util.date\n\n/**\n * Build [GMTDate] parser using [pattern] string.\n *\n * Pattern string format:\n * | Unit | pattern char | Description |\n * | -------- | ------------ | ---------------------------------------------------- |\n * | Seconds | s | parse seconds 0 to 60 |\n * | Minutes | m | parse minutes 0 to 60 |\n * | Hours | h | parse hours 0 to 23 |\n * | Month | M | parse month from Jan to Dec(see [Month] for details) |\n * | Year | Y | parse year |\n * | Any char | * | Match any character |\n */\npublic class GMTDateParser(private val pattern: String) {\n init {\n check(pattern.isNotEmpty()) { \"Date parser pattern shouldn't be empty.\" }\n }\n\n /**\n * Parse [GMTDate] from [dateString] using [pattern].\n */\n public fun parse(dateString: String): GMTDate {\n val builder = GMTDateBuilder()\n\n var start = 0\n var current = pattern[start]\n var chunkStart = 0\n var index = 1\n\n try {\n while (index < pattern.length) {\n if (pattern[index] == current) {\n index++\n continue\n }\n\n val chunkEnd = chunkStart + index - start\n builder.handleToken(current, dateString.substring(chunkStart, chunkEnd))\n\n chunkStart = chunkEnd\n start = index\n current = pattern[index]\n\n index++\n }\n\n if (chunkStart < dateString.length) {\n builder.handleToken(current, dateString.substring(chunkStart))\n }\n } catch (_: Throwable) {\n throw InvalidDateStringException(dateString, chunkStart, pattern)\n }\n\n return builder.build()\n }\n\n private fun GMTDateBuilder.handleToken(\n type: Char,\n chunk: String\n ): Unit = when (type) {\n SECONDS -> {\n seconds = chunk.toInt()\n }\n MINUTES -> {\n minutes = chunk.toInt()\n }\n HOURS -> {\n hours = chunk.toInt()\n }\n DAY_OF_MONTH -> {\n dayOfMonth = chunk.toInt()\n }\n MONTH -> {\n month = Month.from(chunk)\n }\n YEAR -> {\n year = chunk.toInt()\n }\n ZONE ->\n check(chunk == \"GMT\")\n ANY -> Unit\n else -> {\n check(chunk.all { it == type })\n }\n }\n\n public companion object {\n public const val SECONDS: Char = 's'\n public const val MINUTES: Char = 'm'\n public const val HOURS: Char = 'h'\n\n public const val DAY_OF_MONTH: Char = 'd'\n public const val MONTH: Char = 'M'\n public const val YEAR: Char = 'Y'\n\n public const val ZONE: Char = 'z'\n\n public const val ANY: Char = '*'\n }\n}\n\ninternal class GMTDateBuilder {\n var seconds: Int? = null\n var minutes: Int? = null\n var hours: Int? = null\n\n var dayOfMonth: Int? = null\n lateinit var month: Month\n var year: Int? = null\n\n fun build(): GMTDate = GMTDate(seconds!!, minutes!!, hours!!, dayOfMonth!!, month, year!!)\n}\n\n/**\n * Thrown when the date string doesn't the string pattern.\n */\npublic class InvalidDateStringException(\n data: String,\n at: Int,\n pattern: String\n) : IllegalStateException(\"Failed to parse date string: \\\"${data}\\\" at index $at. Pattern: \\\"$pattern\\\"\")\n","/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.util.debug\n\nimport io.ktor.util.debug.plugins.*\nimport kotlinx.coroutines.*\nimport kotlin.coroutines.*\n\n/**\n * Initialize plugins debug mode for [block]\n */\npublic suspend fun initContextInDebugMode(\n block: suspend () -> T\n): T {\n if (!IntellijIdeaDebugDetector.isDebuggerConnected) return block()\n\n val debugContext = currentCoroutineContext() + PluginsTrace()\n return withContext(debugContext) { block() }\n}\n\n/**\n * Adds [pluginName] to the current [CoroutineContext] if Intellij JVM debugger is attached.\n */\npublic suspend fun addToContextInDebugMode(\n pluginName: String,\n block: suspend () -> T\n): T {\n if (!IntellijIdeaDebugDetector.isDebuggerConnected) return block()\n\n val debugContext = currentCoroutineContext() + PluginName(pluginName)\n return withContext(debugContext) { block() }\n}\n\n/**\n * Performs [action] on the current element of the [CoroutineContext] with the given [key] if Intellij JVM debugger is\n * attached.\n * */\npublic suspend fun useContextElementInDebugMode(\n key: CoroutineContext.Key,\n action: (Element) -> Unit\n) {\n if (!IntellijIdeaDebugDetector.isDebuggerConnected) return\n\n currentCoroutineContext()[key]?.let(action)\n}\n","/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.util.debug.plugins\n\nimport kotlin.coroutines.*\n\n/**\n * Contains information of all the plugins that have been executed during the current call.\n * Is used in Intellij Idea debugger to show plugin execution order.\n */\npublic data class PluginsTrace(\n /**\n * Plugin name.\n */\n val eventOrder: MutableList = mutableListOf()\n) : AbstractCoroutineContextElement(PluginsTrace) {\n\n /**\n * Key for [PluginsTrace] instance in the coroutine context.\n */\n public companion object Key : CoroutineContext.Key\n\n /**\n * Returns a string representation of the object.\n */\n override fun toString(): String = \"PluginsTrace(${eventOrder.joinToString()})\"\n}\n\n/**\n * Contains information about the plugin and handler (onCall, onReceive, and so on) that is currently being executed.\n * Is used in Intellij Idea debugger to show plugin execution order.\n * */\npublic data class PluginTraceElement(val pluginName: String, val handler: String, val event: PluginEvent) {\n public enum class PluginEvent {\n STARTED,\n FINISHED\n }\n}\n","/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.util.internal\n\n/*\n * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.\n *\n * Copied from kotlinx.coroutines\n */\n\nimport kotlinx.atomicfu.*\nimport kotlin.jvm.*\nimport kotlin.native.concurrent.*\n\nprivate typealias Node = LockFreeLinkedListNode\n\n@PublishedApi\ninternal const val UNDECIDED: Int = 0\n\n@PublishedApi\ninternal const val SUCCESS: Int = 1\n\n@PublishedApi\ninternal const val FAILURE: Int = 2\n\n@PublishedApi\ninternal val CONDITION_FALSE: Any = Symbol(\"CONDITION_FALSE\")\n\n@PublishedApi\ninternal val ALREADY_REMOVED: Any = Symbol(\"ALREADY_REMOVED\")\n\n@PublishedApi\ninternal val LIST_EMPTY: Any = Symbol(\"LIST_EMPTY\")\n\nprivate val REMOVE_PREPARED: Any = Symbol(\"REMOVE_PREPARED\")\n\n/** @suppress **This is unstable API and it is subject to change.** */\npublic typealias RemoveFirstDesc = LockFreeLinkedListNode.RemoveFirstDesc\n\n/** @suppress **This is unstable API and it is subject to change.** */\npublic typealias AddLastDesc = LockFreeLinkedListNode.AddLastDesc\n\n/** @suppress **This is unstable API and it is subject to change.** */\npublic typealias AbstractAtomicDesc = LockFreeLinkedListNode.AbstractAtomicDesc\n\nprivate class Symbol(val symbol: String) {\n override fun toString(): String = symbol\n}\n\n/**\n * The most abstract operation that can be in process. Other threads observing an instance of this\n * class in the fields of their object shall invoke [perform] to help.\n *\n * @suppress **This is unstable API and it is subject to change.**\n */\npublic abstract class OpDescriptor {\n /**\n * Returns `null` is operation was performed successfully or some other\n * object that indicates the failure reason.\n */\n public abstract fun perform(affected: Any?): Any?\n}\n\nprivate val NO_DECISION: Any = Symbol(\"NO_DECISION\")\n\n/**\n * Descriptor for multi-word atomic operation.\n * Based on paper\n * [\"A Practical Multi-Word Compare-and-Swap Operation\"](http://www.cl.cam.ac.uk/research/srgnetos/papers/2002-casn.pdf)\n * by Timothy L. Harris, Keir Fraser and Ian A. Pratt.\n *\n * Note: parts of atomic operation must be globally ordered. Otherwise, this implementation will produce\n * `StackOverflowError`.\n *\n * @suppress **This is unstable API and it is subject to change.**\n */\npublic abstract class AtomicOp : OpDescriptor() {\n private val _consensus = atomic(NO_DECISION)\n\n public val isDecided: Boolean get() = _consensus.value !== NO_DECISION\n\n public fun tryDecide(decision: Any?): Boolean {\n check(decision !== NO_DECISION)\n return _consensus.compareAndSet(NO_DECISION, decision)\n }\n\n private fun decide(decision: Any?): Any? = if (tryDecide(decision)) decision else _consensus.value\n\n public abstract fun prepare(affected: T): Any? // `null` if Ok, or failure reason\n\n public abstract fun complete(affected: T, failure: Any?) // failure != null if failed to prepare op\n\n // returns `null` on success\n @Suppress(\"UNCHECKED_CAST\")\n public final override fun perform(affected: Any?): Any? {\n // make decision on status\n var decision = this._consensus.value\n if (decision === NO_DECISION) {\n decision = decide(prepare(affected as T))\n }\n\n complete(affected as T, decision)\n return decision\n }\n}\n\n/**\n * A part of multi-step atomic operation [AtomicOp].\n *\n * @suppress **This is unstable API and it is subject to change.**\n */\npublic abstract class AtomicDesc {\n\n // returns `null` if prepared successfully\n public abstract fun prepare(op: AtomicOp<*>): Any?\n\n // decision == null if success\n public abstract fun complete(op: AtomicOp<*>, failure: Any?)\n}\n\n/**\n * Doubly-linked concurrent list node with remove support.\n * Based on paper\n * [\"Lock-Free and Practical Doubly Linked List-Based Deques Using Single-Word Compare-and-Swap\"](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.140.4693&rep=rep1&type=pdf)\n * by Sundell and Tsigas.\n *\n * Important notes:\n * * The instance of this class serves both as list head/tail sentinel and as the list item.\n * Sentinel node should be never removed.\n * * There are no operations to add items to left side of the list, only to the end (right side), because we cannot\n * efficiently linearize them with atomic multi-step head-removal operations. In short,\n * support for [describeRemoveFirst] operation precludes ability to add items at the beginning.\n *\n * @suppress **This is unstable API and it is subject to change.**\n */\n@Suppress(\"LeakingThis\")\npublic open class LockFreeLinkedListNode {\n\n // Node | Removed | OpDescriptor\n private val _next = atomic(this)\n\n // Node | Removed\n private val _prev = atomic(this)\n\n // lazily cached removed ref to this\n private val _removedRef = atomic(null)\n\n private fun removed(): Removed =\n _removedRef.value ?: Removed(this).also { _removedRef.lazySet(it) }\n\n @PublishedApi\n internal abstract class CondAddOp(\n @JvmField val newNode: Node\n ) : AtomicOp() {\n @JvmField\n var oldNext: Node? = null\n\n override fun complete(affected: Node, failure: Any?) {\n val success = failure == null\n val update = if (success) newNode else oldNext\n if (update != null && affected._next.compareAndSet(this, update)) {\n // only the thread the makes this update actually finishes add operation\n if (success) newNode.finishAdd(oldNext!!)\n }\n }\n }\n\n @PublishedApi\n internal inline fun makeCondAddOp(node: Node, crossinline condition: () -> Boolean): CondAddOp =\n object : CondAddOp(node) {\n override fun prepare(affected: Node): Any? = if (condition()) null else CONDITION_FALSE\n }\n\n public val isRemoved: Boolean get() = next is Removed\n\n // LINEARIZABLE. Returns Node | Removed\n public val next: Any\n get() {\n _next.loop { next ->\n if (next !is OpDescriptor) return next\n next.perform(this)\n }\n }\n\n // LINEARIZABLE. Returns next non-removed Node\n public val nextNode: Node get() = next.unwrap()\n\n // LINEARIZABLE. Returns Node | Removed\n public val prev: Any\n get() {\n _prev.loop { prev ->\n if (prev is Removed) return prev\n prev as Node // otherwise, it can be only node\n if (prev.next === this) return prev\n correctPrev(prev, null)\n }\n }\n\n // LINEARIZABLE. Returns prev non-removed Node\n public val prevNode: Node get() = prev.unwrap()\n\n // ------ addOneIfEmpty ------\n\n public fun addOneIfEmpty(node: Node): Boolean {\n node._prev.lazySet(this)\n node._next.lazySet(this)\n while (true) {\n val next = next\n if (next !== this) return false // this is not an empty list!\n if (_next.compareAndSet(this, node)) {\n // added successfully (linearized add) -- fixup the list\n node.finishAdd(this)\n return true\n }\n }\n }\n\n // ------ addLastXXX ------\n\n /**\n * Adds last item to this list.\n */\n public fun addLast(node: Node) {\n while (true) { // lock-free loop on prev.next\n val prev = prev as Node // sentinel node is never removed, so prev is always defined\n if (prev.addNext(node, this)) return\n }\n }\n\n public fun describeAddLast(node: T): AddLastDesc = AddLastDesc(this, node)\n\n /**\n * Adds last item to this list atomically if the [condition] is true.\n */\n public inline fun addLastIf(node: Node, crossinline condition: () -> Boolean): Boolean {\n val condAdd = makeCondAddOp(node, condition)\n while (true) { // lock-free loop on prev.next\n val prev = prev as Node // sentinel node is never removed, so prev is always defined\n when (prev.tryCondAddNext(node, this, condAdd)) {\n SUCCESS -> return true\n FAILURE -> return false\n }\n }\n }\n\n public inline fun addLastIfPrev(node: Node, predicate: (Node) -> Boolean): Boolean {\n while (true) { // lock-free loop on prev.next\n val prev = prev as Node // sentinel node is never removed, so prev is always defined\n if (!predicate(prev)) return false\n if (prev.addNext(node, this)) return true\n }\n }\n\n public inline fun addLastIfPrevAndIf(\n node: Node,\n predicate: (Node) -> Boolean, // prev node predicate\n crossinline condition: () -> Boolean // atomically checked condition\n ): Boolean {\n val condAdd = makeCondAddOp(node, condition)\n while (true) { // lock-free loop on prev.next\n val prev = prev as Node // sentinel node is never removed, so prev is always defined\n if (!predicate(prev)) return false\n when (prev.tryCondAddNext(node, this, condAdd)) {\n SUCCESS -> return true\n FAILURE -> return false\n }\n }\n }\n\n // ------ addXXX util ------\n\n /**\n * Given:\n * ```\n * +-----------------------+\n * this | node V next\n * +---+---+ +---+---+ +---+---+\n * ... <-- | P | N | | P | N | | P | N | --> ....\n * +---+---+ +---+---+ +---+---+\n * ^ |\n * +-----------------------+\n * ```\n * Produces:\n * ```\n * this node next\n * +---+---+ +---+---+ +---+---+\n * ... <-- | P | N | ==> | P | N | --> | P | N | --> ....\n * +---+---+ +---+---+ +---+---+\n * ^ | ^ |\n * +---------+ +---------+\n * ```\n * Where `==>` denotes linearization point.\n * Returns `false` if `next` was not following `this` node.\n */\n @PublishedApi\n internal fun addNext(node: Node, next: Node): Boolean {\n node._prev.lazySet(this)\n node._next.lazySet(next)\n if (!_next.compareAndSet(next, node)) return false\n // added successfully (linearized add) -- fixup the list\n node.finishAdd(next)\n return true\n }\n\n // returns UNDECIDED, SUCCESS or FAILURE\n @PublishedApi\n internal fun tryCondAddNext(node: Node, next: Node, condAdd: CondAddOp): Int {\n node._prev.lazySet(this)\n node._next.lazySet(next)\n condAdd.oldNext = next\n if (!_next.compareAndSet(next, condAdd)) return UNDECIDED\n // added operation successfully (linearized) -- complete it & fixup the list\n return if (condAdd.perform(this) == null) SUCCESS else FAILURE\n }\n\n // ------ removeXXX ------\n\n /**\n * Removes this node from the list. Returns `true` when removed successfully, or `false` if the node was already\n * removed or if it was not added to any list in the first place.\n *\n * **Note**: Invocation of this operation does not guarantee that remove was actually complete if result was `false`.\n * In particular, invoking [nextNode].[prevNode] might still return this node even though it is \"already removed\".\n * Invoke [helpRemove] to make sure that remove was completed.\n */\n public open fun remove(): Boolean {\n while (true) { // lock-free loop on next\n val next = this.next\n // was already removed -- don't try to help (original thread will take care)\n if (next is Removed) {\n return false\n }\n if (next === this) return false // was not even added\n val removed = (next as Node).removed()\n if (_next.compareAndSet(next, removed)) {\n // was removed successfully (linearized remove) -- fixup the list\n finishRemove(next)\n return true\n }\n }\n }\n\n public fun helpRemove() {\n val removed = this.next as? Removed ?: error(\"Must be invoked on a removed node\")\n finishRemove(removed.ref)\n }\n\n public open fun describeRemove(): AtomicDesc? {\n if (isRemoved) return null // fast path if was already removed\n return object : AbstractAtomicDesc() {\n private val _originalNext = atomic(null)\n override val affectedNode: Node? get() = this@LockFreeLinkedListNode\n override val originalNext get() = _originalNext.value\n override fun failure(affected: Node, next: Any): Any? =\n if (next is Removed) ALREADY_REMOVED else null\n\n override fun onPrepare(affected: Node, next: Node): Any? {\n // Note: onPrepare must use CAS to make sure the stale invocation is not\n // going to overwrite the previous decision on successful preparation.\n // Result of CAS is irrelevant, but we must ensure that it is set when invoker completes\n _originalNext.compareAndSet(null, next)\n return null // always success\n }\n\n override fun updatedNext(affected: Node, next: Node) = next.removed()\n override fun finishOnSuccess(affected: Node, next: Node) = finishRemove(next)\n }\n }\n\n public fun removeFirstOrNull(): Node? {\n while (true) { // try to linearize\n val first = next as Node\n if (first === this) return null\n if (first.remove()) return first\n first.helpDelete() // must help delete, or loose lock-freedom\n }\n }\n\n public fun describeRemoveFirst(): RemoveFirstDesc = RemoveFirstDesc(this)\n\n public inline fun removeFirstIfIsInstanceOf(): T? {\n while (true) { // try to linearize\n val first = next as Node\n if (first === this) return null\n if (first !is T) return null\n if (first.remove()) return first\n first.helpDelete() // must help delete, or loose lock-freedom\n }\n }\n\n // just peek at item when predicate is true\n public inline fun removeFirstIfIsInstanceOfOrPeekIf(predicate: (T) -> Boolean): T? {\n while (true) { // try to linearize\n val first = next as Node\n if (first === this) return null\n if (first !is T) return null\n if (predicate(first)) return first // just peek when predicate is true\n if (first.remove()) return first\n first.helpDelete() // must help delete, or loose lock-freedom\n }\n }\n\n // ------ multi-word atomic operations helpers ------\n\n public open class AddLastDesc constructor(\n @JvmField public val queue: Node,\n @JvmField public val node: T\n ) : AbstractAtomicDesc() {\n init {\n // require freshly allocated node here\n check(node._next.value === node && node._prev.value === node)\n }\n\n final override fun takeAffectedNode(op: OpDescriptor): Node {\n while (true) {\n val prev = queue._prev.value as Node // this sentinel node is never removed\n val next = prev._next.value\n if (next === queue) return prev // all is good -> linked properly\n if (next === op) return prev // all is good -> our operation descriptor is already there\n if (next is OpDescriptor) { // some other operation descriptor -> help & retry\n next.perform(prev)\n continue\n }\n // linked improperly -- help insert\n val affected = queue.correctPrev(prev, op)\n // we can find node which this operation is already affecting while trying to correct prev\n if (affected != null) return affected\n }\n }\n\n private val _affectedNode = atomic(null)\n final override val affectedNode: Node? get() = _affectedNode.value\n final override val originalNext: Node get() = queue\n\n override fun retry(affected: Node, next: Any): Boolean = next !== queue\n\n protected override fun onPrepare(affected: Node, next: Node): Any? {\n // Note: onPrepare must use CAS to make sure the stale invocation is not\n // going to overwrite the previous decision on successful preparation.\n // Result of CAS is irrelevant, but we must ensure that it is set when invoker completes\n _affectedNode.compareAndSet(null, affected)\n return null // always success\n }\n\n override fun updatedNext(affected: Node, next: Node): Any {\n // it is invoked only on successfully completion of operation, but this invocation can be stale,\n // so we must use CAS to set both prev & next pointers\n node._prev.compareAndSet(node, affected)\n node._next.compareAndSet(node, queue)\n return node\n }\n\n override fun finishOnSuccess(affected: Node, next: Node) {\n node.finishAdd(queue)\n }\n }\n\n public open class RemoveFirstDesc(\n @JvmField public val queue: Node\n ) : AbstractAtomicDesc() {\n private val _affectedNode = atomic(null)\n private val _originalNext = atomic(null)\n\n @Suppress(\"UNCHECKED_CAST\")\n public val result: T\n get() = affectedNode!! as T\n\n final override fun takeAffectedNode(op: OpDescriptor): Node = queue.next as Node\n final override val affectedNode: Node? get() = _affectedNode.value\n final override val originalNext: Node? get() = _originalNext.value\n\n // check node predicates here, must signal failure if affect is not of type T\n protected override fun failure(affected: Node, next: Any): Any? =\n if (affected === queue) LIST_EMPTY else null\n\n // validate the resulting node (return false if it should be deleted)\n protected open fun validatePrepared(node: T): Boolean = true // false means remove node & retry\n\n final override fun retry(affected: Node, next: Any): Boolean {\n if (next !is Removed) return false\n affected.helpDelete() // must help delete, or loose lock-freedom\n return true\n }\n\n @Suppress(\"UNCHECKED_CAST\")\n final override fun onPrepare(affected: Node, next: Node): Any? {\n check(affected !is LockFreeLinkedListHead)\n if (!validatePrepared(affected as T)) return REMOVE_PREPARED\n\n // Note: onPrepare must use CAS to make sure the stale invocation is not\n // going to overwrite the previous decision on successful preparation.\n // Result of CAS is irrelevant, but we must ensure that it is set when invoker completes\n _affectedNode.compareAndSet(null, affected)\n _originalNext.compareAndSet(null, next)\n\n // ok\n return null\n }\n\n final override fun updatedNext(affected: Node, next: Node): Any = next.removed()\n final override fun finishOnSuccess(affected: Node, next: Node): Unit = affected.finishRemove(next)\n }\n\n public abstract class AbstractAtomicDesc : AtomicDesc() {\n protected abstract val affectedNode: Node?\n protected abstract val originalNext: Node?\n protected open fun takeAffectedNode(op: OpDescriptor): Node = affectedNode!!\n\n // next: Node | Removed\n\n protected open fun failure(affected: Node, next: Any): Any? = null\n\n // next: Node | Removed\n protected open fun retry(affected: Node, next: Any): Boolean = false\n\n // non-null on failure\n protected abstract fun onPrepare(affected: Node, next: Node): Any?\n protected abstract fun updatedNext(affected: Node, next: Node): Any\n protected abstract fun finishOnSuccess(affected: Node, next: Node)\n\n // This is Harris's RDCSS (Restricted Double-Compare Single Swap) operation\n // It inserts \"op\" descriptor of when \"op\" status is still undecided (rolls back otherwise)\n private class PrepareOp(\n @JvmField val next: Node,\n @JvmField val op: AtomicOp,\n @JvmField val desc: AbstractAtomicDesc\n ) : OpDescriptor() {\n override fun perform(affected: Any?): Any? {\n affected as Node // type assertion\n val decision = desc.onPrepare(affected, next)\n if (decision != null) {\n if (decision === REMOVE_PREPARED) {\n // remove element on failure\n val removed = next.removed()\n if (affected._next.compareAndSet(this, removed)) {\n affected.helpDelete()\n }\n } else {\n // some other failure -- mark as decided\n op.tryDecide(decision)\n // undo preparations\n affected._next.compareAndSet(this, next)\n }\n return decision\n }\n val update: Any = if (op.isDecided) next else op // restore if decision was already reached\n affected._next.compareAndSet(this, update)\n return null // ok\n }\n }\n\n @Suppress(\"UNCHECKED_CAST\")\n final override fun prepare(op: AtomicOp<*>): Any? {\n while (true) { // lock free loop on next\n val affected = takeAffectedNode(op)\n // read its original next pointer first\n val next = affected._next.value\n // then see if already reached consensus on overall operation\n if (next === op) return null // already in process of operation -- all is good\n if (op.isDecided) return null // already decided this operation -- go to next desc\n if (next is OpDescriptor) {\n // some other operation is in process -- help it\n next.perform(affected)\n continue // and retry\n }\n // next: Node | Removed\n val failure = failure(affected, next)\n if (failure != null) return failure // signal failure\n if (retry(affected, next)) continue // retry operation\n val prepareOp = PrepareOp(next as Node, op as AtomicOp, this)\n if (affected._next.compareAndSet(next, prepareOp)) {\n // prepared -- complete preparations\n val prepFail = prepareOp.perform(affected)\n if (prepFail === REMOVE_PREPARED) continue // retry\n return prepFail\n }\n }\n }\n\n final override fun complete(op: AtomicOp<*>, failure: Any?) {\n val success = failure == null\n val affectedNode = affectedNode ?: run { check(!success); return }\n val originalNext = originalNext ?: run { check(!success); return }\n val update = if (success) updatedNext(affectedNode, originalNext) else originalNext\n if (affectedNode._next.compareAndSet(op, update)) {\n if (success) finishOnSuccess(affectedNode, originalNext)\n }\n }\n }\n\n // ------ other helpers ------\n\n /**\n * Given:\n * ```\n *\n * prev this next\n * +---+---+ +---+---+ +---+---+\n * ... <-- | P | N | --> | P | N | --> | P | N | --> ....\n * +---+---+ +---+---+ +---+---+\n * ^ ^ | |\n * | +---------+ |\n * +-------------------------+\n * ```\n * Produces:\n * ```\n * prev this next\n * +---+---+ +---+---+ +---+---+\n * ... <-- | P | N | --> | P | N | --> | P | N | --> ....\n * +---+---+ +---+---+ +---+---+\n * ^ | ^ |\n * +---------+ +---------+\n * ```\n */\n private fun finishAdd(next: Node) {\n next._prev.loop { nextPrev ->\n if (nextPrev is Removed || this.next !== next) return // next was removed, remover fixes up links\n if (next._prev.compareAndSet(nextPrev, this)) {\n if (this.next is Removed) {\n // already removed\n next.correctPrev(nextPrev as Node, null)\n }\n return\n }\n }\n }\n\n private fun finishRemove(next: Node) {\n helpDelete()\n next.correctPrev(_prev.value.unwrap(), null)\n }\n\n private fun markPrev(): Node {\n _prev.loop { prev ->\n if (prev is Removed) return prev.ref\n // See detailed comment in findHead on why `prev === this` is a special case for which we know that\n // the prev should have being pointing to the head of list but finishAdd that was supposed\n // to do that is not complete yet.\n val removedPrev = (if (prev === this) findHead() else (prev as Node)).removed()\n if (_prev.compareAndSet(prev, removedPrev)) return prev\n }\n }\n\n /**\n * Finds the head of the list (implementing [LockFreeLinkedListHead]) by following [next] pointers.\n *\n * The code in [kotlinx.coroutines.JobSupport] performs upgrade of a single node to a list.\n * It uses [addOneIfEmpty] to add the list head to \"empty list of a single node\" once.\n * During upgrade a transient state of the list looks like this:\n *\n * ```\n * +-----------------+\n * | |\n * node V head |\n * +---+---+ +---+---+ |\n * +-> | P | N | --> | P | N |-+\n * | +---+---+ +---+---+\n * | | ^ |\n * +---- + +---------+\n * ```\n *\n * The [prev] pointer in `node` still points to itself when [finishAdd] (invoked inside [addOneIfEmpty])\n * has not completed yet. If this state is observed, then we know that [prev] should have been pointing\n * to the list head. This function is looking up the head by following consistent chain of [next] pointers.\n */\n private fun findHead(): Node {\n var cur = this\n while (true) {\n if (cur is LockFreeLinkedListHead) return cur\n cur = cur.nextNode\n check(cur !== this) { \"Cannot loop to this while looking for list head\" }\n }\n }\n\n // fixes next links to the left of this node\n @PublishedApi\n internal fun helpDelete() {\n var last: Node? = null // will set to the node left of prev when found\n var prev: Node = markPrev()\n var next: Node = (this._next.value as Removed).ref\n while (true) {\n // move to the right until first non-removed node\n val nextNext = next.next\n if (nextNext is Removed) {\n next.markPrev()\n next = nextNext.ref\n continue\n }\n // move the left until first non-removed node\n val prevNext = prev.next\n if (prevNext is Removed) {\n if (last != null) {\n prev.markPrev()\n last._next.compareAndSet(prev, prevNext.ref)\n prev = last\n last = null\n } else {\n prev = prev._prev.value.unwrap()\n }\n continue\n }\n if (prevNext !== this) {\n // skipped over some removed nodes to the left -- setup to fixup the next links\n last = prev\n prev = prevNext as Node\n if (prev === next) return // already done!!!\n continue\n }\n // Now prev & next are Ok\n if (prev._next.compareAndSet(this, next)) return // success!\n }\n }\n\n // fixes prev links from this node\n // returns affected node by this operation when this op is in progress (and nothing can be corrected)\n // returns null otherwise (prev was corrected)\n private fun correctPrev(_prev: Node, op: OpDescriptor?): Node? {\n var prev: Node = _prev\n\n var last: Node? = null // will be set so that last.next === prev\n while (true) {\n // move the left until first non-removed node\n val prevNext = prev._next.value\n if (prevNext === op) return prev // part of the same op -- don't recurse, didn't correct prev\n if (prevNext is OpDescriptor) { // help & retry\n prevNext.perform(prev)\n continue\n }\n if (prevNext is Removed) {\n if (last !== null) {\n prev.markPrev()\n last._next.compareAndSet(prev, prevNext.ref)\n prev = last\n last = null\n } else {\n prev = prev._prev.value.unwrap()\n }\n continue\n }\n val oldPrev = this._prev.value\n if (oldPrev is Removed) return null // this node was removed, too -- its remover will take care\n if (prevNext !== this) {\n // need to fixup next\n last = prev\n prev = prevNext as Node\n continue\n }\n if (oldPrev === prev) return null // it is already linked as needed\n if (this._prev.compareAndSet(oldPrev, prev)) {\n if (prev._prev.value !is Removed) return null // finish only if prev was not concurrently removed\n }\n }\n }\n\n internal fun validateNode(prev: Node, next: Node) {\n check(prev === this._prev.value)\n check(next === this._next.value)\n }\n\n override fun toString(): String =\n \"${this::class.simpleName}@${hashCode()}\"\n}\n\nprivate class Removed(@JvmField val ref: Node) {\n override fun toString(): String = \"Removed[$ref]\"\n}\n\n@PublishedApi\ninternal fun Any.unwrap(): Node = (this as? Removed)?.ref ?: this as Node\n\n/**\n * Head (sentinel) item of the linked list that is never removed.\n *\n * @suppress **This is unstable API and it is subject to change.**\n */\npublic open class LockFreeLinkedListHead : LockFreeLinkedListNode() {\n public val isEmpty: Boolean get() = next === this\n\n /**\n * Iterates over all elements in this list of a specified type.\n */\n public inline fun forEach(block: (T) -> Unit) {\n var cur: Node = next as Node\n while (cur != this) {\n if (cur is T) block(cur)\n cur = cur.nextNode\n }\n }\n\n // just a defensive programming -- makes sure that list head sentinel is never removed\n public final override fun remove(): Boolean = throw UnsupportedOperationException()\n\n public final override fun describeRemove(): Nothing = throw UnsupportedOperationException()\n\n internal fun validate() {\n var prev: Node = this\n var cur: Node = next as Node\n while (cur != this) {\n val next = cur.nextNode\n cur.validateNode(prev, next)\n prev = cur\n cur = next\n }\n validateNode(prev, next as Node)\n }\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.util.pipeline\n\n/**\n * Represents a phase in a pipeline\n *\n * @param name a name for this phase\n */\npublic class PipelinePhase(public val name: String) {\n override fun toString(): String = \"Phase('$name')\"\n}\n\n/**\n * An exception about misconfigured phases in a pipeline\n */\npublic class InvalidPhaseException(message: String) : Throwable(message)\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.util.pipeline\n\nimport io.ktor.util.*\nimport io.ktor.util.collections.*\nimport io.ktor.util.debug.*\nimport io.ktor.util.debug.plugins.*\nimport io.ktor.utils.io.concurrent.*\nimport kotlinx.atomicfu.*\nimport kotlin.coroutines.*\n\ninternal typealias PipelineInterceptorFunction =\n (PipelineContext, TSubject, Continuation) -> Any?\n\n/**\n * Represents an execution pipeline for asynchronous extensible computations\n */\n@Suppress(\"DEPRECATION\")\npublic open class Pipeline(\n vararg phases: PipelinePhase\n) {\n /**\n * Provides common place to store pipeline attributes\n */\n public val attributes: Attributes = Attributes(concurrent = true)\n\n /**\n * Indicated if debug mode is enabled. In debug mode users will get more details in the stacktrace.\n */\n public open val developmentMode: Boolean = false\n\n private val phasesRaw: MutableList = mutableListOf(*phases)\n\n private var interceptorsQuantity = 0\n\n /**\n * Phases of this pipeline\n */\n public val items: List\n get() = phasesRaw.map {\n it as? PipelinePhase ?: (it as? PhaseContent<*, *>)?.phase!!\n }\n\n /**\n * @return `true` if there are no interceptors installed regardless number of phases\n */\n public val isEmpty: Boolean\n get() = interceptorsQuantity == 0\n\n private val _interceptors: AtomicRef>?> =\n atomic(null)\n\n private var interceptors: List>?\n get() = _interceptors.value\n set(value) {\n _interceptors.value = value\n }\n\n private var interceptorsListShared: Boolean = false\n\n private var interceptorsListSharedPhase: PipelinePhase? = null\n\n public constructor(\n phase: PipelinePhase,\n interceptors: List>\n ) : this(phase) {\n interceptors.forEach { intercept(phase, it) }\n }\n\n /**\n * Executes this pipeline in the given [context] and with the given [subject]\n */\n public suspend fun execute(context: TContext, subject: TSubject): TSubject =\n createContext(context, subject, coroutineContext).execute(subject)\n\n /**\n * Adds [phase] to the end of this pipeline\n */\n public fun addPhase(phase: PipelinePhase) {\n if (hasPhase(phase)) {\n return\n }\n\n phasesRaw.add(phase)\n }\n\n /**\n * Inserts [phase] after the [reference] phase. If there are other phases inserted after [reference], then [phase]\n * will be inserted after them.\n * Example:\n * ```\n * val pipeline = Pipeline(a)\n * pipeline.insertPhaseAfter(a, b)\n * pipeline.insertPhaseAfter(a, c)\n * assertEquals(listOf(a, b, c), pipeline.items)\n * ```\n */\n public fun insertPhaseAfter(reference: PipelinePhase, phase: PipelinePhase) {\n if (hasPhase(phase)) return\n\n val index = findPhaseIndex(reference)\n if (index == -1) {\n throw InvalidPhaseException(\"Phase $reference was not registered for this pipeline\")\n }\n // insert after the last phase that has Relation.After on [reference]\n var lastRelatedPhaseIndex = index\n for (i in index + 1..phasesRaw.lastIndex) {\n val relation = (phasesRaw[i] as? PhaseContent<*, *>)?.relation ?: break\n val relatedTo = (relation as? PipelinePhaseRelation.After)?.relativeTo ?: continue\n lastRelatedPhaseIndex = if (relatedTo == reference) i else lastRelatedPhaseIndex\n }\n\n phasesRaw.add(\n lastRelatedPhaseIndex + 1,\n PhaseContent(phase, PipelinePhaseRelation.After(reference))\n )\n }\n\n /**\n * Inserts [phase] before the [reference] phase.\n * Example:\n * ```\n * val pipeline = Pipeline(c)\n * pipeline.insertPhaseBefore(c, a)\n * pipeline.insertPhaseBefore(c, b)\n * assertEquals(listOf(a, b, c), pipeline.items)\n * ```\n */\n public fun insertPhaseBefore(reference: PipelinePhase, phase: PipelinePhase) {\n if (hasPhase(phase)) return\n\n val index = findPhaseIndex(reference)\n if (index == -1) {\n throw InvalidPhaseException(\"Phase $reference was not registered for this pipeline\")\n }\n\n phasesRaw.add(index, PhaseContent(phase, PipelinePhaseRelation.Before(reference)))\n }\n\n /**\n * Adds [block] to the [phase] of this pipeline\n */\n public fun intercept(phase: PipelinePhase, block: PipelineInterceptor) {\n val phaseContent = findPhase(phase)\n ?: throw InvalidPhaseException(\"Phase $phase was not registered for this pipeline\")\n\n @Suppress(\"UNCHECKED_CAST\")\n block as PipelineInterceptorFunction\n\n if (tryAddToPhaseFastPath(phase, block)) {\n interceptorsQuantity++\n return\n }\n\n phaseContent.addInterceptor(block)\n interceptorsQuantity++\n resetInterceptorsList()\n\n afterIntercepted()\n }\n\n /**\n * Invoked after an interceptor has been installed\n */\n public open fun afterIntercepted() {\n }\n\n public fun interceptorsForPhase(phase: PipelinePhase): List> {\n @Suppress(\"UNCHECKED_CAST\")\n return phasesRaw.filterIsInstance>()\n .firstOrNull { phaseOrContent -> phaseOrContent.phase == phase }\n ?.sharedInterceptors() as List>?\n ?: emptyList()\n }\n\n public fun mergePhases(from: Pipeline) {\n val fromPhases = from.phasesRaw\n val toInsert = fromPhases.toMutableList()\n // the worst case is O(n^2), but it will happen only\n // when all phases were inserted before each other into the second pipeline\n // (see test testDependantPhasesLastCommon).\n // in practice, it will be linear time for most cases\n while (toInsert.isNotEmpty()) {\n val iterator = toInsert.iterator()\n while (iterator.hasNext()) {\n val fromPhaseOrContent = iterator.next()\n\n val fromPhase = (fromPhaseOrContent as? PipelinePhase)\n ?: (fromPhaseOrContent as PhaseContent<*, *>).phase\n\n if (hasPhase(fromPhase)) {\n iterator.remove()\n } else {\n val inserted = insertRelativePhase(fromPhaseOrContent, fromPhase)\n if (inserted) {\n iterator.remove()\n }\n }\n }\n }\n }\n\n private fun mergeInterceptors(from: Pipeline) {\n if (interceptorsQuantity == 0) {\n setInterceptorsListFromAnotherPipeline(from)\n } else {\n resetInterceptorsList()\n }\n\n val fromPhases = from.phasesRaw\n fromPhases.forEach { fromPhaseOrContent ->\n val fromPhase = (fromPhaseOrContent as? PipelinePhase)\n ?: (fromPhaseOrContent as PhaseContent<*, *>).phase\n\n if (fromPhaseOrContent is PhaseContent<*, *> && !fromPhaseOrContent.isEmpty) {\n @Suppress(\"UNCHECKED_CAST\")\n fromPhaseOrContent as PhaseContent\n\n fromPhaseOrContent.addTo(findPhase(fromPhase)!!)\n interceptorsQuantity += fromPhaseOrContent.size\n }\n }\n }\n\n /**\n * Merges another pipeline into this pipeline, maintaining relative phases order\n */\n public fun merge(from: Pipeline) {\n if (fastPathMerge(from)) {\n return\n }\n\n mergePhases(from)\n mergeInterceptors(from)\n }\n\n /**\n * Reset current pipeline from other.\n */\n public fun resetFrom(from: Pipeline) {\n phasesRaw.clear()\n check(interceptorsQuantity == 0)\n\n fastPathMerge(from)\n }\n\n internal fun phaseInterceptors(phase: PipelinePhase): List> =\n findPhase(phase)?.sharedInterceptors() ?: emptyList()\n\n /**\n * For tests only\n */\n internal fun interceptorsForTests(): List> {\n return interceptors ?: cacheInterceptors()\n }\n\n @Suppress(\"DEPRECATION\")\n private fun createContext(\n context: TContext,\n subject: TSubject,\n coroutineContext: CoroutineContext\n ): PipelineContext =\n pipelineContextFor(context, sharedInterceptorsList(), subject, coroutineContext, developmentMode)\n\n private fun findPhase(phase: PipelinePhase): PhaseContent? {\n val phasesList = phasesRaw\n\n for (index in 0 until phasesList.size) {\n val current = phasesList[index]\n if (current === phase) {\n val content = PhaseContent(phase, PipelinePhaseRelation.Last)\n phasesList[index] = content\n return content\n }\n\n if (current is PhaseContent<*, *> && current.phase === phase) {\n @Suppress(\"UNCHECKED_CAST\")\n return current as PhaseContent\n }\n }\n\n return null\n }\n\n private fun findPhaseIndex(phase: PipelinePhase): Int {\n val phasesList = phasesRaw\n for (index in 0 until phasesList.size) {\n val current = phasesList[index]\n if (current === phase || (current is PhaseContent<*, *> && current.phase === phase)) {\n return index\n }\n }\n\n return -1\n }\n\n private fun hasPhase(phase: PipelinePhase): Boolean {\n val phasesList = phasesRaw\n for (index in 0 until phasesList.size) {\n val current = phasesList[index]\n if (current === phase || (current is PhaseContent<*, *> && current.phase === phase)) {\n return true\n }\n }\n\n return false\n }\n\n private fun cacheInterceptors(): List> {\n val interceptorsQuantity = interceptorsQuantity\n if (interceptorsQuantity == 0) {\n notSharedInterceptorsList(emptyList())\n return emptyList()\n }\n\n val phases = phasesRaw\n if (interceptorsQuantity == 1) {\n for (phaseIndex in 0..phases.lastIndex) {\n @Suppress(\"UNCHECKED_CAST\")\n val phaseContent =\n phases[phaseIndex] as? PhaseContent ?: continue\n\n if (phaseContent.isEmpty) continue\n\n val interceptors = phaseContent.sharedInterceptors()\n setInterceptorsListFromPhase(phaseContent)\n return interceptors\n }\n }\n\n val destination: MutableList> = mutableListOf()\n for (phaseIndex in 0..phases.lastIndex) {\n @Suppress(\"UNCHECKED_CAST\")\n val phase = phases[phaseIndex] as? PhaseContent ?: continue\n\n phase.addTo(destination)\n }\n\n notSharedInterceptorsList(destination)\n return destination\n }\n\n private fun fastPathMerge(from: Pipeline): Boolean {\n if (from.phasesRaw.isEmpty()) {\n return true\n }\n\n if (phasesRaw.isNotEmpty()) {\n return false\n }\n\n val fromPhases = from.phasesRaw\n\n for (index in 0..fromPhases.lastIndex) {\n val fromPhaseOrContent = fromPhases[index]\n if (fromPhaseOrContent is PipelinePhase) {\n phasesRaw.add(fromPhaseOrContent)\n continue\n }\n\n if (fromPhaseOrContent !is PhaseContent<*, *>) {\n continue\n }\n\n @Suppress(\"UNCHECKED_CAST\")\n fromPhaseOrContent as PhaseContent\n\n phasesRaw.add(\n PhaseContent(\n fromPhaseOrContent.phase,\n fromPhaseOrContent.relation,\n fromPhaseOrContent.sharedInterceptors()\n )\n )\n continue\n }\n\n interceptorsQuantity += from.interceptorsQuantity\n setInterceptorsListFromAnotherPipeline(from)\n return true\n }\n\n private fun sharedInterceptorsList(): List> {\n if (interceptors == null) {\n cacheInterceptors()\n }\n\n interceptorsListShared = true\n return interceptors!!\n }\n\n private fun resetInterceptorsList() {\n interceptors = null\n interceptorsListShared = false\n interceptorsListSharedPhase = null\n }\n\n private fun notSharedInterceptorsList(list: List>) {\n interceptors = list\n interceptorsListShared = false\n interceptorsListSharedPhase = null\n }\n\n private fun setInterceptorsListFromPhase(phaseContent: PhaseContent) {\n interceptors = phaseContent.sharedInterceptors()\n interceptorsListShared = false\n interceptorsListSharedPhase = phaseContent.phase\n }\n\n private fun setInterceptorsListFromAnotherPipeline(pipeline: Pipeline) {\n interceptors = pipeline.sharedInterceptorsList()\n interceptorsListShared = true\n interceptorsListSharedPhase = null\n }\n\n private fun tryAddToPhaseFastPath(\n phase: PipelinePhase,\n block: PipelineInterceptorFunction\n ): Boolean {\n val currentInterceptors = interceptors\n if (phasesRaw.isEmpty() || currentInterceptors == null) {\n return false\n }\n\n if (interceptorsListShared || currentInterceptors !is MutableList) {\n return false\n }\n\n if (interceptorsListSharedPhase == phase) {\n currentInterceptors.add(block)\n return true\n }\n\n if (phase == phasesRaw.last() || findPhaseIndex(phase) == phasesRaw.lastIndex) {\n findPhase(phase)!!.addInterceptor(block)\n currentInterceptors.add(block)\n return true\n }\n\n return false\n }\n\n private fun insertRelativePhase(fromPhaseOrContent: Any, fromPhase: PipelinePhase): Boolean {\n val fromPhaseRelation = when {\n fromPhaseOrContent === fromPhase -> PipelinePhaseRelation.Last\n else -> (fromPhaseOrContent as PhaseContent<*, *>).relation\n }\n\n when {\n fromPhaseRelation is PipelinePhaseRelation.Last ->\n addPhase(fromPhase)\n\n fromPhaseRelation is PipelinePhaseRelation.Before && hasPhase(fromPhaseRelation.relativeTo) ->\n insertPhaseBefore(fromPhaseRelation.relativeTo, fromPhase)\n\n fromPhaseRelation is PipelinePhaseRelation.After ->\n insertPhaseAfter(fromPhaseRelation.relativeTo, fromPhase)\n\n else -> return false\n }\n return true\n }\n}\n\n/**\n * Executes this pipeline\n */\n@Suppress(\"NOTHING_TO_INLINE\")\npublic suspend inline fun Pipeline.execute(\n context: TContext\n) {\n // A list of executed plugins with their handlers must be attached to the call's coroutine context\n // in order to be available from the IntelliJ debugger any time inside the call.\n initContextInDebugMode {\n execute(context, Unit)\n }\n}\n\n/**\n * Intercepts an untyped pipeline when the subject is of the given type\n */\npublic inline fun Pipeline<*, TContext>.intercept(\n phase: PipelinePhase,\n noinline block: suspend PipelineContext.(TSubject) -> Unit\n) {\n intercept(phase) interceptor@{ subject ->\n if (subject !is TSubject) return@interceptor\n\n @Suppress(\"UNCHECKED_CAST\")\n val reinterpret = this as? PipelineContext\n reinterpret?.block(subject)\n }\n}\n\n/**\n * Represents an interceptor type which is a suspend extension function for a context\n */\npublic typealias PipelineInterceptor =\n suspend PipelineContext.(TSubject) -> Unit\n","/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.util.reflect\n\nimport kotlin.reflect.*\n\n/**\n * Information about type.\n */\npublic expect interface Type\n\npublic expect val KType.platformType: Type\n\n/**\n * Ktor type information.\n * @property type: source KClass<*>\n * @property reifiedType: type with substituted generics\n * @property kotlinType: kotlin reified type with all generic type parameters.\n */\npublic data class TypeInfo(\n public val type: KClass<*>,\n public val reifiedType: Type,\n public val kotlinType: KType? = null\n)\n\n/**\n * Returns [TypeInfo] for the specified type [T]\n */\npublic expect inline fun typeInfo(): TypeInfo\n\n/**\n * Check [this] is instance of [type].\n */\npublic expect fun Any.instanceOf(type: KClass<*>): Boolean\n\n@PublishedApi\n@OptIn(ExperimentalStdlibApi::class)\ninternal inline fun tryGetType(): KType? = try {\n // We need to wrap getting type in try catch because of https://youtrack.jetbrains.com/issue/KT-42913\n typeOf()\n} catch (cause: Throwable) {\n null\n}\n","/*\n * Copyright 2014-2019 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.util\n\n/**\n * Create ES specific [Attributes] instance.\n */\n@JsName(\"AttributesJsFn\")\npublic actual fun Attributes(concurrent: Boolean): Attributes = AttributesJs()\n\n@Suppress(\"KDocMissingDocumentation\")\npublic class AttributesJs : Attributes {\n private val map = mutableMapOf, Any?>()\n\n @Suppress(\"UNCHECKED_CAST\")\n override fun getOrNull(key: AttributeKey): T? = map[key] as T?\n\n override operator fun contains(key: AttributeKey<*>): Boolean = map.containsKey(key)\n\n override fun put(key: AttributeKey, value: T) {\n map[key] = value\n }\n\n override fun remove(key: AttributeKey) {\n map.remove(key)\n }\n\n @Suppress(\"UNCHECKED_CAST\")\n override fun computeIfAbsent(key: AttributeKey, block: () -> T): T {\n map[key]?.let { return it as T }\n return block().also { result ->\n map[key] = result\n }\n }\n\n override val allKeys: List>\n get() = map.keys.toList()\n}\n","/*\n * Copyright 2014-2019 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.util\n\npublic actual fun Set.unmodifiable(): Set = this\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.util\n\nimport kotlinx.coroutines.*\nimport org.khronos.webgl.*\nimport kotlin.js.*\n\n/**\n * Generates a nonce string.\n */\npublic actual fun generateNonce(): String {\n val buffer = ByteArray(NONCE_SIZE_IN_BYTES)\n if (PlatformUtils.IS_NODE) {\n _crypto.randomFillSync(buffer)\n } else {\n _crypto.getRandomValues(buffer)\n }\n return hex(buffer)\n}\n\n/**\n * Create [Digest] from specified hash [name].\n */\npublic actual fun Digest(name: String): Digest = object : Digest {\n private val state = mutableListOf()\n override fun plusAssign(bytes: ByteArray) {\n state += bytes\n }\n\n override fun reset() {\n state.clear()\n }\n\n override suspend fun build(): ByteArray {\n val snapshot = state.reduce { a, b -> a + b }\n val digestBuffer = _crypto.subtle.digest(name, snapshot).asDeferred().await()\n val digestView = DataView(digestBuffer)\n return ByteArray(digestView.byteLength) { digestView.getUint8(it) }\n }\n}\n\n// Variable is renamed to `_crypto` so it wouldn't clash with existing `crypto` variable.\n// JS IR backend doesn't reserve names accessed inside js(\"\") calls\nprivate val _crypto: Crypto by lazy { // lazy because otherwise it's untestable due to evaluation order\n if (PlatformUtils.IS_NODE) {\n js(\"eval('require')('crypto')\")\n } else {\n js(\"(window ? (window.crypto ? window.crypto : window.msCrypto) : self.crypto)\")\n }\n}\n\nprivate external class Crypto {\n val subtle: SubtleCrypto\n\n fun getRandomValues(array: ByteArray)\n\n fun randomFillSync(array: ByteArray)\n}\n\nprivate external class SubtleCrypto {\n fun digest(algoName: String, buffer: ByteArray): Promise\n}\n\n/**\n * Compute SHA-1 hash for the specified [bytes]\n */\npublic actual fun sha1(bytes: ByteArray): ByteArray = Sha1().digest(bytes)\n","// ktlint-disable filename\n/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.util\n\npublic actual object PlatformUtils {\n public actual val IS_BROWSER: Boolean = js(\n \"typeof window !== 'undefined' && typeof window.document !== 'undefined' || typeof self !== 'undefined' && typeof self.location !== 'undefined'\" // ktlint-disable max-line-length\n ) as Boolean\n\n public actual val IS_NODE: Boolean = js(\n \"typeof process !== 'undefined' && process.versions != null && process.versions.node != null\"\n ) as Boolean\n\n public actual val IS_JVM: Boolean = false\n public actual val IS_NATIVE: Boolean = false\n public actual val IS_DEVELOPMENT_MODE: Boolean = false\n public actual val IS_NEW_MM_ENABLED: Boolean = true\n}\n","/*\n * Copyright 2014-2019 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.util.date\n\nimport kotlin.js.*\n\n/**\n * Create new gmt date from the [timestamp].\n * @param timestamp is a number of epoch milliseconds (it is `now` by default).\n */\npublic actual fun GMTDate(timestamp: Long?): GMTDate {\n val date = timestamp?.toDouble()?.let { Date(it) } ?: Date()\n\n if (date.getTime().isNaN()) throw InvalidTimestampException(timestamp!!)\n\n with(date) {\n /* from SUNDAY 0 -> MONDAY 0 */\n val dayOfWeek = WeekDay.from((getUTCDay() + 6) % 7)\n\n val month = Month.from(getUTCMonth())\n\n return GMTDate(\n getUTCSeconds(),\n getUTCMinutes(),\n getUTCHours(),\n\n dayOfWeek,\n getUTCDate(),\n getUTCFullYear(),\n\n month,\n getUTCFullYear(),\n\n getTime().toLong()\n )\n }\n}\n\n/**\n * Create an instance of [GMTDate] from the specified date/time components\n */\npublic actual fun GMTDate(seconds: Int, minutes: Int, hours: Int, dayOfMonth: Int, month: Month, year: Int): GMTDate {\n val timestamp = Date.UTC(year, month.ordinal, dayOfMonth, hours, minutes, seconds).toLong()\n return GMTDate(timestamp)\n}\n\n/**\n * Invalid exception: possible overflow or underflow\n */\npublic class InvalidTimestampException(timestamp: Long) : IllegalStateException(\n \"Invalid date timestamp exception: $timestamp\"\n)\n\n/**\n * Gets current system time in milliseconds since certain moment in the past, only delta between two subsequent calls makes sense.\n */\npublic actual fun getTimeMillis(): Long = Date().getTime().toLong()\n","// ktlint-disable filename\n/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.util.debug\n\ninternal actual object IntellijIdeaDebugDetector {\n actual val isDebuggerConnected: Boolean = false\n}\n","/*\n * Copyright 2014-2022 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.util.internal\n\n/**\n * Internal helper for setting cause on [Throwable] in MPP\n */\npublic actual fun Throwable.initCauseBridge(cause: Throwable) {}\n","/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.util.reflect\n\nimport kotlin.reflect.*\n\npublic actual interface Type\n\npublic object JsType : Type\n\n@OptIn(ExperimentalStdlibApi::class)\npublic actual inline fun typeInfo(): TypeInfo = typeInfoImpl(JsType, T::class, tryGetType())\n\npublic fun typeInfoImpl(reifiedType: Type, kClass: KClass<*>, kType: KType?): TypeInfo =\n TypeInfo(kClass, reifiedType, kType)\n\n/**\n * Check [this] is instance of [type].\n */\npublic actual fun Any.instanceOf(type: KClass<*>): Boolean = type.isInstance(this)\n\npublic actual val KType.platformType: Type\n get() = JsType\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.util.collections\n\ninternal const val INITIAL_CAPACITY = 32\n\n/**\n * Ktor concurrent map implementation. Please do not use it.\n */\npublic expect class ConcurrentMap(\n initialCapacity: Int = INITIAL_CAPACITY\n) : MutableMap {\n\n /**\n * Computes [block] and inserts result in map. The [block] will be evaluated at most once.\n */\n public fun computeIfAbsent(key: Key, block: () -> Value): Value\n}\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http\n\nimport io.ktor.util.*\nimport io.ktor.util.date.*\nimport kotlin.jvm.*\n\n/**\n * Represents a cookie with name, content and a set of settings such as expiration, visibility and security.\n * A cookie with neither [expires] nor [maxAge] is a session cookie.\n *\n * @property name\n * @property value\n * @property encoding - cookie encoding type [CookieEncoding]\n * @property maxAge number of seconds to keep cookie\n * @property expires date when it expires\n * @property domain for which it is set\n * @property path for which it is set\n * @property secure send it via secure connection only\n * @property httpOnly only transfer cookie over HTTP, no access from JavaScript\n * @property extensions additional cookie extensions\n */\npublic data class Cookie(\n val name: String,\n val value: String,\n val encoding: CookieEncoding = CookieEncoding.URI_ENCODING,\n @get:JvmName(\"getMaxAgeInt\")\n val maxAge: Int = 0,\n val expires: GMTDate? = null,\n val domain: String? = null,\n val path: String? = null,\n val secure: Boolean = false,\n val httpOnly: Boolean = false,\n val extensions: Map = emptyMap()\n)\n\n/**\n * Cooke encoding strategy\n */\npublic enum class CookieEncoding {\n /**\n * No encoding (could be dangerous)\n */\n RAW,\n\n /**\n * Double quotes with slash-escaping\n */\n DQUOTES,\n\n /**\n * URI encoding\n */\n URI_ENCODING,\n\n /**\n * BASE64 encoding\n */\n BASE64_ENCODING\n}\n\nprivate val loweredPartNames = setOf(\"max-age\", \"expires\", \"domain\", \"path\", \"secure\", \"httponly\", \"\\$x-enc\")\n\n/**\n * Parse server's `Set-Cookie` header value\n */\npublic fun parseServerSetCookieHeader(cookiesHeader: String): Cookie {\n val asMap = parseClientCookiesHeader(cookiesHeader, false)\n val first = asMap.entries.first { !it.key.startsWith(\"$\") }\n val encoding = asMap[\"\\$x-enc\"]?.let { CookieEncoding.valueOf(it) } ?: CookieEncoding.RAW\n val loweredMap = asMap.mapKeys { it.key.toLowerCasePreservingASCIIRules() }\n\n return Cookie(\n name = first.key,\n value = decodeCookieValue(first.value, encoding),\n encoding = encoding,\n maxAge = loweredMap[\"max-age\"]?.toIntClamping() ?: 0,\n expires = loweredMap[\"expires\"]?.fromCookieToGmtDate(),\n domain = loweredMap[\"domain\"],\n path = loweredMap[\"path\"],\n secure = \"secure\" in loweredMap,\n httpOnly = \"httponly\" in loweredMap,\n extensions = asMap.filterKeys {\n it.toLowerCasePreservingASCIIRules() !in loweredPartNames && it != first.key\n }\n )\n}\n\nprivate val clientCookieHeaderPattern = \"\"\"(^|;)\\s*([^;=\\{\\}\\s]+)\\s*(=\\s*(\"[^\"]*\"|[^;]*))?\"\"\".toRegex()\n\n/**\n * Parse client's `Cookie` header value\n */\npublic fun parseClientCookiesHeader(cookiesHeader: String, skipEscaped: Boolean = true): Map =\n clientCookieHeaderPattern.findAll(cookiesHeader)\n .map { (it.groups[2]?.value ?: \"\") to (it.groups[4]?.value ?: \"\") }\n .filter { !skipEscaped || !it.first.startsWith(\"$\") }\n .map { cookie ->\n if (cookie.second.startsWith(\"\\\"\") && cookie.second.endsWith(\"\\\"\")) {\n cookie.copy(second = cookie.second.removeSurrounding(\"\\\"\"))\n } else {\n cookie\n }\n }\n .toMap()\n\n/**\n * Format `Set-Cookie` header value\n */\npublic fun renderSetCookieHeader(cookie: Cookie): String = with(cookie) {\n renderSetCookieHeader(\n name,\n value,\n encoding,\n maxAge,\n expires,\n domain,\n path,\n secure,\n httpOnly,\n extensions\n )\n}\n\n/**\n * Format `Cookie` header value\n */\npublic fun renderCookieHeader(cookie: Cookie): String = with(cookie) {\n \"$name=${encodeCookieValue(value, encoding)}\"\n}\n\n/**\n * Format `Set-Cookie` header value\n */\npublic fun renderSetCookieHeader(\n name: String,\n value: String,\n encoding: CookieEncoding = CookieEncoding.URI_ENCODING,\n maxAge: Int = 0,\n expires: GMTDate? = null,\n domain: String? = null,\n path: String? = null,\n secure: Boolean = false,\n httpOnly: Boolean = false,\n extensions: Map = emptyMap(),\n includeEncoding: Boolean = true\n): String = (\n listOf(\n cookiePart(name.assertCookieName(), value, encoding),\n cookiePartUnencoded(\"Max-Age\", if (maxAge > 0) maxAge else null),\n cookiePartUnencoded(\"Expires\", expires?.toHttpDate()),\n cookiePart(\"Domain\", domain, CookieEncoding.RAW),\n cookiePart(\"Path\", path, CookieEncoding.RAW),\n\n cookiePartFlag(\"Secure\", secure),\n cookiePartFlag(\"HttpOnly\", httpOnly)\n ) + extensions.map { cookiePartExt(it.key.assertCookieName(), it.value, encoding) } +\n if (includeEncoding) cookiePartExt(\"\\$x-enc\", encoding.name, CookieEncoding.RAW) else \"\"\n ).filter { it.isNotEmpty() }\n .joinToString(\"; \")\n\n/**\n * Encode cookie value using the specified [encoding]\n */\npublic fun encodeCookieValue(value: String, encoding: CookieEncoding): String = when (encoding) {\n CookieEncoding.RAW -> when {\n value.any { it.shouldEscapeInCookies() } ->\n throw IllegalArgumentException(\n \"The cookie value contains characters that cannot be encoded in RAW format. \" +\n \" Consider URL_ENCODING mode\"\n )\n else -> value\n }\n CookieEncoding.DQUOTES -> when {\n value.contains('\"') -> throw IllegalArgumentException(\n \"The cookie value contains characters that cannot be encoded in DQUOTES format. \" +\n \"Consider URL_ENCODING mode\"\n )\n value.any { it.shouldEscapeInCookies() } -> \"\\\"$value\\\"\"\n else -> value\n }\n CookieEncoding.BASE64_ENCODING -> value.encodeBase64()\n CookieEncoding.URI_ENCODING -> value.encodeURLQueryComponent(encodeFull = true, spaceToPlus = true)\n}\n\n/**\n * Decode cookie value using the specified [encoding]\n */\npublic fun decodeCookieValue(encodedValue: String, encoding: CookieEncoding): String = when (encoding) {\n CookieEncoding.RAW, CookieEncoding.DQUOTES -> when {\n encodedValue.trimStart().startsWith(\"\\\"\") && encodedValue.trimEnd().endsWith(\"\\\"\") ->\n encodedValue.trim().removeSurrounding(\"\\\"\")\n else -> encodedValue\n }\n CookieEncoding.URI_ENCODING -> encodedValue.decodeURLQueryComponent(plusIsSpace = true)\n CookieEncoding.BASE64_ENCODING -> encodedValue.decodeBase64String()\n}\n\nprivate fun String.assertCookieName() = when {\n any { it.shouldEscapeInCookies() } -> throw IllegalArgumentException(\"Cookie name is not valid: $this\")\n else -> this\n}\n\nprivate val cookieCharsShouldBeEscaped = setOf(';', ',', '\"')\n\nprivate fun Char.shouldEscapeInCookies() = isWhitespace() || this < ' ' || this in cookieCharsShouldBeEscaped\n\n@Suppress(\"NOTHING_TO_INLINE\")\nprivate inline fun cookiePart(name: String, value: Any?, encoding: CookieEncoding) =\n if (value != null) \"$name=${encodeCookieValue(value.toString(), encoding)}\" else \"\"\n\n@Suppress(\"NOTHING_TO_INLINE\")\nprivate inline fun cookiePartUnencoded(name: String, value: Any?) =\n if (value != null) \"$name=$value\" else \"\"\n\n@Suppress(\"NOTHING_TO_INLINE\")\nprivate inline fun cookiePartFlag(name: String, value: Boolean) =\n if (value) name else \"\"\n\n@Suppress(\"NOTHING_TO_INLINE\")\nprivate inline fun cookiePartExt(name: String, value: String?, encoding: CookieEncoding) =\n if (value == null) cookiePartFlag(name, true) else cookiePart(name, value, encoding)\n\nprivate fun String.toIntClamping(): Int = toLong().coerceIn(0L, Int.MAX_VALUE.toLong()).toInt()\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"StringsKt\")\n\npackage kotlin.text\n\n/**\n * Converts the string into a regular expression [Regex] with the default options.\n */\n@kotlin.internal.InlineOnly\npublic inline fun String.toRegex(): Regex = Regex(this)\n\n/**\n * Converts the string into a regular expression [Regex] with the specified single [option].\n */\n@kotlin.internal.InlineOnly\npublic inline fun String.toRegex(option: RegexOption): Regex = Regex(this, option)\n\n/**\n * Converts the string into a regular expression [Regex] with the specified set of [options].\n */\n@kotlin.internal.InlineOnly\npublic inline fun String.toRegex(options: Set): Regex = Regex(this, options)\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http\n\n/**\n * Set `E-Tag` header\n */\npublic fun HeadersBuilder.etag(entityTag: String): Unit = set(HttpHeaders.ETag, entityTag)\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\npackage io.ktor.http\n\nimport io.ktor.utils.io.charsets.*\nimport io.ktor.utils.io.core.*\n\nprivate val URL_ALPHABET = ((('a'..'z') + ('A'..'Z') + ('0'..'9')).map { it.code.toByte() }).toSet()\nprivate val URL_ALPHABET_CHARS = ((('a'..'z') + ('A'..'Z') + ('0'..'9'))).toSet()\nprivate val HEX_ALPHABET = (('a'..'f') + ('A'..'F') + ('0'..'9')).toSet()\n\n/**\n * https://tools.ietf.org/html/rfc3986#section-2\n */\nprivate val URL_PROTOCOL_PART = setOf(\n ':', '/', '?', '#', '[', ']', '@', // general\n '!', '$', '&', '\\'', '(', ')', '*', ',', ';', '=', // sub-components\n '-', '.', '_', '~', '+' // unreserved\n).map { it.code.toByte() }\n\n/**\n * from `pchar` in https://tools.ietf.org/html/rfc3986#section-2\n */\nprivate val VALID_PATH_PART = setOf(\n ':', '@',\n '!', '$', '&', '\\'', '(', ')', '*', '+', ',', ';', '=',\n '-', '.', '_', '~'\n)\n\n/**\n * Characters allowed in attributes according: https://datatracker.ietf.org/doc/html/rfc5987\n * attr-char = ALPHA / DIGIT / \"!\" / \"#\" / \"$\" / \"&\" / \"+\" / \"-\" / \".\" / \"^\" / \"_\" / \"`\" / \"|\" / \"~\"\n */\ninternal val ATTRIBUTE_CHARACTERS: Set = URL_ALPHABET_CHARS + setOf(\n '!', '#', '$', '&', '+', '-', '.', '^', '_', '`', '|', '~'\n)\n\n/**\n * Oauth specific percent encoding\n * https://tools.ietf.org/html/rfc5849#section-3.6\n */\nprivate val OAUTH_SYMBOLS = listOf('-', '.', '_', '~').map { it.code.toByte() }\n\n/**\n * Encode url part as specified in\n * https://tools.ietf.org/html/rfc3986#section-2\n */\npublic fun String.encodeURLQueryComponent(\n encodeFull: Boolean = false,\n spaceToPlus: Boolean = false,\n charset: Charset = Charsets.UTF_8\n): String = buildString {\n val content = charset.newEncoder().encode(this@encodeURLQueryComponent)\n content.forEach {\n when {\n it == ' '.code.toByte() -> if (spaceToPlus) append('+') else append(\"%20\")\n it in URL_ALPHABET || (!encodeFull && it in URL_PROTOCOL_PART) -> append(it.toInt().toChar())\n else -> append(it.percentEncode())\n }\n }\n}\n\n/**\n * Encodes URL path. It escapes all illegal or ambiguous characters keeping all \"/\" symbols.\n */\npublic fun String.encodeURLPath(): String = encodeURLPath(encodeSlash = false)\n\n/**\n * Encodes URL path segment. It escapes all illegal or ambiguous characters\n */\npublic fun String.encodeURLPathPart(): String = encodeURLPath(encodeSlash = true)\n\ninternal fun String.encodeURLPath(encodeSlash: Boolean): String = buildString {\n val charset = Charsets.UTF_8\n\n var index = 0\n while (index < this@encodeURLPath.length) {\n val current = this@encodeURLPath[index]\n if ((!encodeSlash && current == '/') || current in URL_ALPHABET_CHARS || current in VALID_PATH_PART) {\n append(current)\n index++\n continue\n }\n\n if (current == '%' &&\n index + 2 < this@encodeURLPath.length &&\n this@encodeURLPath[index + 1] in HEX_ALPHABET &&\n this@encodeURLPath[index + 2] in HEX_ALPHABET\n ) {\n append(current)\n append(this@encodeURLPath[index + 1])\n append(this@encodeURLPath[index + 2])\n\n index += 3\n continue\n }\n\n val symbolSize = if (current.isSurrogate()) 2 else 1\n // we need to call newEncoder() for every symbol, otherwise it won't work\n charset.newEncoder().encode(this@encodeURLPath, index, index + symbolSize).forEach {\n append(it.percentEncode())\n }\n index += symbolSize\n }\n}\n\n/**\n * Encode [this] in percent encoding specified here:\n * https://tools.ietf.org/html/rfc5849#section-3.6\n */\npublic fun String.encodeOAuth(): String = encodeURLParameter()\n\n/**\n * Encode [this] as query parameter key.\n */\npublic fun String.encodeURLParameter(\n spaceToPlus: Boolean = false\n): String = buildString {\n val content = Charsets.UTF_8.newEncoder().encode(this@encodeURLParameter)\n content.forEach {\n when {\n it in URL_ALPHABET || it in OAUTH_SYMBOLS -> append(it.toInt().toChar())\n spaceToPlus && it == ' '.code.toByte() -> append('+')\n else -> append(it.percentEncode())\n }\n }\n}\n\ninternal fun String.percentEncode(allowedSet: Set): String {\n val encodedCount = count { it !in allowedSet }\n if (encodedCount == 0) return this\n\n val resultSize = length + encodedCount * 2\n val result = CharArray(resultSize)\n\n var writeIndex = 0\n for (index in 0 until length) {\n val current = this[index]\n if (current in allowedSet) {\n result[writeIndex++] = current\n } else {\n val code = current.code\n result[writeIndex++] = '%'\n result[writeIndex++] = hexDigitToChar(code shr 4)\n result[writeIndex++] = hexDigitToChar(code and 0xf)\n }\n }\n\n return result.concatToString()\n}\n\n/**\n * Encode [this] as query parameter value.\n */\ninternal fun String.encodeURLParameterValue(): String = encodeURLParameter(spaceToPlus = true)\n\n/**\n * Decode URL query component\n */\npublic fun String.decodeURLQueryComponent(\n start: Int = 0,\n end: Int = length,\n plusIsSpace: Boolean = false,\n charset: Charset = Charsets.UTF_8\n): String = decodeScan(start, end, plusIsSpace, charset)\n\n/**\n * Decode percent encoded URL part within the specified range [[start], [end]).\n * This function is not intended to decode urlencoded forms so it doesn't decode plus character to space.\n */\npublic fun String.decodeURLPart(\n start: Int = 0,\n end: Int = length,\n charset: Charset = Charsets.UTF_8\n): String = decodeScan(start, end, false, charset)\n\nprivate fun String.decodeScan(start: Int, end: Int, plusIsSpace: Boolean, charset: Charset): String {\n for (index in start until end) {\n val ch = this[index]\n if (ch == '%' || (plusIsSpace && ch == '+')) {\n return decodeImpl(start, end, index, plusIsSpace, charset)\n }\n }\n return if (start == 0 && end == length) toString() else substring(start, end)\n}\n\nprivate fun CharSequence.decodeImpl(\n start: Int,\n end: Int,\n prefixEnd: Int,\n plusIsSpace: Boolean,\n charset: Charset\n): String {\n val length = end - start\n // if length is big, it probably means it is encoded\n val sbSize = if (length > 255) length / 3 else length\n val sb = StringBuilder(sbSize)\n\n if (prefixEnd > start) {\n sb.append(this, start, prefixEnd)\n }\n\n var index = prefixEnd\n\n // reuse ByteArray for hex decoding stripes\n var bytes: ByteArray? = null\n\n while (index < end) {\n val c = this[index]\n when {\n plusIsSpace && c == '+' -> {\n sb.append(' ')\n index++\n }\n c == '%' -> {\n // if ByteArray was not needed before, create it with an estimate of remaining string be all hex\n if (bytes == null) {\n bytes = ByteArray((end - index) / 3)\n }\n\n // fill ByteArray with all the bytes, so Charset can decode text\n var count = 0\n while (index < end && this[index] == '%') {\n if (index + 2 >= end) {\n throw URLDecodeException(\n \"Incomplete trailing HEX escape: ${substring(index)}, in $this at $index\"\n )\n }\n\n val digit1 = charToHexDigit(this[index + 1])\n val digit2 = charToHexDigit(this[index + 2])\n if (digit1 == -1 || digit2 == -1) {\n throw URLDecodeException(\n \"Wrong HEX escape: %${this[index + 1]}${this[index + 2]}, in $this, at $index\"\n )\n }\n\n bytes[count++] = (digit1 * 16 + digit2).toByte()\n index += 3\n }\n\n // Decode chars from bytes and put into StringBuilder\n // Note: Tried using ByteBuffer and using enc.decode() – it's slower\n sb.append(String(bytes, offset = 0, length = count, charset = charset))\n }\n else -> {\n sb.append(c)\n index++\n }\n }\n }\n\n return sb.toString()\n}\n\n/**\n * URL decoder exception\n */\npublic class URLDecodeException(message: String) : Exception(message)\n\nprivate fun Byte.percentEncode(): String {\n val code = toInt() and 0xff\n val array = CharArray(3)\n array[0] = '%'\n array[1] = hexDigitToChar(code shr 4)\n array[2] = hexDigitToChar(code and 0xf)\n return array.concatToString()\n}\n\nprivate fun charToHexDigit(c2: Char) = when (c2) {\n in '0'..'9' -> c2 - '0'\n in 'A'..'F' -> c2 - 'A' + 10\n in 'a'..'f' -> c2 - 'a' + 10\n else -> -1\n}\n\nprivate fun hexDigitToChar(digit: Int): Char = when (digit) {\n in 0..9 -> '0' + digit\n else -> 'A' + digit - 10\n}\n\nprivate fun ByteReadPacket.forEach(block: (Byte) -> Unit) {\n takeWhile { buffer ->\n while (buffer.canRead()) {\n block(buffer.readByte())\n }\n true\n }\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http\n\n/**\n * Represents `Content-Disposition` header value\n */\npublic class ContentDisposition(\n disposition: String,\n parameters: List = emptyList()\n) : HeaderValueWithParameters(disposition, parameters) {\n /**\n * Content disposition value without parameters\n */\n public val disposition: String get() = content\n\n /**\n * Content disposition name (from parameter named `name`)\n */\n public val name: String?\n get() = parameter(Parameters.Name)\n\n /**\n * Creates new with parameter appended.\n */\n public fun withParameter(key: String, value: String, encodeValue: Boolean = true): ContentDisposition {\n val encodedValue = if (encodeValue) {\n encodeContentDispositionAttribute(key, value)\n } else value\n\n return ContentDisposition(disposition, parameters + HeaderValueParam(key, encodedValue))\n }\n\n /**\n * Creates new with parameters appended\n */\n public fun withParameters(newParameters: List): ContentDisposition =\n ContentDisposition(disposition, parameters + newParameters)\n\n override fun equals(other: Any?): Boolean =\n other is ContentDisposition &&\n disposition == other.disposition &&\n parameters == other.parameters\n\n override fun hashCode(): Int = disposition.hashCode() * 31 + parameters.hashCode()\n\n @Suppress(\"unused\", \"PublicApiImplicitType\")\n public companion object {\n /**\n * `Content-Disposition: file`\n */\n public val File: ContentDisposition = ContentDisposition(\"file\")\n\n /**\n * `Content-Disposition: mixed`\n */\n public val Mixed: ContentDisposition = ContentDisposition(\"mixed\")\n\n /**\n * `Content-Disposition: attachment`\n */\n public val Attachment: ContentDisposition = ContentDisposition(\"attachment\")\n\n /**\n * `Content-Disposition: inline`\n */\n public val Inline: ContentDisposition = ContentDisposition(\"inline\")\n\n /**\n * Parse `Content-Disposition` header [value]\n */\n public fun parse(value: String): ContentDisposition = parse(value) { v, p -> ContentDisposition(v, p) }\n }\n\n /**\n * Frequently used content disposition parameter names\n */\n @Suppress(\"KDocMissingDocumentation\", \"unused\", \"PublicApiImplicitType\")\n public object Parameters {\n public const val FileName: String = \"filename\"\n public const val FileNameAsterisk: String = \"filename*\"\n public const val Name: String = \"name\"\n public const val CreationDate: String = \"creation-date\"\n public const val ModificationDate: String = \"modification-date\"\n public const val ReadDate: String = \"read-date\"\n public const val Size: String = \"size\"\n public const val Handling: String = \"handling\"\n }\n}\n\nprivate fun encodeContentDispositionAttribute(key: String, value: String): String {\n if (key != ContentDisposition.Parameters.FileNameAsterisk) return value\n if (value.startsWith(\"utf-8''\", ignoreCase = true)) return value\n if (value.all { it in ATTRIBUTE_CHARACTERS }) return value\n\n val encodedValue = value.percentEncode(ATTRIBUTE_CHARACTERS)\n return \"utf-8''$encodedValue\"\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http\n\nimport io.ktor.util.*\n\n/** Separator symbols listed in RFC https://tools.ietf.org/html/rfc2616#section-2.2 */\nprivate val HeaderFieldValueSeparators =\n setOf('(', ')', '<', '>', '@', ',', ';', ':', '\\\\', '\\\"', '/', '[', ']', '?', '=', '{', '}', ' ', '\\t', '\\n', '\\r')\n\n/**\n * Represents a header value that consist of [content] followed by [parameters].\n * Useful for headers such as `Content-Type`, `Content-Disposition` and so on.\n *\n * @property content header's content without parameters\n * @property parameters\n */\npublic abstract class HeaderValueWithParameters(\n protected val content: String,\n public val parameters: List = emptyList()\n) {\n\n /**\n * The first value for the parameter with [name] comparing case-insensitively or `null` if no such parameters found\n */\n public fun parameter(name: String): String? {\n for (index in 0..parameters.lastIndex) {\n val parameter = parameters[index]\n\n if (parameter.name.equals(name, ignoreCase = true)) {\n return parameter.value\n }\n }\n\n return null\n }\n\n override fun toString(): String = when {\n parameters.isEmpty() -> content\n else -> {\n val size = content.length + parameters.sumOf { it.name.length + it.value.length + 3 }\n\n StringBuilder(size).apply {\n append(content)\n for (index in 0..parameters.lastIndex) {\n val element = parameters[index]\n append(\"; \")\n append(element.name)\n append(\"=\")\n element.value.escapeIfNeededTo(this)\n }\n }.toString()\n }\n }\n\n public companion object {\n /**\n * Parse header with parameter and pass it to [init] function to instantiate particular type\n */\n public inline fun parse(value: String, init: (String, List) -> R): R {\n val headerValue = parseHeaderValue(value).last()\n return init(headerValue.value, headerValue.params)\n }\n }\n}\n\n/**\n * Append formatted header value to the builder\n */\npublic fun StringValuesBuilder.append(name: String, value: HeaderValueWithParameters) {\n append(name, value.toString())\n}\n\n/**\n * Escape using double quotes if needed or keep as is if no dangerous strings found\n */\npublic fun String.escapeIfNeeded(): String = when {\n needQuotes() -> quote()\n else -> this\n}\n\n@Suppress(\"NOTHING_TO_INLINE\")\nprivate inline fun String.escapeIfNeededTo(out: StringBuilder) {\n when {\n needQuotes() -> out.append(quote())\n else -> out.append(this)\n }\n}\n\nprivate fun String.needQuotes(): Boolean {\n if (isEmpty()) return true\n if (isQuoted()) return false\n\n for (index in 0 until length) {\n if (HeaderFieldValueSeparators.contains(this[index])) return true\n }\n\n return false\n}\n\nprivate fun String.isQuoted(): Boolean {\n if (length < 2) {\n return false\n }\n if (first() != '\"' || last() != '\"') {\n return false\n }\n var startIndex = 1\n do {\n val index = indexOf('\"', startIndex)\n if (index == lastIndex) {\n break\n }\n\n var slashesCount = 0\n var slashIndex = index - 1\n while (this[slashIndex] == '\\\\') {\n slashesCount++\n slashIndex--\n }\n if (slashesCount % 2 == 0) {\n return false\n }\n\n startIndex = index + 1\n } while (startIndex < length)\n\n return true\n}\n\n/**\n * Escape string using double quotes\n */\npublic fun String.quote(): String = buildString { this@quote.quoteTo(this) }\n\nprivate fun String.quoteTo(out: StringBuilder) {\n out.append(\"\\\"\")\n for (i in 0 until length) {\n when (val ch = this[i]) {\n '\\\\' -> out.append(\"\\\\\\\\\")\n '\\n' -> out.append(\"\\\\n\")\n '\\r' -> out.append(\"\\\\r\")\n '\\t' -> out.append(\"\\\\t\")\n '\\\"' -> out.append(\"\\\\\\\"\")\n else -> out.append(ch)\n }\n }\n out.append(\"\\\"\")\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http\n\nimport io.ktor.utils.io.charsets.*\n\n/**\n * Represents a value for a `Content-Type` header.\n * @property contentType represents a type part of the media type.\n * @property contentSubtype represents a subtype part of the media type.\n */\npublic class ContentType private constructor(\n public val contentType: String,\n public val contentSubtype: String,\n existingContent: String,\n parameters: List = emptyList()\n) : HeaderValueWithParameters(existingContent, parameters) {\n\n public constructor(\n contentType: String,\n contentSubtype: String,\n parameters: List = emptyList()\n ) : this(\n contentType,\n contentSubtype,\n \"$contentType/$contentSubtype\",\n parameters\n )\n\n /**\n * Creates a copy of `this` type with the added parameter with the [name] and [value].\n */\n public fun withParameter(name: String, value: String): ContentType {\n if (hasParameter(name, value)) return this\n\n return ContentType(contentType, contentSubtype, content, parameters + HeaderValueParam(name, value))\n }\n\n private fun hasParameter(name: String, value: String): Boolean = when (parameters.size) {\n 0 -> false\n 1 -> parameters[0].let { it.name.equals(name, ignoreCase = true) && it.value.equals(value, ignoreCase = true) }\n else -> parameters.any { it.name.equals(name, ignoreCase = true) && it.value.equals(value, ignoreCase = true) }\n }\n\n /**\n * Creates a copy of `this` type without any parameters\n */\n public fun withoutParameters(): ContentType = when {\n parameters.isEmpty() -> this\n else -> ContentType(contentType, contentSubtype)\n }\n\n /**\n * Checks if `this` type matches a [pattern] type taking into account placeholder symbols `*` and parameters.\n */\n public fun match(pattern: ContentType): Boolean {\n if (pattern.contentType != \"*\" && !pattern.contentType.equals(contentType, ignoreCase = true)) {\n return false\n }\n\n if (pattern.contentSubtype != \"*\" && !pattern.contentSubtype.equals(contentSubtype, ignoreCase = true)) {\n return false\n }\n\n for ((patternName, patternValue) in pattern.parameters) {\n val matches = when (patternName) {\n \"*\" -> {\n when (patternValue) {\n \"*\" -> true\n else -> parameters.any { p -> p.value.equals(patternValue, ignoreCase = true) }\n }\n }\n\n else -> {\n val value = parameter(patternName)\n when (patternValue) {\n \"*\" -> value != null\n else -> value.equals(patternValue, ignoreCase = true)\n }\n }\n }\n\n if (!matches) {\n return false\n }\n }\n return true\n }\n\n /**\n * Checks if `this` type matches a [pattern] type taking into account placeholder symbols `*` and parameters.\n */\n public fun match(pattern: String): Boolean = match(parse(pattern))\n\n override fun equals(other: Any?): Boolean =\n other is ContentType &&\n contentType.equals(other.contentType, ignoreCase = true) &&\n contentSubtype.equals(other.contentSubtype, ignoreCase = true) &&\n parameters == other.parameters\n\n override fun hashCode(): Int {\n var result = contentType.lowercase().hashCode()\n result += 31 * result + contentSubtype.lowercase().hashCode()\n result += 31 * parameters.hashCode()\n return result\n }\n\n public companion object {\n /**\n * Parses a string representing a `Content-Type` header into a [ContentType] instance.\n */\n public fun parse(value: String): ContentType {\n if (value.isBlank()) return Any\n\n return parse(value) { parts, parameters ->\n val slash = parts.indexOf('/')\n\n if (slash == -1) {\n if (parts.trim() == \"*\") return Any\n\n throw BadContentTypeFormatException(value)\n }\n\n val type = parts.substring(0, slash).trim()\n\n if (type.isEmpty()) {\n throw BadContentTypeFormatException(value)\n }\n\n val subtype = parts.substring(slash + 1).trim()\n\n if (type.contains(' ') || subtype.contains(' ')) {\n throw BadContentTypeFormatException(value)\n }\n\n if (subtype.isEmpty() || subtype.contains('/')) {\n throw BadContentTypeFormatException(value)\n }\n\n ContentType(type, subtype, parameters)\n }\n }\n\n /**\n * Represents a pattern `* / *` to match any content type.\n */\n public val Any: ContentType = ContentType(\"*\", \"*\")\n }\n\n /**\n * Provides a list of standard subtypes of an `application` content type.\n */\n @Suppress(\"KDocMissingDocumentation\", \"unused\")\n public object Application {\n /**\n * Represents a pattern `application / *` to match any application content type.\n */\n public val Any: ContentType = ContentType(\"application\", \"*\")\n public val Atom: ContentType = ContentType(\"application\", \"atom+xml\")\n public val Cbor: ContentType = ContentType(\"application\", \"cbor\")\n public val Json: ContentType = ContentType(\"application\", \"json\")\n public val HalJson: ContentType = ContentType(\"application\", \"hal+json\")\n public val JavaScript: ContentType = ContentType(\"application\", \"javascript\")\n public val OctetStream: ContentType = ContentType(\"application\", \"octet-stream\")\n public val FontWoff: ContentType = ContentType(\"application\", \"font-woff\")\n public val Rss: ContentType = ContentType(\"application\", \"rss+xml\")\n public val Xml: ContentType = ContentType(\"application\", \"xml\")\n public val Xml_Dtd: ContentType = ContentType(\"application\", \"xml-dtd\")\n public val Zip: ContentType = ContentType(\"application\", \"zip\")\n public val GZip: ContentType = ContentType(\"application\", \"gzip\")\n\n public val FormUrlEncoded: ContentType =\n ContentType(\"application\", \"x-www-form-urlencoded\")\n\n public val Pdf: ContentType = ContentType(\"application\", \"pdf\")\n public val Xlsx: ContentType = ContentType(\n \"application\",\n \"vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n )\n public val Docx: ContentType = ContentType(\n \"application\",\n \"vnd.openxmlformats-officedocument.wordprocessingml.document\"\n )\n public val Pptx: ContentType = ContentType(\n \"application\",\n \"vnd.openxmlformats-officedocument.presentationml.presentation\"\n )\n public val ProtoBuf: ContentType = ContentType(\"application\", \"protobuf\")\n public val Wasm: ContentType = ContentType(\"application\", \"wasm\")\n public val ProblemJson: ContentType = ContentType(\"application\", \"problem+json\")\n public val ProblemXml: ContentType = ContentType(\"application\", \"problem+xml\")\n }\n\n /**\n * Provides a list of standard subtypes of an `audio` content type.\n */\n @Suppress(\"KDocMissingDocumentation\", \"unused\")\n public object Audio {\n public val Any: ContentType = ContentType(\"audio\", \"*\")\n public val MP4: ContentType = ContentType(\"audio\", \"mp4\")\n public val MPEG: ContentType = ContentType(\"audio\", \"mpeg\")\n public val OGG: ContentType = ContentType(\"audio\", \"ogg\")\n }\n\n /**\n * Provides a list of standard subtypes of an `image` content type.\n */\n @Suppress(\"KDocMissingDocumentation\", \"unused\")\n public object Image {\n public val Any: ContentType = ContentType(\"image\", \"*\")\n public val GIF: ContentType = ContentType(\"image\", \"gif\")\n public val JPEG: ContentType = ContentType(\"image\", \"jpeg\")\n public val PNG: ContentType = ContentType(\"image\", \"png\")\n public val SVG: ContentType = ContentType(\"image\", \"svg+xml\")\n public val XIcon: ContentType = ContentType(\"image\", \"x-icon\")\n }\n\n /**\n * Provides a list of standard subtypes of a `message` content type.\n */\n @Suppress(\"KDocMissingDocumentation\", \"unused\")\n public object Message {\n public val Any: ContentType = ContentType(\"message\", \"*\")\n public val Http: ContentType = ContentType(\"message\", \"http\")\n }\n\n /**\n * Provides a list of standard subtypes of a `multipart` content type.\n */\n @Suppress(\"KDocMissingDocumentation\", \"unused\")\n public object MultiPart {\n public val Any: ContentType = ContentType(\"multipart\", \"*\")\n public val Mixed: ContentType = ContentType(\"multipart\", \"mixed\")\n public val Alternative: ContentType = ContentType(\"multipart\", \"alternative\")\n public val Related: ContentType = ContentType(\"multipart\", \"related\")\n public val FormData: ContentType = ContentType(\"multipart\", \"form-data\")\n public val Signed: ContentType = ContentType(\"multipart\", \"signed\")\n public val Encrypted: ContentType = ContentType(\"multipart\", \"encrypted\")\n public val ByteRanges: ContentType = ContentType(\"multipart\", \"byteranges\")\n }\n\n /**\n * Provides a list of standard subtypes of a `text` content type.\n */\n @Suppress(\"KDocMissingDocumentation\", \"unused\")\n public object Text {\n public val Any: ContentType = ContentType(\"text\", \"*\")\n public val Plain: ContentType = ContentType(\"text\", \"plain\")\n public val CSS: ContentType = ContentType(\"text\", \"css\")\n public val CSV: ContentType = ContentType(\"text\", \"csv\")\n public val Html: ContentType = ContentType(\"text\", \"html\")\n public val JavaScript: ContentType = ContentType(\"text\", \"javascript\")\n public val VCard: ContentType = ContentType(\"text\", \"vcard\")\n public val Xml: ContentType = ContentType(\"text\", \"xml\")\n public val EventStream: ContentType = ContentType(\"text\", \"event-stream\")\n }\n\n /**\n * Provides a list of standard subtypes of a `video` content type.\n */\n @Suppress(\"KDocMissingDocumentation\", \"unused\")\n public object Video {\n public val Any: ContentType = ContentType(\"video\", \"*\")\n public val MPEG: ContentType = ContentType(\"video\", \"mpeg\")\n public val MP4: ContentType = ContentType(\"video\", \"mp4\")\n public val OGG: ContentType = ContentType(\"video\", \"ogg\")\n public val QuickTime: ContentType = ContentType(\"video\", \"quicktime\")\n }\n}\n\n/**\n * Exception thrown when a content type string is malformed.\n */\npublic class BadContentTypeFormatException(value: String) : Exception(\"Bad Content-Type format: $value\")\n\n/**\n * Creates a copy of `this` type with the added charset parameter with [charset] value.\n */\npublic fun ContentType.withCharset(charset: Charset): ContentType =\n withParameter(\"charset\", charset.name)\n\n/**\n * Creates a copy of `this` type with the added charset parameter with [charset] value\n * if [ContentType] is not ignored\n */\npublic fun ContentType.withCharsetIfNeeded(charset: Charset): ContentType =\n if (contentType.lowercase() == \"application\" && contentSubtype.lowercase() == \"json\") {\n this\n } else {\n withParameter(\"charset\", charset.name)\n }\n\n/**\n * Extracts a [Charset] value from the given `Content-Type`, `Content-Disposition` or similar header value.\n */\npublic fun HeaderValueWithParameters.charset(): Charset? = parameter(\"charset\")?.let {\n try {\n Charset.forName(it)\n } catch (exception: IllegalArgumentException) {\n null\n }\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http\n\nimport io.ktor.util.date.*\nimport kotlin.native.concurrent.*\n\nprivate val HTTP_DATE_FORMATS = listOf(\n \"***, dd MMM YYYY hh:mm:ss zzz\",\n \"****, dd-MMM-YYYY hh:mm:ss zzz\",\n \"*** MMM d hh:mm:ss YYYY\",\n \"***, dd-MMM-YYYY hh:mm:ss zzz\",\n \"***, dd-MMM-YYYY hh-mm-ss zzz\",\n \"***, dd MMM YYYY hh:mm:ss zzz\",\n \"*** dd-MMM-YYYY hh:mm:ss zzz\",\n \"*** dd MMM YYYY hh:mm:ss zzz\",\n \"*** dd-MMM-YYYY hh-mm-ss zzz\",\n \"***,dd-MMM-YYYY hh:mm:ss zzz\",\n \"*** MMM d YYYY hh:mm:ss zzz\"\n)\n\n/**\n * Convert valid http date [String] to [GMTDate] trying various http date formats from [HTTP_DATE_FORMATS]\n *\n * Note that only GMT(UTC) date is valid http date.\n */\npublic fun String.fromHttpToGmtDate(): GMTDate = with(trim()) {\n for (format in HTTP_DATE_FORMATS) {\n try {\n val parser = GMTDateParser(format)\n return parser.parse(this@fromHttpToGmtDate)\n } catch (_: InvalidDateStringException) {\n }\n }\n\n error(\"Failed to parse date: $this\")\n}\n\n/**\n * Convert valid cookie date [String] to [GMTDate] trying first the RFC6265 standard, falling back on [fromHttpToGmtDate]\n *\n * @see [fromHttpToGmtDate]\n */\npublic fun String.fromCookieToGmtDate(): GMTDate = with(trim()) {\n try {\n val parser = CookieDateParser()\n return parser.parse(this@with)\n } catch (_: InvalidCookieDateException) {\n }\n\n return fromHttpToGmtDate()\n}\n\n/**\n * Convert [GMTDate] to valid http date [String]\n */\npublic fun GMTDate.toHttpDate(): String = buildString {\n append(\"${dayOfWeek.value}, \")\n append(\"${dayOfMonth.padZero(2)} \")\n append(\"${month.value} \")\n append(year.padZero(4))\n append(\" ${hours.padZero(2)}:${minutes.padZero(2)}:${seconds.padZero(2)} \")\n append(\"GMT\")\n}\n\nprivate fun Int.padZero(length: Int): String = toString().padStart(length, '0')\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http\n\nimport io.ktor.util.*\nimport io.ktor.utils.io.charsets.*\n\n/**\n * Default [ContentType] for [extension]\n */\npublic fun ContentType.Companion.defaultForFileExtension(extension: String): ContentType =\n ContentType.fromFileExtension(extension).selectDefault()\n\n/**\n * Default [ContentType] for file [path]\n */\npublic fun ContentType.Companion.defaultForFilePath(path: String): ContentType =\n ContentType.fromFilePath(path).selectDefault()\n\n/**\n * Recommended content types by file [path]\n */\npublic fun ContentType.Companion.fromFilePath(path: String): List {\n val slashIndex = path.lastIndexOfAny(\"/\\\\\".toCharArray())\n val index = path.indexOf('.', startIndex = slashIndex + 1)\n if (index == -1) {\n return emptyList()\n }\n return fromFileExtension(path.substring(index + 1))\n}\n\n/**\n * Recommended content type by file name extension\n */\npublic fun ContentType.Companion.fromFileExtension(ext: String): List {\n var current = ext.removePrefix(\".\").toLowerCasePreservingASCIIRules()\n while (current.isNotEmpty()) {\n val type = contentTypesByExtensions[current]\n if (type != null) {\n return type\n }\n current = current.substringAfter(\".\", \"\")\n }\n\n return emptyList()\n}\n\n/**\n * Recommended file name extensions for this content type\n */\npublic fun ContentType.fileExtensions(): List = extensionsByContentType[this]\n ?: extensionsByContentType[this.withoutParameters()]\n ?: emptyList()\n\nprivate val contentTypesByExtensions: Map> by lazy {\n caseInsensitiveMap>().apply { putAll(mimes.asSequence().groupByPairs()) }\n}\n\nprivate val extensionsByContentType: Map> by lazy {\n mimes.asSequence().map { (first, second) -> second to first }.groupByPairs()\n}\n\ninternal fun List.selectDefault(): ContentType {\n val contentType = firstOrNull() ?: ContentType.Application.OctetStream\n return when {\n contentType.contentType == \"text\" && contentType.charset() == null -> contentType.withCharset(Charsets.UTF_8)\n else -> contentType\n }\n}\n\ninternal fun Sequence>.groupByPairs() = groupBy { it.first }\n .mapValues { e -> e.value.map { it.second } }\n\ninternal fun String.toContentType() = try {\n ContentType.parse(this)\n} catch (e: Throwable) {\n throw IllegalArgumentException(\"Failed to parse $this\", e)\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http\n\nimport io.ktor.util.*\n\n/**\n * Represents HTTP headers as a map from case-insensitive names to collection of [String] values\n */\npublic interface Headers : StringValues {\n public companion object {\n /**\n * Empty [Headers] instance\n */\n @Suppress(\"DEPRECATION_ERROR\")\n public val Empty: Headers = EmptyHeaders\n\n /**\n * Builds a [Headers] instance with the given [builder] function\n * @param builder specifies a function to build a map\n */\n public inline fun build(builder: HeadersBuilder.() -> Unit): Headers = HeadersBuilder().apply(builder).build()\n }\n}\n\n@Suppress(\"KDocMissingDocumentation\")\npublic class HeadersBuilder(size: Int = 8) : StringValuesBuilderImpl(true, size) {\n override fun build(): Headers {\n return HeadersImpl(values)\n }\n\n override fun validateName(name: String) {\n super.validateName(name)\n HttpHeaders.checkHeaderName(name)\n }\n\n override fun validateValue(value: String) {\n super.validateValue(value)\n HttpHeaders.checkHeaderValue(value)\n }\n}\n\n@Suppress(\"KDocMissingDocumentation\")\n@Deprecated(\n \"Empty headers is internal\",\n replaceWith = ReplaceWith(\"Headers.Empty\"),\n level = DeprecationLevel.ERROR\n)\npublic object EmptyHeaders : Headers {\n override val caseInsensitiveName: Boolean get() = true\n override fun getAll(name: String): List? = null\n override fun names(): Set = emptySet()\n override fun entries(): Set>> = emptySet()\n override fun isEmpty(): Boolean = true\n override fun toString(): String = \"Headers ${entries()}\"\n}\n\n/**\n * Returns empty headers\n */\npublic fun headersOf(): Headers = Headers.Empty\n\n/**\n * Returns [Headers] instance containing only one header with the specified [name] and [value]\n */\npublic fun headersOf(name: String, value: String): Headers = HeadersSingleImpl(name, listOf(value))\n\n/**\n * Returns [Headers] instance containing only one header with the specified [name] and [values]\n */\npublic fun headersOf(name: String, values: List): Headers = HeadersSingleImpl(name, values)\n\n/**\n * Returns [Headers] instance from [pairs]\n */\npublic fun headersOf(vararg pairs: Pair>): Headers = HeadersImpl(pairs.asList().toMap())\n\n@Suppress(\"KDocMissingDocumentation\")\npublic class HeadersImpl(\n values: Map> = emptyMap()\n) : Headers, StringValuesImpl(true, values) {\n override fun toString(): String = \"Headers ${entries()}\"\n}\n\n@Suppress(\"KDocMissingDocumentation\")\npublic class HeadersSingleImpl(\n name: String,\n values: List\n) : Headers, StringValuesSingleImpl(true, name, values) {\n override fun toString(): String = \"Headers ${entries()}\"\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http\n\n/**\n * Represents a single value parameter\n * @property name of parameter\n * @property value of parameter\n * @property escapeValue specifies if the value should be escaped\n */\npublic data class HeaderValueParam(val name: String, val value: String, val escapeValue: Boolean) {\n\n public constructor(name: String, value: String) : this(name, value, false)\n\n override fun equals(other: Any?): Boolean {\n return other is HeaderValueParam &&\n other.name.equals(name, ignoreCase = true) &&\n other.value.equals(value, ignoreCase = true)\n }\n override fun hashCode(): Int {\n\n var result = name.lowercase().hashCode()\n result += 31 * result + value.lowercase().hashCode()\n return result\n }\n}\n\n/**\n * Represents a header value. Similar to [HeaderValueWithParameters]\n * @property value\n * @property params for this value (could be empty)\n */\npublic data class HeaderValue(val value: String, val params: List = emptyList()) {\n /**\n * Value's quality according to `q` parameter or `1.0` if missing or invalid\n */\n val quality: Double = params.firstOrNull { it.name == \"q\" }\n ?.value\n ?.toDoubleOrNull()\n ?.takeIf { it in 0.0..1.0 }\n ?: 1.0\n}\n\n/**\n * Parse header value and sort multiple values according to qualities\n */\npublic fun parseAndSortHeader(header: String?): List =\n parseHeaderValue(header).sortedByDescending { it.quality }\n\n/**\n * Parse `Content-Type` header values and sort them by quality and asterisks quantity\n */\npublic fun parseAndSortContentTypeHeader(header: String?): List = parseHeaderValue(header).sortedWith(\n compareByDescending { it.quality }.thenBy {\n val contentType = ContentType.parse(it.value)\n var asterisks = 0\n if (contentType.contentType == \"*\") {\n asterisks += 2\n }\n if (contentType.contentSubtype == \"*\") {\n asterisks++\n }\n asterisks\n }.thenByDescending { it.params.size }\n)\n\n/**\n * Parse header value respecting multi-values\n */\npublic fun parseHeaderValue(text: String?): List {\n return parseHeaderValue(text, false)\n}\n\n/**\n * Parse header value respecting multi-values\n * @param parametersOnly if no header value itself, only parameters\n */\npublic fun parseHeaderValue(text: String?, parametersOnly: Boolean): List {\n if (text == null) {\n return emptyList()\n }\n\n var position = 0\n val items = lazy(LazyThreadSafetyMode.NONE) { arrayListOf() }\n while (position <= text.lastIndex) {\n position = parseHeaderValueItem(text, position, items, parametersOnly)\n }\n return items.valueOrEmpty()\n}\n\n/**\n * Construct a list of [HeaderValueParam] from an iterable of pairs\n */\npublic fun Iterable>.toHeaderParamsList(): List =\n map { HeaderValueParam(it.first, it.second) }\n\nprivate fun Lazy>.valueOrEmpty(): List = if (isInitialized()) value else emptyList()\nprivate fun String.subtrim(start: Int, end: Int): String {\n return substring(start, end).trim()\n}\n\nprivate fun parseHeaderValueItem(\n text: String,\n start: Int,\n items: Lazy>,\n parametersOnly: Boolean\n): Int {\n var position = start\n val parameters = lazy(LazyThreadSafetyMode.NONE) { arrayListOf() }\n var valueEnd: Int? = if (parametersOnly) position else null\n\n while (position <= text.lastIndex) {\n when (text[position]) {\n ',' -> {\n items.value.add(HeaderValue(text.subtrim(start, valueEnd ?: position), parameters.valueOrEmpty()))\n return position + 1\n }\n\n ';' -> {\n if (valueEnd == null) valueEnd = position\n position = parseHeaderValueParameter(text, position + 1, parameters)\n }\n\n else -> {\n position = if (parametersOnly) {\n parseHeaderValueParameter(text, position, parameters)\n } else {\n position + 1\n }\n }\n }\n }\n\n items.value.add(HeaderValue(text.subtrim(start, valueEnd ?: position), parameters.valueOrEmpty()))\n return position\n}\n\nprivate fun parseHeaderValueParameter(text: String, start: Int, parameters: Lazy>): Int {\n fun addParam(text: String, start: Int, end: Int, value: String) {\n val name = text.subtrim(start, end)\n if (name.isEmpty()) {\n return\n }\n\n parameters.value.add(HeaderValueParam(name, value))\n }\n\n var position = start\n while (position <= text.lastIndex) {\n when (text[position]) {\n '=' -> {\n val (paramEnd, paramValue) = parseHeaderValueParameterValue(text, position + 1)\n addParam(text, start, position, paramValue)\n return paramEnd\n }\n\n ';', ',' -> {\n addParam(text, start, position, \"\")\n return position\n }\n\n else -> position++\n }\n }\n\n addParam(text, start, position, \"\")\n return position\n}\n\nprivate fun parseHeaderValueParameterValue(value: String, start: Int): Pair {\n if (value.length == start) {\n return start to \"\"\n }\n\n var position = start\n if (value[start] == '\"') {\n return parseHeaderValueParameterValueQuoted(value, position + 1)\n }\n\n while (position <= value.lastIndex) {\n when (value[position]) {\n ';', ',' -> return position to value.subtrim(start, position)\n else -> position++\n }\n }\n return position to value.subtrim(start, position)\n}\n\nprivate fun parseHeaderValueParameterValueQuoted(value: String, start: Int): Pair {\n var position = start\n val builder = StringBuilder()\n loop@ while (position <= value.lastIndex) {\n val currentChar = value[position]\n\n when {\n currentChar == '\"' && value.nextIsSemicolonOrEnd(position) -> {\n return position + 1 to builder.toString()\n }\n\n currentChar == '\\\\' && position < value.lastIndex - 2 -> {\n builder.append(value[position + 1])\n position += 2\n continue@loop\n }\n }\n\n builder.append(currentChar)\n position++\n }\n\n // The value is unquoted here\n return position to '\"' + builder.toString()\n}\n\nprivate fun String.nextIsSemicolonOrEnd(start: Int): Boolean {\n var position = start + 1\n loop@ while (position < length && get(position) == ' ') {\n position += 1\n }\n\n return position == length || get(position) == ';'\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http\n\n@Suppress(\"unused\", \"KDocMissingDocumentation\", \"PublicApiImplicitType\", \"MayBeConstant\")\npublic object HttpHeaders {\n // Permanently registered standard HTTP headers\n // The list is taken from http://www.iana.org/assignments/message-headers/message-headers.xml#perm-headers\n\n public val Accept: String = \"Accept\"\n public val AcceptCharset: String = \"Accept-Charset\"\n public val AcceptEncoding: String = \"Accept-Encoding\"\n public val AcceptLanguage: String = \"Accept-Language\"\n public val AcceptRanges: String = \"Accept-Ranges\"\n public val Age: String = \"Age\"\n public val Allow: String = \"Allow\"\n\n // Application-Layer Protocol Negotiation, HTTP/2\n public val ALPN: String = \"ALPN\"\n public val AuthenticationInfo: String = \"Authentication-Info\"\n public val Authorization: String = \"Authorization\"\n public val CacheControl: String = \"Cache-Control\"\n public val Connection: String = \"Connection\"\n public val ContentDisposition: String = \"Content-Disposition\"\n public val ContentEncoding: String = \"Content-Encoding\"\n public val ContentLanguage: String = \"Content-Language\"\n public val ContentLength: String = \"Content-Length\"\n public val ContentLocation: String = \"Content-Location\"\n public val ContentRange: String = \"Content-Range\"\n public val ContentType: String = \"Content-Type\"\n public val Cookie: String = \"Cookie\"\n\n // WebDAV Search\n public val DASL: String = \"DASL\"\n public val Date: String = \"Date\"\n\n // WebDAV\n public val DAV: String = \"DAV\"\n public val Depth: String = \"Depth\"\n\n public val Destination: String = \"Destination\"\n public val ETag: String = \"ETag\"\n public val Expect: String = \"Expect\"\n public val Expires: String = \"Expires\"\n public val From: String = \"From\"\n public val Forwarded: String = \"Forwarded\"\n public val Host: String = \"Host\"\n public val HTTP2Settings: String = \"HTTP2-Settings\"\n public val If: String = \"If\"\n public val IfMatch: String = \"If-Match\"\n public val IfModifiedSince: String = \"If-Modified-Since\"\n public val IfNoneMatch: String = \"If-None-Match\"\n public val IfRange: String = \"If-Range\"\n public val IfScheduleTagMatch: String = \"If-Schedule-Tag-Match\"\n public val IfUnmodifiedSince: String = \"If-Unmodified-Since\"\n public val LastModified: String = \"Last-Modified\"\n public val Location: String = \"Location\"\n public val LockToken: String = \"Lock-Token\"\n public val Link: String = \"Link\"\n public val MaxForwards: String = \"Max-Forwards\"\n public val MIMEVersion: String = \"MIME-Version\"\n public val OrderingType: String = \"Ordering-Type\"\n public val Origin: String = \"Origin\"\n public val Overwrite: String = \"Overwrite\"\n public val Position: String = \"Position\"\n public val Pragma: String = \"Pragma\"\n public val Prefer: String = \"Prefer\"\n public val PreferenceApplied: String = \"Preference-Applied\"\n public val ProxyAuthenticate: String = \"Proxy-Authenticate\"\n public val ProxyAuthenticationInfo: String = \"Proxy-Authentication-Info\"\n public val ProxyAuthorization: String = \"Proxy-Authorization\"\n public val PublicKeyPins: String = \"Public-Key-Pins\"\n public val PublicKeyPinsReportOnly: String = \"Public-Key-Pins-Report-Only\"\n public val Range: String = \"Range\"\n public val Referrer: String = \"Referer\"\n public val RetryAfter: String = \"Retry-After\"\n public val ScheduleReply: String = \"Schedule-Reply\"\n public val ScheduleTag: String = \"Schedule-Tag\"\n public val SecWebSocketAccept: String = \"Sec-WebSocket-Accept\"\n public val SecWebSocketExtensions: String = \"Sec-WebSocket-Extensions\"\n public val SecWebSocketKey: String = \"Sec-WebSocket-Key\"\n public val SecWebSocketProtocol: String = \"Sec-WebSocket-Protocol\"\n public val SecWebSocketVersion: String = \"Sec-WebSocket-Version\"\n public val Server: String = \"Server\"\n public val SetCookie: String = \"Set-Cookie\"\n\n // Atom Publishing\n public val SLUG: String = \"SLUG\"\n public val StrictTransportSecurity: String = \"Strict-Transport-Security\"\n public val TE: String = \"TE\"\n public val Timeout: String = \"Timeout\"\n public val Trailer: String = \"Trailer\"\n public val TransferEncoding: String = \"Transfer-Encoding\"\n public val Upgrade: String = \"Upgrade\"\n public val UserAgent: String = \"User-Agent\"\n public val Vary: String = \"Vary\"\n public val Via: String = \"Via\"\n public val Warning: String = \"Warning\"\n public val WWWAuthenticate: String = \"WWW-Authenticate\"\n\n // CORS\n public val AccessControlAllowOrigin: String = \"Access-Control-Allow-Origin\"\n public val AccessControlAllowMethods: String = \"Access-Control-Allow-Methods\"\n public val AccessControlAllowCredentials: String = \"Access-Control-Allow-Credentials\"\n public val AccessControlAllowHeaders: String = \"Access-Control-Allow-Headers\"\n\n public val AccessControlRequestMethod: String = \"Access-Control-Request-Method\"\n public val AccessControlRequestHeaders: String = \"Access-Control-Request-Headers\"\n public val AccessControlExposeHeaders: String = \"Access-Control-Expose-Headers\"\n public val AccessControlMaxAge: String = \"Access-Control-Max-Age\"\n\n // Unofficial de-facto headers\n public val XHttpMethodOverride: String = \"X-Http-Method-Override\"\n public val XForwardedHost: String = \"X-Forwarded-Host\"\n public val XForwardedServer: String = \"X-Forwarded-Server\"\n public val XForwardedProto: String = \"X-Forwarded-Proto\"\n public val XForwardedFor: String = \"X-Forwarded-For\"\n\n public val XForwardedPort: String = \"X-Forwarded-Port\"\n\n public val XRequestId: String = \"X-Request-ID\"\n public val XCorrelationId: String = \"X-Correlation-ID\"\n public val XTotalCount: String = \"X-Total-Count\"\n\n /**\n * Check if [header] is unsafe. Header is unsafe if listed in [UnsafeHeadersList]\n */\n public fun isUnsafe(header: String): Boolean = UnsafeHeadersArray.any { it.equals(header, ignoreCase = true) }\n\n private val UnsafeHeadersArray: Array = arrayOf(TransferEncoding, Upgrade)\n\n @Deprecated(\"Use UnsafeHeadersList instead.\", replaceWith = ReplaceWith(\"HttpHeaders.UnsafeHeadersList\"))\n public val UnsafeHeaders: Array\n get() = UnsafeHeadersArray.copyOf()\n\n /**\n * A list of header names that are not safe to use unless it is low-level engine implementation.\n */\n public val UnsafeHeadersList: List = UnsafeHeadersArray.asList()\n\n /**\n * Validates header [name] throwing [IllegalHeaderNameException] when the name is not valid.\n */\n public fun checkHeaderName(name: String) {\n name.forEachIndexed { index, ch ->\n if (ch <= ' ' || isDelimiter(ch)) {\n throw IllegalHeaderNameException(name, index)\n }\n }\n }\n\n /**\n * Validates header [value] throwing [IllegalHeaderValueException] when the value is not valid.\n */\n public fun checkHeaderValue(value: String) {\n value.forEachIndexed { index, ch ->\n if (ch == ' ' || ch == '\\u0009') return@forEachIndexed\n if (ch < ' ') {\n throw IllegalHeaderValueException(value, index)\n }\n }\n }\n}\n\n/**\n * Thrown when an attempt to set unsafe header detected. A header is unsafe if listed in [HttpHeaders.UnsafeHeadersList].\n */\npublic class UnsafeHeaderException(header: String) : IllegalArgumentException(\n \"Header(s) $header are controlled by the engine and \" +\n \"cannot be set explicitly\"\n)\n\n/**\n * Thrown when an illegal header name was used.\n * A header name should only consist from visible characters\n * without delimiters \"double quote\" and the following characters: `(),/:;<=>?@[\\]{}`.\n * @property headerName that was tried to use\n * @property position at which validation failed\n */\npublic class IllegalHeaderNameException(public val headerName: String, public val position: Int) :\n IllegalArgumentException(\n \"Header name '$headerName' contains illegal character '${headerName[position]}'\" +\n \" (code ${(headerName[position].code and 0xff)})\"\n )\n\n/**\n * Thrown when an illegal header value was used.\n * A header value should only consist from visible characters, spaces and/or HTAB (0x09).\n * @property headerValue that was tried to use\n * @property position at which validation failed\n */\npublic class IllegalHeaderValueException(public val headerValue: String, public val position: Int) :\n IllegalArgumentException(\n \"Header value '$headerValue' contains illegal character '${headerValue[position]}'\" +\n \" (code ${(headerValue[position].code and 0xff)})\"\n )\n\nprivate fun isDelimiter(ch: Char): Boolean = ch in \"\\\"(),/:;<=>?@[\\\\]{}\"\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http\n\n/**\n * Represents an HTTP method (verb)\n * @property value contains method name\n */\npublic data class HttpMethod(val value: String) {\n @Suppress(\"KDocMissingDocumentation\", \"PublicApiImplicitType\")\n public companion object {\n public val Get: HttpMethod = HttpMethod(\"GET\")\n public val Post: HttpMethod = HttpMethod(\"POST\")\n public val Put: HttpMethod = HttpMethod(\"PUT\")\n\n // https://tools.ietf.org/html/rfc5789\n public val Patch: HttpMethod = HttpMethod(\"PATCH\")\n public val Delete: HttpMethod = HttpMethod(\"DELETE\")\n public val Head: HttpMethod = HttpMethod(\"HEAD\")\n public val Options: HttpMethod = HttpMethod(\"OPTIONS\")\n\n /**\n * Parse HTTP method by [method] string\n */\n public fun parse(method: String): HttpMethod {\n return when (method) {\n Get.value -> Get\n Post.value -> Post\n Put.value -> Put\n Patch.value -> Patch\n Delete.value -> Delete\n Head.value -> Head\n Options.value -> Options\n else -> HttpMethod(method)\n }\n }\n\n /**\n * A list of default HTTP methods\n */\n public val DefaultMethods: List = listOf(Get, Post, Put, Patch, Delete, Head, Options)\n }\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http\n\n/**\n * Represents an HTTP status code and description.\n * @param value is a numeric code.\n * @param description is free form description of a status.\n */\n@Suppress(\"unused\")\npublic data class HttpStatusCode(val value: Int, val description: String) {\n override fun toString(): String = \"$value $description\"\n\n override fun equals(other: Any?): Boolean = other is HttpStatusCode && other.value == value\n\n override fun hashCode(): Int = value.hashCode()\n\n /**\n * Returns a copy of `this` code with a description changed to [value].\n */\n public fun description(value: String): HttpStatusCode = copy(description = value)\n\n @Suppress(\"KDocMissingDocumentation\", \"PublicApiImplicitType\")\n public companion object {\n // =============================================================================================================\n // Disclaimer\n // Adding a new status code here please remember [allStatusCodes] as well\n //\n\n public val Continue: HttpStatusCode = HttpStatusCode(100, \"Continue\")\n public val SwitchingProtocols: HttpStatusCode = HttpStatusCode(101, \"Switching Protocols\")\n public val Processing: HttpStatusCode = HttpStatusCode(102, \"Processing\")\n\n public val OK: HttpStatusCode = HttpStatusCode(200, \"OK\")\n public val Created: HttpStatusCode = HttpStatusCode(201, \"Created\")\n public val Accepted: HttpStatusCode = HttpStatusCode(202, \"Accepted\")\n\n public val NonAuthoritativeInformation: HttpStatusCode =\n HttpStatusCode(203, \"Non-Authoritative Information\")\n\n public val NoContent: HttpStatusCode = HttpStatusCode(204, \"No Content\")\n public val ResetContent: HttpStatusCode = HttpStatusCode(205, \"Reset Content\")\n public val PartialContent: HttpStatusCode = HttpStatusCode(206, \"Partial Content\")\n public val MultiStatus: HttpStatusCode = HttpStatusCode(207, \"Multi-Status\")\n\n public val MultipleChoices: HttpStatusCode = HttpStatusCode(300, \"Multiple Choices\")\n public val MovedPermanently: HttpStatusCode = HttpStatusCode(301, \"Moved Permanently\")\n public val Found: HttpStatusCode = HttpStatusCode(302, \"Found\")\n public val SeeOther: HttpStatusCode = HttpStatusCode(303, \"See Other\")\n public val NotModified: HttpStatusCode = HttpStatusCode(304, \"Not Modified\")\n public val UseProxy: HttpStatusCode = HttpStatusCode(305, \"Use Proxy\")\n public val SwitchProxy: HttpStatusCode = HttpStatusCode(306, \"Switch Proxy\")\n public val TemporaryRedirect: HttpStatusCode = HttpStatusCode(307, \"Temporary Redirect\")\n public val PermanentRedirect: HttpStatusCode = HttpStatusCode(308, \"Permanent Redirect\")\n\n public val BadRequest: HttpStatusCode = HttpStatusCode(400, \"Bad Request\")\n public val Unauthorized: HttpStatusCode = HttpStatusCode(401, \"Unauthorized\")\n public val PaymentRequired: HttpStatusCode = HttpStatusCode(402, \"Payment Required\")\n public val Forbidden: HttpStatusCode = HttpStatusCode(403, \"Forbidden\")\n public val NotFound: HttpStatusCode = HttpStatusCode(404, \"Not Found\")\n public val MethodNotAllowed: HttpStatusCode = HttpStatusCode(405, \"Method Not Allowed\")\n public val NotAcceptable: HttpStatusCode = HttpStatusCode(406, \"Not Acceptable\")\n\n public val ProxyAuthenticationRequired: HttpStatusCode =\n HttpStatusCode(407, \"Proxy Authentication Required\")\n\n public val RequestTimeout: HttpStatusCode = HttpStatusCode(408, \"Request Timeout\")\n public val Conflict: HttpStatusCode = HttpStatusCode(409, \"Conflict\")\n public val Gone: HttpStatusCode = HttpStatusCode(410, \"Gone\")\n public val LengthRequired: HttpStatusCode = HttpStatusCode(411, \"Length Required\")\n public val PreconditionFailed: HttpStatusCode = HttpStatusCode(412, \"Precondition Failed\")\n public val PayloadTooLarge: HttpStatusCode = HttpStatusCode(413, \"Payload Too Large\")\n public val RequestURITooLong: HttpStatusCode = HttpStatusCode(414, \"Request-URI Too Long\")\n\n public val UnsupportedMediaType: HttpStatusCode = HttpStatusCode(415, \"Unsupported Media Type\")\n\n public val RequestedRangeNotSatisfiable: HttpStatusCode =\n HttpStatusCode(416, \"Requested Range Not Satisfiable\")\n\n public val ExpectationFailed: HttpStatusCode = HttpStatusCode(417, \"Expectation Failed\")\n public val UnprocessableEntity: HttpStatusCode = HttpStatusCode(422, \"Unprocessable Entity\")\n public val Locked: HttpStatusCode = HttpStatusCode(423, \"Locked\")\n public val FailedDependency: HttpStatusCode = HttpStatusCode(424, \"Failed Dependency\")\n public val UpgradeRequired: HttpStatusCode = HttpStatusCode(426, \"Upgrade Required\")\n public val TooManyRequests: HttpStatusCode = HttpStatusCode(429, \"Too Many Requests\")\n\n public val RequestHeaderFieldTooLarge: HttpStatusCode =\n HttpStatusCode(431, \"Request Header Fields Too Large\")\n\n public val InternalServerError: HttpStatusCode = HttpStatusCode(500, \"Internal Server Error\")\n public val NotImplemented: HttpStatusCode = HttpStatusCode(501, \"Not Implemented\")\n public val BadGateway: HttpStatusCode = HttpStatusCode(502, \"Bad Gateway\")\n public val ServiceUnavailable: HttpStatusCode = HttpStatusCode(503, \"Service Unavailable\")\n public val GatewayTimeout: HttpStatusCode = HttpStatusCode(504, \"Gateway Timeout\")\n\n public val VersionNotSupported: HttpStatusCode =\n HttpStatusCode(505, \"HTTP Version Not Supported\")\n\n public val VariantAlsoNegotiates: HttpStatusCode = HttpStatusCode(506, \"Variant Also Negotiates\")\n public val InsufficientStorage: HttpStatusCode = HttpStatusCode(507, \"Insufficient Storage\")\n\n /**\n * All known status codes\n */\n public val allStatusCodes: List = allStatusCodes()\n\n private val statusCodesMap: Map = allStatusCodes.associateBy { it.value }\n\n /**\n * Creates an instance of [HttpStatusCode] with the given numeric value.\n */\n public fun fromValue(value: Int): HttpStatusCode {\n return statusCodesMap[value] ?: HttpStatusCode(value, \"Unknown Status Code\")\n }\n }\n}\n\n@Suppress(\"UNUSED\", \"KDocMissingDocumentation\")\n@Deprecated(\n \"Use ExpectationFailed instead\",\n ReplaceWith(\"ExpectationFailed\", \"io.ktor.http.HttpStatusCode.Companion.ExpectationFailed\"),\n level = DeprecationLevel.ERROR\n)\npublic inline val HttpStatusCode.Companion.ExceptionFailed: HttpStatusCode\n get() = ExpectationFailed\n\ninternal fun allStatusCodes(): List = listOf(\n HttpStatusCode.Continue,\n HttpStatusCode.SwitchingProtocols,\n HttpStatusCode.Processing,\n HttpStatusCode.OK,\n HttpStatusCode.Created,\n HttpStatusCode.Accepted,\n HttpStatusCode.NonAuthoritativeInformation,\n HttpStatusCode.NoContent,\n HttpStatusCode.ResetContent,\n HttpStatusCode.PartialContent,\n HttpStatusCode.MultiStatus,\n HttpStatusCode.MultipleChoices,\n HttpStatusCode.MovedPermanently,\n HttpStatusCode.Found,\n HttpStatusCode.SeeOther,\n HttpStatusCode.NotModified,\n HttpStatusCode.UseProxy,\n HttpStatusCode.SwitchProxy,\n HttpStatusCode.TemporaryRedirect,\n HttpStatusCode.PermanentRedirect,\n HttpStatusCode.BadRequest,\n HttpStatusCode.Unauthorized,\n HttpStatusCode.PaymentRequired,\n HttpStatusCode.Forbidden,\n HttpStatusCode.NotFound,\n HttpStatusCode.MethodNotAllowed,\n HttpStatusCode.NotAcceptable,\n HttpStatusCode.ProxyAuthenticationRequired,\n HttpStatusCode.RequestTimeout,\n HttpStatusCode.Conflict,\n HttpStatusCode.Gone,\n HttpStatusCode.LengthRequired,\n HttpStatusCode.PreconditionFailed,\n HttpStatusCode.PayloadTooLarge,\n HttpStatusCode.RequestURITooLong,\n HttpStatusCode.UnsupportedMediaType,\n HttpStatusCode.RequestedRangeNotSatisfiable,\n HttpStatusCode.ExpectationFailed,\n HttpStatusCode.UnprocessableEntity,\n HttpStatusCode.Locked,\n HttpStatusCode.FailedDependency,\n HttpStatusCode.UpgradeRequired,\n HttpStatusCode.TooManyRequests,\n HttpStatusCode.RequestHeaderFieldTooLarge,\n HttpStatusCode.InternalServerError,\n HttpStatusCode.NotImplemented,\n HttpStatusCode.BadGateway,\n HttpStatusCode.ServiceUnavailable,\n HttpStatusCode.GatewayTimeout,\n HttpStatusCode.VersionNotSupported,\n HttpStatusCode.VariantAlsoNegotiates,\n HttpStatusCode.InsufficientStorage\n)\n\n/**\n * Checks if a given status code is a success code according to HTTP standards.\n *\n * Codes from 200 to 299 are considered to be successful.\n */\npublic fun HttpStatusCode.isSuccess(): Boolean = value in (200 until 300)\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http\n\nimport io.ktor.utils.io.charsets.*\n\n/**\n * Parse URL query parameters. Shouldn't be used for urlencoded forms because of `+` character.\n */\npublic fun String.parseUrlEncodedParameters(defaultEncoding: Charset = Charsets.UTF_8, limit: Int = 1000): Parameters {\n val parameters: List> =\n split(\"&\", limit = limit).map { it.substringBefore(\"=\") to it.substringAfter(\"=\", \"\") }\n val encoding: String =\n parameters.firstOrNull { it.first == \"_charset_\" }?.second ?: defaultEncoding.name\n\n val charset = Charset.forName(encoding)\n return Parameters.build {\n parameters.forEach { (key, value) ->\n append(\n key.decodeURLQueryComponent(charset = charset),\n value.decodeURLQueryComponent(charset = charset)\n )\n }\n }\n}\n\n/**\n * Encode form parameters from a list of pairs\n */\npublic fun List>.formUrlEncode(): String = buildString { formUrlEncodeTo(this) }\n\n/**\n * Encode form parameters from a list of pairs to the specified [out] appendable\n */\npublic fun List>.formUrlEncodeTo(out: Appendable) {\n joinTo(out, \"&\") {\n val key = it.first.encodeURLParameter(spaceToPlus = true)\n if (it.second == null) {\n key\n } else {\n val value = it.second.toString().encodeURLParameterValue()\n \"$key=$value\"\n }\n }\n}\n\n/**\n * Encode form parameters\n */\npublic fun Parameters.formUrlEncode(): String = entries()\n .flatMap { e -> e.value.map { e.key to it } }\n .formUrlEncode()\n\n/**\n * Encode form parameters to the specified [out] appendable\n */\npublic fun Parameters.formUrlEncodeTo(out: Appendable) {\n entries().formUrlEncodeTo(out)\n}\n\ninternal fun ParametersBuilder.formUrlEncodeTo(out: Appendable) {\n entries().formUrlEncodeTo(out)\n}\n\ninternal fun Set>>.formUrlEncodeTo(out: Appendable) {\n flatMap { (key, value) ->\n if (value.isEmpty()) listOf(key to null) else value.map { key to it }\n }.formUrlEncodeTo(out)\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http\n\nimport io.ktor.util.*\nimport kotlin.native.concurrent.*\n\nprivate val rawMimes: String\n get() = \"\"\"\n.123,application/vnd.lotus-1-2-3\n.3dmf,x-world/x-3dmf\n.3dml,text/vnd.in3d.3dml\n.3dm,x-world/x-3dmf\n.3g2,video/3gpp2\n.3gp,video/3gpp\n.7z,application/x-7z-compressed\n.aab,application/x-authorware-bin\n.aac,audio/aac\n.aam,application/x-authorware-map\n.a,application/octet-stream\n.aas,application/x-authorware-seg\n.abc,text/vnd.abc\n.abw,application/x-abiword\n.ac,application/pkix-attr-cert\n.acc,application/vnd.americandynamics.acc\n.ace,application/x-ace-compressed\n.acgi,text/html\n.acu,application/vnd.acucobol\n.adp,audio/adpcm\n.aep,application/vnd.audiograph\n.afl,video/animaflex\n.afp,application/vnd.ibm.modcap\n.ahead,application/vnd.ahead.space\n.ai,application/postscript\n.aif,audio/aiff\n.aifc,audio/aiff\n.aiff,audio/aiff\n.aim,application/x-aim\n.aip,text/x-audiosoft-intra\n.air,application/vnd.adobe.air-application-installer-package+zip\n.ait,application/vnd.dvb.ait\n.ami,application/vnd.amiga.ami\n.ani,application/x-navi-animation\n.aos,application/x-nokia-9000-communicator-add-on-software\n.apk,application/vnd.android.package-archive\n.application,application/x-ms-application\n,application/pgp-encrypted\n.apr,application/vnd.lotus-approach\n.aps,application/mime\n.arc,application/octet-stream\n.arj,application/arj\n.arj,application/octet-stream\n.art,image/x-jg\n.asf,video/x-ms-asf\n.asm,text/x-asm\n.aso,application/vnd.accpac.simply.aso\n.asp,text/asp\n.asx,application/x-mplayer2\n.asx,video/x-ms-asf\n.asx,video/x-ms-asf-plugin\n.atc,application/vnd.acucorp\n.atomcat,application/atomcat+xml\n.atomsvc,application/atomsvc+xml\n.atom,application/atom+xml\n.atx,application/vnd.antix.game-component\n.au,audio/basic\n.au,audio/x-au\n.avi,video/avi\n.avi,video/msvideo\n.avi,video/x-msvideo\n.avs,video/avs-video\n.aw,application/applixware\n.azf,application/vnd.airzip.filesecure.azf\n.azs,application/vnd.airzip.filesecure.azs\n.azw,application/vnd.amazon.ebook\n.bcpio,application/x-bcpio\n.bdf,application/x-font-bdf\n.bdm,application/vnd.syncml.dm+wbxml\n.bed,application/vnd.realvnc.bed\n.bh2,application/vnd.fujitsu.oasysprs\n.bin,application/macbinary\n.bin,application/mac-binary\n.bin,application/octet-stream\n.bin,application/x-binary\n.bin,application/x-macbinary\n.bmi,application/vnd.bmi\n.bm,image/bmp\n.bmp,image/bmp\n.bmp,image/x-windows-bmp\n.boo,application/book\n.book,application/book\n.box,application/vnd.previewsystems.box\n.boz,application/x-bzip2\n.bsh,application/x-bsh\n.btif,image/prs.btif\n.bz2,application/x-bzip2\n.bz,application/x-bzip\n.c11amc,application/vnd.cluetrust.cartomobile-config\n.c11amz,application/vnd.cluetrust.cartomobile-config-pkg\n.c4g,application/vnd.clonk.c4group\n.cab,application/vnd.ms-cab-compressed\n.car,application/vnd.curl.car\n.cat,application/vnd.ms-pki.seccat\n.ccad,application/clariscad\n.cco,application/x-cocoa\n.cc,text/plain\n.cc,text/x-c\n.ccxml,application/ccxml+xml,\n.cdbcmsg,application/vnd.contact.cmsg\n.cdf,application/cdf\n.cdf,application/x-cdf\n.cdf,application/x-netcdf\n.cdkey,application/vnd.mediastation.cdkey\n.cdmia,application/cdmi-capability\n.cdmic,application/cdmi-container\n.cdmid,application/cdmi-domain\n.cdmio,application/cdmi-object\n.cdmiq,application/cdmi-queue\n.cdx,chemical/x-cdx\n.cdxml,application/vnd.chemdraw+xml\n.cdy,application/vnd.cinderella\n.cer,application/pkix-cert\n.cgm,image/cgm\n.cha,application/x-chat\n.chat,application/x-chat\n.chm,application/vnd.ms-htmlhelp\n.chrt,application/vnd.kde.kchart\n.cif,chemical/x-cif\n.cii,application/vnd.anser-web-certificate-issue-initiation\n.cil,application/vnd.ms-artgalry\n.cla,application/vnd.claymore\n.class,application/java\n.class,application/java-byte-code\n.class,application/java-vm\n.class,application/x-java-class\n.clkk,application/vnd.crick.clicker.keyboard\n.clkp,application/vnd.crick.clicker.palette\n.clkt,application/vnd.crick.clicker.template\n.clkw,application/vnd.crick.clicker.wordbank\n.clkx,application/vnd.crick.clicker\n.clp,application/x-msclip\n.cmc,application/vnd.cosmocaller\n.cmdf,chemical/x-cmdf\n.cml,chemical/x-cml\n.cmp,application/vnd.yellowriver-custom-menu\n.cmx,image/x-cmx\n.cod,application/vnd.rim.cod\n.com,application/octet-stream\n.com,text/plain\n.conf,text/plain\n.cpio,application/x-cpio\n.cpp,text/x-c\n.cpt,application/mac-compactpro\n.cpt,application/x-compactpro\n.cpt,application/x-cpt\n.crd,application/x-mscardfile\n.crl,application/pkcs-crl\n.crl,application/pkix-crl\n.crt,application/pkix-cert\n.crt,application/x-x509-ca-cert\n.crt,application/x-x509-user-cert\n.cryptonote,application/vnd.rig.cryptonote\n.csh,application/x-csh\n.csh,text/x-script.csh\n.csml,chemical/x-csml\n.csp,application/vnd.commonspace\n.css,text/css\n.csv,text/csv\n.c,text/plain\n.c++,text/plain\n.c,text/x-c\n.cu,application/cu-seeme\n.curl,text/vnd.curl\n.cww,application/prs.cww\n.cxx,text/plain\n.dat,binary/octet-stream\n.dae,model/vnd.collada+xml\n.daf,application/vnd.mobius.daf\n.davmount,application/davmount+xml\n.dcr,application/x-director\n.dcurl,text/vnd.curl.dcurl\n.dd2,application/vnd.oma.dd2+xml\n.ddd,application/vnd.fujixerox.ddd\n.deb,application/x-debian-package\n.deepv,application/x-deepv\n.def,text/plain\n.der,application/x-x509-ca-cert\n.dfac,application/vnd.dreamfactory\n.dif,video/x-dv\n.dir,application/x-director\n.dis,application/vnd.mobius.dis\n.djvu,image/vnd.djvu\n.dl,video/dl\n.dl,video/x-dl\n.dna,application/vnd.dna\n.doc,application/msword\n.docm,application/vnd.ms-word.document.macroenabled.12\n.docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document\n.dot,application/msword\n.dotm,application/vnd.ms-word.template.macroenabled.12\n.dotx,application/vnd.openxmlformats-officedocument.wordprocessingml.template\n.dp,application/commonground\n.dp,application/vnd.osgi.dp\n.dpg,application/vnd.dpgraph\n.dra,audio/vnd.dra\n.drw,application/drafting\n.dsc,text/prs.lines.tag\n.dssc,application/dssc+der\n.dtb,application/x-dtbook+xml\n.dtd,application/xml-dtd\n.dts,audio/vnd.dts\n.dtshd,audio/vnd.dts.hd\n.dump,application/octet-stream\n.dvi,application/x-dvi\n.dv,video/x-dv\n.dwf,model/vnd.dwf\n.dwg,application/acad\n.dwg,image/vnd.dwg\n.dwg,image/x-dwg\n.dxf,application/dxf\n.dxf,image/vnd.dwg\n.dxf,image/vnd.dxf\n.dxf,image/x-dwg\n.dxp,application/vnd.spotfire.dxp\n.dxr,application/x-director\n.ecelp4800,audio/vnd.nuera.ecelp4800\n.ecelp7470,audio/vnd.nuera.ecelp7470\n.ecelp9600,audio/vnd.nuera.ecelp9600\n.edm,application/vnd.novadigm.edm\n.edx,application/vnd.novadigm.edx\n.efif,application/vnd.picsel\n.ei6,application/vnd.pg.osasli\n.elc,application/x-elc\n.el,text/x-script.elisp\n.eml,message/rfc822\n.emma,application/emma+xml\n.env,application/x-envoy\n.eol,audio/vnd.digital-winds\n.eot,application/vnd.ms-fontobject\n.eps,application/postscript\n.epub,application/epub+zip\n.es3,application/vnd.eszigno3+xml\n.es,application/ecmascript\n.es,application/x-esrehber\n.esf,application/vnd.epson.esf\n.etx,text/x-setext\n.evy,application/envoy\n.evy,application/x-envoy\n.exe,application/octet-stream\n.exe,application/x-msdownload\n.exi,application/exi\n.ext,application/vnd.novadigm.ext\n.ez2,application/vnd.ezpix-album\n.ez3,application/vnd.ezpix-package\n.f4v,video/x-f4v\n.f77,text/x-fortran\n.f90,text/plain\n.f90,text/x-fortran\n.fbs,image/vnd.fastbidsheet\n.fcs,application/vnd.isac.fcs\n.fdf,application/vnd.fdf\n.fe_launch,application/vnd.denovo.fcselayout-link\n.fg5,application/vnd.fujitsu.oasysgp\n.fh,image/x-freehand\n.fif,application/fractals\n.fif,image/fif\n.fig,application/x-xfig\n.fli,video/fli\n.fli,video/x-fli\n.flo,application/vnd.micrografx.flo\n.flo,image/florian\n.flv,video/x-flv\n.flw,application/vnd.kde.kivio\n.flx,text/vnd.fmi.flexstor\n.fly,text/vnd.fly\n.fm,application/vnd.framemaker\n.fmf,video/x-atomic3d-feature\n.fnc,application/vnd.frogans.fnc\n.for,text/plain\n.for,text/x-fortran\n.fpx,image/vnd.fpx\n.fpx,image/vnd.net-fpx\n.frl,application/freeloader\n.fsc,application/vnd.fsc.weblaunch\n.fst,image/vnd.fst\n.ftc,application/vnd.fluxtime.clip\n.f,text/plain\n.f,text/x-fortran\n.fti,application/vnd.anser-web-funds-transfer-initiation\n.funk,audio/make\n.fvt,video/vnd.fvt\n.fxp,application/vnd.adobe.fxp\n.fzs,application/vnd.fuzzysheet\n.g2w,application/vnd.geoplan\n.g3,image/g3fax\n.g3w,application/vnd.geospace\n.gac,application/vnd.groove-account\n.gdl,model/vnd.gdl\n.geo,application/vnd.dynageo\n.gex,application/vnd.geometry-explorer\n.ggb,application/vnd.geogebra.file\n.ggt,application/vnd.geogebra.tool\n.ghf,application/vnd.groove-help\n.gif,image/gif\n.gim,application/vnd.groove-identity-message\n.gl,video/gl\n.gl,video/x-gl\n.gmx,application/vnd.gmx\n.gnumeric,application/x-gnumeric\n.gph,application/vnd.flographit\n.gqf,application/vnd.grafeq\n.gram,application/srgs\n.grv,application/vnd.groove-injector\n.grxml,application/srgs+xml\n.gsd,audio/x-gsm\n.gsf,application/x-font-ghostscript\n.gsm,audio/x-gsm\n.gsp,application/x-gsp\n.gss,application/x-gss\n.gtar,application/x-gtar\n.g,text/plain\n.gtm,application/vnd.groove-tool-message\n.gtw,model/vnd.gtw\n.gv,text/vnd.graphviz\n.gxt,application/vnd.geonext\n.gz,application/x-compressed\n.gz,application/x-gzip\n.gzip,application/x-gzip\n.gzip,multipart/x-gzip\n.h261,video/h261\n.h263,video/h263\n.h264,video/h264\n.hal,application/vnd.hal+xml\n.hbci,application/vnd.hbci\n.hdf,application/x-hdf\n.help,application/x-helpfile\n.hgl,application/vnd.hp-hpgl\n.hh,text/plain\n.hh,text/x-h\n.hlb,text/x-script\n.hlp,application/hlp\n.hlp,application/winhlp\n.hlp,application/x-helpfile\n.hlp,application/x-winhelp\n.hpg,application/vnd.hp-hpgl\n.hpgl,application/vnd.hp-hpgl\n.hpid,application/vnd.hp-hpid\n.hps,application/vnd.hp-hps\n.hqx,application/binhex\n.hqx,application/binhex4\n.hqx,application/mac-binhex\n.hqx,application/mac-binhex40\n.hqx,application/x-binhex40\n.hqx,application/x-mac-binhex40\n.hta,application/hta\n.htc,text/x-component\n.h,text/plain\n.h,text/x-h\n.htke,application/vnd.kenameaapp\n.htmls,text/html\n.html,text/html\n.htm,text/html\n.htt,text/webviewhtml\n.htx,text/html\n.hvd,application/vnd.yamaha.hv-dic\n.hvp,application/vnd.yamaha.hv-voice\n.hvs,application/vnd.yamaha.hv-script\n.i2g,application/vnd.intergeo\n.icc,application/vnd.iccprofile\n.ice,x-conference/x-cooltalk\n.ico,image/x-icon\n.ics,text/calendar\n.idc,text/plain\n.ief,image/ief\n.iefs,image/ief\n.iff,application/iff\n.ifm,application/vnd.shana.informed.formdata\n.iges,application/iges\n.iges,model/iges\n.igl,application/vnd.igloader\n.igm,application/vnd.insors.igm\n.igs,application/iges\n.igs,model/iges\n.igx,application/vnd.micrografx.igx\n.iif,application/vnd.shana.informed.interchange\n.ima,application/x-ima\n.imap,application/x-httpd-imap\n.imp,application/vnd.accpac.simply.imp\n.ims,application/vnd.ms-ims\n.inf,application/inf\n.ins,application/x-internett-signup\n.ip,application/x-ip2\n.ipfix,application/ipfix\n.ipk,application/vnd.shana.informed.package\n.irm,application/vnd.ibm.rights-management\n.irp,application/vnd.irepository.package+xml\n.isu,video/x-isvideo\n.it,audio/it\n.itp,application/vnd.shana.informed.formtemplate\n.iv,application/x-inventor\n.ivp,application/vnd.immervision-ivp\n.ivr,i-world/i-vrml\n.ivu,application/vnd.immervision-ivu\n.ivy,application/x-livescreen\n.jad,text/vnd.sun.j2me.app-descriptor\n.jam,application/vnd.jam\n.jam,audio/x-jam\n.jar,application/java-archive\n.java,text/plain\n.java,text/x-java-source\n.jav,text/plain\n.jav,text/x-java-source\n.jcm,application/x-java-commerce\n.jfif,image/jpeg\n.jfif,image/pjpeg\n.jfif-tbnl,image/jpeg\n.jisp,application/vnd.jisp\n.jlt,application/vnd.hp-jlyt\n.jnlp,application/x-java-jnlp-file\n.joda,application/vnd.joost.joda-archive\n.jpeg,image/jpeg\n.jpe,image/jpeg\n.jpg,image/jpeg\n.jpgv,video/jpeg\n.jpm,video/jpm\n.jps,image/x-jps\n.js,application/javascript\n.json,application/json\n.jut,image/jutvision\n.kar,audio/midi\n.karbon,application/vnd.kde.karbon\n.kar,music/x-karaoke\n.key,application/pgp-keys\n.keychain,application/octet-stream\n.kfo,application/vnd.kde.kformula\n.kia,application/vnd.kidspiration\n.kml,application/vnd.google-earth.kml+xml\n.kmz,application/vnd.google-earth.kmz\n.kne,application/vnd.kinar\n.kon,application/vnd.kde.kontour\n.kpr,application/vnd.kde.kpresenter\n.ksh,application/x-ksh\n.ksh,text/x-script.ksh\n.ksp,application/vnd.kde.kspread\n.ktx,image/ktx\n.ktz,application/vnd.kahootz\n.kwd,application/vnd.kde.kword\n.la,audio/nspaudio\n.la,audio/x-nspaudio\n.lam,audio/x-liveaudio\n.lasxml,application/vnd.las.las+xml\n.latex,application/x-latex\n.lbd,application/vnd.llamagraphics.life-balance.desktop\n.lbe,application/vnd.llamagraphics.life-balance.exchange+xml\n.les,application/vnd.hhe.lesson-player\n.lha,application/lha\n.lha,application/x-lha\n.link66,application/vnd.route66.link66+xml\n.list,text/plain\n.lma,audio/nspaudio\n.lma,audio/x-nspaudio\n.log,text/plain\n.lrm,application/vnd.ms-lrm\n.lsp,application/x-lisp\n.lsp,text/x-script.lisp\n.lst,text/plain\n.lsx,text/x-la-asf\n.ltf,application/vnd.frogans.ltf\n.ltx,application/x-latex\n.lvp,audio/vnd.lucent.voice\n.lwp,application/vnd.lotus-wordpro\n.lzh,application/octet-stream\n.lzh,application/x-lzh\n.lzx,application/lzx\n.lzx,application/octet-stream\n.lzx,application/x-lzx\n.m1v,video/mpeg\n.m21,application/mp21\n.m2a,audio/mpeg\n.m2v,video/mpeg\n.m3u8,application/vnd.apple.mpegurl\n.m3u,audio/x-mpegurl\n.m4a,audio/mp4\n.m4v,video/mp4\n.ma,application/mathematica\n.mads,application/mads+xml\n.mag,application/vnd.ecowin.chart\n.man,application/x-troff-man\n.map,application/x-navimap\n.mar,text/plain\n.mathml,application/mathml+xml\n.mbd,application/mbedlet\n.mbk,application/vnd.mobius.mbk\n.mbox,application/mbox\n.mc1,application/vnd.medcalcdata\n.mc${'$'},application/x-magic-cap-package-1.0\n.mcd,application/mcad\n.mcd,application/vnd.mcd\n.mcd,application/x-mathcad\n.mcf,image/vasa\n.mcf,text/mcf\n.mcp,application/netmc\n.mcurl,text/vnd.curl.mcurl\n.mdb,application/x-msaccess\n.mdi,image/vnd.ms-modi\n.me,application/x-troff-me\n.meta4,application/metalink4+xml\n.mets,application/mets+xml\n.mfm,application/vnd.mfmp\n.mgp,application/vnd.osgeo.mapguide.package\n.mgz,application/vnd.proteus.magazine\n.mht,message/rfc822\n.mhtml,message/rfc822\n.mid,application/x-midi\n.mid,audio/midi\n.mid,audio/x-mid\n.midi,application/x-midi\n.midi,audio/midi\n.midi,audio/x-mid\n.midi,audio/x-midi\n.midi,music/crescendo\n.midi,x-music/x-midi\n.mid,music/crescendo\n.mid,x-music/x-midi\n.mif,application/vnd.mif\n.mif,application/x-frame\n.mif,application/x-mif\n.mime,message/rfc822\n.mime,www/mime\n.mj2,video/mj2\n.mjf,audio/x-vnd.audioexplosion.mjuicemediafile\n.mjpg,video/x-motion-jpeg\n.mkv,video/x-matroska\n.mkv,audio/x-matroska\n.mlp,application/vnd.dolby.mlp\n.mm,application/base64\n.mm,application/x-meme\n.mmd,application/vnd.chipnuts.karaoke-mmd\n.mme,application/base64\n.mmf,application/vnd.smaf\n.mmr,image/vnd.fujixerox.edmics-mmr\n.mny,application/x-msmoney\n.mod,audio/mod\n.mod,audio/x-mod\n.mods,application/mods+xml\n.moov,video/quicktime\n.movie,video/x-sgi-movie\n.mov,video/quicktime\n.mp2,audio/mpeg\n.mp2,audio/x-mpeg\n.mp2,video/mpeg\n.mp2,video/x-mpeg\n.mp2,video/x-mpeq2a\n.mp3,audio/mpeg\n.mp3,audio/mpeg3\n.mp4a,audio/mp4\n.mp4,video/mp4\n.mp4,application/mp4\n.mpa,audio/mpeg\n.mpc,application/vnd.mophun.certificate\n.mpc,application/x-project\n.mpeg,video/mpeg\n.mpe,video/mpeg\n.mpga,audio/mpeg\n.mpg,video/mpeg\n.mpg,audio/mpeg\n.mpkg,application/vnd.apple.installer+xml\n.mpm,application/vnd.blueice.multipass\n.mpn,application/vnd.mophun.application\n.mpp,application/vnd.ms-project\n.mpt,application/x-project\n.mpv,application/x-project\n.mpx,application/x-project\n.mpy,application/vnd.ibm.minipay\n.mqy,application/vnd.mobius.mqy\n.mrc,application/marc\n.mrcx,application/marcxml+xml\n.ms,application/x-troff-ms\n.mscml,application/mediaservercontrol+xml\n.mseq,application/vnd.mseq\n.msf,application/vnd.epson.msf\n.msg,application/vnd.ms-outlook\n.msh,model/mesh\n.msl,application/vnd.mobius.msl\n.msty,application/vnd.muvee.style\n.m,text/plain\n.m,text/x-m\n.mts,model/vnd.mts\n.mus,application/vnd.musician\n.musicxml,application/vnd.recordare.musicxml+xml\n.mvb,application/x-msmediaview\n.mv,video/x-sgi-movie\n.mwf,application/vnd.mfer\n.mxf,application/mxf\n.mxl,application/vnd.recordare.musicxml\n.mxml,application/xv+xml\n.mxs,application/vnd.triscape.mxs\n.mxu,video/vnd.mpegurl\n.my,audio/make\n.mzz,application/x-vnd.audioexplosion.mzz\n.n3,text/n3\nN/A,application/andrew-inset\n.nap,image/naplps\n.naplps,image/naplps\n.nbp,application/vnd.wolfram.player\n.nc,application/x-netcdf\n.ncm,application/vnd.nokia.configuration-message\n.ncx,application/x-dtbncx+xml\n.n-gage,application/vnd.nokia.n-gage.symbian.install\n.ngdat,application/vnd.nokia.n-gage.data\n.niff,image/x-niff\n.nif,image/x-niff\n.nix,application/x-mix-transfer\n.nlu,application/vnd.neurolanguage.nlu\n.nml,application/vnd.enliven\n.nnd,application/vnd.noblenet-directory\n.nns,application/vnd.noblenet-sealer\n.nnw,application/vnd.noblenet-web\n.npx,image/vnd.net-fpx\n.nsc,application/x-conference\n.nsf,application/vnd.lotus-notes\n.nvd,application/x-navidoc\n.oa2,application/vnd.fujitsu.oasys2\n.oa3,application/vnd.fujitsu.oasys3\n.o,application/octet-stream\n.oas,application/vnd.fujitsu.oasys\n.obd,application/x-msbinder\n.oda,application/oda\n.odb,application/vnd.oasis.opendocument.database\n.odc,application/vnd.oasis.opendocument.chart\n.odf,application/vnd.oasis.opendocument.formula\n.odft,application/vnd.oasis.opendocument.formula-template\n.odg,application/vnd.oasis.opendocument.graphics\n.odi,application/vnd.oasis.opendocument.image\n.odm,application/vnd.oasis.opendocument.text-master\n.odp,application/vnd.oasis.opendocument.presentation\n.ods,application/vnd.oasis.opendocument.spreadsheet\n.odt,application/vnd.oasis.opendocument.text\n.oga,audio/ogg\n.ogg,audio/ogg\n.ogv,video/ogg\n.ogx,application/ogg\n.omc,application/x-omc\n.omcd,application/x-omcdatamaker\n.omcr,application/x-omcregerator\n.onetoc,application/onenote\n.opf,application/oebps-package+xml\n.org,application/vnd.lotus-organizer\n.osf,application/vnd.yamaha.openscoreformat\n.osfpvg,application/vnd.yamaha.openscoreformat.osfpvg+xml\n.otc,application/vnd.oasis.opendocument.chart-template\n.otf,application/x-font-otf\n.otg,application/vnd.oasis.opendocument.graphics-template\n.oth,application/vnd.oasis.opendocument.text-web\n.oti,application/vnd.oasis.opendocument.image-template\n.otp,application/vnd.oasis.opendocument.presentation-template\n.ots,application/vnd.oasis.opendocument.spreadsheet-template\n.ott,application/vnd.oasis.opendocument.text-template\n.oxt,application/vnd.openofficeorg.extension\n.p10,application/pkcs10\n.p12,application/pkcs-12\n.p7a,application/x-pkcs7-signature\n.p7b,application/x-pkcs7-certificates\n.p7c,application/pkcs7-mime\n.p7m,application/pkcs7-mime\n.p7r,application/x-pkcs7-certreqresp\n.p7s,application/pkcs7-signature\n.p8,application/pkcs8\n.pages,application/vnd.apple.pages\n.part,application/pro_eng\n.par,text/plain-bas\n.pas,text/pascal\n.paw,application/vnd.pawaafile\n.pbd,application/vnd.powerbuilder6\n.pbm,image/x-portable-bitmap\n.pcf,application/x-font-pcf\n.pcl,application/vnd.hp-pcl\n.pcl,application/x-pcl\n.pclxl,application/vnd.hp-pclxl\n.pct,image/x-pict\n.pcurl,application/vnd.curl.pcurl\n.pcx,image/x-pcx\n.pdb,application/vnd.palm\n.pdb,chemical/x-pdb\n.pdf,application/pdf\n.pem,application/x-pem-file\n.pfa,application/x-font-type1\n.pfr,application/font-tdpfr\n.pfunk,audio/make\n.pfunk,audio/make.my.funk\n.pfx,application/x-pkcs12\n.pgm,image/x-portable-graymap\n.pgn,application/x-chess-pgn\n.pgp,application/pgp-signature\n.pic,image/pict\n.pict,image/pict\n.pkg,application/x-newton-compatible-pkg\n.pki,application/pkixcmp\n.pkipath,application/pkix-pkipath\n.pko,application/vnd.ms-pki.pko\n.plb,application/vnd.3gpp.pic-bw-large\n.plc,application/vnd.mobius.plc\n.plf,application/vnd.pocketlearn\n.pls,application/pls+xml\n.pl,text/plain\n.pl,text/x-script.perl\n.plx,application/x-pixclscript\n.pm4,application/x-pagemaker\n.pm5,application/x-pagemaker\n.pm,image/x-xpixmap\n.pml,application/vnd.ctc-posml\n.pm,text/x-script.perl-module\n.png,image/png\n.pnm,application/x-portable-anymap\n.pnm,image/x-portable-anymap\n.portpkg,application/vnd.macports.portpkg\n.pot,application/mspowerpoint\n.pot,application/vnd.ms-powerpoint\n.potm,application/vnd.ms-powerpoint.template.macroenabled.12\n.potx,application/vnd.openxmlformats-officedocument.presentationml.template\n.pov,model/x-pov\n.ppa,application/vnd.ms-powerpoint\n.ppam,application/vnd.ms-powerpoint.addin.macroenabled.12\n.ppd,application/vnd.cups-ppd\n.ppm,image/x-portable-pixmap\n.pps,application/mspowerpoint\n.pps,application/vnd.ms-powerpoint\n.ppsm,application/vnd.ms-powerpoint.slideshow.macroenabled.12\n.ppsx,application/vnd.openxmlformats-officedocument.presentationml.slideshow\n.ppt,application/mspowerpoint\n.ppt,application/powerpoint\n.ppt,application/vnd.ms-powerpoint\n.ppt,application/x-mspowerpoint\n.pptm,application/vnd.ms-powerpoint.presentation.macroenabled.12\n.pptx,application/vnd.openxmlformats-officedocument.presentationml.presentation\n.ppz,application/mspowerpoint\n.prc,application/x-mobipocket-ebook\n.pre,application/vnd.lotus-freelance\n.pre,application/x-freelance\n.prf,application/pics-rules\n.prt,application/pro_eng\n.ps,application/postscript\n.psb,application/vnd.3gpp.pic-bw-small\n.psd,application/octet-stream\n.psd,image/vnd.adobe.photoshop\n.psf,application/x-font-linux-psf\n.pskcxml,application/pskc+xml\n.p,text/x-pascal\n.ptid,application/vnd.pvi.ptid1\n.pub,application/x-mspublisher\n.pvb,application/vnd.3gpp.pic-bw-var\n.pvu,paleovu/x-pv\n.pwn,application/vnd.3m.post-it-notes\n.pwz,application/vnd.ms-powerpoint\n.pya,audio/vnd.ms-playready.media.pya\n.pyc,application/x-bytecode.python\n.py,text/x-script.python\n.pyv,video/vnd.ms-playready.media.pyv\n.qam,application/vnd.epson.quickanime\n.qbo,application/vnd.intu.qbo\n.qcp,audio/vnd.qcelp\n.qd3d,x-world/x-3dmf\n.qd3,x-world/x-3dmf\n.qfx,application/vnd.intu.qfx\n.qif,image/x-quicktime\n.qps,application/vnd.publishare-delta-tree\n.qtc,video/x-qtc\n.qtif,image/x-quicktime\n.qti,image/x-quicktime\n.qt,video/quicktime\n.qxd,application/vnd.quark.quarkxpress\n.ra,audio/x-pn-realaudio\n.ra,audio/x-pn-realaudio-plugin\n.ra,audio/x-realaudio\n.ram,audio/x-pn-realaudio\n.rar,application/x-rar-compressed\n.ras,application/x-cmu-raster\n.ras,image/cmu-raster\n.ras,image/x-cmu-raster\n.rast,image/cmu-raster\n.rcprofile,application/vnd.ipunplugged.rcprofile\n.rdf,application/rdf+xml\n.rdz,application/vnd.data-vision.rdz\n.rep,application/vnd.businessobjects\n.res,application/x-dtbresource+xml\n.rexx,text/x-script.rexx\n.rf,image/vnd.rn-realflash\n.rgb,image/x-rgb\n.rif,application/reginfo+xml\n.rip,audio/vnd.rip\n.rl,application/resource-lists+xml\n.rlc,image/vnd.fujixerox.edmics-rlc\n.rld,application/resource-lists-diff+xml\n.rm,application/vnd.rn-realmedia\n.rm,audio/x-pn-realaudio\n.rmi,audio/mid\n.rmm,audio/x-pn-realaudio\n.rmp,audio/x-pn-realaudio\n.rmp,audio/x-pn-realaudio-plugin\n.rms,application/vnd.jcp.javame.midlet-rms\n.rnc,application/relax-ng-compact-syntax\n.rng,application/ringing-tones\n.rng,application/vnd.nokia.ringing-tone\n.rnx,application/vnd.rn-realplayer\n.roff,application/x-troff\n.rp9,application/vnd.cloanto.rp9\n.rp,image/vnd.rn-realpix\n.rpm,audio/x-pn-realaudio-plugin\n.rpm,application/x-rpm\n.rpss,application/vnd.nokia.radio-presets\n.rpst,application/vnd.nokia.radio-preset\n.rq,application/sparql-query\n.rs,application/rls-services+xml\n.rsd,application/rsd+xml\n.rss,application/rss+xml\n.rtf,application/rtf\n.rtf,text/rtf\n.rt,text/richtext\n.rt,text/vnd.rn-realtext\n.rtx,application/rtf\n.rtx,text/richtext\n.rv,video/vnd.rn-realvideo\n.s3m,audio/s3m\n.saf,application/vnd.yamaha.smaf-audio\n.saveme,application/octet-stream\n.sbk,application/x-tbook\n.sbml,application/sbml+xml\n.sc,application/vnd.ibm.secure-container\n.scd,application/x-msschedule\n.scm,application/vnd.lotus-screencam\n.scm,application/x-lotusscreencam\n.scm,text/x-script.guile\n.scm,text/x-script.scheme\n.scm,video/x-scm\n.scq,application/scvp-cv-request\n.scs,application/scvp-cv-response\n.scurl,text/vnd.curl.scurl\n.sda,application/vnd.stardivision.draw\n.sdc,application/vnd.stardivision.calc\n.sdd,application/vnd.stardivision.impress\n.sdf,application/octet-stream\n.sdkm,application/vnd.solent.sdkm+xml\n.sdml,text/plain\n.sdp,application/sdp\n.sdp,application/x-sdp\n.sdr,application/sounder\n.sdw,application/vnd.stardivision.writer\n.sea,application/sea\n.sea,application/x-sea\n.see,application/vnd.seemail\n.seed,application/vnd.fdsn.seed\n.sema,application/vnd.sema\n.semd,application/vnd.semd\n.semf,application/vnd.semf\n.ser,application/java-serialized-object\n.set,application/set\n.setpay,application/set-payment-initiation\n.setreg,application/set-registration-initiation\n.sfd-hdstx,application/vnd.hydrostatix.sof-data\n.sfs,application/vnd.spotfire.sfs\n.sgl,application/vnd.stardivision.writer-global\n.sgml,text/sgml\n.sgml,text/x-sgml\n.sgm,text/sgml\n.sgm,text/x-sgml\n.sh,application/x-bsh\n.sh,application/x-sh\n.sh,application/x-shar\n.shar,application/x-bsh\n.shar,application/x-shar\n.shf,application/shf+xml\n.sh,text/x-script.sh\n.shtml,text/html\n.shtml,text/x-server-parsed-html\n.sid,audio/x-psid\n.sis,application/vnd.symbian.install\n.sit,application/x-sit\n.sit,application/x-stuffit\n.sitx,application/x-stuffitx\n.skd,application/x-koan\n.skm,application/x-koan\n.skp,application/vnd.koan\n.skp,application/x-koan\n.skt,application/x-koan\n.sl,application/x-seelogo\n.sldm,application/vnd.ms-powerpoint.slide.macroenabled.12\n.sldx,application/vnd.openxmlformats-officedocument.presentationml.slide\n.slt,application/vnd.epson.salt\n.sm,application/vnd.stepmania.stepchart\n.smf,application/vnd.stardivision.math\n.smi,application/smil\n.smi,application/smil+xml\n.smil,application/smil\n.snd,audio/basic\n.snd,audio/x-adpcm\n.snf,application/x-font-snf\n.sol,application/solids\n.spc,application/x-pkcs7-certificates\n.spc,text/x-speech\n.spf,application/vnd.yamaha.smaf-phrase\n.spl,application/futuresplash\n.spl,application/x-futuresplash\n.spot,text/vnd.in3d.spot\n.spp,application/scvp-vp-response\n.spq,application/scvp-vp-request\n.spr,application/x-sprite\n.sprite,application/x-sprite\n.src,application/x-wais-source\n.srt,text/srt\n.sru,application/sru+xml\n.srx,application/sparql-results+xml\n.sse,application/vnd.kodak-descriptor\n.ssf,application/vnd.epson.ssf\n.ssi,text/x-server-parsed-html\n.ssm,application/streamingmedia\n.ssml,application/ssml+xml\n.sst,application/vnd.ms-pki.certstore\n.st,application/vnd.sailingtracker.track\n.stc,application/vnd.sun.xml.calc.template\n.std,application/vnd.sun.xml.draw.template\n.step,application/step\n.s,text/x-asm\n.stf,application/vnd.wt.stf\n.sti,application/vnd.sun.xml.impress.template\n.stk,application/hyperstudio\n.stl,application/sla\n.stl,application/vnd.ms-pki.stl\n.stl,application/x-navistyle\n.stp,application/step\n.str,application/vnd.pg.format\n.stw,application/vnd.sun.xml.writer.template\n.sub,image/vnd.dvb.subtitle\n.sus,application/vnd.sus-calendar\n.sv4cpio,application/x-sv4cpio\n.sv4crc,application/x-sv4crc\n.svc,application/vnd.dvb.service\n.svd,application/vnd.svd\n.svf,image/vnd.dwg\n.svf,image/x-dwg\n.svg,image/svg+xml\n.svr,application/x-world\n.svr,x-world/x-svr\n.swf,application/x-shockwave-flash\n.swi,application/vnd.aristanetworks.swi\n.sxc,application/vnd.sun.xml.calc\n.sxd,application/vnd.sun.xml.draw\n.sxg,application/vnd.sun.xml.writer.global\n.sxi,application/vnd.sun.xml.impress\n.sxm,application/vnd.sun.xml.math\n.sxw,application/vnd.sun.xml.writer\n.talk,text/x-speech\n.tao,application/vnd.tao.intent-module-archive\n.t,application/x-troff\n.tar,application/x-tar\n.tbk,application/toolbook\n.tbk,application/x-tbook\n.tcap,application/vnd.3gpp2.tcap\n.tcl,application/x-tcl\n.tcl,text/x-script.tcl\n.tcsh,text/x-script.tcsh\n.teacher,application/vnd.smart.teacher\n.tei,application/tei+xml\n.tex,application/x-tex\n.texi,application/x-texinfo\n.texinfo,application/x-texinfo\n.text,text/plain\n.tfi,application/thraud+xml\n.tfm,application/x-tex-tfm\n.tgz,application/gnutar\n.tgz,application/x-compressed\n.thmx,application/vnd.ms-officetheme\n.tiff,image/tiff\n.tif,image/tiff\n.tmo,application/vnd.tmobile-livetv\n.torrent,application/x-bittorrent\n.tpl,application/vnd.groove-tool-template\n.tpt,application/vnd.trid.tpt\n.tra,application/vnd.trueapp\n.tr,application/x-troff\n.trm,application/x-msterminal\n.tsd,application/timestamped-data\n.tsi,audio/tsp-audio\n.tsp,application/dsptype\n.tsp,audio/tsplayer\n.tsv,text/tab-separated-values\n.t,text/troff\n.ttf,application/x-font-ttf\n.ttl,text/turtle\n.turbot,image/florian\n.twd,application/vnd.simtech-mindmapper\n.txd,application/vnd.genomatix.tuxedo\n.txf,application/vnd.mobius.txf\n.txt,text/plain\n.ufd,application/vnd.ufdl\n.uil,text/x-uil\n.umj,application/vnd.umajin\n.unis,text/uri-list\n.uni,text/uri-list\n.unityweb,application/vnd.unity\n.unv,application/i-deas\n.uoml,application/vnd.uoml+xml\n.uris,text/uri-list\n.uri,text/uri-list\n.ustar,application/x-ustar\n.ustar,multipart/x-ustar\n.utz,application/vnd.uiq.theme\n.uu,application/octet-stream\n.uue,text/x-uuencode\n.uu,text/x-uuencode\n.uva,audio/vnd.dece.audio\n.uvh,video/vnd.dece.hd\n.uvi,image/vnd.dece.graphic\n.uvm,video/vnd.dece.mobile\n.uvp,video/vnd.dece.pd\n.uvs,video/vnd.dece.sd\n.uvu,video/vnd.uvvu.mp4\n.uvv,video/vnd.dece.video\n.vcd,application/x-cdlink\n.vcf,text/x-vcard\n.vcg,application/vnd.groove-vcard\n.vcs,text/x-vcalendar\n.vcx,application/vnd.vcx\n.vda,application/vda\n.vdo,video/vdo\n.vew,application/groupwise\n.vis,application/vnd.visionary\n.vivo,video/vivo\n.vivo,video/vnd.vivo\n.viv,video/vivo\n.viv,video/vnd.vivo\n.vmd,application/vocaltec-media-desc\n.vmf,application/vocaltec-media-file\n.vob,video/dvd\n.voc,audio/voc\n.voc,audio/x-voc\n.vos,video/vosaic\n.vox,audio/voxware\n.vqe,audio/x-twinvq-plugin\n.vqf,audio/x-twinvq\n.vql,audio/x-twinvq-plugin\n.vrml,application/x-vrml\n.vrml,model/vrml\n.vrml,x-world/x-vrml\n.vrt,x-world/x-vrt\n.vsd,application/vnd.visio\n.vsd,application/x-visio\n.vsf,application/vnd.vsf\n.vst,application/x-visio\n.vsw,application/x-visio\n.vtt,text/vtt\n.vtu,model/vnd.vtu\n.vxml,application/voicexml+xml\n.w60,application/wordperfect6.0\n.w61,application/wordperfect6.1\n.w6w,application/msword\n.wad,application/x-doom\n.war,application/zip\n.wasm,application/wasm\n.wav,audio/wav\n.wax,audio/x-ms-wax\n.wb1,application/x-qpro\n.wbmp,image/vnd.wap.wbmp\n.wbs,application/vnd.criticaltools.wbs+xml\n.wbxml,application/vnd.wap.wbxml\n.weba,audio/webm\n.web,application/vnd.xara\n.webm,video/webm\n.webp,image/webp\n.wg,application/vnd.pmi.widget\n.wgt,application/widget\n.wiz,application/msword\n.wk1,application/x-123\n.wma,audio/x-ms-wma\n.wmd,application/x-ms-wmd\n.wmf,application/x-msmetafile\n.wmf,windows/metafile\n.wmlc,application/vnd.wap.wmlc\n.wmlsc,application/vnd.wap.wmlscriptc\n.wmls,text/vnd.wap.wmlscript\n.wml,text/vnd.wap.wml\n.wm,video/x-ms-wm\n.wmv,video/x-ms-wmv\n.wmx,video/x-ms-wmx\n.wmz,application/x-ms-wmz\n.woff,application/x-font-woff\n.word,application/msword\n.wp5,application/wordperfect\n.wp5,application/wordperfect6.0\n.wp6,application/wordperfect\n.wp,application/wordperfect\n.wpd,application/vnd.wordperfect\n.wpd,application/wordperfect\n.wpd,application/x-wpwin\n.wpl,application/vnd.ms-wpl\n.wps,application/vnd.ms-works\n.wq1,application/x-lotus\n.wqd,application/vnd.wqd\n.wri,application/mswrite\n.wri,application/x-mswrite\n.wri,application/x-wri\n.wrl,application/x-world\n.wrl,model/vrml\n.wrl,x-world/x-vrml\n.wrz,model/vrml\n.wrz,x-world/x-vrml\n.wsc,text/scriplet\n.wsdl,application/wsdl+xml\n.wspolicy,application/wspolicy+xml\n.wsrc,application/x-wais-source\n.wtb,application/vnd.webturbo\n.wtk,application/x-wintalk\n.wvx,video/x-ms-wvx\n.x3d,application/vnd.hzn-3d-crossword\n.xap,application/x-silverlight-app\n.xar,application/vnd.xara\n.xbap,application/x-ms-xbap\n.xbd,application/vnd.fujixerox.docuworks.binder\n.xbm,image/xbm\n.xbm,image/x-xbitmap\n.xbm,image/x-xbm\n.xdf,application/xcap-diff+xml\n.xdm,application/vnd.syncml.dm+xml\n.xdp,application/vnd.adobe.xdp+xml\n.xdr,video/x-amt-demorun\n.xdssc,application/dssc+xml\n.xdw,application/vnd.fujixerox.docuworks\n.xenc,application/xenc+xml\n.xer,application/patch-ops-error+xml\n.xfdf,application/vnd.adobe.xfdf\n.xfdl,application/vnd.xfdl\n.xgz,xgl/drawing\n.xhtml,application/xhtml+xml\n.xif,image/vnd.xiff\n.xla,application/excel\n.xla,application/x-excel\n.xla,application/x-msexcel\n.xlam,application/vnd.ms-excel.addin.macroenabled.12\n.xl,application/excel\n.xlb,application/excel\n.xlb,application/vnd.ms-excel\n.xlb,application/x-excel\n.xlc,application/excel\n.xlc,application/vnd.ms-excel\n.xlc,application/x-excel\n.xld,application/excel\n.xld,application/x-excel\n.xlk,application/excel\n.xlk,application/x-excel\n.xll,application/excel\n.xll,application/vnd.ms-excel\n.xll,application/x-excel\n.xlm,application/excel\n.xlm,application/vnd.ms-excel\n.xlm,application/x-excel\n.xls,application/excel\n.xls,application/vnd.ms-excel\n.xls,application/x-excel\n.xls,application/x-msexcel\n.xlsb,application/vnd.ms-excel.sheet.binary.macroenabled.12\n.xlsm,application/vnd.ms-excel.sheet.macroenabled.12\n.xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\n.xlt,application/excel\n.xlt,application/x-excel\n.xltm,application/vnd.ms-excel.template.macroenabled.12\n.xltx,application/vnd.openxmlformats-officedocument.spreadsheetml.template\n.xlv,application/excel\n.xlv,application/x-excel\n.xlw,application/excel\n.xlw,application/vnd.ms-excel\n.xlw,application/x-excel\n.xlw,application/x-msexcel\n.xm,audio/xm\n.xml,application/xml\n.xml,text/xml\n.xmz,xgl/movie\n.xo,application/vnd.olpc-sugar\n.xop,application/xop+xml\n.xpi,application/x-xpinstall\n.xpix,application/x-vnd.ls-xpix\n.xpm,image/xpm\n.xpm,image/x-xpixmap\n.x-png,image/png\n.xpr,application/vnd.is-xpr\n.xps,application/vnd.ms-xpsdocument\n.xpw,application/vnd.intercon.formnet\n.xslt,application/xslt+xml\n.xsm,application/vnd.syncml+xml\n.xspf,application/xspf+xml\n.xsr,video/x-amt-showrun\n.xul,application/vnd.mozilla.xul+xml\n.xwd,image/x-xwd\n.xwd,image/x-xwindowdump\n.xyz,chemical/x-pdb\n.xyz,chemical/x-xyz\n.xz,application/x-xz\n.yaml,text/yaml\n.yang,application/yang\n.yin,application/yin+xml\n.z,application/x-compress\n.z,application/x-compressed\n.zaz,application/vnd.zzazz.deck+xml\n.zip,application/zip\n.zip,application/x-compressed\n.zip,application/x-zip-compressed\n.zip,multipart/x-zip\n.zir,application/vnd.zul\n.zmm,application/vnd.handheld-entertainment+xml\n.zoo,application/octet-stream\n.zsh,text/x-script.zsh\n\"\"\"\n\ninternal fun loadMimes(): List> {\n return rawMimes.lineSequence().mapNotNull {\n val line = it.trim()\n if (line.isEmpty()) return@mapNotNull null\n\n val index = line.indexOf(',')\n val extension = line.substring(0, index)\n val mime = line.substring(index + 1)\n\n extension.removePrefix(\".\").toLowerCasePreservingASCIIRules() to mime.toContentType()\n }.toList()\n}\n\ninternal val mimes: List> by lazy { loadMimes() }\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http\n\nimport io.ktor.util.*\n\n/**\n * Represents HTTP parameters as a map from case-insensitive names to collection of [String] values\n */\npublic interface Parameters : StringValues {\n public companion object {\n /**\n * Empty [Parameters] instance\n */\n public val Empty: Parameters = EmptyParameters\n\n /**\n * Builds a [Parameters] instance with the given [builder] function\n * @param builder specifies a function to build a map\n */\n public inline fun build(builder: ParametersBuilder.() -> Unit): Parameters =\n ParametersBuilder().apply(builder).build()\n }\n}\n\n@Suppress(\"KDocMissingDocumentation\")\npublic interface ParametersBuilder : StringValuesBuilder {\n override fun build(): Parameters\n}\n\n@Suppress(\"KDocMissingDocumentation\")\npublic fun ParametersBuilder(size: Int = 8): ParametersBuilder = ParametersBuilderImpl(size)\n\n@Suppress(\"KDocMissingDocumentation\")\npublic class ParametersBuilderImpl(\n size: Int = 8\n) : StringValuesBuilderImpl(true, size), ParametersBuilder {\n override fun build(): Parameters {\n return ParametersImpl(values)\n }\n}\n\n/**\n * Returns an empty parameters instance\n */\npublic fun parametersOf(): Parameters = Parameters.Empty\n\n/**\n * Creates a parameters instance containing only single pair\n */\npublic fun parametersOf(name: String, value: String): Parameters = ParametersSingleImpl(name, listOf(value))\n\n/**\n * Creates a parameters instance containing only single pair of [name] with multiple [values]\n */\npublic fun parametersOf(name: String, values: List): Parameters = ParametersSingleImpl(name, values)\n\n/**\n * Creates a parameters instance from the entries of the given [map]\n */\npublic fun parametersOf(map: Map>): Parameters = ParametersImpl(map)\n\n/**\n * Creates a parameters instance from the specified [pairs]\n */\npublic fun parametersOf(vararg pairs: Pair>): Parameters = ParametersImpl(pairs.asList().toMap())\n\n@Suppress(\"KDocMissingDocumentation\")\npublic class ParametersImpl(\n values: Map> = emptyMap()\n) : Parameters, StringValuesImpl(true, values) {\n override fun toString(): String = \"Parameters ${entries()}\"\n}\n\n@Suppress(\"KDocMissingDocumentation\")\npublic class ParametersSingleImpl(name: String, values: List) : Parameters,\n StringValuesSingleImpl(true, name, values) {\n override fun toString(): String = \"Parameters ${entries()}\"\n}\n\n/**\n * Plus operator function that creates a new parameters instance from the original one concatenating with [other]\n */\npublic operator fun Parameters.plus(other: Parameters): Parameters = when {\n caseInsensitiveName == other.caseInsensitiveName -> when {\n this.isEmpty() -> other\n other.isEmpty() -> this\n else -> Parameters.build { appendAll(this@plus); appendAll(other) }\n }\n else -> {\n throw IllegalArgumentException(\n \"Cannot concatenate Parameters with case-sensitive and case-insensitive names\"\n )\n }\n}\n\ninternal object EmptyParameters : Parameters {\n override val caseInsensitiveName: Boolean get() = true\n override fun getAll(name: String): List? = null\n override fun names(): Set = emptySet()\n override fun entries(): Set>> = emptySet()\n override fun isEmpty(): Boolean = true\n override fun toString(): String = \"Parameters ${entries()}\"\n\n override fun equals(other: Any?): Boolean = other is Parameters && other.isEmpty()\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http\n\n/**\n * Parse query string withing starting at the specified [startIndex] but up to [limit] pairs\n */\npublic fun parseQueryString(query: String, startIndex: Int = 0, limit: Int = 1000, decode: Boolean = true): Parameters {\n return if (startIndex > query.lastIndex) {\n Parameters.Empty\n } else {\n Parameters.build { parse(query, startIndex, limit, decode) }\n }\n}\n\nprivate fun ParametersBuilder.parse(query: String, startIndex: Int, limit: Int, decode: Boolean) {\n var count = 0\n var nameIndex = startIndex\n var equalIndex = -1\n for (index in startIndex..query.lastIndex) {\n if (count == limit) {\n return\n }\n when (query[index]) {\n '&' -> {\n appendParam(query, nameIndex, equalIndex, index, decode)\n nameIndex = index + 1\n equalIndex = -1\n count++\n }\n '=' -> {\n if (equalIndex == -1) {\n equalIndex = index\n }\n }\n }\n }\n if (count == limit) {\n return\n }\n appendParam(query, nameIndex, equalIndex, query.length, decode)\n}\n\nprivate fun ParametersBuilder.appendParam(\n query: String,\n nameIndex: Int,\n equalIndex: Int,\n endIndex: Int,\n decode: Boolean\n) {\n if (equalIndex == -1) {\n val spaceNameIndex = trimStart(nameIndex, endIndex, query)\n val spaceEndIndex = trimEnd(spaceNameIndex, endIndex, query)\n\n if (spaceEndIndex > spaceNameIndex) {\n val name = when {\n decode -> query.decodeURLQueryComponent(spaceNameIndex, spaceEndIndex)\n else -> query.substring(spaceNameIndex, spaceEndIndex)\n }\n appendAll(name, emptyList())\n }\n return\n }\n val spaceNameIndex = trimStart(nameIndex, equalIndex, query)\n val spaceEqualIndex = trimEnd(spaceNameIndex, equalIndex, query)\n if (spaceEqualIndex > spaceNameIndex) {\n val name = when {\n decode -> query.decodeURLQueryComponent(spaceNameIndex, spaceEqualIndex)\n else -> query.substring(spaceNameIndex, spaceEqualIndex)\n }\n\n val spaceValueIndex = trimStart(equalIndex + 1, endIndex, query)\n val spaceEndIndex = trimEnd(spaceValueIndex, endIndex, query)\n val value = when {\n decode -> query.decodeURLQueryComponent(spaceValueIndex, spaceEndIndex, plusIsSpace = true)\n else -> query.substring(spaceValueIndex, spaceEndIndex)\n }\n append(name, value)\n }\n}\n\nprivate fun trimEnd(start: Int, end: Int, text: CharSequence): Int {\n var spaceIndex = end\n while (spaceIndex > start && text[spaceIndex - 1].isWhitespace()) spaceIndex--\n return spaceIndex\n}\n\nprivate fun trimStart(start: Int, end: Int, query: CharSequence): Int {\n var spaceIndex = start\n while (spaceIndex < end && query[spaceIndex].isWhitespace()) spaceIndex++\n return spaceIndex\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http\n\n/**\n * Select default port value from protocol.\n */\npublic const val DEFAULT_PORT: Int = 0\n\n/**\n * A URL builder with all mutable components\n *\n * @property protocol URL protocol (scheme)\n * @property host name without port (domain)\n * @property port port number\n * @property user username part (optional)\n * @property password password part (optional)\n * @property pathSegments URL path without query\n * @property parameters URL query parameters\n * @property fragment URL fragment (anchor name)\n * @property trailingQuery keep a trailing question character even if there are no query parameters\n */\npublic class URLBuilder(\n public var protocol: URLProtocol = URLProtocol.HTTP,\n public var host: String = \"\",\n public var port: Int = DEFAULT_PORT,\n user: String? = null,\n password: String? = null,\n pathSegments: List = emptyList(),\n parameters: Parameters = Parameters.Empty,\n fragment: String = \"\",\n public var trailingQuery: Boolean = false\n) {\n public var encodedUser: String? = user?.encodeURLParameter()\n\n public var user: String?\n get() = encodedUser?.decodeURLPart()\n set(value) {\n encodedUser = value?.encodeURLParameter()\n }\n\n public var encodedPassword: String? = password?.encodeURLParameter()\n public var password: String?\n get() = encodedPassword?.decodeURLPart()\n set(value) {\n encodedPassword = value?.encodeURLParameter()\n }\n\n public var encodedFragment: String = fragment.encodeURLQueryComponent()\n public var fragment: String\n get() = encodedFragment.decodeURLQueryComponent()\n set(value) {\n encodedFragment = value.encodeURLQueryComponent()\n }\n\n public var encodedPathSegments: List = pathSegments.map { it.encodeURLPathPart() }\n\n public var pathSegments: List\n get() = encodedPathSegments.map { it.decodeURLPart() }\n set(value) {\n encodedPathSegments = value.map { it.encodeURLPathPart() }\n }\n\n public var encodedParameters: ParametersBuilder = encodeParameters(parameters)\n set(value) {\n field = value\n parameters = UrlDecodedParametersBuilder(value)\n }\n\n public var parameters: ParametersBuilder = UrlDecodedParametersBuilder(encodedParameters)\n private set\n\n /**\n * Build a URL string\n */\n // note: 256 should fit 99.5% of all urls according to http://www.supermind.org/blog/740/average-length-of-a-url-part-2\n public fun buildString(): String {\n applyOrigin()\n return appendTo(StringBuilder(256)).toString()\n }\n\n /**\n * Build a [Url] instance (everything is copied to a new instance)\n */\n public fun build(): Url {\n applyOrigin()\n return Url(\n protocol = protocol,\n host = host,\n specifiedPort = port,\n pathSegments = pathSegments,\n parameters = parameters.build(),\n fragment = fragment,\n user = user,\n password = password,\n trailingQuery = trailingQuery,\n urlString = buildString()\n )\n }\n\n private fun applyOrigin() {\n if (host.isNotEmpty() || protocol.name == \"file\") return\n host = originUrl.host\n if (protocol == URLProtocol.HTTP) protocol = originUrl.protocol\n if (port == DEFAULT_PORT) port = originUrl.specifiedPort\n }\n\n // Required to write external extension function\n public companion object {\n private val originUrl = Url(origin)\n }\n}\n\nprivate fun URLBuilder.appendTo(out: A): A {\n out.append(protocol.name)\n\n when (protocol.name) {\n \"file\" -> {\n out.appendFile(host, encodedPath)\n return out\n }\n\n \"mailto\" -> {\n out.appendMailto(encodedUserAndPassword, host)\n return out\n }\n }\n\n out.append(\"://\")\n out.append(authority)\n\n out.appendUrlFullPath(encodedPath, encodedParameters, trailingQuery)\n\n if (encodedFragment.isNotEmpty()) {\n out.append('#')\n out.append(encodedFragment)\n }\n\n return out\n}\n\nprivate fun Appendable.appendMailto(encodedUser: String, host: String) {\n append(\":\")\n append(encodedUser)\n append(host)\n}\n\nprivate fun Appendable.appendFile(host: String, encodedPath: String) {\n append(\"://\")\n append(host)\n if (!encodedPath.startsWith('/')) {\n append('/')\n }\n append(encodedPath)\n}\n\n/**\n * Hostname of current origin.\n *\n * It uses \"http://localhost\" for all platforms except js.\n */\npublic expect val URLBuilder.Companion.origin: String\n\n/**\n * Create a copy of this builder. Modifications in a copy is not reflected in the original instance and vise-versa.\n */\npublic fun URLBuilder.clone(): URLBuilder = URLBuilder().takeFrom(this)\n\ninternal val URLBuilder.encodedUserAndPassword: String\n get() = buildString {\n appendUserAndPassword(encodedUser, encodedPassword)\n }\n\n/**\n * Adds [segments] to current [encodedPath].\n *\n * @param segments path items to append\n * @param encodeSlash `true` to encode the '/' character to allow it to be a part of a path segment;\n * `false` to use '/' as a separator between path segments.\n */\npublic fun URLBuilder.appendPathSegments(segments: List, encodeSlash: Boolean = false): URLBuilder {\n val pathSegments = if (!encodeSlash) segments.flatMap { it.split('/') } else segments\n val encodedSegments = pathSegments.map { it.encodeURLPathPart() }\n appendEncodedPathSegments(encodedSegments)\n\n return this\n}\n\n/**\n * Adds [components] to current [encodedPath]\n *\n * @param components path items to append\n * @param encodeSlash `true` to encode the '/' character to allow it to be a part of a path segment;\n * `false` to use '/' as a separator between path segments.\n */\npublic fun URLBuilder.appendPathSegments(vararg components: String, encodeSlash: Boolean = false): URLBuilder {\n return appendPathSegments(components.toList(), encodeSlash)\n}\n\n/**\n * Replace [components] in the current [encodedPath]. The [path] components will be escaped, except `/` character.\n * @param path path items to set\n */\npublic fun URLBuilder.path(vararg path: String) {\n encodedPathSegments = path.map { it.encodeURLPath() }\n}\n\n/**\n * Adds [segments] to current [encodedPath]\n */\npublic fun URLBuilder.appendEncodedPathSegments(segments: List): URLBuilder {\n val endsWithSlash =\n encodedPathSegments.size > 1 && encodedPathSegments.last().isEmpty() && segments.isNotEmpty()\n val startWithSlash =\n segments.size > 1 && segments.first().isEmpty() && encodedPathSegments.isNotEmpty()\n encodedPathSegments = when {\n endsWithSlash && startWithSlash -> encodedPathSegments.dropLast(1) + segments.drop(1)\n endsWithSlash -> encodedPathSegments.dropLast(1) + segments\n startWithSlash -> encodedPathSegments + segments.drop(1)\n else -> encodedPathSegments + segments\n }\n return this\n}\n\n/**\n * Adds [components] to current [encodedPath]\n */\npublic fun URLBuilder.appendEncodedPathSegments(vararg components: String): URLBuilder =\n appendEncodedPathSegments(components.toList())\n\n/**\n * [URLBuilder] authority.\n */\npublic val URLBuilder.authority: String\n get() = buildString {\n append(encodedUserAndPassword)\n append(host)\n\n if (port != DEFAULT_PORT && port != protocol.defaultPort) {\n append(\":\")\n append(port.toString())\n }\n }\n\npublic var URLBuilder.encodedPath: String\n get() = encodedPathSegments.joinPath()\n set(value) {\n encodedPathSegments = when {\n value.isBlank() -> emptyList()\n value == \"/\" -> ROOT_PATH\n else -> value.split('/').toMutableList()\n }\n }\n\nprivate fun List.joinPath(): String {\n if (isEmpty()) return \"\"\n if (size == 1) {\n if (first().isEmpty()) return \"/\"\n return first()\n }\n\n return joinToString(\"/\")\n}\n\n/**\n * Sets the url parts using the specified [scheme], [host], [port] and [path].\n * Pass `null` to keep existing value in the [URLBuilder].\n */\npublic fun URLBuilder.set(\n scheme: String? = null,\n host: String? = null,\n port: Int? = null,\n path: String? = null,\n block: URLBuilder.() -> Unit = {}\n) {\n if (scheme != null) protocol = URLProtocol.createOrDefault(scheme)\n if (host != null) this.host = host\n if (port != null) this.port = port\n if (path != null) encodedPath = path\n block(this)\n}\n\n@Deprecated(level = DeprecationLevel.HIDDEN, message = \"Plesae use method with boolean parameter\")\npublic fun URLBuilder.appendPathSegments(segments: List): URLBuilder =\n appendPathSegments(segments, false)\n\n@Deprecated(level = DeprecationLevel.HIDDEN, message = \"Plesae use method with boolean parameter\")\npublic fun URLBuilder.appendPathSegments(vararg components: String): URLBuilder =\n appendPathSegments(components.toList(), false)\n\n@Deprecated(\n message = \"Please use appendPathSegments method\",\n replaceWith = ReplaceWith(\"this.appendPathSegments(components\")\n)\npublic fun URLBuilder.pathComponents(vararg components: String): URLBuilder = appendPathSegments(components.toList())\n\n@Deprecated(\n message = \"Please use appendPathSegments method\",\n replaceWith = ReplaceWith(\"this.appendPathSegments(components\")\n)\npublic fun URLBuilder.pathComponents(components: List): URLBuilder = appendPathSegments(components)\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http\n\nimport io.ktor.util.*\n\ninternal val ROOT_PATH = listOf(\"\")\n\n/**\n * Take url parts from [urlString]\n * throws [URLParserException]\n */\npublic fun URLBuilder.takeFrom(urlString: String): URLBuilder {\n if (urlString.isBlank()) return this\n\n return try {\n takeFromUnsafe(urlString)\n } catch (cause: Throwable) {\n throw URLParserException(urlString, cause)\n }\n}\n\n/**\n * Thrown when failed to parse URL\n */\npublic class URLParserException(urlString: String, cause: Throwable) : IllegalStateException(\n \"Fail to parse url: $urlString\",\n cause\n)\n\ninternal fun URLBuilder.takeFromUnsafe(urlString: String): URLBuilder {\n var startIndex = urlString.indexOfFirst { !it.isWhitespace() }\n val endIndex = urlString.indexOfLast { !it.isWhitespace() } + 1\n\n val schemeLength = findScheme(urlString, startIndex, endIndex)\n if (schemeLength > 0) {\n val scheme = urlString.substring(startIndex, startIndex + schemeLength)\n\n protocol = URLProtocol.createOrDefault(scheme)\n startIndex += schemeLength + 1\n }\n\n // Auth & Host\n val slashCount = count(urlString, startIndex, endIndex, '/')\n startIndex += slashCount\n\n if (protocol.name == \"file\") {\n parseFile(urlString, startIndex, endIndex, slashCount)\n return this\n }\n\n if (protocol.name == \"mailto\") {\n require(slashCount == 0)\n parseMailto(urlString, startIndex, endIndex)\n return this\n }\n\n if (slashCount >= 2) {\n loop@ while (true) {\n val delimiter = urlString.indexOfAny(\"@/\\\\?#\".toCharArray(), startIndex).takeIf { it > 0 } ?: endIndex\n\n if (delimiter < endIndex && urlString[delimiter] == '@') {\n // user and password check\n val passwordIndex = urlString.indexOfColonInHostPort(startIndex, delimiter)\n if (passwordIndex != -1) {\n encodedUser = urlString.substring(startIndex, passwordIndex)\n encodedPassword = urlString.substring(passwordIndex + 1, delimiter)\n } else {\n encodedUser = urlString.substring(startIndex, delimiter)\n }\n startIndex = delimiter + 1\n } else {\n fillHost(urlString, startIndex, delimiter)\n startIndex = delimiter\n break@loop\n }\n }\n }\n\n // Path\n if (startIndex >= endIndex) {\n encodedPathSegments = if (urlString[endIndex - 1] == '/') ROOT_PATH else emptyList()\n return this\n }\n\n encodedPathSegments = if (slashCount == 0) {\n // Relative path\n // last item is either file name or empty string for directories\n encodedPathSegments.dropLast(1)\n } else {\n emptyList()\n }\n\n val pathEnd = urlString.indexOfAny(\"?#\".toCharArray(), startIndex).takeIf { it > 0 } ?: endIndex\n if (pathEnd > startIndex) {\n val rawPath = urlString.substring(startIndex, pathEnd)\n val basePath = when {\n encodedPathSegments.size == 1 && encodedPathSegments.first().isEmpty() -> emptyList()\n else -> encodedPathSegments\n }\n\n val rawChunks = if (rawPath == \"/\") ROOT_PATH else rawPath.split('/')\n\n val relativePath = when (slashCount) {\n 1 -> ROOT_PATH\n else -> emptyList()\n } + rawChunks\n\n encodedPathSegments = basePath + relativePath\n startIndex = pathEnd\n }\n\n // Query\n if (startIndex < endIndex && urlString[startIndex] == '?') {\n startIndex = parseQuery(urlString, startIndex, endIndex)\n }\n\n // Fragment\n parseFragment(urlString, startIndex, endIndex)\n return this\n}\n\nprivate fun URLBuilder.parseFile(urlString: String, startIndex: Int, endIndex: Int, slashCount: Int) {\n when (slashCount) {\n 2 -> {\n val nextSlash = urlString.indexOf('/', startIndex)\n if (nextSlash == -1 || nextSlash == endIndex) {\n host = urlString.substring(startIndex, endIndex)\n return\n }\n\n host = urlString.substring(startIndex, nextSlash)\n encodedPath = urlString.substring(nextSlash, endIndex)\n }\n 3 -> {\n host = \"\"\n encodedPath = \"/\" + urlString.substring(startIndex, endIndex)\n }\n else -> throw IllegalArgumentException(\"Invalid file url: $urlString\")\n }\n}\n\nprivate fun URLBuilder.parseMailto(urlString: String, startIndex: Int, endIndex: Int) {\n val delimiter = urlString.indexOf(\"@\", startIndex)\n if (delimiter == -1) {\n throw IllegalArgumentException(\"Invalid mailto url: $urlString, it should contain '@'.\")\n }\n\n user = urlString.substring(startIndex, delimiter).decodeURLPart()\n host = urlString.substring(delimiter + 1, endIndex)\n}\n\nprivate fun URLBuilder.parseQuery(urlString: String, startIndex: Int, endIndex: Int): Int {\n if (startIndex + 1 == endIndex) {\n trailingQuery = true\n return endIndex\n }\n\n val fragmentStart = urlString.indexOf('#', startIndex + 1).takeIf { it > 0 } ?: endIndex\n\n val rawParameters = parseQueryString(urlString.substring(startIndex + 1, fragmentStart), decode = false)\n rawParameters.forEach { key, values ->\n encodedParameters.appendAll(key, values)\n }\n\n return fragmentStart\n}\n\nprivate fun URLBuilder.parseFragment(urlString: String, startIndex: Int, endIndex: Int) {\n if (startIndex < endIndex && urlString[startIndex] == '#') {\n encodedFragment = urlString.substring(startIndex + 1, endIndex)\n }\n}\n\nprivate fun URLBuilder.fillHost(urlString: String, startIndex: Int, endIndex: Int) {\n val colonIndex = urlString.indexOfColonInHostPort(startIndex, endIndex).takeIf { it > 0 } ?: endIndex\n\n host = urlString.substring(startIndex, colonIndex)\n\n if (colonIndex + 1 < endIndex) {\n port = urlString.substring(colonIndex + 1, endIndex).toInt()\n } else {\n port = DEFAULT_PORT\n }\n}\n\n/**\n * Finds scheme in the given [urlString]. If there is no scheme found the function returns -1. If the scheme contains\n * illegal characters an [IllegalArgumentException] will be thrown. If the scheme is present and it doesn't contain\n * illegal characters the function returns the length of the scheme.\n */\nprivate fun findScheme(urlString: String, startIndex: Int, endIndex: Int): Int {\n var current = startIndex\n\n // Incorrect scheme position is used to identify the first position at which the character is not allowed in the\n // scheme or the part of the scheme. This number is reported in the exception message.\n var incorrectSchemePosition = -1\n val firstChar = urlString[current]\n if (firstChar !in 'a'..'z' && firstChar !in 'A'..'Z') {\n incorrectSchemePosition = current\n }\n\n while (current < endIndex) {\n val char = urlString[current]\n\n // Character ':' means the end of the scheme and at this point the length of the scheme should be returned or\n // the exception should be thrown in case the scheme contains illegal characters.\n if (char == ':') {\n if (incorrectSchemePosition != -1) {\n throw IllegalArgumentException(\"Illegal character in scheme at position $incorrectSchemePosition\")\n }\n\n return current - startIndex\n }\n\n // If character '/' or '?' or '#' found this is not a scheme.\n if (char == '/' || char == '?' || char == '#') return -1\n\n // Update incorrect scheme position is current char is illegal.\n if (incorrectSchemePosition == -1 &&\n char !in 'a'..'z' &&\n char !in 'A'..'Z' &&\n char !in '0'..'9' &&\n char != '.' &&\n char != '+' &&\n char != '-'\n ) {\n incorrectSchemePosition = current\n }\n\n ++current\n }\n\n return -1\n}\n\nprivate fun count(urlString: String, startIndex: Int, endIndex: Int, char: Char): Int {\n var result = 0\n while (startIndex + result < endIndex) {\n if (urlString[startIndex + result] != char) break\n result++\n }\n\n return result\n}\n\nprivate fun String.indexOfColonInHostPort(startIndex: Int, endIndex: Int): Int {\n var skip = false\n for (index in startIndex until endIndex) {\n when (this[index]) {\n '[' -> skip = true\n ']' -> skip = false\n ':' -> if (!skip) return index\n }\n }\n\n return -1\n}\n\nprivate fun Char.isLetter(): Boolean = lowercaseChar() in 'a'..'z'\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http\n\nimport io.ktor.util.*\n\n/**\n * Represents URL protocol\n * @property name of protocol (schema)\n * @property defaultPort default port for protocol or `-1` if not known\n */\npublic data class URLProtocol(val name: String, val defaultPort: Int) {\n init {\n require(name.all { it.isLowerCase() }) { \"All characters should be lower case\" }\n }\n\n @Suppress(\"PublicApiImplicitType\")\n public companion object {\n /**\n * HTTP with port 80\n */\n public val HTTP: URLProtocol = URLProtocol(\"http\", 80)\n\n /**\n * secure HTTPS with port 443\n */\n public val HTTPS: URLProtocol = URLProtocol(\"https\", 443)\n\n /**\n * Web socket over HTTP on port 80\n */\n public val WS: URLProtocol = URLProtocol(\"ws\", 80)\n\n /**\n * Web socket over secure HTTPS on port 443\n */\n public val WSS: URLProtocol = URLProtocol(\"wss\", 443)\n\n /**\n * Socks proxy url protocol.\n */\n public val SOCKS: URLProtocol = URLProtocol(\"socks\", 1080)\n\n /**\n * Protocols by names map\n */\n public val byName: Map = listOf(HTTP, HTTPS, WS, WSS, SOCKS).associateBy { it.name }\n\n /**\n * Create an instance by [name] or use already existing instance\n */\n public fun createOrDefault(name: String): URLProtocol = name.toLowerCasePreservingASCIIRules().let {\n byName[it] ?: URLProtocol(it, DEFAULT_PORT)\n }\n }\n}\n\n/**\n * Check if the protocol is websocket\n */\npublic fun URLProtocol.isWebsocket(): Boolean = name == \"ws\" || name == \"wss\"\n\n/**\n * Check if the protocol is secure\n */\npublic fun URLProtocol.isSecure(): Boolean = name == \"https\" || name == \"wss\"\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http\n\nimport io.ktor.util.*\n\n/**\n * Construct [Url] from [urlString].\n */\n@Suppress(\"FunctionName\")\npublic fun Url(urlString: String): Url = URLBuilder(urlString).build()\n\n/**\n * Construct [Url] from [builder] without building origin.\n */\n@Suppress(\"FunctionName\")\npublic fun Url(builder: URLBuilder): Url = URLBuilder().takeFrom(builder).build()\n\n/**\n * Construct [URLBuilder] from [urlString].\n */\n@Suppress(\"FunctionName\")\npublic fun URLBuilder(urlString: String): URLBuilder = URLBuilder().takeFrom(urlString)\n\n/**\n * Construct [URLBuilder] from [url].\n */\n@Suppress(\"FunctionName\")\npublic fun URLBuilder(url: Url): URLBuilder = URLBuilder().takeFrom(url)\n\n/**\n * Construct [URLBuilder] from [builder].\n */\n@Suppress(\"FunctionName\")\npublic fun URLBuilder(builder: URLBuilder): URLBuilder = URLBuilder().takeFrom(builder)\n\n/**\n * Take components from another [url] builder\n */\npublic fun URLBuilder.takeFrom(url: URLBuilder): URLBuilder {\n protocol = url.protocol\n host = url.host\n port = url.port\n encodedPathSegments = url.encodedPathSegments\n encodedUser = url.encodedUser\n encodedPassword = url.encodedPassword\n encodedParameters = ParametersBuilder().apply { appendAll(url.encodedParameters) }\n encodedFragment = url.encodedFragment\n trailingQuery = url.trailingQuery\n\n return this\n}\n\n/**\n * Take components from another [url]\n */\npublic fun URLBuilder.takeFrom(url: Url): URLBuilder {\n protocol = url.protocol\n host = url.host\n port = url.port\n encodedPath = url.encodedPath\n encodedUser = url.encodedUser\n encodedPassword = url.encodedPassword\n encodedParameters = ParametersBuilder().apply { appendAll(parseQueryString(url.encodedQuery, decode = false)) }\n encodedFragment = url.encodedFragment\n trailingQuery = url.trailingQuery\n\n return this\n}\n\n/**\n * Full encoded path with query string but without domain, port and schema\n */\npublic val Url.fullPath: String\n get() = buildString { appendUrlFullPath(encodedPath, encodedQuery, trailingQuery) }\n\n/**\n * Host:port pair, not normalized so port is always specified even if the port is schema's default\n */\npublic val Url.hostWithPort: String get() = \"$host:$port\"\n\ninternal fun Appendable.appendUrlFullPath(\n encodedPath: String,\n encodedQuery: String,\n trailingQuery: Boolean\n) {\n if (encodedPath.isNotBlank() && !encodedPath.startsWith(\"/\")) {\n append('/')\n }\n\n append(encodedPath)\n\n if (encodedQuery.isNotEmpty() || trailingQuery) {\n append(\"?\")\n }\n\n append(encodedQuery)\n}\n\npublic fun Appendable.appendUrlFullPath(\n encodedPath: String,\n encodedQueryParameters: ParametersBuilder,\n trailingQuery: Boolean\n) {\n if (encodedPath.isNotBlank() && !encodedPath.startsWith(\"/\")) {\n append('/')\n }\n\n append(encodedPath)\n\n if (!encodedQueryParameters.isEmpty() || trailingQuery) {\n append(\"?\")\n }\n\n encodedQueryParameters.entries()\n .flatMap { (key, value) ->\n if (value.isEmpty()) listOf(key to null) else value.map { key to it }\n }\n .joinTo(this, \"&\") {\n val key = it.first\n if (it.second == null) {\n key\n } else {\n val value = it.second.toString()\n \"$key=$value\"\n }\n }\n}\n\ninternal fun StringBuilder.appendUserAndPassword(encodedUser: String?, encodedPassword: String?) {\n if (encodedUser == null) {\n return\n }\n append(encodedUser)\n\n if (encodedPassword != null) {\n append(':')\n append(encodedPassword)\n }\n\n append(\"@\")\n}\n","/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.http\n\n/**\n * Represents an immutable URL\n *\n * @property protocol\n * @property host name without port (domain)\n * @property port the specified port or protocol default port\n * @property specifiedPort port number that was specified to override protocol's default\n * @property encodedPath encoded path without query string\n * @property parameters URL query parameters\n * @property fragment URL fragment (anchor name)\n * @property user username part of URL\n * @property password password part of URL\n * @property trailingQuery keep trailing question character even if there are no query parameters\n */\npublic class Url internal constructor(\n public val protocol: URLProtocol,\n public val host: String,\n public val specifiedPort: Int,\n public val pathSegments: List,\n public val parameters: Parameters,\n public val fragment: String,\n public val user: String?,\n public val password: String?,\n public val trailingQuery: Boolean,\n private val urlString: String\n) {\n init {\n require(\n specifiedPort in 0..65535 ||\n specifiedPort == DEFAULT_PORT\n ) { \"port must be between 0 and 65535, or $DEFAULT_PORT if not set\" }\n }\n\n public val port: Int get() = specifiedPort.takeUnless { it == DEFAULT_PORT } ?: protocol.defaultPort\n\n public val encodedPath: String by lazy {\n if (pathSegments.isEmpty()) {\n return@lazy \"\"\n }\n val pathStartIndex = urlString.indexOf('/', protocol.name.length + 3)\n if (pathStartIndex == -1) {\n return@lazy \"\"\n }\n val pathEndIndex = urlString.indexOfAny(charArrayOf('?', '#'), pathStartIndex)\n if (pathEndIndex == -1) {\n return@lazy urlString.substring(pathStartIndex)\n }\n urlString.substring(pathStartIndex, pathEndIndex)\n }\n\n public val encodedQuery: String by lazy {\n val queryStart = urlString.indexOf('?') + 1\n if (queryStart == 0) return@lazy \"\"\n\n val queryEnd = urlString.indexOf('#', queryStart)\n if (queryEnd == -1) return@lazy urlString.substring(queryStart)\n\n urlString.substring(queryStart, queryEnd)\n }\n\n public val encodedPathAndQuery: String by lazy {\n val pathStart = urlString.indexOf('/', protocol.name.length + 3)\n if (pathStart == -1) {\n return@lazy \"\"\n }\n val queryEnd = urlString.indexOf('#', pathStart)\n if (queryEnd == -1) {\n return@lazy urlString.substring(pathStart)\n }\n urlString.substring(pathStart, queryEnd)\n }\n\n public val encodedUser: String? by lazy {\n if (user == null) return@lazy null\n if (user.isEmpty()) return@lazy \"\"\n val usernameStart = protocol.name.length + 3\n val usernameEnd = urlString.indexOfAny(charArrayOf(':', '@'), usernameStart)\n urlString.substring(usernameStart, usernameEnd)\n }\n\n public val encodedPassword: String? by lazy {\n if (password == null) return@lazy null\n if (password.isEmpty()) return@lazy \"\"\n val passwordStart = urlString.indexOf(':', protocol.name.length + 3) + 1\n val passwordEnd = urlString.indexOf('@')\n urlString.substring(passwordStart, passwordEnd)\n }\n\n public val encodedFragment: String by lazy {\n val fragmentStart = urlString.indexOf('#') + 1\n if (fragmentStart == 0) return@lazy \"\"\n\n urlString.substring(fragmentStart)\n }\n\n override fun toString(): String = urlString\n\n override fun equals(other: Any?): Boolean {\n if (this === other) return true\n if (other == null || this::class != other::class) return false\n\n other as Url\n\n if (urlString != other.urlString) return false\n\n return true\n }\n\n override fun hashCode(): Int {\n return urlString.hashCode()\n }\n\n public companion object\n}\n\n@Suppress(\"UNUSED_PARAMETER\")\n@Deprecated(\n \"Url is not a data class anymore. Please use URLBuilder(url)\",\n level = DeprecationLevel.ERROR,\n replaceWith = ReplaceWith(\"URLBuilder(this)\")\n)\npublic fun Url.copy(\n protocol: URLProtocol = this.protocol,\n host: String = this.host,\n specifiedPort: Int = this.specifiedPort,\n encodedPath: String = this.encodedPath,\n parameters: Parameters = this.parameters,\n fragment: String = this.fragment,\n user: String? = this.user,\n password: String? = this.password,\n trailingQuery: Boolean = this.trailingQuery\n): Url = error(\"Please use URLBuilder(url)\")\n\n/**\n * [Url] authority.\n */\npublic val Url.authority: String\n get() = buildString {\n append(encodedUserAndPassword)\n\n if (specifiedPort == DEFAULT_PORT || specifiedPort == protocol.defaultPort) {\n append(host)\n } else {\n append(hostWithPort)\n }\n }\n\n/**\n * A [Url] protocol and authority.\n */\npublic val Url.protocolWithAuthority: String\n get() = buildString {\n append(protocol.name)\n append(\"://\")\n append(encodedUserAndPassword)\n\n if (specifiedPort == DEFAULT_PORT || specifiedPort == protocol.defaultPort) {\n append(host)\n } else {\n append(hostWithPort)\n }\n }\n\ninternal val Url.encodedUserAndPassword: String\n get() = buildString {\n appendUserAndPassword(encodedUser, encodedPassword)\n }\n","/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.http\n\nimport io.ktor.util.*\n\ninternal class UrlDecodedParametersBuilder(\n private val encodedParametersBuilder: ParametersBuilder\n) : ParametersBuilder {\n\n override fun build(): Parameters = decodeParameters(encodedParametersBuilder)\n\n override val caseInsensitiveName: Boolean = encodedParametersBuilder.caseInsensitiveName\n\n override fun getAll(name: String): List? = encodedParametersBuilder.getAll(name.encodeURLParameter())\n ?.map { it.decodeURLQueryComponent(plusIsSpace = true) }\n\n override fun contains(name: String): Boolean = encodedParametersBuilder.contains(name.encodeURLParameter())\n\n override fun contains(name: String, value: String): Boolean =\n encodedParametersBuilder.contains(name.encodeURLParameter(), value.encodeURLParameterValue())\n\n override fun names(): Set =\n encodedParametersBuilder.names().map { it.decodeURLQueryComponent() }.toSet()\n\n override fun isEmpty(): Boolean = encodedParametersBuilder.isEmpty()\n\n override fun entries(): Set>> = decodeParameters(encodedParametersBuilder).entries()\n\n override fun set(name: String, value: String) =\n encodedParametersBuilder.set(name.encodeURLParameter(), value.encodeURLParameterValue())\n\n override fun get(name: String): String? =\n encodedParametersBuilder[name.encodeURLParameter()]?.decodeURLQueryComponent(plusIsSpace = true)\n\n override fun append(name: String, value: String) =\n encodedParametersBuilder.append(name.encodeURLParameter(), value.encodeURLParameterValue())\n\n override fun appendAll(stringValues: StringValues) = encodedParametersBuilder.appendAllEncoded(stringValues)\n\n override fun appendAll(name: String, values: Iterable) =\n encodedParametersBuilder.appendAll(name.encodeURLParameter(), values.map { it.encodeURLParameterValue() })\n\n override fun appendMissing(stringValues: StringValues) =\n encodedParametersBuilder.appendMissing(encodeParameters(stringValues).build())\n\n override fun appendMissing(name: String, values: Iterable) =\n encodedParametersBuilder.appendMissing(name.encodeURLParameter(), values.map { it.encodeURLParameterValue() })\n\n override fun remove(name: String) =\n encodedParametersBuilder.remove(name.encodeURLParameter())\n\n override fun remove(name: String, value: String): Boolean =\n encodedParametersBuilder.remove(name.encodeURLParameter(), value.encodeURLParameterValue())\n\n override fun removeKeysWithNoEntries() = encodedParametersBuilder.removeKeysWithNoEntries()\n\n override fun clear() = encodedParametersBuilder.clear()\n}\n\ninternal fun decodeParameters(parameters: StringValuesBuilder): Parameters = ParametersBuilder()\n .apply { appendAllDecoded(parameters) }\n .build()\n\ninternal fun encodeParameters(parameters: StringValues): ParametersBuilder = ParametersBuilder()\n .apply { appendAllEncoded(parameters) }\n\nprivate fun StringValuesBuilder.appendAllDecoded(parameters: StringValuesBuilder) {\n parameters.names()\n .forEach { key ->\n val values = parameters.getAll(key) ?: emptyList()\n appendAll(\n key.decodeURLQueryComponent(),\n values.map { it.decodeURLQueryComponent(plusIsSpace = true) }\n )\n }\n}\n\nprivate fun StringValuesBuilder.appendAllEncoded(parameters: StringValues) {\n parameters.names()\n .forEach { key ->\n val values = parameters.getAll(key) ?: emptyList()\n appendAll(key.encodeURLParameter(), values.map { it.encodeURLParameterValue() })\n }\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http.content\n\nimport io.ktor.http.*\n\n/**\n * Implementation of the [OutgoingContent.ByteArrayContent] for sending array of bytes\n */\npublic class ByteArrayContent(\n private val bytes: ByteArray,\n override val contentType: ContentType? = null,\n override val status: HttpStatusCode? = null\n) : OutgoingContent.ByteArrayContent() {\n override val contentLength: Long get() = bytes.size.toLong()\n\n override fun bytes(): ByteArray = bytes\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http.content\n\nimport io.ktor.http.*\nimport io.ktor.util.*\nimport io.ktor.util.date.*\nimport kotlin.native.concurrent.*\n\n/**\n * Specifies caching properties for [OutgoingContent] such as `Cache-Control` or `Expires`.\n * @property cacheControl header\n * @property expires header\n */\npublic data class CachingOptions(val cacheControl: CacheControl? = null, val expires: GMTDate? = null)\n\n/**\n * Specifies a key for the [CacheControl] extension property for [OutgoingContent].\n */\npublic val CachingProperty: AttributeKey = AttributeKey(\"Caching\")\n\n/**\n * Gets or sets the [CacheControl] instance as an extension property on this content.\n */\npublic var OutgoingContent.caching: CachingOptions?\n get() = getProperty(CachingProperty)\n set(value) = setProperty(CachingProperty, value)\n","/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.http.content\n\nimport io.ktor.http.*\nimport io.ktor.utils.io.*\n\n/**\n * [OutgoingContent] to respond with [ByteWriteChannel].\n * The stream would be automatically closed after [body] finish.\n */\npublic class ChannelWriterContent(\n private val body: suspend ByteWriteChannel.() -> Unit,\n override val contentType: ContentType?,\n override val status: HttpStatusCode? = null,\n override val contentLength: Long? = null\n) : OutgoingContent.WriteChannelContent() {\n override suspend fun writeTo(channel: ByteWriteChannel) {\n body(channel)\n }\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http.content\n\nimport io.ktor.http.*\nimport io.ktor.http.content.PartData.*\nimport io.ktor.utils.io.*\nimport io.ktor.utils.io.core.*\n\n/**\n * Represents a multipart/form-data entry. Could be a [FormItem] or [FileItem]\n * @property dispose to be invoked when this part is no longed needed\n * @property headers of this part, could be inaccurate on some engines\n */\npublic sealed class PartData(public val dispose: () -> Unit, public val headers: Headers) {\n /**\n * Represents a multipart form item\n * @property value of this field\n */\n public class FormItem(public val value: String, dispose: () -> Unit, partHeaders: Headers) :\n PartData(dispose, partHeaders)\n\n /**\n * Represents a file item\n * @property provider of content bytes\n */\n public class FileItem(\n public val provider: () -> Input,\n dispose: () -> Unit,\n partHeaders: Headers\n ) : PartData(dispose, partHeaders) {\n /**\n * Original file name if present\n */\n public val originalFileName: String? = contentDisposition?.parameter(ContentDisposition.Parameters.FileName)\n }\n\n /**\n * Represents a binary item\n * @property provider of content bytes\n */\n public class BinaryItem(\n public val provider: () -> Input,\n dispose: () -> Unit,\n partHeaders: Headers\n ) : PartData(dispose, partHeaders)\n\n /**\n * Represents a binary part with a provider that supplies [ByteReadChannel]\n * @property provider supplies a channel to read data from\n */\n public class BinaryChannelItem(\n public val provider: () -> ByteReadChannel,\n partHeaders: Headers\n ) : PartData({}, partHeaders)\n\n /**\n * Parsed `Content-Disposition` header or `null` if missing\n */\n public val contentDisposition: ContentDisposition? by lazy(LazyThreadSafetyMode.NONE) {\n headers[HttpHeaders.ContentDisposition]?.let { ContentDisposition.parse(it) }\n }\n\n /**\n * Parsed `Content-Type` header or `null` if missing\n */\n public val contentType: ContentType? by lazy(LazyThreadSafetyMode.NONE) {\n headers[HttpHeaders.ContentType]?.let {\n ContentType.parse(\n it\n )\n }\n }\n\n /**\n * Optional part name based on `Content-Disposition` header\n */\n public val name: String? get() = contentDisposition?.name\n\n @Suppress(\"KDocMissingDocumentation\", \"unused\")\n @Deprecated(\n \"Use name property instead\",\n ReplaceWith(\"name\"),\n level = DeprecationLevel.ERROR\n )\n public val partName: String?\n get() = name\n\n @Suppress(\"KDocMissingDocumentation\", \"unused\")\n @Deprecated(\n \"Use headers property instead\",\n ReplaceWith(\"headers\"),\n level = DeprecationLevel.ERROR\n )\n public val partHeaders: Headers\n get() = headers\n}\n\n/**\n * Represents a multipart data stream that could be received from a call\n */\npublic interface MultiPartData {\n /**\n * Reads next part data or `null` if end of multipart stream encountered\n */\n public suspend fun readPart(): PartData?\n\n /**\n * An empty multipart data stream\n */\n public object Empty : MultiPartData {\n override suspend fun readPart(): PartData? {\n return null\n }\n }\n}\n\n/**\n * Parse multipart data stream and invoke [partHandler] for each [PartData] encountered\n * @param partHandler to be invoked for every part item\n */\npublic suspend fun MultiPartData.forEachPart(partHandler: suspend (PartData) -> Unit) {\n while (true) {\n val part = readPart() ?: break\n partHandler(part)\n }\n}\n\n/**\n * Parse multipart data stream and put all parts into a list\n * @return a list of part data\n */\npublic suspend fun MultiPartData.readAllParts(): List {\n var part = readPart() ?: return emptyList()\n val parts = ArrayList()\n parts.add(part)\n\n do {\n part = readPart() ?: break\n parts.add(part)\n } while (true)\n\n return parts\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http.content\n\nimport io.ktor.http.*\nimport io.ktor.util.*\nimport io.ktor.utils.io.*\nimport kotlinx.coroutines.*\nimport kotlin.coroutines.*\n\n/**\n * A subject of pipeline when body of HTTP message is `null`\n */\npublic object NullBody\n\n/**\n * Information about the content to be sent to the peer, recognized by a client or server engine\n */\npublic sealed class OutgoingContent {\n /**\n * Specifies [ContentType] for this resource.\n */\n public open val contentType: ContentType? get() = null\n\n /**\n * Specifies content length in bytes for this resource.\n *\n * If null, the resources will be sent as `Transfer-Encoding: chunked`\n */\n public open val contentLength: Long? get() = null\n\n /**\n * Status code to set when sending this content\n */\n public open val status: HttpStatusCode?\n get() = null\n\n /**\n * Headers to set when sending this content\n */\n public open val headers: Headers\n get() = Headers.Empty\n\n private var extensionProperties: Attributes? = null\n\n /**\n * Gets an extension property for this content\n */\n public open fun getProperty(key: AttributeKey): T? = extensionProperties?.getOrNull(key)\n\n /**\n * Sets an extension property for this content\n */\n public open fun setProperty(key: AttributeKey, value: T?) {\n when {\n value == null && extensionProperties == null -> return\n value == null -> extensionProperties?.remove(key)\n else -> (extensionProperties ?: Attributes()).also { extensionProperties = it }.put(key, value)\n }\n }\n\n /**\n * Trailers to set when sending this content, will be ignored if request is not in HTTP2 mode\n */\n public open fun trailers(): Headers? = null\n\n /**\n * Variant of a [OutgoingContent] without a payload\n */\n public abstract class NoContent : OutgoingContent()\n\n /**\n * Variant of a [OutgoingContent] with payload read from [ByteReadChannel]\n *\n */\n public abstract class ReadChannelContent : OutgoingContent() {\n /**\n * Provides [ByteReadChannel] for the content\n */\n public abstract fun readFrom(): ByteReadChannel\n\n /**\n * Provides [ByteReadChannel] for the given range of the content\n */\n @OptIn(DelicateCoroutinesApi::class)\n public open fun readFrom(range: LongRange): ByteReadChannel = if (range.isEmpty()) {\n ByteReadChannel.Empty\n } else {\n GlobalScope.writer(Dispatchers.Unconfined, autoFlush = true) {\n val source = readFrom()\n source.discard(range.start)\n val limit = range.endInclusive - range.start + 1\n source.copyTo(channel, limit)\n }.channel\n }\n }\n\n /**\n * Variant of a [OutgoingContent] with payload written to [ByteWriteChannel]\n */\n public abstract class WriteChannelContent : OutgoingContent() {\n /**\n * Receives [channel] provided by the engine and writes all data to it\n */\n public abstract suspend fun writeTo(channel: ByteWriteChannel)\n }\n\n /**\n * Variant of a [OutgoingContent] with payload represented as [ByteArray]\n */\n public abstract class ByteArrayContent : OutgoingContent() {\n /**\n * Provides [ByteArray] which engine will send to peer\n */\n public abstract fun bytes(): ByteArray\n }\n\n /**\n * Variant of a [OutgoingContent] for upgrading an HTTP connection\n */\n public abstract class ProtocolUpgrade : OutgoingContent() {\n final override val status: HttpStatusCode\n get() = HttpStatusCode.SwitchingProtocols\n\n /**\n * Upgrades an HTTP connection\n * @param input is a [ByteReadChannel] for an upgraded connection\n * @param output is a [ByteWriteChannel] for an upgraded connection\n * @param engineContext is a [CoroutineContext] to execute non-blocking code, such as parsing or processing\n * @param userContext is a [CoroutineContext] to execute user-provided callbacks or code potentially blocking\n */\n public abstract suspend fun upgrade(\n input: ByteReadChannel,\n output: ByteWriteChannel,\n engineContext: CoroutineContext,\n userContext: CoroutineContext\n ): Job\n }\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http.content\n\nimport io.ktor.http.*\nimport io.ktor.utils.io.charsets.*\nimport io.ktor.utils.io.core.*\n\n/**\n * Represents a text content that could be sent\n * @property text to be sent\n */\npublic class TextContent(\n public val text: String,\n override val contentType: ContentType,\n override val status: HttpStatusCode? = null\n) : OutgoingContent.ByteArrayContent() {\n private val bytes = text.toByteArray(contentType.charset() ?: Charsets.UTF_8)\n\n override val contentLength: Long\n get() = bytes.size.toLong()\n\n override fun bytes(): ByteArray = bytes\n\n override fun toString(): String = \"TextContent[$contentType] \\\"${text.take(30)}\\\"\"\n}\n","/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.http.content\n\nimport io.ktor.http.*\nimport io.ktor.util.*\nimport io.ktor.util.date.*\n\n/**\n * Specifies a key for the VersionList extension property for [OutgoingContent].\n */\npublic val VersionListProperty: AttributeKey> = AttributeKey(\"VersionList\")\n\n/**\n * Gets or sets a list of [Version] instances as an extension property on this content.\n */\npublic var OutgoingContent.versions: List\n get() = getProperty(VersionListProperty) ?: emptyList()\n set(value) = setProperty(VersionListProperty, value)\n\n/**\n * A content version.\n *\n * An example of version is [EntityTagVersion] or [LastModifiedVersion].\n */\npublic interface Version {\n /**\n * Checks [requestHeaders] against this version and returns [VersionCheckResult].\n */\n public fun check(requestHeaders: Headers): VersionCheckResult\n\n /**\n * Appends relevant headers to the builder.\n */\n public fun appendHeadersTo(builder: HeadersBuilder)\n}\n\n/**\n * Represent the result of the version comparison between content being sent and HTTP request.\n *\n * @param statusCode represents [HttpStatusCode] associated with the result.\n */\npublic enum class VersionCheckResult(public val statusCode: HttpStatusCode) {\n /**\n * Indicates that content needs to be sent to recipient.\n */\n OK(HttpStatusCode.OK),\n\n /**\n * Indicates that content has not been modified according to headers sent by the client.\n */\n NOT_MODIFIED(HttpStatusCode.NotModified),\n\n /**\n * One or more conditions given in the request header fields evaluated to false.\n */\n PRECONDITION_FAILED(HttpStatusCode.PreconditionFailed)\n}\n\n/**\n * Creates an instance of [LastModifiedVersion] that passes the given [lastModified] date through the\n * `If-Modified-Since` and `If-Unmodified-Since` conditional headers provided by the client.\n *\n * For better accuracy, use ETag instead.\n *\n * @param lastModified of the current content, for example the file's last modified date\n */\npublic data class LastModifiedVersion(val lastModified: GMTDate) : Version {\n private val truncatedModificationDate: GMTDate = lastModified.truncateToSeconds()\n\n /**\n * @return [VersionCheckResult.OK] if all headers pass or there are no headers in the request,\n * [VersionCheckResult.NOT_MODIFIED] for `If-Modified-Since`,\n * [VersionCheckResult.PRECONDITION_FAILED] for `If-Unmodified-Since`\n */\n override fun check(requestHeaders: Headers): VersionCheckResult {\n val modifiedSince = requestHeaders.getAll(HttpHeaders.IfModifiedSince)?.parseDates()\n if (modifiedSince != null && !ifModifiedSince(modifiedSince)) {\n return VersionCheckResult.NOT_MODIFIED\n }\n\n val unmodifiedSince = requestHeaders.getAll(HttpHeaders.IfUnmodifiedSince)?.parseDates()\n if (unmodifiedSince != null && !ifUnmodifiedSince(unmodifiedSince)) {\n return VersionCheckResult.PRECONDITION_FAILED\n }\n\n return VersionCheckResult.OK\n }\n\n /**\n * If-Modified-Since logic: all [dates] should be _before_ this date (truncated to seconds).\n */\n public fun ifModifiedSince(dates: List): Boolean {\n return dates.any { truncatedModificationDate > it }\n }\n\n /**\n * If-Unmodified-Since logic: all [dates] should not be before this date (truncated to seconds).\n */\n public fun ifUnmodifiedSince(dates: List): Boolean {\n return dates.all { truncatedModificationDate <= it }\n }\n\n override fun appendHeadersTo(builder: HeadersBuilder) {\n builder[HttpHeaders.LastModified] = lastModified.toHttpDate()\n }\n\n private fun List.parseDates(): List? =\n filter { it.isNotBlank() }\n .mapNotNull {\n try {\n it.fromHttpToGmtDate()\n } catch (_: Throwable) {\n // according to RFC7232 sec 3.3 illegal dates should be ignored\n null\n }\n }\n .takeIf { it.isNotEmpty() }\n}\n\n/**\n * Creates an instance of [EntityTagVersion] parsing the [spec] via [EntityTagVersion.parseSingle].\n */\n@Suppress(\"FunctionName\", \"CONFLICTING_OVERLOADS\")\npublic fun EntityTagVersion(spec: String): EntityTagVersion {\n return EntityTagVersion.parseSingle(spec)\n}\n\n/**\n * This version checks the [etag] value and pass it through conditions supplied by the remote client.\n * Depending on the conditions, it produces the return value of enum type [VersionCheckResult].\n *\n * It never handles `If-None-Match: *` as it is related to non-etag logic (for example, Last modified checks).\n *\n * @param etag - entity tag, for example file's content hash\n * @param weak - whether strong or weak validation should be applied\n * @return [VersionCheckResult.OK] if all headers pass or there was no related headers,\n * [VersionCheckResult.NOT_MODIFIED] for successful If-None-Match,\n * [VersionCheckResult.PRECONDITION_FAILED] for failed If-Match\n */\npublic data class EntityTagVersion(val etag: String, val weak: Boolean) : Version {\n private val normalized: String = when {\n etag == \"*\" -> etag\n etag.startsWith(\"\\\"\") -> etag\n else -> etag.quote()\n }\n\n init {\n for (index in etag.indices) {\n val ch = etag[index]\n if (ch <= ' ' || ch == '\\\"') {\n require(index == 0 || index == etag.lastIndex) { \"Character '$ch' is not allowed in entity-tag.\" }\n }\n }\n }\n\n override fun check(requestHeaders: Headers): VersionCheckResult {\n requestHeaders[HttpHeaders.IfNoneMatch]?.let { parse(it) }?.let { givenNoneMatchEtags ->\n noneMatch(givenNoneMatchEtags).let { result ->\n if (result != VersionCheckResult.OK) return result\n }\n }\n\n requestHeaders[HttpHeaders.IfMatch]?.let { parse(it) }?.let { givenMatchEtags ->\n match(givenMatchEtags).let { result ->\n if (result != VersionCheckResult.OK) return result\n }\n }\n\n return VersionCheckResult.OK\n }\n\n /**\n * Checks whether two entity-tags match (strong).\n */\n public fun match(other: EntityTagVersion): Boolean {\n if (this == STAR || other == STAR) return true\n return normalized == other.normalized\n }\n\n /**\n * Specifies `If-None-Match` logic using the [match] function.\n */\n public fun noneMatch(givenNoneMatchEtags: List): VersionCheckResult {\n if (STAR in givenNoneMatchEtags) return VersionCheckResult.OK\n\n if (givenNoneMatchEtags.any { match(it) }) {\n return VersionCheckResult.NOT_MODIFIED\n }\n\n return VersionCheckResult.OK\n }\n\n /**\n * Specifies `If-Match` logic using the [match] function.\n */\n public fun match(givenMatchEtags: List): VersionCheckResult {\n if (givenMatchEtags.isEmpty()) return VersionCheckResult.OK\n if (STAR in givenMatchEtags) return VersionCheckResult.OK\n\n for (given in givenMatchEtags) {\n if (match(given)) {\n return VersionCheckResult.OK\n }\n }\n\n return VersionCheckResult.PRECONDITION_FAILED\n }\n\n override fun appendHeadersTo(builder: HeadersBuilder) {\n builder.etag(normalized)\n }\n\n public companion object {\n /**\n * Instance for `*` entity-tag pattern.\n */\n public val STAR: EntityTagVersion = EntityTagVersion(\"*\", false)\n\n /**\n * Parses headers with a list of entity-tags. Useful for headers such as `If-Match`/`If-None-Match`.\n */\n public fun parse(headerValue: String): List {\n val rawEntries = parseHeaderValue(headerValue)\n return rawEntries.map { entry ->\n check(entry.quality == 1.0) { \"entity-tag quality parameter is not allowed: ${entry.quality}.\" }\n check(entry.params.isEmpty()) { \"entity-tag parameters are not allowed: ${entry.params}.\" }\n\n parseSingle(entry.value)\n }\n }\n\n /**\n * Parses a single entity-tag or pattern specification.\n */\n public fun parseSingle(value: String): EntityTagVersion {\n if (value == \"*\") return STAR\n\n val weak: Boolean\n val rawEtag: String\n\n if (value.startsWith(\"W/\")) {\n weak = true\n rawEtag = value.drop(2)\n } else {\n weak = false\n rawEtag = value\n }\n\n val etag = when {\n rawEtag.startsWith(\"\\\"\") -> rawEtag\n else -> rawEtag.quote()\n }\n\n return EntityTagVersion(etag, weak)\n }\n }\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http.parsing\n\ninternal interface Parser {\n public fun parse(input: String): ParseResult?\n\n public fun match(input: String): Boolean\n}\n\ninternal class ParseResult(\n private val mapping: Map>\n) {\n operator fun get(key: String): String? = mapping[key]?.firstOrNull()\n public fun getAll(key: String): List = mapping[key] ?: emptyList()\n\n public fun contains(key: String): Boolean = mapping.contains(key)\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http.parsing\n\ninternal sealed class Grammar\n\ninternal interface ComplexGrammar {\n val grammars: List\n}\n\ninternal interface SimpleGrammar {\n val grammar: Grammar\n}\n\ninternal class StringGrammar(val value: String) : Grammar()\ninternal class AnyOfGrammar(val value: String) : Grammar()\ninternal class RangeGrammar(val from: Char, val to: Char) : Grammar()\ninternal class RawGrammar(val value: String) : Grammar()\n\ninternal class NamedGrammar(val name: String, val grammar: Grammar) : Grammar()\n\ninternal class MaybeGrammar(override val grammar: Grammar) : Grammar(), SimpleGrammar\ninternal class ManyGrammar(override val grammar: Grammar) : Grammar(), SimpleGrammar\ninternal class AtLeastOne(override val grammar: Grammar) : Grammar(), SimpleGrammar\n\ninternal class SequenceGrammar(sourceGrammars: List) : Grammar(), ComplexGrammar {\n override val grammars: List = sourceGrammars.flatten()\n}\n\ninternal class OrGrammar(sourceGrammars: List) : Grammar(), ComplexGrammar {\n override val grammars: List = sourceGrammars.flatten()\n}\n\ninternal fun maybe(grammar: Grammar): Grammar = MaybeGrammar(grammar)\ninternal fun maybe(value: String): Grammar = MaybeGrammar(StringGrammar(value))\ninternal fun maybe(block: GrammarBuilder.() -> Unit): () -> Grammar = { maybe(GrammarBuilder().apply(block).build()) }\n\ninternal infix fun String.then(grammar: Grammar): Grammar = StringGrammar(this) then grammar\ninternal infix fun Grammar.then(grammar: Grammar): Grammar = SequenceGrammar(listOf(this, grammar))\ninternal infix fun Grammar.then(value: String): Grammar = this then StringGrammar(value)\n\ninternal infix fun Grammar.or(grammar: Grammar): Grammar = OrGrammar(listOf(this, grammar))\ninternal infix fun Grammar.or(value: String): Grammar = this or StringGrammar(value)\ninternal infix fun String.or(grammar: Grammar): Grammar = StringGrammar(this) or grammar\n\ninternal fun many(grammar: Grammar): Grammar = ManyGrammar(grammar)\ninternal fun atLeastOne(grammar: Grammar): Grammar = AtLeastOne(grammar)\n\ninternal fun Grammar.named(name: String): Grammar = NamedGrammar(name, this)\n\ninternal fun anyOf(value: String): Grammar = AnyOfGrammar(value)\ninternal infix fun Char.to(other: Char): Grammar = RangeGrammar(this, other)\n\ninternal inline fun List.flatten(): List {\n val result = mutableListOf()\n forEach {\n if (it is T) result += it.grammars else result += it\n }\n return result\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http.parsing\n\ninternal val lowAlpha get() = 'a' to 'z'\ninternal val alpha get() = ('a' to 'z') or ('A' to 'Z')\ninternal val digit get() = RawGrammar(\"\\\\d\")\ninternal val hex get() = digit or ('A' to 'F') or ('a' to 'f')\n\ninternal val alphaDigit get() = alpha or digit\ninternal val alphas get() = atLeastOne(alpha)\ninternal val digits get() = atLeastOne(digit)\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http.parsing.regex\n\nimport io.ktor.http.parsing.*\n\ninternal class RegexParser(\n private val expression: Regex,\n private val indexes: Map>\n) : Parser {\n override fun parse(input: String): ParseResult? {\n val match = expression.matchEntire(input)\n if (match == null || match.value.length != input.length) {\n return null\n }\n\n val mapping = mutableMapOf>()\n indexes.forEach { (key, locations) ->\n locations.forEach { index ->\n val result = mutableListOf()\n match.groups[index]?.let { result += it.value }\n if (result.isNotEmpty()) mapping[key] = result\n }\n }\n\n return ParseResult(mapping)\n }\n\n override fun match(input: String): Boolean = expression matches input\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http.parsing.regex\n\nimport io.ktor.http.parsing.*\n\ninternal fun Grammar.buildRegexParser(): Parser {\n val groups = mutableMapOf>()\n val expression = toRegex(groups).regex\n\n return RegexParser(Regex(expression), groups)\n}\n\nprivate class GrammarRegex(\n regexRaw: String,\n groupsCountRaw: Int = 0,\n group: Boolean = false\n) {\n val regex = if (group) \"($regexRaw)\" else regexRaw\n val groupsCount = if (group) groupsCountRaw + 1 else groupsCountRaw\n}\n\nprivate fun Grammar.toRegex(\n groups: MutableMap>,\n offset: Int = 1,\n shouldGroup: Boolean = false\n): GrammarRegex = when (this) {\n is StringGrammar -> GrammarRegex(Regex.escape(value))\n is RawGrammar -> GrammarRegex(value)\n is NamedGrammar -> {\n val nested = grammar.toRegex(groups, offset + 1)\n groups.add(name, offset)\n GrammarRegex(nested.regex, nested.groupsCount, group = true)\n }\n is ComplexGrammar -> {\n val expression = StringBuilder()\n\n var currentOffset = if (shouldGroup) offset + 1 else offset\n grammars.forEachIndexed { index, grammar ->\n val current = grammar.toRegex(groups, currentOffset, shouldGroup = true)\n\n if (index != 0 && this is OrGrammar) expression.append(\"|\")\n expression.append(current.regex)\n currentOffset += current.groupsCount\n }\n\n val groupsCount = if (shouldGroup) currentOffset - offset - 1 else currentOffset - offset\n GrammarRegex(expression.toString(), groupsCount, shouldGroup)\n }\n is SimpleGrammar -> {\n val operator = when (this) {\n is MaybeGrammar -> '?'\n is ManyGrammar -> '*'\n is AtLeastOne -> '+'\n else -> error(\"Unsupported simple grammar element: $this\")\n }\n\n val nested = grammar.toRegex(groups, offset, shouldGroup = true)\n GrammarRegex(\"${nested.regex}$operator\", nested.groupsCount)\n }\n is AnyOfGrammar -> GrammarRegex(\"[${Regex.escape(value)}]\")\n is RangeGrammar -> GrammarRegex(\"[$from-$to]\")\n else -> error(\"Unsupported grammar element: $this\")\n}\n\nprivate fun MutableMap>.add(key: String, value: Int) {\n if (!contains(key)) this[key] = mutableListOf()\n this[key]!! += value\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http\n\nimport io.ktor.util.*\nimport kotlinx.browser.*\nimport org.w3c.dom.*\nimport org.w3c.workers.*\n\n/**\n * Hostname of current origin.\n *\n * It uses \"localhost\" for all platforms except js.\n */\npublic actual val URLBuilder.Companion.origin: String\n get() = when {\n PlatformUtils.IS_BROWSER -> if (js(\"typeof window !== 'undefined'\") as Boolean) {\n window.location.origin\n } else {\n js(\"self.location.origin\") as String\n }\n else -> \"http://localhost\"\n }\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http.websocket\n\nimport io.ktor.util.*\nimport io.ktor.utils.io.charsets.*\nimport io.ktor.utils.io.core.*\n\nprivate const val WEBSOCKET_SERVER_ACCEPT_TAIL = \"258EAFA5-E914-47DA-95CA-C5AB0DC85B11\"\n\n/**\n * Calculates `Sec-WebSocket-Accept` header value\n */\npublic fun websocketServerAccept(nonce: String): String =\n sha1(\"${nonce.trim()}$WEBSOCKET_SERVER_ACCEPT_TAIL\".toByteArray(Charsets.ISO_8859_1)).encodeBase64()\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http\n\nimport io.ktor.http.parsing.*\nimport io.ktor.http.parsing.regex.*\nimport kotlin.native.concurrent.*\n\n/**\n * Check if [host] is IPv4 or IPv6 address.\n */\npublic fun hostIsIp(host: String): Boolean = IP_PARSER.match(host)\n\nprivate val IPv4address = digits then \".\" then digits then \".\" then digits then \".\" then digits\n\nprivate val IPv6address = \"[\" then atLeastOne(hex or \":\") then \"]\"\n\nprivate val IP_PARSER = (IPv4address or IPv6address).buildRegexParser()\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.http.auth\n\nimport io.ktor.http.*\nimport io.ktor.http.parsing.*\nimport io.ktor.util.*\nimport io.ktor.utils.io.charsets.*\nimport kotlin.native.concurrent.*\n\nprivate val TOKEN_EXTRA = setOf('!', '#', '$', '%', '&', '\\'', '*', '+', '-', '.', '^', '_', '`', '|', '~')\nprivate val TOKEN68_EXTRA = setOf('-', '.', '_', '~', '+', '/')\nprivate val token68Pattern = \"[a-zA-Z0-9\\\\-._~+/]+=*\".toRegex()\nprivate val escapeRegex: Regex = \"\\\\\\\\.\".toRegex()\n\n/**\n * Parses an authorization header [headerValue] into a [HttpAuthHeader].\n * @return [HttpAuthHeader] or `null` if argument string is blank.\n * @throws [ParseException] on invalid header\n */\npublic fun parseAuthorizationHeader(headerValue: String): HttpAuthHeader? {\n var index = 0\n index = headerValue.skipSpaces(index)\n\n var tokenStartIndex = index\n while (index < headerValue.length && headerValue[index].isToken()) {\n index++\n }\n\n // Auth scheme\n val authScheme = headerValue.substring(tokenStartIndex until index)\n index = headerValue.skipSpaces(index)\n tokenStartIndex = index\n\n if (authScheme.isBlank()) {\n return null\n }\n\n if (headerValue.length == index) {\n return HttpAuthHeader.Parameterized(authScheme, emptyList())\n }\n\n val token68 = matchToken68(headerValue, index)\n if (token68 != null) {\n return HttpAuthHeader.Single(authScheme, token68)\n }\n\n val parameters = matchParameters(headerValue, tokenStartIndex)\n return HttpAuthHeader.Parameterized(authScheme, parameters)\n}\n\nprivate fun matchParameters(headerValue: String, startIndex: Int): Map {\n val result = mutableMapOf()\n\n var index = startIndex\n while (index > 0 && index < headerValue.length) {\n index = matchParameter(headerValue, index, result)\n index = headerValue.skipDelimiter(index, ',')\n }\n\n return result\n}\n\nprivate fun matchParameter(headerValue: String, startIndex: Int, parameters: MutableMap): Int {\n val keyStart = headerValue.skipSpaces(startIndex)\n var index = keyStart\n\n // Take key\n while (index < headerValue.length && headerValue[index].isToken()) {\n index++\n }\n\n val key = headerValue.substring(keyStart until index)\n\n // Take '='\n index = headerValue.skipSpaces(index)\n if (index >= headerValue.length || headerValue[index] != '=') {\n throw ParseException(\"Expected `=` after parameter key '$key': $headerValue\")\n }\n\n index++\n index = headerValue.skipSpaces(index)\n\n // Take value\n var quoted = false\n var valueStart = index\n\n if (headerValue[index] == '\"') {\n quoted = true\n index++\n valueStart = index\n\n var escaped = false\n while (index < headerValue.length) {\n if (headerValue[index] == '\"' && !escaped) break\n escaped = !escaped && headerValue[index] == '\\\\'\n\n index++\n }\n\n if (index == headerValue.length) {\n throw ParseException(\"Expected closing quote'\\\"' in parameter: $headerValue \")\n }\n } else {\n while (index < headerValue.length && headerValue[index] != ' ' && headerValue[index] != ',') {\n index++\n }\n }\n\n val value = headerValue.substring(valueStart until index)\n parameters[key] = if (quoted) value.unescaped() else value\n\n if (quoted) index++\n return index\n}\n\nprivate fun matchToken68(headerValue: String, startIndex: Int): String? {\n var index = startIndex\n\n while (index < headerValue.length && headerValue[index].isToken68()) {\n index++\n }\n\n while (index < headerValue.length && headerValue[index] == '=') {\n index++\n }\n\n val onlySpaceRemaining = (index until headerValue.length).all { headerValue[it] == ' ' }\n if (onlySpaceRemaining) {\n return headerValue.substring(startIndex until index)\n }\n\n return null\n}\n\n/**\n * Describes an authentication header with a mandatory [authScheme] that usually is a standard [AuthScheme].\n *\n * This can be of type [HttpAuthHeader.Single] or [HttpAuthHeader.Parameterized].\n *\n * @property authScheme auth scheme, usually one of [AuthScheme]\n */\npublic sealed class HttpAuthHeader(public val authScheme: String) {\n init {\n if (!authScheme.matches(token68Pattern)) {\n throw ParseException(\"Invalid authScheme value: it should be token, but instead it is $authScheme\")\n }\n }\n\n /**\n * Describes an authentication header that is represented by a single [blob].\n * @property blob contains single token 68, should consist from digits, letters and one of the following: `-._~+/`\n */\n public class Single(authScheme: String, public val blob: String) : HttpAuthHeader(authScheme) {\n init {\n if (!blob.matches(token68Pattern)) {\n throw ParseException(\"Invalid blob value: it should be token68, but instead it is $blob\")\n }\n }\n\n override fun render(): String = \"$authScheme $blob\"\n override fun render(encoding: HeaderValueEncoding): String = render()\n\n override fun equals(other: Any?): Boolean {\n if (other !is Single) return false\n return other.authScheme.equals(authScheme, ignoreCase = true) &&\n other.blob.equals(blob, ignoreCase = true)\n }\n\n override fun hashCode(): Int {\n return Hash.combine(authScheme.lowercase(), blob.lowercase())\n }\n }\n\n /**\n * Describes a parameterized authentication header that is represented by a set of [parameters] encoded with [encoding].\n * @property parameters a list of auth parameters\n * @property encoding parameters encoding method, one of [HeaderValueEncoding]\n */\n public class Parameterized(\n authScheme: String,\n public val parameters: List,\n public val encoding: HeaderValueEncoding = HeaderValueEncoding.QUOTED_WHEN_REQUIRED\n ) : HttpAuthHeader(authScheme) {\n public constructor(\n authScheme: String,\n parameters: Map,\n encoding: HeaderValueEncoding = HeaderValueEncoding.QUOTED_WHEN_REQUIRED\n ) : this(authScheme, parameters.entries.map { HeaderValueParam(it.key, it.value) }, encoding)\n\n init {\n parameters.forEach {\n if (!it.name.matches(token68Pattern)) {\n throw ParseException(\"parameter name should be a token but it is ${it.name}\")\n }\n }\n }\n\n /**\n * Copies this [Parameterized] appending a new parameter [name] [value].\n */\n public fun withParameter(name: String, value: String): Parameterized =\n Parameterized(authScheme, this.parameters + HeaderValueParam(name, value), encoding)\n\n /**\n * Copies this [Parameterized] replacing parameters with [name] assigning new [value]\n * or appending if no such parameters found.\n * If there were several pairs they will be reduced into a single pair\n * at position of first occurrence discarding following pairs with this [name].\n */\n public fun withReplacedParameter(name: String, value: String): Parameterized {\n val firstIndex = parameters.indexOfFirst { it.name == name }\n if (firstIndex == -1) return withParameter(name, value)\n\n var replaced = false\n val newParameters = parameters.mapNotNull {\n when {\n it.name != name -> it\n !replaced -> {\n replaced = true\n HeaderValueParam(name, value)\n }\n else -> null\n }\n }\n\n return Parameterized(authScheme, newParameters, encoding)\n }\n\n override fun render(encoding: HeaderValueEncoding): String =\n parameters.joinToString(\", \", prefix = \"$authScheme \") { \"${it.name}=${it.value.encode(encoding)}\" }\n\n /**\n * Tries to extract the first value of a parameter [name]. Returns null when not found.\n */\n public fun parameter(name: String): String? = parameters.firstOrNull { it.name == name }?.value\n\n private fun String.encode(encoding: HeaderValueEncoding) = when (encoding) {\n HeaderValueEncoding.QUOTED_WHEN_REQUIRED -> escapeIfNeeded()\n HeaderValueEncoding.QUOTED_ALWAYS -> quote()\n HeaderValueEncoding.URI_ENCODE -> encodeURLParameter()\n }\n\n override fun render(): String = render(encoding)\n\n override fun equals(other: Any?): Boolean {\n if (other !is Parameterized) return false\n return other.authScheme.equals(authScheme, ignoreCase = true) &&\n other.parameters == parameters\n }\n\n override fun hashCode(): Int {\n return Hash.combine(authScheme.lowercase(), parameters)\n }\n }\n\n /**\n * Encodes the header with a specified [encoding].\n */\n public abstract fun render(encoding: HeaderValueEncoding): String\n\n /**\n * Encodes the header with the default [HeaderValueEncoding] for this header.\n */\n public abstract fun render(): String\n\n /**\n * Encodes the header with the default [HeaderValueEncoding] for this header.\n */\n override fun toString(): String {\n return render()\n }\n\n public companion object {\n /**\n * Generates an [AuthScheme.Basic] challenge as a [HttpAuthHeader].\n */\n public fun basicAuthChallenge(realm: String, charset: Charset?): Parameterized = Parameterized(\n AuthScheme.Basic,\n LinkedHashMap().apply {\n put(Parameters.Realm, realm)\n if (charset != null) {\n put(Parameters.Charset, charset.name)\n }\n }\n )\n\n /**\n * Generates an [AuthScheme.Digest] challenge as a [HttpAuthHeader].\n */\n public fun digestAuthChallenge(\n realm: String,\n nonce: String = generateNonce(),\n domain: List = emptyList(),\n opaque: String? = null,\n stale: Boolean? = null,\n algorithm: String = \"MD5\"\n ): Parameterized = Parameterized(\n AuthScheme.Digest,\n linkedMapOf().apply {\n put(\"realm\", realm)\n put(\"nonce\", nonce)\n if (domain.isNotEmpty()) {\n put(\"domain\", domain.joinToString(\" \"))\n }\n if (opaque != null) {\n put(\"opaque\", opaque)\n }\n if (stale != null) {\n put(\"stale\", stale.toString())\n }\n put(\"algorithm\", algorithm)\n },\n HeaderValueEncoding.QUOTED_ALWAYS\n )\n }\n\n /**\n * Standard parameters for [Parameterized] [HttpAuthHeader].\n */\n @Suppress(\"KDocMissingDocumentation\", \"PublicApiImplicitType\")\n public object Parameters {\n public const val Realm: String = \"realm\"\n public const val Charset: String = \"charset\"\n\n public const val OAuthCallback: String = \"oauth_callback\"\n public const val OAuthConsumerKey: String = \"oauth_consumer_key\"\n public const val OAuthNonce: String = \"oauth_nonce\"\n public const val OAuthToken: String = \"oauth_token\"\n public const val OAuthTokenSecret: String = \"oauth_token_secret\"\n public const val OAuthVerifier: String = \"oauth_verifier\"\n public const val OAuthSignatureMethod: String = \"oauth_signature_method\"\n public const val OAuthTimestamp: String = \"oauth_timestamp\"\n public const val OAuthVersion: String = \"oauth_version\"\n public const val OAuthSignature: String = \"oauth_signature\"\n public const val OAuthCallbackConfirmed: String = \"oauth_callback_confirmed\"\n }\n}\n\nprivate fun String.unescaped() = replace(escapeRegex) { it.value.takeLast(1) }\n\nprivate fun String.skipDelimiter(startIndex: Int, delimiter: Char): Int {\n var index = skipSpaces(startIndex)\n\n while (index < length && this[index] != delimiter) {\n index++\n }\n\n if (index == length) return -1\n index++\n\n return skipSpaces(index)\n}\n\nprivate fun String.skipSpaces(startIndex: Int): Int {\n var index = startIndex\n while (index < length && (this[index] == ' ')) {\n index++\n }\n\n return index\n}\n\nprivate fun Char.isToken68(): Boolean = (this in 'a'..'z') || (this in 'A'..'Z') || isDigit() || this in TOKEN68_EXTRA\n\nprivate fun Char.isToken(): Boolean = (this in 'a'..'z') || (this in 'A'..'Z') || isDigit() || this in TOKEN_EXTRA\n",null,"/*\n * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"UArraysKt\")\n@file:kotlin.jvm.JvmPackageName(\"kotlin.collections.unsigned\")\n\npackage kotlin.collections\n\n//\n// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt\n// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib\n//\n\nimport kotlin.random.*\nimport kotlin.ranges.contains\nimport kotlin.ranges.reversed\n\n/**\n * Returns 1st *element* from the array.\n * \n * If the size of this array is less than 1, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun UIntArray.component1(): UInt {\n return get(0)\n}\n\n/**\n * Returns 1st *element* from the array.\n * \n * If the size of this array is less than 1, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun ULongArray.component1(): ULong {\n return get(0)\n}\n\n/**\n * Returns 1st *element* from the array.\n * \n * If the size of this array is less than 1, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun UByteArray.component1(): UByte {\n return get(0)\n}\n\n/**\n * Returns 1st *element* from the array.\n * \n * If the size of this array is less than 1, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun UShortArray.component1(): UShort {\n return get(0)\n}\n\n/**\n * Returns 2nd *element* from the array.\n * \n * If the size of this array is less than 2, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun UIntArray.component2(): UInt {\n return get(1)\n}\n\n/**\n * Returns 2nd *element* from the array.\n * \n * If the size of this array is less than 2, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun ULongArray.component2(): ULong {\n return get(1)\n}\n\n/**\n * Returns 2nd *element* from the array.\n * \n * If the size of this array is less than 2, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun UByteArray.component2(): UByte {\n return get(1)\n}\n\n/**\n * Returns 2nd *element* from the array.\n * \n * If the size of this array is less than 2, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun UShortArray.component2(): UShort {\n return get(1)\n}\n\n/**\n * Returns 3rd *element* from the array.\n * \n * If the size of this array is less than 3, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun UIntArray.component3(): UInt {\n return get(2)\n}\n\n/**\n * Returns 3rd *element* from the array.\n * \n * If the size of this array is less than 3, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun ULongArray.component3(): ULong {\n return get(2)\n}\n\n/**\n * Returns 3rd *element* from the array.\n * \n * If the size of this array is less than 3, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun UByteArray.component3(): UByte {\n return get(2)\n}\n\n/**\n * Returns 3rd *element* from the array.\n * \n * If the size of this array is less than 3, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun UShortArray.component3(): UShort {\n return get(2)\n}\n\n/**\n * Returns 4th *element* from the array.\n * \n * If the size of this array is less than 4, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun UIntArray.component4(): UInt {\n return get(3)\n}\n\n/**\n * Returns 4th *element* from the array.\n * \n * If the size of this array is less than 4, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun ULongArray.component4(): ULong {\n return get(3)\n}\n\n/**\n * Returns 4th *element* from the array.\n * \n * If the size of this array is less than 4, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun UByteArray.component4(): UByte {\n return get(3)\n}\n\n/**\n * Returns 4th *element* from the array.\n * \n * If the size of this array is less than 4, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun UShortArray.component4(): UShort {\n return get(3)\n}\n\n/**\n * Returns 5th *element* from the array.\n * \n * If the size of this array is less than 5, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun UIntArray.component5(): UInt {\n return get(4)\n}\n\n/**\n * Returns 5th *element* from the array.\n * \n * If the size of this array is less than 5, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun ULongArray.component5(): ULong {\n return get(4)\n}\n\n/**\n * Returns 5th *element* from the array.\n * \n * If the size of this array is less than 5, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun UByteArray.component5(): UByte {\n return get(4)\n}\n\n/**\n * Returns 5th *element* from the array.\n * \n * If the size of this array is less than 5, throws an [IndexOutOfBoundsException] except in Kotlin/JS\n * where the behavior is unspecified.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun UShortArray.component5(): UShort {\n return get(4)\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic expect fun UIntArray.elementAt(index: Int): UInt\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic expect fun ULongArray.elementAt(index: Int): ULong\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic expect fun UByteArray.elementAt(index: Int): UByte\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic expect fun UShortArray.elementAt(index: Int): UShort\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.elementAtOrElse(index: Int, defaultValue: (Int) -> UInt): UInt {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.elementAtOrElse(index: Int, defaultValue: (Int) -> ULong): ULong {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.elementAtOrElse(index: Int, defaultValue: (Int) -> UByte): UByte {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.elementAtOrElse(index: Int, defaultValue: (Int) -> UShort): UShort {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.elementAtOrNull(index: Int): UInt? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.elementAtOrNull(index: Int): ULong? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.elementAtOrNull(index: Int): UByte? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.elementAtOrNull(index: Int): UShort? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.find(predicate: (UInt) -> Boolean): UInt? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.find(predicate: (ULong) -> Boolean): ULong? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.find(predicate: (UByte) -> Boolean): UByte? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.find(predicate: (UShort) -> Boolean): UShort? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.findLast(predicate: (UInt) -> Boolean): UInt? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.findLast(predicate: (ULong) -> Boolean): ULong? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.findLast(predicate: (UByte) -> Boolean): UByte? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.findLast(predicate: (UShort) -> Boolean): UShort? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns the first element.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.first(): UInt {\n return storage.first().toUInt()\n}\n\n/**\n * Returns the first element.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.first(): ULong {\n return storage.first().toULong()\n}\n\n/**\n * Returns the first element.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.first(): UByte {\n return storage.first().toUByte()\n}\n\n/**\n * Returns the first element.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.first(): UShort {\n return storage.first().toUShort()\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.first(predicate: (UInt) -> Boolean): UInt {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.first(predicate: (ULong) -> Boolean): ULong {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.first(predicate: (UByte) -> Boolean): UByte {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.first(predicate: (UShort) -> Boolean): UShort {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first element, or `null` if the array is empty.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.firstOrNull(): UInt? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first element, or `null` if the array is empty.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.firstOrNull(): ULong? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first element, or `null` if the array is empty.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.firstOrNull(): UByte? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first element, or `null` if the array is empty.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.firstOrNull(): UShort? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.firstOrNull(predicate: (UInt) -> Boolean): UInt? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.firstOrNull(predicate: (ULong) -> Boolean): ULong? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.firstOrNull(predicate: (UByte) -> Boolean): UByte? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.firstOrNull(predicate: (UShort) -> Boolean): UShort? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.getOrElse(index: Int, defaultValue: (Int) -> UInt): UInt {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.getOrElse(index: Int, defaultValue: (Int) -> ULong): ULong {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.getOrElse(index: Int, defaultValue: (Int) -> UByte): UByte {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.getOrElse(index: Int, defaultValue: (Int) -> UShort): UShort {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.getOrNull\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.getOrNull(index: Int): UInt? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.getOrNull\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.getOrNull(index: Int): ULong? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.getOrNull\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.getOrNull(index: Int): UByte? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this array.\n * \n * @sample samples.collections.Collections.Elements.getOrNull\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.getOrNull(index: Int): UShort? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns first index of [element], or -1 if the array does not contain element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.indexOf(element: UInt): Int {\n return storage.indexOf(element.toInt())\n}\n\n/**\n * Returns first index of [element], or -1 if the array does not contain element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.indexOf(element: ULong): Int {\n return storage.indexOf(element.toLong())\n}\n\n/**\n * Returns first index of [element], or -1 if the array does not contain element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.indexOf(element: UByte): Int {\n return storage.indexOf(element.toByte())\n}\n\n/**\n * Returns first index of [element], or -1 if the array does not contain element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.indexOf(element: UShort): Int {\n return storage.indexOf(element.toShort())\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.indexOfFirst(predicate: (UInt) -> Boolean): Int {\n return storage.indexOfFirst { predicate(it.toUInt()) }\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.indexOfFirst(predicate: (ULong) -> Boolean): Int {\n return storage.indexOfFirst { predicate(it.toULong()) }\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.indexOfFirst(predicate: (UByte) -> Boolean): Int {\n return storage.indexOfFirst { predicate(it.toUByte()) }\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the array does not contain such element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.indexOfFirst(predicate: (UShort) -> Boolean): Int {\n return storage.indexOfFirst { predicate(it.toUShort()) }\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.indexOfLast(predicate: (UInt) -> Boolean): Int {\n return storage.indexOfLast { predicate(it.toUInt()) }\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.indexOfLast(predicate: (ULong) -> Boolean): Int {\n return storage.indexOfLast { predicate(it.toULong()) }\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.indexOfLast(predicate: (UByte) -> Boolean): Int {\n return storage.indexOfLast { predicate(it.toUByte()) }\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the array does not contain such element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.indexOfLast(predicate: (UShort) -> Boolean): Int {\n return storage.indexOfLast { predicate(it.toUShort()) }\n}\n\n/**\n * Returns the last element.\n * \n * @throws NoSuchElementException if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.last(): UInt {\n return storage.last().toUInt()\n}\n\n/**\n * Returns the last element.\n * \n * @throws NoSuchElementException if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.last(): ULong {\n return storage.last().toULong()\n}\n\n/**\n * Returns the last element.\n * \n * @throws NoSuchElementException if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.last(): UByte {\n return storage.last().toUByte()\n}\n\n/**\n * Returns the last element.\n * \n * @throws NoSuchElementException if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.last(): UShort {\n return storage.last().toUShort()\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * \n * @throws NoSuchElementException if no such element is found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.last(predicate: (UInt) -> Boolean): UInt {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * \n * @throws NoSuchElementException if no such element is found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.last(predicate: (ULong) -> Boolean): ULong {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * \n * @throws NoSuchElementException if no such element is found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.last(predicate: (UByte) -> Boolean): UByte {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * \n * @throws NoSuchElementException if no such element is found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.last(predicate: (UShort) -> Boolean): UShort {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n}\n\n/**\n * Returns last index of [element], or -1 if the array does not contain element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.lastIndexOf(element: UInt): Int {\n return storage.lastIndexOf(element.toInt())\n}\n\n/**\n * Returns last index of [element], or -1 if the array does not contain element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.lastIndexOf(element: ULong): Int {\n return storage.lastIndexOf(element.toLong())\n}\n\n/**\n * Returns last index of [element], or -1 if the array does not contain element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.lastIndexOf(element: UByte): Int {\n return storage.lastIndexOf(element.toByte())\n}\n\n/**\n * Returns last index of [element], or -1 if the array does not contain element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.lastIndexOf(element: UShort): Int {\n return storage.lastIndexOf(element.toShort())\n}\n\n/**\n * Returns the last element, or `null` if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.lastOrNull(): UInt? {\n return if (isEmpty()) null else this[size - 1]\n}\n\n/**\n * Returns the last element, or `null` if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.lastOrNull(): ULong? {\n return if (isEmpty()) null else this[size - 1]\n}\n\n/**\n * Returns the last element, or `null` if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.lastOrNull(): UByte? {\n return if (isEmpty()) null else this[size - 1]\n}\n\n/**\n * Returns the last element, or `null` if the array is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.lastOrNull(): UShort? {\n return if (isEmpty()) null else this[size - 1]\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.lastOrNull(predicate: (UInt) -> Boolean): UInt? {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.lastOrNull(predicate: (ULong) -> Boolean): ULong? {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.lastOrNull(predicate: (UByte) -> Boolean): UByte? {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.lastOrNull(predicate: (UShort) -> Boolean): UShort? {\n for (index in this.indices.reversed()) {\n val element = this[index]\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns a random element from this array.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.random(): UInt {\n return random(Random)\n}\n\n/**\n * Returns a random element from this array.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.random(): ULong {\n return random(Random)\n}\n\n/**\n * Returns a random element from this array.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.random(): UByte {\n return random(Random)\n}\n\n/**\n * Returns a random element from this array.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.random(): UShort {\n return random(Random)\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.random(random: Random): UInt {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.random(random: Random): ULong {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.random(random: Random): UByte {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness.\n * \n * @throws NoSuchElementException if this array is empty.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.random(random: Random): UShort {\n if (isEmpty())\n throw NoSuchElementException(\"Array is empty.\")\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.randomOrNull(): UInt? {\n return randomOrNull(Random)\n}\n\n/**\n * Returns a random element from this array, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.randomOrNull(): ULong? {\n return randomOrNull(Random)\n}\n\n/**\n * Returns a random element from this array, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.randomOrNull(): UByte? {\n return randomOrNull(Random)\n}\n\n/**\n * Returns a random element from this array, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.randomOrNull(): UShort? {\n return randomOrNull(Random)\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun UIntArray.randomOrNull(random: Random): UInt? {\n if (isEmpty())\n return null\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun ULongArray.randomOrNull(random: Random): ULong? {\n if (isEmpty())\n return null\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun UByteArray.randomOrNull(random: Random): UByte? {\n if (isEmpty())\n return null\n return get(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this array using the specified source of randomness, or `null` if this array is empty.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun UShortArray.randomOrNull(random: Random): UShort? {\n if (isEmpty())\n return null\n return get(random.nextInt(size))\n}\n\n/**\n * Returns the single element, or throws an exception if the array is empty or has more than one element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.single(): UInt {\n return storage.single().toUInt()\n}\n\n/**\n * Returns the single element, or throws an exception if the array is empty or has more than one element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.single(): ULong {\n return storage.single().toULong()\n}\n\n/**\n * Returns the single element, or throws an exception if the array is empty or has more than one element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.single(): UByte {\n return storage.single().toUByte()\n}\n\n/**\n * Returns the single element, or throws an exception if the array is empty or has more than one element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.single(): UShort {\n return storage.single().toUShort()\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.single(predicate: (UInt) -> Boolean): UInt {\n var single: UInt? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Array contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as UInt\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.single(predicate: (ULong) -> Boolean): ULong {\n var single: ULong? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Array contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as ULong\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.single(predicate: (UByte) -> Boolean): UByte {\n var single: UByte? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Array contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as UByte\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.single(predicate: (UShort) -> Boolean): UShort {\n var single: UShort? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Array contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Array contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as UShort\n}\n\n/**\n * Returns single element, or `null` if the array is empty or has more than one element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.singleOrNull(): UInt? {\n return if (size == 1) this[0] else null\n}\n\n/**\n * Returns single element, or `null` if the array is empty or has more than one element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.singleOrNull(): ULong? {\n return if (size == 1) this[0] else null\n}\n\n/**\n * Returns single element, or `null` if the array is empty or has more than one element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.singleOrNull(): UByte? {\n return if (size == 1) this[0] else null\n}\n\n/**\n * Returns single element, or `null` if the array is empty or has more than one element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.singleOrNull(): UShort? {\n return if (size == 1) this[0] else null\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.singleOrNull(predicate: (UInt) -> Boolean): UInt? {\n var single: UInt? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.singleOrNull(predicate: (ULong) -> Boolean): ULong? {\n var single: ULong? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.singleOrNull(predicate: (UByte) -> Boolean): UByte? {\n var single: UByte? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.singleOrNull(predicate: (UShort) -> Boolean): UShort? {\n var single: UShort? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns a list containing all elements except first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.drop(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return takeLast((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.drop(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return takeLast((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.drop(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return takeLast((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.drop(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return takeLast((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.dropLastWhile(predicate: (UInt) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return take(index + 1)\n }\n }\n return emptyList()\n}\n\n/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.dropLastWhile(predicate: (ULong) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return take(index + 1)\n }\n }\n return emptyList()\n}\n\n/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.dropLastWhile(predicate: (UByte) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return take(index + 1)\n }\n }\n return emptyList()\n}\n\n/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.dropLastWhile(predicate: (UShort) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return take(index + 1)\n }\n }\n return emptyList()\n}\n\n/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.dropWhile(predicate: (UInt) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.dropWhile(predicate: (ULong) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.dropWhile(predicate: (UByte) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.dropWhile(predicate: (UShort) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.filter(predicate: (UInt) -> Boolean): List {\n return filterTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.filter(predicate: (ULong) -> Boolean): List {\n return filterTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.filter(predicate: (UByte) -> Boolean): List {\n return filterTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.filter(predicate: (UShort) -> Boolean): List {\n return filterTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexed\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.filterIndexed(predicate: (index: Int, UInt) -> Boolean): List {\n return filterIndexedTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexed\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.filterIndexed(predicate: (index: Int, ULong) -> Boolean): List {\n return filterIndexedTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexed\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.filterIndexed(predicate: (index: Int, UByte) -> Boolean): List {\n return filterIndexedTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexed\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.filterIndexed(predicate: (index: Int, UShort) -> Boolean): List {\n return filterIndexedTo(ArrayList(), predicate)\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexedTo\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UIntArray.filterIndexedTo(destination: C, predicate: (index: Int, UInt) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexedTo\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > ULongArray.filterIndexedTo(destination: C, predicate: (index: Int, ULong) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexedTo\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UByteArray.filterIndexedTo(destination: C, predicate: (index: Int, UByte) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexedTo\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UShortArray.filterIndexedTo(destination: C, predicate: (index: Int, UShort) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Returns a list containing all elements not matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.filterNot(predicate: (UInt) -> Boolean): List {\n return filterNotTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing all elements not matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.filterNot(predicate: (ULong) -> Boolean): List {\n return filterNotTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing all elements not matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.filterNot(predicate: (UByte) -> Boolean): List {\n return filterNotTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing all elements not matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.filterNot(predicate: (UShort) -> Boolean): List {\n return filterNotTo(ArrayList(), predicate)\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UIntArray.filterNotTo(destination: C, predicate: (UInt) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > ULongArray.filterNotTo(destination: C, predicate: (ULong) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UByteArray.filterNotTo(destination: C, predicate: (UByte) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UShortArray.filterNotTo(destination: C, predicate: (UShort) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UIntArray.filterTo(destination: C, predicate: (UInt) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > ULongArray.filterTo(destination: C, predicate: (ULong) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UByteArray.filterTo(destination: C, predicate: (UByte) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UShortArray.filterTo(destination: C, predicate: (UShort) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Returns a list containing elements at indices in the specified [indices] range.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.slice(indices: IntRange): List {\n if (indices.isEmpty()) return listOf()\n return copyOfRange(indices.start, indices.endInclusive + 1).asList()\n}\n\n/**\n * Returns a list containing elements at indices in the specified [indices] range.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.slice(indices: IntRange): List {\n if (indices.isEmpty()) return listOf()\n return copyOfRange(indices.start, indices.endInclusive + 1).asList()\n}\n\n/**\n * Returns a list containing elements at indices in the specified [indices] range.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.slice(indices: IntRange): List {\n if (indices.isEmpty()) return listOf()\n return copyOfRange(indices.start, indices.endInclusive + 1).asList()\n}\n\n/**\n * Returns a list containing elements at indices in the specified [indices] range.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.slice(indices: IntRange): List {\n if (indices.isEmpty()) return listOf()\n return copyOfRange(indices.start, indices.endInclusive + 1).asList()\n}\n\n/**\n * Returns a list containing elements at specified [indices].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.slice(indices: Iterable): List {\n val size = indices.collectionSizeOrDefault(10)\n if (size == 0) return emptyList()\n val list = ArrayList(size)\n for (index in indices) {\n list.add(get(index))\n }\n return list\n}\n\n/**\n * Returns a list containing elements at specified [indices].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.slice(indices: Iterable): List {\n val size = indices.collectionSizeOrDefault(10)\n if (size == 0) return emptyList()\n val list = ArrayList(size)\n for (index in indices) {\n list.add(get(index))\n }\n return list\n}\n\n/**\n * Returns a list containing elements at specified [indices].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.slice(indices: Iterable): List {\n val size = indices.collectionSizeOrDefault(10)\n if (size == 0) return emptyList()\n val list = ArrayList(size)\n for (index in indices) {\n list.add(get(index))\n }\n return list\n}\n\n/**\n * Returns a list containing elements at specified [indices].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.slice(indices: Iterable): List {\n val size = indices.collectionSizeOrDefault(10)\n if (size == 0) return emptyList()\n val list = ArrayList(size)\n for (index in indices) {\n list.add(get(index))\n }\n return list\n}\n\n/**\n * Returns an array containing elements of this array at specified [indices].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.sliceArray(indices: Collection): UIntArray {\n return UIntArray(storage.sliceArray(indices))\n}\n\n/**\n * Returns an array containing elements of this array at specified [indices].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.sliceArray(indices: Collection): ULongArray {\n return ULongArray(storage.sliceArray(indices))\n}\n\n/**\n * Returns an array containing elements of this array at specified [indices].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.sliceArray(indices: Collection): UByteArray {\n return UByteArray(storage.sliceArray(indices))\n}\n\n/**\n * Returns an array containing elements of this array at specified [indices].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.sliceArray(indices: Collection): UShortArray {\n return UShortArray(storage.sliceArray(indices))\n}\n\n/**\n * Returns an array containing elements at indices in the specified [indices] range.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.sliceArray(indices: IntRange): UIntArray {\n return UIntArray(storage.sliceArray(indices))\n}\n\n/**\n * Returns an array containing elements at indices in the specified [indices] range.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.sliceArray(indices: IntRange): ULongArray {\n return ULongArray(storage.sliceArray(indices))\n}\n\n/**\n * Returns an array containing elements at indices in the specified [indices] range.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.sliceArray(indices: IntRange): UByteArray {\n return UByteArray(storage.sliceArray(indices))\n}\n\n/**\n * Returns an array containing elements at indices in the specified [indices] range.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.sliceArray(indices: IntRange): UShortArray {\n return UShortArray(storage.sliceArray(indices))\n}\n\n/**\n * Returns a list containing first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.take(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n if (n >= size) return toList()\n if (n == 1) return listOf(this[0])\n var count = 0\n val list = ArrayList(n)\n for (item in this) {\n list.add(item)\n if (++count == n)\n break\n }\n return list\n}\n\n/**\n * Returns a list containing first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.take(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n if (n >= size) return toList()\n if (n == 1) return listOf(this[0])\n var count = 0\n val list = ArrayList(n)\n for (item in this) {\n list.add(item)\n if (++count == n)\n break\n }\n return list\n}\n\n/**\n * Returns a list containing first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.take(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n if (n >= size) return toList()\n if (n == 1) return listOf(this[0])\n var count = 0\n val list = ArrayList(n)\n for (item in this) {\n list.add(item)\n if (++count == n)\n break\n }\n return list\n}\n\n/**\n * Returns a list containing first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.take(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n if (n >= size) return toList()\n if (n == 1) return listOf(this[0])\n var count = 0\n val list = ArrayList(n)\n for (item in this) {\n list.add(item)\n if (++count == n)\n break\n }\n return list\n}\n\n/**\n * Returns a list containing last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.takeLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n val size = size\n if (n >= size) return toList()\n if (n == 1) return listOf(this[size - 1])\n val list = ArrayList(n)\n for (index in size - n until size)\n list.add(this[index])\n return list\n}\n\n/**\n * Returns a list containing last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.takeLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n val size = size\n if (n >= size) return toList()\n if (n == 1) return listOf(this[size - 1])\n val list = ArrayList(n)\n for (index in size - n until size)\n list.add(this[index])\n return list\n}\n\n/**\n * Returns a list containing last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.takeLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n val size = size\n if (n >= size) return toList()\n if (n == 1) return listOf(this[size - 1])\n val list = ArrayList(n)\n for (index in size - n until size)\n list.add(this[index])\n return list\n}\n\n/**\n * Returns a list containing last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.takeLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n val size = size\n if (n >= size) return toList()\n if (n == 1) return listOf(this[size - 1])\n val list = ArrayList(n)\n for (index in size - n until size)\n list.add(this[index])\n return list\n}\n\n/**\n * Returns a list containing last elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.takeLastWhile(predicate: (UInt) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return drop(index + 1)\n }\n }\n return toList()\n}\n\n/**\n * Returns a list containing last elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.takeLastWhile(predicate: (ULong) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return drop(index + 1)\n }\n }\n return toList()\n}\n\n/**\n * Returns a list containing last elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.takeLastWhile(predicate: (UByte) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return drop(index + 1)\n }\n }\n return toList()\n}\n\n/**\n * Returns a list containing last elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.takeLastWhile(predicate: (UShort) -> Boolean): List {\n for (index in lastIndex downTo 0) {\n if (!predicate(this[index])) {\n return drop(index + 1)\n }\n }\n return toList()\n}\n\n/**\n * Returns a list containing first elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.takeWhile(predicate: (UInt) -> Boolean): List {\n val list = ArrayList()\n for (item in this) {\n if (!predicate(item))\n break\n list.add(item)\n }\n return list\n}\n\n/**\n * Returns a list containing first elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.takeWhile(predicate: (ULong) -> Boolean): List {\n val list = ArrayList()\n for (item in this) {\n if (!predicate(item))\n break\n list.add(item)\n }\n return list\n}\n\n/**\n * Returns a list containing first elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.takeWhile(predicate: (UByte) -> Boolean): List {\n val list = ArrayList()\n for (item in this) {\n if (!predicate(item))\n break\n list.add(item)\n }\n return list\n}\n\n/**\n * Returns a list containing first elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.takeWhile(predicate: (UShort) -> Boolean): List {\n val list = ArrayList()\n for (item in this) {\n if (!predicate(item))\n break\n list.add(item)\n }\n return list\n}\n\n/**\n * Reverses elements in the array in-place.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.reverse(): Unit {\n storage.reverse()\n}\n\n/**\n * Reverses elements in the array in-place.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.reverse(): Unit {\n storage.reverse()\n}\n\n/**\n * Reverses elements in the array in-place.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.reverse(): Unit {\n storage.reverse()\n}\n\n/**\n * Reverses elements in the array in-place.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.reverse(): Unit {\n storage.reverse()\n}\n\n/**\n * Reverses elements of the array in the specified range in-place.\n * \n * @param fromIndex the start of the range (inclusive) to reverse.\n * @param toIndex the end of the range (exclusive) to reverse.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.reverse(fromIndex: Int, toIndex: Int): Unit {\n storage.reverse(fromIndex, toIndex)\n}\n\n/**\n * Reverses elements of the array in the specified range in-place.\n * \n * @param fromIndex the start of the range (inclusive) to reverse.\n * @param toIndex the end of the range (exclusive) to reverse.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.reverse(fromIndex: Int, toIndex: Int): Unit {\n storage.reverse(fromIndex, toIndex)\n}\n\n/**\n * Reverses elements of the array in the specified range in-place.\n * \n * @param fromIndex the start of the range (inclusive) to reverse.\n * @param toIndex the end of the range (exclusive) to reverse.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.reverse(fromIndex: Int, toIndex: Int): Unit {\n storage.reverse(fromIndex, toIndex)\n}\n\n/**\n * Reverses elements of the array in the specified range in-place.\n * \n * @param fromIndex the start of the range (inclusive) to reverse.\n * @param toIndex the end of the range (exclusive) to reverse.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.reverse(fromIndex: Int, toIndex: Int): Unit {\n storage.reverse(fromIndex, toIndex)\n}\n\n/**\n * Returns a list with elements in reversed order.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.reversed(): List {\n if (isEmpty()) return emptyList()\n val list = toMutableList()\n list.reverse()\n return list\n}\n\n/**\n * Returns a list with elements in reversed order.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.reversed(): List {\n if (isEmpty()) return emptyList()\n val list = toMutableList()\n list.reverse()\n return list\n}\n\n/**\n * Returns a list with elements in reversed order.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.reversed(): List {\n if (isEmpty()) return emptyList()\n val list = toMutableList()\n list.reverse()\n return list\n}\n\n/**\n * Returns a list with elements in reversed order.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.reversed(): List {\n if (isEmpty()) return emptyList()\n val list = toMutableList()\n list.reverse()\n return list\n}\n\n/**\n * Returns an array with elements of this array in reversed order.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.reversedArray(): UIntArray {\n return UIntArray(storage.reversedArray())\n}\n\n/**\n * Returns an array with elements of this array in reversed order.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.reversedArray(): ULongArray {\n return ULongArray(storage.reversedArray())\n}\n\n/**\n * Returns an array with elements of this array in reversed order.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.reversedArray(): UByteArray {\n return UByteArray(storage.reversedArray())\n}\n\n/**\n * Returns an array with elements of this array in reversed order.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.reversedArray(): UShortArray {\n return UShortArray(storage.reversedArray())\n}\n\n/**\n * Randomly shuffles elements in this array in-place.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.shuffle(): Unit {\n shuffle(Random)\n}\n\n/**\n * Randomly shuffles elements in this array in-place.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.shuffle(): Unit {\n shuffle(Random)\n}\n\n/**\n * Randomly shuffles elements in this array in-place.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.shuffle(): Unit {\n shuffle(Random)\n}\n\n/**\n * Randomly shuffles elements in this array in-place.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.shuffle(): Unit {\n shuffle(Random)\n}\n\n/**\n * Randomly shuffles elements in this array in-place using the specified [random] instance as the source of randomness.\n * \n * See: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.shuffle(random: Random): Unit {\n for (i in lastIndex downTo 1) {\n val j = random.nextInt(i + 1)\n val copy = this[i]\n this[i] = this[j]\n this[j] = copy\n }\n}\n\n/**\n * Randomly shuffles elements in this array in-place using the specified [random] instance as the source of randomness.\n * \n * See: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.shuffle(random: Random): Unit {\n for (i in lastIndex downTo 1) {\n val j = random.nextInt(i + 1)\n val copy = this[i]\n this[i] = this[j]\n this[j] = copy\n }\n}\n\n/**\n * Randomly shuffles elements in this array in-place using the specified [random] instance as the source of randomness.\n * \n * See: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.shuffle(random: Random): Unit {\n for (i in lastIndex downTo 1) {\n val j = random.nextInt(i + 1)\n val copy = this[i]\n this[i] = this[j]\n this[j] = copy\n }\n}\n\n/**\n * Randomly shuffles elements in this array in-place using the specified [random] instance as the source of randomness.\n * \n * See: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.shuffle(random: Random): Unit {\n for (i in lastIndex downTo 1) {\n val j = random.nextInt(i + 1)\n val copy = this[i]\n this[i] = this[j]\n this[j] = copy\n }\n}\n\n/**\n * Sorts elements in the array in-place descending according to their natural sort order.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.sortDescending(): Unit {\n if (size > 1) {\n sort()\n reverse()\n }\n}\n\n/**\n * Sorts elements in the array in-place descending according to their natural sort order.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.sortDescending(): Unit {\n if (size > 1) {\n sort()\n reverse()\n }\n}\n\n/**\n * Sorts elements in the array in-place descending according to their natural sort order.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.sortDescending(): Unit {\n if (size > 1) {\n sort()\n reverse()\n }\n}\n\n/**\n * Sorts elements in the array in-place descending according to their natural sort order.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.sortDescending(): Unit {\n if (size > 1) {\n sort()\n reverse()\n }\n}\n\n/**\n * Returns a list of all elements sorted according to their natural sort order.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.sorted(): List {\n return copyOf().apply { sort() }.asList()\n}\n\n/**\n * Returns a list of all elements sorted according to their natural sort order.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.sorted(): List {\n return copyOf().apply { sort() }.asList()\n}\n\n/**\n * Returns a list of all elements sorted according to their natural sort order.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.sorted(): List {\n return copyOf().apply { sort() }.asList()\n}\n\n/**\n * Returns a list of all elements sorted according to their natural sort order.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.sorted(): List {\n return copyOf().apply { sort() }.asList()\n}\n\n/**\n * Returns an array with all elements of this array sorted according to their natural sort order.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.sortedArray(): UIntArray {\n if (isEmpty()) return this\n return this.copyOf().apply { sort() }\n}\n\n/**\n * Returns an array with all elements of this array sorted according to their natural sort order.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.sortedArray(): ULongArray {\n if (isEmpty()) return this\n return this.copyOf().apply { sort() }\n}\n\n/**\n * Returns an array with all elements of this array sorted according to their natural sort order.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.sortedArray(): UByteArray {\n if (isEmpty()) return this\n return this.copyOf().apply { sort() }\n}\n\n/**\n * Returns an array with all elements of this array sorted according to their natural sort order.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.sortedArray(): UShortArray {\n if (isEmpty()) return this\n return this.copyOf().apply { sort() }\n}\n\n/**\n * Returns an array with all elements of this array sorted descending according to their natural sort order.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.sortedArrayDescending(): UIntArray {\n if (isEmpty()) return this\n return this.copyOf().apply { sortDescending() }\n}\n\n/**\n * Returns an array with all elements of this array sorted descending according to their natural sort order.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.sortedArrayDescending(): ULongArray {\n if (isEmpty()) return this\n return this.copyOf().apply { sortDescending() }\n}\n\n/**\n * Returns an array with all elements of this array sorted descending according to their natural sort order.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.sortedArrayDescending(): UByteArray {\n if (isEmpty()) return this\n return this.copyOf().apply { sortDescending() }\n}\n\n/**\n * Returns an array with all elements of this array sorted descending according to their natural sort order.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.sortedArrayDescending(): UShortArray {\n if (isEmpty()) return this\n return this.copyOf().apply { sortDescending() }\n}\n\n/**\n * Returns a list of all elements sorted descending according to their natural sort order.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.sortedDescending(): List {\n return copyOf().apply { sort() }.reversed()\n}\n\n/**\n * Returns a list of all elements sorted descending according to their natural sort order.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.sortedDescending(): List {\n return copyOf().apply { sort() }.reversed()\n}\n\n/**\n * Returns a list of all elements sorted descending according to their natural sort order.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.sortedDescending(): List {\n return copyOf().apply { sort() }.reversed()\n}\n\n/**\n * Returns a list of all elements sorted descending according to their natural sort order.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.sortedDescending(): List {\n return copyOf().apply { sort() }.reversed()\n}\n\n/**\n * Returns an array of type [ByteArray], which is a view of this array where each element is a signed reinterpretation\n * of the corresponding element of this array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.asByteArray(): ByteArray {\n return storage\n}\n\n/**\n * Returns an array of type [IntArray], which is a view of this array where each element is a signed reinterpretation\n * of the corresponding element of this array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.asIntArray(): IntArray {\n return storage\n}\n\n/**\n * Returns a [List] that wraps the original array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic expect fun UIntArray.asList(): List\n\n/**\n * Returns a [List] that wraps the original array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic expect fun ULongArray.asList(): List\n\n/**\n * Returns a [List] that wraps the original array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic expect fun UByteArray.asList(): List\n\n/**\n * Returns a [List] that wraps the original array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic expect fun UShortArray.asList(): List\n\n/**\n * Returns an array of type [LongArray], which is a view of this array where each element is a signed reinterpretation\n * of the corresponding element of this array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.asLongArray(): LongArray {\n return storage\n}\n\n/**\n * Returns an array of type [ShortArray], which is a view of this array where each element is a signed reinterpretation\n * of the corresponding element of this array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.asShortArray(): ShortArray {\n return storage\n}\n\n/**\n * Returns an array of type [UByteArray], which is a view of this array where each element is an unsigned reinterpretation\n * of the corresponding element of this array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.asUByteArray(): UByteArray {\n return UByteArray(this)\n}\n\n/**\n * Returns an array of type [UIntArray], which is a view of this array where each element is an unsigned reinterpretation\n * of the corresponding element of this array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.asUIntArray(): UIntArray {\n return UIntArray(this)\n}\n\n/**\n * Returns an array of type [ULongArray], which is a view of this array where each element is an unsigned reinterpretation\n * of the corresponding element of this array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.asULongArray(): ULongArray {\n return ULongArray(this)\n}\n\n/**\n * Returns an array of type [UShortArray], which is a view of this array where each element is an unsigned reinterpretation\n * of the corresponding element of this array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.asUShortArray(): UShortArray {\n return UShortArray(this)\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.3\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\n@ExperimentalUnsignedTypes\npublic infix fun UIntArray.contentEquals(other: UIntArray): Boolean {\n return this.contentEquals(other)\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.3\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\n@ExperimentalUnsignedTypes\npublic infix fun ULongArray.contentEquals(other: ULongArray): Boolean {\n return this.contentEquals(other)\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.3\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\n@ExperimentalUnsignedTypes\npublic infix fun UByteArray.contentEquals(other: UByteArray): Boolean {\n return this.contentEquals(other)\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.3\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\n@ExperimentalUnsignedTypes\npublic infix fun UShortArray.contentEquals(other: UShortArray): Boolean {\n return this.contentEquals(other)\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic infix fun UIntArray?.contentEquals(other: UIntArray?): Boolean {\n return this?.storage.contentEquals(other?.storage)\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic infix fun ULongArray?.contentEquals(other: ULongArray?): Boolean {\n return this?.storage.contentEquals(other?.storage)\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic infix fun UByteArray?.contentEquals(other: UByteArray?): Boolean {\n return this?.storage.contentEquals(other?.storage)\n}\n\n/**\n * Returns `true` if the two specified arrays are *structurally* equal to one another,\n * i.e. contain the same number of the same elements in the same order.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic infix fun UShortArray?.contentEquals(other: UShortArray?): Boolean {\n return this?.storage.contentEquals(other?.storage)\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.3\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.contentHashCode(): Int {\n return this.contentHashCode()\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.3\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.contentHashCode(): Int {\n return this.contentHashCode()\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.3\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.contentHashCode(): Int {\n return this.contentHashCode()\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.3\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.contentHashCode(): Int {\n return this.contentHashCode()\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray?.contentHashCode(): Int {\n return this?.storage.contentHashCode()\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray?.contentHashCode(): Int {\n return this?.storage.contentHashCode()\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray?.contentHashCode(): Int {\n return this?.storage.contentHashCode()\n}\n\n/**\n * Returns a hash code based on the contents of this array as if it is [List].\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray?.contentHashCode(): Int {\n return this?.storage.contentHashCode()\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.3\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.contentToString(): String {\n return this.contentToString()\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.3\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.contentToString(): String {\n return this.contentToString()\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.3\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.contentToString(): String {\n return this.contentToString()\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@SinceKotlin(\"1.3\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.contentToString(): String {\n return this.contentToString()\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray?.contentToString(): String {\n return this?.joinToString(\", \", \"[\", \"]\") ?: \"null\"\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray?.contentToString(): String {\n return this?.joinToString(\", \", \"[\", \"]\") ?: \"null\"\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray?.contentToString(): String {\n return this?.joinToString(\", \", \"[\", \"]\") ?: \"null\"\n}\n\n/**\n * Returns a string representation of the contents of the specified array as if it is [List].\n * \n * @sample samples.collections.Arrays.ContentOperations.contentToString\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray?.contentToString(): String {\n return this?.joinToString(\", \", \"[\", \"]\") ?: \"null\"\n}\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.copyInto(destination: UIntArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): UIntArray {\n storage.copyInto(destination.storage, destinationOffset, startIndex, endIndex)\n return destination\n}\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.copyInto(destination: ULongArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): ULongArray {\n storage.copyInto(destination.storage, destinationOffset, startIndex, endIndex)\n return destination\n}\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.copyInto(destination: UByteArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): UByteArray {\n storage.copyInto(destination.storage, destinationOffset, startIndex, endIndex)\n return destination\n}\n\n/**\n * Copies this array or its subrange into the [destination] array and returns that array.\n * \n * It's allowed to pass the same array in the [destination] and even specify the subrange so that it overlaps with the destination range.\n * \n * @param destination the array to copy to.\n * @param destinationOffset the position in the [destination] array to copy to, 0 by default.\n * @param startIndex the beginning (inclusive) of the subrange to copy, 0 by default.\n * @param endIndex the end (exclusive) of the subrange to copy, size of this array by default.\n * \n * @throws IndexOutOfBoundsException or [IllegalArgumentException] when [startIndex] or [endIndex] is out of range of this array indices or when `startIndex > endIndex`.\n * @throws IndexOutOfBoundsException when the subrange doesn't fit into the [destination] array starting at the specified [destinationOffset],\n * or when that index is out of the [destination] array indices range.\n * \n * @return the [destination] array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.copyInto(destination: UShortArray, destinationOffset: Int = 0, startIndex: Int = 0, endIndex: Int = size): UShortArray {\n storage.copyInto(destination.storage, destinationOffset, startIndex, endIndex)\n return destination\n}\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.copyOf(): UIntArray {\n return UIntArray(storage.copyOf())\n}\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.copyOf(): ULongArray {\n return ULongArray(storage.copyOf())\n}\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.copyOf(): UByteArray {\n return UByteArray(storage.copyOf())\n}\n\n/**\n * Returns new array which is a copy of the original array.\n * \n * @sample samples.collections.Arrays.CopyOfOperations.copyOf\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.copyOf(): UShortArray {\n return UShortArray(storage.copyOf())\n}\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with zero values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.copyOf(newSize: Int): UIntArray {\n return UIntArray(storage.copyOf(newSize))\n}\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with zero values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.copyOf(newSize: Int): ULongArray {\n return ULongArray(storage.copyOf(newSize))\n}\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with zero values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.copyOf(newSize: Int): UByteArray {\n return UByteArray(storage.copyOf(newSize))\n}\n\n/**\n * Returns new array which is a copy of the original array, resized to the given [newSize].\n * The copy is either truncated or padded at the end with zero values if necessary.\n * \n * - If [newSize] is less than the size of the original array, the copy array is truncated to the [newSize].\n * - If [newSize] is greater than the size of the original array, the extra elements in the copy array are filled with zero values.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.copyOf(newSize: Int): UShortArray {\n return UShortArray(storage.copyOf(newSize))\n}\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive) to copy.\n * @param toIndex the end of the range (exclusive) to copy.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.copyOfRange(fromIndex: Int, toIndex: Int): UIntArray {\n return UIntArray(storage.copyOfRange(fromIndex, toIndex))\n}\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive) to copy.\n * @param toIndex the end of the range (exclusive) to copy.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.copyOfRange(fromIndex: Int, toIndex: Int): ULongArray {\n return ULongArray(storage.copyOfRange(fromIndex, toIndex))\n}\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive) to copy.\n * @param toIndex the end of the range (exclusive) to copy.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.copyOfRange(fromIndex: Int, toIndex: Int): UByteArray {\n return UByteArray(storage.copyOfRange(fromIndex, toIndex))\n}\n\n/**\n * Returns a new array which is a copy of the specified range of the original array.\n * \n * @param fromIndex the start of the range (inclusive) to copy.\n * @param toIndex the end of the range (exclusive) to copy.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.copyOfRange(fromIndex: Int, toIndex: Int): UShortArray {\n return UShortArray(storage.copyOfRange(fromIndex, toIndex))\n}\n\n/**\n * Fills this array or its subrange with the specified [element] value.\n * \n * @param fromIndex the start of the range (inclusive) to fill, 0 by default.\n * @param toIndex the end of the range (exclusive) to fill, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.fill(element: UInt, fromIndex: Int = 0, toIndex: Int = size): Unit {\n storage.fill(element.toInt(), fromIndex, toIndex)\n}\n\n/**\n * Fills this array or its subrange with the specified [element] value.\n * \n * @param fromIndex the start of the range (inclusive) to fill, 0 by default.\n * @param toIndex the end of the range (exclusive) to fill, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.fill(element: ULong, fromIndex: Int = 0, toIndex: Int = size): Unit {\n storage.fill(element.toLong(), fromIndex, toIndex)\n}\n\n/**\n * Fills this array or its subrange with the specified [element] value.\n * \n * @param fromIndex the start of the range (inclusive) to fill, 0 by default.\n * @param toIndex the end of the range (exclusive) to fill, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.fill(element: UByte, fromIndex: Int = 0, toIndex: Int = size): Unit {\n storage.fill(element.toByte(), fromIndex, toIndex)\n}\n\n/**\n * Fills this array or its subrange with the specified [element] value.\n * \n * @param fromIndex the start of the range (inclusive) to fill, 0 by default.\n * @param toIndex the end of the range (exclusive) to fill, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.fill(element: UShort, fromIndex: Int = 0, toIndex: Int = size): Unit {\n storage.fill(element.toShort(), fromIndex, toIndex)\n}\n\n/**\n * Returns the range of valid indices for the array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic inline val UIntArray.indices: IntRange\n get() = storage.indices\n\n/**\n * Returns the range of valid indices for the array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic inline val ULongArray.indices: IntRange\n get() = storage.indices\n\n/**\n * Returns the range of valid indices for the array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic inline val UByteArray.indices: IntRange\n get() = storage.indices\n\n/**\n * Returns the range of valid indices for the array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic inline val UShortArray.indices: IntRange\n get() = storage.indices\n\n/**\n * Returns the last valid index for the array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic inline val UIntArray.lastIndex: Int\n get() = storage.lastIndex\n\n/**\n * Returns the last valid index for the array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic inline val ULongArray.lastIndex: Int\n get() = storage.lastIndex\n\n/**\n * Returns the last valid index for the array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic inline val UByteArray.lastIndex: Int\n get() = storage.lastIndex\n\n/**\n * Returns the last valid index for the array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic inline val UShortArray.lastIndex: Int\n get() = storage.lastIndex\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun UIntArray.plus(element: UInt): UIntArray {\n return UIntArray(storage + element.toInt())\n}\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun ULongArray.plus(element: ULong): ULongArray {\n return ULongArray(storage + element.toLong())\n}\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun UByteArray.plus(element: UByte): UByteArray {\n return UByteArray(storage + element.toByte())\n}\n\n/**\n * Returns an array containing all elements of the original array and then the given [element].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun UShortArray.plus(element: UShort): UShortArray {\n return UShortArray(storage + element.toShort())\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic operator fun UIntArray.plus(elements: Collection): UIntArray {\n var index = size\n val result = storage.copyOf(size + elements.size)\n for (element in elements) result[index++] = element.toInt()\n return UIntArray(result)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic operator fun ULongArray.plus(elements: Collection): ULongArray {\n var index = size\n val result = storage.copyOf(size + elements.size)\n for (element in elements) result[index++] = element.toLong()\n return ULongArray(result)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic operator fun UByteArray.plus(elements: Collection): UByteArray {\n var index = size\n val result = storage.copyOf(size + elements.size)\n for (element in elements) result[index++] = element.toByte()\n return UByteArray(result)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] collection.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic operator fun UShortArray.plus(elements: Collection): UShortArray {\n var index = size\n val result = storage.copyOf(size + elements.size)\n for (element in elements) result[index++] = element.toShort()\n return UShortArray(result)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun UIntArray.plus(elements: UIntArray): UIntArray {\n return UIntArray(storage + elements.storage)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun ULongArray.plus(elements: ULongArray): ULongArray {\n return ULongArray(storage + elements.storage)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun UByteArray.plus(elements: UByteArray): UByteArray {\n return UByteArray(storage + elements.storage)\n}\n\n/**\n * Returns an array containing all elements of the original array and then all elements of the given [elements] array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline operator fun UShortArray.plus(elements: UShortArray): UShortArray {\n return UShortArray(storage + elements.storage)\n}\n\n/**\n * Sorts the array in-place.\n * \n * @sample samples.collections.Arrays.Sorting.sortArray\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.sort(): Unit {\n if (size > 1) sortArray(this, 0, size)\n}\n\n/**\n * Sorts the array in-place.\n * \n * @sample samples.collections.Arrays.Sorting.sortArray\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.sort(): Unit {\n if (size > 1) sortArray(this, 0, size)\n}\n\n/**\n * Sorts the array in-place.\n * \n * @sample samples.collections.Arrays.Sorting.sortArray\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.sort(): Unit {\n if (size > 1) sortArray(this, 0, size)\n}\n\n/**\n * Sorts the array in-place.\n * \n * @sample samples.collections.Arrays.Sorting.sortArray\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.sort(): Unit {\n if (size > 1) sortArray(this, 0, size)\n}\n\n/**\n * Sorts a range in the array in-place.\n * \n * @param fromIndex the start of the range (inclusive) to sort, 0 by default.\n * @param toIndex the end of the range (exclusive) to sort, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n * \n * @sample samples.collections.Arrays.Sorting.sortRangeOfArray\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n sortArray(this, fromIndex, toIndex)\n}\n\n/**\n * Sorts a range in the array in-place.\n * \n * @param fromIndex the start of the range (inclusive) to sort, 0 by default.\n * @param toIndex the end of the range (exclusive) to sort, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n * \n * @sample samples.collections.Arrays.Sorting.sortRangeOfArray\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n sortArray(this, fromIndex, toIndex)\n}\n\n/**\n * Sorts a range in the array in-place.\n * \n * @param fromIndex the start of the range (inclusive) to sort, 0 by default.\n * @param toIndex the end of the range (exclusive) to sort, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n * \n * @sample samples.collections.Arrays.Sorting.sortRangeOfArray\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n sortArray(this, fromIndex, toIndex)\n}\n\n/**\n * Sorts a range in the array in-place.\n * \n * @param fromIndex the start of the range (inclusive) to sort, 0 by default.\n * @param toIndex the end of the range (exclusive) to sort, size of this array by default.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n * \n * @sample samples.collections.Arrays.Sorting.sortRangeOfArray\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {\n AbstractList.checkRangeIndexes(fromIndex, toIndex, size)\n sortArray(this, fromIndex, toIndex)\n}\n\n/**\n * Sorts elements of the array in the specified range in-place.\n * The elements are sorted descending according to their natural sort order.\n * \n * @param fromIndex the start of the range (inclusive) to sort.\n * @param toIndex the end of the range (exclusive) to sort.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.sortDescending(fromIndex: Int, toIndex: Int): Unit {\n sort(fromIndex, toIndex)\n reverse(fromIndex, toIndex)\n}\n\n/**\n * Sorts elements of the array in the specified range in-place.\n * The elements are sorted descending according to their natural sort order.\n * \n * @param fromIndex the start of the range (inclusive) to sort.\n * @param toIndex the end of the range (exclusive) to sort.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.sortDescending(fromIndex: Int, toIndex: Int): Unit {\n sort(fromIndex, toIndex)\n reverse(fromIndex, toIndex)\n}\n\n/**\n * Sorts elements of the array in the specified range in-place.\n * The elements are sorted descending according to their natural sort order.\n * \n * @param fromIndex the start of the range (inclusive) to sort.\n * @param toIndex the end of the range (exclusive) to sort.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.sortDescending(fromIndex: Int, toIndex: Int): Unit {\n sort(fromIndex, toIndex)\n reverse(fromIndex, toIndex)\n}\n\n/**\n * Sorts elements of the array in the specified range in-place.\n * The elements are sorted descending according to their natural sort order.\n * \n * @param fromIndex the start of the range (inclusive) to sort.\n * @param toIndex the end of the range (exclusive) to sort.\n * \n * @throws IndexOutOfBoundsException if [fromIndex] is less than zero or [toIndex] is greater than the size of this array.\n * @throws IllegalArgumentException if [fromIndex] is greater than [toIndex].\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.sortDescending(fromIndex: Int, toIndex: Int): Unit {\n sort(fromIndex, toIndex)\n reverse(fromIndex, toIndex)\n}\n\n/**\n * Returns an array of type [ByteArray], which is a copy of this array where each element is a signed reinterpretation\n * of the corresponding element of this array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.toByteArray(): ByteArray {\n return storage.copyOf()\n}\n\n/**\n * Returns an array of type [IntArray], which is a copy of this array where each element is a signed reinterpretation\n * of the corresponding element of this array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.toIntArray(): IntArray {\n return storage.copyOf()\n}\n\n/**\n * Returns an array of type [LongArray], which is a copy of this array where each element is a signed reinterpretation\n * of the corresponding element of this array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.toLongArray(): LongArray {\n return storage.copyOf()\n}\n\n/**\n * Returns an array of type [ShortArray], which is a copy of this array where each element is a signed reinterpretation\n * of the corresponding element of this array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.toShortArray(): ShortArray {\n return storage.copyOf()\n}\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.toTypedArray(): Array {\n return Array(size) { index -> this[index] }\n}\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.toTypedArray(): Array {\n return Array(size) { index -> this[index] }\n}\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.toTypedArray(): Array {\n return Array(size) { index -> this[index] }\n}\n\n/**\n * Returns a *typed* object array containing all of the elements of this primitive array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.toTypedArray(): Array {\n return Array(size) { index -> this[index] }\n}\n\n/**\n * Returns an array of UByte containing all of the elements of this generic array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun Array.toUByteArray(): UByteArray {\n return UByteArray(size) { index -> this[index] }\n}\n\n/**\n * Returns an array of type [UByteArray], which is a copy of this array where each element is an unsigned reinterpretation\n * of the corresponding element of this array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ByteArray.toUByteArray(): UByteArray {\n return UByteArray(this.copyOf())\n}\n\n/**\n * Returns an array of UInt containing all of the elements of this generic array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun Array.toUIntArray(): UIntArray {\n return UIntArray(size) { index -> this[index] }\n}\n\n/**\n * Returns an array of type [UIntArray], which is a copy of this array where each element is an unsigned reinterpretation\n * of the corresponding element of this array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun IntArray.toUIntArray(): UIntArray {\n return UIntArray(this.copyOf())\n}\n\n/**\n * Returns an array of ULong containing all of the elements of this generic array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun Array.toULongArray(): ULongArray {\n return ULongArray(size) { index -> this[index] }\n}\n\n/**\n * Returns an array of type [ULongArray], which is a copy of this array where each element is an unsigned reinterpretation\n * of the corresponding element of this array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun LongArray.toULongArray(): ULongArray {\n return ULongArray(this.copyOf())\n}\n\n/**\n * Returns an array of UShort containing all of the elements of this generic array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun Array.toUShortArray(): UShortArray {\n return UShortArray(size) { index -> this[index] }\n}\n\n/**\n * Returns an array of type [UShortArray], which is a copy of this array where each element is an unsigned reinterpretation\n * of the corresponding element of this array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ShortArray.toUShortArray(): UShortArray {\n return UShortArray(this.copyOf())\n}\n\n/**\n * Returns a [Map] where keys are elements from the given array and values are\n * produced by the [valueSelector] function applied to each element.\n * \n * If any two elements are equal, the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Collections.Transformations.associateWith\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.associateWith(valueSelector: (UInt) -> V): Map {\n val result = LinkedHashMap(mapCapacity(size).coerceAtLeast(16))\n return associateWithTo(result, valueSelector)\n}\n\n/**\n * Returns a [Map] where keys are elements from the given array and values are\n * produced by the [valueSelector] function applied to each element.\n * \n * If any two elements are equal, the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Collections.Transformations.associateWith\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.associateWith(valueSelector: (ULong) -> V): Map {\n val result = LinkedHashMap(mapCapacity(size).coerceAtLeast(16))\n return associateWithTo(result, valueSelector)\n}\n\n/**\n * Returns a [Map] where keys are elements from the given array and values are\n * produced by the [valueSelector] function applied to each element.\n * \n * If any two elements are equal, the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Collections.Transformations.associateWith\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.associateWith(valueSelector: (UByte) -> V): Map {\n val result = LinkedHashMap(mapCapacity(size).coerceAtLeast(16))\n return associateWithTo(result, valueSelector)\n}\n\n/**\n * Returns a [Map] where keys are elements from the given array and values are\n * produced by the [valueSelector] function applied to each element.\n * \n * If any two elements are equal, the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original array.\n * \n * @sample samples.collections.Collections.Transformations.associateWith\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.associateWith(valueSelector: (UShort) -> V): Map {\n val result = LinkedHashMap(mapCapacity(size).coerceAtLeast(16))\n return associateWithTo(result, valueSelector)\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs for each element of the given array,\n * where key is the element itself and value is provided by the [valueSelector] function applied to that key.\n * \n * If any two elements are equal, the last one overwrites the former value in the map.\n * \n * @sample samples.collections.Collections.Transformations.associateWithTo\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UIntArray.associateWithTo(destination: M, valueSelector: (UInt) -> V): M {\n for (element in this) {\n destination.put(element, valueSelector(element))\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs for each element of the given array,\n * where key is the element itself and value is provided by the [valueSelector] function applied to that key.\n * \n * If any two elements are equal, the last one overwrites the former value in the map.\n * \n * @sample samples.collections.Collections.Transformations.associateWithTo\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > ULongArray.associateWithTo(destination: M, valueSelector: (ULong) -> V): M {\n for (element in this) {\n destination.put(element, valueSelector(element))\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs for each element of the given array,\n * where key is the element itself and value is provided by the [valueSelector] function applied to that key.\n * \n * If any two elements are equal, the last one overwrites the former value in the map.\n * \n * @sample samples.collections.Collections.Transformations.associateWithTo\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UByteArray.associateWithTo(destination: M, valueSelector: (UByte) -> V): M {\n for (element in this) {\n destination.put(element, valueSelector(element))\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs for each element of the given array,\n * where key is the element itself and value is provided by the [valueSelector] function applied to that key.\n * \n * If any two elements are equal, the last one overwrites the former value in the map.\n * \n * @sample samples.collections.Collections.Transformations.associateWithTo\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UShortArray.associateWithTo(destination: M, valueSelector: (UShort) -> V): M {\n for (element in this) {\n destination.put(element, valueSelector(element))\n }\n return destination\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMap\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.flatMap(transform: (UInt) -> Iterable): List {\n return flatMapTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMap\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.flatMap(transform: (ULong) -> Iterable): List {\n return flatMapTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMap\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.flatMap(transform: (UByte) -> Iterable): List {\n return flatMapTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMap\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.flatMap(transform: (UShort) -> Iterable): List {\n return flatMapTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMapIndexed\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.flatMapIndexed(transform: (index: Int, UInt) -> Iterable): List {\n return flatMapIndexedTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMapIndexed\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.flatMapIndexed(transform: (index: Int, ULong) -> Iterable): List {\n return flatMapIndexedTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMapIndexed\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.flatMapIndexed(transform: (index: Int, UByte) -> Iterable): List {\n return flatMapIndexedTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array.\n * \n * @sample samples.collections.Collections.Transformations.flatMapIndexed\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.flatMapIndexed(transform: (index: Int, UShort) -> Iterable): List {\n return flatMapIndexedTo(ArrayList(), transform)\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array, to the given [destination].\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UIntArray.flatMapIndexedTo(destination: C, transform: (index: Int, UInt) -> Iterable): C {\n var index = 0\n for (element in this) {\n val list = transform(index++, element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array, to the given [destination].\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > ULongArray.flatMapIndexedTo(destination: C, transform: (index: Int, ULong) -> Iterable): C {\n var index = 0\n for (element in this) {\n val list = transform(index++, element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array, to the given [destination].\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UByteArray.flatMapIndexedTo(destination: C, transform: (index: Int, UByte) -> Iterable): C {\n var index = 0\n for (element in this) {\n val list = transform(index++, element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original array, to the given [destination].\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UShortArray.flatMapIndexedTo(destination: C, transform: (index: Int, UShort) -> Iterable): C {\n var index = 0\n for (element in this) {\n val list = transform(index++, element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element of original array, to the given [destination].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UIntArray.flatMapTo(destination: C, transform: (UInt) -> Iterable): C {\n for (element in this) {\n val list = transform(element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element of original array, to the given [destination].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > ULongArray.flatMapTo(destination: C, transform: (ULong) -> Iterable): C {\n for (element in this) {\n val list = transform(element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element of original array, to the given [destination].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UByteArray.flatMapTo(destination: C, transform: (UByte) -> Iterable): C {\n for (element in this) {\n val list = transform(element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element of original array, to the given [destination].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UShortArray.flatMapTo(destination: C, transform: (UShort) -> Iterable): C {\n for (element in this) {\n val list = transform(element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and returns a map where each group key is associated with a list of corresponding elements.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.groupBy(keySelector: (UInt) -> K): Map> {\n return groupByTo(LinkedHashMap>(), keySelector)\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and returns a map where each group key is associated with a list of corresponding elements.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.groupBy(keySelector: (ULong) -> K): Map> {\n return groupByTo(LinkedHashMap>(), keySelector)\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and returns a map where each group key is associated with a list of corresponding elements.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.groupBy(keySelector: (UByte) -> K): Map> {\n return groupByTo(LinkedHashMap>(), keySelector)\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and returns a map where each group key is associated with a list of corresponding elements.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.groupBy(keySelector: (UShort) -> K): Map> {\n return groupByTo(LinkedHashMap>(), keySelector)\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and returns a map where each group key is associated with a list of corresponding values.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.groupBy(keySelector: (UInt) -> K, valueTransform: (UInt) -> V): Map> {\n return groupByTo(LinkedHashMap>(), keySelector, valueTransform)\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and returns a map where each group key is associated with a list of corresponding values.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.groupBy(keySelector: (ULong) -> K, valueTransform: (ULong) -> V): Map> {\n return groupByTo(LinkedHashMap>(), keySelector, valueTransform)\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and returns a map where each group key is associated with a list of corresponding values.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.groupBy(keySelector: (UByte) -> K, valueTransform: (UByte) -> V): Map> {\n return groupByTo(LinkedHashMap>(), keySelector, valueTransform)\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and returns a map where each group key is associated with a list of corresponding values.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original array.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.groupBy(keySelector: (UShort) -> K, valueTransform: (UShort) -> V): Map> {\n return groupByTo(LinkedHashMap>(), keySelector, valueTransform)\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun >> UIntArray.groupByTo(destination: M, keySelector: (UInt) -> K): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(element)\n }\n return destination\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun >> ULongArray.groupByTo(destination: M, keySelector: (ULong) -> K): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(element)\n }\n return destination\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun >> UByteArray.groupByTo(destination: M, keySelector: (UByte) -> K): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(element)\n }\n return destination\n}\n\n/**\n * Groups elements of the original array by the key returned by the given [keySelector] function\n * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun >> UShortArray.groupByTo(destination: M, keySelector: (UShort) -> K): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(element)\n }\n return destination\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and puts to the [destination] map each group key associated with a list of corresponding values.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun >> UIntArray.groupByTo(destination: M, keySelector: (UInt) -> K, valueTransform: (UInt) -> V): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(valueTransform(element))\n }\n return destination\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and puts to the [destination] map each group key associated with a list of corresponding values.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun >> ULongArray.groupByTo(destination: M, keySelector: (ULong) -> K, valueTransform: (ULong) -> V): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(valueTransform(element))\n }\n return destination\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and puts to the [destination] map each group key associated with a list of corresponding values.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun >> UByteArray.groupByTo(destination: M, keySelector: (UByte) -> K, valueTransform: (UByte) -> V): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(valueTransform(element))\n }\n return destination\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original array\n * by the key returned by the given [keySelector] function applied to the element\n * and puts to the [destination] map each group key associated with a list of corresponding values.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun >> UShortArray.groupByTo(destination: M, keySelector: (UShort) -> K, valueTransform: (UShort) -> V): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(valueTransform(element))\n }\n return destination\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element in the original array.\n * \n * @sample samples.collections.Collections.Transformations.map\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.map(transform: (UInt) -> R): List {\n return mapTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element in the original array.\n * \n * @sample samples.collections.Collections.Transformations.map\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.map(transform: (ULong) -> R): List {\n return mapTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element in the original array.\n * \n * @sample samples.collections.Collections.Transformations.map\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.map(transform: (UByte) -> R): List {\n return mapTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element in the original array.\n * \n * @sample samples.collections.Collections.Transformations.map\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.map(transform: (UShort) -> R): List {\n return mapTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element and its index in the original array.\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.mapIndexed(transform: (index: Int, UInt) -> R): List {\n return mapIndexedTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element and its index in the original array.\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.mapIndexed(transform: (index: Int, ULong) -> R): List {\n return mapIndexedTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element and its index in the original array.\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.mapIndexed(transform: (index: Int, UByte) -> R): List {\n return mapIndexedTo(ArrayList(size), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element and its index in the original array.\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.mapIndexed(transform: (index: Int, UShort) -> R): List {\n return mapIndexedTo(ArrayList(size), transform)\n}\n\n/**\n * Applies the given [transform] function to each element and its index in the original array\n * and appends the results to the given [destination].\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UIntArray.mapIndexedTo(destination: C, transform: (index: Int, UInt) -> R): C {\n var index = 0\n for (item in this)\n destination.add(transform(index++, item))\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element and its index in the original array\n * and appends the results to the given [destination].\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > ULongArray.mapIndexedTo(destination: C, transform: (index: Int, ULong) -> R): C {\n var index = 0\n for (item in this)\n destination.add(transform(index++, item))\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element and its index in the original array\n * and appends the results to the given [destination].\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UByteArray.mapIndexedTo(destination: C, transform: (index: Int, UByte) -> R): C {\n var index = 0\n for (item in this)\n destination.add(transform(index++, item))\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element and its index in the original array\n * and appends the results to the given [destination].\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UShortArray.mapIndexedTo(destination: C, transform: (index: Int, UShort) -> R): C {\n var index = 0\n for (item in this)\n destination.add(transform(index++, item))\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element of the original array\n * and appends the results to the given [destination].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UIntArray.mapTo(destination: C, transform: (UInt) -> R): C {\n for (item in this)\n destination.add(transform(item))\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element of the original array\n * and appends the results to the given [destination].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > ULongArray.mapTo(destination: C, transform: (ULong) -> R): C {\n for (item in this)\n destination.add(transform(item))\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element of the original array\n * and appends the results to the given [destination].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UByteArray.mapTo(destination: C, transform: (UByte) -> R): C {\n for (item in this)\n destination.add(transform(item))\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element of the original array\n * and appends the results to the given [destination].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UShortArray.mapTo(destination: C, transform: (UShort) -> R): C {\n for (item in this)\n destination.add(transform(item))\n return destination\n}\n\n/**\n * Returns a lazy [Iterable] that wraps each element of the original array\n * into an [IndexedValue] containing the index of that element and the element itself.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.withIndex(): Iterable> {\n return IndexingIterable { iterator() }\n}\n\n/**\n * Returns a lazy [Iterable] that wraps each element of the original array\n * into an [IndexedValue] containing the index of that element and the element itself.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.withIndex(): Iterable> {\n return IndexingIterable { iterator() }\n}\n\n/**\n * Returns a lazy [Iterable] that wraps each element of the original array\n * into an [IndexedValue] containing the index of that element and the element itself.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.withIndex(): Iterable> {\n return IndexingIterable { iterator() }\n}\n\n/**\n * Returns a lazy [Iterable] that wraps each element of the original array\n * into an [IndexedValue] containing the index of that element and the element itself.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.withIndex(): Iterable> {\n return IndexingIterable { iterator() }\n}\n\n/**\n * Returns `true` if all elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.all\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.all(predicate: (UInt) -> Boolean): Boolean {\n for (element in this) if (!predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if all elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.all\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.all(predicate: (ULong) -> Boolean): Boolean {\n for (element in this) if (!predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if all elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.all\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.all(predicate: (UByte) -> Boolean): Boolean {\n for (element in this) if (!predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if all elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.all\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.all(predicate: (UShort) -> Boolean): Boolean {\n for (element in this) if (!predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if array has at least one element.\n * \n * @sample samples.collections.Collections.Aggregates.any\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.any(): Boolean {\n return storage.any()\n}\n\n/**\n * Returns `true` if array has at least one element.\n * \n * @sample samples.collections.Collections.Aggregates.any\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.any(): Boolean {\n return storage.any()\n}\n\n/**\n * Returns `true` if array has at least one element.\n * \n * @sample samples.collections.Collections.Aggregates.any\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.any(): Boolean {\n return storage.any()\n}\n\n/**\n * Returns `true` if array has at least one element.\n * \n * @sample samples.collections.Collections.Aggregates.any\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.any(): Boolean {\n return storage.any()\n}\n\n/**\n * Returns `true` if at least one element matches the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.anyWithPredicate\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.any(predicate: (UInt) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return true\n return false\n}\n\n/**\n * Returns `true` if at least one element matches the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.anyWithPredicate\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.any(predicate: (ULong) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return true\n return false\n}\n\n/**\n * Returns `true` if at least one element matches the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.anyWithPredicate\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.any(predicate: (UByte) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return true\n return false\n}\n\n/**\n * Returns `true` if at least one element matches the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.anyWithPredicate\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.any(predicate: (UShort) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return true\n return false\n}\n\n/**\n * Returns the number of elements matching the given [predicate].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.count(predicate: (UInt) -> Boolean): Int {\n var count = 0\n for (element in this) if (predicate(element)) ++count\n return count\n}\n\n/**\n * Returns the number of elements matching the given [predicate].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.count(predicate: (ULong) -> Boolean): Int {\n var count = 0\n for (element in this) if (predicate(element)) ++count\n return count\n}\n\n/**\n * Returns the number of elements matching the given [predicate].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.count(predicate: (UByte) -> Boolean): Int {\n var count = 0\n for (element in this) if (predicate(element)) ++count\n return count\n}\n\n/**\n * Returns the number of elements matching the given [predicate].\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.count(predicate: (UShort) -> Boolean): Int {\n var count = 0\n for (element in this) if (predicate(element)) ++count\n return count\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.fold(initial: R, operation: (acc: R, UInt) -> R): R {\n var accumulator = initial\n for (element in this) accumulator = operation(accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.fold(initial: R, operation: (acc: R, ULong) -> R): R {\n var accumulator = initial\n for (element in this) accumulator = operation(accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.fold(initial: R, operation: (acc: R, UByte) -> R): R {\n var accumulator = initial\n for (element in this) accumulator = operation(accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.fold(initial: R, operation: (acc: R, UShort) -> R): R {\n var accumulator = initial\n for (element in this) accumulator = operation(accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.foldIndexed(initial: R, operation: (index: Int, acc: R, UInt) -> R): R {\n var index = 0\n var accumulator = initial\n for (element in this) accumulator = operation(index++, accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.foldIndexed(initial: R, operation: (index: Int, acc: R, ULong) -> R): R {\n var index = 0\n var accumulator = initial\n for (element in this) accumulator = operation(index++, accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.foldIndexed(initial: R, operation: (index: Int, acc: R, UByte) -> R): R {\n var index = 0\n var accumulator = initial\n for (element in this) accumulator = operation(index++, accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.foldIndexed(initial: R, operation: (index: Int, acc: R, UShort) -> R): R {\n var index = 0\n var accumulator = initial\n for (element in this) accumulator = operation(index++, accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value, and calculates the next accumulator value.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.foldRight(initial: R, operation: (UInt, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value, and calculates the next accumulator value.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.foldRight(initial: R, operation: (ULong, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value, and calculates the next accumulator value.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.foldRight(initial: R, operation: (UByte, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value, and calculates the next accumulator value.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.foldRight(initial: R, operation: (UShort, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself\n * and current accumulator value, and calculates the next accumulator value.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.foldRightIndexed(initial: R, operation: (index: Int, UInt, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself\n * and current accumulator value, and calculates the next accumulator value.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.foldRightIndexed(initial: R, operation: (index: Int, ULong, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself\n * and current accumulator value, and calculates the next accumulator value.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.foldRightIndexed(initial: R, operation: (index: Int, UByte, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns the specified [initial] value if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself\n * and current accumulator value, and calculates the next accumulator value.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.foldRightIndexed(initial: R, operation: (index: Int, UShort, acc: R) -> R): R {\n var index = lastIndex\n var accumulator = initial\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Performs the given [action] on each element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.forEach(action: (UInt) -> Unit): Unit {\n for (element in this) action(element)\n}\n\n/**\n * Performs the given [action] on each element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.forEach(action: (ULong) -> Unit): Unit {\n for (element in this) action(element)\n}\n\n/**\n * Performs the given [action] on each element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.forEach(action: (UByte) -> Unit): Unit {\n for (element in this) action(element)\n}\n\n/**\n * Performs the given [action] on each element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.forEach(action: (UShort) -> Unit): Unit {\n for (element in this) action(element)\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.forEachIndexed(action: (index: Int, UInt) -> Unit): Unit {\n var index = 0\n for (item in this) action(index++, item)\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.forEachIndexed(action: (index: Int, ULong) -> Unit): Unit {\n var index = 0\n for (item in this) action(index++, item)\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.forEachIndexed(action: (index: Int, UByte) -> Unit): Unit {\n var index = 0\n for (item in this) action(index++, item)\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.forEachIndexed(action: (index: Int, UShort) -> Unit): Unit {\n var index = 0\n for (item in this) action(index++, item)\n}\n\n/**\n * Returns the largest element.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"maxOrThrow-U\")\n@ExperimentalUnsignedTypes\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun UIntArray.max(): UInt {\n if (isEmpty()) throw NoSuchElementException()\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (max < e) max = e\n }\n return max\n}\n\n/**\n * Returns the largest element.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"maxOrThrow-U\")\n@ExperimentalUnsignedTypes\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun ULongArray.max(): ULong {\n if (isEmpty()) throw NoSuchElementException()\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (max < e) max = e\n }\n return max\n}\n\n/**\n * Returns the largest element.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"maxOrThrow-U\")\n@ExperimentalUnsignedTypes\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun UByteArray.max(): UByte {\n if (isEmpty()) throw NoSuchElementException()\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (max < e) max = e\n }\n return max\n}\n\n/**\n * Returns the largest element.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"maxOrThrow-U\")\n@ExperimentalUnsignedTypes\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun UShortArray.max(): UShort {\n if (isEmpty()) throw NoSuchElementException()\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (max < e) max = e\n }\n return max\n}\n\n/**\n * Returns the first element yielding the largest value of the given function.\n * \n * @throws NoSuchElementException if the array is empty.\n * \n * @sample samples.collections.Collections.Aggregates.maxBy\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"maxByOrThrow-U\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic inline fun > UIntArray.maxBy(selector: (UInt) -> R): UInt {\n if (isEmpty()) throw NoSuchElementException()\n var maxElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return maxElem\n var maxValue = selector(maxElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (maxValue < v) {\n maxElem = e\n maxValue = v\n }\n }\n return maxElem\n}\n\n/**\n * Returns the first element yielding the largest value of the given function.\n * \n * @throws NoSuchElementException if the array is empty.\n * \n * @sample samples.collections.Collections.Aggregates.maxBy\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"maxByOrThrow-U\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic inline fun > ULongArray.maxBy(selector: (ULong) -> R): ULong {\n if (isEmpty()) throw NoSuchElementException()\n var maxElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return maxElem\n var maxValue = selector(maxElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (maxValue < v) {\n maxElem = e\n maxValue = v\n }\n }\n return maxElem\n}\n\n/**\n * Returns the first element yielding the largest value of the given function.\n * \n * @throws NoSuchElementException if the array is empty.\n * \n * @sample samples.collections.Collections.Aggregates.maxBy\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"maxByOrThrow-U\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic inline fun > UByteArray.maxBy(selector: (UByte) -> R): UByte {\n if (isEmpty()) throw NoSuchElementException()\n var maxElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return maxElem\n var maxValue = selector(maxElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (maxValue < v) {\n maxElem = e\n maxValue = v\n }\n }\n return maxElem\n}\n\n/**\n * Returns the first element yielding the largest value of the given function.\n * \n * @throws NoSuchElementException if the array is empty.\n * \n * @sample samples.collections.Collections.Aggregates.maxBy\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"maxByOrThrow-U\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic inline fun > UShortArray.maxBy(selector: (UShort) -> R): UShort {\n if (isEmpty()) throw NoSuchElementException()\n var maxElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return maxElem\n var maxValue = selector(maxElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (maxValue < v) {\n maxElem = e\n maxValue = v\n }\n }\n return maxElem\n}\n\n/**\n * Returns the first element yielding the largest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.maxByOrNull\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UIntArray.maxByOrNull(selector: (UInt) -> R): UInt? {\n if (isEmpty()) return null\n var maxElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return maxElem\n var maxValue = selector(maxElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (maxValue < v) {\n maxElem = e\n maxValue = v\n }\n }\n return maxElem\n}\n\n/**\n * Returns the first element yielding the largest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.maxByOrNull\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > ULongArray.maxByOrNull(selector: (ULong) -> R): ULong? {\n if (isEmpty()) return null\n var maxElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return maxElem\n var maxValue = selector(maxElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (maxValue < v) {\n maxElem = e\n maxValue = v\n }\n }\n return maxElem\n}\n\n/**\n * Returns the first element yielding the largest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.maxByOrNull\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UByteArray.maxByOrNull(selector: (UByte) -> R): UByte? {\n if (isEmpty()) return null\n var maxElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return maxElem\n var maxValue = selector(maxElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (maxValue < v) {\n maxElem = e\n maxValue = v\n }\n }\n return maxElem\n}\n\n/**\n * Returns the first element yielding the largest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.maxByOrNull\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UShortArray.maxByOrNull(selector: (UShort) -> R): UShort? {\n if (isEmpty()) return null\n var maxElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return maxElem\n var maxValue = selector(maxElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (maxValue < v) {\n maxElem = e\n maxValue = v\n }\n }\n return maxElem\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.maxOf(selector: (UInt) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.maxOf(selector: (ULong) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.maxOf(selector: (UByte) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.maxOf(selector: (UShort) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.maxOf(selector: (UInt) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.maxOf(selector: (ULong) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.maxOf(selector: (UByte) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.maxOf(selector: (UShort) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UIntArray.maxOf(selector: (UInt) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > ULongArray.maxOf(selector: (ULong) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UByteArray.maxOf(selector: (UByte) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UShortArray.maxOf(selector: (UShort) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.maxOfOrNull(selector: (UInt) -> Double): Double? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.maxOfOrNull(selector: (ULong) -> Double): Double? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.maxOfOrNull(selector: (UByte) -> Double): Double? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.maxOfOrNull(selector: (UShort) -> Double): Double? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.maxOfOrNull(selector: (UInt) -> Float): Float? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.maxOfOrNull(selector: (ULong) -> Float): Float? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.maxOfOrNull(selector: (UByte) -> Float): Float? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.maxOfOrNull(selector: (UShort) -> Float): Float? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UIntArray.maxOfOrNull(selector: (UInt) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > ULongArray.maxOfOrNull(selector: (ULong) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UByteArray.maxOfOrNull(selector: (UByte) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UShortArray.maxOfOrNull(selector: (UShort) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.maxOfWith(comparator: Comparator, selector: (UInt) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.maxOfWith(comparator: Comparator, selector: (ULong) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.maxOfWith(comparator: Comparator, selector: (UByte) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.maxOfWith(comparator: Comparator, selector: (UShort) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.maxOfWithOrNull(comparator: Comparator, selector: (UInt) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.maxOfWithOrNull(comparator: Comparator, selector: (ULong) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.maxOfWithOrNull(comparator: Comparator, selector: (UByte) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.maxOfWithOrNull(comparator: Comparator, selector: (UShort) -> R): R? {\n if (isEmpty()) return null\n var maxValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.maxOrNull(): UInt? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (max < e) max = e\n }\n return max\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.maxOrNull(): ULong? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (max < e) max = e\n }\n return max\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.maxOrNull(): UByte? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (max < e) max = e\n }\n return max\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.maxOrNull(): UShort? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (max < e) max = e\n }\n return max\n}\n\n/**\n * Returns the first element having the largest value according to the provided [comparator].\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"maxWithOrThrow-U\")\n@ExperimentalUnsignedTypes\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun UIntArray.maxWith(comparator: Comparator): UInt {\n if (isEmpty()) throw NoSuchElementException()\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(max, e) < 0) max = e\n }\n return max\n}\n\n/**\n * Returns the first element having the largest value according to the provided [comparator].\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"maxWithOrThrow-U\")\n@ExperimentalUnsignedTypes\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun ULongArray.maxWith(comparator: Comparator): ULong {\n if (isEmpty()) throw NoSuchElementException()\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(max, e) < 0) max = e\n }\n return max\n}\n\n/**\n * Returns the first element having the largest value according to the provided [comparator].\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"maxWithOrThrow-U\")\n@ExperimentalUnsignedTypes\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun UByteArray.maxWith(comparator: Comparator): UByte {\n if (isEmpty()) throw NoSuchElementException()\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(max, e) < 0) max = e\n }\n return max\n}\n\n/**\n * Returns the first element having the largest value according to the provided [comparator].\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"maxWithOrThrow-U\")\n@ExperimentalUnsignedTypes\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun UShortArray.maxWith(comparator: Comparator): UShort {\n if (isEmpty()) throw NoSuchElementException()\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(max, e) < 0) max = e\n }\n return max\n}\n\n/**\n * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.maxWithOrNull(comparator: Comparator): UInt? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(max, e) < 0) max = e\n }\n return max\n}\n\n/**\n * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.maxWithOrNull(comparator: Comparator): ULong? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(max, e) < 0) max = e\n }\n return max\n}\n\n/**\n * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.maxWithOrNull(comparator: Comparator): UByte? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(max, e) < 0) max = e\n }\n return max\n}\n\n/**\n * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.maxWithOrNull(comparator: Comparator): UShort? {\n if (isEmpty()) return null\n var max = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(max, e) < 0) max = e\n }\n return max\n}\n\n/**\n * Returns the smallest element.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"minOrThrow-U\")\n@ExperimentalUnsignedTypes\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun UIntArray.min(): UInt {\n if (isEmpty()) throw NoSuchElementException()\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (min > e) min = e\n }\n return min\n}\n\n/**\n * Returns the smallest element.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"minOrThrow-U\")\n@ExperimentalUnsignedTypes\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun ULongArray.min(): ULong {\n if (isEmpty()) throw NoSuchElementException()\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (min > e) min = e\n }\n return min\n}\n\n/**\n * Returns the smallest element.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"minOrThrow-U\")\n@ExperimentalUnsignedTypes\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun UByteArray.min(): UByte {\n if (isEmpty()) throw NoSuchElementException()\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (min > e) min = e\n }\n return min\n}\n\n/**\n * Returns the smallest element.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"minOrThrow-U\")\n@ExperimentalUnsignedTypes\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun UShortArray.min(): UShort {\n if (isEmpty()) throw NoSuchElementException()\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (min > e) min = e\n }\n return min\n}\n\n/**\n * Returns the first element yielding the smallest value of the given function.\n * \n * @throws NoSuchElementException if the array is empty.\n * \n * @sample samples.collections.Collections.Aggregates.minBy\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"minByOrThrow-U\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic inline fun > UIntArray.minBy(selector: (UInt) -> R): UInt {\n if (isEmpty()) throw NoSuchElementException()\n var minElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return minElem\n var minValue = selector(minElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (minValue > v) {\n minElem = e\n minValue = v\n }\n }\n return minElem\n}\n\n/**\n * Returns the first element yielding the smallest value of the given function.\n * \n * @throws NoSuchElementException if the array is empty.\n * \n * @sample samples.collections.Collections.Aggregates.minBy\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"minByOrThrow-U\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic inline fun > ULongArray.minBy(selector: (ULong) -> R): ULong {\n if (isEmpty()) throw NoSuchElementException()\n var minElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return minElem\n var minValue = selector(minElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (minValue > v) {\n minElem = e\n minValue = v\n }\n }\n return minElem\n}\n\n/**\n * Returns the first element yielding the smallest value of the given function.\n * \n * @throws NoSuchElementException if the array is empty.\n * \n * @sample samples.collections.Collections.Aggregates.minBy\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"minByOrThrow-U\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic inline fun > UByteArray.minBy(selector: (UByte) -> R): UByte {\n if (isEmpty()) throw NoSuchElementException()\n var minElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return minElem\n var minValue = selector(minElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (minValue > v) {\n minElem = e\n minValue = v\n }\n }\n return minElem\n}\n\n/**\n * Returns the first element yielding the smallest value of the given function.\n * \n * @throws NoSuchElementException if the array is empty.\n * \n * @sample samples.collections.Collections.Aggregates.minBy\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"minByOrThrow-U\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic inline fun > UShortArray.minBy(selector: (UShort) -> R): UShort {\n if (isEmpty()) throw NoSuchElementException()\n var minElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return minElem\n var minValue = selector(minElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (minValue > v) {\n minElem = e\n minValue = v\n }\n }\n return minElem\n}\n\n/**\n * Returns the first element yielding the smallest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.minByOrNull\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UIntArray.minByOrNull(selector: (UInt) -> R): UInt? {\n if (isEmpty()) return null\n var minElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return minElem\n var minValue = selector(minElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (minValue > v) {\n minElem = e\n minValue = v\n }\n }\n return minElem\n}\n\n/**\n * Returns the first element yielding the smallest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.minByOrNull\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > ULongArray.minByOrNull(selector: (ULong) -> R): ULong? {\n if (isEmpty()) return null\n var minElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return minElem\n var minValue = selector(minElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (minValue > v) {\n minElem = e\n minValue = v\n }\n }\n return minElem\n}\n\n/**\n * Returns the first element yielding the smallest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.minByOrNull\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UByteArray.minByOrNull(selector: (UByte) -> R): UByte? {\n if (isEmpty()) return null\n var minElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return minElem\n var minValue = selector(minElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (minValue > v) {\n minElem = e\n minValue = v\n }\n }\n return minElem\n}\n\n/**\n * Returns the first element yielding the smallest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.minByOrNull\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UShortArray.minByOrNull(selector: (UShort) -> R): UShort? {\n if (isEmpty()) return null\n var minElem = this[0]\n val lastIndex = this.lastIndex\n if (lastIndex == 0) return minElem\n var minValue = selector(minElem)\n for (i in 1..lastIndex) {\n val e = this[i]\n val v = selector(e)\n if (minValue > v) {\n minElem = e\n minValue = v\n }\n }\n return minElem\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.minOf(selector: (UInt) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.minOf(selector: (ULong) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.minOf(selector: (UByte) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.minOf(selector: (UShort) -> Double): Double {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.minOf(selector: (UInt) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.minOf(selector: (ULong) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.minOf(selector: (UByte) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.minOf(selector: (UShort) -> Float): Float {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UIntArray.minOf(selector: (UInt) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > ULongArray.minOf(selector: (ULong) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UByteArray.minOf(selector: (UByte) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UShortArray.minOf(selector: (UShort) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.minOfOrNull(selector: (UInt) -> Double): Double? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.minOfOrNull(selector: (ULong) -> Double): Double? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.minOfOrNull(selector: (UByte) -> Double): Double? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.minOfOrNull(selector: (UShort) -> Double): Double? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.minOfOrNull(selector: (UInt) -> Float): Float? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.minOfOrNull(selector: (ULong) -> Float): Float? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.minOfOrNull(selector: (UByte) -> Float): Float? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.minOfOrNull(selector: (UShort) -> Float): Float? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UIntArray.minOfOrNull(selector: (UInt) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > ULongArray.minOfOrNull(selector: (ULong) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UByteArray.minOfOrNull(selector: (UByte) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun > UShortArray.minOfOrNull(selector: (UShort) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.minOfWith(comparator: Comparator, selector: (UInt) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.minOfWith(comparator: Comparator, selector: (ULong) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.minOfWith(comparator: Comparator, selector: (UByte) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array.\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.minOfWith(comparator: Comparator, selector: (UShort) -> R): R {\n if (isEmpty()) throw NoSuchElementException()\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.minOfWithOrNull(comparator: Comparator, selector: (UInt) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.minOfWithOrNull(comparator: Comparator, selector: (ULong) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.minOfWithOrNull(comparator: Comparator, selector: (UByte) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the array or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.minOfWithOrNull(comparator: Comparator, selector: (UShort) -> R): R? {\n if (isEmpty()) return null\n var minValue = selector(this[0])\n for (i in 1..lastIndex) {\n val v = selector(this[i])\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.minOrNull(): UInt? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (min > e) min = e\n }\n return min\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.minOrNull(): ULong? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (min > e) min = e\n }\n return min\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.minOrNull(): UByte? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (min > e) min = e\n }\n return min\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.minOrNull(): UShort? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (min > e) min = e\n }\n return min\n}\n\n/**\n * Returns the first element having the smallest value according to the provided [comparator].\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"minWithOrThrow-U\")\n@ExperimentalUnsignedTypes\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun UIntArray.minWith(comparator: Comparator): UInt {\n if (isEmpty()) throw NoSuchElementException()\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(min, e) > 0) min = e\n }\n return min\n}\n\n/**\n * Returns the first element having the smallest value according to the provided [comparator].\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"minWithOrThrow-U\")\n@ExperimentalUnsignedTypes\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun ULongArray.minWith(comparator: Comparator): ULong {\n if (isEmpty()) throw NoSuchElementException()\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(min, e) > 0) min = e\n }\n return min\n}\n\n/**\n * Returns the first element having the smallest value according to the provided [comparator].\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"minWithOrThrow-U\")\n@ExperimentalUnsignedTypes\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun UByteArray.minWith(comparator: Comparator): UByte {\n if (isEmpty()) throw NoSuchElementException()\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(min, e) > 0) min = e\n }\n return min\n}\n\n/**\n * Returns the first element having the smallest value according to the provided [comparator].\n * \n * @throws NoSuchElementException if the array is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"minWithOrThrow-U\")\n@ExperimentalUnsignedTypes\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun UShortArray.minWith(comparator: Comparator): UShort {\n if (isEmpty()) throw NoSuchElementException()\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(min, e) > 0) min = e\n }\n return min\n}\n\n/**\n * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UIntArray.minWithOrNull(comparator: Comparator): UInt? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(min, e) > 0) min = e\n }\n return min\n}\n\n/**\n * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun ULongArray.minWithOrNull(comparator: Comparator): ULong? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(min, e) > 0) min = e\n }\n return min\n}\n\n/**\n * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UByteArray.minWithOrNull(comparator: Comparator): UByte? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(min, e) > 0) min = e\n }\n return min\n}\n\n/**\n * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\npublic fun UShortArray.minWithOrNull(comparator: Comparator): UShort? {\n if (isEmpty()) return null\n var min = this[0]\n for (i in 1..lastIndex) {\n val e = this[i]\n if (comparator.compare(min, e) > 0) min = e\n }\n return min\n}\n\n/**\n * Returns `true` if the array has no elements.\n * \n * @sample samples.collections.Collections.Aggregates.none\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.none(): Boolean {\n return isEmpty()\n}\n\n/**\n * Returns `true` if the array has no elements.\n * \n * @sample samples.collections.Collections.Aggregates.none\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.none(): Boolean {\n return isEmpty()\n}\n\n/**\n * Returns `true` if the array has no elements.\n * \n * @sample samples.collections.Collections.Aggregates.none\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.none(): Boolean {\n return isEmpty()\n}\n\n/**\n * Returns `true` if the array has no elements.\n * \n * @sample samples.collections.Collections.Aggregates.none\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.none(): Boolean {\n return isEmpty()\n}\n\n/**\n * Returns `true` if no elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.noneWithPredicate\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.none(predicate: (UInt) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if no elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.noneWithPredicate\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.none(predicate: (ULong) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if no elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.noneWithPredicate\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.none(predicate: (UByte) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if no elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.noneWithPredicate\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.none(predicate: (UShort) -> Boolean): Boolean {\n for (element in this) if (predicate(element)) return false\n return true\n}\n\n/**\n * Performs the given [action] on each element and returns the array itself afterwards.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.onEach(action: (UInt) -> Unit): UIntArray {\n return apply { for (element in this) action(element) }\n}\n\n/**\n * Performs the given [action] on each element and returns the array itself afterwards.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.onEach(action: (ULong) -> Unit): ULongArray {\n return apply { for (element in this) action(element) }\n}\n\n/**\n * Performs the given [action] on each element and returns the array itself afterwards.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.onEach(action: (UByte) -> Unit): UByteArray {\n return apply { for (element in this) action(element) }\n}\n\n/**\n * Performs the given [action] on each element and returns the array itself afterwards.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.onEach(action: (UShort) -> Unit): UShortArray {\n return apply { for (element in this) action(element) }\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element,\n * and returns the array itself afterwards.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.onEachIndexed(action: (index: Int, UInt) -> Unit): UIntArray {\n return apply { forEachIndexed(action) }\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element,\n * and returns the array itself afterwards.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.onEachIndexed(action: (index: Int, ULong) -> Unit): ULongArray {\n return apply { forEachIndexed(action) }\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element,\n * and returns the array itself afterwards.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.onEachIndexed(action: (index: Int, UByte) -> Unit): UByteArray {\n return apply { forEachIndexed(action) }\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element,\n * and returns the array itself afterwards.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.onEachIndexed(action: (index: Int, UShort) -> Unit): UShortArray {\n return apply { forEachIndexed(action) }\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.reduce(operation: (acc: UInt, UInt) -> UInt): UInt {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.reduce(operation: (acc: ULong, ULong) -> ULong): ULong {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.reduce(operation: (acc: UByte, UByte) -> UByte): UByte {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.reduce(operation: (acc: UShort, UShort) -> UShort): UShort {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.reduceIndexed(operation: (index: Int, acc: UInt, UInt) -> UInt): UInt {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.reduceIndexed(operation: (index: Int, acc: ULong, ULong) -> ULong): ULong {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.reduceIndexed(operation: (index: Int, acc: UByte, UByte) -> UByte): UByte {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.reduceIndexed(operation: (index: Int, acc: UShort, UShort) -> UShort): UShort {\n if (isEmpty())\n throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.reduceIndexedOrNull(operation: (index: Int, acc: UInt, UInt) -> UInt): UInt? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.reduceIndexedOrNull(operation: (index: Int, acc: ULong, ULong) -> ULong): ULong? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.reduceIndexedOrNull(operation: (index: Int, acc: UByte, UByte) -> UByte): UByte? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original array.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.reduceIndexedOrNull(operation: (index: Int, acc: UShort, UShort) -> UShort): UShort? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(index, accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.reduceOrNull(operation: (acc: UInt, UInt) -> UInt): UInt? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.reduceOrNull(operation: (acc: ULong, ULong) -> ULong): ULong? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.reduceOrNull(operation: (acc: UByte, UByte) -> UByte): UByte? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.reduceOrNull(operation: (acc: UShort, UShort) -> UShort): UShort? {\n if (isEmpty())\n return null\n var accumulator = this[0]\n for (index in 1..lastIndex) {\n accumulator = operation(accumulator, this[index])\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.reduceRight(operation: (UInt, acc: UInt) -> UInt): UInt {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.reduceRight(operation: (ULong, acc: ULong) -> ULong): ULong {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.reduceRight(operation: (UByte, acc: UByte) -> UByte): UByte {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.reduceRight(operation: (UShort, acc: UShort) -> UShort): UShort {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.reduceRightIndexed(operation: (index: Int, UInt, acc: UInt) -> UInt): UInt {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.reduceRightIndexed(operation: (index: Int, ULong, acc: ULong) -> ULong): ULong {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.reduceRightIndexed(operation: (index: Int, UByte, acc: UByte) -> UByte): UByte {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Throws an exception if this array is empty. If the array can be empty in an expected way,\n * please use [reduceRightIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.reduceRightIndexed(operation: (index: Int, UShort, acc: UShort) -> UShort): UShort {\n var index = lastIndex\n if (index < 0) throw UnsupportedOperationException(\"Empty array can't be reduced.\")\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.reduceRightIndexedOrNull(operation: (index: Int, UInt, acc: UInt) -> UInt): UInt? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.reduceRightIndexedOrNull(operation: (index: Int, ULong, acc: ULong) -> ULong): ULong? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.reduceRightIndexedOrNull(operation: (index: Int, UByte, acc: UByte) -> UByte): UByte? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original array and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.reduceRightIndexedOrNull(operation: (index: Int, UShort, acc: UShort) -> UShort): UShort? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(index, get(index), accumulator)\n --index\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.reduceRightOrNull(operation: (UInt, acc: UInt) -> UInt): UInt? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.reduceRightOrNull(operation: (ULong, acc: ULong) -> ULong): ULong? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.reduceRightOrNull(operation: (UByte, acc: UByte) -> UByte): UByte? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns `null` if the array is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.reduceRightOrNull(operation: (UShort, acc: UShort) -> UShort): UShort? {\n var index = lastIndex\n if (index < 0) return null\n var accumulator = get(index--)\n while (index >= 0) {\n accumulator = operation(get(index--), accumulator)\n }\n return accumulator\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.runningFold(initial: R, operation: (acc: R, UInt) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (element in this) {\n accumulator = operation(accumulator, element)\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.runningFold(initial: R, operation: (acc: R, ULong) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (element in this) {\n accumulator = operation(accumulator, element)\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.runningFold(initial: R, operation: (acc: R, UByte) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (element in this) {\n accumulator = operation(accumulator, element)\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.runningFold(initial: R, operation: (acc: R, UShort) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (element in this) {\n accumulator = operation(accumulator, element)\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, UInt) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (index in indices) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, ULong) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (index in indices) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, UByte) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (index in indices) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, UShort) -> R): List {\n if (isEmpty()) return listOf(initial)\n val result = ArrayList(size + 1).apply { add(initial) }\n var accumulator = initial\n for (index in indices) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with the first element of this array.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.runningReduce(operation: (acc: UInt, UInt) -> UInt): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with the first element of this array.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.runningReduce(operation: (acc: ULong, ULong) -> ULong): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with the first element of this array.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.runningReduce(operation: (acc: UByte, UByte) -> UByte): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with the first element of this array.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.runningReduce(operation: (acc: UShort, UShort) -> UShort): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with the first element of this array.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.runningReduceIndexed(operation: (index: Int, acc: UInt, UInt) -> UInt): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with the first element of this array.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.runningReduceIndexed(operation: (index: Int, acc: ULong, ULong) -> ULong): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with the first element of this array.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.runningReduceIndexed(operation: (index: Int, acc: UByte, UByte) -> UByte): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with the first element of this array.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.runningReduceIndexed(operation: (index: Int, acc: UShort, UShort) -> UShort): List {\n if (isEmpty()) return emptyList()\n var accumulator = this[0]\n val result = ArrayList(size).apply { add(accumulator) }\n for (index in 1 until size) {\n accumulator = operation(index, accumulator, this[index])\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.scan(initial: R, operation: (acc: R, UInt) -> R): List {\n return runningFold(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.scan(initial: R, operation: (acc: R, ULong) -> R): List {\n return runningFold(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.scan(initial: R, operation: (acc: R, UByte) -> R): List {\n return runningFold(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.scan(initial: R, operation: (acc: R, UShort) -> R): List {\n return runningFold(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.scanIndexed(initial: R, operation: (index: Int, acc: R, UInt) -> R): List {\n return runningFoldIndexed(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.scanIndexed(initial: R, operation: (index: Int, acc: R, ULong) -> R): List {\n return runningFoldIndexed(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.scanIndexed(initial: R, operation: (index: Int, acc: R, UByte) -> R): List {\n return runningFoldIndexed(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original array and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.scanIndexed(initial: R, operation: (index: Int, acc: R, UShort) -> R): List {\n return runningFoldIndexed(initial, operation)\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.sumBy(selector: (UInt) -> UInt): UInt {\n var sum: UInt = 0u\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.sumBy(selector: (ULong) -> UInt): UInt {\n var sum: UInt = 0u\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.sumBy(selector: (UByte) -> UInt): UInt {\n var sum: UInt = 0u\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.sumBy(selector: (UShort) -> UInt): UInt {\n var sum: UInt = 0u\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.sumByDouble(selector: (UInt) -> Double): Double {\n var sum: Double = 0.0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.sumByDouble(selector: (ULong) -> Double): Double {\n var sum: Double = 0.0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.sumByDouble(selector: (UByte) -> Double): Double {\n var sum: Double = 0.0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.sumByDouble(selector: (UShort) -> Double): Double {\n var sum: Double = 0.0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@Suppress(\"INAPPLICABLE_JVM_NAME\")\n@kotlin.jvm.JvmName(\"sumOfDouble\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.sumOf(selector: (UInt) -> Double): Double {\n var sum: Double = 0.toDouble()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@Suppress(\"INAPPLICABLE_JVM_NAME\")\n@kotlin.jvm.JvmName(\"sumOfDouble\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.sumOf(selector: (ULong) -> Double): Double {\n var sum: Double = 0.toDouble()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@Suppress(\"INAPPLICABLE_JVM_NAME\")\n@kotlin.jvm.JvmName(\"sumOfDouble\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.sumOf(selector: (UByte) -> Double): Double {\n var sum: Double = 0.toDouble()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@Suppress(\"INAPPLICABLE_JVM_NAME\")\n@kotlin.jvm.JvmName(\"sumOfDouble\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.sumOf(selector: (UShort) -> Double): Double {\n var sum: Double = 0.toDouble()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@Suppress(\"INAPPLICABLE_JVM_NAME\")\n@kotlin.jvm.JvmName(\"sumOfInt\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.sumOf(selector: (UInt) -> Int): Int {\n var sum: Int = 0.toInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@Suppress(\"INAPPLICABLE_JVM_NAME\")\n@kotlin.jvm.JvmName(\"sumOfInt\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.sumOf(selector: (ULong) -> Int): Int {\n var sum: Int = 0.toInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@Suppress(\"INAPPLICABLE_JVM_NAME\")\n@kotlin.jvm.JvmName(\"sumOfInt\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.sumOf(selector: (UByte) -> Int): Int {\n var sum: Int = 0.toInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@Suppress(\"INAPPLICABLE_JVM_NAME\")\n@kotlin.jvm.JvmName(\"sumOfInt\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.sumOf(selector: (UShort) -> Int): Int {\n var sum: Int = 0.toInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@Suppress(\"INAPPLICABLE_JVM_NAME\")\n@kotlin.jvm.JvmName(\"sumOfLong\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.sumOf(selector: (UInt) -> Long): Long {\n var sum: Long = 0.toLong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@Suppress(\"INAPPLICABLE_JVM_NAME\")\n@kotlin.jvm.JvmName(\"sumOfLong\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.sumOf(selector: (ULong) -> Long): Long {\n var sum: Long = 0.toLong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@Suppress(\"INAPPLICABLE_JVM_NAME\")\n@kotlin.jvm.JvmName(\"sumOfLong\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.sumOf(selector: (UByte) -> Long): Long {\n var sum: Long = 0.toLong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@Suppress(\"INAPPLICABLE_JVM_NAME\")\n@kotlin.jvm.JvmName(\"sumOfLong\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.sumOf(selector: (UShort) -> Long): Long {\n var sum: Long = 0.toLong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@Suppress(\"INAPPLICABLE_JVM_NAME\")\n@kotlin.jvm.JvmName(\"sumOfUInt\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.sumOf(selector: (UInt) -> UInt): UInt {\n var sum: UInt = 0.toUInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@Suppress(\"INAPPLICABLE_JVM_NAME\")\n@kotlin.jvm.JvmName(\"sumOfUInt\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.sumOf(selector: (ULong) -> UInt): UInt {\n var sum: UInt = 0.toUInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@Suppress(\"INAPPLICABLE_JVM_NAME\")\n@kotlin.jvm.JvmName(\"sumOfUInt\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.sumOf(selector: (UByte) -> UInt): UInt {\n var sum: UInt = 0.toUInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@Suppress(\"INAPPLICABLE_JVM_NAME\")\n@kotlin.jvm.JvmName(\"sumOfUInt\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.sumOf(selector: (UShort) -> UInt): UInt {\n var sum: UInt = 0.toUInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@Suppress(\"INAPPLICABLE_JVM_NAME\")\n@kotlin.jvm.JvmName(\"sumOfULong\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.sumOf(selector: (UInt) -> ULong): ULong {\n var sum: ULong = 0.toULong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@Suppress(\"INAPPLICABLE_JVM_NAME\")\n@kotlin.jvm.JvmName(\"sumOfULong\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.sumOf(selector: (ULong) -> ULong): ULong {\n var sum: ULong = 0.toULong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@Suppress(\"INAPPLICABLE_JVM_NAME\")\n@kotlin.jvm.JvmName(\"sumOfULong\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.sumOf(selector: (UByte) -> ULong): ULong {\n var sum: ULong = 0.toULong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the array.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@Suppress(\"INAPPLICABLE_JVM_NAME\")\n@kotlin.jvm.JvmName(\"sumOfULong\")\n@ExperimentalUnsignedTypes\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.sumOf(selector: (UShort) -> ULong): ULong {\n var sum: ULong = 0.toULong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic infix fun UIntArray.zip(other: Array): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic infix fun ULongArray.zip(other: Array): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic infix fun UByteArray.zip(other: Array): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic infix fun UShortArray.zip(other: Array): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.zip(other: Array, transform: (a: UInt, b: R) -> V): List {\n val size = minOf(size, other.size)\n val list = ArrayList(size)\n for (i in 0 until size) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.zip(other: Array, transform: (a: ULong, b: R) -> V): List {\n val size = minOf(size, other.size)\n val list = ArrayList(size)\n for (i in 0 until size) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.zip(other: Array, transform: (a: UByte, b: R) -> V): List {\n val size = minOf(size, other.size)\n val list = ArrayList(size)\n for (i in 0 until size) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.zip(other: Array, transform: (a: UShort, b: R) -> V): List {\n val size = minOf(size, other.size)\n val list = ArrayList(size)\n for (i in 0 until size) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` collection and [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic infix fun UIntArray.zip(other: Iterable): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` collection and [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic infix fun ULongArray.zip(other: Iterable): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` collection and [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic infix fun UByteArray.zip(other: Iterable): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` collection and [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic infix fun UShortArray.zip(other: Iterable): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] collection with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.zip(other: Iterable, transform: (a: UInt, b: R) -> V): List {\n val arraySize = size\n val list = ArrayList(minOf(other.collectionSizeOrDefault(10), arraySize))\n var i = 0\n for (element in other) {\n if (i >= arraySize) break\n list.add(transform(this[i++], element))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] collection with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.zip(other: Iterable, transform: (a: ULong, b: R) -> V): List {\n val arraySize = size\n val list = ArrayList(minOf(other.collectionSizeOrDefault(10), arraySize))\n var i = 0\n for (element in other) {\n if (i >= arraySize) break\n list.add(transform(this[i++], element))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] collection with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.zip(other: Iterable, transform: (a: UByte, b: R) -> V): List {\n val arraySize = size\n val list = ArrayList(minOf(other.collectionSizeOrDefault(10), arraySize))\n var i = 0\n for (element in other) {\n if (i >= arraySize) break\n list.add(transform(this[i++], element))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] collection with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.zip(other: Iterable, transform: (a: UShort, b: R) -> V): List {\n val arraySize = size\n val list = ArrayList(minOf(other.collectionSizeOrDefault(10), arraySize))\n var i = 0\n for (element in other) {\n if (i >= arraySize) break\n list.add(transform(this[i++], element))\n }\n return list\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic infix fun UIntArray.zip(other: UIntArray): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic infix fun ULongArray.zip(other: ULongArray): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic infix fun UByteArray.zip(other: UByteArray): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\npublic infix fun UShortArray.zip(other: UShortArray): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest array.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.zip(other: UIntArray, transform: (a: UInt, b: UInt) -> V): List {\n val size = minOf(size, other.size)\n val list = ArrayList(size)\n for (i in 0 until size) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest array.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.zip(other: ULongArray, transform: (a: ULong, b: ULong) -> V): List {\n val size = minOf(size, other.size)\n val list = ArrayList(size)\n for (i in 0 until size) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest array.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.zip(other: UByteArray, transform: (a: UByte, b: UByte) -> V): List {\n val size = minOf(size, other.size)\n val list = ArrayList(size)\n for (i in 0 until size) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Returns a list of values built from the elements of `this` array and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest array.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.zip(other: UShortArray, transform: (a: UShort, b: UShort) -> V): List {\n val size = minOf(size, other.size)\n val list = ArrayList(size)\n for (i in 0 until size) {\n list.add(transform(this[i], other[i]))\n }\n return list\n}\n\n/**\n * Returns the sum of all elements in the array.\n */\n@kotlin.jvm.JvmName(\"sumOfUInt\")\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\npublic fun Array.sum(): UInt {\n var sum: UInt = 0u\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the array.\n */\n@kotlin.jvm.JvmName(\"sumOfULong\")\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\npublic fun Array.sum(): ULong {\n var sum: ULong = 0uL\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the array.\n */\n@kotlin.jvm.JvmName(\"sumOfUByte\")\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\npublic fun Array.sum(): UInt {\n var sum: UInt = 0u\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the array.\n */\n@kotlin.jvm.JvmName(\"sumOfUShort\")\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\npublic fun Array.sum(): UInt {\n var sum: UInt = 0u\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UIntArray.sum(): UInt {\n return storage.sum().toUInt()\n}\n\n/**\n * Returns the sum of all elements in the array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun ULongArray.sum(): ULong {\n return storage.sum().toULong()\n}\n\n/**\n * Returns the sum of all elements in the array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UByteArray.sum(): UInt {\n return sumOf { it.toUInt() }\n}\n\n/**\n * Returns the sum of all elements in the array.\n */\n@SinceKotlin(\"1.3\")\n@ExperimentalUnsignedTypes\n@kotlin.internal.InlineOnly\npublic inline fun UShortArray.sum(): UInt {\n return sumOf { it.toUInt() }\n}\n\n","/*\n * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.reflect\n\nimport findAssociatedObject\n\n/**\n * The experimental marker for associated objects API.\n *\n * Any usage of a declaration annotated with `@ExperimentalAssociatedObjects` must be accepted either by\n * annotating that usage with the [OptIn] annotation, e.g. `@OptIn(ExperimentalAssociatedObjects::class)`,\n * or by using the compiler argument `-opt-in=kotlin.reflect.ExperimentalAssociatedObjects`.\n */\n@RequiresOptIn(level = RequiresOptIn.Level.ERROR)\n@Retention(value = AnnotationRetention.BINARY)\npublic annotation class ExperimentalAssociatedObjects\n\n/**\n * Makes the annotated annotation class an associated object key.\n *\n * An associated object key annotation should have single [KClass] parameter.\n * When applied to a class with reference to an object declaration as an argument, it binds\n * the object to the class, making this binding discoverable at runtime using [findAssociatedObject].\n */\n@ExperimentalAssociatedObjects\n@Retention(AnnotationRetention.BINARY)\n@Target(AnnotationTarget.ANNOTATION_CLASS)\npublic annotation class AssociatedObjectKey\n\n/**\n * If [T] is an @[AssociatedObjectKey]-annotated annotation class and [this] class is annotated with @[T] (`S::class`),\n * returns object `S`.\n *\n * Otherwise returns `null`.\n */\n@ExperimentalAssociatedObjects\npublic inline fun KClass<*>.findAssociatedObject(): Any? =\n this.findAssociatedObject(T::class)",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.serialization\n\nimport io.ktor.websocket.*\n\npublic open class ContentConvertException(\n message: String,\n cause: Throwable? = null\n) : Exception(message, cause)\n\npublic class JsonConvertException(\n message: String,\n cause: Throwable? = null\n) : ContentConvertException(message, cause)\n\npublic open class WebsocketContentConvertException(\n message: String,\n cause: Throwable? = null\n) : ContentConvertException(message, cause)\n\npublic class WebsocketConverterNotFoundException(\n message: String,\n cause: Throwable? = null\n) : WebsocketContentConvertException(message, cause)\n\npublic class WebsocketDeserializeException(\n message: String,\n cause: Throwable? = null,\n public val frame: Frame\n) : WebsocketContentConvertException(message, cause)\n","/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.serialization\n\nimport io.ktor.http.*\nimport io.ktor.http.content.*\nimport io.ktor.util.*\nimport io.ktor.util.pipeline.*\nimport io.ktor.util.reflect.*\nimport io.ktor.utils.io.*\nimport io.ktor.utils.io.charsets.*\nimport io.ktor.utils.io.core.*\nimport kotlinx.coroutines.flow.*\nimport kotlin.reflect.*\n\n/**\n * A custom content converter that could be registered in [ContentNegotiation] plugin for any particular content type\n * Could provide bi-directional conversion implementation.\n * One of the most typical examples of content converter is a JSON content converter that provides both\n * serialization and deserialization\n *\n * Implementations must override at least one of [serialize] or [serializeNullable] methods.\n */\npublic interface ContentConverter {\n\n /**\n * Serializes a [value] to the specified [contentType] to a [OutgoingContent].\n * This function could ignore value if it is not suitable for conversion and return `null` so in this case\n * other registered converters could be tried or this function could be invoked with other content types\n * it the converted has been registered multiple times with different content types.\n *\n * @param charset response charset\n * @param typeInfo response body typeInfo\n * @param contentType to which this data converter has been registered and that matches the client's [Accept] header\n * @param value to be converted\n *\n * @return a converted [OutgoingContent] value, or null if [value] isn't suitable for this converter\n */\n @Deprecated(\n \"Please override and use serializeNullable instead\",\n level = DeprecationLevel.WARNING,\n replaceWith = ReplaceWith(\"serializeNullable(charset, typeInfo, contentType, value)\")\n )\n public suspend fun serialize(\n contentType: ContentType,\n charset: Charset,\n typeInfo: TypeInfo,\n value: Any\n ): OutgoingContent? = serializeNullable(contentType, charset, typeInfo, value)\n\n /**\n * Serializes a [value] to the specified [contentType] to a [OutgoingContent].\n * This function could ignore value if it is not suitable for conversion and return `null` so in this case\n * other registered converters could be tried or this function could be invoked with other content types\n * it the converted has been registered multiple times with different content types.\n *\n * @param charset response charset\n * @param typeInfo response body typeInfo\n * @param contentType to which this data converter has been registered and that matches the client's [Accept] header\n * @param value to be converted\n *\n * @return a converted [OutgoingContent] value, or null if [value] isn't suitable for this converter\n */\n @Suppress(\"DEPRECATION\")\n public suspend fun serializeNullable(\n contentType: ContentType,\n charset: Charset,\n typeInfo: TypeInfo,\n value: Any?\n ): OutgoingContent? = serialize(contentType, charset, typeInfo, value!!)\n\n /**\n * Deserializes [content] to the value of type [typeInfo]\n *\n * @return a converted value (deserialized) or `null` if the context's subject is not suitable for this converter\n */\n public suspend fun deserialize(charset: Charset, typeInfo: TypeInfo, content: ByteReadChannel): Any?\n}\n\n/**\n * Detect suitable charset for an application call by `Accept` header or fallback to [defaultCharset]\n */\npublic fun Headers.suitableCharset(defaultCharset: Charset = Charsets.UTF_8): Charset =\n suitableCharsetOrNull(defaultCharset) ?: defaultCharset\n\n/**\n * Detect suitable charset for an application call by `Accept` header or fallback to null\n */\npublic fun Headers.suitableCharsetOrNull(defaultCharset: Charset = Charsets.UTF_8): Charset? {\n for ((charset, _) in parseAndSortHeader(get(HttpHeaders.AcceptCharset))) when {\n charset == \"*\" -> return defaultCharset\n Charset.isSupported(charset) -> return Charset.forName(charset)\n }\n return null\n}\n\n/**\n * Configuration for client and server `ContentNegotiation` plugin\n */\npublic interface Configuration {\n\n public fun register(\n contentType: ContentType,\n converter: T,\n configuration: T.() -> Unit = {}\n )\n}\n\n@InternalAPI\npublic suspend fun List.deserialize(\n body: ByteReadChannel,\n typeInfo: TypeInfo,\n charset: Charset\n): Any {\n // Pick the first one that can convert the subject successfully.\n // The result can be null if\n // 1. there is no suitable converter\n // 2. result of deserialization is null\n // We can differentiate these cases by checking if body was consumed or not\n val result = asFlow().map { converter ->\n converter.deserialize(\n charset = charset,\n typeInfo = typeInfo,\n content = body\n )\n }.firstOrNull { it != null || body.isClosedForRead }\n\n return when {\n result != null -> result\n !body.isClosedForRead -> body\n typeInfo.kotlinType?.isMarkedNullable == true -> NullBody\n else -> throw ContentConvertException(\"No suitable converter found for $typeInfo\")\n }\n}\n","/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.serialization\n\nimport io.ktor.http.*\nimport io.ktor.http.content.*\nimport io.ktor.util.reflect.*\nimport io.ktor.utils.io.*\nimport io.ktor.utils.io.charsets.*\nimport io.ktor.websocket.*\n\n/**\n * A custom content converter that could be used in the [WebSockets] plugin\n * Could provide bi-directional conversion implementation.\n * One of the most typical examples of the content converter is a JSON converter that provides\n * both serialization and deserialization\n *\n * Implementations must override at least one of [serialize] or [serializeNullable] methods.\n */\npublic interface WebsocketContentConverter {\n /**\n * Serializes a [value] to a WebSocket [Frame].\n * This function could throw `WebsocketConverterNotFoundException` if the value is not suitable for conversion\n *\n * @param charset response charset\n * @param typeInfo response body typeInfo\n * @param value to be converted\n *\n * @return a converted [Frame] value, or null if [value] isn't suitable for this converter\n */\n public suspend fun serialize(\n charset: Charset,\n typeInfo: TypeInfo,\n value: Any\n ): Frame = serializeNullable(charset, typeInfo, value)\n\n /**\n * Serializes a [value] to a WebSocket [Frame].\n * This function could throw `WebsocketConverterNotFoundException` if the value is not suitable for conversion\n *\n * @param charset response charset\n * @param typeInfo response body typeInfo\n * @param value to be converted\n *\n * @return a converted [Frame] value, or null if [value] isn't suitable for this converter\n */\n public suspend fun serializeNullable(\n charset: Charset,\n typeInfo: TypeInfo,\n value: Any?\n ): Frame = serialize(charset, typeInfo, value!!)\n\n /**\n * Deserializes [content] to the value of type [typeInfo]\n *\n * @return a converted value (deserialized) or throws `WebsocketConverterNotFoundException` if the context's\n * subject is not suitable for this converter\n */\n public suspend fun deserialize(charset: Charset, typeInfo: TypeInfo, content: Frame): Any?\n\n /**\n * Checks if the content converter can deserialize a [frame]\n *\n * @param frame a WebSocket frame\n *\n * @return true if the content converter can deserialize a [frame] type or false if a type of [frame]\n * is not supported by the converter\n */\n public fun isApplicable(frame: Frame): Boolean\n}\n\n/**\n * Serializes a [value] to a WebSocket [Frame].\n * This function could throw `WebsocketConverterNotFoundException` if the value is not suitable for conversion\n *\n * @param charset response charset\n * @param value to be converted\n *\n * @return a converted [OutgoingContent] value, or null if [value] isn't suitable for this converter\n */\npublic suspend inline fun WebsocketContentConverter.serialize(\n value: T,\n charset: Charset = Charsets.UTF_8\n): Frame = serializeNullable(charset, typeInfo(), value)\n\n/**\n * Deserializes [content] to the value of type [T]\n *\n * @return a converted value (deserialized) or throws `WebsocketConverterNotFoundException` if the context's\n * subject is not suitable for this converter\n */\npublic suspend inline fun WebsocketContentConverter.deserialize(\n content: Frame,\n charset: Charset = Charsets.UTF_8\n): T = deserialize(charset, typeInfo(), content) as T\n","package com.ustadmobile.core.db\n\nimport com.ustadmobile.door.lifecycle.LiveData\nimport com.ustadmobile.door.lifecycle.Observer\nimport kotlinx.coroutines.CompletableDeferred\nimport kotlinx.coroutines.channels.Channel\nimport kotlinx.coroutines.withTimeoutOrNull\n\nsuspend fun waitForLiveData(liveData: LiveData, timeout: Long, checker: (T) -> Boolean) {\n val channel = Channel(1)\n val observerFn = Observer { t ->\n if(checker.invoke(t))\n channel.trySend(t)\n }\n liveData.observeForever(observerFn)\n\n withTimeoutOrNull(timeout) { channel.receive() }\n\n liveData.removeObserver(observerFn)\n channel.close()\n}\n\nsuspend fun LiveData.waitUntil(timeout: Long = 5000, checker: (T) -> Boolean): LiveData {\n val completableDeferred = CompletableDeferred()\n val observerFn = Observer { t ->\n if(checker.invoke(t))\n completableDeferred.complete(t)\n }\n\n observeForever(observerFn)\n withTimeoutOrNull(timeout) { completableDeferred.await() }\n removeObserver(observerFn)\n\n return this\n}\n\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"StringsKt\")\n\npackage kotlin.text\n\nimport kotlin.contracts.contract\nimport kotlin.jvm.JvmName\n\n/**\n * Returns a copy of this string converted to upper case using the rules of the default locale.\n */\n@Deprecated(\"Use uppercase() instead.\", ReplaceWith(\"uppercase()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic expect fun String.toUpperCase(): String\n\n/**\n * Returns a copy of this string converted to upper case using Unicode mapping rules of the invariant locale.\n *\n * This function supports one-to-many and many-to-one character mapping,\n * thus the length of the returned string can be different from the length of the original string.\n *\n * @sample samples.text.Strings.uppercase\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic expect fun String.uppercase(): String\n\n/**\n * Returns a copy of this string converted to lower case using the rules of the default locale.\n */\n@Deprecated(\"Use lowercase() instead.\", ReplaceWith(\"lowercase()\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic expect fun String.toLowerCase(): String\n\n/**\n * Returns a copy of this string converted to lower case using Unicode mapping rules of the invariant locale.\n *\n * This function supports one-to-many and many-to-one character mapping,\n * thus the length of the returned string can be different from the length of the original string.\n *\n * @sample samples.text.Strings.lowercase\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic expect fun String.lowercase(): String\n\n/**\n * Returns a copy of this string having its first letter titlecased using the rules of the default locale,\n * or the original string if it's empty or already starts with a title case letter.\n *\n * The title case of a character is usually the same as its upper case with several exceptions.\n * The particular list of characters with the special title case form depends on the underlying platform.\n *\n * @sample samples.text.Strings.capitalize\n */\n@Deprecated(\"Use replaceFirstChar instead.\", ReplaceWith(\"replaceFirstChar { if (it.isLowerCase()) it.titlecase() else it.toString() }\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic expect fun String.capitalize(): String\n\n/**\n * Returns a copy of this string having its first letter lowercased using the rules of the default locale,\n * or the original string if it's empty or already starts with a lower case letter.\n *\n * @sample samples.text.Strings.decapitalize\n */\n@Deprecated(\"Use replaceFirstChar instead.\", ReplaceWith(\"replaceFirstChar { it.lowercase() }\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic expect fun String.decapitalize(): String\n\n/**\n * Returns a sub sequence of this char sequence having leading and trailing characters matching the [predicate] removed.\n */\npublic inline fun CharSequence.trim(predicate: (Char) -> Boolean): CharSequence {\n var startIndex = 0\n var endIndex = length - 1\n var startFound = false\n\n while (startIndex <= endIndex) {\n val index = if (!startFound) startIndex else endIndex\n val match = predicate(this[index])\n\n if (!startFound) {\n if (!match)\n startFound = true\n else\n startIndex += 1\n } else {\n if (!match)\n break\n else\n endIndex -= 1\n }\n }\n\n return subSequence(startIndex, endIndex + 1)\n}\n\n/**\n * Returns a string having leading and trailing characters matching the [predicate] removed.\n */\npublic inline fun String.trim(predicate: (Char) -> Boolean): String =\n (this as CharSequence).trim(predicate).toString()\n\n/**\n * Returns a sub sequence of this char sequence having leading characters matching the [predicate] removed.\n */\npublic inline fun CharSequence.trimStart(predicate: (Char) -> Boolean): CharSequence {\n for (index in this.indices)\n if (!predicate(this[index]))\n return subSequence(index, length)\n\n return \"\"\n}\n\n/**\n * Returns a string having leading characters matching the [predicate] removed.\n */\npublic inline fun String.trimStart(predicate: (Char) -> Boolean): String =\n (this as CharSequence).trimStart(predicate).toString()\n\n/**\n * Returns a sub sequence of this char sequence having trailing characters matching the [predicate] removed.\n */\npublic inline fun CharSequence.trimEnd(predicate: (Char) -> Boolean): CharSequence {\n for (index in this.indices.reversed())\n if (!predicate(this[index]))\n return subSequence(0, index + 1)\n\n return \"\"\n}\n\n/**\n * Returns a string having trailing characters matching the [predicate] removed.\n */\npublic inline fun String.trimEnd(predicate: (Char) -> Boolean): String =\n (this as CharSequence).trimEnd(predicate).toString()\n\n/**\n * Returns a sub sequence of this char sequence having leading and trailing characters from the [chars] array removed.\n */\npublic fun CharSequence.trim(vararg chars: Char): CharSequence = trim { it in chars }\n\n/**\n * Returns a string having leading and trailing characters from the [chars] array removed.\n */\npublic fun String.trim(vararg chars: Char): String = trim { it in chars }\n\n/**\n * Returns a sub sequence of this char sequence having leading characters from the [chars] array removed.\n */\npublic fun CharSequence.trimStart(vararg chars: Char): CharSequence = trimStart { it in chars }\n\n/**\n * Returns a string having leading characters from the [chars] array removed.\n */\npublic fun String.trimStart(vararg chars: Char): String = trimStart { it in chars }\n\n/**\n * Returns a sub sequence of this char sequence having trailing characters from the [chars] array removed.\n */\npublic fun CharSequence.trimEnd(vararg chars: Char): CharSequence = trimEnd { it in chars }\n\n/**\n * Returns a string having trailing characters from the [chars] array removed.\n */\npublic fun String.trimEnd(vararg chars: Char): String = trimEnd { it in chars }\n\n/**\n * Returns a sub sequence of this char sequence having leading and trailing whitespace removed.\n */\npublic fun CharSequence.trim(): CharSequence = trim(Char::isWhitespace)\n\n/**\n * Returns a string having leading and trailing whitespace removed.\n */\n@kotlin.internal.InlineOnly\npublic inline fun String.trim(): String = (this as CharSequence).trim().toString()\n\n/**\n * Returns a sub sequence of this char sequence having leading whitespace removed.\n */\npublic fun CharSequence.trimStart(): CharSequence = trimStart(Char::isWhitespace)\n\n/**\n * Returns a string having leading whitespace removed.\n */\n@kotlin.internal.InlineOnly\npublic inline fun String.trimStart(): String = (this as CharSequence).trimStart().toString()\n\n/**\n * Returns a sub sequence of this char sequence having trailing whitespace removed.\n */\npublic fun CharSequence.trimEnd(): CharSequence = trimEnd(Char::isWhitespace)\n\n/**\n * Returns a string having trailing whitespace removed.\n */\n@kotlin.internal.InlineOnly\npublic inline fun String.trimEnd(): String = (this as CharSequence).trimEnd().toString()\n\n/**\n * Returns a char sequence with content of this char sequence padded at the beginning\n * to the specified [length] with the specified character or space.\n *\n * @param length the desired string length.\n * @param padChar the character to pad string with, if it has length less than the [length] specified. Space is used by default.\n * @return Returns a char sequence of length at least [length] consisting of `this` char sequence prepended with [padChar] as many times\n * as are necessary to reach that length.\n * @sample samples.text.Strings.padStart\n */\npublic fun CharSequence.padStart(length: Int, padChar: Char = ' '): CharSequence {\n if (length < 0)\n throw IllegalArgumentException(\"Desired length $length is less than zero.\")\n if (length <= this.length)\n return this.subSequence(0, this.length)\n\n val sb = StringBuilder(length)\n for (i in 1..(length - this.length))\n sb.append(padChar)\n sb.append(this)\n return sb\n}\n\n/**\n * Pads the string to the specified [length] at the beginning with the specified character or space.\n *\n * @param length the desired string length.\n * @param padChar the character to pad string with, if it has length less than the [length] specified. Space is used by default.\n * @return Returns a string of length at least [length] consisting of `this` string prepended with [padChar] as many times\n * as are necessary to reach that length.\n * @sample samples.text.Strings.padStart\n */\npublic fun String.padStart(length: Int, padChar: Char = ' '): String =\n (this as CharSequence).padStart(length, padChar).toString()\n\n/**\n * Returns a char sequence with content of this char sequence padded at the end\n * to the specified [length] with the specified character or space.\n *\n * @param length the desired string length.\n * @param padChar the character to pad string with, if it has length less than the [length] specified. Space is used by default.\n * @return Returns a char sequence of length at least [length] consisting of `this` char sequence appended with [padChar] as many times\n * as are necessary to reach that length.\n * @sample samples.text.Strings.padEnd\n */\npublic fun CharSequence.padEnd(length: Int, padChar: Char = ' '): CharSequence {\n if (length < 0)\n throw IllegalArgumentException(\"Desired length $length is less than zero.\")\n if (length <= this.length)\n return this.subSequence(0, this.length)\n\n val sb = StringBuilder(length)\n sb.append(this)\n for (i in 1..(length - this.length))\n sb.append(padChar)\n return sb\n}\n\n/**\n * Pads the string to the specified [length] at the end with the specified character or space.\n *\n * @param length the desired string length.\n * @param padChar the character to pad string with, if it has length less than the [length] specified. Space is used by default.\n * @return Returns a string of length at least [length] consisting of `this` string appended with [padChar] as many times\n * as are necessary to reach that length.\n * @sample samples.text.Strings.padEnd\n */\npublic fun String.padEnd(length: Int, padChar: Char = ' '): String =\n (this as CharSequence).padEnd(length, padChar).toString()\n\n/**\n * Returns `true` if this nullable char sequence is either `null` or empty.\n *\n * @sample samples.text.Strings.stringIsNullOrEmpty\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence?.isNullOrEmpty(): Boolean {\n contract {\n returns(false) implies (this@isNullOrEmpty != null)\n }\n\n return this == null || this.length == 0\n}\n\n/**\n * Returns `true` if this char sequence is empty (contains no characters).\n *\n * @sample samples.text.Strings.stringIsEmpty\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.isEmpty(): Boolean = length == 0\n\n/**\n * Returns `true` if this char sequence is not empty.\n *\n * @sample samples.text.Strings.stringIsNotEmpty\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.isNotEmpty(): Boolean = length > 0\n\n// implemented differently in JVM and JS\n//public fun String.isBlank(): Boolean = length() == 0 || all { it.isWhitespace() }\n\n\n/**\n * Returns `true` if this char sequence is not empty and contains some characters except of whitespace characters.\n *\n * @sample samples.text.Strings.stringIsNotBlank\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.isNotBlank(): Boolean = !isBlank()\n\n/**\n * Returns `true` if this nullable char sequence is either `null` or empty or consists solely of whitespace characters.\n *\n * @sample samples.text.Strings.stringIsNullOrBlank\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence?.isNullOrBlank(): Boolean {\n contract {\n returns(false) implies (this@isNullOrBlank != null)\n }\n\n return this == null || this.isBlank()\n}\n\n/**\n * Iterator for characters of the given char sequence.\n */\npublic operator fun CharSequence.iterator(): CharIterator = object : CharIterator() {\n private var index = 0\n\n public override fun nextChar(): Char = get(index++)\n\n public override fun hasNext(): Boolean = index < length\n}\n\n/** Returns the string if it is not `null`, or the empty string otherwise. */\n@kotlin.internal.InlineOnly\npublic inline fun String?.orEmpty(): String = this ?: \"\"\n\n/**\n * Returns this char sequence if it's not empty\n * or the result of calling [defaultValue] function if the char sequence is empty.\n *\n * @sample samples.text.Strings.stringIfEmpty\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun C.ifEmpty(defaultValue: () -> R): R where C : CharSequence, C : R =\n if (isEmpty()) defaultValue() else this\n\n/**\n * Returns this char sequence if it is not empty and doesn't consist solely of whitespace characters,\n * or the result of calling [defaultValue] function otherwise.\n *\n * @sample samples.text.Strings.stringIfBlank\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun C.ifBlank(defaultValue: () -> R): R where C : CharSequence, C : R =\n if (isBlank()) defaultValue() else this\n\n/**\n * Returns the range of valid character indices for this char sequence.\n */\npublic val CharSequence.indices: IntRange\n get() = 0..length - 1\n\n/**\n * Returns the index of the last character in the char sequence or -1 if it is empty.\n */\npublic val CharSequence.lastIndex: Int\n get() = this.length - 1\n\n/**\n * Returns `true` if this CharSequence has Unicode surrogate pair at the specified [index].\n */\npublic fun CharSequence.hasSurrogatePairAt(index: Int): Boolean {\n return index in 0..length - 2\n && this[index].isHighSurrogate()\n && this[index + 1].isLowSurrogate()\n}\n\n/**\n * Returns a substring specified by the given [range] of indices.\n */\npublic fun String.substring(range: IntRange): String = substring(range.start, range.endInclusive + 1)\n\n/**\n * Returns a subsequence of this char sequence specified by the given [range] of indices.\n */\npublic fun CharSequence.subSequence(range: IntRange): CharSequence = subSequence(range.start, range.endInclusive + 1)\n\n/**\n * Returns a subsequence of this char sequence.\n *\n * This extension is chosen only for invocation with old-named parameters.\n * Replace parameter names with the same as those of [CharSequence.subSequence].\n */\n@kotlin.internal.InlineOnly\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\") // false warning\n@Deprecated(\"Use parameters named startIndex and endIndex.\", ReplaceWith(\"subSequence(startIndex = start, endIndex = end)\"))\npublic inline fun String.subSequence(start: Int, end: Int): CharSequence = subSequence(start, end)\n\n/**\n * Returns a substring of chars from a range of this char sequence starting at the [startIndex] and ending right before the [endIndex].\n *\n * @param startIndex the start index (inclusive).\n * @param endIndex the end index (exclusive). If not specified, the length of the char sequence is used.\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.substring(startIndex: Int, endIndex: Int = length): String = subSequence(startIndex, endIndex).toString()\n\n/**\n * Returns a substring of chars at indices from the specified [range] of this char sequence.\n */\npublic fun CharSequence.substring(range: IntRange): String = subSequence(range.start, range.endInclusive + 1).toString()\n\n/**\n * Returns a substring before the first occurrence of [delimiter].\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.substringBefore(delimiter: Char, missingDelimiterValue: String = this): String {\n val index = indexOf(delimiter)\n return if (index == -1) missingDelimiterValue else substring(0, index)\n}\n\n/**\n * Returns a substring before the first occurrence of [delimiter].\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.substringBefore(delimiter: String, missingDelimiterValue: String = this): String {\n val index = indexOf(delimiter)\n return if (index == -1) missingDelimiterValue else substring(0, index)\n}\n\n/**\n * Returns a substring after the first occurrence of [delimiter].\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.substringAfter(delimiter: Char, missingDelimiterValue: String = this): String {\n val index = indexOf(delimiter)\n return if (index == -1) missingDelimiterValue else substring(index + 1, length)\n}\n\n/**\n * Returns a substring after the first occurrence of [delimiter].\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.substringAfter(delimiter: String, missingDelimiterValue: String = this): String {\n val index = indexOf(delimiter)\n return if (index == -1) missingDelimiterValue else substring(index + delimiter.length, length)\n}\n\n/**\n * Returns a substring before the last occurrence of [delimiter].\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.substringBeforeLast(delimiter: Char, missingDelimiterValue: String = this): String {\n val index = lastIndexOf(delimiter)\n return if (index == -1) missingDelimiterValue else substring(0, index)\n}\n\n/**\n * Returns a substring before the last occurrence of [delimiter].\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.substringBeforeLast(delimiter: String, missingDelimiterValue: String = this): String {\n val index = lastIndexOf(delimiter)\n return if (index == -1) missingDelimiterValue else substring(0, index)\n}\n\n/**\n * Returns a substring after the last occurrence of [delimiter].\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.substringAfterLast(delimiter: Char, missingDelimiterValue: String = this): String {\n val index = lastIndexOf(delimiter)\n return if (index == -1) missingDelimiterValue else substring(index + 1, length)\n}\n\n/**\n * Returns a substring after the last occurrence of [delimiter].\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.substringAfterLast(delimiter: String, missingDelimiterValue: String = this): String {\n val index = lastIndexOf(delimiter)\n return if (index == -1) missingDelimiterValue else substring(index + delimiter.length, length)\n}\n\n/**\n * Returns a char sequence with content of this char sequence where its part at the given range\n * is replaced with the [replacement] char sequence.\n * @param startIndex the index of the first character to be replaced.\n * @param endIndex the index of the first character after the replacement to keep in the string.\n */\npublic fun CharSequence.replaceRange(startIndex: Int, endIndex: Int, replacement: CharSequence): CharSequence {\n if (endIndex < startIndex)\n throw IndexOutOfBoundsException(\"End index ($endIndex) is less than start index ($startIndex).\")\n val sb = StringBuilder()\n sb.appendRange(this, 0, startIndex)\n sb.append(replacement)\n sb.appendRange(this, endIndex, length)\n return sb\n}\n\n/**\n * Replaces the part of the string at the given range with the [replacement] char sequence.\n * @param startIndex the index of the first character to be replaced.\n * @param endIndex the index of the first character after the replacement to keep in the string.\n */\n@kotlin.internal.InlineOnly\npublic inline fun String.replaceRange(startIndex: Int, endIndex: Int, replacement: CharSequence): String =\n (this as CharSequence).replaceRange(startIndex, endIndex, replacement).toString()\n\n/**\n * Returns a char sequence with content of this char sequence where its part at the given [range]\n * is replaced with the [replacement] char sequence.\n *\n * The end index of the [range] is included in the part to be replaced.\n */\npublic fun CharSequence.replaceRange(range: IntRange, replacement: CharSequence): CharSequence =\n replaceRange(range.start, range.endInclusive + 1, replacement)\n\n/**\n * Replace the part of string at the given [range] with the [replacement] string.\n *\n * The end index of the [range] is included in the part to be replaced.\n */\n@kotlin.internal.InlineOnly\npublic inline fun String.replaceRange(range: IntRange, replacement: CharSequence): String =\n (this as CharSequence).replaceRange(range, replacement).toString()\n\n/**\n * Returns a char sequence with content of this char sequence where its part at the given range is removed.\n *\n * @param startIndex the index of the first character to be removed.\n * @param endIndex the index of the first character after the removed part to keep in the string.\n *\n * [endIndex] is not included in the removed part.\n */\npublic fun CharSequence.removeRange(startIndex: Int, endIndex: Int): CharSequence {\n if (endIndex < startIndex)\n throw IndexOutOfBoundsException(\"End index ($endIndex) is less than start index ($startIndex).\")\n\n if (endIndex == startIndex)\n return this.subSequence(0, length)\n\n val sb = StringBuilder(length - (endIndex - startIndex))\n sb.appendRange(this, 0, startIndex)\n sb.appendRange(this, endIndex, length)\n return sb\n}\n\n/**\n * Removes the part of a string at a given range.\n * @param startIndex the index of the first character to be removed.\n * @param endIndex the index of the first character after the removed part to keep in the string.\n *\n * [endIndex] is not included in the removed part.\n */\n@kotlin.internal.InlineOnly\npublic inline fun String.removeRange(startIndex: Int, endIndex: Int): String =\n (this as CharSequence).removeRange(startIndex, endIndex).toString()\n\n/**\n * Returns a char sequence with content of this char sequence where its part at the given [range] is removed.\n *\n * The end index of the [range] is included in the removed part.\n */\npublic fun CharSequence.removeRange(range: IntRange): CharSequence = removeRange(range.start, range.endInclusive + 1)\n\n/**\n * Removes the part of a string at the given [range].\n *\n * The end index of the [range] is included in the removed part.\n */\n@kotlin.internal.InlineOnly\npublic inline fun String.removeRange(range: IntRange): String =\n (this as CharSequence).removeRange(range).toString()\n\n/**\n * If this char sequence starts with the given [prefix], returns a new char sequence\n * with the prefix removed. Otherwise, returns a new char sequence with the same characters.\n */\npublic fun CharSequence.removePrefix(prefix: CharSequence): CharSequence {\n if (startsWith(prefix)) {\n return subSequence(prefix.length, length)\n }\n return subSequence(0, length)\n}\n\n/**\n * If this string starts with the given [prefix], returns a copy of this string\n * with the prefix removed. Otherwise, returns this string.\n */\npublic fun String.removePrefix(prefix: CharSequence): String {\n if (startsWith(prefix)) {\n return substring(prefix.length)\n }\n return this\n}\n\n/**\n * If this char sequence ends with the given [suffix], returns a new char sequence\n * with the suffix removed. Otherwise, returns a new char sequence with the same characters.\n */\npublic fun CharSequence.removeSuffix(suffix: CharSequence): CharSequence {\n if (endsWith(suffix)) {\n return subSequence(0, length - suffix.length)\n }\n return subSequence(0, length)\n}\n\n/**\n * If this string ends with the given [suffix], returns a copy of this string\n * with the suffix removed. Otherwise, returns this string.\n */\npublic fun String.removeSuffix(suffix: CharSequence): String {\n if (endsWith(suffix)) {\n return substring(0, length - suffix.length)\n }\n return this\n}\n\n/**\n * When this char sequence starts with the given [prefix] and ends with the given [suffix],\n * returns a new char sequence having both the given [prefix] and [suffix] removed.\n * Otherwise returns a new char sequence with the same characters.\n */\npublic fun CharSequence.removeSurrounding(prefix: CharSequence, suffix: CharSequence): CharSequence {\n if ((length >= prefix.length + suffix.length) && startsWith(prefix) && endsWith(suffix)) {\n return subSequence(prefix.length, length - suffix.length)\n }\n return subSequence(0, length)\n}\n\n/**\n * Removes from a string both the given [prefix] and [suffix] if and only if\n * it starts with the [prefix] and ends with the [suffix].\n * Otherwise returns this string unchanged.\n */\npublic fun String.removeSurrounding(prefix: CharSequence, suffix: CharSequence): String {\n if ((length >= prefix.length + suffix.length) && startsWith(prefix) && endsWith(suffix)) {\n return substring(prefix.length, length - suffix.length)\n }\n return this\n}\n\n/**\n * When this char sequence starts with and ends with the given [delimiter],\n * returns a new char sequence having this [delimiter] removed both from the start and end.\n * Otherwise returns a new char sequence with the same characters.\n */\npublic fun CharSequence.removeSurrounding(delimiter: CharSequence): CharSequence = removeSurrounding(delimiter, delimiter)\n\n/**\n * Removes the given [delimiter] string from both the start and the end of this string\n * if and only if it starts with and ends with the [delimiter].\n * Otherwise returns this string unchanged.\n */\npublic fun String.removeSurrounding(delimiter: CharSequence): String = removeSurrounding(delimiter, delimiter)\n\n/**\n * Replace part of string before the first occurrence of given delimiter with the [replacement] string.\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.replaceBefore(delimiter: Char, replacement: String, missingDelimiterValue: String = this): String {\n val index = indexOf(delimiter)\n return if (index == -1) missingDelimiterValue else replaceRange(0, index, replacement)\n}\n\n/**\n * Replace part of string before the first occurrence of given delimiter with the [replacement] string.\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.replaceBefore(delimiter: String, replacement: String, missingDelimiterValue: String = this): String {\n val index = indexOf(delimiter)\n return if (index == -1) missingDelimiterValue else replaceRange(0, index, replacement)\n}\n\n/**\n * Replace part of string after the first occurrence of given delimiter with the [replacement] string.\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.replaceAfter(delimiter: Char, replacement: String, missingDelimiterValue: String = this): String {\n val index = indexOf(delimiter)\n return if (index == -1) missingDelimiterValue else replaceRange(index + 1, length, replacement)\n}\n\n/**\n * Replace part of string after the first occurrence of given delimiter with the [replacement] string.\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.replaceAfter(delimiter: String, replacement: String, missingDelimiterValue: String = this): String {\n val index = indexOf(delimiter)\n return if (index == -1) missingDelimiterValue else replaceRange(index + delimiter.length, length, replacement)\n}\n\n/**\n * Replace part of string after the last occurrence of given delimiter with the [replacement] string.\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.replaceAfterLast(delimiter: String, replacement: String, missingDelimiterValue: String = this): String {\n val index = lastIndexOf(delimiter)\n return if (index == -1) missingDelimiterValue else replaceRange(index + delimiter.length, length, replacement)\n}\n\n/**\n * Replace part of string after the last occurrence of given delimiter with the [replacement] string.\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.replaceAfterLast(delimiter: Char, replacement: String, missingDelimiterValue: String = this): String {\n val index = lastIndexOf(delimiter)\n return if (index == -1) missingDelimiterValue else replaceRange(index + 1, length, replacement)\n}\n\n/**\n * Replace part of string before the last occurrence of given delimiter with the [replacement] string.\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.replaceBeforeLast(delimiter: Char, replacement: String, missingDelimiterValue: String = this): String {\n val index = lastIndexOf(delimiter)\n return if (index == -1) missingDelimiterValue else replaceRange(0, index, replacement)\n}\n\n/**\n * Replace part of string before the last occurrence of given delimiter with the [replacement] string.\n * If the string does not contain the delimiter, returns [missingDelimiterValue] which defaults to the original string.\n */\npublic fun String.replaceBeforeLast(delimiter: String, replacement: String, missingDelimiterValue: String = this): String {\n val index = lastIndexOf(delimiter)\n return if (index == -1) missingDelimiterValue else replaceRange(0, index, replacement)\n}\n\n\n// public fun String.replace(oldChar: Char, newChar: Char, ignoreCase: Boolean): String // JVM- and JS-specific\n// public fun String.replace(oldValue: String, newValue: String, ignoreCase: Boolean): String // JVM- and JS-specific\n\n/**\n * Returns a new string obtained by replacing each substring of this char sequence that matches the given regular expression\n * with the given [replacement].\n *\n * The [replacement] can consist of any combination of literal text and $-substitutions. To treat the replacement string\n * literally escape it with the [kotlin.text.Regex.Companion.escapeReplacement] method.\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.replace(regex: Regex, replacement: String): String = regex.replace(this, replacement)\n\n/**\n * Returns a new string obtained by replacing each substring of this char sequence that matches the given regular expression\n * with the result of the given function [transform] that takes [MatchResult] and returns a string to be used as a\n * replacement for that match.\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.replace(regex: Regex, noinline transform: (MatchResult) -> CharSequence): String =\n regex.replace(this, transform)\n\n/**\n * Replaces the first occurrence of the given regular expression [regex] in this char sequence with specified [replacement] expression.\n *\n * @param replacement A replacement expression that can include substitutions. See [Regex.replaceFirst] for details.\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.replaceFirst(regex: Regex, replacement: String): String = regex.replaceFirst(this, replacement)\n\n/**\n * Returns a copy of this string having its first character replaced with the result of the specified [transform],\n * or the original string if it's empty.\n *\n * @param transform function that takes the first character and returns the result of the transform applied to the character.\n *\n * @sample samples.text.Strings.replaceFirstChar\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@JvmName(\"replaceFirstCharWithChar\")\n@kotlin.internal.InlineOnly\npublic inline fun String.replaceFirstChar(transform: (Char) -> Char): String {\n return if (isNotEmpty()) transform(this[0]) + substring(1) else this\n}\n\n/**\n * Returns a copy of this string having its first character replaced with the result of the specified [transform],\n * or the original string if it's empty.\n *\n * @param transform function that takes the first character and returns the result of the transform applied to the character.\n *\n * @sample samples.text.Strings.replaceFirstChar\n */\n@SinceKotlin(\"1.5\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@JvmName(\"replaceFirstCharWithCharSequence\")\n@kotlin.internal.InlineOnly\npublic inline fun String.replaceFirstChar(transform: (Char) -> CharSequence): String {\n return if (isNotEmpty()) transform(this[0]).toString() + substring(1) else this\n}\n\n\n/**\n * Returns `true` if this char sequence matches the given regular expression.\n */\n@kotlin.internal.InlineOnly\npublic inline infix fun CharSequence.matches(regex: Regex): Boolean = regex.matches(this)\n\n/**\n * Implementation of [regionMatches] for CharSequences.\n * Invoked when it's already known that arguments are not Strings, so that no additional type checks are performed.\n */\ninternal fun CharSequence.regionMatchesImpl(thisOffset: Int, other: CharSequence, otherOffset: Int, length: Int, ignoreCase: Boolean): Boolean {\n if ((otherOffset < 0) || (thisOffset < 0) || (thisOffset > this.length - length) || (otherOffset > other.length - length)) {\n return false\n }\n\n for (index in 0 until length) {\n if (!this[thisOffset + index].equals(other[otherOffset + index], ignoreCase))\n return false\n }\n return true\n}\n\n/**\n * Returns `true` if this char sequence starts with the specified character.\n */\npublic fun CharSequence.startsWith(char: Char, ignoreCase: Boolean = false): Boolean =\n this.length > 0 && this[0].equals(char, ignoreCase)\n\n/**\n * Returns `true` if this char sequence ends with the specified character.\n */\npublic fun CharSequence.endsWith(char: Char, ignoreCase: Boolean = false): Boolean =\n this.length > 0 && this[lastIndex].equals(char, ignoreCase)\n\n/**\n * Returns `true` if this char sequence starts with the specified prefix.\n */\npublic fun CharSequence.startsWith(prefix: CharSequence, ignoreCase: Boolean = false): Boolean {\n if (!ignoreCase && this is String && prefix is String)\n return this.startsWith(prefix)\n else\n return regionMatchesImpl(0, prefix, 0, prefix.length, ignoreCase)\n}\n\n/**\n * Returns `true` if a substring of this char sequence starting at the specified offset [startIndex] starts with the specified prefix.\n */\npublic fun CharSequence.startsWith(prefix: CharSequence, startIndex: Int, ignoreCase: Boolean = false): Boolean {\n if (!ignoreCase && this is String && prefix is String)\n return this.startsWith(prefix, startIndex)\n else\n return regionMatchesImpl(startIndex, prefix, 0, prefix.length, ignoreCase)\n}\n\n/**\n * Returns `true` if this char sequence ends with the specified suffix.\n */\npublic fun CharSequence.endsWith(suffix: CharSequence, ignoreCase: Boolean = false): Boolean {\n if (!ignoreCase && this is String && suffix is String)\n return this.endsWith(suffix)\n else\n return regionMatchesImpl(length - suffix.length, suffix, 0, suffix.length, ignoreCase)\n}\n\n\n// common prefix and suffix\n\n/**\n * Returns the longest string `prefix` such that this char sequence and [other] char sequence both start with this prefix,\n * taking care not to split surrogate pairs.\n * If this and [other] have no common prefix, returns the empty string.\n\n * @param ignoreCase `true` to ignore character case when matching a character. By default `false`.\n * @sample samples.text.Strings.commonPrefixWith\n */\npublic fun CharSequence.commonPrefixWith(other: CharSequence, ignoreCase: Boolean = false): String {\n val shortestLength = minOf(this.length, other.length)\n\n var i = 0\n while (i < shortestLength && this[i].equals(other[i], ignoreCase = ignoreCase)) {\n i++\n }\n if (this.hasSurrogatePairAt(i - 1) || other.hasSurrogatePairAt(i - 1)) {\n i--\n }\n return subSequence(0, i).toString()\n}\n\n/**\n * Returns the longest string `suffix` such that this char sequence and [other] char sequence both end with this suffix,\n * taking care not to split surrogate pairs.\n * If this and [other] have no common suffix, returns the empty string.\n\n * @param ignoreCase `true` to ignore character case when matching a character. By default `false`.\n * @sample samples.text.Strings.commonSuffixWith\n */\npublic fun CharSequence.commonSuffixWith(other: CharSequence, ignoreCase: Boolean = false): String {\n val thisLength = this.length\n val otherLength = other.length\n val shortestLength = minOf(thisLength, otherLength)\n\n var i = 0\n while (i < shortestLength && this[thisLength - i - 1].equals(other[otherLength - i - 1], ignoreCase = ignoreCase)) {\n i++\n }\n if (this.hasSurrogatePairAt(thisLength - i - 1) || other.hasSurrogatePairAt(otherLength - i - 1)) {\n i--\n }\n return subSequence(thisLength - i, thisLength).toString()\n}\n\n\n// indexOfAny()\n\n/**\n * Finds the index of the first occurrence of any of the specified [chars] in this char sequence,\n * starting from the specified [startIndex] and optionally ignoring the case.\n *\n * @param ignoreCase `true` to ignore character case when matching a character. By default `false`.\n * @return An index of the first occurrence of matched character from [chars] or -1 if none of [chars] are found.\n *\n */\npublic fun CharSequence.indexOfAny(chars: CharArray, startIndex: Int = 0, ignoreCase: Boolean = false): Int {\n if (!ignoreCase && chars.size == 1 && this is String) {\n val char = chars.single()\n return nativeIndexOf(char, startIndex)\n }\n\n for (index in startIndex.coerceAtLeast(0)..lastIndex) {\n val charAtIndex = get(index)\n if (chars.any { it.equals(charAtIndex, ignoreCase) })\n return index\n }\n return -1\n}\n\n/**\n * Finds the index of the last occurrence of any of the specified [chars] in this char sequence,\n * starting from the specified [startIndex] and optionally ignoring the case.\n *\n * @param startIndex The index of character to start searching at. The search proceeds backward toward the beginning of the string.\n * @param ignoreCase `true` to ignore character case when matching a character. By default `false`.\n * @return An index of the last occurrence of matched character from [chars] or -1 if none of [chars] are found.\n *\n */\npublic fun CharSequence.lastIndexOfAny(chars: CharArray, startIndex: Int = lastIndex, ignoreCase: Boolean = false): Int {\n if (!ignoreCase && chars.size == 1 && this is String) {\n val char = chars.single()\n return nativeLastIndexOf(char, startIndex)\n }\n\n\n for (index in startIndex.coerceAtMost(lastIndex) downTo 0) {\n val charAtIndex = get(index)\n if (chars.any { it.equals(charAtIndex, ignoreCase) })\n return index\n }\n\n return -1\n}\n\n\nprivate fun CharSequence.indexOf(other: CharSequence, startIndex: Int, endIndex: Int, ignoreCase: Boolean, last: Boolean = false): Int {\n val indices = if (!last)\n startIndex.coerceAtLeast(0)..endIndex.coerceAtMost(length)\n else\n startIndex.coerceAtMost(lastIndex) downTo endIndex.coerceAtLeast(0)\n\n if (this is String && other is String) { // smart cast\n for (index in indices) {\n if (other.regionMatches(0, this, index, other.length, ignoreCase))\n return index\n }\n } else {\n for (index in indices) {\n if (other.regionMatchesImpl(0, this, index, other.length, ignoreCase))\n return index\n }\n }\n return -1\n}\n\nprivate fun CharSequence.findAnyOf(strings: Collection, startIndex: Int, ignoreCase: Boolean, last: Boolean): Pair? {\n if (!ignoreCase && strings.size == 1) {\n val string = strings.single()\n val index = if (!last) indexOf(string, startIndex) else lastIndexOf(string, startIndex)\n return if (index < 0) null else index to string\n }\n\n val indices = if (!last) startIndex.coerceAtLeast(0)..length else startIndex.coerceAtMost(lastIndex) downTo 0\n\n if (this is String) {\n for (index in indices) {\n val matchingString = strings.firstOrNull { it.regionMatches(0, this, index, it.length, ignoreCase) }\n if (matchingString != null)\n return index to matchingString\n }\n } else {\n for (index in indices) {\n val matchingString = strings.firstOrNull { it.regionMatchesImpl(0, this, index, it.length, ignoreCase) }\n if (matchingString != null)\n return index to matchingString\n }\n }\n\n return null\n}\n\n/**\n * Finds the first occurrence of any of the specified [strings] in this char sequence,\n * starting from the specified [startIndex] and optionally ignoring the case.\n *\n * @param ignoreCase `true` to ignore character case when matching a string. By default `false`.\n * @return A pair of an index of the first occurrence of matched string from [strings] and the string matched\n * or `null` if none of [strings] are found.\n *\n * To avoid ambiguous results when strings in [strings] have characters in common, this method proceeds from\n * the beginning to the end of this string, and finds at each position the first element in [strings]\n * that matches this string at that position.\n */\npublic fun CharSequence.findAnyOf(strings: Collection, startIndex: Int = 0, ignoreCase: Boolean = false): Pair? =\n findAnyOf(strings, startIndex, ignoreCase, last = false)\n\n/**\n * Finds the last occurrence of any of the specified [strings] in this char sequence,\n * starting from the specified [startIndex] and optionally ignoring the case.\n *\n * @param startIndex The index of character to start searching at. The search proceeds backward toward the beginning of the string.\n * @param ignoreCase `true` to ignore character case when matching a string. By default `false`.\n * @return A pair of an index of the last occurrence of matched string from [strings] and the string matched or `null` if none of [strings] are found.\n *\n * To avoid ambiguous results when strings in [strings] have characters in common, this method proceeds from\n * the end toward the beginning of this string, and finds at each position the first element in [strings]\n * that matches this string at that position.\n */\npublic fun CharSequence.findLastAnyOf(strings: Collection, startIndex: Int = lastIndex, ignoreCase: Boolean = false): Pair? =\n findAnyOf(strings, startIndex, ignoreCase, last = true)\n\n/**\n * Finds the index of the first occurrence of any of the specified [strings] in this char sequence,\n * starting from the specified [startIndex] and optionally ignoring the case.\n *\n * @param ignoreCase `true` to ignore character case when matching a string. By default `false`.\n * @return An index of the first occurrence of matched string from [strings] or -1 if none of [strings] are found.\n *\n * To avoid ambiguous results when strings in [strings] have characters in common, this method proceeds from\n * the beginning to the end of this string, and finds at each position the first element in [strings]\n * that matches this string at that position.\n */\npublic fun CharSequence.indexOfAny(strings: Collection, startIndex: Int = 0, ignoreCase: Boolean = false): Int =\n findAnyOf(strings, startIndex, ignoreCase, last = false)?.first ?: -1\n\n/**\n * Finds the index of the last occurrence of any of the specified [strings] in this char sequence,\n * starting from the specified [startIndex] and optionally ignoring the case.\n *\n * @param startIndex The index of character to start searching at. The search proceeds backward toward the beginning of the string.\n * @param ignoreCase `true` to ignore character case when matching a string. By default `false`.\n * @return An index of the last occurrence of matched string from [strings] or -1 if none of [strings] are found.\n *\n * To avoid ambiguous results when strings in [strings] have characters in common, this method proceeds from\n * the end toward the beginning of this string, and finds at each position the first element in [strings]\n * that matches this string at that position.\n */\npublic fun CharSequence.lastIndexOfAny(strings: Collection, startIndex: Int = lastIndex, ignoreCase: Boolean = false): Int =\n findAnyOf(strings, startIndex, ignoreCase, last = true)?.first ?: -1\n\n\n// indexOf\n\n/**\n * Returns the index within this string of the first occurrence of the specified character, starting from the specified [startIndex].\n *\n * @param ignoreCase `true` to ignore character case when matching a character. By default `false`.\n * @return An index of the first occurrence of [char] or -1 if none is found.\n */\npublic fun CharSequence.indexOf(char: Char, startIndex: Int = 0, ignoreCase: Boolean = false): Int {\n return if (ignoreCase || this !is String)\n indexOfAny(charArrayOf(char), startIndex, ignoreCase)\n else\n nativeIndexOf(char, startIndex)\n}\n\n/**\n * Returns the index within this char sequence of the first occurrence of the specified [string],\n * starting from the specified [startIndex].\n *\n * @param ignoreCase `true` to ignore character case when matching a string. By default `false`.\n * @return An index of the first occurrence of [string] or `-1` if none is found.\n * @sample samples.text.Strings.indexOf\n */\npublic fun CharSequence.indexOf(string: String, startIndex: Int = 0, ignoreCase: Boolean = false): Int {\n return if (ignoreCase || this !is String)\n indexOf(string, startIndex, length, ignoreCase)\n else\n nativeIndexOf(string, startIndex)\n}\n\n/**\n * Returns the index within this char sequence of the last occurrence of the specified character,\n * starting from the specified [startIndex].\n *\n * @param startIndex The index of character to start searching at. The search proceeds backward toward the beginning of the string.\n * @param ignoreCase `true` to ignore character case when matching a character. By default `false`.\n * @return An index of the last occurrence of [char] or -1 if none is found.\n */\npublic fun CharSequence.lastIndexOf(char: Char, startIndex: Int = lastIndex, ignoreCase: Boolean = false): Int {\n return if (ignoreCase || this !is String)\n lastIndexOfAny(charArrayOf(char), startIndex, ignoreCase)\n else\n nativeLastIndexOf(char, startIndex)\n}\n\n/**\n * Returns the index within this char sequence of the last occurrence of the specified [string],\n * starting from the specified [startIndex].\n *\n * @param startIndex The index of character to start searching at. The search proceeds backward toward the beginning of the string.\n * @param ignoreCase `true` to ignore character case when matching a string. By default `false`.\n * @return An index of the last occurrence of [string] or -1 if none is found.\n */\npublic fun CharSequence.lastIndexOf(string: String, startIndex: Int = lastIndex, ignoreCase: Boolean = false): Int {\n return if (ignoreCase || this !is String)\n indexOf(string, startIndex, 0, ignoreCase, last = true)\n else\n nativeLastIndexOf(string, startIndex)\n}\n\n/**\n * Returns `true` if this char sequence contains the specified [other] sequence of characters as a substring.\n *\n * @param ignoreCase `true` to ignore character case when comparing strings. By default `false`.\n */\n@Suppress(\"INAPPLICABLE_OPERATOR_MODIFIER\")\npublic operator fun CharSequence.contains(other: CharSequence, ignoreCase: Boolean = false): Boolean =\n if (other is String)\n indexOf(other, ignoreCase = ignoreCase) >= 0\n else\n indexOf(other, 0, length, ignoreCase) >= 0\n\n\n\n/**\n * Returns `true` if this char sequence contains the specified character [char].\n *\n * @param ignoreCase `true` to ignore character case when comparing characters. By default `false`.\n */\n@Suppress(\"INAPPLICABLE_OPERATOR_MODIFIER\")\npublic operator fun CharSequence.contains(char: Char, ignoreCase: Boolean = false): Boolean =\n indexOf(char, ignoreCase = ignoreCase) >= 0\n\n/**\n * Returns `true` if this char sequence contains at least one match of the specified regular expression [regex].\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun CharSequence.contains(regex: Regex): Boolean = regex.containsMatchIn(this)\n\n\n// rangesDelimitedBy\n\n\nprivate class DelimitedRangesSequence(\n private val input: CharSequence,\n private val startIndex: Int,\n private val limit: Int,\n private val getNextMatch: CharSequence.(currentIndex: Int) -> Pair?\n) : Sequence {\n\n override fun iterator(): Iterator = object : Iterator {\n var nextState: Int = -1 // -1 for unknown, 0 for done, 1 for continue\n var currentStartIndex: Int = startIndex.coerceIn(0, input.length)\n var nextSearchIndex: Int = currentStartIndex\n var nextItem: IntRange? = null\n var counter: Int = 0\n\n private fun calcNext() {\n if (nextSearchIndex < 0) {\n nextState = 0\n nextItem = null\n } else {\n if (limit > 0 && ++counter >= limit || nextSearchIndex > input.length) {\n nextItem = currentStartIndex..input.lastIndex\n nextSearchIndex = -1\n } else {\n val match = input.getNextMatch(nextSearchIndex)\n if (match == null) {\n nextItem = currentStartIndex..input.lastIndex\n nextSearchIndex = -1\n } else {\n val (index, length) = match\n nextItem = currentStartIndex until index\n currentStartIndex = index + length\n nextSearchIndex = currentStartIndex + if (length == 0) 1 else 0\n }\n }\n nextState = 1\n }\n }\n\n override fun next(): IntRange {\n if (nextState == -1)\n calcNext()\n if (nextState == 0)\n throw NoSuchElementException()\n val result = nextItem as IntRange\n // Clean next to avoid keeping reference on yielded instance\n nextItem = null\n nextState = -1\n return result\n }\n\n override fun hasNext(): Boolean {\n if (nextState == -1)\n calcNext()\n return nextState == 1\n }\n }\n}\n\n/**\n * Returns a sequence of index ranges of substrings in this char sequence around occurrences of the specified [delimiters].\n *\n * @param delimiters One or more characters to be used as delimiters.\n * @param startIndex The index to start searching delimiters from.\n * No range having its start value less than [startIndex] is returned.\n * [startIndex] is coerced to be non-negative and not greater than length of this string.\n * @param ignoreCase `true` to ignore character case when matching a delimiter. By default `false`.\n * @param limit The maximum number of substrings to return. Zero by default means no limit is set.\n */\nprivate fun CharSequence.rangesDelimitedBy(delimiters: CharArray, startIndex: Int = 0, ignoreCase: Boolean = false, limit: Int = 0): Sequence {\n requireNonNegativeLimit(limit)\n\n return DelimitedRangesSequence(this, startIndex, limit, { currentIndex ->\n indexOfAny(delimiters, currentIndex, ignoreCase = ignoreCase).let { if (it < 0) null else it to 1 }\n })\n}\n\n\n/**\n * Returns a sequence of index ranges of substrings in this char sequence around occurrences of the specified [delimiters].\n *\n * @param delimiters One or more strings to be used as delimiters.\n * @param startIndex The index to start searching delimiters from.\n * No range having its start value less than [startIndex] is returned.\n * [startIndex] is coerced to be non-negative and not greater than length of this string.\n * @param ignoreCase `true` to ignore character case when matching a delimiter. By default `false`.\n * @param limit The maximum number of substrings to return. Zero by default means no limit is set.\n *\n * To avoid ambiguous results when strings in [delimiters] have characters in common, this method proceeds from\n * the beginning to the end of this string, and finds at each position the first element in [delimiters]\n * that matches this string at that position.\n */\nprivate fun CharSequence.rangesDelimitedBy(delimiters: Array, startIndex: Int = 0, ignoreCase: Boolean = false, limit: Int = 0): Sequence {\n requireNonNegativeLimit(limit)\n val delimitersList = delimiters.asList()\n\n return DelimitedRangesSequence(this, startIndex, limit, { currentIndex -> findAnyOf(delimitersList, currentIndex, ignoreCase = ignoreCase, last = false)?.let { it.first to it.second.length } })\n\n}\n\ninternal fun requireNonNegativeLimit(limit: Int) =\n require(limit >= 0) { \"Limit must be non-negative, but was $limit\" }\n\n\n// split\n\n/**\n * Splits this char sequence to a sequence of strings around occurrences of the specified [delimiters].\n *\n * @param delimiters One or more strings to be used as delimiters.\n * @param ignoreCase `true` to ignore character case when matching a delimiter. By default `false`.\n * @param limit The maximum number of substrings to return. Zero by default means no limit is set.\n *\n * To avoid ambiguous results when strings in [delimiters] have characters in common, this method proceeds from\n * the beginning to the end of this string, and finds at each position the first element in [delimiters]\n * that matches this string at that position.\n */\npublic fun CharSequence.splitToSequence(vararg delimiters: String, ignoreCase: Boolean = false, limit: Int = 0): Sequence =\n rangesDelimitedBy(delimiters, ignoreCase = ignoreCase, limit = limit).map { substring(it) }\n\n/**\n * Splits this char sequence to a list of strings around occurrences of the specified [delimiters].\n *\n * @param delimiters One or more strings to be used as delimiters.\n * @param ignoreCase `true` to ignore character case when matching a delimiter. By default `false`.\n * @param limit The maximum number of substrings to return. Zero by default means no limit is set.\n *\n * To avoid ambiguous results when strings in [delimiters] have characters in common, this method proceeds from\n * the beginning to the end of this string, and matches at each position the first element in [delimiters]\n * that is equal to a delimiter in this instance at that position.\n */\npublic fun CharSequence.split(vararg delimiters: String, ignoreCase: Boolean = false, limit: Int = 0): List {\n if (delimiters.size == 1) {\n val delimiter = delimiters[0]\n if (!delimiter.isEmpty()) {\n return split(delimiter, ignoreCase, limit)\n }\n }\n\n return rangesDelimitedBy(delimiters, ignoreCase = ignoreCase, limit = limit).asIterable().map { substring(it) }\n}\n\n/**\n * Splits this char sequence to a sequence of strings around occurrences of the specified [delimiters].\n *\n * @param delimiters One or more characters to be used as delimiters.\n * @param ignoreCase `true` to ignore character case when matching a delimiter. By default `false`.\n * @param limit The maximum number of substrings to return.\n */\npublic fun CharSequence.splitToSequence(vararg delimiters: Char, ignoreCase: Boolean = false, limit: Int = 0): Sequence =\n rangesDelimitedBy(delimiters, ignoreCase = ignoreCase, limit = limit).map { substring(it) }\n\n/**\n * Splits this char sequence to a list of strings around occurrences of the specified [delimiters].\n *\n * @param delimiters One or more characters to be used as delimiters.\n * @param ignoreCase `true` to ignore character case when matching a delimiter. By default `false`.\n * @param limit The maximum number of substrings to return.\n */\npublic fun CharSequence.split(vararg delimiters: Char, ignoreCase: Boolean = false, limit: Int = 0): List {\n if (delimiters.size == 1) {\n return split(delimiters[0].toString(), ignoreCase, limit)\n }\n\n return rangesDelimitedBy(delimiters, ignoreCase = ignoreCase, limit = limit).asIterable().map { substring(it) }\n}\n\n/**\n * Splits this char sequence to a list of strings around occurrences of the specified [delimiter].\n * This is specialized version of split which receives single non-empty delimiter and offers better performance\n *\n * @param delimiter String used as delimiter\n * @param ignoreCase `true` to ignore character case when matching a delimiter. By default `false`.\n * @param limit The maximum number of substrings to return.\n */\nprivate fun CharSequence.split(delimiter: String, ignoreCase: Boolean, limit: Int): List {\n requireNonNegativeLimit(limit)\n\n var currentOffset = 0\n var nextIndex = indexOf(delimiter, currentOffset, ignoreCase)\n if (nextIndex == -1 || limit == 1) {\n return listOf(this.toString())\n }\n\n val isLimited = limit > 0\n val result = ArrayList(if (isLimited) limit.coerceAtMost(10) else 10)\n do {\n result.add(substring(currentOffset, nextIndex))\n currentOffset = nextIndex + delimiter.length\n // Do not search for next occurrence if we're reaching limit\n if (isLimited && result.size == limit - 1) break\n nextIndex = indexOf(delimiter, currentOffset, ignoreCase)\n } while (nextIndex != -1)\n\n result.add(substring(currentOffset, length))\n return result\n}\n\n/**\n * Splits this char sequence to a list of strings around matches of the given regular expression.\n *\n * @param limit Non-negative value specifying the maximum number of substrings to return.\n * Zero by default means no limit is set.\n */\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.split(regex: Regex, limit: Int = 0): List = regex.split(this, limit)\n\n/**\n * Splits this char sequence to a sequence of strings around matches of the given regular expression.\n *\n * @param limit Non-negative value specifying the maximum number of substrings to return.\n * Zero by default means no limit is set.\n * @sample samples.text.Strings.splitToSequence\n */\n@SinceKotlin(\"1.6\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun CharSequence.splitToSequence(regex: Regex, limit: Int = 0): Sequence = regex.splitToSequence(this, limit)\n\n/**\n * Splits this char sequence to a sequence of lines delimited by any of the following character sequences: CRLF, LF or CR.\n *\n * The lines returned do not include terminating line separators.\n */\npublic fun CharSequence.lineSequence(): Sequence = splitToSequence(\"\\r\\n\", \"\\n\", \"\\r\")\n\n/**\n * Splits this char sequence to a list of lines delimited by any of the following character sequences: CRLF, LF or CR.\n *\n * The lines returned do not include terminating line separators.\n */\npublic fun CharSequence.lines(): List = lineSequence().toList()\n\n/**\n * Returns `true` if the contents of this char sequence are equal to the contents of the specified [other],\n * i.e. both char sequences contain the same number of the same characters in the same order.\n *\n * @sample samples.text.Strings.contentEquals\n */\n@SinceKotlin(\"1.5\")\npublic expect infix fun CharSequence?.contentEquals(other: CharSequence?): Boolean\n\n/**\n * Returns `true` if the contents of this char sequence are equal to the contents of the specified [other], optionally ignoring case difference.\n *\n * @param ignoreCase `true` to ignore character case when comparing contents.\n *\n * @sample samples.text.Strings.contentEquals\n */\n@SinceKotlin(\"1.5\")\npublic expect fun CharSequence?.contentEquals(other: CharSequence?, ignoreCase: Boolean): Boolean\n\ninternal fun CharSequence?.contentEqualsIgnoreCaseImpl(other: CharSequence?): Boolean {\n if (this is String && other is String) {\n return this.equals(other, ignoreCase = true)\n }\n\n if (this === other) return true\n if (this == null || other == null || this.length != other.length) return false\n\n for (i in 0 until length) {\n if (!this[i].equals(other[i], ignoreCase = true)) {\n return false\n }\n }\n\n return true\n}\n\ninternal fun CharSequence?.contentEqualsImpl(other: CharSequence?): Boolean {\n if (this is String && other is String) {\n return this == other\n }\n\n if (this === other) return true\n if (this == null || other == null || this.length != other.length) return false\n\n for (i in 0 until length) {\n if (this[i] != other[i]) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * Returns `true` if the content of this string is equal to the word \"true\", `false` if it is equal to \"false\",\n * and throws an exception otherwise.\n *\n * There is also a lenient version of the function available on nullable String, [String?.toBoolean].\n * Note that this function is case-sensitive.\n *\n * @sample samples.text.Strings.toBooleanStrict\n */\n@SinceKotlin(\"1.5\")\npublic fun String.toBooleanStrict(): Boolean = when (this) {\n \"true\" -> true\n \"false\" -> false\n else -> throw IllegalArgumentException(\"The string doesn't represent a boolean value: $this\")\n}\n\n/**\n * Returns `true` if the content of this string is equal to the word \"true\", `false` if it is equal to \"false\",\n * and `null` otherwise.\n *\n * There is also a lenient version of the function available on nullable String, [String?.toBoolean].\n * Note that this function is case-sensitive.\n *\n * @sample samples.text.Strings.toBooleanStrictOrNull\n */\n@SinceKotlin(\"1.5\")\npublic fun String.toBooleanStrictOrNull(): Boolean? = when (this) {\n \"true\" -> true\n \"false\" -> false\n else -> null\n}","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\npackage kotlin.text\n\n\n/**\n * Returns `true` if the content of this string is equal to the word \"true\", ignoring case, and `false` otherwise.\n */\n@Deprecated(\"Use Kotlin compiler 1.4 to avoid deprecation warning.\")\n@DeprecatedSinceKotlin(hiddenSince = \"1.4\")\n@kotlin.internal.InlineOnly\npublic actual inline fun String.toBoolean(): Boolean = this.toBoolean()\n\n/**\n * Returns `true` if this string is not `null` and its content is equal to the word \"true\", ignoring case, and `false` otherwise.\n *\n * There are also strict versions of the function available on non-nullable String, [toBooleanStrict] and [toBooleanStrictOrNull].\n */\n@SinceKotlin(\"1.4\")\npublic actual fun String?.toBoolean(): Boolean = this != null && this.lowercase() == \"true\"\n\n/**\n * Parses the string as a signed [Byte] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n */\npublic actual fun String.toByte(): Byte = toByteOrNull() ?: numberFormatError(this)\n\n/**\n * Parses the string as a signed [Byte] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n * @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion.\n */\npublic actual fun String.toByte(radix: Int): Byte = toByteOrNull(radix) ?: numberFormatError(this)\n\n\n/**\n * Parses the string as a [Short] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n */\npublic actual fun String.toShort(): Short = toShortOrNull() ?: numberFormatError(this)\n\n/**\n * Parses the string as a [Short] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n * @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion.\n */\npublic actual fun String.toShort(radix: Int): Short = toShortOrNull(radix) ?: numberFormatError(this)\n\n/**\n * Parses the string as an [Int] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n */\npublic actual fun String.toInt(): Int = toIntOrNull() ?: numberFormatError(this)\n\n/**\n * Parses the string as an [Int] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n * @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion.\n */\npublic actual fun String.toInt(radix: Int): Int = toIntOrNull(radix) ?: numberFormatError(this)\n\n/**\n * Parses the string as a [Long] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n */\npublic actual fun String.toLong(): Long = toLongOrNull() ?: numberFormatError(this)\n\n/**\n * Parses the string as a [Long] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n * @throws IllegalArgumentException when [radix] is not a valid radix for string to number conversion.\n */\npublic actual fun String.toLong(radix: Int): Long = toLongOrNull(radix) ?: numberFormatError(this)\n\n/**\n * Parses the string as a [Double] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n */\npublic actual fun String.toDouble(): Double = (+(this.asDynamic())).unsafeCast().also {\n if (it.isNaN() && !this.isNaN() || it == 0.0 && this.isBlank())\n numberFormatError(this)\n}\n\n/**\n * Parses the string as a [Float] number and returns the result.\n * @throws NumberFormatException if the string is not a valid representation of a number.\n */\n@kotlin.internal.InlineOnly\npublic actual inline fun String.toFloat(): Float = toDouble().unsafeCast()\n\n/**\n * Parses the string as a [Double] number and returns the result\n * or `null` if the string is not a valid representation of a number.\n */\npublic actual fun String.toDoubleOrNull(): Double? = (+(this.asDynamic())).unsafeCast().takeIf {\n !(it.isNaN() && !this.isNaN() || it == 0.0 && this.isBlank())\n}\n\n/**\n * Parses the string as a [Float] number and returns the result\n * or `null` if the string is not a valid representation of a number.\n */\n@kotlin.internal.InlineOnly\npublic actual inline fun String.toFloatOrNull(): Float? = toDoubleOrNull().unsafeCast()\n\n/**\n * Returns a string representation of this [Byte] value in the specified [radix].\n *\n * @throws IllegalArgumentException when [radix] is not a valid radix for number to string conversion.\n */\n@SinceKotlin(\"1.2\")\n@kotlin.internal.InlineOnly\npublic actual inline fun Byte.toString(radix: Int): String = this.toInt().toString(radix)\n\n/**\n * Returns a string representation of this [Short] value in the specified [radix].\n *\n * @throws IllegalArgumentException when [radix] is not a valid radix for number to string conversion.\n */\n@SinceKotlin(\"1.2\")\n@kotlin.internal.InlineOnly\npublic actual inline fun Short.toString(radix: Int): String = this.toInt().toString(radix)\n\n/**\n * Returns a string representation of this [Int] value in the specified [radix].\n *\n * @throws IllegalArgumentException when [radix] is not a valid radix for number to string conversion.\n */\n@SinceKotlin(\"1.2\")\npublic actual fun Int.toString(radix: Int): String = asDynamic().toString(checkRadix(radix))\n\nprivate fun String.isNaN(): Boolean = when (this.lowercase()) {\n \"nan\", \"+nan\", \"-nan\" -> true\n else -> false\n}\n\n/**\n * Checks whether the given [radix] is valid radix for string to number and number to string conversion.\n */\n@PublishedApi\ninternal actual fun checkRadix(radix: Int): Int {\n if (radix !in 2..36) {\n throw IllegalArgumentException(\"radix $radix was not in valid range 2..36\")\n }\n return radix\n}\n\ninternal actual fun digitOf(char: Char, radix: Int): Int = when {\n char >= '0' && char <= '9' -> char - '0'\n char >= 'A' && char <= 'Z' -> char - 'A' + 10\n char >= 'a' && char <= 'z' -> char - 'a' + 10\n char < '\\u0080' -> -1\n char >= '\\uFF21' && char <= '\\uFF3A' -> char - '\\uFF21' + 10 // full-width latin capital letter\n char >= '\\uFF41' && char <= '\\uFF5A' -> char - '\\uFF41' + 10 // full-width latin small letter\n else -> char.digitToIntImpl()\n}.let { if (it >= radix) -1 else it }\n","/*\n * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"CollectionsKt\")\n\npackage kotlin.collections\n\n//\n// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt\n// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib\n//\n\nimport kotlin.random.*\nimport kotlin.ranges.contains\nimport kotlin.ranges.reversed\n\n/**\n * Returns 1st *element* from the list.\n * \n * Throws an [IndexOutOfBoundsException] if the size of this list is less than 1.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun List.component1(): T {\n return get(0)\n}\n\n/**\n * Returns 2nd *element* from the list.\n * \n * Throws an [IndexOutOfBoundsException] if the size of this list is less than 2.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun List.component2(): T {\n return get(1)\n}\n\n/**\n * Returns 3rd *element* from the list.\n * \n * Throws an [IndexOutOfBoundsException] if the size of this list is less than 3.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun List.component3(): T {\n return get(2)\n}\n\n/**\n * Returns 4th *element* from the list.\n * \n * Throws an [IndexOutOfBoundsException] if the size of this list is less than 4.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun List.component4(): T {\n return get(3)\n}\n\n/**\n * Returns 5th *element* from the list.\n * \n * Throws an [IndexOutOfBoundsException] if the size of this list is less than 5.\n */\n@kotlin.internal.InlineOnly\npublic inline operator fun List.component5(): T {\n return get(4)\n}\n\n/**\n * Returns `true` if [element] is found in the collection.\n */\npublic operator fun <@kotlin.internal.OnlyInputTypes T> Iterable.contains(element: T): Boolean {\n if (this is Collection)\n return contains(element)\n return indexOf(element) >= 0\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this collection.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\npublic fun Iterable.elementAt(index: Int): T {\n if (this is List)\n return get(index)\n return elementAtOrElse(index) { throw IndexOutOfBoundsException(\"Collection doesn't contain element at index $index.\") }\n}\n\n/**\n * Returns an element at the given [index] or throws an [IndexOutOfBoundsException] if the [index] is out of bounds of this list.\n * \n * @sample samples.collections.Collections.Elements.elementAt\n */\n@kotlin.internal.InlineOnly\npublic inline fun List.elementAt(index: Int): T {\n return get(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this collection.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\npublic fun Iterable.elementAtOrElse(index: Int, defaultValue: (Int) -> T): T {\n if (this is List)\n return this.getOrElse(index, defaultValue)\n if (index < 0)\n return defaultValue(index)\n val iterator = iterator()\n var count = 0\n while (iterator.hasNext()) {\n val element = iterator.next()\n if (index == count++)\n return element\n }\n return defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this list.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrElse\n */\n@kotlin.internal.InlineOnly\npublic inline fun List.elementAtOrElse(index: Int, defaultValue: (Int) -> T): T {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this collection.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\npublic fun Iterable.elementAtOrNull(index: Int): T? {\n if (this is List)\n return this.getOrNull(index)\n if (index < 0)\n return null\n val iterator = iterator()\n var count = 0\n while (iterator.hasNext()) {\n val element = iterator.next()\n if (index == count++)\n return element\n }\n return null\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this list.\n * \n * @sample samples.collections.Collections.Elements.elementAtOrNull\n */\n@kotlin.internal.InlineOnly\npublic inline fun List.elementAtOrNull(index: Int): T? {\n return this.getOrNull(index)\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.find(predicate: (T) -> Boolean): T? {\n return firstOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.findLast(predicate: (T) -> Boolean): T? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.find\n */\n@kotlin.internal.InlineOnly\npublic inline fun List.findLast(predicate: (T) -> Boolean): T? {\n return lastOrNull(predicate)\n}\n\n/**\n * Returns the first element.\n * \n * @throws NoSuchElementException if the collection is empty.\n */\npublic fun Iterable.first(): T {\n when (this) {\n is List -> return this.first()\n else -> {\n val iterator = iterator()\n if (!iterator.hasNext())\n throw NoSuchElementException(\"Collection is empty.\")\n return iterator.next()\n }\n }\n}\n\n/**\n * Returns the first element.\n * \n * @throws NoSuchElementException if the list is empty.\n */\npublic fun List.first(): T {\n if (isEmpty())\n throw NoSuchElementException(\"List is empty.\")\n return this[0]\n}\n\n/**\n * Returns the first element matching the given [predicate].\n * @throws [NoSuchElementException] if no such element is found.\n */\npublic inline fun Iterable.first(predicate: (T) -> Boolean): T {\n for (element in this) if (predicate(element)) return element\n throw NoSuchElementException(\"Collection contains no element matching the predicate.\")\n}\n\n/**\n * Returns the first non-null value produced by [transform] function being applied to elements of this collection in iteration order,\n * or throws [NoSuchElementException] if no non-null value was produced.\n * \n * @sample samples.collections.Collections.Transformations.firstNotNullOf\n */\n@SinceKotlin(\"1.5\")\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.firstNotNullOf(transform: (T) -> R?): R {\n return firstNotNullOfOrNull(transform) ?: throw NoSuchElementException(\"No element of the collection was transformed to a non-null value.\")\n}\n\n/**\n * Returns the first non-null value produced by [transform] function being applied to elements of this collection in iteration order,\n * or `null` if no non-null value was produced.\n * \n * @sample samples.collections.Collections.Transformations.firstNotNullOf\n */\n@SinceKotlin(\"1.5\")\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.firstNotNullOfOrNull(transform: (T) -> R?): R? {\n for (element in this) {\n val result = transform(element)\n if (result != null) {\n return result\n }\n }\n return null\n}\n\n/**\n * Returns the first element, or `null` if the collection is empty.\n */\npublic fun Iterable.firstOrNull(): T? {\n when (this) {\n is List -> {\n if (isEmpty())\n return null\n else\n return this[0]\n }\n else -> {\n val iterator = iterator()\n if (!iterator.hasNext())\n return null\n return iterator.next()\n }\n }\n}\n\n/**\n * Returns the first element, or `null` if the list is empty.\n */\npublic fun List.firstOrNull(): T? {\n return if (isEmpty()) null else this[0]\n}\n\n/**\n * Returns the first element matching the given [predicate], or `null` if element was not found.\n */\npublic inline fun Iterable.firstOrNull(predicate: (T) -> Boolean): T? {\n for (element in this) if (predicate(element)) return element\n return null\n}\n\n/**\n * Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this list.\n */\n@kotlin.internal.InlineOnly\npublic inline fun List.getOrElse(index: Int, defaultValue: (Int) -> T): T {\n return if (index >= 0 && index <= lastIndex) get(index) else defaultValue(index)\n}\n\n/**\n * Returns an element at the given [index] or `null` if the [index] is out of bounds of this list.\n * \n * @sample samples.collections.Collections.Elements.getOrNull\n */\npublic fun List.getOrNull(index: Int): T? {\n return if (index >= 0 && index <= lastIndex) get(index) else null\n}\n\n/**\n * Returns first index of [element], or -1 if the collection does not contain element.\n */\npublic fun <@kotlin.internal.OnlyInputTypes T> Iterable.indexOf(element: T): Int {\n if (this is List) return this.indexOf(element)\n var index = 0\n for (item in this) {\n checkIndexOverflow(index)\n if (element == item)\n return index\n index++\n }\n return -1\n}\n\n/**\n * Returns first index of [element], or -1 if the list does not contain element.\n */\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\") // false warning, extension takes precedence in some cases\npublic fun <@kotlin.internal.OnlyInputTypes T> List.indexOf(element: T): Int {\n return indexOf(element)\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the collection does not contain such element.\n */\npublic inline fun Iterable.indexOfFirst(predicate: (T) -> Boolean): Int {\n var index = 0\n for (item in this) {\n checkIndexOverflow(index)\n if (predicate(item))\n return index\n index++\n }\n return -1\n}\n\n/**\n * Returns index of the first element matching the given [predicate], or -1 if the list does not contain such element.\n */\npublic inline fun List.indexOfFirst(predicate: (T) -> Boolean): Int {\n var index = 0\n for (item in this) {\n if (predicate(item))\n return index\n index++\n }\n return -1\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the collection does not contain such element.\n */\npublic inline fun Iterable.indexOfLast(predicate: (T) -> Boolean): Int {\n var lastIndex = -1\n var index = 0\n for (item in this) {\n checkIndexOverflow(index)\n if (predicate(item))\n lastIndex = index\n index++\n }\n return lastIndex\n}\n\n/**\n * Returns index of the last element matching the given [predicate], or -1 if the list does not contain such element.\n */\npublic inline fun List.indexOfLast(predicate: (T) -> Boolean): Int {\n val iterator = this.listIterator(size)\n while (iterator.hasPrevious()) {\n if (predicate(iterator.previous())) {\n return iterator.nextIndex()\n }\n }\n return -1\n}\n\n/**\n * Returns the last element.\n * \n * @throws NoSuchElementException if the collection is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun Iterable.last(): T {\n when (this) {\n is List -> return this.last()\n else -> {\n val iterator = iterator()\n if (!iterator.hasNext())\n throw NoSuchElementException(\"Collection is empty.\")\n var last = iterator.next()\n while (iterator.hasNext())\n last = iterator.next()\n return last\n }\n }\n}\n\n/**\n * Returns the last element.\n * \n * @throws NoSuchElementException if the list is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun List.last(): T {\n if (isEmpty())\n throw NoSuchElementException(\"List is empty.\")\n return this[lastIndex]\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * \n * @throws NoSuchElementException if no such element is found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun Iterable.last(predicate: (T) -> Boolean): T {\n var last: T? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n last = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Collection contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return last as T\n}\n\n/**\n * Returns the last element matching the given [predicate].\n * \n * @throws NoSuchElementException if no such element is found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun List.last(predicate: (T) -> Boolean): T {\n val iterator = this.listIterator(size)\n while (iterator.hasPrevious()) {\n val element = iterator.previous()\n if (predicate(element)) return element\n }\n throw NoSuchElementException(\"List contains no element matching the predicate.\")\n}\n\n/**\n * Returns last index of [element], or -1 if the collection does not contain element.\n */\npublic fun <@kotlin.internal.OnlyInputTypes T> Iterable.lastIndexOf(element: T): Int {\n if (this is List) return this.lastIndexOf(element)\n var lastIndex = -1\n var index = 0\n for (item in this) {\n checkIndexOverflow(index)\n if (element == item)\n lastIndex = index\n index++\n }\n return lastIndex\n}\n\n/**\n * Returns last index of [element], or -1 if the list does not contain element.\n */\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\") // false warning, extension takes precedence in some cases\npublic fun <@kotlin.internal.OnlyInputTypes T> List.lastIndexOf(element: T): Int {\n return lastIndexOf(element)\n}\n\n/**\n * Returns the last element, or `null` if the collection is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun Iterable.lastOrNull(): T? {\n when (this) {\n is List -> return if (isEmpty()) null else this[size - 1]\n else -> {\n val iterator = iterator()\n if (!iterator.hasNext())\n return null\n var last = iterator.next()\n while (iterator.hasNext())\n last = iterator.next()\n return last\n }\n }\n}\n\n/**\n * Returns the last element, or `null` if the list is empty.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic fun List.lastOrNull(): T? {\n return if (isEmpty()) null else this[size - 1]\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun Iterable.lastOrNull(predicate: (T) -> Boolean): T? {\n var last: T? = null\n for (element in this) {\n if (predicate(element)) {\n last = element\n }\n }\n return last\n}\n\n/**\n * Returns the last element matching the given [predicate], or `null` if no such element was found.\n * \n * @sample samples.collections.Collections.Elements.last\n */\npublic inline fun List.lastOrNull(predicate: (T) -> Boolean): T? {\n val iterator = this.listIterator(size)\n while (iterator.hasPrevious()) {\n val element = iterator.previous()\n if (predicate(element)) return element\n }\n return null\n}\n\n/**\n * Returns a random element from this collection.\n * \n * @throws NoSuchElementException if this collection is empty.\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun Collection.random(): T {\n return random(Random)\n}\n\n/**\n * Returns a random element from this collection using the specified source of randomness.\n * \n * @throws NoSuchElementException if this collection is empty.\n */\n@SinceKotlin(\"1.3\")\npublic fun Collection.random(random: Random): T {\n if (isEmpty())\n throw NoSuchElementException(\"Collection is empty.\")\n return elementAt(random.nextInt(size))\n}\n\n/**\n * Returns a random element from this collection, or `null` if this collection is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\npublic inline fun Collection.randomOrNull(): T? {\n return randomOrNull(Random)\n}\n\n/**\n * Returns a random element from this collection using the specified source of randomness, or `null` if this collection is empty.\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic fun Collection.randomOrNull(random: Random): T? {\n if (isEmpty())\n return null\n return elementAt(random.nextInt(size))\n}\n\n/**\n * Returns the single element, or throws an exception if the collection is empty or has more than one element.\n */\npublic fun Iterable.single(): T {\n when (this) {\n is List -> return this.single()\n else -> {\n val iterator = iterator()\n if (!iterator.hasNext())\n throw NoSuchElementException(\"Collection is empty.\")\n val single = iterator.next()\n if (iterator.hasNext())\n throw IllegalArgumentException(\"Collection has more than one element.\")\n return single\n }\n }\n}\n\n/**\n * Returns the single element, or throws an exception if the list is empty or has more than one element.\n */\npublic fun List.single(): T {\n return when (size) {\n 0 -> throw NoSuchElementException(\"List is empty.\")\n 1 -> this[0]\n else -> throw IllegalArgumentException(\"List has more than one element.\")\n }\n}\n\n/**\n * Returns the single element matching the given [predicate], or throws exception if there is no or more than one matching element.\n */\npublic inline fun Iterable.single(predicate: (T) -> Boolean): T {\n var single: T? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) throw IllegalArgumentException(\"Collection contains more than one matching element.\")\n single = element\n found = true\n }\n }\n if (!found) throw NoSuchElementException(\"Collection contains no element matching the predicate.\")\n @Suppress(\"UNCHECKED_CAST\")\n return single as T\n}\n\n/**\n * Returns single element, or `null` if the collection is empty or has more than one element.\n */\npublic fun Iterable.singleOrNull(): T? {\n when (this) {\n is List -> return if (size == 1) this[0] else null\n else -> {\n val iterator = iterator()\n if (!iterator.hasNext())\n return null\n val single = iterator.next()\n if (iterator.hasNext())\n return null\n return single\n }\n }\n}\n\n/**\n * Returns single element, or `null` if the list is empty or has more than one element.\n */\npublic fun List.singleOrNull(): T? {\n return if (size == 1) this[0] else null\n}\n\n/**\n * Returns the single element matching the given [predicate], or `null` if element was not found or more than one element was found.\n */\npublic inline fun Iterable.singleOrNull(predicate: (T) -> Boolean): T? {\n var single: T? = null\n var found = false\n for (element in this) {\n if (predicate(element)) {\n if (found) return null\n single = element\n found = true\n }\n }\n if (!found) return null\n return single\n}\n\n/**\n * Returns a list containing all elements except first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun Iterable.drop(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return toList()\n val list: ArrayList\n if (this is Collection<*>) {\n val resultSize = size - n\n if (resultSize <= 0)\n return emptyList()\n if (resultSize == 1)\n return listOf(last())\n list = ArrayList(resultSize)\n if (this is List) {\n if (this is RandomAccess) {\n for (index in n until size)\n list.add(this[index])\n } else {\n for (item in listIterator(n))\n list.add(item)\n }\n return list\n }\n }\n else {\n list = ArrayList()\n }\n var count = 0\n for (item in this) {\n if (count >= n) list.add(item) else ++count\n }\n return list.optimizeReadOnlyList()\n}\n\n/**\n * Returns a list containing all elements except last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic fun List.dropLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n return take((size - n).coerceAtLeast(0))\n}\n\n/**\n * Returns a list containing all elements except last elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun List.dropLastWhile(predicate: (T) -> Boolean): List {\n if (!isEmpty()) {\n val iterator = listIterator(size)\n while (iterator.hasPrevious()) {\n if (!predicate(iterator.previous())) {\n return take(iterator.nextIndex() + 1)\n }\n }\n }\n return emptyList()\n}\n\n/**\n * Returns a list containing all elements except first elements that satisfy the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.drop\n */\npublic inline fun Iterable.dropWhile(predicate: (T) -> Boolean): List {\n var yielding = false\n val list = ArrayList()\n for (item in this)\n if (yielding)\n list.add(item)\n else if (!predicate(item)) {\n list.add(item)\n yielding = true\n }\n return list\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\npublic inline fun Iterable.filter(predicate: (T) -> Boolean): List {\n return filterTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing only elements matching the given [predicate].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexed\n */\npublic inline fun Iterable.filterIndexed(predicate: (index: Int, T) -> Boolean): List {\n return filterIndexedTo(ArrayList(), predicate)\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * @param [predicate] function that takes the index of an element and the element itself\n * and returns the result of predicate evaluation on the element.\n * \n * @sample samples.collections.Collections.Filtering.filterIndexedTo\n */\npublic inline fun > Iterable.filterIndexedTo(destination: C, predicate: (index: Int, T) -> Boolean): C {\n forEachIndexed { index, element ->\n if (predicate(index, element)) destination.add(element)\n }\n return destination\n}\n\n/**\n * Returns a list containing all elements that are instances of specified type parameter R.\n * \n * @sample samples.collections.Collections.Filtering.filterIsInstance\n */\npublic inline fun Iterable<*>.filterIsInstance(): List<@kotlin.internal.NoInfer R> {\n return filterIsInstanceTo(ArrayList())\n}\n\n/**\n * Appends all elements that are instances of specified type parameter R to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterIsInstanceTo\n */\npublic inline fun > Iterable<*>.filterIsInstanceTo(destination: C): C {\n for (element in this) if (element is R) destination.add(element)\n return destination\n}\n\n/**\n * Returns a list containing all elements not matching the given [predicate].\n * \n * @sample samples.collections.Collections.Filtering.filter\n */\npublic inline fun Iterable.filterNot(predicate: (T) -> Boolean): List {\n return filterNotTo(ArrayList(), predicate)\n}\n\n/**\n * Returns a list containing all elements that are not `null`.\n * \n * @sample samples.collections.Collections.Filtering.filterNotNull\n */\npublic fun Iterable.filterNotNull(): List {\n return filterNotNullTo(ArrayList())\n}\n\n/**\n * Appends all elements that are not `null` to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterNotNullTo\n */\npublic fun , T : Any> Iterable.filterNotNullTo(destination: C): C {\n for (element in this) if (element != null) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements not matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun > Iterable.filterNotTo(destination: C, predicate: (T) -> Boolean): C {\n for (element in this) if (!predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Appends all elements matching the given [predicate] to the given [destination].\n * \n * @sample samples.collections.Collections.Filtering.filterTo\n */\npublic inline fun > Iterable.filterTo(destination: C, predicate: (T) -> Boolean): C {\n for (element in this) if (predicate(element)) destination.add(element)\n return destination\n}\n\n/**\n * Returns a list containing elements at indices in the specified [indices] range.\n */\npublic fun List.slice(indices: IntRange): List {\n if (indices.isEmpty()) return listOf()\n return this.subList(indices.start, indices.endInclusive + 1).toList()\n}\n\n/**\n * Returns a list containing elements at specified [indices].\n */\npublic fun List.slice(indices: Iterable): List {\n val size = indices.collectionSizeOrDefault(10)\n if (size == 0) return emptyList()\n val list = ArrayList(size)\n for (index in indices) {\n list.add(get(index))\n }\n return list\n}\n\n/**\n * Returns a list containing first [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun Iterable.take(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n if (this is Collection) {\n if (n >= size) return toList()\n if (n == 1) return listOf(first())\n }\n var count = 0\n val list = ArrayList(n)\n for (item in this) {\n list.add(item)\n if (++count == n)\n break\n }\n return list.optimizeReadOnlyList()\n}\n\n/**\n * Returns a list containing last [n] elements.\n * \n * @throws IllegalArgumentException if [n] is negative.\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic fun List.takeLast(n: Int): List {\n require(n >= 0) { \"Requested element count $n is less than zero.\" }\n if (n == 0) return emptyList()\n val size = size\n if (n >= size) return toList()\n if (n == 1) return listOf(last())\n val list = ArrayList(n)\n if (this is RandomAccess) {\n for (index in size - n until size)\n list.add(this[index])\n } else {\n for (item in listIterator(size - n))\n list.add(item)\n }\n return list\n}\n\n/**\n * Returns a list containing last elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic inline fun List.takeLastWhile(predicate: (T) -> Boolean): List {\n if (isEmpty())\n return emptyList()\n val iterator = listIterator(size)\n while (iterator.hasPrevious()) {\n if (!predicate(iterator.previous())) {\n iterator.next()\n val expectedSize = size - iterator.nextIndex()\n if (expectedSize == 0) return emptyList()\n return ArrayList(expectedSize).apply {\n while (iterator.hasNext())\n add(iterator.next())\n }\n }\n }\n return toList()\n}\n\n/**\n * Returns a list containing first elements satisfying the given [predicate].\n * \n * @sample samples.collections.Collections.Transformations.take\n */\npublic inline fun Iterable.takeWhile(predicate: (T) -> Boolean): List {\n val list = ArrayList()\n for (item in this) {\n if (!predicate(item))\n break\n list.add(item)\n }\n return list\n}\n\n/**\n * Reverses elements in the list in-place.\n */\npublic expect fun MutableList.reverse(): Unit\n\n/**\n * Returns a list with elements in reversed order.\n */\npublic fun Iterable.reversed(): List {\n if (this is Collection && size <= 1) return toList()\n val list = toMutableList()\n list.reverse()\n return list\n}\n\n/**\n * Randomly shuffles elements in this list in-place using the specified [random] instance as the source of randomness.\n * \n * See: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm\n */\n@SinceKotlin(\"1.3\")\npublic fun MutableList.shuffle(random: Random): Unit {\n for (i in lastIndex downTo 1) {\n val j = random.nextInt(i + 1)\n this[j] = this.set(i, this[j])\n }\n}\n\n/**\n * Sorts elements in the list in-place according to natural sort order of the value returned by specified [selector] function.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic inline fun > MutableList.sortBy(crossinline selector: (T) -> R?): Unit {\n if (size > 1) sortWith(compareBy(selector))\n}\n\n/**\n * Sorts elements in the list in-place descending according to natural sort order of the value returned by specified [selector] function.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic inline fun > MutableList.sortByDescending(crossinline selector: (T) -> R?): Unit {\n if (size > 1) sortWith(compareByDescending(selector))\n}\n\n/**\n * Sorts elements in the list in-place descending according to their natural sort order.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic fun > MutableList.sortDescending(): Unit {\n sortWith(reverseOrder())\n}\n\n/**\n * Returns a list of all elements sorted according to their natural sort order.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic fun > Iterable.sorted(): List {\n if (this is Collection) {\n if (size <= 1) return this.toList()\n @Suppress(\"UNCHECKED_CAST\")\n return (toTypedArray>() as Array).apply { sort() }.asList()\n }\n return toMutableList().apply { sort() }\n}\n\n/**\n * Returns a list of all elements sorted according to natural sort order of the value returned by specified [selector] function.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n * \n * @sample samples.collections.Collections.Sorting.sortedBy\n */\npublic inline fun > Iterable.sortedBy(crossinline selector: (T) -> R?): List {\n return sortedWith(compareBy(selector))\n}\n\n/**\n * Returns a list of all elements sorted descending according to natural sort order of the value returned by specified [selector] function.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic inline fun > Iterable.sortedByDescending(crossinline selector: (T) -> R?): List {\n return sortedWith(compareByDescending(selector))\n}\n\n/**\n * Returns a list of all elements sorted descending according to their natural sort order.\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic fun > Iterable.sortedDescending(): List {\n return sortedWith(reverseOrder())\n}\n\n/**\n * Returns a list of all elements sorted according to the specified [comparator].\n * \n * The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.\n */\npublic fun Iterable.sortedWith(comparator: Comparator): List {\n if (this is Collection) {\n if (size <= 1) return this.toList()\n @Suppress(\"UNCHECKED_CAST\")\n return (toTypedArray() as Array).apply { sortWith(comparator) }.asList()\n }\n return toMutableList().apply { sortWith(comparator) }\n}\n\n/**\n * Returns an array of Boolean containing all of the elements of this collection.\n */\npublic fun Collection.toBooleanArray(): BooleanArray {\n val result = BooleanArray(size)\n var index = 0\n for (element in this)\n result[index++] = element\n return result\n}\n\n/**\n * Returns an array of Byte containing all of the elements of this collection.\n */\npublic fun Collection.toByteArray(): ByteArray {\n val result = ByteArray(size)\n var index = 0\n for (element in this)\n result[index++] = element\n return result\n}\n\n/**\n * Returns an array of Char containing all of the elements of this collection.\n */\npublic fun Collection.toCharArray(): CharArray {\n val result = CharArray(size)\n var index = 0\n for (element in this)\n result[index++] = element\n return result\n}\n\n/**\n * Returns an array of Double containing all of the elements of this collection.\n */\npublic fun Collection.toDoubleArray(): DoubleArray {\n val result = DoubleArray(size)\n var index = 0\n for (element in this)\n result[index++] = element\n return result\n}\n\n/**\n * Returns an array of Float containing all of the elements of this collection.\n */\npublic fun Collection.toFloatArray(): FloatArray {\n val result = FloatArray(size)\n var index = 0\n for (element in this)\n result[index++] = element\n return result\n}\n\n/**\n * Returns an array of Int containing all of the elements of this collection.\n */\npublic fun Collection.toIntArray(): IntArray {\n val result = IntArray(size)\n var index = 0\n for (element in this)\n result[index++] = element\n return result\n}\n\n/**\n * Returns an array of Long containing all of the elements of this collection.\n */\npublic fun Collection.toLongArray(): LongArray {\n val result = LongArray(size)\n var index = 0\n for (element in this)\n result[index++] = element\n return result\n}\n\n/**\n * Returns an array of Short containing all of the elements of this collection.\n */\npublic fun Collection.toShortArray(): ShortArray {\n val result = ShortArray(size)\n var index = 0\n for (element in this)\n result[index++] = element\n return result\n}\n\n/**\n * Returns a [Map] containing key-value pairs provided by [transform] function\n * applied to elements of the given collection.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original collection.\n * \n * @sample samples.collections.Collections.Transformations.associate\n */\npublic inline fun Iterable.associate(transform: (T) -> Pair): Map {\n val capacity = mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16)\n return associateTo(LinkedHashMap(capacity), transform)\n}\n\n/**\n * Returns a [Map] containing the elements from the given collection indexed by the key\n * returned from [keySelector] function applied to each element.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original collection.\n * \n * @sample samples.collections.Collections.Transformations.associateBy\n */\npublic inline fun Iterable.associateBy(keySelector: (T) -> K): Map {\n val capacity = mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector)\n}\n\n/**\n * Returns a [Map] containing the values provided by [valueTransform] and indexed by [keySelector] functions applied to elements of the given collection.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original collection.\n * \n * @sample samples.collections.Collections.Transformations.associateByWithValueTransform\n */\npublic inline fun Iterable.associateBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map {\n val capacity = mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16)\n return associateByTo(LinkedHashMap(capacity), keySelector, valueTransform)\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function applied to each element of the given collection\n * and value is the element itself.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * @sample samples.collections.Collections.Transformations.associateByTo\n */\npublic inline fun > Iterable.associateByTo(destination: M, keySelector: (T) -> K): M {\n for (element in this) {\n destination.put(keySelector(element), element)\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs,\n * where key is provided by the [keySelector] function and\n * and value is provided by the [valueTransform] function applied to elements of the given collection.\n * \n * If any two elements would have the same key returned by [keySelector] the last one gets added to the map.\n * \n * @sample samples.collections.Collections.Transformations.associateByToWithValueTransform\n */\npublic inline fun > Iterable.associateByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M {\n for (element in this) {\n destination.put(keySelector(element), valueTransform(element))\n }\n return destination\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs\n * provided by [transform] function applied to each element of the given collection.\n * \n * If any of two pairs would have the same key the last one gets added to the map.\n * \n * @sample samples.collections.Collections.Transformations.associateTo\n */\npublic inline fun > Iterable.associateTo(destination: M, transform: (T) -> Pair): M {\n for (element in this) {\n destination += transform(element)\n }\n return destination\n}\n\n/**\n * Returns a [Map] where keys are elements from the given collection and values are\n * produced by the [valueSelector] function applied to each element.\n * \n * If any two elements are equal, the last one gets added to the map.\n * \n * The returned map preserves the entry iteration order of the original collection.\n * \n * @sample samples.collections.Collections.Transformations.associateWith\n */\n@SinceKotlin(\"1.3\")\npublic inline fun Iterable.associateWith(valueSelector: (K) -> V): Map {\n val result = LinkedHashMap(mapCapacity(collectionSizeOrDefault(10)).coerceAtLeast(16))\n return associateWithTo(result, valueSelector)\n}\n\n/**\n * Populates and returns the [destination] mutable map with key-value pairs for each element of the given collection,\n * where key is the element itself and value is provided by the [valueSelector] function applied to that key.\n * \n * If any two elements are equal, the last one overwrites the former value in the map.\n * \n * @sample samples.collections.Collections.Transformations.associateWithTo\n */\n@SinceKotlin(\"1.3\")\npublic inline fun > Iterable.associateWithTo(destination: M, valueSelector: (K) -> V): M {\n for (element in this) {\n destination.put(element, valueSelector(element))\n }\n return destination\n}\n\n/**\n * Appends all elements to the given [destination] collection.\n */\npublic fun > Iterable.toCollection(destination: C): C {\n for (item in this) {\n destination.add(item)\n }\n return destination\n}\n\n/**\n * Returns a new [HashSet] of all elements.\n */\npublic fun Iterable.toHashSet(): HashSet {\n return toCollection(HashSet(mapCapacity(collectionSizeOrDefault(12))))\n}\n\n/**\n * Returns a [List] containing all elements.\n */\npublic fun Iterable.toList(): List {\n if (this is Collection) {\n return when (size) {\n 0 -> emptyList()\n 1 -> listOf(if (this is List) get(0) else iterator().next())\n else -> this.toMutableList()\n }\n }\n return this.toMutableList().optimizeReadOnlyList()\n}\n\n/**\n * Returns a new [MutableList] filled with all elements of this collection.\n */\npublic fun Iterable.toMutableList(): MutableList {\n if (this is Collection)\n return this.toMutableList()\n return toCollection(ArrayList())\n}\n\n/**\n * Returns a new [MutableList] filled with all elements of this collection.\n */\npublic fun Collection.toMutableList(): MutableList {\n return ArrayList(this)\n}\n\n/**\n * Returns a [Set] of all elements.\n * \n * The returned set preserves the element iteration order of the original collection.\n */\npublic fun Iterable.toSet(): Set {\n if (this is Collection) {\n return when (size) {\n 0 -> emptySet()\n 1 -> setOf(if (this is List) this[0] else iterator().next())\n else -> toCollection(LinkedHashSet(mapCapacity(size)))\n }\n }\n return toCollection(LinkedHashSet()).optimizeReadOnlySet()\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection.\n * \n * @sample samples.collections.Collections.Transformations.flatMap\n */\npublic inline fun Iterable.flatMap(transform: (T) -> Iterable): List {\n return flatMapTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element of original collection.\n * \n * @sample samples.collections.Collections.Transformations.flatMap\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapSequence\")\npublic inline fun Iterable.flatMap(transform: (T) -> Sequence): List {\n return flatMapTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original collection.\n * \n * @sample samples.collections.Collections.Transformations.flatMapIndexed\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterable\")\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.flatMapIndexed(transform: (index: Int, T) -> Iterable): List {\n return flatMapIndexedTo(ArrayList(), transform)\n}\n\n/**\n * Returns a single list of all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original collection.\n * \n * @sample samples.collections.Collections.Transformations.flatMapIndexed\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedSequence\")\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.flatMapIndexed(transform: (index: Int, T) -> Sequence): List {\n return flatMapIndexedTo(ArrayList(), transform)\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original collection, to the given [destination].\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedIterableTo\")\n@kotlin.internal.InlineOnly\npublic inline fun > Iterable.flatMapIndexedTo(destination: C, transform: (index: Int, T) -> Iterable): C {\n var index = 0\n for (element in this) {\n val list = transform(checkIndexOverflow(index++), element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element\n * and its index in the original collection, to the given [destination].\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapIndexedSequenceTo\")\n@kotlin.internal.InlineOnly\npublic inline fun > Iterable.flatMapIndexedTo(destination: C, transform: (index: Int, T) -> Sequence): C {\n var index = 0\n for (element in this) {\n val list = transform(checkIndexOverflow(index++), element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination].\n */\npublic inline fun > Iterable.flatMapTo(destination: C, transform: (T) -> Iterable): C {\n for (element in this) {\n val list = transform(element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Appends all elements yielded from results of [transform] function being invoked on each element of original collection, to the given [destination].\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"flatMapSequenceTo\")\npublic inline fun > Iterable.flatMapTo(destination: C, transform: (T) -> Sequence): C {\n for (element in this) {\n val list = transform(element)\n destination.addAll(list)\n }\n return destination\n}\n\n/**\n * Groups elements of the original collection by the key returned by the given [keySelector] function\n * applied to each element and returns a map where each group key is associated with a list of corresponding elements.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original collection.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun Iterable.groupBy(keySelector: (T) -> K): Map> {\n return groupByTo(LinkedHashMap>(), keySelector)\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original collection\n * by the key returned by the given [keySelector] function applied to the element\n * and returns a map where each group key is associated with a list of corresponding values.\n * \n * The returned map preserves the entry iteration order of the keys produced from the original collection.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun Iterable.groupBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map> {\n return groupByTo(LinkedHashMap>(), keySelector, valueTransform)\n}\n\n/**\n * Groups elements of the original collection by the key returned by the given [keySelector] function\n * applied to each element and puts to the [destination] map each group key associated with a list of corresponding elements.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupBy\n */\npublic inline fun >> Iterable.groupByTo(destination: M, keySelector: (T) -> K): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(element)\n }\n return destination\n}\n\n/**\n * Groups values returned by the [valueTransform] function applied to each element of the original collection\n * by the key returned by the given [keySelector] function applied to the element\n * and puts to the [destination] map each group key associated with a list of corresponding values.\n * \n * @return The [destination] map.\n * \n * @sample samples.collections.Collections.Transformations.groupByKeysAndValues\n */\npublic inline fun >> Iterable.groupByTo(destination: M, keySelector: (T) -> K, valueTransform: (T) -> V): M {\n for (element in this) {\n val key = keySelector(element)\n val list = destination.getOrPut(key) { ArrayList() }\n list.add(valueTransform(element))\n }\n return destination\n}\n\n/**\n * Creates a [Grouping] source from a collection to be used later with one of group-and-fold operations\n * using the specified [keySelector] function to extract a key from each element.\n * \n * @sample samples.collections.Grouping.groupingByEachCount\n */\n@SinceKotlin(\"1.1\")\npublic inline fun Iterable.groupingBy(crossinline keySelector: (T) -> K): Grouping {\n return object : Grouping {\n override fun sourceIterator(): Iterator = this@groupingBy.iterator()\n override fun keyOf(element: T): K = keySelector(element)\n }\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element in the original collection.\n * \n * @sample samples.collections.Collections.Transformations.map\n */\npublic inline fun Iterable.map(transform: (T) -> R): List {\n return mapTo(ArrayList(collectionSizeOrDefault(10)), transform)\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to each element and its index in the original collection.\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun Iterable.mapIndexed(transform: (index: Int, T) -> R): List {\n return mapIndexedTo(ArrayList(collectionSizeOrDefault(10)), transform)\n}\n\n/**\n * Returns a list containing only the non-null results of applying the given [transform] function\n * to each element and its index in the original collection.\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun Iterable.mapIndexedNotNull(transform: (index: Int, T) -> R?): List {\n return mapIndexedNotNullTo(ArrayList(), transform)\n}\n\n/**\n * Applies the given [transform] function to each element and its index in the original collection\n * and appends only the non-null results to the given [destination].\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun > Iterable.mapIndexedNotNullTo(destination: C, transform: (index: Int, T) -> R?): C {\n forEachIndexed { index, element -> transform(index, element)?.let { destination.add(it) } }\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element and its index in the original collection\n * and appends the results to the given [destination].\n * @param [transform] function that takes the index of an element and the element itself\n * and returns the result of the transform applied to the element.\n */\npublic inline fun > Iterable.mapIndexedTo(destination: C, transform: (index: Int, T) -> R): C {\n var index = 0\n for (item in this)\n destination.add(transform(checkIndexOverflow(index++), item))\n return destination\n}\n\n/**\n * Returns a list containing only the non-null results of applying the given [transform] function\n * to each element in the original collection.\n * \n * @sample samples.collections.Collections.Transformations.mapNotNull\n */\npublic inline fun Iterable.mapNotNull(transform: (T) -> R?): List {\n return mapNotNullTo(ArrayList(), transform)\n}\n\n/**\n * Applies the given [transform] function to each element in the original collection\n * and appends only the non-null results to the given [destination].\n */\npublic inline fun > Iterable.mapNotNullTo(destination: C, transform: (T) -> R?): C {\n forEach { element -> transform(element)?.let { destination.add(it) } }\n return destination\n}\n\n/**\n * Applies the given [transform] function to each element of the original collection\n * and appends the results to the given [destination].\n */\npublic inline fun > Iterable.mapTo(destination: C, transform: (T) -> R): C {\n for (item in this)\n destination.add(transform(item))\n return destination\n}\n\n/**\n * Returns a lazy [Iterable] that wraps each element of the original collection\n * into an [IndexedValue] containing the index of that element and the element itself.\n */\npublic fun Iterable.withIndex(): Iterable> {\n return IndexingIterable { iterator() }\n}\n\n/**\n * Returns a list containing only distinct elements from the given collection.\n * \n * Among equal elements of the given collection, only the first one will be present in the resulting list.\n * The elements in the resulting list are in the same order as they were in the source collection.\n * \n * @sample samples.collections.Collections.Transformations.distinctAndDistinctBy\n */\npublic fun Iterable.distinct(): List {\n return this.toMutableSet().toList()\n}\n\n/**\n * Returns a list containing only elements from the given collection\n * having distinct keys returned by the given [selector] function.\n * \n * Among elements of the given collection with equal keys, only the first one will be present in the resulting list.\n * The elements in the resulting list are in the same order as they were in the source collection.\n * \n * @sample samples.collections.Collections.Transformations.distinctAndDistinctBy\n */\npublic inline fun Iterable.distinctBy(selector: (T) -> K): List {\n val set = HashSet()\n val list = ArrayList()\n for (e in this) {\n val key = selector(e)\n if (set.add(key))\n list.add(e)\n }\n return list\n}\n\n/**\n * Returns a set containing all elements that are contained by both this collection and the specified collection.\n * \n * The returned set preserves the element iteration order of the original collection.\n * \n * To get a set containing all elements that are contained at least in one of these collections use [union].\n */\npublic infix fun Iterable.intersect(other: Iterable): Set {\n val set = this.toMutableSet()\n set.retainAll(other)\n return set\n}\n\n/**\n * Returns a set containing all elements that are contained by this collection and not contained by the specified collection.\n * \n * The returned set preserves the element iteration order of the original collection.\n */\npublic infix fun Iterable.subtract(other: Iterable): Set {\n val set = this.toMutableSet()\n set.removeAll(other)\n return set\n}\n\n/**\n * Returns a new [MutableSet] containing all distinct elements from the given collection.\n * \n * The returned set preserves the element iteration order of the original collection.\n */\npublic fun Iterable.toMutableSet(): MutableSet {\n return when (this) {\n is Collection -> LinkedHashSet(this)\n else -> toCollection(LinkedHashSet())\n }\n}\n\n/**\n * Returns a set containing all distinct elements from both collections.\n * \n * The returned set preserves the element iteration order of the original collection.\n * Those elements of the [other] collection that are unique are iterated in the end\n * in the order of the [other] collection.\n * \n * To get a set containing all elements that are contained in both collections use [intersect].\n */\npublic infix fun Iterable.union(other: Iterable): Set {\n val set = this.toMutableSet()\n set.addAll(other)\n return set\n}\n\n/**\n * Returns `true` if all elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.all\n */\npublic inline fun Iterable.all(predicate: (T) -> Boolean): Boolean {\n if (this is Collection && isEmpty()) return true\n for (element in this) if (!predicate(element)) return false\n return true\n}\n\n/**\n * Returns `true` if collection has at least one element.\n * \n * @sample samples.collections.Collections.Aggregates.any\n */\npublic fun Iterable.any(): Boolean {\n if (this is Collection) return !isEmpty()\n return iterator().hasNext()\n}\n\n/**\n * Returns `true` if at least one element matches the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.anyWithPredicate\n */\npublic inline fun Iterable.any(predicate: (T) -> Boolean): Boolean {\n if (this is Collection && isEmpty()) return false\n for (element in this) if (predicate(element)) return true\n return false\n}\n\n/**\n * Returns the number of elements in this collection.\n */\npublic fun Iterable.count(): Int {\n if (this is Collection) return size\n var count = 0\n for (element in this) checkCountOverflow(++count)\n return count\n}\n\n/**\n * Returns the number of elements in this collection.\n */\n@kotlin.internal.InlineOnly\npublic inline fun Collection.count(): Int {\n return size\n}\n\n/**\n * Returns the number of elements matching the given [predicate].\n */\npublic inline fun Iterable.count(predicate: (T) -> Boolean): Int {\n if (this is Collection && isEmpty()) return 0\n var count = 0\n for (element in this) if (predicate(element)) checkCountOverflow(++count)\n return count\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns the specified [initial] value if the collection is empty.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n */\npublic inline fun Iterable.fold(initial: R, operation: (acc: R, T) -> R): R {\n var accumulator = initial\n for (element in this) accumulator = operation(accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original collection.\n * \n * Returns the specified [initial] value if the collection is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n */\npublic inline fun Iterable.foldIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): R {\n var index = 0\n var accumulator = initial\n for (element in this) accumulator = operation(checkIndexOverflow(index++), accumulator, element)\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns the specified [initial] value if the list is empty.\n * \n * @param [operation] function that takes an element and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun List.foldRight(initial: R, operation: (T, acc: R) -> R): R {\n var accumulator = initial\n if (!isEmpty()) {\n val iterator = listIterator(size)\n while (iterator.hasPrevious()) {\n accumulator = operation(iterator.previous(), accumulator)\n }\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with [initial] value and applying [operation] from right to left\n * to each element with its index in the original list and current accumulator value.\n * \n * Returns the specified [initial] value if the list is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself\n * and current accumulator value, and calculates the next accumulator value.\n */\npublic inline fun List.foldRightIndexed(initial: R, operation: (index: Int, T, acc: R) -> R): R {\n var accumulator = initial\n if (!isEmpty()) {\n val iterator = listIterator(size)\n while (iterator.hasPrevious()) {\n val index = iterator.previousIndex()\n accumulator = operation(index, iterator.previous(), accumulator)\n }\n }\n return accumulator\n}\n\n/**\n * Performs the given [action] on each element.\n */\n@kotlin.internal.HidesMembers\npublic inline fun Iterable.forEach(action: (T) -> Unit): Unit {\n for (element in this) action(element)\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\npublic inline fun Iterable.forEachIndexed(action: (index: Int, T) -> Unit): Unit {\n var index = 0\n for (item in this) action(checkIndexOverflow(index++), item)\n}\n\n/**\n * Returns the largest element.\n * \n * If any of elements is `NaN` returns `NaN`.\n * \n * @throws NoSuchElementException if the collection is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"maxOrThrow\")\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun Iterable.max(): Double {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var max = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n max = maxOf(max, e)\n }\n return max\n}\n\n/**\n * Returns the largest element.\n * \n * If any of elements is `NaN` returns `NaN`.\n * \n * @throws NoSuchElementException if the collection is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"maxOrThrow\")\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun Iterable.max(): Float {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var max = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n max = maxOf(max, e)\n }\n return max\n}\n\n/**\n * Returns the largest element.\n * \n * @throws NoSuchElementException if the collection is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"maxOrThrow\")\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun > Iterable.max(): T {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var max = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n if (max < e) max = e\n }\n return max\n}\n\n/**\n * Returns the first element yielding the largest value of the given function.\n * \n * @throws NoSuchElementException if the collection is empty.\n * \n * @sample samples.collections.Collections.Aggregates.maxBy\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"maxByOrThrow\")\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic inline fun > Iterable.maxBy(selector: (T) -> R): T {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var maxElem = iterator.next()\n if (!iterator.hasNext()) return maxElem\n var maxValue = selector(maxElem)\n do {\n val e = iterator.next()\n val v = selector(e)\n if (maxValue < v) {\n maxElem = e\n maxValue = v\n }\n } while (iterator.hasNext())\n return maxElem\n}\n\n/**\n * Returns the first element yielding the largest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.maxByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > Iterable.maxByOrNull(selector: (T) -> R): T? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var maxElem = iterator.next()\n if (!iterator.hasNext()) return maxElem\n var maxValue = selector(maxElem)\n do {\n val e = iterator.next()\n val v = selector(e)\n if (maxValue < v) {\n maxElem = e\n maxValue = v\n }\n } while (iterator.hasNext())\n return maxElem\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the collection.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the collection is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.maxOf(selector: (T) -> Double): Double {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var maxValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the collection.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the collection is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.maxOf(selector: (T) -> Float): Float {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var maxValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the collection.\n * \n * @throws NoSuchElementException if the collection is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > Iterable.maxOf(selector: (T) -> R): R {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var maxValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the collection or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.maxOfOrNull(selector: (T) -> Double): Double? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var maxValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the collection or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.maxOfOrNull(selector: (T) -> Float): Float? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var maxValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n maxValue = maxOf(maxValue, v)\n }\n return maxValue\n}\n\n/**\n * Returns the largest value among all values produced by [selector] function\n * applied to each element in the collection or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > Iterable.maxOfOrNull(selector: (T) -> R): R? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var maxValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n if (maxValue < v) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the collection.\n * \n * @throws NoSuchElementException if the collection is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.maxOfWith(comparator: Comparator, selector: (T) -> R): R {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var maxValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the collection or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.maxOfWithOrNull(comparator: Comparator, selector: (T) -> R): R? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var maxValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n if (comparator.compare(maxValue, v) < 0) {\n maxValue = v\n }\n }\n return maxValue\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n * \n * If any of elements is `NaN` returns `NaN`.\n */\n@SinceKotlin(\"1.4\")\npublic fun Iterable.maxOrNull(): Double? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var max = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n max = maxOf(max, e)\n }\n return max\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n * \n * If any of elements is `NaN` returns `NaN`.\n */\n@SinceKotlin(\"1.4\")\npublic fun Iterable.maxOrNull(): Float? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var max = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n max = maxOf(max, e)\n }\n return max\n}\n\n/**\n * Returns the largest element or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun > Iterable.maxOrNull(): T? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var max = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n if (max < e) max = e\n }\n return max\n}\n\n/**\n * Returns the first element having the largest value according to the provided [comparator].\n * \n * @throws NoSuchElementException if the collection is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"maxWithOrThrow\")\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun Iterable.maxWith(comparator: Comparator): T {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var max = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n if (comparator.compare(max, e) < 0) max = e\n }\n return max\n}\n\n/**\n * Returns the first element having the largest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun Iterable.maxWithOrNull(comparator: Comparator): T? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var max = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n if (comparator.compare(max, e) < 0) max = e\n }\n return max\n}\n\n/**\n * Returns the smallest element.\n * \n * If any of elements is `NaN` returns `NaN`.\n * \n * @throws NoSuchElementException if the collection is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"minOrThrow\")\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun Iterable.min(): Double {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var min = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n min = minOf(min, e)\n }\n return min\n}\n\n/**\n * Returns the smallest element.\n * \n * If any of elements is `NaN` returns `NaN`.\n * \n * @throws NoSuchElementException if the collection is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"minOrThrow\")\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun Iterable.min(): Float {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var min = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n min = minOf(min, e)\n }\n return min\n}\n\n/**\n * Returns the smallest element.\n * \n * @throws NoSuchElementException if the collection is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"minOrThrow\")\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun > Iterable.min(): T {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var min = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n if (min > e) min = e\n }\n return min\n}\n\n/**\n * Returns the first element yielding the smallest value of the given function.\n * \n * @throws NoSuchElementException if the collection is empty.\n * \n * @sample samples.collections.Collections.Aggregates.minBy\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"minByOrThrow\")\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic inline fun > Iterable.minBy(selector: (T) -> R): T {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var minElem = iterator.next()\n if (!iterator.hasNext()) return minElem\n var minValue = selector(minElem)\n do {\n val e = iterator.next()\n val v = selector(e)\n if (minValue > v) {\n minElem = e\n minValue = v\n }\n } while (iterator.hasNext())\n return minElem\n}\n\n/**\n * Returns the first element yielding the smallest value of the given function or `null` if there are no elements.\n * \n * @sample samples.collections.Collections.Aggregates.minByOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > Iterable.minByOrNull(selector: (T) -> R): T? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var minElem = iterator.next()\n if (!iterator.hasNext()) return minElem\n var minValue = selector(minElem)\n do {\n val e = iterator.next()\n val v = selector(e)\n if (minValue > v) {\n minElem = e\n minValue = v\n }\n } while (iterator.hasNext())\n return minElem\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the collection.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the collection is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.minOf(selector: (T) -> Double): Double {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var minValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the collection.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n * \n * @throws NoSuchElementException if the collection is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.minOf(selector: (T) -> Float): Float {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var minValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the collection.\n * \n * @throws NoSuchElementException if the collection is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > Iterable.minOf(selector: (T) -> R): R {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var minValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the collection or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.minOfOrNull(selector: (T) -> Double): Double? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var minValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the collection or `null` if there are no elements.\n * \n * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.minOfOrNull(selector: (T) -> Float): Float? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var minValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n minValue = minOf(minValue, v)\n }\n return minValue\n}\n\n/**\n * Returns the smallest value among all values produced by [selector] function\n * applied to each element in the collection or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun > Iterable.minOfOrNull(selector: (T) -> R): R? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var minValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n if (minValue > v) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the collection.\n * \n * @throws NoSuchElementException if the collection is empty.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.minOfWith(comparator: Comparator, selector: (T) -> R): R {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var minValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest value according to the provided [comparator]\n * among all values produced by [selector] function applied to each element in the collection or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.minOfWithOrNull(comparator: Comparator, selector: (T) -> R): R? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var minValue = selector(iterator.next())\n while (iterator.hasNext()) {\n val v = selector(iterator.next())\n if (comparator.compare(minValue, v) > 0) {\n minValue = v\n }\n }\n return minValue\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n * \n * If any of elements is `NaN` returns `NaN`.\n */\n@SinceKotlin(\"1.4\")\npublic fun Iterable.minOrNull(): Double? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var min = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n min = minOf(min, e)\n }\n return min\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n * \n * If any of elements is `NaN` returns `NaN`.\n */\n@SinceKotlin(\"1.4\")\npublic fun Iterable.minOrNull(): Float? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var min = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n min = minOf(min, e)\n }\n return min\n}\n\n/**\n * Returns the smallest element or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun > Iterable.minOrNull(): T? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var min = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n if (min > e) min = e\n }\n return min\n}\n\n/**\n * Returns the first element having the smallest value according to the provided [comparator].\n * \n * @throws NoSuchElementException if the collection is empty.\n */\n@SinceKotlin(\"1.7\")\n@kotlin.jvm.JvmName(\"minWithOrThrow\")\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun Iterable.minWith(comparator: Comparator): T {\n val iterator = iterator()\n if (!iterator.hasNext()) throw NoSuchElementException()\n var min = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n if (comparator.compare(min, e) > 0) min = e\n }\n return min\n}\n\n/**\n * Returns the first element having the smallest value according to the provided [comparator] or `null` if there are no elements.\n */\n@SinceKotlin(\"1.4\")\npublic fun Iterable.minWithOrNull(comparator: Comparator): T? {\n val iterator = iterator()\n if (!iterator.hasNext()) return null\n var min = iterator.next()\n while (iterator.hasNext()) {\n val e = iterator.next()\n if (comparator.compare(min, e) > 0) min = e\n }\n return min\n}\n\n/**\n * Returns `true` if the collection has no elements.\n * \n * @sample samples.collections.Collections.Aggregates.none\n */\npublic fun Iterable.none(): Boolean {\n if (this is Collection) return isEmpty()\n return !iterator().hasNext()\n}\n\n/**\n * Returns `true` if no elements match the given [predicate].\n * \n * @sample samples.collections.Collections.Aggregates.noneWithPredicate\n */\npublic inline fun Iterable.none(predicate: (T) -> Boolean): Boolean {\n if (this is Collection && isEmpty()) return true\n for (element in this) if (predicate(element)) return false\n return true\n}\n\n/**\n * Performs the given [action] on each element and returns the collection itself afterwards.\n */\n@SinceKotlin(\"1.1\")\npublic inline fun > C.onEach(action: (T) -> Unit): C {\n return apply { for (element in this) action(element) }\n}\n\n/**\n * Performs the given [action] on each element, providing sequential index with the element,\n * and returns the collection itself afterwards.\n * @param [action] function that takes the index of an element and the element itself\n * and performs the action on the element.\n */\n@SinceKotlin(\"1.4\")\npublic inline fun > C.onEachIndexed(action: (index: Int, T) -> Unit): C {\n return apply { forEachIndexed(action) }\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Throws an exception if this collection is empty. If the collection can be empty in an expected way,\n * please use [reduceOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun Iterable.reduce(operation: (acc: S, T) -> S): S {\n val iterator = this.iterator()\n if (!iterator.hasNext()) throw UnsupportedOperationException(\"Empty collection can't be reduced.\")\n var accumulator: S = iterator.next()\n while (iterator.hasNext()) {\n accumulator = operation(accumulator, iterator.next())\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original collection.\n * \n * Throws an exception if this collection is empty. If the collection can be empty in an expected way,\n * please use [reduceIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduce\n */\npublic inline fun Iterable.reduceIndexed(operation: (index: Int, acc: S, T) -> S): S {\n val iterator = this.iterator()\n if (!iterator.hasNext()) throw UnsupportedOperationException(\"Empty collection can't be reduced.\")\n var index = 1\n var accumulator: S = iterator.next()\n while (iterator.hasNext()) {\n accumulator = operation(checkIndexOverflow(index++), accumulator, iterator.next())\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element with its index in the original collection.\n * \n * Returns `null` if the collection is empty.\n * \n * @param [operation] function that takes the index of an element, current accumulator value and the element itself,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun Iterable.reduceIndexedOrNull(operation: (index: Int, acc: S, T) -> S): S? {\n val iterator = this.iterator()\n if (!iterator.hasNext()) return null\n var index = 1\n var accumulator: S = iterator.next()\n while (iterator.hasNext()) {\n accumulator = operation(checkIndexOverflow(index++), accumulator, iterator.next())\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the first element and applying [operation] from left to right\n * to current accumulator value and each element.\n * \n * Returns `null` if the collection is empty.\n * \n * @param [operation] function that takes current accumulator value and an element,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceOrNull\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun Iterable.reduceOrNull(operation: (acc: S, T) -> S): S? {\n val iterator = this.iterator()\n if (!iterator.hasNext()) return null\n var accumulator: S = iterator.next()\n while (iterator.hasNext()) {\n accumulator = operation(accumulator, iterator.next())\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Throws an exception if this list is empty. If the list can be empty in an expected way,\n * please use [reduceRightOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\npublic inline fun List.reduceRight(operation: (T, acc: S) -> S): S {\n val iterator = listIterator(size)\n if (!iterator.hasPrevious())\n throw UnsupportedOperationException(\"Empty list can't be reduced.\")\n var accumulator: S = iterator.previous()\n while (iterator.hasPrevious()) {\n accumulator = operation(iterator.previous(), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original list and current accumulator value.\n * \n * Throws an exception if this list is empty. If the list can be empty in an expected way,\n * please use [reduceRightIndexedOrNull] instead. It returns `null` when its receiver is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRight\n */\npublic inline fun List.reduceRightIndexed(operation: (index: Int, T, acc: S) -> S): S {\n val iterator = listIterator(size)\n if (!iterator.hasPrevious())\n throw UnsupportedOperationException(\"Empty list can't be reduced.\")\n var accumulator: S = iterator.previous()\n while (iterator.hasPrevious()) {\n val index = iterator.previousIndex()\n accumulator = operation(index, iterator.previous(), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element with its index in the original list and current accumulator value.\n * \n * Returns `null` if the list is empty.\n * \n * @param [operation] function that takes the index of an element, the element itself and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\npublic inline fun List.reduceRightIndexedOrNull(operation: (index: Int, T, acc: S) -> S): S? {\n val iterator = listIterator(size)\n if (!iterator.hasPrevious())\n return null\n var accumulator: S = iterator.previous()\n while (iterator.hasPrevious()) {\n val index = iterator.previousIndex()\n accumulator = operation(index, iterator.previous(), accumulator)\n }\n return accumulator\n}\n\n/**\n * Accumulates value starting with the last element and applying [operation] from right to left\n * to each element and current accumulator value.\n * \n * Returns `null` if the list is empty.\n * \n * @param [operation] function that takes an element and current accumulator value,\n * and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.reduceRightOrNull\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun List.reduceRightOrNull(operation: (T, acc: S) -> S): S? {\n val iterator = listIterator(size)\n if (!iterator.hasPrevious())\n return null\n var accumulator: S = iterator.previous()\n while (iterator.hasPrevious()) {\n accumulator = operation(iterator.previous(), accumulator)\n }\n return accumulator\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\npublic inline fun Iterable.runningFold(initial: R, operation: (acc: R, T) -> R): List {\n val estimatedSize = collectionSizeOrDefault(9)\n if (estimatedSize == 0) return listOf(initial)\n val result = ArrayList(estimatedSize + 1).apply { add(initial) }\n var accumulator = initial\n for (element in this) {\n accumulator = operation(accumulator, element)\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original collection and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningFold\n */\n@SinceKotlin(\"1.4\")\npublic inline fun Iterable.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): List {\n val estimatedSize = collectionSizeOrDefault(9)\n if (estimatedSize == 0) return listOf(initial)\n val result = ArrayList(estimatedSize + 1).apply { add(initial) }\n var index = 0\n var accumulator = initial\n for (element in this) {\n accumulator = operation(index++, accumulator, element)\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with the first element of this collection.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and the element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun Iterable.runningReduce(operation: (acc: S, T) -> S): List {\n val iterator = this.iterator()\n if (!iterator.hasNext()) return emptyList()\n var accumulator: S = iterator.next()\n val result = ArrayList(collectionSizeOrDefault(10)).apply { add(accumulator) }\n while (iterator.hasNext()) {\n accumulator = operation(accumulator, iterator.next())\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original collection and current accumulator value that starts with the first element of this collection.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.runningReduce\n */\n@SinceKotlin(\"1.4\")\npublic inline fun Iterable.runningReduceIndexed(operation: (index: Int, acc: S, T) -> S): List {\n val iterator = this.iterator()\n if (!iterator.hasNext()) return emptyList()\n var accumulator: S = iterator.next()\n val result = ArrayList(collectionSizeOrDefault(10)).apply { add(accumulator) }\n var index = 1\n while (iterator.hasNext()) {\n accumulator = operation(index++, accumulator, iterator.next())\n result.add(accumulator)\n }\n return result\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes current accumulator value and an element, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun Iterable.scan(initial: R, operation: (acc: R, T) -> R): List {\n return runningFold(initial, operation)\n}\n\n/**\n * Returns a list containing successive accumulation values generated by applying [operation] from left to right\n * to each element, its index in the original collection and current accumulator value that starts with [initial] value.\n * \n * Note that `acc` value passed to [operation] function should not be mutated;\n * otherwise it would affect the previous value in resulting list.\n * \n * @param [operation] function that takes the index of an element, current accumulator value\n * and the element itself, and calculates the next accumulator value.\n * \n * @sample samples.collections.Collections.Aggregates.scan\n */\n@SinceKotlin(\"1.4\")\n@WasExperimental(ExperimentalStdlibApi::class)\npublic inline fun Iterable.scanIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): List {\n return runningFoldIndexed(initial, operation)\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the collection.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun Iterable.sumBy(selector: (T) -> Int): Int {\n var sum: Int = 0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the collection.\n */\n@Deprecated(\"Use sumOf instead.\", ReplaceWith(\"this.sumOf(selector)\"))\n@DeprecatedSinceKotlin(warningSince = \"1.5\")\npublic inline fun Iterable.sumByDouble(selector: (T) -> Double): Double {\n var sum: Double = 0.0\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the collection.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfDouble\")\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.sumOf(selector: (T) -> Double): Double {\n var sum: Double = 0.toDouble()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the collection.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfInt\")\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.sumOf(selector: (T) -> Int): Int {\n var sum: Int = 0.toInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the collection.\n */\n@SinceKotlin(\"1.4\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfLong\")\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.sumOf(selector: (T) -> Long): Long {\n var sum: Long = 0.toLong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the collection.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfUInt\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.sumOf(selector: (T) -> UInt): UInt {\n var sum: UInt = 0.toUInt()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns the sum of all values produced by [selector] function applied to each element in the collection.\n */\n@SinceKotlin(\"1.5\")\n@OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n@OverloadResolutionByLambdaReturnType\n@kotlin.jvm.JvmName(\"sumOfULong\")\n@WasExperimental(ExperimentalUnsignedTypes::class)\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.sumOf(selector: (T) -> ULong): ULong {\n var sum: ULong = 0.toULong()\n for (element in this) {\n sum += selector(element)\n }\n return sum\n}\n\n/**\n * Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements.\n */\npublic fun Iterable.requireNoNulls(): Iterable {\n for (element in this) {\n if (element == null) {\n throw IllegalArgumentException(\"null element found in $this.\")\n }\n }\n @Suppress(\"UNCHECKED_CAST\")\n return this as Iterable\n}\n\n/**\n * Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements.\n */\npublic fun List.requireNoNulls(): List {\n for (element in this) {\n if (element == null) {\n throw IllegalArgumentException(\"null element found in $this.\")\n }\n }\n @Suppress(\"UNCHECKED_CAST\")\n return this as List\n}\n\n/**\n * Splits this collection into a list of lists each not exceeding the given [size].\n * \n * The last list in the resulting list may have fewer elements than the given [size].\n * \n * @param size the number of elements to take in each list, must be positive and can be greater than the number of elements in this collection.\n * \n * @sample samples.collections.Collections.Transformations.chunked\n */\n@SinceKotlin(\"1.2\")\npublic fun Iterable.chunked(size: Int): List> {\n return windowed(size, size, partialWindows = true)\n}\n\n/**\n * Splits this collection into several lists each not exceeding the given [size]\n * and applies the given [transform] function to an each.\n * \n * @return list of results of the [transform] applied to an each list.\n * \n * Note that the list passed to the [transform] function is ephemeral and is valid only inside that function.\n * You should not store it or allow it to escape in some way, unless you made a snapshot of it.\n * The last list may have fewer elements than the given [size].\n * \n * @param size the number of elements to take in each list, must be positive and can be greater than the number of elements in this collection.\n * \n * @sample samples.text.Strings.chunkedTransform\n */\n@SinceKotlin(\"1.2\")\npublic fun Iterable.chunked(size: Int, transform: (List) -> R): List {\n return windowed(size, size, partialWindows = true, transform = transform)\n}\n\n/**\n * Returns a list containing all elements of the original collection without the first occurrence of the given [element].\n */\npublic operator fun Iterable.minus(element: T): List {\n val result = ArrayList(collectionSizeOrDefault(10))\n var removed = false\n return this.filterTo(result) { if (!removed && it == element) { removed = true; false } else true }\n}\n\n/**\n * Returns a list containing all elements of the original collection except the elements contained in the given [elements] array.\n * \n * Before Kotlin 1.6, the [elements] array may have been converted to a [HashSet] to speed up the operation, thus the elements were required to have\n * a correct and stable implementation of `hashCode()` that didn't change between successive invocations.\n * On JVM, you can enable this behavior back with the system property `kotlin.collections.convert_arg_to_set_in_removeAll` set to `true`.\n */\npublic operator fun Iterable.minus(elements: Array): List {\n if (elements.isEmpty()) return this.toList()\n val other = elements.convertToSetForSetOperation()\n return this.filterNot { it in other }\n}\n\n/**\n * Returns a list containing all elements of the original collection except the elements contained in the given [elements] collection.\n * \n * Before Kotlin 1.6, the [elements] collection may have been converted to a [HashSet] to speed up the operation, thus the elements were required to have\n * a correct and stable implementation of `hashCode()` that didn't change between successive invocations.\n * On JVM, you can enable this behavior back with the system property `kotlin.collections.convert_arg_to_set_in_removeAll` set to `true`.\n */\npublic operator fun Iterable.minus(elements: Iterable): List {\n val other = elements.convertToSetForSetOperationWith(this)\n if (other.isEmpty())\n return this.toList()\n return this.filterNot { it in other }\n}\n\n/**\n * Returns a list containing all elements of the original collection except the elements contained in the given [elements] sequence.\n * \n * Before Kotlin 1.6, the [elements] sequence may have been converted to a [HashSet] to speed up the operation, thus the elements were required to have\n * a correct and stable implementation of `hashCode()` that didn't change between successive invocations.\n * On JVM, you can enable this behavior back with the system property `kotlin.collections.convert_arg_to_set_in_removeAll` set to `true`.\n */\npublic operator fun Iterable.minus(elements: Sequence): List {\n val other = elements.convertToSetForSetOperation()\n if (other.isEmpty())\n return this.toList()\n return this.filterNot { it in other }\n}\n\n/**\n * Returns a list containing all elements of the original collection without the first occurrence of the given [element].\n */\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.minusElement(element: T): List {\n return minus(element)\n}\n\n/**\n * Splits the original collection into pair of lists,\n * where *first* list contains elements for which [predicate] yielded `true`,\n * while *second* list contains elements for which [predicate] yielded `false`.\n * \n * @sample samples.collections.Iterables.Operations.partition\n */\npublic inline fun Iterable.partition(predicate: (T) -> Boolean): Pair, List> {\n val first = ArrayList()\n val second = ArrayList()\n for (element in this) {\n if (predicate(element)) {\n first.add(element)\n } else {\n second.add(element)\n }\n }\n return Pair(first, second)\n}\n\n/**\n * Returns a list containing all elements of the original collection and then the given [element].\n */\npublic operator fun Iterable.plus(element: T): List {\n if (this is Collection) return this.plus(element)\n val result = ArrayList()\n result.addAll(this)\n result.add(element)\n return result\n}\n\n/**\n * Returns a list containing all elements of the original collection and then the given [element].\n */\npublic operator fun Collection.plus(element: T): List {\n val result = ArrayList(size + 1)\n result.addAll(this)\n result.add(element)\n return result\n}\n\n/**\n * Returns a list containing all elements of the original collection and then all elements of the given [elements] array.\n */\npublic operator fun Iterable.plus(elements: Array): List {\n if (this is Collection) return this.plus(elements)\n val result = ArrayList()\n result.addAll(this)\n result.addAll(elements)\n return result\n}\n\n/**\n * Returns a list containing all elements of the original collection and then all elements of the given [elements] array.\n */\npublic operator fun Collection.plus(elements: Array): List {\n val result = ArrayList(this.size + elements.size)\n result.addAll(this)\n result.addAll(elements)\n return result\n}\n\n/**\n * Returns a list containing all elements of the original collection and then all elements of the given [elements] collection.\n */\npublic operator fun Iterable.plus(elements: Iterable): List {\n if (this is Collection) return this.plus(elements)\n val result = ArrayList()\n result.addAll(this)\n result.addAll(elements)\n return result\n}\n\n/**\n * Returns a list containing all elements of the original collection and then all elements of the given [elements] collection.\n */\npublic operator fun Collection.plus(elements: Iterable): List {\n if (elements is Collection) {\n val result = ArrayList(this.size + elements.size)\n result.addAll(this)\n result.addAll(elements)\n return result\n } else {\n val result = ArrayList(this)\n result.addAll(elements)\n return result\n }\n}\n\n/**\n * Returns a list containing all elements of the original collection and then all elements of the given [elements] sequence.\n */\npublic operator fun Iterable.plus(elements: Sequence): List {\n val result = ArrayList()\n result.addAll(this)\n result.addAll(elements)\n return result\n}\n\n/**\n * Returns a list containing all elements of the original collection and then all elements of the given [elements] sequence.\n */\npublic operator fun Collection.plus(elements: Sequence): List {\n val result = ArrayList(this.size + 10)\n result.addAll(this)\n result.addAll(elements)\n return result\n}\n\n/**\n * Returns a list containing all elements of the original collection and then the given [element].\n */\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.plusElement(element: T): List {\n return plus(element)\n}\n\n/**\n * Returns a list containing all elements of the original collection and then the given [element].\n */\n@kotlin.internal.InlineOnly\npublic inline fun Collection.plusElement(element: T): List {\n return plus(element)\n}\n\n/**\n * Returns a list of snapshots of the window of the given [size]\n * sliding along this collection with the given [step], where each\n * snapshot is a list.\n * \n * Several last lists may have fewer elements than the given [size].\n * \n * Both [size] and [step] must be positive and can be greater than the number of elements in this collection.\n * @param size the number of elements to take in each window\n * @param step the number of elements to move the window forward by on an each step, by default 1\n * @param partialWindows controls whether or not to keep partial windows in the end if any,\n * by default `false` which means partial windows won't be preserved\n * \n * @sample samples.collections.Sequences.Transformations.takeWindows\n */\n@SinceKotlin(\"1.2\")\npublic fun Iterable.windowed(size: Int, step: Int = 1, partialWindows: Boolean = false): List> {\n checkWindowSizeStep(size, step)\n if (this is RandomAccess && this is List) {\n val thisSize = this.size\n val resultCapacity = thisSize / step + if (thisSize % step == 0) 0 else 1\n val result = ArrayList>(resultCapacity)\n var index = 0\n while (index in 0 until thisSize) {\n val windowSize = size.coerceAtMost(thisSize - index)\n if (windowSize < size && !partialWindows) break\n result.add(List(windowSize) { this[it + index] })\n index += step\n }\n return result\n }\n val result = ArrayList>()\n windowedIterator(iterator(), size, step, partialWindows, reuseBuffer = false).forEach {\n result.add(it)\n }\n return result\n}\n\n/**\n * Returns a list of results of applying the given [transform] function to\n * an each list representing a view over the window of the given [size]\n * sliding along this collection with the given [step].\n * \n * Note that the list passed to the [transform] function is ephemeral and is valid only inside that function.\n * You should not store it or allow it to escape in some way, unless you made a snapshot of it.\n * Several last lists may have fewer elements than the given [size].\n * \n * Both [size] and [step] must be positive and can be greater than the number of elements in this collection.\n * @param size the number of elements to take in each window\n * @param step the number of elements to move the window forward by on an each step, by default 1\n * @param partialWindows controls whether or not to keep partial windows in the end if any,\n * by default `false` which means partial windows won't be preserved\n * \n * @sample samples.collections.Sequences.Transformations.averageWindows\n */\n@SinceKotlin(\"1.2\")\npublic fun Iterable.windowed(size: Int, step: Int = 1, partialWindows: Boolean = false, transform: (List) -> R): List {\n checkWindowSizeStep(size, step)\n if (this is RandomAccess && this is List) {\n val thisSize = this.size\n val resultCapacity = thisSize / step + if (thisSize % step == 0) 0 else 1\n val result = ArrayList(resultCapacity)\n val window = MovingSubList(this)\n var index = 0\n while (index in 0 until thisSize) {\n val windowSize = size.coerceAtMost(thisSize - index)\n if (!partialWindows && windowSize < size) break\n window.move(index, index + windowSize)\n result.add(transform(window))\n index += step\n }\n return result\n }\n val result = ArrayList()\n windowedIterator(iterator(), size, step, partialWindows, reuseBuffer = true).forEach {\n result.add(transform(it))\n }\n return result\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` collection and the [other] array with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun Iterable.zip(other: Array): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of values built from the elements of `this` collection and the [other] array with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun Iterable.zip(other: Array, transform: (a: T, b: R) -> V): List {\n val arraySize = other.size\n val list = ArrayList(minOf(collectionSizeOrDefault(10), arraySize))\n var i = 0\n for (element in this) {\n if (i >= arraySize) break\n list.add(transform(element, other[i++]))\n }\n return list\n}\n\n/**\n * Returns a list of pairs built from the elements of `this` collection and [other] collection with the same index.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterable\n */\npublic infix fun Iterable.zip(other: Iterable): List> {\n return zip(other) { t1, t2 -> t1 to t2 }\n}\n\n/**\n * Returns a list of values built from the elements of `this` collection and the [other] collection with the same index\n * using the provided [transform] function applied to each pair of elements.\n * The returned list has length of the shortest collection.\n * \n * @sample samples.collections.Iterables.Operations.zipIterableWithTransform\n */\npublic inline fun Iterable.zip(other: Iterable, transform: (a: T, b: R) -> V): List {\n val first = iterator()\n val second = other.iterator()\n val list = ArrayList(minOf(collectionSizeOrDefault(10), other.collectionSizeOrDefault(10)))\n while (first.hasNext() && second.hasNext()) {\n list.add(transform(first.next(), second.next()))\n }\n return list\n}\n\n/**\n * Returns a list of pairs of each two adjacent elements in this collection.\n * \n * The returned list is empty if this collection contains less than two elements.\n * \n * @sample samples.collections.Collections.Transformations.zipWithNext\n */\n@SinceKotlin(\"1.2\")\npublic fun Iterable.zipWithNext(): List> {\n return zipWithNext { a, b -> a to b }\n}\n\n/**\n * Returns a list containing the results of applying the given [transform] function\n * to an each pair of two adjacent elements in this collection.\n * \n * The returned list is empty if this collection contains less than two elements.\n * \n * @sample samples.collections.Collections.Transformations.zipWithNextToFindDeltas\n */\n@SinceKotlin(\"1.2\")\npublic inline fun Iterable.zipWithNext(transform: (a: T, b: T) -> R): List {\n val iterator = iterator()\n if (!iterator.hasNext()) return emptyList()\n val result = mutableListOf()\n var current = iterator.next()\n while (iterator.hasNext()) {\n val next = iterator.next()\n result.add(transform(current, next))\n current = next\n }\n return result\n}\n\n/**\n * Appends the string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n * \n * @sample samples.collections.Collections.Transformations.joinTo\n */\npublic fun Iterable.joinTo(buffer: A, separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((T) -> CharSequence)? = null): A {\n buffer.append(prefix)\n var count = 0\n for (element in this) {\n if (++count > 1) buffer.append(separator)\n if (limit < 0 || count <= limit) {\n buffer.appendElement(element, transform)\n } else break\n }\n if (limit >= 0 && count > limit) buffer.append(truncated)\n buffer.append(postfix)\n return buffer\n}\n\n/**\n * Creates a string from all the elements separated using [separator] and using the given [prefix] and [postfix] if supplied.\n * \n * If the collection could be huge, you can specify a non-negative value of [limit], in which case only the first [limit]\n * elements will be appended, followed by the [truncated] string (which defaults to \"...\").\n * \n * @sample samples.collections.Collections.Transformations.joinToString\n */\npublic fun Iterable.joinToString(separator: CharSequence = \", \", prefix: CharSequence = \"\", postfix: CharSequence = \"\", limit: Int = -1, truncated: CharSequence = \"...\", transform: ((T) -> CharSequence)? = null): String {\n return joinTo(StringBuilder(), separator, prefix, postfix, limit, truncated, transform).toString()\n}\n\n/**\n * Returns this collection as an [Iterable].\n */\n@kotlin.internal.InlineOnly\npublic inline fun Iterable.asIterable(): Iterable {\n return this\n}\n\n/**\n * Creates a [Sequence] instance that wraps the original collection returning its elements when being iterated.\n * \n * @sample samples.collections.Sequences.Building.sequenceFromCollection\n */\npublic fun Iterable.asSequence(): Sequence {\n return Sequence { this.iterator() }\n}\n\n/**\n * Returns an average value of elements in the collection.\n */\n@kotlin.jvm.JvmName(\"averageOfByte\")\npublic fun Iterable.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n checkCountOverflow(++count)\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the collection.\n */\n@kotlin.jvm.JvmName(\"averageOfShort\")\npublic fun Iterable.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n checkCountOverflow(++count)\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the collection.\n */\n@kotlin.jvm.JvmName(\"averageOfInt\")\npublic fun Iterable.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n checkCountOverflow(++count)\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the collection.\n */\n@kotlin.jvm.JvmName(\"averageOfLong\")\npublic fun Iterable.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n checkCountOverflow(++count)\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the collection.\n */\n@kotlin.jvm.JvmName(\"averageOfFloat\")\npublic fun Iterable.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n checkCountOverflow(++count)\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns an average value of elements in the collection.\n */\n@kotlin.jvm.JvmName(\"averageOfDouble\")\npublic fun Iterable.average(): Double {\n var sum: Double = 0.0\n var count: Int = 0\n for (element in this) {\n sum += element\n checkCountOverflow(++count)\n }\n return if (count == 0) Double.NaN else sum / count\n}\n\n/**\n * Returns the sum of all elements in the collection.\n */\n@kotlin.jvm.JvmName(\"sumOfByte\")\npublic fun Iterable.sum(): Int {\n var sum: Int = 0\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the collection.\n */\n@kotlin.jvm.JvmName(\"sumOfShort\")\npublic fun Iterable.sum(): Int {\n var sum: Int = 0\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the collection.\n */\n@kotlin.jvm.JvmName(\"sumOfInt\")\npublic fun Iterable.sum(): Int {\n var sum: Int = 0\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the collection.\n */\n@kotlin.jvm.JvmName(\"sumOfLong\")\npublic fun Iterable.sum(): Long {\n var sum: Long = 0L\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the collection.\n */\n@kotlin.jvm.JvmName(\"sumOfFloat\")\npublic fun Iterable.sum(): Float {\n var sum: Float = 0.0f\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n/**\n * Returns the sum of all elements in the collection.\n */\n@kotlin.jvm.JvmName(\"sumOfDouble\")\npublic fun Iterable.sum(): Double {\n var sum: Double = 0.0\n for (element in this) {\n sum += element\n }\n return sum\n}\n\n","package com.ustadmobile.lib.util\n\n/**\n * Represents the parameters required for serving a partial response\n */\ndata class RangeResponse(\n /**\n * The response status code : 206 (if the request is valid), 416 (if range is unsatisfiable),\n * 400 (if request is invalid)\n */\n val statusCode: Int,\n\n /**\n * The first byte to serve (inclusive)\n */\n val fromByte: Long,\n\n /**\n * The last byte to serve (inclusive)\n */\n val toByte: Long,\n\n /**\n * The actual length of the range that will be served\n */\n val actualContentLength: Long,\n\n /**\n * The headers that should be added to the response (if statusCode = 206)\n */\n val responseHeaders: Map)\n\nval RANGE_CONTENT_LENGTH_HEADER = \"Content-Length\"\nval RANGE_CONTENT_RANGE_HEADER = \"Content-Range\"\nval RANGE_CONTENT_ACCEPT_RANGE_HEADER = \"Accept-Ranges\"\n\n\nfun parseRangeRequestHeader(rangeHeader: String, totalLength: Long): RangeResponse {\n\n var fromByte = -1L\n var toByte = -1L\n var statusCode = 0\n var responseHeaders = emptyMap()\n var actualContentLength = 0L\n\n try {\n val header = rangeHeader.substring(\"bytes=\".length)\n\n val dashPos = header.indexOf('-')\n if (dashPos > 0) {\n fromByte = header.substring(0, dashPos).toLong()\n }\n\n if (dashPos == header.length - 1) {\n toByte = totalLength - 1\n } else if (dashPos > 0) {\n toByte = header.substring(dashPos + 1).toLong()\n }\n\n if(fromByte == -1L || toByte == -1L) {\n statusCode = 400\n }else if(fromByte >= 0 && fromByte < totalLength\n && toByte > 0 && toByte <= totalLength) {\n /*\n * range request is inclusive: e.g. range 0-1 length is 2 bytes as per\n * https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html 14.35.1 Byte Ranges\n */\n actualContentLength = (toByte + 1) - fromByte\n responseHeaders = mapOf(\n RANGE_CONTENT_LENGTH_HEADER to actualContentLength.toString(),\n RANGE_CONTENT_RANGE_HEADER to \"bytes $fromByte-$toByte/$totalLength\",\n RANGE_CONTENT_ACCEPT_RANGE_HEADER to \"bytes\"\n )\n\n statusCode = 206\n }else {\n statusCode = 416\n }\n } catch (e: Exception) {\n statusCode = 400\n }\n\n return RangeResponse(statusCode, fromByte, toByte, actualContentLength,\n responseHeaders)\n}\n\n\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"CollectionsKt\")\n@file:OptIn(kotlin.experimental.ExperimentalTypeInference::class)\n\npackage kotlin.collections\n\nimport kotlin.contracts.*\nimport kotlin.random.Random\n\ninternal object EmptyIterator : ListIterator {\n override fun hasNext(): Boolean = false\n override fun hasPrevious(): Boolean = false\n override fun nextIndex(): Int = 0\n override fun previousIndex(): Int = -1\n override fun next(): Nothing = throw NoSuchElementException()\n override fun previous(): Nothing = throw NoSuchElementException()\n}\n\ninternal object EmptyList : List, Serializable, RandomAccess {\n private const val serialVersionUID: Long = -7390468764508069838L\n\n override fun equals(other: Any?): Boolean = other is List<*> && other.isEmpty()\n override fun hashCode(): Int = 1\n override fun toString(): String = \"[]\"\n\n override val size: Int get() = 0\n override fun isEmpty(): Boolean = true\n override fun contains(element: Nothing): Boolean = false\n override fun containsAll(elements: Collection): Boolean = elements.isEmpty()\n\n override fun get(index: Int): Nothing = throw IndexOutOfBoundsException(\"Empty list doesn't contain element at index $index.\")\n override fun indexOf(element: Nothing): Int = -1\n override fun lastIndexOf(element: Nothing): Int = -1\n\n override fun iterator(): Iterator = EmptyIterator\n override fun listIterator(): ListIterator = EmptyIterator\n override fun listIterator(index: Int): ListIterator {\n if (index != 0) throw IndexOutOfBoundsException(\"Index: $index\")\n return EmptyIterator\n }\n\n override fun subList(fromIndex: Int, toIndex: Int): List {\n if (fromIndex == 0 && toIndex == 0) return this\n throw IndexOutOfBoundsException(\"fromIndex: $fromIndex, toIndex: $toIndex\")\n }\n\n private fun readResolve(): Any = EmptyList\n}\n\ninternal fun Array.asCollection(): Collection = ArrayAsCollection(this, isVarargs = false)\n\nprivate class ArrayAsCollection(val values: Array, val isVarargs: Boolean) : Collection {\n override val size: Int get() = values.size\n override fun isEmpty(): Boolean = values.isEmpty()\n override fun contains(element: T): Boolean = values.contains(element)\n override fun containsAll(elements: Collection): Boolean = elements.all { contains(it) }\n override fun iterator(): Iterator = values.iterator()\n // override hidden toArray implementation to prevent copying of values array\n public fun toArray(): Array = values.copyToArrayOfAny(isVarargs)\n}\n\n/**\n * Returns an empty read-only list. The returned list is serializable (JVM).\n * @sample samples.collections.Collections.Lists.emptyReadOnlyList\n */\npublic fun emptyList(): List = EmptyList\n\n/**\n * Returns a new read-only list of given elements. The returned list is serializable (JVM).\n * @sample samples.collections.Collections.Lists.readOnlyList\n */\npublic fun listOf(vararg elements: T): List = if (elements.size > 0) elements.asList() else emptyList()\n\n/**\n * Returns an empty read-only list. The returned list is serializable (JVM).\n * @sample samples.collections.Collections.Lists.emptyReadOnlyList\n */\n@kotlin.internal.InlineOnly\npublic inline fun listOf(): List = emptyList()\n\n/**\n * Returns an empty new [MutableList].\n * @sample samples.collections.Collections.Lists.emptyMutableList\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline fun mutableListOf(): MutableList = ArrayList()\n\n/**\n * Returns an empty new [ArrayList].\n * @sample samples.collections.Collections.Lists.emptyArrayList\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline fun arrayListOf(): ArrayList = ArrayList()\n\n/**\n * Returns a new [MutableList] with the given elements.\n * @sample samples.collections.Collections.Lists.mutableList\n */\npublic fun mutableListOf(vararg elements: T): MutableList =\n if (elements.size == 0) ArrayList() else ArrayList(ArrayAsCollection(elements, isVarargs = true))\n\n/**\n * Returns a new [ArrayList] with the given elements.\n * @sample samples.collections.Collections.Lists.arrayList\n */\npublic fun arrayListOf(vararg elements: T): ArrayList =\n if (elements.size == 0) ArrayList() else ArrayList(ArrayAsCollection(elements, isVarargs = true))\n\n/**\n * Returns a new read-only list either of single given element, if it is not null, or empty list if the element is null. The returned list is serializable (JVM).\n * @sample samples.collections.Collections.Lists.listOfNotNull\n */\npublic fun listOfNotNull(element: T?): List = if (element != null) listOf(element) else emptyList()\n\n/**\n * Returns a new read-only list only of those given elements, that are not null. The returned list is serializable (JVM).\n * @sample samples.collections.Collections.Lists.listOfNotNull\n */\npublic fun listOfNotNull(vararg elements: T?): List = elements.filterNotNull()\n\n/**\n * Creates a new read-only list with the specified [size], where each element is calculated by calling the specified\n * [init] function.\n *\n * The function [init] is called for each list element sequentially starting from the first one.\n * It should return the value for a list element given its index.\n *\n * @sample samples.collections.Collections.Lists.readOnlyListFromInitializer\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline fun List(size: Int, init: (index: Int) -> T): List = MutableList(size, init)\n\n/**\n * Creates a new mutable list with the specified [size], where each element is calculated by calling the specified\n * [init] function.\n *\n * The function [init] is called for each list element sequentially starting from the first one.\n * It should return the value for a list element given its index.\n *\n * @sample samples.collections.Collections.Lists.mutableListFromInitializer\n */\n@SinceKotlin(\"1.1\")\n@kotlin.internal.InlineOnly\npublic inline fun MutableList(size: Int, init: (index: Int) -> T): MutableList {\n val list = ArrayList(size)\n repeat(size) { index -> list.add(init(index)) }\n return list\n}\n\n/**\n * Builds a new read-only [List] by populating a [MutableList] using the given [builderAction]\n * and returning a read-only list with the same elements.\n *\n * The list passed as a receiver to the [builderAction] is valid only inside that function.\n * Using it outside of the function produces an unspecified behavior.\n *\n * The returned list is serializable (JVM).\n *\n * @sample samples.collections.Builders.Lists.buildListSample\n */\n@SinceKotlin(\"1.6\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\n@Suppress(\"DEPRECATION\")\npublic inline fun buildList(@BuilderInference builderAction: MutableList.() -> Unit): List {\n contract { callsInPlace(builderAction, InvocationKind.EXACTLY_ONCE) }\n return buildListInternal(builderAction)\n}\n\n@PublishedApi\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\ninternal expect inline fun buildListInternal(builderAction: MutableList.() -> Unit): List\n\n/**\n * Builds a new read-only [List] by populating a [MutableList] using the given [builderAction]\n * and returning a read-only list with the same elements.\n *\n * The list passed as a receiver to the [builderAction] is valid only inside that function.\n * Using it outside of the function produces an unspecified behavior.\n *\n * The returned list is serializable (JVM).\n *\n * [capacity] is used to hint the expected number of elements added in the [builderAction].\n *\n * @throws IllegalArgumentException if the given [capacity] is negative.\n *\n * @sample samples.collections.Builders.Lists.buildListSampleWithCapacity\n */\n@SinceKotlin(\"1.6\")\n@WasExperimental(ExperimentalStdlibApi::class)\n@kotlin.internal.InlineOnly\n@Suppress(\"DEPRECATION\")\npublic inline fun buildList(capacity: Int, @BuilderInference builderAction: MutableList.() -> Unit): List {\n contract { callsInPlace(builderAction, InvocationKind.EXACTLY_ONCE) }\n return buildListInternal(capacity, builderAction)\n}\n\n@PublishedApi\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\ninternal expect inline fun buildListInternal(capacity: Int, builderAction: MutableList.() -> Unit): List\n\n/**\n * Returns an [IntRange] of the valid indices for this collection.\n * @sample samples.collections.Collections.Collections.indicesOfCollection\n */\npublic val Collection<*>.indices: IntRange\n get() = 0..size - 1\n\n/**\n * Returns the index of the last item in the list or -1 if the list is empty.\n *\n * @sample samples.collections.Collections.Lists.lastIndexOfList\n */\npublic val List.lastIndex: Int\n get() = this.size - 1\n\n/**\n * Returns `true` if the collection is not empty.\n * @sample samples.collections.Collections.Collections.collectionIsNotEmpty\n */\n@kotlin.internal.InlineOnly\npublic inline fun Collection.isNotEmpty(): Boolean = !isEmpty()\n\n/**\n * Returns `true` if this nullable collection is either null or empty.\n * @sample samples.collections.Collections.Collections.collectionIsNullOrEmpty\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun Collection?.isNullOrEmpty(): Boolean {\n contract {\n returns(false) implies (this@isNullOrEmpty != null)\n }\n\n return this == null || this.isEmpty()\n}\n\n/**\n * Returns this Collection if it's not `null` and the empty list otherwise.\n * @sample samples.collections.Collections.Collections.collectionOrEmpty\n */\n@kotlin.internal.InlineOnly\npublic inline fun Collection?.orEmpty(): Collection = this ?: emptyList()\n\n/**\n * Returns this List if it's not `null` and the empty list otherwise.\n * @sample samples.collections.Collections.Lists.listOrEmpty\n */\n@kotlin.internal.InlineOnly\npublic inline fun List?.orEmpty(): List = this ?: emptyList()\n\n/**\n * Returns this collection if it's not empty\n * or the result of calling [defaultValue] function if the collection is empty.\n *\n * @sample samples.collections.Collections.Collections.collectionIfEmpty\n */\n@SinceKotlin(\"1.3\")\n@kotlin.internal.InlineOnly\npublic inline fun C.ifEmpty(defaultValue: () -> R): R where C : Collection<*>, C : R =\n if (isEmpty()) defaultValue() else this\n\n\n/**\n * Checks if all elements in the specified collection are contained in this collection.\n *\n * Allows to overcome type-safety restriction of `containsAll` that requires to pass a collection of type `Collection`.\n * @sample samples.collections.Collections.Collections.collectionContainsAll\n */\n@Suppress(\"EXTENSION_SHADOWED_BY_MEMBER\") // false warning, extension takes precedence in some cases\n@kotlin.internal.InlineOnly\npublic inline fun <@kotlin.internal.OnlyInputTypes T> Collection.containsAll(elements: Collection): Boolean = this.containsAll(elements)\n\n\n/**\n * Returns a new list with the elements of this list randomly shuffled\n * using the specified [random] instance as the source of randomness.\n */\n@SinceKotlin(\"1.3\")\npublic fun Iterable.shuffled(random: Random): List = toMutableList().apply { shuffle(random) }\n\n\ninternal fun List.optimizeReadOnlyList() = when (size) {\n 0 -> emptyList()\n 1 -> listOf(this[0])\n else -> this\n}\n\n/**\n * Searches this list or its range for the provided [element] using the binary search algorithm.\n * The list is expected to be sorted into ascending order according to the Comparable natural ordering of its elements,\n * otherwise the result is undefined.\n *\n * If the list contains multiple elements equal to the specified [element], there is no guarantee which one will be found.\n *\n * `null` value is considered to be less than any non-null value.\n *\n * @return the index of the element, if it is contained in the list within the specified range;\n * otherwise, the inverted insertion point `(-insertion point - 1)`.\n * The insertion point is defined as the index at which the element should be inserted,\n * so that the list (or the specified subrange of list) still remains sorted.\n * @sample samples.collections.Collections.Lists.binarySearchOnComparable\n * @sample samples.collections.Collections.Lists.binarySearchWithBoundaries\n */\npublic fun > List.binarySearch(element: T?, fromIndex: Int = 0, toIndex: Int = size): Int {\n rangeCheck(size, fromIndex, toIndex)\n\n var low = fromIndex\n var high = toIndex - 1\n\n while (low <= high) {\n val mid = (low + high).ushr(1) // safe from overflows\n val midVal = get(mid)\n val cmp = compareValues(midVal, element)\n\n if (cmp < 0)\n low = mid + 1\n else if (cmp > 0)\n high = mid - 1\n else\n return mid // key found\n }\n return -(low + 1) // key not found\n}\n\n/**\n * Searches this list or its range for the provided [element] using the binary search algorithm.\n * The list is expected to be sorted into ascending order according to the specified [comparator],\n * otherwise the result is undefined.\n *\n * If the list contains multiple elements equal to the specified [element], there is no guarantee which one will be found.\n *\n * `null` value is considered to be less than any non-null value.\n *\n * @return the index of the element, if it is contained in the list within the specified range;\n * otherwise, the inverted insertion point `(-insertion point - 1)`.\n * The insertion point is defined as the index at which the element should be inserted,\n * so that the list (or the specified subrange of list) still remains sorted according to the specified [comparator].\n * @sample samples.collections.Collections.Lists.binarySearchWithComparator\n */\npublic fun List.binarySearch(element: T, comparator: Comparator, fromIndex: Int = 0, toIndex: Int = size): Int {\n rangeCheck(size, fromIndex, toIndex)\n\n var low = fromIndex\n var high = toIndex - 1\n\n while (low <= high) {\n val mid = (low + high).ushr(1) // safe from overflows\n val midVal = get(mid)\n val cmp = comparator.compare(midVal, element)\n\n if (cmp < 0)\n low = mid + 1\n else if (cmp > 0)\n high = mid - 1\n else\n return mid // key found\n }\n return -(low + 1) // key not found\n}\n\n/**\n * Searches this list or its range for an element having the key returned by the specified [selector] function\n * equal to the provided [key] value using the binary search algorithm.\n * The list is expected to be sorted into ascending order according to the Comparable natural ordering of keys of its elements.\n * otherwise the result is undefined.\n *\n * If the list contains multiple elements with the specified [key], there is no guarantee which one will be found.\n *\n * `null` value is considered to be less than any non-null value.\n *\n * @return the index of the element with the specified [key], if it is contained in the list within the specified range;\n * otherwise, the inverted insertion point `(-insertion point - 1)`.\n * The insertion point is defined as the index at which the element should be inserted,\n * so that the list (or the specified subrange of list) still remains sorted.\n * @sample samples.collections.Collections.Lists.binarySearchByKey\n */\npublic inline fun > List.binarySearchBy(\n key: K?,\n fromIndex: Int = 0,\n toIndex: Int = size,\n crossinline selector: (T) -> K?\n): Int =\n binarySearch(fromIndex, toIndex) { compareValues(selector(it), key) }\n\n// do not introduce this overload --- too rare\n//public fun List.binarySearchBy(key: K, comparator: Comparator, fromIndex: Int = 0, toIndex: Int = size(), selector: (T) -> K): Int =\n// binarySearch(fromIndex, toIndex) { comparator.compare(selector(it), key) }\n\n\n/**\n * Searches this list or its range for an element for which the given [comparison] function returns zero using the binary search algorithm.\n *\n * The list is expected to be sorted so that the signs of the [comparison] function's return values ascend on the list elements,\n * i.e. negative values come before zero and zeroes come before positive values.\n * Otherwise, the result is undefined.\n *\n * If the list contains multiple elements for which [comparison] returns zero, there is no guarantee which one will be found.\n *\n * @param comparison function that returns zero when called on the list element being searched.\n * On the elements coming before the target element, the function must return negative values;\n * on the elements coming after the target element, the function must return positive values.\n *\n * @return the index of the found element, if it is contained in the list within the specified range;\n * otherwise, the inverted insertion point `(-insertion point - 1)`.\n * The insertion point is defined as the index at which the element should be inserted,\n * so that the list (or the specified subrange of list) still remains sorted.\n * @sample samples.collections.Collections.Lists.binarySearchWithComparisonFunction\n */\npublic fun List.binarySearch(fromIndex: Int = 0, toIndex: Int = size, comparison: (T) -> Int): Int {\n rangeCheck(size, fromIndex, toIndex)\n\n var low = fromIndex\n var high = toIndex - 1\n\n while (low <= high) {\n val mid = (low + high).ushr(1) // safe from overflows\n val midVal = get(mid)\n val cmp = comparison(midVal)\n\n if (cmp < 0)\n low = mid + 1\n else if (cmp > 0)\n high = mid - 1\n else\n return mid // key found\n }\n return -(low + 1) // key not found\n}\n\n/**\n * Checks that `from` and `to` are in\n * the range of [0..size] and throws an appropriate exception, if they aren't.\n */\nprivate fun rangeCheck(size: Int, fromIndex: Int, toIndex: Int) {\n when {\n fromIndex > toIndex -> throw IllegalArgumentException(\"fromIndex ($fromIndex) is greater than toIndex ($toIndex).\")\n fromIndex < 0 -> throw IndexOutOfBoundsException(\"fromIndex ($fromIndex) is less than zero.\")\n toIndex > size -> throw IndexOutOfBoundsException(\"toIndex ($toIndex) is greater than size ($size).\")\n }\n}\n\n\n@PublishedApi\n@SinceKotlin(\"1.3\")\ninternal expect fun checkIndexOverflow(index: Int): Int\n\n@PublishedApi\n@SinceKotlin(\"1.3\")\ninternal expect fun checkCountOverflow(count: Int): Int\n\n\n@PublishedApi\n@SinceKotlin(\"1.3\")\ninternal fun throwIndexOverflow() { throw ArithmeticException(\"Index overflow has happened.\") }\n\n@PublishedApi\n@SinceKotlin(\"1.3\")\ninternal fun throwCountOverflow() { throw ArithmeticException(\"Count overflow has happened.\") }\n\n","/*\n * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n@file:kotlin.jvm.JvmMultifileClass\n@file:kotlin.jvm.JvmName(\"StandardKt\")\npackage kotlin\n\nimport kotlin.contracts.*\n\n/**\n * An exception is thrown to indicate that a method body remains to be implemented.\n */\npublic class NotImplementedError(message: String = \"An operation is not implemented.\") : Error(message)\n\n/**\n * Always throws [NotImplementedError] stating that operation is not implemented.\n */\n\n@kotlin.internal.InlineOnly\npublic inline fun TODO(): Nothing = throw NotImplementedError()\n\n/**\n * Always throws [NotImplementedError] stating that operation is not implemented.\n *\n * @param reason a string explaining why the implementation is missing.\n */\n@kotlin.internal.InlineOnly\npublic inline fun TODO(reason: String): Nothing = throw NotImplementedError(\"An operation is not implemented: $reason\")\n\n\n\n/**\n * Calls the specified function [block] and returns its result.\n *\n * For detailed usage information see the documentation for [scope functions](https://kotlinlang.org/docs/reference/scope-functions.html#run).\n */\n@kotlin.internal.InlineOnly\npublic inline fun run(block: () -> R): R {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n return block()\n}\n\n/**\n * Calls the specified function [block] with `this` value as its receiver and returns its result.\n *\n * For detailed usage information see the documentation for [scope functions](https://kotlinlang.org/docs/reference/scope-functions.html#run).\n */\n@kotlin.internal.InlineOnly\npublic inline fun T.run(block: T.() -> R): R {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n return block()\n}\n\n/**\n * Calls the specified function [block] with the given [receiver] as its receiver and returns its result.\n *\n * For detailed usage information see the documentation for [scope functions](https://kotlinlang.org/docs/reference/scope-functions.html#with).\n */\n@kotlin.internal.InlineOnly\npublic inline fun with(receiver: T, block: T.() -> R): R {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n return receiver.block()\n}\n\n/**\n * Calls the specified function [block] with `this` value as its receiver and returns `this` value.\n *\n * For detailed usage information see the documentation for [scope functions](https://kotlinlang.org/docs/reference/scope-functions.html#apply).\n */\n@kotlin.internal.InlineOnly\npublic inline fun T.apply(block: T.() -> Unit): T {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n block()\n return this\n}\n\n/**\n * Calls the specified function [block] with `this` value as its argument and returns `this` value.\n *\n * For detailed usage information see the documentation for [scope functions](https://kotlinlang.org/docs/reference/scope-functions.html#also).\n */\n@kotlin.internal.InlineOnly\n@SinceKotlin(\"1.1\")\npublic inline fun T.also(block: (T) -> Unit): T {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n block(this)\n return this\n}\n\n/**\n * Calls the specified function [block] with `this` value as its argument and returns its result.\n *\n * For detailed usage information see the documentation for [scope functions](https://kotlinlang.org/docs/reference/scope-functions.html#let).\n */\n@kotlin.internal.InlineOnly\npublic inline fun T.let(block: (T) -> R): R {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n return block(this)\n}\n\n/**\n * Returns `this` value if it satisfies the given [predicate] or `null`, if it doesn't.\n *\n * For detailed usage information see the documentation for [scope functions](https://kotlinlang.org/docs/reference/scope-functions.html#takeif-and-takeunless).\n */\n@kotlin.internal.InlineOnly\n@SinceKotlin(\"1.1\")\npublic inline fun T.takeIf(predicate: (T) -> Boolean): T? {\n contract {\n callsInPlace(predicate, InvocationKind.EXACTLY_ONCE)\n }\n return if (predicate(this)) this else null\n}\n\n/**\n * Returns `this` value if it _does not_ satisfy the given [predicate] or `null`, if it does.\n *\n * For detailed usage information see the documentation for [scope functions](https://kotlinlang.org/docs/reference/scope-functions.html#takeif-and-takeunless).\n */\n@kotlin.internal.InlineOnly\n@SinceKotlin(\"1.1\")\npublic inline fun T.takeUnless(predicate: (T) -> Boolean): T? {\n contract {\n callsInPlace(predicate, InvocationKind.EXACTLY_ONCE)\n }\n return if (!predicate(this)) this else null\n}\n\n/**\n * Executes the given function [action] specified number of [times].\n *\n * A zero-based index of current iteration is passed as a parameter to [action].\n *\n * @sample samples.misc.ControlFlow.repeat\n */\n@kotlin.internal.InlineOnly\npublic inline fun repeat(times: Int, action: (Int) -> Unit) {\n contract { callsInPlace(action) }\n\n for (index in 0 until times) {\n action(index)\n }\n}\n","package com.ustadmobile.lib.util\n\nprivate val sanitizeRegex = Regex(\"\\\\W\")\n\n/**\n * This is primarily here for test methods so that the active database can be bound in JDBC\n */\nfun sanitizeDbNameFromUrl(url: String): String = url.removePrefix(\"https://\")\n .removePrefix(\"http://\")\n .replace(sanitizeRegex, \"_\")",null,null,"/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.request\n\nimport io.ktor.client.*\nimport io.ktor.client.call.*\nimport io.ktor.client.statement.*\nimport io.ktor.client.utils.*\nimport io.ktor.http.*\nimport io.ktor.util.*\nimport kotlin.jvm.*\n\n/**\n * Executes a [HttpClient] request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.request(\n builder: HttpRequestBuilder = HttpRequestBuilder()\n): HttpResponse = HttpStatement(builder, this).execute()\n\n/**\n * Prepares a [HttpClient] request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.prepareRequest(\n builder: HttpRequestBuilder = HttpRequestBuilder()\n): HttpStatement = HttpStatement(builder, this)\n\n/**\n * Executes a [HttpClient] request, with the information configured in [builder] block\n */\npublic suspend inline fun HttpClient.request(block: HttpRequestBuilder.() -> Unit): HttpResponse =\n request(HttpRequestBuilder().apply(block))\n\n/**\n * Prepares a [HttpClient] request, with the information configured in [builder] block\n */\npublic suspend inline fun HttpClient.prepareRequest(block: HttpRequestBuilder.() -> Unit): HttpStatement =\n prepareRequest(HttpRequestBuilder().apply(block))\n\n/**\n * Executes a [HttpClient] request, with the [urlString] and the information configured in builder [block]\n */\npublic suspend inline fun HttpClient.request(\n urlString: String,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpResponse = request {\n url(urlString)\n block()\n}\n\n/**\n * Prepares a [HttpClient] request, with the [urlString] and the information configured in builder [block]\n */\npublic suspend inline fun HttpClient.prepareRequest(\n urlString: String,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpStatement = prepareRequest {\n url(urlString)\n block()\n}\n\n/**\n * Executes a [HttpClient] request, with the [url] and the information configured in builder [block]\n */\npublic suspend inline fun HttpClient.request(\n url: Url,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpResponse = request {\n url(url)\n block()\n}\n\n/**\n * Prepares a [HttpClient] request, with the [url] and the information configured in builder [block]\n */\npublic suspend inline fun HttpClient.prepareRequest(\n url: Url,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpStatement = prepareRequest {\n url(url)\n block()\n}\n\n/**\n * Executes a [HttpClient] GET request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.get(builder: HttpRequestBuilder): HttpResponse {\n builder.method = HttpMethod.Get\n return request(builder)\n}\n\n/**\n * Executes a [HttpClient] POST request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.post(builder: HttpRequestBuilder): HttpResponse {\n builder.method = HttpMethod.Post\n return request(builder)\n}\n\n/**\n * Executes a [HttpClient] PUT request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.put(builder: HttpRequestBuilder): HttpResponse {\n builder.method = HttpMethod.Put\n return request(builder)\n}\n\n/**\n * Executes a [HttpClient] DELETE request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.delete(builder: HttpRequestBuilder): HttpResponse {\n builder.method = HttpMethod.Delete\n return request(builder)\n}\n\n/**\n * Executes a [HttpClient] OPTIONS request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.options(builder: HttpRequestBuilder): HttpResponse {\n builder.method = HttpMethod.Options\n return request(builder)\n}\n\n/**\n * Executes a [HttpClient] PATCH request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.patch(builder: HttpRequestBuilder): HttpResponse {\n builder.method = HttpMethod.Patch\n return request(builder)\n}\n\n/**\n * Executes a [HttpClient] HEAD request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.head(builder: HttpRequestBuilder): HttpResponse {\n builder.method = HttpMethod.Head\n return request(builder)\n}\n\n/**\n * Prepares a [HttpClient] GET request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.prepareGet(builder: HttpRequestBuilder): HttpStatement {\n builder.method = HttpMethod.Get\n return prepareRequest(builder)\n}\n\n/**\n * Prepares a [HttpClient] POST request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.preparePost(builder: HttpRequestBuilder): HttpStatement {\n builder.method = HttpMethod.Post\n return prepareRequest(builder)\n}\n\n/**\n * Prepares a [HttpClient] PUT request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.preparePut(builder: HttpRequestBuilder): HttpStatement {\n builder.method = HttpMethod.Put\n return prepareRequest(builder)\n}\n\n/**\n * Prepares a [HttpClient] DELETE request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.prepareDelete(builder: HttpRequestBuilder): HttpStatement {\n builder.method = HttpMethod.Delete\n return prepareRequest(builder)\n}\n\n/**\n * Prepares a [HttpClient] OPTIONS request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.prepareOptions(builder: HttpRequestBuilder): HttpStatement {\n builder.method = HttpMethod.Options\n return prepareRequest(builder)\n}\n\n/**\n * Prepares a [HttpClient] PATCH request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.preparePatch(builder: HttpRequestBuilder): HttpStatement {\n builder.method = HttpMethod.Patch\n return prepareRequest(builder)\n}\n\n/**\n * Prepares a [HttpClient] HEAD request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.prepareHead(builder: HttpRequestBuilder): HttpStatement {\n builder.method = HttpMethod.Head\n return prepareRequest(builder)\n}\n\n/**\n * Executes a [HttpClient] GET request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.get(block: HttpRequestBuilder.() -> Unit): HttpResponse =\n get(HttpRequestBuilder().apply(block))\n\n/**\n * Executes a [HttpClient] POST request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.post(block: HttpRequestBuilder.() -> Unit): HttpResponse =\n post(HttpRequestBuilder().apply(block))\n\n/**\n * Executes a [HttpClient] PUT request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.put(block: HttpRequestBuilder.() -> Unit): HttpResponse =\n put(HttpRequestBuilder().apply(block))\n\n/**\n * Executes a [HttpClient] DELETE request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.delete(block: HttpRequestBuilder.() -> Unit): HttpResponse =\n delete(HttpRequestBuilder().apply(block))\n\n/**\n * Executes a [HttpClient] OPTIONS request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.options(block: HttpRequestBuilder.() -> Unit): HttpResponse =\n options(HttpRequestBuilder().apply(block))\n\n/**\n * Executes a [HttpClient] PATCH request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.patch(block: HttpRequestBuilder.() -> Unit): HttpResponse =\n patch(HttpRequestBuilder().apply(block))\n\n/**\n * Executes a [HttpClient] HEAD request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.head(block: HttpRequestBuilder.() -> Unit): HttpResponse =\n head(HttpRequestBuilder().apply(block))\n\n/**\n * Prepares a [HttpClient] GET request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.prepareGet(block: HttpRequestBuilder.() -> Unit): HttpStatement =\n prepareGet(HttpRequestBuilder().apply(block))\n\n/**\n * Prepares a [HttpClient] POST request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.preparePost(block: HttpRequestBuilder.() -> Unit): HttpStatement =\n preparePost(HttpRequestBuilder().apply(block))\n\n/**\n * Prepares a [HttpClient] PUT request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.preparePut(block: HttpRequestBuilder.() -> Unit): HttpStatement =\n preparePut(HttpRequestBuilder().apply(block))\n\n/**\n * Prepares a [HttpClient] DELETE request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.prepareDelete(block: HttpRequestBuilder.() -> Unit): HttpStatement =\n prepareDelete(HttpRequestBuilder().apply(block))\n\n/**\n * Prepares a [HttpClient] OPTIONS request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.prepareOptions(block: HttpRequestBuilder.() -> Unit): HttpStatement =\n prepareOptions(HttpRequestBuilder().apply(block))\n\n/**\n * Prepares a [HttpClient] PATCH request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.preparePatch(block: HttpRequestBuilder.() -> Unit): HttpStatement =\n preparePatch(HttpRequestBuilder().apply(block))\n\n/**\n * Prepares a [HttpClient] HEAD request, with the information from the [builder]\n */\npublic suspend inline fun HttpClient.prepareHead(block: HttpRequestBuilder.() -> Unit): HttpStatement =\n prepareHead(HttpRequestBuilder().apply(block))\n\n/**\n * Creates a [HttpRequestBuilder] and configures it with a [block] of code.\n */\npublic fun request(block: HttpRequestBuilder.() -> Unit): HttpRequestBuilder =\n HttpRequestBuilder().apply(block)\n\n/**\n * Executes a [HttpClient] GET request, with the specified [url] as URL and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.get(\n urlString: String,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpResponse = get { url(urlString); block() }\n\n/**\n * Executes a [HttpClient] POST request, with the specified [url] as URL and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.post(\n urlString: String,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpResponse = post { url(urlString); block() }\n\n/**\n * Executes a [HttpClient] PUT request, with the specified [url] as URL and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.put(\n urlString: String,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpResponse = put { url(urlString); block() }\n\n/**\n * Executes a [HttpClient] DELETE request, with the specified [url] as URL and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.delete(\n urlString: String,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpResponse = delete { url(urlString); block() }\n\n/**\n * Executes a [HttpClient] OPTIONS request, with the specified [url] as URL and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.options(\n urlString: String,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpResponse = options { url(urlString); block() }\n\n/**\n * Executes a [HttpClient] PATCH request, with the specified [url] as URL and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.patch(\n urlString: String,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpResponse = patch { url(urlString); block() }\n\n/**\n * Executes a [HttpClient] HEAD request, with the specified [url] as URL and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.head(\n urlString: String,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpResponse = head { url(urlString); block() }\n\n/**\n * Prepares a [HttpClient] GET request, with the specified [url] as URL and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.prepareGet(\n urlString: String,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpStatement = prepareGet { url(urlString); block() }\n\n/**\n * Prepares a [HttpClient] POST request, with the specified [url] as URL and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.preparePost(\n urlString: String,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpStatement = preparePost { url(urlString); block() }\n\n/**\n * Prepares a [HttpClient] PUT request, with the specified [url] as URL and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.preparePut(\n urlString: String,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpStatement = preparePut { url(urlString); block() }\n\n/**\n * Prepares a [HttpClient] DELETE request, with the specified [url] as URL and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.prepareDelete(\n urlString: String,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpStatement = prepareDelete { url(urlString); block() }\n\n/**\n * Prepares a [HttpClient] OPTIONS request, with the specified [url] as URL and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.prepareOptions(\n urlString: String,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpStatement = prepareOptions { url(urlString); block() }\n\n/**\n * Prepares a [HttpClient] PATCH request, with the specified [url] as URL and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.preparePatch(\n urlString: String,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpStatement = preparePatch { url(urlString); block() }\n\n/**\n * Prepares a [HttpClient] HEAD request, with the specified [url] as URL and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.prepareHead(\n urlString: String,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpStatement = prepareHead { url(urlString); block() }\n",null,null,"/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.client.request\n\nimport io.ktor.client.utils.*\nimport io.ktor.http.content.*\nimport io.ktor.util.*\nimport io.ktor.util.reflect.*\n\ninternal val BodyTypeAttributeKey: AttributeKey = AttributeKey(\"BodyTypeAttributeKey\")\n\n@OptIn(InternalAPI::class)\npublic inline fun HttpRequestBuilder.setBody(body: T) {\n when (body) {\n null -> {\n this.body = NullBody\n bodyType = typeInfo()\n }\n is OutgoingContent -> {\n this.body = body\n bodyType = null\n }\n else -> {\n this.body = body\n bodyType = typeInfo()\n }\n }\n}\n\n@OptIn(InternalAPI::class)\npublic fun HttpRequestBuilder.setBody(body: Any?, bodyType: TypeInfo) {\n this.body = body ?: NullBody\n this.bodyType = bodyType\n}\n",null,null,null,null,null,null,"/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.call\n\nimport io.ktor.client.*\nimport io.ktor.client.request.*\nimport io.ktor.client.statement.*\nimport io.ktor.http.content.*\nimport io.ktor.util.*\nimport io.ktor.util.reflect.*\nimport io.ktor.utils.io.*\nimport io.ktor.utils.io.concurrent.*\nimport kotlinx.atomicfu.*\nimport kotlinx.coroutines.*\nimport kotlin.coroutines.*\nimport kotlin.reflect.*\n\n/**\n * A class that represents a single pair of [request] and [response] for a specific [HttpClient].\n *\n * @property client: client that executed the call.\n */\npublic open class HttpClientCall(\n public val client: HttpClient\n) : CoroutineScope {\n private val received: AtomicBoolean = atomic(false)\n\n override val coroutineContext: CoroutineContext get() = response.coroutineContext\n\n /**\n * Typed [Attributes] associated to this call serving as a lightweight container.\n */\n public val attributes: Attributes get() = request.attributes\n\n /**\n * Represents the [request] sent by the client\n */\n public lateinit var request: HttpRequest\n protected set\n\n /**\n * Represents the [response] sent by the server.\n */\n public lateinit var response: HttpResponse\n protected set\n\n @InternalAPI\n public constructor(\n client: HttpClient,\n requestData: HttpRequestData,\n responseData: HttpResponseData\n ) : this(client) {\n this.request = DefaultHttpRequest(this, requestData)\n this.response = DefaultHttpResponse(this, responseData)\n\n if (responseData.body !is ByteReadChannel) {\n @Suppress(\"DEPRECATION_ERROR\")\n attributes.put(CustomResponse, responseData.body)\n }\n }\n\n protected open val allowDoubleReceive: Boolean = false\n\n @OptIn(InternalAPI::class)\n protected open suspend fun getResponseContent(): ByteReadChannel = response.content\n\n /**\n * Tries to receive the payload of the [response] as a specific expected type provided in [info].\n * Returns [response] if [info] corresponds to [HttpResponse].\n *\n * @throws NoTransformationFoundException If no transformation is found for the type [info].\n * @throws DoubleReceiveException If already called [body].\n */\n @OptIn(InternalAPI::class)\n public suspend fun bodyNullable(info: TypeInfo): Any? {\n try {\n if (response.instanceOf(info.type)) return response\n if (!allowDoubleReceive && !received.compareAndSet(false, true)) {\n throw DoubleReceiveException(this)\n }\n\n @Suppress(\"DEPRECATION_ERROR\")\n val responseData = attributes.getOrNull(CustomResponse) ?: getResponseContent()\n\n val subject = HttpResponseContainer(info, responseData)\n val result = client.responsePipeline.execute(this, subject).response.takeIf { it != NullBody }\n\n if (result != null && !result.instanceOf(info.type)) {\n val from = result::class\n val to = info.type\n throw NoTransformationFoundException(response, from, to)\n }\n\n return result\n } catch (cause: Throwable) {\n response.cancel(\"Receive failed\", cause)\n throw cause\n } finally {\n response.complete()\n }\n }\n\n /**\n * Tries to receive the payload of the [response] as a specific expected type provided in [info].\n * Returns [response] if [info] corresponds to [HttpResponse].\n *\n * @throws NoTransformationFoundException If no transformation is found for the type [info].\n * @throws DoubleReceiveException If already called [body].\n * @throws NullPointerException If content is `null`.\n */\n @OptIn(InternalAPI::class)\n public suspend fun body(info: TypeInfo): Any = bodyNullable(info)!!\n\n override fun toString(): String = \"HttpClientCall[${request.url}, ${response.status}]\"\n\n internal fun setResponse(response: HttpResponse) {\n this.response = response\n }\n\n internal fun setRequest(request: HttpRequest) {\n this.request = request\n }\n\n public companion object {\n /**\n * [CustomResponse] key used to process the response of custom type in case of [HttpClientEngine] can't return body bytes directly.\n * If present, attribute value will be an initial value for [HttpResponseContainer] in [HttpClient.responsePipeline].\n *\n * Example: [WebSocketSession]\n */\n @Deprecated(\n \"This is going to be removed. Please file a ticket with clarification why and what for do you need it.\",\n level = DeprecationLevel.ERROR\n )\n public val CustomResponse: AttributeKey = AttributeKey(\"CustomResponse\")\n }\n}\n\n/**\n * Tries to receive the payload of the [response] as a specific type [T].\n *\n * @throws NoTransformationFoundException If no transformation is found for the type [T].\n * @throws DoubleReceiveException If already called [body].\n */\npublic suspend inline fun HttpClientCall.body(): T = bodyNullable(typeInfo()) as T\n\n/**\n * Tries to receive the payload of the [response] as a specific type [T].\n *\n * @throws NoTransformationFoundException If no transformation is found for the type [T].\n * @throws DoubleReceiveException If already called [body].\n */\npublic suspend inline fun HttpResponse.body(): T = call.bodyNullable(typeInfo()) as T\n\n/**\n * Tries to receive the payload of the [response] as a specific type [T] described in [typeInfo].\n *\n * @throws NoTransformationFoundException If no transformation is found for the type info [typeInfo].\n * @throws DoubleReceiveException If already called [body].\n */\n@Suppress(\"UNCHECKED_CAST\")\npublic suspend fun HttpResponse.body(typeInfo: TypeInfo): T = call.bodyNullable(typeInfo) as T\n\n/**\n * Exception representing that the response payload has already been received.\n */\n@Suppress(\"KDocMissingDocumentation\")\npublic class DoubleReceiveException(call: HttpClientCall) : IllegalStateException() {\n override val message: String = \"Response already received: $call\"\n}\n\n/**\n * Exception representing fail of the response pipeline\n * [cause] contains origin pipeline exception\n */\n@Suppress(\"KDocMissingDocumentation\", \"unused\")\npublic class ReceivePipelineException(\n public val request: HttpClientCall,\n public val info: TypeInfo,\n override val cause: Throwable\n) : IllegalStateException(\"Fail to run receive pipeline: $cause\")\n\n/**\n * Exception representing the no transformation was found.\n * It includes the received type and the expected type as part of the message.\n */\n@Suppress(\"KDocMissingDocumentation\")\npublic class NoTransformationFoundException(\n response: HttpResponse,\n from: KClass<*>,\n to: KClass<*>\n) : UnsupportedOperationException() {\n override val message: String? = \"\"\"No transformation found: $from -> $to\n |with response from ${response.request.url}:\n |status: ${response.status}\n |response headers: \n |${response.headers.flattenEntries().joinToString { (key, value) -> \"$key: $value\\n\" }}\n \"\"\".trimMargin()\n}\n",null,null,null,null,null,null,null,null,null,null,null,"/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.plugins\n\nimport io.ktor.client.*\nimport io.ktor.client.request.*\nimport io.ktor.client.statement.*\nimport io.ktor.http.*\nimport io.ktor.http.content.*\nimport io.ktor.util.*\nimport io.ktor.utils.io.*\nimport io.ktor.utils.io.core.*\nimport kotlinx.coroutines.*\nimport kotlinx.coroutines.CancellationException\n\n/**\n * Install default transformers.\n * Usually installed by default so there is no need to use it\n * unless you have disabled it via [HttpClientConfig.useDefaultTransformers].\n */\n@OptIn(InternalAPI::class)\npublic fun HttpClient.defaultTransformers() {\n requestPipeline.intercept(HttpRequestPipeline.Render) { body ->\n if (context.headers[HttpHeaders.Accept] == null) {\n context.headers.append(HttpHeaders.Accept, \"*/*\")\n }\n\n val contentType = context.contentType()\n val content = when (body) {\n is String -> {\n TextContent(body, contentType ?: ContentType.Text.Plain)\n }\n\n is ByteArray -> object : OutgoingContent.ByteArrayContent() {\n override val contentType: ContentType = contentType ?: ContentType.Application.OctetStream\n override val contentLength: Long = body.size.toLong()\n override fun bytes(): ByteArray = body\n }\n\n is ByteReadChannel -> object : OutgoingContent.ReadChannelContent() {\n override val contentLength = context.headers[HttpHeaders.ContentLength]?.toLong()\n override val contentType: ContentType = contentType ?: ContentType.Application.OctetStream\n override fun readFrom(): ByteReadChannel = body\n }\n\n is OutgoingContent -> body\n else -> platformRequestDefaultTransform(contentType, context, body)\n }\n if (content?.contentType != null) {\n context.headers.remove(HttpHeaders.ContentType)\n proceedWith(content)\n }\n }\n\n responsePipeline.intercept(HttpResponsePipeline.Parse) { (info, body) ->\n if (body !is ByteReadChannel) return@intercept\n val response = context.response\n\n when (info.type) {\n Unit::class -> {\n body.cancel()\n proceedWith(HttpResponseContainer(info, Unit))\n }\n\n Int::class -> {\n proceedWith(HttpResponseContainer(info, body.readRemaining().readText().toInt()))\n }\n\n ByteReadPacket::class,\n Input::class -> {\n proceedWith(HttpResponseContainer(info, body.readRemaining()))\n }\n\n ByteArray::class -> {\n val bytes = body.toByteArray()\n\n val contentLength = response.contentLength()\n val contentEncoding = response.headers[HttpHeaders.ContentEncoding]\n if (contentEncoding == null && contentLength != null && contentLength > 0) {\n check(bytes.size == contentLength.toInt()) { \"Expected $contentLength, actual ${bytes.size}\" }\n }\n proceedWith(HttpResponseContainer(info, bytes))\n }\n\n ByteReadChannel::class -> {\n // the response job could be already completed so the job holder\n // could be cancelled immediately, but it doesn't matter\n // since the copying job is running under the client job\n val responseJobHolder = Job(response.coroutineContext[Job])\n val channel: ByteReadChannel = writer(response.coroutineContext) {\n try {\n body.copyTo(channel, limit = Long.MAX_VALUE)\n } catch (cause: CancellationException) {\n response.cancel(cause)\n throw cause\n } catch (cause: Throwable) {\n response.cancel(\"Receive failed\", cause)\n throw cause\n } finally {\n response.complete()\n }\n }.also { writerJob ->\n writerJob.invokeOnCompletion {\n responseJobHolder.complete()\n }\n }.channel\n\n proceedWith(HttpResponseContainer(info, channel))\n }\n\n HttpStatusCode::class -> {\n body.cancel()\n proceedWith(HttpResponseContainer(info, response.status))\n }\n }\n }\n\n platformResponseDefaultTransformers()\n}\n\ninternal expect fun platformRequestDefaultTransform(\n contentType: ContentType?,\n context: HttpRequestBuilder,\n body: Any\n): OutgoingContent?\n\ninternal expect fun HttpClient.platformResponseDefaultTransformers()\n","/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.client.plugins\n\nimport io.ktor.client.*\nimport io.ktor.client.call.*\nimport io.ktor.client.request.*\nimport io.ktor.client.statement.*\nimport io.ktor.events.*\nimport io.ktor.http.*\nimport io.ktor.util.*\nimport kotlinx.coroutines.*\nimport kotlin.math.*\nimport kotlin.native.concurrent.*\nimport kotlin.random.*\n\n/**\n * A plugin that enables the client to retry failed requests.\n * The default retry policy is 3 retries with exponential delay.\n * Typical usages:\n * ```\n * // use predefined retry policies\n * install(HttpRequestRetry) {\n * retryOnServerErrors(maxRetries = 3)\n * exponentialDelay()\n * }\n *\n * // use custom policies\n * install(HttpRequestRetry) {\n * maxRetries = 5\n * retryIf { request, response -> !response.status.isSuccess() }\n * retryOnExceptionIf { request, cause -> cause is NetworkError }\n * delayMillis { retry -> retry * 3000 } // will retry in 3, 6, 9, etc. seconds\n * modifyRequest { it.headers.append(\"X_RETRY_COUNT\", retryCount.toString()) }\n * }\n * ```\n */\npublic class HttpRequestRetry internal constructor(configuration: Configuration) {\n\n /**\n * A context for [HttpRequestRetry.Configuration.shouldRetry]\n * and [HttpRequestRetry.Configuration.shouldRetryOnException]\n */\n public class ShouldRetryContext(\n /**\n * A retry count starting from 1\n */\n public val retryCount: Int\n )\n\n /**\n * A context for [HttpRequestRetry.Configuration.delayMillis].\n * Contains a non-null [response] or [cause] but not both.\n */\n public class DelayContext internal constructor(\n public val request: HttpRequestBuilder,\n public val response: HttpResponse?,\n public val cause: Throwable?\n )\n\n /**\n * A context for [HttpRequestRetry.Configuration.modifyRequest].\n * Contains a non-null [response] or [cause] but not both.\n */\n public class ModifyRequestContext internal constructor(\n /**\n * An original request\n */\n public val request: HttpRequestBuilder,\n public val response: HttpResponse?,\n public val cause: Throwable?,\n /**\n * A retry count that starts from 1\n */\n public val retryCount: Int,\n )\n\n /**\n * Data for the [HttpRequestRetryEvent] event. Contains a non-null [response] or [cause] but not both.\n */\n public class RetryEventData internal constructor(\n public val request: HttpRequestBuilder,\n public val retryCount: Int,\n public val response: HttpResponse?,\n public val cause: Throwable?\n )\n\n private val shouldRetry: ShouldRetryContext.(HttpRequest, HttpResponse) -> Boolean = configuration.shouldRetry\n private val shouldRetryOnException: ShouldRetryContext.(HttpRequestBuilder, Throwable) -> Boolean =\n configuration.shouldRetryOnException\n private val delayMillis: DelayContext.(Int) -> Long = configuration.delayMillis\n private val delay: suspend (Long) -> Unit = configuration.delay\n private val maxRetries: Int = configuration.maxRetries\n private val modifyRequest: ModifyRequestContext.(HttpRequestBuilder) -> Unit = configuration.modifyRequest\n\n /**\n * Contains [HttpRequestRetry] configurations settings.\n */\n @KtorDsl\n public class Configuration {\n internal lateinit var shouldRetry: ShouldRetryContext.(HttpRequest, HttpResponse) -> Boolean\n internal lateinit var shouldRetryOnException: ShouldRetryContext.(HttpRequestBuilder, Throwable) -> Boolean\n internal lateinit var delayMillis: DelayContext.(Int) -> Long\n internal var modifyRequest: ModifyRequestContext.(HttpRequestBuilder) -> Unit = {}\n internal var delay: suspend (Long) -> Unit = { kotlinx.coroutines.delay(it) }\n\n /**\n * The maximum amount of retries to perform for a request.\n */\n public var maxRetries: Int = 0\n\n init {\n retryOnExceptionOrServerErrors(3)\n exponentialDelay()\n }\n\n /**\n * Disables retry.\n */\n public fun noRetry() {\n maxRetries = 0\n shouldRetry = { _, _ -> false }\n shouldRetryOnException = { _, _ -> false }\n }\n\n /**\n * Modifies a request before retrying.\n */\n public fun modifyRequest(block: ModifyRequestContext.(HttpRequestBuilder) -> Unit) {\n modifyRequest = block\n }\n\n /**\n * Specifies retry logic for a response. The [block] accepts [HttpRequest] and [HttpResponse]\n * and should return `true` if this request should be retried.\n */\n public fun retryIf(maxRetries: Int = -1, block: ShouldRetryContext.(HttpRequest, HttpResponse) -> Boolean) {\n if (maxRetries != -1) this.maxRetries = maxRetries\n shouldRetry = block\n }\n\n /**\n * Specifies retry logic for failed requests. The [block] accepts [HttpRequestBuilder]\n * and [Throwable] and should return true if this request should be retried.\n */\n public fun retryOnExceptionIf(\n maxRetries: Int = -1,\n block: ShouldRetryContext.(HttpRequestBuilder, Throwable) -> Boolean\n ) {\n if (maxRetries != -1) this.maxRetries = maxRetries\n shouldRetryOnException = block\n }\n\n /**\n * Enables retrying a request if an exception is thrown during the [HttpSend] phase\n * and specifies the number of retries.\n */\n public fun retryOnException(maxRetries: Int = -1) {\n retryOnExceptionIf(maxRetries) { _, cause -> cause !is CancellationException }\n }\n\n /**\n * Enables retrying a request if a 5xx response is received from a server\n * and specifies the number of retries.\n */\n public fun retryOnServerErrors(maxRetries: Int = -1) {\n retryIf(maxRetries) { _, response ->\n response.status.value.let { it in 500..599 }\n }\n }\n\n /**\n * Enables retrying a request if an exception is thrown during the [HttpSend] phase\n * or a 5xx response is received and specifies the number of retries.\n */\n public fun retryOnExceptionOrServerErrors(maxRetries: Int = -1) {\n retryOnServerErrors(maxRetries)\n retryOnException(maxRetries)\n }\n\n /**\n * Specifies delay logic for retries. The [block] accepts the number of retries\n * and should return the number of milliseconds to wait before retrying.\n */\n public fun delayMillis(\n respectRetryAfterHeader: Boolean = true,\n block: DelayContext.(retry: Int) -> Long\n ) {\n delayMillis = {\n if (respectRetryAfterHeader) {\n val retryAfter = response?.headers?.get(HttpHeaders.RetryAfter)?.toLongOrNull()?.times(1000)\n maxOf(block(it), retryAfter ?: 0)\n } else {\n block(it)\n }\n }\n }\n\n /**\n * Specifies a constant delay between retries.\n * This delay equals to `millis + [0..randomizationMs]` milliseconds.\n */\n public fun constantDelay(\n millis: Long = 1000,\n randomizationMs: Long = 1000,\n respectRetryAfterHeader: Boolean = true\n ) {\n check(millis > 0)\n check(randomizationMs >= 0)\n\n delayMillis(respectRetryAfterHeader) {\n millis + randomMs(randomizationMs)\n }\n }\n\n /**\n * Specifies an exponential delay between retries, which is calculated using the Exponential backoff algorithm.\n * This delay equals to `base ^ retryCount * 1000 + [0..randomizationMs]`\n */\n public fun exponentialDelay(\n base: Double = 2.0,\n maxDelayMs: Long = 60000,\n randomizationMs: Long = 1000,\n respectRetryAfterHeader: Boolean = true\n ) {\n check(base > 0)\n check(maxDelayMs > 0)\n check(randomizationMs >= 0)\n\n delayMillis(respectRetryAfterHeader) { retry ->\n val delay = minOf(base.pow(retry).toLong() * 1000L, maxDelayMs)\n delay + randomMs(randomizationMs)\n }\n }\n\n /**\n * A function that waits for the specified amount of milliseconds. Uses [kotlinx.coroutines.delay] by default.\n * Useful for tests.\n */\n public fun delay(block: suspend (Long) -> Unit) {\n delay = block\n }\n\n private fun randomMs(randomizationMs: Long): Long =\n if (randomizationMs == 0L) 0L else Random.nextLong(randomizationMs)\n }\n\n internal fun intercept(client: HttpClient) {\n client.plugin(HttpSend).intercept { request ->\n var retryCount = 0\n val shouldRetry = request.attributes.getOrNull(ShouldRetryPerRequestAttributeKey) ?: shouldRetry\n val shouldRetryOnException =\n request.attributes.getOrNull(ShouldRetryOnExceptionPerRequestAttributeKey) ?: shouldRetryOnException\n val maxRetries = request.attributes.getOrNull(MaxRetriesPerRequestAttributeKey) ?: maxRetries\n val delayMillis = request.attributes.getOrNull(RetryDelayPerRequestAttributeKey) ?: delayMillis\n val modifyRequest = request.attributes.getOrNull(ModifyRequestPerRequestAttributeKey) ?: modifyRequest\n\n var call: HttpClientCall\n var lastRetryData: RetryEventData? = null\n while (true) {\n val subRequest = prepareRequest(request)\n\n val retryData = try {\n if (lastRetryData != null) {\n val modifyRequestContext = ModifyRequestContext(\n request,\n lastRetryData.response,\n lastRetryData.cause,\n lastRetryData.retryCount\n )\n modifyRequest(modifyRequestContext, subRequest)\n }\n call = execute(subRequest)\n if (!shouldRetry(retryCount, maxRetries, shouldRetry, call)) {\n break\n }\n RetryEventData(subRequest, ++retryCount, call.response, null)\n } catch (cause: Throwable) {\n if (!shouldRetryOnException(retryCount, maxRetries, shouldRetryOnException, subRequest, cause)) {\n throw cause\n }\n RetryEventData(subRequest, ++retryCount, null, cause)\n }\n\n lastRetryData = retryData\n client.monitor.raise(HttpRequestRetryEvent, lastRetryData)\n\n val delayContext = DelayContext(lastRetryData.request, lastRetryData.response, lastRetryData.cause)\n delay(delayMillis(delayContext, retryCount))\n }\n call\n }\n }\n\n private fun shouldRetry(\n retryCount: Int,\n maxRetries: Int,\n shouldRetry: ShouldRetryContext.(HttpRequest, HttpResponse) -> Boolean,\n call: HttpClientCall\n ) = retryCount < maxRetries && shouldRetry(ShouldRetryContext(retryCount + 1), call.request, call.response)\n\n private fun shouldRetryOnException(\n retryCount: Int,\n maxRetries: Int,\n shouldRetry: ShouldRetryContext.(HttpRequestBuilder, Throwable) -> Boolean,\n subRequest: HttpRequestBuilder,\n cause: Throwable\n ) = retryCount < maxRetries && shouldRetry(ShouldRetryContext(retryCount + 1), subRequest, cause)\n\n private fun prepareRequest(request: HttpRequestBuilder): HttpRequestBuilder {\n val subRequest = HttpRequestBuilder().takeFrom(request)\n val subRequestJob = Job()\n subRequest.executionContext = subRequestJob\n CoroutineScope(request.executionContext).launch {\n subRequestJob.join()\n }\n request.executionContext.invokeOnCompletion {\n when (it) {\n null -> subRequestJob.complete()\n else -> subRequestJob.completeExceptionally(it)\n }\n }\n return subRequest\n }\n\n public companion object Plugin : HttpClientPlugin {\n override val key: AttributeKey = AttributeKey(\"RetryFeature\")\n\n /**\n * Occurs on request retry.\n */\n public val HttpRequestRetryEvent: EventDefinition = EventDefinition()\n\n override fun prepare(block: Configuration.() -> Unit): HttpRequestRetry {\n val configuration = Configuration().apply(block)\n return HttpRequestRetry(configuration)\n }\n\n override fun install(plugin: HttpRequestRetry, scope: HttpClient) {\n plugin.intercept(scope)\n }\n }\n}\n\n/**\n * Configures the [HttpRequestRetry] plugin on a per-request level.\n */\npublic fun HttpRequestBuilder.retry(block: HttpRequestRetry.Configuration.() -> Unit) {\n val configuration = HttpRequestRetry.Configuration().apply(block)\n attributes.put(ShouldRetryPerRequestAttributeKey, configuration.shouldRetry)\n attributes.put(ShouldRetryOnExceptionPerRequestAttributeKey, configuration.shouldRetryOnException)\n attributes.put(RetryDelayPerRequestAttributeKey, configuration.delayMillis)\n attributes.put(MaxRetriesPerRequestAttributeKey, configuration.maxRetries)\n attributes.put(ModifyRequestPerRequestAttributeKey, configuration.modifyRequest)\n}\n\nprivate val MaxRetriesPerRequestAttributeKey =\n AttributeKey(\"MaxRetriesPerRequestAttributeKey\")\n\nprivate val ShouldRetryPerRequestAttributeKey =\n AttributeKey Boolean>(\n \"ShouldRetryPerRequestAttributeKey\"\n )\n\nprivate val ShouldRetryOnExceptionPerRequestAttributeKey =\n AttributeKey Boolean>(\n \"ShouldRetryOnExceptionPerRequestAttributeKey\"\n )\n\nprivate val ModifyRequestPerRequestAttributeKey =\n AttributeKey Unit>(\n \"ModifyRequestPerRequestAttributeKey\"\n )\n\nprivate val RetryDelayPerRequestAttributeKey =\n AttributeKey Long>(\n \"RetryDelayPerRequestAttributeKey\"\n )\n","package io.ktor.websocket.serialization\n\nimport io.ktor.serialization.*\nimport io.ktor.util.reflect.*\nimport io.ktor.utils.io.charsets.*\nimport io.ktor.websocket.*\n\n/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\n/**\n * Serializes [data] to a frame and enqueues this frame.\n * May suspend if the [outgoing] queue is full.\n * If the [outgoing] channel is already closed, throws an exception, so it is impossible to transfer any message.\n * Frames sent after a Close frame are silently ignored.\n * Note that a Close frame could be sent automatically in reply to a peer's Close frame unless it is a raw WebSocket session.\n *\n * @param data The data to serialize\n * @param converter The WebSocket converter\n * @param charset Response charset\n */\npublic suspend inline fun WebSocketSession.sendSerializedBase(\n data: T,\n converter: WebsocketContentConverter,\n charset: Charset\n) {\n val serializedData = converter.serializeNullable(\n charset = charset,\n typeInfo = typeInfo(),\n value = data\n )\n outgoing.send(serializedData)\n}\n\n/**\n * Dequeues a frame and deserializes it to the type [T] using [converter].\n * May throw [WebsocketDeserializeException] if the received frame type is not [Frame.Text] or [Frame.Binary].\n * In this case, [WebsocketDeserializeException.frame] contains the received frame.\n * May throw [ClosedReceiveChannelException] if a channel was closed\n *\n * @param converter The WebSocket converter\n * @param charset Response charset\n *\n * @returns A deserialized value or throws [WebsocketDeserializeException] if the [converter]\n * can't deserialize frame data to type [T]\n */\npublic suspend inline fun WebSocketSession.receiveDeserializedBase(\n converter: WebsocketContentConverter,\n charset: Charset\n): Any? {\n val frame = incoming.receive()\n\n if (!converter.isApplicable(frame)) {\n throw WebsocketDeserializeException(\n \"Converter doesn't support frame type ${frame.frameType.name}\",\n frame = frame\n )\n }\n\n val typeInfo = typeInfo()\n val result = converter.deserialize(\n charset = charset,\n typeInfo = typeInfo,\n content = frame\n )\n\n if (result is T) return result\n if (result == null) {\n if (typeInfo.kotlinType?.isMarkedNullable == true) return null\n throw WebsocketDeserializeException(\"Frame has null content\", frame = frame)\n }\n\n throw WebsocketDeserializeException(\n \"Can't deserialize value : expected value of type ${T::class.simpleName},\" +\n \" got ${result::class.simpleName}\",\n frame = frame\n )\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.plugins.websocket\n\nimport io.ktor.client.*\nimport io.ktor.client.call.*\nimport io.ktor.client.engine.*\nimport io.ktor.client.plugins.*\nimport io.ktor.client.request.*\nimport io.ktor.client.statement.*\nimport io.ktor.http.*\nimport io.ktor.serialization.*\nimport io.ktor.util.*\nimport io.ktor.websocket.*\nimport kotlin.native.concurrent.*\n\nprivate val REQUEST_EXTENSIONS_KEY = AttributeKey>>(\"Websocket extensions\")\n\n/**\n * Indicates if a client engine supports WebSockets.\n */\npublic object WebSocketCapability : HttpClientEngineCapability {\n override fun toString(): String = \"WebSocketCapability\"\n}\n\n/**\n * Indicates if a client engine supports extensions for WebSocket plugin.\n */\npublic object WebSocketExtensionsCapability : HttpClientEngineCapability {\n override fun toString(): String = \"WebSocketExtensionsCapability\"\n}\n\n/**\n * Client WebSocket plugin.\n *\n * @property pingInterval - interval between [FrameType.PING] messages.\n * @property maxFrameSize - max size of a single websocket frame.\n * @property extensionsConfig - extensions configuration\n * @property contentConverter - converter for serialization/deserialization\n */\npublic class WebSockets internal constructor(\n public val pingInterval: Long,\n public val maxFrameSize: Long,\n private val extensionsConfig: WebSocketExtensionsConfig,\n public val contentConverter: WebsocketContentConverter? = null\n) {\n /**\n * Client WebSocket plugin.\n *\n * @property pingInterval - interval between [FrameType.PING] messages.\n * @property maxFrameSize - max size of single websocket frame.\n */\n public constructor(\n pingInterval: Long = -1L,\n maxFrameSize: Long = Int.MAX_VALUE.toLong(),\n ) : this(pingInterval, maxFrameSize, WebSocketExtensionsConfig())\n\n /**\n * Client WebSocket plugin.\n */\n public constructor() : this(-1L, Int.MAX_VALUE.toLong(), WebSocketExtensionsConfig())\n\n private fun installExtensions(context: HttpRequestBuilder) {\n val installed = extensionsConfig.build()\n context.attributes.put(REQUEST_EXTENSIONS_KEY, installed)\n\n val protocols = installed.flatMap { it.protocols }\n addNegotiatedProtocols(context, protocols)\n }\n\n @Suppress(\"UNCHECKED_CAST\")\n private fun completeNegotiation(\n call: HttpClientCall\n ): List> {\n val serverExtensions: List = call.response\n .headers[HttpHeaders.SecWebSocketExtensions]\n ?.let { parseWebSocketExtensions(it) } ?: emptyList()\n\n val clientExtensions = call.attributes[REQUEST_EXTENSIONS_KEY]\n\n return clientExtensions.filter { it.clientNegotiation(serverExtensions) }\n }\n\n private fun addNegotiatedProtocols(context: HttpRequestBuilder, protocols: List) {\n if (protocols.isEmpty()) return\n\n val headerValue = protocols.joinToString(\";\")\n context.header(HttpHeaders.SecWebSocketExtensions, headerValue)\n }\n\n internal fun convertSessionToDefault(session: WebSocketSession): DefaultWebSocketSession {\n if (session is DefaultWebSocketSession) return session\n\n return DefaultWebSocketSession(session, pingInterval, timeoutMillis = pingInterval * 2).also {\n it.maxFrameSize = this@WebSockets.maxFrameSize\n }\n }\n\n /**\n * [WebSockets] configuration.\n */\n @KtorDsl\n public class Config {\n internal val extensionsConfig: WebSocketExtensionsConfig = WebSocketExtensionsConfig()\n\n /**\n * Sets interval of sending ping frames.\n *\n * Value -1L is for disabled ping.\n */\n public var pingInterval: Long = -1L\n\n /**\n * Sets maximum frame size in bytes.\n */\n public var maxFrameSize: Long = Int.MAX_VALUE.toLong()\n\n /**\n * A converter for serialization/deserialization\n */\n public var contentConverter: WebsocketContentConverter? = null\n\n /**\n * Configure WebSocket extensions.\n */\n public fun extensions(block: WebSocketExtensionsConfig.() -> Unit) {\n extensionsConfig.apply(block)\n }\n }\n\n /**\n * Add WebSockets support for ktor http client.\n */\n public companion object Plugin : HttpClientPlugin {\n override val key: AttributeKey = AttributeKey(\"Websocket\")\n\n override fun prepare(block: Config.() -> Unit): WebSockets {\n val config = Config().apply(block)\n return WebSockets(\n config.pingInterval,\n config.maxFrameSize,\n config.extensionsConfig,\n config.contentConverter\n )\n }\n\n @OptIn(InternalAPI::class)\n override fun install(plugin: WebSockets, scope: HttpClient) {\n val extensionsSupported = scope.engine.supportedCapabilities.contains(WebSocketExtensionsCapability)\n\n scope.requestPipeline.intercept(HttpRequestPipeline.Render) {\n if (!context.url.protocol.isWebsocket()) return@intercept\n context.setCapability(WebSocketCapability, Unit)\n\n if (extensionsSupported) {\n plugin.installExtensions(context)\n }\n\n proceedWith(WebSocketContent())\n }\n\n scope.responsePipeline.intercept(HttpResponsePipeline.Transform) { (info, session) ->\n if (session !is WebSocketSession) return@intercept\n\n val clientSession: ClientWebSocketSession = when (info.type) {\n DefaultClientWebSocketSession::class -> {\n val defaultSession = plugin.convertSessionToDefault(session)\n val clientSession = DefaultClientWebSocketSession(context, defaultSession)\n\n val negotiated = if (extensionsSupported) {\n plugin.completeNegotiation(context)\n } else emptyList()\n\n clientSession.apply {\n start(negotiated)\n }\n }\n else -> DelegatingClientWebSocketSession(context, session)\n }\n\n val response = HttpResponseContainer(info, clientSession)\n proceedWith(response)\n }\n }\n }\n}\n\n@Suppress(\"KDocMissingDocumentation\")\npublic class WebSocketException(message: String) : IllegalStateException(message)\n","/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.client.call\n\nimport io.ktor.client.statement.*\nimport io.ktor.util.reflect.*\n\n/**\n * Tries to receive the payload of the [response] as a specific type [T].\n *\n * @throws NoTransformationFoundException If no transformation is found for the type [T].\n * @throws DoubleReceiveException If already called [receive].\n */\n@Deprecated(\"Use `body` method instead\", replaceWith = ReplaceWith(\"this.body()\"), level = DeprecationLevel.ERROR)\npublic suspend inline fun HttpClientCall.receive(): T = error(\"Use `body` method instead\")\n\n/**\n * Tries to receive the payload of the [response] as a specific type [T].\n *\n * @throws NoTransformationFoundException If no transformation is found for the type [T].\n * @throws DoubleReceiveException If already called [receive].\n */\n@Deprecated(\"Use `body` method instead\", replaceWith = ReplaceWith(\"this.body()\"), level = DeprecationLevel.ERROR)\npublic suspend inline fun HttpResponse.receive(): T = error(\"Use `body` method instead\")\n\n/**\n * Tries to receive the payload of the [response] as a specific expected type provided in [info].\n * Returns [response] if [info] corresponds to [HttpResponse].\n *\n * @throws NoTransformationFoundException If no transformation is found for the type [info].\n * @throws DoubleReceiveException If already called [receive].\n */\n@Suppress(\"UNUSED_PARAMETER\")\n@Deprecated(\"Use `body` method instead\", replaceWith = ReplaceWith(\"this.body(info)\"), level = DeprecationLevel.ERROR)\npublic suspend fun HttpClientCall.receive(info: TypeInfo): Any = error(\"Use `body` method instead\")\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.call\n\nimport io.ktor.client.*\nimport io.ktor.client.request.*\nimport io.ktor.client.statement.*\nimport io.ktor.http.*\nimport io.ktor.util.*\nimport io.ktor.util.date.*\nimport io.ktor.utils.io.*\nimport io.ktor.utils.io.core.*\nimport kotlinx.coroutines.*\nimport kotlin.coroutines.*\n\ninternal class SavedHttpCall(\n client: HttpClient,\n request: HttpRequest,\n response: HttpResponse,\n private val responseBody: ByteArray\n) : HttpClientCall(client) {\n\n init {\n this.request = SavedHttpRequest(this, request)\n this.response = SavedHttpResponse(this, responseBody, response)\n }\n\n /**\n * Returns a channel with [responseBody] data.\n */\n override suspend fun getResponseContent(): ByteReadChannel {\n return ByteReadChannel(responseBody)\n }\n\n override val allowDoubleReceive: Boolean = true\n}\n\ninternal class SavedHttpRequest(\n override val call: SavedHttpCall,\n origin: HttpRequest\n) : HttpRequest by origin\n\ninternal class SavedHttpResponse(\n override val call: SavedHttpCall,\n body: ByteArray,\n origin: HttpResponse\n) : HttpResponse() {\n private val context = Job()\n\n override val status: HttpStatusCode = origin.status\n\n override val version: HttpProtocolVersion = origin.version\n\n override val requestTime: GMTDate = origin.requestTime\n\n override val responseTime: GMTDate = origin.responseTime\n\n override val headers: Headers = origin.headers\n\n override val coroutineContext: CoroutineContext = origin.coroutineContext + context\n\n @OptIn(InternalAPI::class)\n override val content: ByteReadChannel = ByteReadChannel(body)\n}\n\n/**\n * Fetch data for [HttpClientCall] and close the origin.\n */\n@OptIn(InternalAPI::class)\npublic suspend fun HttpClientCall.save(): HttpClientCall {\n val responseBody = response.content.readRemaining().readBytes()\n\n return SavedHttpCall(client, request, response, responseBody)\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.engine\n\nimport io.ktor.client.utils.*\nimport io.ktor.http.*\nimport io.ktor.http.content.*\nimport io.ktor.util.*\nimport kotlinx.coroutines.*\nimport kotlin.coroutines.*\n\n/**\n * Default user agent to use in ktor client.\n */\n@InternalAPI\npublic val KTOR_DEFAULT_USER_AGENT: String = \"Ktor client\"\n\nprivate val DATE_HEADERS = setOf(\n HttpHeaders.Date,\n HttpHeaders.Expires,\n HttpHeaders.LastModified,\n HttpHeaders.IfModifiedSince,\n HttpHeaders.IfUnmodifiedSince\n)\n\n/**\n * Merge headers from [content] and [requestHeaders] according to [OutgoingContent] properties\n */\n@InternalAPI\npublic fun mergeHeaders(\n requestHeaders: Headers,\n content: OutgoingContent,\n block: (key: String, value: String) -> Unit\n) {\n buildHeaders {\n appendAll(requestHeaders)\n appendAll(content.headers)\n }.forEach { key, values ->\n if (HttpHeaders.ContentLength == key) return@forEach // set later\n if (HttpHeaders.ContentType == key) return@forEach // set later\n\n // https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2\n if (DATE_HEADERS.contains(key)) {\n values.forEach { value ->\n block(key, value)\n }\n } else {\n block(key, values.joinToString(\",\"))\n }\n }\n\n val missingAgent = requestHeaders[HttpHeaders.UserAgent] == null && content.headers[HttpHeaders.UserAgent] == null\n if (missingAgent && needUserAgent()) {\n block(HttpHeaders.UserAgent, KTOR_DEFAULT_USER_AGENT)\n }\n\n val type = content.contentType?.toString()\n ?: content.headers[HttpHeaders.ContentType]\n ?: requestHeaders[HttpHeaders.ContentType]\n\n val length = content.contentLength?.toString()\n ?: content.headers[HttpHeaders.ContentLength]\n ?: requestHeaders[HttpHeaders.ContentLength]\n\n type?.let { block(HttpHeaders.ContentType, it) }\n length?.let { block(HttpHeaders.ContentLength, it) }\n}\n\n/**\n * Returns current call context if exists, otherwise null.\n */\n@InternalAPI\npublic suspend fun callContext(): CoroutineContext = coroutineContext[KtorCallContextElement]!!.callContext\n\n/**\n * Coroutine context element containing call job.\n */\ninternal class KtorCallContextElement(val callContext: CoroutineContext) : CoroutineContext.Element {\n override val key: CoroutineContext.Key<*>\n get() = KtorCallContextElement\n\n public companion object : CoroutineContext.Key\n}\n\n/**\n * Attach [callJob] to user job using the following logic: when user job completes with exception, [callJob] completes\n * with exception too.\n */\n@OptIn(InternalCoroutinesApi::class)\ninternal suspend inline fun attachToUserJob(callJob: Job) {\n val userJob = coroutineContext[Job] ?: return\n\n val cleanupHandler = userJob.invokeOnCompletion(onCancelling = true) { cause ->\n cause ?: return@invokeOnCompletion\n callJob.cancel(CancellationException(cause.message))\n }\n\n callJob.invokeOnCompletion {\n cleanupHandler.dispose()\n }\n}\n\nprivate fun needUserAgent(): Boolean = !PlatformUtils.IS_BROWSER\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.plugins\n\nimport io.ktor.client.*\nimport io.ktor.util.*\nimport kotlin.native.concurrent.*\n\ninternal val PLUGIN_INSTALLED_LIST = AttributeKey(\"ApplicationPluginRegistry\")\n\n/**\n * Base interface representing a [HttpClient] plugin.\n */\npublic interface HttpClientPlugin {\n /**\n * The [AttributeKey] for this plugin.\n */\n public val key: AttributeKey\n\n /**\n * Builds a [TPlugin] by calling the [block] with a [TConfig] config instance as receiver.\n */\n public fun prepare(block: TConfig.() -> Unit = {}): TPlugin\n\n /**\n * Installs the [plugin] class for a [HttpClient] defined at [scope].\n */\n public fun install(plugin: TPlugin, scope: HttpClient)\n}\n\n/**\n * Returns a [plugin] installed in this client. Returns `null` if the plugin was not previously installed.\n */\npublic fun HttpClient.pluginOrNull(plugin: HttpClientPlugin): F? =\n attributes.getOrNull(PLUGIN_INSTALLED_LIST)?.getOrNull(plugin.key)\n\n/**\n * Returns a [plugin] installed in [HttpClient].\n *\n * @throws [IllegalStateException] if [plugin] is not installed.\n */\npublic fun HttpClient.plugin(plugin: HttpClientPlugin): F {\n return pluginOrNull(plugin) ?: throw IllegalStateException(\n \"Plugin $plugin is not installed. Consider using `install(${plugin.key})` in client config first.\"\n )\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.plugins\n\nimport io.ktor.client.*\nimport io.ktor.client.engine.*\nimport io.ktor.client.network.sockets.*\nimport io.ktor.client.request.*\nimport io.ktor.client.utils.*\nimport io.ktor.http.*\nimport io.ktor.util.*\nimport io.ktor.utils.io.errors.*\nimport kotlinx.coroutines.*\n\n/**\n * A plugin that allows you to configure the following timeouts:\n * - __request timeout__ — a time period required to process an HTTP call: from sending a request to receiving a response.\n * - __connection timeout__ — a time period in which a client should establish a connection with a server.\n * - __socket timeout__ — a maximum time of inactivity between two data packets when exchanging data with a server.\n *\n * You can learn more from [Timeout](https://ktor.io/docs/timeout.html).\n */\npublic class HttpTimeout private constructor(\n private val requestTimeoutMillis: Long?,\n private val connectTimeoutMillis: Long?,\n private val socketTimeoutMillis: Long?\n) {\n /**\n * An [HttpTimeout] extension configuration that is used during installation.\n */\n @KtorDsl\n public class HttpTimeoutCapabilityConfiguration {\n private var _requestTimeoutMillis: Long? = 0\n private var _connectTimeoutMillis: Long? = 0\n private var _socketTimeoutMillis: Long? = 0\n\n /**\n * Creates a new instance of [HttpTimeoutCapabilityConfiguration].\n */\n public constructor(\n requestTimeoutMillis: Long? = null,\n connectTimeoutMillis: Long? = null,\n socketTimeoutMillis: Long? = null\n ) {\n this.requestTimeoutMillis = requestTimeoutMillis\n this.connectTimeoutMillis = connectTimeoutMillis\n this.socketTimeoutMillis = socketTimeoutMillis\n }\n\n /**\n * Specifies a request timeout in milliseconds.\n * The request timeout is the time period required to process an HTTP call: from sending a request to receiving a response.\n */\n public var requestTimeoutMillis: Long?\n get() = _requestTimeoutMillis\n set(value) {\n _requestTimeoutMillis = checkTimeoutValue(value)\n }\n\n /**\n * Specifies a connection timeout in milliseconds.\n * The connection timeout is the time period in which a client should establish a connection with a server.\n */\n public var connectTimeoutMillis: Long?\n get() = _connectTimeoutMillis\n set(value) {\n _connectTimeoutMillis = checkTimeoutValue(value)\n }\n\n /**\n * Specifies a socket timeout (read and write) in milliseconds.\n * The socket timeout is the maximum time of inactivity between two data packets when exchanging data with a server.\n */\n public var socketTimeoutMillis: Long?\n get() = _socketTimeoutMillis\n set(value) {\n _socketTimeoutMillis = checkTimeoutValue(value)\n }\n\n internal fun build(): HttpTimeout = HttpTimeout(requestTimeoutMillis, connectTimeoutMillis, socketTimeoutMillis)\n\n private fun checkTimeoutValue(value: Long?): Long? {\n require(value == null || value > 0) {\n \"Only positive timeout values are allowed, for infinite timeout use HttpTimeout.INFINITE_TIMEOUT_MS\"\n }\n return value\n }\n\n override fun equals(other: Any?): Boolean {\n if (this === other) return true\n if (other == null || this::class != other::class) return false\n\n other as HttpTimeoutCapabilityConfiguration\n\n if (_requestTimeoutMillis != other._requestTimeoutMillis) return false\n if (_connectTimeoutMillis != other._connectTimeoutMillis) return false\n if (_socketTimeoutMillis != other._socketTimeoutMillis) return false\n\n return true\n }\n\n override fun hashCode(): Int {\n var result = _requestTimeoutMillis?.hashCode() ?: 0\n result = 31 * result + (_connectTimeoutMillis?.hashCode() ?: 0)\n result = 31 * result + (_socketTimeoutMillis?.hashCode() ?: 0)\n return result\n }\n\n public companion object {\n public val key: AttributeKey = AttributeKey(\"TimeoutConfiguration\")\n }\n }\n\n /**\n * Utils method that return `true` if at least one timeout is configured (has not null value).\n */\n private fun hasNotNullTimeouts() =\n requestTimeoutMillis != null || connectTimeoutMillis != null || socketTimeoutMillis != null\n\n /**\n * A companion object for a plugin installation.\n */\n public companion object Plugin :\n HttpClientPlugin,\n HttpClientEngineCapability {\n\n override val key: AttributeKey = AttributeKey(\"TimeoutPlugin\")\n\n /**\n * An infinite timeout in milliseconds.\n */\n public const val INFINITE_TIMEOUT_MS: Long = Long.MAX_VALUE\n\n override fun prepare(block: HttpTimeoutCapabilityConfiguration.() -> Unit): HttpTimeout =\n HttpTimeoutCapabilityConfiguration().apply(block).build()\n\n @OptIn(InternalAPI::class)\n override fun install(plugin: HttpTimeout, scope: HttpClient) {\n scope.requestPipeline.intercept(HttpRequestPipeline.Before) {\n val isWebSocket = context.url.protocol.isWebsocket()\n if (isWebSocket || context.body is ClientUpgradeContent) return@intercept\n\n var configuration = context.getCapabilityOrNull(HttpTimeout)\n if (configuration == null && plugin.hasNotNullTimeouts()) {\n configuration = HttpTimeoutCapabilityConfiguration()\n context.setCapability(HttpTimeout, configuration)\n }\n\n configuration?.apply {\n val context = this@intercept.context\n connectTimeoutMillis = connectTimeoutMillis ?: plugin.connectTimeoutMillis\n socketTimeoutMillis = socketTimeoutMillis ?: plugin.socketTimeoutMillis\n requestTimeoutMillis = requestTimeoutMillis ?: plugin.requestTimeoutMillis\n\n val requestTimeout = requestTimeoutMillis ?: plugin.requestTimeoutMillis\n if (requestTimeout == null || requestTimeout == INFINITE_TIMEOUT_MS) return@apply\n\n val executionContext = context.executionContext\n val killer = scope.launch {\n delay(requestTimeout)\n val cause = HttpRequestTimeoutException(context)\n executionContext.cancel(cause.message!!, cause)\n }\n\n context.executionContext.invokeOnCompletion {\n killer.cancel()\n }\n }\n }\n }\n }\n}\n\n/**\n * Adds timeout boundaries to the request. Requires the [HttpTimeout] plugin to be installed.\n */\npublic fun HttpRequestBuilder.timeout(block: HttpTimeout.HttpTimeoutCapabilityConfiguration.() -> Unit): Unit =\n setCapability(HttpTimeout, HttpTimeout.HttpTimeoutCapabilityConfiguration().apply(block))\n\n/**\n * This exception is thrown in case the request timeout is exceeded.\n * The request timeout is the time period required to process an HTTP call: from sending a request to receiving a response.\n */\npublic class HttpRequestTimeoutException(\n url: String,\n timeoutMillis: Long?\n) : IOException(\"Request timeout has expired [url=$url, request_timeout=${timeoutMillis ?: \"unknown\"} ms]\") {\n\n public constructor(request: HttpRequestBuilder) : this(\n request.url.buildString(),\n request.getCapabilityOrNull(HttpTimeout)?.requestTimeoutMillis\n )\n\n public constructor(request: HttpRequestData) : this(\n request.url.toString(),\n request.getCapabilityOrNull(HttpTimeout)?.requestTimeoutMillis\n )\n}\n\n/**\n * This exception is thrown in case the connection timeout is exceeded.\n * It indicates the client took too long to establish a connection with a server.\n */\npublic fun ConnectTimeoutException(\n request: HttpRequestData,\n cause: Throwable? = null\n): ConnectTimeoutException = ConnectTimeoutException(\n \"Connect timeout has expired [url=${request.url}, \" +\n \"connect_timeout=${request.getCapabilityOrNull(HttpTimeout)?.connectTimeoutMillis ?: \"unknown\"} ms]\",\n cause\n)\n\n/**\n * This exception is thrown in case the connection timeout is exceeded.\n * It indicates the client took too long to establish a connection with a server.\n */\npublic fun ConnectTimeoutException(\n url: String,\n timeout: Long?,\n cause: Throwable? = null\n): ConnectTimeoutException = ConnectTimeoutException(\n \"Connect timeout has expired [url=$url, connect_timeout=${timeout ?: \"unknown\"} ms]\",\n cause\n)\n\n/**\n * This exception is thrown in case the socket timeout (read or write) is exceeded.\n * It indicates the time between two data packets when exchanging data with a server was too long.\n */\npublic fun SocketTimeoutException(\n request: HttpRequestData,\n cause: Throwable? = null\n): SocketTimeoutException = SocketTimeoutException(\n \"Socket timeout has expired [url=${request.url}, \" +\n \"socket_timeout=${request.getCapabilityOrNull(HttpTimeout)?.socketTimeoutMillis ?: \"unknown\"}] ms\",\n cause\n)\n\n/**\n * Converts a long timeout in milliseconds to int value. To do that, we need to consider [HttpTimeout.INFINITE_TIMEOUT_MS]\n * as zero and convert timeout value to [Int].\n */\n@InternalAPI\npublic fun convertLongTimeoutToIntWithInfiniteAsZero(timeout: Long): Int = when {\n timeout == HttpTimeout.INFINITE_TIMEOUT_MS -> 0\n timeout < Int.MIN_VALUE -> Int.MIN_VALUE\n timeout > Int.MAX_VALUE -> Int.MAX_VALUE\n else -> timeout.toInt()\n}\n\n/**\n * Converts long timeout in milliseconds to long value. To do that, we need to consider [HttpTimeout.INFINITE_TIMEOUT_MS]\n * as zero and convert timeout value to [Int].\n */\n@InternalAPI\npublic fun convertLongTimeoutToLongWithInfiniteAsZero(timeout: Long): Long = when (timeout) {\n HttpTimeout.INFINITE_TIMEOUT_MS -> 0L\n else -> timeout\n}\n\n@PublishedApi\ninternal inline fun unwrapRequestTimeoutException(block: () -> T): T {\n try {\n return block()\n } catch (cause: CancellationException) {\n throw cause.unwrapCancellationException()\n }\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.plugins.websocket\n\nimport io.ktor.client.call.*\nimport io.ktor.client.plugins.*\nimport io.ktor.serialization.*\nimport io.ktor.util.reflect.*\nimport io.ktor.utils.io.*\nimport io.ktor.websocket.*\nimport io.ktor.websocket.serialization.*\n\n/**\n * Client specific [WebSocketSession].\n */\npublic interface ClientWebSocketSession : WebSocketSession {\n /**\n * [HttpClientCall] associated with session.\n */\n public val call: HttpClientCall\n}\n\n/**\n * ClientSpecific [DefaultWebSocketSession].\n */\npublic class DefaultClientWebSocketSession(\n override val call: HttpClientCall,\n delegate: DefaultWebSocketSession\n) : ClientWebSocketSession, DefaultWebSocketSession by delegate\n\ninternal class DelegatingClientWebSocketSession(\n override val call: HttpClientCall,\n session: WebSocketSession\n) : ClientWebSocketSession, WebSocketSession by session\n\n/**\n * Converter for web socket session\n */\npublic val DefaultClientWebSocketSession.converter: WebsocketContentConverter?\n get() = call.client.pluginOrNull(WebSockets)?.contentConverter\n\n/**\n * Serializes [data] to a frame and enqueues this frame.\n * May suspend if the outgoing queue is full.\n * If the outgoing channel is already closed, throws an exception, so it is impossible to transfer any message.\n * Frames sent after a Close frame are silently ignored.\n * Note that a Close frame could be sent automatically in reply to a peer's Close frame unless it is a raw WebSocket session.\n *\n * @throws WebsocketConverterNotFoundException if no [contentConverter] is found for the [WebSockets] plugin\n */\npublic suspend inline fun DefaultClientWebSocketSession.sendSerialized(data: T) {\n val converter = converter\n ?: throw WebsocketConverterNotFoundException(\"No converter was found for websocket\")\n\n sendSerializedBase(\n data,\n converter,\n call.request.headers.suitableCharset()\n )\n}\n\n/**\n * Dequeues a frame and deserializes it to the type [T] using WebSocket content converter.\n * May throw an exception [WebsocketDeserializeException] if the converter can't deserialize frame data to type [T].\n * May throw [WebsocketDeserializeException] if the received frame type is not [Frame.Text] or [Frame.Binary].\n * In this case, [WebsocketDeserializeException.frame] contains the received frame.\n * May throw [ClosedReceiveChannelException] if a channel was closed\n *\n * @throws WebsocketConverterNotFoundException if no [contentConverter] is found for the [WebSockets] plugin\n * @throws WebsocketDeserializeException if the received frame can't be deserialized to type [T]\n */\npublic suspend inline fun DefaultClientWebSocketSession.receiveDeserialized(): T {\n val converter = converter\n ?: throw WebsocketConverterNotFoundException(\"No converter was found for websocket\")\n\n return receiveDeserializedBase(\n converter,\n call.request.headers.suitableCharset()\n ) as T\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.plugins.websocket\n\nimport io.ktor.client.request.*\nimport io.ktor.http.*\nimport io.ktor.http.websocket.*\nimport io.ktor.util.*\n\nprivate const val WEBSOCKET_VERSION = \"13\"\nprivate const val NONCE_SIZE = 16\n\n@OptIn(InternalAPI::class)\ninternal class WebSocketContent : ClientUpgradeContent() {\n private val nonce: String = buildString {\n val nonce = generateNonce(NONCE_SIZE)\n append(nonce.encodeBase64())\n }\n\n override val headers: Headers = HeadersBuilder().apply {\n append(HttpHeaders.Upgrade, \"websocket\")\n append(HttpHeaders.Connection, \"upgrade\")\n\n append(HttpHeaders.SecWebSocketKey, nonce)\n append(HttpHeaders.SecWebSocketVersion, WEBSOCKET_VERSION)\n }.build()\n\n override fun verify(headers: Headers) {\n val serverAccept = headers[HttpHeaders.SecWebSocketAccept]\n ?: error(\"Server should specify header ${HttpHeaders.SecWebSocketAccept}\")\n\n val expectedAccept = websocketServerAccept(nonce)\n check(expectedAccept == serverAccept) {\n \"Failed to verify server accept header. Expected: $expectedAccept, received: $serverAccept\"\n }\n }\n\n override fun toString(): String = \"WebSocketContent\"\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.request\n\nimport io.ktor.http.*\nimport io.ktor.http.content.*\nimport io.ktor.util.*\nimport io.ktor.utils.io.*\n\n@Suppress(\"KDocMissingDocumentation\")\n@InternalAPI\npublic abstract class ClientUpgradeContent : OutgoingContent.NoContent() {\n private val content: ByteChannel by lazy { ByteChannel() }\n\n public val output: ByteWriteChannel get() = content\n\n public suspend fun pipeTo(output: ByteWriteChannel) {\n content.copyAndClose(output)\n }\n\n public abstract fun verify(headers: Headers)\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.request\n\nimport io.ktor.client.*\nimport io.ktor.client.call.*\nimport io.ktor.client.engine.*\nimport io.ktor.client.utils.*\nimport io.ktor.http.*\nimport io.ktor.http.content.*\nimport io.ktor.util.*\nimport io.ktor.util.collections.*\nimport io.ktor.util.date.*\nimport io.ktor.util.reflect.*\nimport io.ktor.utils.io.*\nimport kotlinx.coroutines.*\nimport kotlin.coroutines.*\nimport kotlin.reflect.*\n\n/**\n * A request for [HttpClient], first part of [HttpClientCall].\n */\npublic interface HttpRequest : HttpMessage, CoroutineScope {\n /**\n * The associated [HttpClientCall] containing both\n * the underlying [HttpClientCall.request] and [HttpClientCall.response].\n */\n public val call: HttpClientCall\n\n override val coroutineContext: CoroutineContext get() = call.coroutineContext\n\n /**\n * The [HttpMethod] or HTTP VERB used for this request.\n */\n public val method: HttpMethod\n\n /**\n * The [Url] representing the endpoint and the uri for this request.\n */\n public val url: Url\n\n /**\n * Typed [Attributes] associated to this call serving as a lightweight container.\n */\n public val attributes: Attributes\n\n /**\n * An [OutgoingContent] representing the request body\n */\n public val content: OutgoingContent\n}\n\n/**\n * Class for building [HttpRequestData].\n */\n@Suppress(\"DEPRECATION\")\npublic class HttpRequestBuilder : HttpMessageBuilder {\n /**\n * [URLBuilder] to configure the URL for this request.\n */\n public val url: URLBuilder = URLBuilder()\n\n /**\n * [HttpMethod] used by this request. [HttpMethod.Get] by default.\n */\n public var method: HttpMethod = HttpMethod.Get\n\n /**\n * [HeadersBuilder] to configure the headers for this request.\n */\n override val headers: HeadersBuilder = HeadersBuilder()\n\n /**\n * The [body] for this request. Initially [EmptyContent].\n */\n public var body: Any = EmptyContent\n @InternalAPI public set\n\n /**\n * The [KType] of [body] for this request. Null for default types that don't need serialization.\n */\n public var bodyType: TypeInfo?\n get() = attributes.getOrNull(BodyTypeAttributeKey)\n @InternalAPI set(value) {\n if (value != null) {\n attributes.put(BodyTypeAttributeKey, value)\n } else {\n attributes.remove(BodyTypeAttributeKey)\n }\n }\n\n /**\n * A deferred used to control the execution of this request.\n */\n public var executionContext: Job = SupervisorJob()\n internal set\n\n /**\n * Call specific attributes.\n */\n public val attributes: Attributes = Attributes(concurrent = true)\n\n /**\n * Executes a [block] that configures the [URLBuilder] associated to this request.\n */\n public fun url(block: URLBuilder.(URLBuilder) -> Unit): Unit = url.block(url)\n\n /**\n * Create immutable [HttpRequestData]\n */\n @OptIn(InternalAPI::class)\n public fun build(): HttpRequestData = HttpRequestData(\n url.build(),\n method,\n headers.build(),\n body as? OutgoingContent ?: error(\"No request transformation found: $body\"),\n executionContext,\n attributes\n )\n\n /**\n * Set request specific attributes specified by [block].\n */\n public fun setAttributes(block: Attributes.() -> Unit) {\n attributes.apply(block)\n }\n\n /**\n * Mutates [this] copying all the data from another [builder] using it as base.\n */\n @InternalAPI\n public fun takeFromWithExecutionContext(builder: HttpRequestBuilder): HttpRequestBuilder {\n executionContext = builder.executionContext\n return takeFrom(builder)\n }\n\n /**\n * Mutates [this] copying all the data but execution context from another [builder] using it as base.\n */\n @OptIn(InternalAPI::class)\n public fun takeFrom(builder: HttpRequestBuilder): HttpRequestBuilder {\n method = builder.method\n body = builder.body\n bodyType = builder.bodyType\n url.takeFrom(builder.url)\n url.encodedPathSegments = url.encodedPathSegments\n headers.appendAll(builder.headers)\n attributes.putAll(builder.attributes)\n\n return this\n }\n\n /**\n * Set capability configuration.\n */\n @OptIn(InternalAPI::class)\n public fun setCapability(key: HttpClientEngineCapability, capability: T) {\n val capabilities = attributes.computeIfAbsent(ENGINE_CAPABILITIES_KEY) { mutableMapOf() }\n capabilities[key] = capability\n }\n\n /**\n * Retrieve capability by key.\n */\n public fun getCapabilityOrNull(key: HttpClientEngineCapability): T? {\n @Suppress(\"UNCHECKED_CAST\")\n return attributes.getOrNull(ENGINE_CAPABILITIES_KEY)?.get(key) as T?\n }\n\n public companion object\n}\n\n/**\n * Actual data of the [HttpRequest], including [url], [method], [headers], [body] and [executionContext].\n * Built by [HttpRequestBuilder].\n */\npublic class HttpRequestData @InternalAPI constructor(\n public val url: Url,\n public val method: HttpMethod,\n public val headers: Headers,\n public val body: OutgoingContent,\n public val executionContext: Job,\n public val attributes: Attributes\n) {\n /**\n * Retrieve extension by its key.\n */\n public fun getCapabilityOrNull(key: HttpClientEngineCapability): T? {\n @Suppress(\"UNCHECKED_CAST\")\n return attributes.getOrNull(ENGINE_CAPABILITIES_KEY)?.get(key) as T?\n }\n\n /**\n * All extension keys associated with this request.\n */\n internal val requiredCapabilities: Set> =\n attributes.getOrNull(ENGINE_CAPABILITIES_KEY)?.keys ?: emptySet()\n\n override fun toString(): String = \"HttpRequestData(url=$url, method=$method)\"\n}\n\n/**\n * Data prepared for [HttpResponse].\n */\npublic class HttpResponseData constructor(\n public val statusCode: HttpStatusCode,\n public val requestTime: GMTDate,\n public val headers: Headers,\n public val version: HttpProtocolVersion,\n public val body: Any,\n public val callContext: CoroutineContext\n) {\n public val responseTime: GMTDate = GMTDate()\n\n override fun toString(): String = \"HttpResponseData=(statusCode=$statusCode)\"\n}\n\n/**\n * Executes a [block] that configures the [HeadersBuilder] associated to this request.\n */\npublic fun HttpMessageBuilder.headers(block: HeadersBuilder.() -> Unit): HeadersBuilder = headers.apply(block)\n\n/**\n * Mutates [this] copying all the data from another [request] using it as base.\n */\n@OptIn(InternalAPI::class)\npublic fun HttpRequestBuilder.takeFrom(request: HttpRequest): HttpRequestBuilder {\n method = request.method\n body = request.content\n bodyType = attributes.getOrNull(BodyTypeAttributeKey)\n url.takeFrom(request.url)\n headers.appendAll(request.headers)\n attributes.putAll(request.attributes)\n return this\n}\n\n/**\n * Executes a [block] that configures the [URLBuilder] associated to this request.\n */\npublic fun HttpRequestBuilder.url(block: URLBuilder.() -> Unit): Unit = block(url)\n\n/**\n * Sets the [HttpRequestBuilder] from [request].\n */\n@OptIn(InternalAPI::class)\npublic fun HttpRequestBuilder.takeFrom(request: HttpRequestData): HttpRequestBuilder {\n method = request.method\n body = request.body\n bodyType = attributes.getOrNull(BodyTypeAttributeKey)\n url.takeFrom(request.url)\n headers.appendAll(request.headers)\n attributes.putAll(request.attributes)\n\n return this\n}\n\n/**\n * Executes a [block] that configures the [URLBuilder] associated to thisrequest.\n */\npublic operator fun HttpRequestBuilder.Companion.invoke(block: URLBuilder.() -> Unit): HttpRequestBuilder =\n HttpRequestBuilder().apply { url(block) }\n\n/**\n * Sets the [url] using the specified [scheme], [host], [port] and [path].\n * Pass `null` to keep existing value in the [URLBuilder].\n */\npublic fun HttpRequestBuilder.url(\n scheme: String? = null,\n host: String? = null,\n port: Int? = null,\n path: String? = null,\n block: URLBuilder.() -> Unit = {}\n) {\n url.set(scheme, host, port, path, block)\n}\n\n/**\n * Constructs a [HttpRequestBuilder] from URL information: [scheme], [host], [port] and [path]\n * and optionally further configures it using [block].\n * Pass `null` to keep existing value in the [URLBuilder].\n */\npublic operator fun HttpRequestBuilder.Companion.invoke(\n scheme: String? = null,\n host: String? = null,\n port: Int? = null,\n path: String? = null,\n block: URLBuilder.() -> Unit = {}\n): HttpRequestBuilder = HttpRequestBuilder().apply { url(scheme, host, port, path, block) }\n\n/**\n * Sets the [HttpRequestBuilder.url] from [urlString].\n */\npublic fun HttpRequestBuilder.url(urlString: String): Unit { // ktlint-disable filename no-unit-return\n url.takeFrom(urlString)\n}\n\n@InternalAPI\n@Suppress(\"KDocMissingDocumentation\")\npublic fun HttpRequestData.isUpgradeRequest(): Boolean {\n return body is ClientUpgradeContent\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.request\n\nimport io.ktor.client.*\nimport io.ktor.client.call.*\nimport io.ktor.util.pipeline.*\n\n/**\n * [HttpClient] Pipeline used for executing [HttpRequest].\n */\npublic class HttpRequestPipeline(\n override val developmentMode: Boolean = false\n) : Pipeline(Before, State, Transform, Render, Send) {\n /**\n * All interceptors accept payload as [subject] and try to convert it to [OutgoingContent]\n * Last phase should proceed with [HttpClientCall]\n */\n public companion object Phases {\n /**\n * The earliest phase that happens before any other\n */\n public val Before: PipelinePhase = PipelinePhase(\"Before\")\n\n /**\n * Use this phase to modify request with shared state\n */\n public val State: PipelinePhase = PipelinePhase(\"State\")\n\n /**\n * Transform request body to supported render format\n */\n public val Transform: PipelinePhase = PipelinePhase(\"Transform\")\n\n /**\n * Encode request body to [OutgoingContent]\n */\n public val Render: PipelinePhase = PipelinePhase(\"Render\")\n\n /**\n * Phase for [HttpSend] plugin\n */\n public val Send: PipelinePhase = PipelinePhase(\"Send\")\n }\n}\n\n/**\n * [HttpClient] Pipeline used for sending [HttpRequest] to remote server.\n */\npublic class HttpSendPipeline(\n override val developmentMode: Boolean = false\n) : Pipeline(Before, State, Monitoring, Engine, Receive) {\n\n public companion object Phases {\n /**\n * The earliest phase that happens before any other.\n */\n public val Before: PipelinePhase = PipelinePhase(\"Before\")\n\n /**\n * Use this phase to modify request with shared state.\n */\n public val State: PipelinePhase = PipelinePhase(\"State\")\n\n /**\n * Use this phase for logging and other actions that don't modify request or shared data.\n */\n public val Monitoring: PipelinePhase = PipelinePhase(\"Monitoring\")\n\n /**\n * Send request to remote server.\n */\n public val Engine: PipelinePhase = PipelinePhase(\"Engine\")\n\n /**\n * Receive pipeline execution phase.\n */\n public val Receive: PipelinePhase = PipelinePhase(\"Receive\")\n }\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.request.forms\n\nimport io.ktor.http.*\nimport io.ktor.http.content.*\nimport io.ktor.utils.io.*\nimport io.ktor.utils.io.charsets.*\nimport io.ktor.utils.io.core.*\nimport kotlin.random.*\n\nprivate val RN_BYTES = \"\\r\\n\".toByteArray()\n\n/**\n * [OutgoingContent] with for application/x-www-form-urlencoded formatted request.\n *\n * @param formData: data to send.\n */\npublic class FormDataContent(\n public val formData: Parameters\n) : OutgoingContent.ByteArrayContent() {\n private val content = formData.formUrlEncode().toByteArray()\n\n override val contentLength: Long = content.size.toLong()\n override val contentType: ContentType = ContentType.Application.FormUrlEncoded.withCharset(Charsets.UTF_8)\n\n override fun bytes(): ByteArray = content\n}\n\n/**\n * [OutgoingContent] for multipart/form-data formatted request.\n *\n * @param parts: form part data\n */\npublic class MultiPartFormDataContent(\n parts: List,\n public val boundary: String = generateBoundary(),\n override val contentType: ContentType = ContentType.MultiPart.FormData.withParameter(\"boundary\", boundary)\n) : OutgoingContent.WriteChannelContent() {\n private val BOUNDARY_BYTES = \"--$boundary\\r\\n\".toByteArray()\n private val LAST_BOUNDARY_BYTES = \"--$boundary--\\r\\n\".toByteArray()\n\n private val BODY_OVERHEAD_SIZE = LAST_BOUNDARY_BYTES.size\n private val PART_OVERHEAD_SIZE = RN_BYTES.size * 2 + BOUNDARY_BYTES.size\n\n private val rawParts: List = parts.map { part ->\n val headersBuilder = BytePacketBuilder()\n for ((key, values) in part.headers.entries()) {\n headersBuilder.writeText(\"$key: ${values.joinToString(\"; \")}\")\n headersBuilder.writeFully(RN_BYTES)\n }\n\n val bodySize = part.headers[HttpHeaders.ContentLength]?.toLong()\n when (part) {\n is PartData.FileItem -> {\n val headers = headersBuilder.build().readBytes()\n val size = bodySize?.plus(PART_OVERHEAD_SIZE)?.plus(headers.size)\n PreparedPart.InputPart(headers, part.provider, size)\n }\n is PartData.BinaryItem -> {\n val headers = headersBuilder.build().readBytes()\n val size = bodySize?.plus(PART_OVERHEAD_SIZE)?.plus(headers.size)\n PreparedPart.InputPart(headers, part.provider, size)\n }\n is PartData.FormItem -> {\n val bytes = buildPacket { writeText(part.value) }.readBytes()\n val provider = { buildPacket { writeFully(bytes) } }\n if (bodySize == null) {\n headersBuilder.writeText(\"${HttpHeaders.ContentLength}: ${bytes.size}\")\n headersBuilder.writeFully(RN_BYTES)\n }\n\n val headers = headersBuilder.build().readBytes()\n val size = bytes.size + PART_OVERHEAD_SIZE + headers.size\n PreparedPart.InputPart(headers, provider, size.toLong())\n }\n is PartData.BinaryChannelItem -> {\n val headers = headersBuilder.build().readBytes()\n val size = bodySize?.plus(PART_OVERHEAD_SIZE)?.plus(headers.size)\n PreparedPart.ChannelPart(headers, part.provider, size)\n }\n }\n }\n\n override val contentLength: Long?\n\n init {\n var rawLength: Long? = 0\n for (part in rawParts) {\n val size = part.size\n if (size == null) {\n rawLength = null\n break\n }\n\n rawLength = rawLength?.plus(size)\n }\n\n if (rawLength != null) {\n rawLength += BODY_OVERHEAD_SIZE\n }\n\n contentLength = rawLength\n }\n\n override suspend fun writeTo(channel: ByteWriteChannel) {\n try {\n for (part in rawParts) {\n channel.writeFully(BOUNDARY_BYTES)\n channel.writeFully(part.headers)\n channel.writeFully(RN_BYTES)\n\n when (part) {\n is PreparedPart.InputPart -> {\n part.provider().use { input ->\n input.copyTo(channel)\n }\n }\n is PreparedPart.ChannelPart -> {\n part.provider().copyTo(channel)\n }\n }\n\n channel.writeFully(RN_BYTES)\n }\n\n channel.writeFully(LAST_BOUNDARY_BYTES)\n } catch (cause: Throwable) {\n channel.close(cause)\n } finally {\n channel.close()\n }\n }\n}\n\nprivate fun generateBoundary(): String = buildString {\n repeat(32) {\n append(Random.nextInt().toString(16))\n }\n}.take(70)\n\nprivate sealed class PreparedPart(val headers: ByteArray, val size: Long?) {\n class InputPart(headers: ByteArray, val provider: () -> Input, size: Long?) : PreparedPart(headers, size)\n class ChannelPart(\n headers: ByteArray,\n val provider: () -> ByteReadChannel,\n size: Long?\n ) : PreparedPart(headers, size)\n}\n\nprivate suspend fun Input.copyTo(channel: ByteWriteChannel) {\n if (this is ByteReadPacket) {\n channel.writePacket(this)\n return\n }\n\n while (!this@copyTo.endOfInput) {\n channel.write { freeSpace, startOffset, endExclusive ->\n this@copyTo.readAvailable(freeSpace, startOffset, endExclusive - startOffset).toInt()\n }\n }\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.request\n\nimport io.ktor.http.*\nimport io.ktor.util.*\nimport io.ktor.util.date.*\n\n/**\n * Gets the associated URL's host.\n */\npublic var HttpRequestBuilder.host: String\n get() = url.host\n set(value) {\n url.host = value\n }\n\n/**\n * Gets the associated URL's port.\n */\npublic var HttpRequestBuilder.port: Int\n get() = url.port\n set(value) {\n url.port = value\n }\n\n/**\n * Appends a single header of [key] with a specific [value] if the value is not null.\n */\npublic fun HttpMessageBuilder.header(key: String, value: Any?): Unit =\n value?.let { headers.append(key, it.toString()) } ?: Unit\n\n/**\n * Appends a single header of [key] with a specific [value] if the value is not null.\n */\npublic fun HttpMessageBuilder.cookie(\n name: String,\n value: String,\n maxAge: Int = 0,\n expires: GMTDate? = null,\n domain: String? = null,\n path: String? = null,\n secure: Boolean = false,\n httpOnly: Boolean = false,\n extensions: Map = emptyMap()\n): Unit { // ktlint-disable no-unit-return\n val renderedCookie = Cookie(\n name = name,\n value = value,\n maxAge = maxAge,\n expires = expires,\n domain = domain,\n path = path,\n secure = secure,\n httpOnly = httpOnly,\n extensions = extensions\n ).let(::renderCookieHeader)\n\n if (HttpHeaders.Cookie !in headers) {\n headers.append(HttpHeaders.Cookie, renderedCookie)\n return\n }\n // Client cookies are stored in a single header \"Cookies\" and multiple values are separated with \";\"\n headers[HttpHeaders.Cookie] = headers[HttpHeaders.Cookie] + \"; \" + renderedCookie\n}\n\n/**\n * Appends a single URL query parameter of [key] with a specific [value] if the value is not null. Can not be used to set\n * form parameters in the body.\n */\npublic fun HttpRequestBuilder.parameter(key: String, value: Any?): Unit =\n value?.let { url.parameters.append(key, it.toString()) } ?: Unit\n\n/**\n * Appends the `Accept` header with a specific [contentType].\n */\npublic fun HttpMessageBuilder.accept(contentType: ContentType): Unit =\n headers.append(HttpHeaders.Accept, contentType.toString())\n\n/**\n * Appends the [HttpHeaders.Authorization] to Basic Authorization with the provided [username] and [password].\n * For advanced configuration use the `io.ktor:ktor-client-auth` plugin.\n */\npublic fun HttpMessageBuilder.basicAuth(username: String, password: String): Unit =\n header(HttpHeaders.Authorization, \"Basic ${\"$username:$password\".encodeBase64()}\")\n\n/**\n * Appends the [HttpHeaders.Authorization] to Bearer Authorization with the provided [token].\n * For advanced configuration use the `io.ktor:ktor-client-auth` plugin.\n */\npublic fun HttpMessageBuilder.bearerAuth(token: String): Unit =\n header(HttpHeaders.Authorization, \"Bearer $token\")\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.statement\n\nimport io.ktor.client.*\nimport io.ktor.client.call.*\nimport io.ktor.client.request.*\nimport io.ktor.http.*\nimport io.ktor.util.*\nimport io.ktor.util.date.*\nimport io.ktor.utils.io.*\nimport io.ktor.utils.io.charsets.*\nimport io.ktor.utils.io.core.*\nimport kotlinx.coroutines.*\n\n/**\n * A response for [HttpClient], second part of [HttpClientCall].\n */\npublic abstract class HttpResponse : HttpMessage, CoroutineScope {\n /**\n * The associated [HttpClientCall] containing both\n * the underlying [HttpClientCall.request] and [HttpClientCall.response].\n */\n public abstract val call: HttpClientCall\n\n /**\n * The [HttpStatusCode] returned by the server. It includes both,\n * the [HttpStatusCode.description] and the [HttpStatusCode.value] (code).\n */\n public abstract val status: HttpStatusCode\n\n /**\n * HTTP version. Usually [HttpProtocolVersion.HTTP_1_1] or [HttpProtocolVersion.HTTP_2_0].\n */\n public abstract val version: HttpProtocolVersion\n\n /**\n * [GMTDate] of the request start.\n */\n public abstract val requestTime: GMTDate\n\n /**\n * [GMTDate] of the response start.\n */\n public abstract val responseTime: GMTDate\n\n /**\n * Unmodified [ByteReadChannel] with the raw payload of the response.\n *\n * **Note:** this content doesn't go through any interceptors from [HttpResponsePipeline].\n * If you need modified content, use [bodyChannel] function.\n */\n @InternalAPI\n public abstract val content: ByteReadChannel\n\n override fun toString(): String = \"HttpResponse[${request.url}, $status]\"\n}\n\n/**\n * [HttpRequest] associated with this response.\n */\npublic val HttpResponse.request: HttpRequest get() = call.request\n\n@InternalAPI\n@PublishedApi\ninternal fun HttpResponse.complete() {\n val job = coroutineContext[Job]!! as CompletableJob\n job.complete()\n}\n\n/**\n * Read the [HttpResponse.content] as a String. You can pass an optional [charset]\n * to specify a charset in the case no one is specified as part of the Content-Type response.\n * If no charset specified either as parameter or as part of the response,\n * [io.ktor.client.plugins.HttpPlainText] settings will be used.\n *\n * Note that [fallbackCharset] parameter will be ignored if the response already has a charset.\n * So it just acts as a fallback, honoring the server preference.\n */\npublic suspend fun HttpResponse.bodyAsText(fallbackCharset: Charset = Charsets.UTF_8): String {\n val originCharset = charset() ?: fallbackCharset\n val decoder = originCharset.newDecoder()\n val input = body()\n\n return decoder.decode(input)\n}\n\n/**\n * Read the [HttpResponse.content] as a [ByteReadChannel].\n */\npublic suspend fun HttpResponse.bodyAsChannel(): ByteReadChannel = body()\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.statement\n\nimport io.ktor.client.*\nimport io.ktor.client.call.*\nimport io.ktor.util.pipeline.*\nimport io.ktor.util.reflect.TypeInfo\n\n/**\n * [HttpClient] Pipeline used for executing [HttpResponse].\n */\npublic class HttpResponsePipeline(\n override val developmentMode: Boolean = false\n) : Pipeline(\n Receive,\n Parse,\n Transform,\n State,\n After\n) {\n public companion object Phases {\n /**\n * The earliest phase that happens before any other\n */\n public val Receive: PipelinePhase = PipelinePhase(\"Receive\")\n\n /**\n * Decode response body\n */\n public val Parse: PipelinePhase = PipelinePhase(\"Parse\")\n\n /**\n * Transform response body to expected format\n */\n public val Transform: PipelinePhase = PipelinePhase(\"Transform\")\n\n /**\n * Use this phase to store request shared state\n */\n public val State: PipelinePhase = PipelinePhase(\"State\")\n\n /**\n * Latest response pipeline phase\n */\n public val After: PipelinePhase = PipelinePhase(\"After\")\n }\n}\n\n/**\n * [HttpClient] Pipeline used for receiving [HttpResponse] without any processing.\n */\npublic class HttpReceivePipeline(\n override val developmentMode: Boolean = false\n) : Pipeline(Before, State, After) {\n public companion object Phases {\n /**\n * The earliest phase that happens before any other\n */\n public val Before: PipelinePhase = PipelinePhase(\"Before\")\n\n /**\n * Use this phase to store request shared state\n */\n public val State: PipelinePhase = PipelinePhase(\"State\")\n\n /**\n * Latest response pipeline phase\n */\n public val After: PipelinePhase = PipelinePhase(\"After\")\n }\n}\n\n/**\n * Class representing a typed [response] with an attached [expectedType].\n * @param expectedType: information about expected type.\n * @param response: current response state.\n */\npublic data class HttpResponseContainer(val expectedType: TypeInfo, val response: Any)\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.request\n\nimport io.ktor.client.*\nimport io.ktor.client.statement.*\nimport io.ktor.http.*\n\n/**\n * Executes a [HttpClient] GET request, with the specified [url] as Url and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.get(\n url: Url,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpResponse = get {\n this.url.takeFrom(url)\n block()\n}\n\n/**\n * Prepares a [HttpClient] GET request, with the specified [url] as Url and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.prepareGet(\n url: Url,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpStatement = prepareGet {\n this.url.takeFrom(url)\n block()\n}\n\n/**\n * Executes a [HttpClient] POST request, with the specified [url] as Url and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.post(\n url: Url,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpResponse = post {\n this.url.takeFrom(url)\n block()\n}\n\n/**\n * Prepares a [HttpClient] POST request, with the specified [url] as Url and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.preparePost(\n url: Url,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpStatement = preparePost {\n this.url.takeFrom(url)\n block()\n}\n\n/**\n * Executes a [HttpClient] PUT request, with the specified [url] as Url and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.put(\n url: Url,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpResponse = put {\n this.url.takeFrom(url)\n block()\n}\n\n/**\n * Prepares a [HttpClient] PUT request, with the specified [url] as Url and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.preparePut(\n url: Url,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpStatement = preparePut {\n this.url.takeFrom(url)\n block()\n}\n\n/**\n * Executes a [HttpClient] PATCH request, with the specified [url] as Url and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.patch(\n url: Url,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpResponse = patch {\n this.url.takeFrom(url)\n block()\n}\n\n/**\n * Prepares a [HttpClient] PATCH request, with the specified [url] as Url and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.preparePatch(\n url: Url,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpStatement = preparePatch {\n this.url.takeFrom(url)\n block()\n}\n\n/**\n * Executes a [HttpClient] OPTIONS request, with the specified [url] as Url and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.options(\n url: Url,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpResponse = options {\n this.url.takeFrom(url)\n block()\n}\n\n/**\n * Prepares a [HttpClient] OPTIONS request, with the specified [url] as Url and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.prepareOptions(\n url: Url,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpStatement = prepareOptions {\n this.url.takeFrom(url)\n block()\n}\n\n/**\n * Executes a [HttpClient] HEAD request, with the specified [url] as Url and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.head(\n url: Url,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpResponse = head {\n this.url.takeFrom(url)\n block()\n}\n\n/**\n * Prepares a [HttpClient] HEAD request, with the specified [url] as Url and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.prepareHead(\n url: Url,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpStatement = prepareHead {\n this.url.takeFrom(url)\n block()\n}\n\n/**\n * Executes a [HttpClient] HEAD request, with the specified [url] as Url and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.delete(\n url: Url,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpResponse = delete {\n this.url.takeFrom(url)\n block()\n}\n\n/**\n * Prepares a [HttpClient] HEAD request, with the specified [url] as Url and\n * an optional [block] receiving an [HttpRequestBuilder] for further configuring the request.\n */\npublic suspend inline fun HttpClient.prepareDelete(\n url: Url,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpStatement = prepareDelete {\n this.url.takeFrom(url)\n block()\n}\n\n/**\n * Sets the [HttpRequestBuilder.url] from [url].\n */\npublic fun HttpRequestBuilder.url(url: Url): Unit { // ktlint-disable no-unit-return\n this.url.takeFrom(url)\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.request.forms\n\nimport io.ktor.client.*\nimport io.ktor.client.request.*\nimport io.ktor.client.statement.*\nimport io.ktor.http.*\nimport io.ktor.http.content.*\n\n/**\n * Submit [formParameters] request.\n *\n * If [encodeInQuery] specified encode [formParameters] in url parameters and use [HttpMethod.Get] for the request.\n * Otherwise send [HttpMethod.Post] request with [formParameters] encoded in body.\n *\n * [formParameters] encoded using application/x-www-form-urlencoded format.\n */\npublic suspend inline fun HttpClient.submitForm(\n formParameters: Parameters = Parameters.Empty,\n encodeInQuery: Boolean = false,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpResponse = request {\n if (encodeInQuery) {\n method = HttpMethod.Get\n url.parameters.appendAll(formParameters)\n } else {\n method = HttpMethod.Post\n setBody(FormDataContent(formParameters))\n }\n\n block()\n}\n\n/**\n * Submit [formParameters] request.\n *\n * If [encodeInQuery] specified encode [formParameters] in url parameters and use [HttpMethod.Get] for the request.\n * Otherwise send [HttpMethod.Post] request with [formParameters] encoded in body.\n *\n * [url] destination\n * [formParameters] encoded using application/x-www-form-urlencoded format.\n */\npublic suspend fun HttpClient.submitForm(\n url: String,\n formParameters: Parameters = Parameters.Empty,\n encodeInQuery: Boolean = false,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpResponse = submitForm(formParameters, encodeInQuery) {\n url(url)\n block()\n}\n\n/**\n * Send [HttpMethod.Post] request with [formData] encoded in body.\n * [formData] encoded using multipart/form-data format.\n * https://tools.ietf.org/html/rfc2045\n */\npublic suspend inline fun HttpClient.submitFormWithBinaryData(\n formData: List,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpResponse = request {\n method = HttpMethod.Post\n setBody(MultiPartFormDataContent(formData))\n block()\n}\n\n/**\n * Send [HttpMethod.Post] request with [formData] encoded in body.\n * [url] destination\n * [formData] encoded using multipart/form-data format.\n *\n * https://tools.ietf.org/html/rfc2045\n */\npublic suspend inline fun HttpClient.submitFormWithBinaryData(\n url: String,\n formData: List,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpResponse = submitFormWithBinaryData(formData) {\n url(url)\n block()\n}\n\n/**\n * Prepare [formParameters] request.\n *\n * If [encodeInQuery] specified encode [formParameters] in url parameters and use [HttpMethod.Get] for the request.\n * Otherwise send [HttpMethod.Post] request with [formParameters] encoded in body.\n *\n * [formParameters] encoded using application/x-www-form-urlencoded format.\n */\npublic suspend inline fun HttpClient.prepareForm(\n formParameters: Parameters = Parameters.Empty,\n encodeInQuery: Boolean = false,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpStatement = prepareRequest {\n if (encodeInQuery) {\n method = HttpMethod.Get\n url.parameters.appendAll(formParameters)\n } else {\n method = HttpMethod.Post\n setBody(FormDataContent(formParameters))\n }\n\n block()\n}\n\n/**\n * Prepare [formParameters] request.\n *\n * If [encodeInQuery] specified encode [formParameters] in url parameters and use [HttpMethod.Get] for the request.\n * Otherwise send [HttpMethod.Post] request with [formParameters] encoded in body.\n *\n * [url] destination\n * [formParameters] encoded using application/x-www-form-urlencoded format.\n */\npublic suspend fun HttpClient.prepareForm(\n url: String,\n formParameters: Parameters = Parameters.Empty,\n encodeInQuery: Boolean = false,\n block: HttpRequestBuilder.() -> Unit = {}\n): HttpStatement = prepareForm(formParameters, encodeInQuery) {\n url(url)\n block()\n}\n\n/**\n * Prepare [HttpMethod.Post] request with [formData] encoded in body.\n * [formData] encoded using multipart/form-data format.\n * https://tools.ietf.org/html/rfc2045\n */\npublic suspend inline fun HttpClient.prepareFormWithBinaryData(\n formData: List,\n crossinline block: HttpRequestBuilder.() -> Unit = {}\n): HttpStatement = prepareRequest {\n method = HttpMethod.Post\n setBody(MultiPartFormDataContent(formData))\n block()\n}\n\n/**\n * Prepare [HttpMethod.Post] request with [formData] encoded in body.\n * [url] destination\n * [formData] encoded using multipart/form-data format.\n *\n * https://tools.ietf.org/html/rfc2045\n */\npublic suspend inline fun HttpClient.prepareFormWithBinaryData(\n url: String,\n formData: List,\n crossinline block: HttpRequestBuilder.() -> Unit = {}\n): HttpStatement = prepareFormWithBinaryData(formData) {\n url(url)\n block()\n}\n","/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\n@file:Suppress(\"UNUSED_PARAMETER\")\n\npackage io.ktor.client.statement\n\nimport io.ktor.client.*\nimport io.ktor.http.*\nimport io.ktor.utils.io.*\nimport io.ktor.utils.io.charsets.*\n\n/**\n * Executes this statement and run [HttpClient.responsePipeline] with the response and expected type [T].\n *\n * Note if T is a streaming type, you should manage how to close it manually.\n */\n@Deprecated(\"Use `body` method instead\", replaceWith = ReplaceWith(\"this.body()\"), level = DeprecationLevel.ERROR)\npublic suspend inline fun HttpStatement.receive(): T = error(\"Use `body` method instead\")\n\n/**\n * Executes this statement and run the [block] with a [HttpClient.responsePipeline] execution result.\n *\n * Note that T can be a streamed type such as [ByteReadChannel].\n */\n@Deprecated(\"Use `body` method instead\", replaceWith = ReplaceWith(\"this.body()\"), level = DeprecationLevel.ERROR)\npublic suspend inline fun HttpStatement.receive(crossinline block: suspend (response: T) -> R): R =\n error(\"Use `body` method instead\")\n\n/**\n * Read the [HttpResponse.content] as a String. You can pass an optional [charset]\n * to specify a charset in the case no one is specified as part of the Content-Type response.\n * If no charset specified either as parameter or as part of the response,\n * [io.ktor.client.plugins.HttpPlainText] settings will be used.\n *\n * Note that [fallbackCharset] parameter will be ignored if the response already has a charset.\n * So it just acts as a fallback, honoring the server preference.\n */\n@Deprecated(\n \"Use `bodyAsText` method instead\",\n replaceWith = ReplaceWith(\"this.bodyAsText()\"),\n level = DeprecationLevel.ERROR\n)\npublic suspend fun HttpResponse.readText(fallbackCharset: Charset? = null): String =\n error(\"Use `bodyAsText` method instead\")\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.statement\n\nimport io.ktor.client.*\nimport io.ktor.client.call.*\nimport io.ktor.client.engine.*\nimport io.ktor.client.plugins.*\nimport io.ktor.client.request.*\nimport io.ktor.client.utils.*\nimport io.ktor.http.*\nimport io.ktor.util.*\nimport io.ktor.utils.io.*\nimport io.ktor.utils.io.charsets.*\nimport io.ktor.utils.io.core.*\nimport kotlinx.coroutines.*\n\n/**\n * Prepared statement for http client request.\n * This statement doesn't perform any network requests until [execute] method call.\n *\n * [HttpStatement] is safe to execute multiple times.\n */\npublic class HttpStatement(\n private val builder: HttpRequestBuilder,\n @PublishedApi\n internal val client: HttpClient\n) {\n init {\n checkCapabilities()\n }\n\n /**\n * Executes this statement and call the [block] with the streaming [response].\n *\n * The [response] argument holds a network connection until the [block] isn't completed. You can read the body\n * on-demand or at once with [body()] method.\n *\n * After [block] finishes, [response] will be completed body will be discarded or released depends on the engine configuration.\n *\n * Please note: the [response] instance will be canceled and shouldn't be passed outside of [block].\n */\n public suspend fun execute(block: suspend (response: HttpResponse) -> T): T = unwrapRequestTimeoutException {\n val response = executeUnsafe()\n\n try {\n return block(response)\n } finally {\n response.cleanup()\n }\n }\n\n /**\n * Executes this statement and download the response.\n * After the method finishes, the client downloads the response body in memory and release the connection.\n *\n * To receive exact type consider using [body()] method.\n */\n public suspend fun execute(): HttpResponse = execute {\n val savedCall = it.call.save()\n\n savedCall.response\n }\n\n /**\n * Executes this statement and run [HttpClient.responsePipeline] with the response and expected type [T].\n *\n * Note if T is a streaming type, you should manage how to close it manually.\n */\n @OptIn(InternalAPI::class)\n public suspend inline fun body(): T = unwrapRequestTimeoutException {\n val response = executeUnsafe()\n return try {\n response.body()\n } finally {\n response.complete()\n }\n }\n\n /**\n * Executes this statement and run the [block] with a [HttpClient.responsePipeline] execution result.\n *\n * Note that T can be a streamed type such as [ByteReadChannel].\n */\n public suspend inline fun body(\n crossinline block: suspend (response: T) -> R\n ): R = unwrapRequestTimeoutException {\n val response: HttpResponse = executeUnsafe()\n try {\n val result = response.body()\n return block(result)\n } finally {\n response.cleanup()\n }\n }\n\n /**\n * Return [HttpResponse] with open streaming body.\n */\n @PublishedApi\n @OptIn(InternalAPI::class)\n internal suspend fun executeUnsafe(): HttpResponse = unwrapRequestTimeoutException {\n val builder = HttpRequestBuilder().takeFromWithExecutionContext(builder)\n\n val call = client.execute(builder)\n return call.response\n }\n\n /**\n * Complete [HttpResponse] and release resources.\n */\n @PublishedApi\n @OptIn(InternalAPI::class)\n internal suspend fun HttpResponse.cleanup() {\n val job = coroutineContext[Job]!! as CompletableJob\n\n job.apply {\n complete()\n try {\n content.cancel()\n } catch (_: Throwable) {\n }\n join()\n }\n }\n\n /**\n * Check that all request configuration related to client capabilities have correspondent plugin installed.\n */\n private fun checkCapabilities() {\n builder.attributes.getOrNull(ENGINE_CAPABILITIES_KEY)?.keys\n ?.filterIsInstance>()\n ?.forEach {\n requireNotNull(client.pluginOrNull(it)) {\n \"Consider installing $it plugin because the request requires it to be installed\"\n }\n }\n }\n\n override fun toString(): String = \"HttpStatement[${builder.url.buildString()}]\"\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.utils\n\nimport io.ktor.http.*\nimport io.ktor.http.content.*\nimport io.ktor.utils.io.*\nimport kotlinx.coroutines.*\nimport kotlin.coroutines.*\n\n/**\n * Concrete [OutgoingContent] without a payload.\n */\npublic object EmptyContent : OutgoingContent.NoContent() {\n override val contentLength: Long = 0\n\n override fun toString(): String = \"EmptyContent\"\n}\n\n/**\n * Generates a new [OutgoingContent] of the same abstract type\n * but with [OutgoingContent.headers] transformed by the specified [block].\n */\npublic fun OutgoingContent.wrapHeaders(block: (Headers) -> Headers): OutgoingContent = when (this) {\n is OutgoingContent.NoContent -> object : OutgoingContent.NoContent() {\n override val contentLength: Long? get() = this@wrapHeaders.contentLength\n override val contentType: ContentType? get() = this@wrapHeaders.contentType\n override val status: HttpStatusCode? get() = this@wrapHeaders.status\n\n override val headers: Headers = block(this@wrapHeaders.headers)\n }\n is OutgoingContent.ReadChannelContent -> object : OutgoingContent.ReadChannelContent() {\n override val contentLength: Long? get() = this@wrapHeaders.contentLength\n override val contentType: ContentType? get() = this@wrapHeaders.contentType\n override val status: HttpStatusCode? get() = this@wrapHeaders.status\n\n override val headers: Headers = block(this@wrapHeaders.headers)\n\n override fun readFrom(): ByteReadChannel = this@wrapHeaders.readFrom()\n\n override fun readFrom(range: LongRange): ByteReadChannel = this@wrapHeaders.readFrom(range)\n }\n is OutgoingContent.WriteChannelContent -> object : OutgoingContent.WriteChannelContent() {\n override val contentLength: Long? get() = this@wrapHeaders.contentLength\n override val contentType: ContentType? get() = this@wrapHeaders.contentType\n override val status: HttpStatusCode? get() = this@wrapHeaders.status\n\n override val headers: Headers = block(this@wrapHeaders.headers)\n\n override suspend fun writeTo(channel: ByteWriteChannel) = this@wrapHeaders.writeTo(channel)\n }\n is OutgoingContent.ByteArrayContent -> object : OutgoingContent.ByteArrayContent() {\n override val contentLength: Long? get() = this@wrapHeaders.contentLength\n override val contentType: ContentType? get() = this@wrapHeaders.contentType\n override val status: HttpStatusCode? get() = this@wrapHeaders.status\n\n override val headers: Headers = block(this@wrapHeaders.headers)\n\n override fun bytes(): ByteArray = this@wrapHeaders.bytes()\n }\n is OutgoingContent.ProtocolUpgrade -> object : OutgoingContent.ProtocolUpgrade() {\n override val contentLength: Long? get() = this@wrapHeaders.contentLength\n override val contentType: ContentType? get() = this@wrapHeaders.contentType\n\n override val headers: Headers = block(this@wrapHeaders.headers)\n\n override suspend fun upgrade(\n input: ByteReadChannel,\n output: ByteWriteChannel,\n engineContext: CoroutineContext,\n userContext: CoroutineContext\n ): Job = this@wrapHeaders.upgrade(input, output, engineContext, userContext)\n }\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.plugins.websocket\n\nimport io.ktor.util.*\nimport io.ktor.utils.io.core.*\nimport io.ktor.websocket.*\nimport kotlinx.coroutines.*\nimport kotlinx.coroutines.channels.*\nimport org.khronos.webgl.*\nimport org.w3c.dom.*\nimport kotlin.coroutines.*\n\n@Suppress(\"CAST_NEVER_SUCCEEDS\")\ninternal class JsWebSocketSession(\n override val coroutineContext: CoroutineContext,\n private val websocket: WebSocket\n) : DefaultWebSocketSession {\n private val _closeReason: CompletableDeferred = CompletableDeferred()\n private val _incoming: Channel = Channel(Channel.UNLIMITED)\n private val _outgoing: Channel = Channel(Channel.UNLIMITED)\n\n override val incoming: ReceiveChannel = _incoming\n override val outgoing: SendChannel = _outgoing\n\n override val extensions: List>\n get() = emptyList()\n\n override val closeReason: Deferred = _closeReason\n\n override var pingIntervalMillis: Long\n get() = throw WebSocketException(\"Websocket ping-pong is not supported in JS engine.\")\n set(_) = throw WebSocketException(\"Websocket ping-pong is not supported in JS engine.\")\n\n override var timeoutMillis: Long\n get() = throw WebSocketException(\"Websocket timeout is not supported in JS engine.\")\n set(_) = throw WebSocketException(\"Websocket timeout is not supported in JS engine.\")\n\n override var masking: Boolean\n get() = true\n set(_) = throw WebSocketException(\"Masking switch is not supported in JS engine.\")\n\n override var maxFrameSize: Long\n get() = Long.MAX_VALUE\n set(_) = throw WebSocketException(\"Max frame size switch is not supported in Js engine.\")\n\n init {\n websocket.binaryType = BinaryType.ARRAYBUFFER\n\n websocket.addEventListener(\n \"message\",\n callback = {\n val event = it.unsafeCast()\n\n val frame: Frame = when (val data = event.data) {\n is ArrayBuffer -> Frame.Binary(false, Int8Array(data).unsafeCast())\n is String -> Frame.Text(data)\n else -> {\n val error = IllegalStateException(\"Unknown frame type: ${event.type}\")\n _closeReason.completeExceptionally(error)\n throw error\n }\n }\n\n _incoming.trySend(frame)\n }\n )\n\n websocket.addEventListener(\n \"error\",\n callback = {\n val cause = WebSocketException(\"$it\")\n _closeReason.completeExceptionally(cause)\n _incoming.close(cause)\n _outgoing.cancel()\n }\n )\n\n websocket.addEventListener(\n \"close\",\n callback = { event: dynamic ->\n val reason = CloseReason(event.code as Short, event.reason as String)\n _closeReason.complete(reason)\n _incoming.trySend(Frame.Close(reason))\n _incoming.close()\n _outgoing.cancel()\n }\n )\n\n launch {\n _outgoing.consumeEach {\n when (it.frameType) {\n FrameType.TEXT -> {\n val text = it.data\n websocket.send(String(text))\n }\n FrameType.BINARY -> {\n val source = it.data as Int8Array\n val frameData = source.buffer.slice(\n source.byteOffset,\n source.byteOffset + source.byteLength\n )\n\n websocket.send(frameData)\n }\n FrameType.CLOSE -> {\n val data = buildPacket { writeFully(it.data) }\n val code = data.readShort()\n val reason = data.readText()\n _closeReason.complete(CloseReason(code, reason))\n if (code.isReservedStatusCode()) {\n websocket.close()\n } else {\n websocket.close(code, reason)\n }\n }\n FrameType.PING, FrameType.PONG -> {\n // ignore\n }\n }\n }\n }\n\n coroutineContext[Job]?.invokeOnCompletion { cause ->\n if (cause == null) {\n websocket.close()\n } else {\n websocket.close(CloseReason.Codes.INTERNAL_ERROR.code, \"Client failed\")\n }\n }\n }\n\n @OptIn(InternalAPI::class)\n override fun start(negotiatedExtensions: List>) {\n require(negotiatedExtensions.isEmpty()) { \"Extensions are not supported.\" }\n }\n\n override suspend fun flush() {\n }\n\n @Deprecated(\n \"Use cancel() instead.\",\n ReplaceWith(\"cancel()\", \"kotlinx.coroutines.cancel\")\n )\n override fun terminate() {\n _incoming.cancel()\n _outgoing.cancel()\n _closeReason.cancel(\"WebSocket terminated\")\n websocket.close()\n }\n\n @OptIn(InternalAPI::class)\n private fun Short.isReservedStatusCode(): Boolean {\n return CloseReason.Codes.byCode(this).let { resolved ->\n @Suppress(\"DEPRECATION\")\n resolved == null || resolved == CloseReason.Codes.CLOSED_ABNORMALLY\n }\n }\n}\n","/*\n * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.\n * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.\n */\n\n// NOTE: THIS FILE IS AUTO-GENERATED, DO NOT EDIT!\n// See github.com/kotlin/dukat for details\n\npackage org.w3c.dom\n\nimport kotlin.js.*\nimport org.khronos.webgl.*\nimport org.w3c.dom.clipboard.*\nimport org.w3c.dom.css.*\nimport org.w3c.dom.encryptedmedia.*\nimport org.w3c.dom.events.*\nimport org.w3c.dom.mediacapture.*\nimport org.w3c.dom.mediasource.*\nimport org.w3c.dom.pointerevents.*\nimport org.w3c.dom.svg.*\nimport org.w3c.fetch.*\nimport org.w3c.files.*\nimport org.w3c.performance.*\nimport org.w3c.workers.*\nimport org.w3c.xhr.*\n\npublic external abstract class HTMLAllCollection {\n open val length: Int\n fun item(nameOrIndex: String = definedExternally): UnionElementOrHTMLCollection?\n fun namedItem(name: String): UnionElementOrHTMLCollection?\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun HTMLAllCollection.get(index: Int): Element? = asDynamic()[index]\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun HTMLAllCollection.get(name: String): UnionElementOrHTMLCollection? = asDynamic()[name]\n\n/**\n * Exposes the JavaScript [HTMLFormControlsCollection](https://developer.mozilla.org/en/docs/Web/API/HTMLFormControlsCollection) to Kotlin\n */\npublic external abstract class HTMLFormControlsCollection : HTMLCollection\n\n/**\n * Exposes the JavaScript [RadioNodeList](https://developer.mozilla.org/en/docs/Web/API/RadioNodeList) to Kotlin\n */\npublic external abstract class RadioNodeList : NodeList, UnionElementOrRadioNodeList {\n open var value: String\n}\n\n/**\n * Exposes the JavaScript [HTMLOptionsCollection](https://developer.mozilla.org/en/docs/Web/API/HTMLOptionsCollection) to Kotlin\n */\npublic external abstract class HTMLOptionsCollection : HTMLCollection {\n override var length: Int\n open var selectedIndex: Int\n fun add(element: UnionHTMLOptGroupElementOrHTMLOptionElement, before: dynamic = definedExternally)\n fun remove(index: Int)\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun HTMLOptionsCollection.set(index: Int, option: HTMLOptionElement?) { asDynamic()[index] = option }\n\n/**\n * Exposes the JavaScript [HTMLElement](https://developer.mozilla.org/en/docs/Web/API/HTMLElement) to Kotlin\n */\npublic external abstract class HTMLElement : Element, GlobalEventHandlers, DocumentAndElementEventHandlers, ElementContentEditable, ElementCSSInlineStyle {\n open var title: String\n open var lang: String\n open var translate: Boolean\n open var dir: String\n open val dataset: DOMStringMap\n open var hidden: Boolean\n open var tabIndex: Int\n open var accessKey: String\n open val accessKeyLabel: String\n open var draggable: Boolean\n open val dropzone: DOMTokenList\n open var contextMenu: HTMLMenuElement?\n open var spellcheck: Boolean\n open var innerText: String\n open val offsetParent: Element?\n open val offsetTop: Int\n open val offsetLeft: Int\n open val offsetWidth: Int\n open val offsetHeight: Int\n fun click()\n fun focus()\n fun blur()\n fun forceSpellCheck()\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLUnknownElement](https://developer.mozilla.org/en/docs/Web/API/HTMLUnknownElement) to Kotlin\n */\npublic external abstract class HTMLUnknownElement : HTMLElement {\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [DOMStringMap](https://developer.mozilla.org/en/docs/Web/API/DOMStringMap) to Kotlin\n */\npublic external abstract class DOMStringMap\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun DOMStringMap.get(name: String): String? = asDynamic()[name]\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun DOMStringMap.set(name: String, value: String) { asDynamic()[name] = value }\n\n/**\n * Exposes the JavaScript [HTMLHtmlElement](https://developer.mozilla.org/en/docs/Web/API/HTMLHtmlElement) to Kotlin\n */\npublic external abstract class HTMLHtmlElement : HTMLElement {\n open var version: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLHeadElement](https://developer.mozilla.org/en/docs/Web/API/HTMLHeadElement) to Kotlin\n */\npublic external abstract class HTMLHeadElement : HTMLElement {\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLTitleElement](https://developer.mozilla.org/en/docs/Web/API/HTMLTitleElement) to Kotlin\n */\npublic external abstract class HTMLTitleElement : HTMLElement {\n open var text: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLBaseElement](https://developer.mozilla.org/en/docs/Web/API/HTMLBaseElement) to Kotlin\n */\npublic external abstract class HTMLBaseElement : HTMLElement {\n open var href: String\n open var target: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLLinkElement](https://developer.mozilla.org/en/docs/Web/API/HTMLLinkElement) to Kotlin\n */\npublic external abstract class HTMLLinkElement : HTMLElement, LinkStyle {\n open var href: String\n open var crossOrigin: String?\n open var rel: String\n open var `as`: RequestDestination\n open val relList: DOMTokenList\n open var media: String\n open var nonce: String\n open var hreflang: String\n open var type: String\n open val sizes: DOMTokenList\n open var referrerPolicy: String\n open var charset: String\n open var rev: String\n open var target: String\n open var scope: String\n open var workerType: WorkerType\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLMetaElement](https://developer.mozilla.org/en/docs/Web/API/HTMLMetaElement) to Kotlin\n */\npublic external abstract class HTMLMetaElement : HTMLElement {\n open var name: String\n open var httpEquiv: String\n open var content: String\n open var scheme: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLStyleElement](https://developer.mozilla.org/en/docs/Web/API/HTMLStyleElement) to Kotlin\n */\npublic external abstract class HTMLStyleElement : HTMLElement, LinkStyle {\n open var media: String\n open var nonce: String\n open var type: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLBodyElement](https://developer.mozilla.org/en/docs/Web/API/HTMLBodyElement) to Kotlin\n */\npublic external abstract class HTMLBodyElement : HTMLElement, WindowEventHandlers {\n open var text: String\n open var link: String\n open var vLink: String\n open var aLink: String\n open var bgColor: String\n open var background: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLHeadingElement](https://developer.mozilla.org/en/docs/Web/API/HTMLHeadingElement) to Kotlin\n */\npublic external abstract class HTMLHeadingElement : HTMLElement {\n open var align: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLParagraphElement](https://developer.mozilla.org/en/docs/Web/API/HTMLParagraphElement) to Kotlin\n */\npublic external abstract class HTMLParagraphElement : HTMLElement {\n open var align: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLHRElement](https://developer.mozilla.org/en/docs/Web/API/HTMLHRElement) to Kotlin\n */\npublic external abstract class HTMLHRElement : HTMLElement {\n open var align: String\n open var color: String\n open var noShade: Boolean\n open var size: String\n open var width: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLPreElement](https://developer.mozilla.org/en/docs/Web/API/HTMLPreElement) to Kotlin\n */\npublic external abstract class HTMLPreElement : HTMLElement {\n open var width: Int\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLQuoteElement](https://developer.mozilla.org/en/docs/Web/API/HTMLQuoteElement) to Kotlin\n */\npublic external abstract class HTMLQuoteElement : HTMLElement {\n open var cite: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLOListElement](https://developer.mozilla.org/en/docs/Web/API/HTMLOListElement) to Kotlin\n */\npublic external abstract class HTMLOListElement : HTMLElement {\n open var reversed: Boolean\n open var start: Int\n open var type: String\n open var compact: Boolean\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLUListElement](https://developer.mozilla.org/en/docs/Web/API/HTMLUListElement) to Kotlin\n */\npublic external abstract class HTMLUListElement : HTMLElement {\n open var compact: Boolean\n open var type: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLLIElement](https://developer.mozilla.org/en/docs/Web/API/HTMLLIElement) to Kotlin\n */\npublic external abstract class HTMLLIElement : HTMLElement {\n open var value: Int\n open var type: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLDListElement](https://developer.mozilla.org/en/docs/Web/API/HTMLDListElement) to Kotlin\n */\npublic external abstract class HTMLDListElement : HTMLElement {\n open var compact: Boolean\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLDivElement](https://developer.mozilla.org/en/docs/Web/API/HTMLDivElement) to Kotlin\n */\npublic external abstract class HTMLDivElement : HTMLElement {\n open var align: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLAnchorElement](https://developer.mozilla.org/en/docs/Web/API/HTMLAnchorElement) to Kotlin\n */\npublic external abstract class HTMLAnchorElement : HTMLElement, HTMLHyperlinkElementUtils {\n open var target: String\n open var download: String\n open var ping: String\n open var rel: String\n open val relList: DOMTokenList\n open var hreflang: String\n open var type: String\n open var text: String\n open var referrerPolicy: String\n open var coords: String\n open var charset: String\n open var name: String\n open var rev: String\n open var shape: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLDataElement](https://developer.mozilla.org/en/docs/Web/API/HTMLDataElement) to Kotlin\n */\npublic external abstract class HTMLDataElement : HTMLElement {\n open var value: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLTimeElement](https://developer.mozilla.org/en/docs/Web/API/HTMLTimeElement) to Kotlin\n */\npublic external abstract class HTMLTimeElement : HTMLElement {\n open var dateTime: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLSpanElement](https://developer.mozilla.org/en/docs/Web/API/HTMLSpanElement) to Kotlin\n */\npublic external abstract class HTMLSpanElement : HTMLElement {\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLBRElement](https://developer.mozilla.org/en/docs/Web/API/HTMLBRElement) to Kotlin\n */\npublic external abstract class HTMLBRElement : HTMLElement {\n open var clear: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLHyperlinkElementUtils](https://developer.mozilla.org/en/docs/Web/API/HTMLHyperlinkElementUtils) to Kotlin\n */\npublic external interface HTMLHyperlinkElementUtils {\n var href: String\n val origin: String\n var protocol: String\n var username: String\n var password: String\n var host: String\n var hostname: String\n var port: String\n var pathname: String\n var search: String\n var hash: String\n}\n\n/**\n * Exposes the JavaScript [HTMLModElement](https://developer.mozilla.org/en/docs/Web/API/HTMLModElement) to Kotlin\n */\npublic external abstract class HTMLModElement : HTMLElement {\n open var cite: String\n open var dateTime: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLPictureElement](https://developer.mozilla.org/en/docs/Web/API/HTMLPictureElement) to Kotlin\n */\npublic external abstract class HTMLPictureElement : HTMLElement {\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLSourceElement](https://developer.mozilla.org/en/docs/Web/API/HTMLSourceElement) to Kotlin\n */\npublic external abstract class HTMLSourceElement : HTMLElement {\n open var src: String\n open var type: String\n open var srcset: String\n open var sizes: String\n open var media: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLImageElement](https://developer.mozilla.org/en/docs/Web/API/HTMLImageElement) to Kotlin\n */\npublic external abstract class HTMLImageElement : HTMLElement, HTMLOrSVGImageElement, TexImageSource {\n open var alt: String\n open var src: String\n open var srcset: String\n open var sizes: String\n open var crossOrigin: String?\n open var useMap: String\n open var isMap: Boolean\n open var width: Int\n open var height: Int\n open val naturalWidth: Int\n open val naturalHeight: Int\n open val complete: Boolean\n open val currentSrc: String\n open var referrerPolicy: String\n open var name: String\n open var lowsrc: String\n open var align: String\n open var hspace: Int\n open var vspace: Int\n open var longDesc: String\n open var border: String\n open val x: Int\n open val y: Int\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLIFrameElement](https://developer.mozilla.org/en/docs/Web/API/HTMLIFrameElement) to Kotlin\n */\npublic external abstract class HTMLIFrameElement : HTMLElement {\n open var src: String\n open var srcdoc: String\n open var name: String\n open val sandbox: DOMTokenList\n open var allowFullscreen: Boolean\n open var allowUserMedia: Boolean\n open var width: String\n open var height: String\n open var referrerPolicy: String\n open val contentDocument: Document?\n open val contentWindow: Window?\n open var align: String\n open var scrolling: String\n open var frameBorder: String\n open var longDesc: String\n open var marginHeight: String\n open var marginWidth: String\n fun getSVGDocument(): Document?\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLEmbedElement](https://developer.mozilla.org/en/docs/Web/API/HTMLEmbedElement) to Kotlin\n */\npublic external abstract class HTMLEmbedElement : HTMLElement {\n open var src: String\n open var type: String\n open var width: String\n open var height: String\n open var align: String\n open var name: String\n fun getSVGDocument(): Document?\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLObjectElement](https://developer.mozilla.org/en/docs/Web/API/HTMLObjectElement) to Kotlin\n */\npublic external abstract class HTMLObjectElement : HTMLElement {\n open var data: String\n open var type: String\n open var typeMustMatch: Boolean\n open var name: String\n open var useMap: String\n open val form: HTMLFormElement?\n open var width: String\n open var height: String\n open val contentDocument: Document?\n open val contentWindow: Window?\n open val willValidate: Boolean\n open val validity: ValidityState\n open val validationMessage: String\n open var align: String\n open var archive: String\n open var code: String\n open var declare: Boolean\n open var hspace: Int\n open var standby: String\n open var vspace: Int\n open var codeBase: String\n open var codeType: String\n open var border: String\n fun getSVGDocument(): Document?\n fun checkValidity(): Boolean\n fun reportValidity(): Boolean\n fun setCustomValidity(error: String)\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLParamElement](https://developer.mozilla.org/en/docs/Web/API/HTMLParamElement) to Kotlin\n */\npublic external abstract class HTMLParamElement : HTMLElement {\n open var name: String\n open var value: String\n open var type: String\n open var valueType: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLVideoElement](https://developer.mozilla.org/en/docs/Web/API/HTMLVideoElement) to Kotlin\n */\npublic external abstract class HTMLVideoElement : HTMLMediaElement, CanvasImageSource, TexImageSource {\n open var width: Int\n open var height: Int\n open val videoWidth: Int\n open val videoHeight: Int\n open var poster: String\n open var playsInline: Boolean\n\n companion object {\n val NETWORK_EMPTY: Short\n val NETWORK_IDLE: Short\n val NETWORK_LOADING: Short\n val NETWORK_NO_SOURCE: Short\n val HAVE_NOTHING: Short\n val HAVE_METADATA: Short\n val HAVE_CURRENT_DATA: Short\n val HAVE_FUTURE_DATA: Short\n val HAVE_ENOUGH_DATA: Short\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLAudioElement](https://developer.mozilla.org/en/docs/Web/API/HTMLAudioElement) to Kotlin\n */\npublic external abstract class HTMLAudioElement : HTMLMediaElement {\n companion object {\n val NETWORK_EMPTY: Short\n val NETWORK_IDLE: Short\n val NETWORK_LOADING: Short\n val NETWORK_NO_SOURCE: Short\n val HAVE_NOTHING: Short\n val HAVE_METADATA: Short\n val HAVE_CURRENT_DATA: Short\n val HAVE_FUTURE_DATA: Short\n val HAVE_ENOUGH_DATA: Short\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLTrackElement](https://developer.mozilla.org/en/docs/Web/API/HTMLTrackElement) to Kotlin\n */\npublic external abstract class HTMLTrackElement : HTMLElement {\n open var kind: String\n open var src: String\n open var srclang: String\n open var label: String\n open var default: Boolean\n open val readyState: Short\n open val track: TextTrack\n\n companion object {\n val NONE: Short\n val LOADING: Short\n val LOADED: Short\n val ERROR: Short\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLMediaElement](https://developer.mozilla.org/en/docs/Web/API/HTMLMediaElement) to Kotlin\n */\npublic external abstract class HTMLMediaElement : HTMLElement {\n open val error: MediaError?\n open var src: String\n open var srcObject: MediaProvider?\n open val currentSrc: String\n open var crossOrigin: String?\n open val networkState: Short\n open var preload: String\n open val buffered: TimeRanges\n open val readyState: Short\n open val seeking: Boolean\n open var currentTime: Double\n open val duration: Double\n open val paused: Boolean\n open var defaultPlaybackRate: Double\n open var playbackRate: Double\n open val played: TimeRanges\n open val seekable: TimeRanges\n open val ended: Boolean\n open var autoplay: Boolean\n open var loop: Boolean\n open var controls: Boolean\n open var volume: Double\n open var muted: Boolean\n open var defaultMuted: Boolean\n open val audioTracks: AudioTrackList\n open val videoTracks: VideoTrackList\n open val textTracks: TextTrackList\n open val mediaKeys: MediaKeys?\n open var onencrypted: ((Event) -> dynamic)?\n open var onwaitingforkey: ((Event) -> dynamic)?\n fun load()\n fun canPlayType(type: String): CanPlayTypeResult\n fun fastSeek(time: Double)\n fun getStartDate(): dynamic\n fun play(): Promise\n fun pause()\n fun addTextTrack(kind: TextTrackKind, label: String = definedExternally, language: String = definedExternally): TextTrack\n fun setMediaKeys(mediaKeys: MediaKeys?): Promise\n\n companion object {\n val NETWORK_EMPTY: Short\n val NETWORK_IDLE: Short\n val NETWORK_LOADING: Short\n val NETWORK_NO_SOURCE: Short\n val HAVE_NOTHING: Short\n val HAVE_METADATA: Short\n val HAVE_CURRENT_DATA: Short\n val HAVE_FUTURE_DATA: Short\n val HAVE_ENOUGH_DATA: Short\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [MediaError](https://developer.mozilla.org/en/docs/Web/API/MediaError) to Kotlin\n */\npublic external abstract class MediaError {\n open val code: Short\n\n companion object {\n val MEDIA_ERR_ABORTED: Short\n val MEDIA_ERR_NETWORK: Short\n val MEDIA_ERR_DECODE: Short\n val MEDIA_ERR_SRC_NOT_SUPPORTED: Short\n }\n}\n\n/**\n * Exposes the JavaScript [AudioTrackList](https://developer.mozilla.org/en/docs/Web/API/AudioTrackList) to Kotlin\n */\npublic external abstract class AudioTrackList : EventTarget {\n open val length: Int\n open var onchange: ((Event) -> dynamic)?\n open var onaddtrack: ((TrackEvent) -> dynamic)?\n open var onremovetrack: ((TrackEvent) -> dynamic)?\n fun getTrackById(id: String): AudioTrack?\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun AudioTrackList.get(index: Int): AudioTrack? = asDynamic()[index]\n\n/**\n * Exposes the JavaScript [AudioTrack](https://developer.mozilla.org/en/docs/Web/API/AudioTrack) to Kotlin\n */\npublic external abstract class AudioTrack : UnionAudioTrackOrTextTrackOrVideoTrack {\n open val id: String\n open val kind: String\n open val label: String\n open val language: String\n open var enabled: Boolean\n open val sourceBuffer: SourceBuffer?\n}\n\n/**\n * Exposes the JavaScript [VideoTrackList](https://developer.mozilla.org/en/docs/Web/API/VideoTrackList) to Kotlin\n */\npublic external abstract class VideoTrackList : EventTarget {\n open val length: Int\n open val selectedIndex: Int\n open var onchange: ((Event) -> dynamic)?\n open var onaddtrack: ((TrackEvent) -> dynamic)?\n open var onremovetrack: ((TrackEvent) -> dynamic)?\n fun getTrackById(id: String): VideoTrack?\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun VideoTrackList.get(index: Int): VideoTrack? = asDynamic()[index]\n\n/**\n * Exposes the JavaScript [VideoTrack](https://developer.mozilla.org/en/docs/Web/API/VideoTrack) to Kotlin\n */\npublic external abstract class VideoTrack : UnionAudioTrackOrTextTrackOrVideoTrack {\n open val id: String\n open val kind: String\n open val label: String\n open val language: String\n open var selected: Boolean\n open val sourceBuffer: SourceBuffer?\n}\n\npublic external abstract class TextTrackList : EventTarget {\n open val length: Int\n open var onchange: ((Event) -> dynamic)?\n open var onaddtrack: ((TrackEvent) -> dynamic)?\n open var onremovetrack: ((TrackEvent) -> dynamic)?\n fun getTrackById(id: String): TextTrack?\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun TextTrackList.get(index: Int): TextTrack? = asDynamic()[index]\n\n/**\n * Exposes the JavaScript [TextTrack](https://developer.mozilla.org/en/docs/Web/API/TextTrack) to Kotlin\n */\npublic external abstract class TextTrack : EventTarget, UnionAudioTrackOrTextTrackOrVideoTrack {\n open val kind: TextTrackKind\n open val label: String\n open val language: String\n open val id: String\n open val inBandMetadataTrackDispatchType: String\n open var mode: TextTrackMode\n open val cues: TextTrackCueList?\n open val activeCues: TextTrackCueList?\n open var oncuechange: ((Event) -> dynamic)?\n open val sourceBuffer: SourceBuffer?\n fun addCue(cue: TextTrackCue)\n fun removeCue(cue: TextTrackCue)\n}\n\npublic external abstract class TextTrackCueList {\n open val length: Int\n fun getCueById(id: String): TextTrackCue?\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun TextTrackCueList.get(index: Int): TextTrackCue? = asDynamic()[index]\n\n/**\n * Exposes the JavaScript [TextTrackCue](https://developer.mozilla.org/en/docs/Web/API/TextTrackCue) to Kotlin\n */\npublic external abstract class TextTrackCue : EventTarget {\n open val track: TextTrack?\n open var id: String\n open var startTime: Double\n open var endTime: Double\n open var pauseOnExit: Boolean\n open var onenter: ((Event) -> dynamic)?\n open var onexit: ((Event) -> dynamic)?\n}\n\n/**\n * Exposes the JavaScript [TimeRanges](https://developer.mozilla.org/en/docs/Web/API/TimeRanges) to Kotlin\n */\npublic external abstract class TimeRanges {\n open val length: Int\n fun start(index: Int): Double\n fun end(index: Int): Double\n}\n\n/**\n * Exposes the JavaScript [TrackEvent](https://developer.mozilla.org/en/docs/Web/API/TrackEvent) to Kotlin\n */\npublic external open class TrackEvent(type: String, eventInitDict: TrackEventInit = definedExternally) : Event {\n open val track: UnionAudioTrackOrTextTrackOrVideoTrack?\n\n companion object {\n val NONE: Short\n val CAPTURING_PHASE: Short\n val AT_TARGET: Short\n val BUBBLING_PHASE: Short\n }\n}\n\npublic external interface TrackEventInit : EventInit {\n var track: UnionAudioTrackOrTextTrackOrVideoTrack? /* = null */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun TrackEventInit(track: UnionAudioTrackOrTextTrackOrVideoTrack? = null, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): TrackEventInit {\n val o = js(\"({})\")\n o[\"track\"] = track\n o[\"bubbles\"] = bubbles\n o[\"cancelable\"] = cancelable\n o[\"composed\"] = composed\n return o\n}\n\n/**\n * Exposes the JavaScript [HTMLMapElement](https://developer.mozilla.org/en/docs/Web/API/HTMLMapElement) to Kotlin\n */\npublic external abstract class HTMLMapElement : HTMLElement {\n open var name: String\n open val areas: HTMLCollection\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLAreaElement](https://developer.mozilla.org/en/docs/Web/API/HTMLAreaElement) to Kotlin\n */\npublic external abstract class HTMLAreaElement : HTMLElement, HTMLHyperlinkElementUtils {\n open var alt: String\n open var coords: String\n open var shape: String\n open var target: String\n open var download: String\n open var ping: String\n open var rel: String\n open val relList: DOMTokenList\n open var referrerPolicy: String\n open var noHref: Boolean\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLTableElement](https://developer.mozilla.org/en/docs/Web/API/HTMLTableElement) to Kotlin\n */\npublic external abstract class HTMLTableElement : HTMLElement {\n open var caption: HTMLTableCaptionElement?\n open var tHead: HTMLTableSectionElement?\n open var tFoot: HTMLTableSectionElement?\n open val tBodies: HTMLCollection\n open val rows: HTMLCollection\n open var align: String\n open var border: String\n open var frame: String\n open var rules: String\n open var summary: String\n open var width: String\n open var bgColor: String\n open var cellPadding: String\n open var cellSpacing: String\n fun createCaption(): HTMLTableCaptionElement\n fun deleteCaption()\n fun createTHead(): HTMLTableSectionElement\n fun deleteTHead()\n fun createTFoot(): HTMLTableSectionElement\n fun deleteTFoot()\n fun createTBody(): HTMLTableSectionElement\n fun insertRow(index: Int = definedExternally): HTMLTableRowElement\n fun deleteRow(index: Int)\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLTableCaptionElement](https://developer.mozilla.org/en/docs/Web/API/HTMLTableCaptionElement) to Kotlin\n */\npublic external abstract class HTMLTableCaptionElement : HTMLElement {\n open var align: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLTableColElement](https://developer.mozilla.org/en/docs/Web/API/HTMLTableColElement) to Kotlin\n */\npublic external abstract class HTMLTableColElement : HTMLElement {\n open var span: Int\n open var align: String\n open var ch: String\n open var chOff: String\n open var vAlign: String\n open var width: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLTableSectionElement](https://developer.mozilla.org/en/docs/Web/API/HTMLTableSectionElement) to Kotlin\n */\npublic external abstract class HTMLTableSectionElement : HTMLElement {\n open val rows: HTMLCollection\n open var align: String\n open var ch: String\n open var chOff: String\n open var vAlign: String\n fun insertRow(index: Int = definedExternally): HTMLElement\n fun deleteRow(index: Int)\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLTableRowElement](https://developer.mozilla.org/en/docs/Web/API/HTMLTableRowElement) to Kotlin\n */\npublic external abstract class HTMLTableRowElement : HTMLElement {\n open val rowIndex: Int\n open val sectionRowIndex: Int\n open val cells: HTMLCollection\n open var align: String\n open var ch: String\n open var chOff: String\n open var vAlign: String\n open var bgColor: String\n fun insertCell(index: Int = definedExternally): HTMLElement\n fun deleteCell(index: Int)\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLTableCellElement](https://developer.mozilla.org/en/docs/Web/API/HTMLTableCellElement) to Kotlin\n */\npublic external abstract class HTMLTableCellElement : HTMLElement {\n open var colSpan: Int\n open var rowSpan: Int\n open var headers: String\n open val cellIndex: Int\n open var scope: String\n open var abbr: String\n open var align: String\n open var axis: String\n open var height: String\n open var width: String\n open var ch: String\n open var chOff: String\n open var noWrap: Boolean\n open var vAlign: String\n open var bgColor: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLFormElement](https://developer.mozilla.org/en/docs/Web/API/HTMLFormElement) to Kotlin\n */\npublic external abstract class HTMLFormElement : HTMLElement {\n open var acceptCharset: String\n open var action: String\n open var autocomplete: String\n open var enctype: String\n open var encoding: String\n open var method: String\n open var name: String\n open var noValidate: Boolean\n open var target: String\n open val elements: HTMLFormControlsCollection\n open val length: Int\n fun submit()\n fun reset()\n fun checkValidity(): Boolean\n fun reportValidity(): Boolean\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun HTMLFormElement.get(index: Int): Element? = asDynamic()[index]\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun HTMLFormElement.get(name: String): UnionElementOrRadioNodeList? = asDynamic()[name]\n\n/**\n * Exposes the JavaScript [HTMLLabelElement](https://developer.mozilla.org/en/docs/Web/API/HTMLLabelElement) to Kotlin\n */\npublic external abstract class HTMLLabelElement : HTMLElement {\n open val form: HTMLFormElement?\n open var htmlFor: String\n open val control: HTMLElement?\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLInputElement](https://developer.mozilla.org/en/docs/Web/API/HTMLInputElement) to Kotlin\n */\npublic external abstract class HTMLInputElement : HTMLElement {\n open var accept: String\n open var alt: String\n open var autocomplete: String\n open var autofocus: Boolean\n open var defaultChecked: Boolean\n open var checked: Boolean\n open var dirName: String\n open var disabled: Boolean\n open val form: HTMLFormElement?\n open val files: FileList?\n open var formAction: String\n open var formEnctype: String\n open var formMethod: String\n open var formNoValidate: Boolean\n open var formTarget: String\n open var height: Int\n open var indeterminate: Boolean\n open var inputMode: String\n open val list: HTMLElement?\n open var max: String\n open var maxLength: Int\n open var min: String\n open var minLength: Int\n open var multiple: Boolean\n open var name: String\n open var pattern: String\n open var placeholder: String\n open var readOnly: Boolean\n open var required: Boolean\n open var size: Int\n open var src: String\n open var step: String\n open var type: String\n open var defaultValue: String\n open var value: String\n open var valueAsDate: dynamic\n open var valueAsNumber: Double\n open var width: Int\n open val willValidate: Boolean\n open val validity: ValidityState\n open val validationMessage: String\n open val labels: NodeList\n open var selectionStart: Int?\n open var selectionEnd: Int?\n open var selectionDirection: String?\n open var align: String\n open var useMap: String\n fun stepUp(n: Int = definedExternally)\n fun stepDown(n: Int = definedExternally)\n fun checkValidity(): Boolean\n fun reportValidity(): Boolean\n fun setCustomValidity(error: String)\n fun select()\n fun setRangeText(replacement: String)\n fun setRangeText(replacement: String, start: Int, end: Int, selectionMode: SelectionMode = definedExternally)\n fun setSelectionRange(start: Int, end: Int, direction: String = definedExternally)\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLButtonElement](https://developer.mozilla.org/en/docs/Web/API/HTMLButtonElement) to Kotlin\n */\npublic external abstract class HTMLButtonElement : HTMLElement {\n open var autofocus: Boolean\n open var disabled: Boolean\n open val form: HTMLFormElement?\n open var formAction: String\n open var formEnctype: String\n open var formMethod: String\n open var formNoValidate: Boolean\n open var formTarget: String\n open var name: String\n open var type: String\n open var value: String\n open var menu: HTMLMenuElement?\n open val willValidate: Boolean\n open val validity: ValidityState\n open val validationMessage: String\n open val labels: NodeList\n fun checkValidity(): Boolean\n fun reportValidity(): Boolean\n fun setCustomValidity(error: String)\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLSelectElement](https://developer.mozilla.org/en/docs/Web/API/HTMLSelectElement) to Kotlin\n */\npublic external abstract class HTMLSelectElement : HTMLElement, ItemArrayLike {\n open var autocomplete: String\n open var autofocus: Boolean\n open var disabled: Boolean\n open val form: HTMLFormElement?\n open var multiple: Boolean\n open var name: String\n open var required: Boolean\n open var size: Int\n open val type: String\n open val options: HTMLOptionsCollection\n override var length: Int\n open val selectedOptions: HTMLCollection\n open var selectedIndex: Int\n open var value: String\n open val willValidate: Boolean\n open val validity: ValidityState\n open val validationMessage: String\n open val labels: NodeList\n fun namedItem(name: String): HTMLOptionElement?\n fun add(element: UnionHTMLOptGroupElementOrHTMLOptionElement, before: dynamic = definedExternally)\n fun remove(index: Int)\n fun checkValidity(): Boolean\n fun reportValidity(): Boolean\n fun setCustomValidity(error: String)\n override fun item(index: Int): Element?\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun HTMLSelectElement.get(index: Int): Element? = asDynamic()[index]\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun HTMLSelectElement.set(index: Int, option: HTMLOptionElement?) { asDynamic()[index] = option }\n\n/**\n * Exposes the JavaScript [HTMLDataListElement](https://developer.mozilla.org/en/docs/Web/API/HTMLDataListElement) to Kotlin\n */\npublic external abstract class HTMLDataListElement : HTMLElement {\n open val options: HTMLCollection\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLOptGroupElement](https://developer.mozilla.org/en/docs/Web/API/HTMLOptGroupElement) to Kotlin\n */\npublic external abstract class HTMLOptGroupElement : HTMLElement, UnionHTMLOptGroupElementOrHTMLOptionElement {\n open var disabled: Boolean\n open var label: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLOptionElement](https://developer.mozilla.org/en/docs/Web/API/HTMLOptionElement) to Kotlin\n */\npublic external abstract class HTMLOptionElement : HTMLElement, UnionHTMLOptGroupElementOrHTMLOptionElement {\n open var disabled: Boolean\n open val form: HTMLFormElement?\n open var label: String\n open var defaultSelected: Boolean\n open var selected: Boolean\n open var value: String\n open var text: String\n open val index: Int\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLTextAreaElement](https://developer.mozilla.org/en/docs/Web/API/HTMLTextAreaElement) to Kotlin\n */\npublic external abstract class HTMLTextAreaElement : HTMLElement {\n open var autocomplete: String\n open var autofocus: Boolean\n open var cols: Int\n open var dirName: String\n open var disabled: Boolean\n open val form: HTMLFormElement?\n open var inputMode: String\n open var maxLength: Int\n open var minLength: Int\n open var name: String\n open var placeholder: String\n open var readOnly: Boolean\n open var required: Boolean\n open var rows: Int\n open var wrap: String\n open val type: String\n open var defaultValue: String\n open var value: String\n open val textLength: Int\n open val willValidate: Boolean\n open val validity: ValidityState\n open val validationMessage: String\n open val labels: NodeList\n open var selectionStart: Int?\n open var selectionEnd: Int?\n open var selectionDirection: String?\n fun checkValidity(): Boolean\n fun reportValidity(): Boolean\n fun setCustomValidity(error: String)\n fun select()\n fun setRangeText(replacement: String)\n fun setRangeText(replacement: String, start: Int, end: Int, selectionMode: SelectionMode = definedExternally)\n fun setSelectionRange(start: Int, end: Int, direction: String = definedExternally)\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLKeygenElement](https://developer.mozilla.org/en/docs/Web/API/HTMLKeygenElement) to Kotlin\n */\npublic external abstract class HTMLKeygenElement : HTMLElement {\n open var autofocus: Boolean\n open var challenge: String\n open var disabled: Boolean\n open val form: HTMLFormElement?\n open var keytype: String\n open var name: String\n open val type: String\n open val willValidate: Boolean\n open val validity: ValidityState\n open val validationMessage: String\n open val labels: NodeList\n fun checkValidity(): Boolean\n fun reportValidity(): Boolean\n fun setCustomValidity(error: String)\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLOutputElement](https://developer.mozilla.org/en/docs/Web/API/HTMLOutputElement) to Kotlin\n */\npublic external abstract class HTMLOutputElement : HTMLElement {\n open val htmlFor: DOMTokenList\n open val form: HTMLFormElement?\n open var name: String\n open val type: String\n open var defaultValue: String\n open var value: String\n open val willValidate: Boolean\n open val validity: ValidityState\n open val validationMessage: String\n open val labels: NodeList\n fun checkValidity(): Boolean\n fun reportValidity(): Boolean\n fun setCustomValidity(error: String)\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLProgressElement](https://developer.mozilla.org/en/docs/Web/API/HTMLProgressElement) to Kotlin\n */\npublic external abstract class HTMLProgressElement : HTMLElement {\n open var value: Double\n open var max: Double\n open val position: Double\n open val labels: NodeList\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLMeterElement](https://developer.mozilla.org/en/docs/Web/API/HTMLMeterElement) to Kotlin\n */\npublic external abstract class HTMLMeterElement : HTMLElement {\n open var value: Double\n open var min: Double\n open var max: Double\n open var low: Double\n open var high: Double\n open var optimum: Double\n open val labels: NodeList\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLFieldSetElement](https://developer.mozilla.org/en/docs/Web/API/HTMLFieldSetElement) to Kotlin\n */\npublic external abstract class HTMLFieldSetElement : HTMLElement {\n open var disabled: Boolean\n open val form: HTMLFormElement?\n open var name: String\n open val type: String\n open val elements: HTMLCollection\n open val willValidate: Boolean\n open val validity: ValidityState\n open val validationMessage: String\n fun checkValidity(): Boolean\n fun reportValidity(): Boolean\n fun setCustomValidity(error: String)\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLLegendElement](https://developer.mozilla.org/en/docs/Web/API/HTMLLegendElement) to Kotlin\n */\npublic external abstract class HTMLLegendElement : HTMLElement {\n open val form: HTMLFormElement?\n open var align: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [ValidityState](https://developer.mozilla.org/en/docs/Web/API/ValidityState) to Kotlin\n */\npublic external abstract class ValidityState {\n open val valueMissing: Boolean\n open val typeMismatch: Boolean\n open val patternMismatch: Boolean\n open val tooLong: Boolean\n open val tooShort: Boolean\n open val rangeUnderflow: Boolean\n open val rangeOverflow: Boolean\n open val stepMismatch: Boolean\n open val badInput: Boolean\n open val customError: Boolean\n open val valid: Boolean\n}\n\n/**\n * Exposes the JavaScript [HTMLDetailsElement](https://developer.mozilla.org/en/docs/Web/API/HTMLDetailsElement) to Kotlin\n */\npublic external abstract class HTMLDetailsElement : HTMLElement {\n open var open: Boolean\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\npublic external abstract class HTMLMenuElement : HTMLElement {\n open var type: String\n open var label: String\n open var compact: Boolean\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\npublic external abstract class HTMLMenuItemElement : HTMLElement {\n open var type: String\n open var label: String\n open var icon: String\n open var disabled: Boolean\n open var checked: Boolean\n open var radiogroup: String\n open var default: Boolean\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\npublic external open class RelatedEvent(type: String, eventInitDict: RelatedEventInit = definedExternally) : Event {\n open val relatedTarget: EventTarget?\n\n companion object {\n val NONE: Short\n val CAPTURING_PHASE: Short\n val AT_TARGET: Short\n val BUBBLING_PHASE: Short\n }\n}\n\npublic external interface RelatedEventInit : EventInit {\n var relatedTarget: EventTarget? /* = null */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun RelatedEventInit(relatedTarget: EventTarget? = null, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): RelatedEventInit {\n val o = js(\"({})\")\n o[\"relatedTarget\"] = relatedTarget\n o[\"bubbles\"] = bubbles\n o[\"cancelable\"] = cancelable\n o[\"composed\"] = composed\n return o\n}\n\n/**\n * Exposes the JavaScript [HTMLDialogElement](https://developer.mozilla.org/en/docs/Web/API/HTMLDialogElement) to Kotlin\n */\npublic external abstract class HTMLDialogElement : HTMLElement {\n open var open: Boolean\n open var returnValue: String\n fun show(anchor: UnionElementOrMouseEvent = definedExternally)\n fun showModal(anchor: UnionElementOrMouseEvent = definedExternally)\n fun close(returnValue: String = definedExternally)\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLScriptElement](https://developer.mozilla.org/en/docs/Web/API/HTMLScriptElement) to Kotlin\n */\npublic external abstract class HTMLScriptElement : HTMLElement, HTMLOrSVGScriptElement {\n open var src: String\n open var type: String\n open var charset: String\n open var async: Boolean\n open var defer: Boolean\n open var crossOrigin: String?\n open var text: String\n open var nonce: String\n open var event: String\n open var htmlFor: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLTemplateElement](https://developer.mozilla.org/en/docs/Web/API/HTMLTemplateElement) to Kotlin\n */\npublic external abstract class HTMLTemplateElement : HTMLElement {\n open val content: DocumentFragment\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLSlotElement](https://developer.mozilla.org/en/docs/Web/API/HTMLSlotElement) to Kotlin\n */\npublic external abstract class HTMLSlotElement : HTMLElement {\n open var name: String\n fun assignedNodes(options: AssignedNodesOptions = definedExternally): Array\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\npublic external interface AssignedNodesOptions {\n var flatten: Boolean? /* = false */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun AssignedNodesOptions(flatten: Boolean? = false): AssignedNodesOptions {\n val o = js(\"({})\")\n o[\"flatten\"] = flatten\n return o\n}\n\n/**\n * Exposes the JavaScript [HTMLCanvasElement](https://developer.mozilla.org/en/docs/Web/API/HTMLCanvasElement) to Kotlin\n */\npublic external abstract class HTMLCanvasElement : HTMLElement, CanvasImageSource, TexImageSource {\n open var width: Int\n open var height: Int\n fun getContext(contextId: String, vararg arguments: Any?): RenderingContext?\n fun toDataURL(type: String = definedExternally, quality: Any? = definedExternally): String\n fun toBlob(_callback: (Blob?) -> Unit, type: String = definedExternally, quality: Any? = definedExternally)\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\npublic external interface CanvasRenderingContext2DSettings {\n var alpha: Boolean? /* = true */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun CanvasRenderingContext2DSettings(alpha: Boolean? = true): CanvasRenderingContext2DSettings {\n val o = js(\"({})\")\n o[\"alpha\"] = alpha\n return o\n}\n\n/**\n * Exposes the JavaScript [CanvasRenderingContext2D](https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D) to Kotlin\n */\npublic external abstract class CanvasRenderingContext2D : CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, CanvasDrawPath, CanvasUserInterface, CanvasText, CanvasDrawImage, CanvasHitRegion, CanvasImageData, CanvasPathDrawingStyles, CanvasTextDrawingStyles, CanvasPath, RenderingContext {\n open val canvas: HTMLCanvasElement\n}\n\npublic external interface CanvasState {\n fun save()\n fun restore()\n}\n\npublic external interface CanvasTransform {\n fun scale(x: Double, y: Double)\n fun rotate(angle: Double)\n fun translate(x: Double, y: Double)\n fun transform(a: Double, b: Double, c: Double, d: Double, e: Double, f: Double)\n fun getTransform(): DOMMatrix\n fun setTransform(a: Double, b: Double, c: Double, d: Double, e: Double, f: Double)\n fun setTransform(transform: dynamic = definedExternally)\n fun resetTransform()\n}\n\npublic external interface CanvasCompositing {\n var globalAlpha: Double\n var globalCompositeOperation: String\n}\n\npublic external interface CanvasImageSmoothing {\n var imageSmoothingEnabled: Boolean\n var imageSmoothingQuality: ImageSmoothingQuality\n}\n\npublic external interface CanvasFillStrokeStyles {\n var strokeStyle: dynamic\n get() = definedExternally\n set(value) = definedExternally\n var fillStyle: dynamic\n get() = definedExternally\n set(value) = definedExternally\n fun createLinearGradient(x0: Double, y0: Double, x1: Double, y1: Double): CanvasGradient\n fun createRadialGradient(x0: Double, y0: Double, r0: Double, x1: Double, y1: Double, r1: Double): CanvasGradient\n fun createPattern(image: CanvasImageSource, repetition: String): CanvasPattern?\n}\n\npublic external interface CanvasShadowStyles {\n var shadowOffsetX: Double\n var shadowOffsetY: Double\n var shadowBlur: Double\n var shadowColor: String\n}\n\npublic external interface CanvasFilters {\n var filter: String\n}\n\npublic external interface CanvasRect {\n fun clearRect(x: Double, y: Double, w: Double, h: Double)\n fun fillRect(x: Double, y: Double, w: Double, h: Double)\n fun strokeRect(x: Double, y: Double, w: Double, h: Double)\n}\n\npublic external interface CanvasDrawPath {\n fun beginPath()\n fun fill(fillRule: CanvasFillRule = definedExternally)\n fun fill(path: Path2D, fillRule: CanvasFillRule = definedExternally)\n fun stroke()\n fun stroke(path: Path2D)\n fun clip(fillRule: CanvasFillRule = definedExternally)\n fun clip(path: Path2D, fillRule: CanvasFillRule = definedExternally)\n fun resetClip()\n fun isPointInPath(x: Double, y: Double, fillRule: CanvasFillRule = definedExternally): Boolean\n fun isPointInPath(path: Path2D, x: Double, y: Double, fillRule: CanvasFillRule = definedExternally): Boolean\n fun isPointInStroke(x: Double, y: Double): Boolean\n fun isPointInStroke(path: Path2D, x: Double, y: Double): Boolean\n}\n\npublic external interface CanvasUserInterface {\n fun drawFocusIfNeeded(element: Element)\n fun drawFocusIfNeeded(path: Path2D, element: Element)\n fun scrollPathIntoView()\n fun scrollPathIntoView(path: Path2D)\n}\n\npublic external interface CanvasText {\n fun fillText(text: String, x: Double, y: Double, maxWidth: Double = definedExternally)\n fun strokeText(text: String, x: Double, y: Double, maxWidth: Double = definedExternally)\n fun measureText(text: String): TextMetrics\n}\n\npublic external interface CanvasDrawImage {\n fun drawImage(image: CanvasImageSource, dx: Double, dy: Double)\n fun drawImage(image: CanvasImageSource, dx: Double, dy: Double, dw: Double, dh: Double)\n fun drawImage(image: CanvasImageSource, sx: Double, sy: Double, sw: Double, sh: Double, dx: Double, dy: Double, dw: Double, dh: Double)\n}\n\npublic external interface CanvasHitRegion {\n fun addHitRegion(options: HitRegionOptions = definedExternally)\n fun removeHitRegion(id: String)\n fun clearHitRegions()\n}\n\npublic external interface CanvasImageData {\n fun createImageData(sw: Double, sh: Double): ImageData\n fun createImageData(imagedata: ImageData): ImageData\n fun getImageData(sx: Double, sy: Double, sw: Double, sh: Double): ImageData\n fun putImageData(imagedata: ImageData, dx: Double, dy: Double)\n fun putImageData(imagedata: ImageData, dx: Double, dy: Double, dirtyX: Double, dirtyY: Double, dirtyWidth: Double, dirtyHeight: Double)\n}\n\npublic external interface CanvasPathDrawingStyles {\n var lineWidth: Double\n var lineCap: CanvasLineCap\n var lineJoin: CanvasLineJoin\n var miterLimit: Double\n var lineDashOffset: Double\n fun setLineDash(segments: Array)\n fun getLineDash(): Array\n}\n\npublic external interface CanvasTextDrawingStyles {\n var font: String\n var textAlign: CanvasTextAlign\n var textBaseline: CanvasTextBaseline\n var direction: CanvasDirection\n}\n\npublic external interface CanvasPath {\n fun closePath()\n fun moveTo(x: Double, y: Double)\n fun lineTo(x: Double, y: Double)\n fun quadraticCurveTo(cpx: Double, cpy: Double, x: Double, y: Double)\n fun bezierCurveTo(cp1x: Double, cp1y: Double, cp2x: Double, cp2y: Double, x: Double, y: Double)\n fun arcTo(x1: Double, y1: Double, x2: Double, y2: Double, radius: Double)\n fun arcTo(x1: Double, y1: Double, x2: Double, y2: Double, radiusX: Double, radiusY: Double, rotation: Double)\n fun rect(x: Double, y: Double, w: Double, h: Double)\n fun arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double, anticlockwise: Boolean = definedExternally)\n fun ellipse(x: Double, y: Double, radiusX: Double, radiusY: Double, rotation: Double, startAngle: Double, endAngle: Double, anticlockwise: Boolean = definedExternally)\n}\n\n/**\n * Exposes the JavaScript [CanvasGradient](https://developer.mozilla.org/en/docs/Web/API/CanvasGradient) to Kotlin\n */\npublic external abstract class CanvasGradient {\n fun addColorStop(offset: Double, color: String)\n}\n\n/**\n * Exposes the JavaScript [CanvasPattern](https://developer.mozilla.org/en/docs/Web/API/CanvasPattern) to Kotlin\n */\npublic external abstract class CanvasPattern {\n fun setTransform(transform: dynamic = definedExternally)\n}\n\n/**\n * Exposes the JavaScript [TextMetrics](https://developer.mozilla.org/en/docs/Web/API/TextMetrics) to Kotlin\n */\npublic external abstract class TextMetrics {\n open val width: Double\n open val actualBoundingBoxLeft: Double\n open val actualBoundingBoxRight: Double\n open val fontBoundingBoxAscent: Double\n open val fontBoundingBoxDescent: Double\n open val actualBoundingBoxAscent: Double\n open val actualBoundingBoxDescent: Double\n open val emHeightAscent: Double\n open val emHeightDescent: Double\n open val hangingBaseline: Double\n open val alphabeticBaseline: Double\n open val ideographicBaseline: Double\n}\n\npublic external interface HitRegionOptions {\n var path: Path2D? /* = null */\n get() = definedExternally\n set(value) = definedExternally\n var fillRule: CanvasFillRule? /* = CanvasFillRule.NONZERO */\n get() = definedExternally\n set(value) = definedExternally\n var id: String? /* = \"\" */\n get() = definedExternally\n set(value) = definedExternally\n var parentID: String? /* = null */\n get() = definedExternally\n set(value) = definedExternally\n var cursor: String? /* = \"inherit\" */\n get() = definedExternally\n set(value) = definedExternally\n var control: Element? /* = null */\n get() = definedExternally\n set(value) = definedExternally\n var label: String? /* = null */\n get() = definedExternally\n set(value) = definedExternally\n var role: String? /* = null */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun HitRegionOptions(path: Path2D? = null, fillRule: CanvasFillRule? = CanvasFillRule.NONZERO, id: String? = \"\", parentID: String? = null, cursor: String? = \"inherit\", control: Element? = null, label: String? = null, role: String? = null): HitRegionOptions {\n val o = js(\"({})\")\n o[\"path\"] = path\n o[\"fillRule\"] = fillRule\n o[\"id\"] = id\n o[\"parentID\"] = parentID\n o[\"cursor\"] = cursor\n o[\"control\"] = control\n o[\"label\"] = label\n o[\"role\"] = role\n return o\n}\n\n/**\n * Exposes the JavaScript [ImageData](https://developer.mozilla.org/en/docs/Web/API/ImageData) to Kotlin\n */\npublic external open class ImageData : ImageBitmapSource, TexImageSource {\n constructor(sw: Int, sh: Int)\n constructor(data: Uint8ClampedArray, sw: Int, sh: Int = definedExternally)\n open val width: Int\n open val height: Int\n open val data: Uint8ClampedArray\n}\n\n/**\n * Exposes the JavaScript [Path2D](https://developer.mozilla.org/en/docs/Web/API/Path2D) to Kotlin\n */\npublic external open class Path2D() : CanvasPath {\n constructor(path: Path2D)\n constructor(paths: Array, fillRule: CanvasFillRule = definedExternally)\n constructor(d: String)\n fun addPath(path: Path2D, transform: dynamic = definedExternally)\n override fun closePath()\n override fun moveTo(x: Double, y: Double)\n override fun lineTo(x: Double, y: Double)\n override fun quadraticCurveTo(cpx: Double, cpy: Double, x: Double, y: Double)\n override fun bezierCurveTo(cp1x: Double, cp1y: Double, cp2x: Double, cp2y: Double, x: Double, y: Double)\n override fun arcTo(x1: Double, y1: Double, x2: Double, y2: Double, radius: Double)\n override fun arcTo(x1: Double, y1: Double, x2: Double, y2: Double, radiusX: Double, radiusY: Double, rotation: Double)\n override fun rect(x: Double, y: Double, w: Double, h: Double)\n override fun arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double, anticlockwise: Boolean /* = definedExternally */)\n override fun ellipse(x: Double, y: Double, radiusX: Double, radiusY: Double, rotation: Double, startAngle: Double, endAngle: Double, anticlockwise: Boolean /* = definedExternally */)\n}\n\n/**\n * Exposes the JavaScript [ImageBitmapRenderingContext](https://developer.mozilla.org/en/docs/Web/API/ImageBitmapRenderingContext) to Kotlin\n */\npublic external abstract class ImageBitmapRenderingContext {\n open val canvas: HTMLCanvasElement\n fun transferFromImageBitmap(bitmap: ImageBitmap?)\n}\n\npublic external interface ImageBitmapRenderingContextSettings {\n var alpha: Boolean? /* = true */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun ImageBitmapRenderingContextSettings(alpha: Boolean? = true): ImageBitmapRenderingContextSettings {\n val o = js(\"({})\")\n o[\"alpha\"] = alpha\n return o\n}\n\n/**\n * Exposes the JavaScript [CustomElementRegistry](https://developer.mozilla.org/en/docs/Web/API/CustomElementRegistry) to Kotlin\n */\npublic external abstract class CustomElementRegistry {\n fun define(name: String, constructor: () -> dynamic, options: ElementDefinitionOptions = definedExternally)\n fun get(name: String): Any?\n fun whenDefined(name: String): Promise\n}\n\npublic external interface ElementDefinitionOptions {\n var extends: String?\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun ElementDefinitionOptions(extends: String? = undefined): ElementDefinitionOptions {\n val o = js(\"({})\")\n o[\"extends\"] = extends\n return o\n}\n\npublic external interface ElementContentEditable {\n var contentEditable: String\n val isContentEditable: Boolean\n}\n\n/**\n * Exposes the JavaScript [DataTransfer](https://developer.mozilla.org/en/docs/Web/API/DataTransfer) to Kotlin\n */\npublic external abstract class DataTransfer {\n open var dropEffect: String\n open var effectAllowed: String\n open val items: DataTransferItemList\n open val types: Array\n open val files: FileList\n fun setDragImage(image: Element, x: Int, y: Int)\n fun getData(format: String): String\n fun setData(format: String, data: String)\n fun clearData(format: String = definedExternally)\n}\n\n/**\n * Exposes the JavaScript [DataTransferItemList](https://developer.mozilla.org/en/docs/Web/API/DataTransferItemList) to Kotlin\n */\npublic external abstract class DataTransferItemList {\n open val length: Int\n fun add(data: String, type: String): DataTransferItem?\n fun add(data: File): DataTransferItem?\n fun remove(index: Int)\n fun clear()\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun DataTransferItemList.get(index: Int): DataTransferItem? = asDynamic()[index]\n\n/**\n * Exposes the JavaScript [DataTransferItem](https://developer.mozilla.org/en/docs/Web/API/DataTransferItem) to Kotlin\n */\npublic external abstract class DataTransferItem {\n open val kind: String\n open val type: String\n fun getAsString(_callback: ((String) -> Unit)?)\n fun getAsFile(): File?\n}\n\n/**\n * Exposes the JavaScript [DragEvent](https://developer.mozilla.org/en/docs/Web/API/DragEvent) to Kotlin\n */\npublic external open class DragEvent(type: String, eventInitDict: DragEventInit = definedExternally) : MouseEvent {\n open val dataTransfer: DataTransfer?\n\n companion object {\n val NONE: Short\n val CAPTURING_PHASE: Short\n val AT_TARGET: Short\n val BUBBLING_PHASE: Short\n }\n}\n\npublic external interface DragEventInit : MouseEventInit {\n var dataTransfer: DataTransfer? /* = null */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun DragEventInit(dataTransfer: DataTransfer? = null, screenX: Int? = 0, screenY: Int? = 0, clientX: Int? = 0, clientY: Int? = 0, button: Short? = 0, buttons: Short? = 0, relatedTarget: EventTarget? = null, region: String? = null, ctrlKey: Boolean? = false, shiftKey: Boolean? = false, altKey: Boolean? = false, metaKey: Boolean? = false, modifierAltGraph: Boolean? = false, modifierCapsLock: Boolean? = false, modifierFn: Boolean? = false, modifierFnLock: Boolean? = false, modifierHyper: Boolean? = false, modifierNumLock: Boolean? = false, modifierScrollLock: Boolean? = false, modifierSuper: Boolean? = false, modifierSymbol: Boolean? = false, modifierSymbolLock: Boolean? = false, view: Window? = null, detail: Int? = 0, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): DragEventInit {\n val o = js(\"({})\")\n o[\"dataTransfer\"] = dataTransfer\n o[\"screenX\"] = screenX\n o[\"screenY\"] = screenY\n o[\"clientX\"] = clientX\n o[\"clientY\"] = clientY\n o[\"button\"] = button\n o[\"buttons\"] = buttons\n o[\"relatedTarget\"] = relatedTarget\n o[\"region\"] = region\n o[\"ctrlKey\"] = ctrlKey\n o[\"shiftKey\"] = shiftKey\n o[\"altKey\"] = altKey\n o[\"metaKey\"] = metaKey\n o[\"modifierAltGraph\"] = modifierAltGraph\n o[\"modifierCapsLock\"] = modifierCapsLock\n o[\"modifierFn\"] = modifierFn\n o[\"modifierFnLock\"] = modifierFnLock\n o[\"modifierHyper\"] = modifierHyper\n o[\"modifierNumLock\"] = modifierNumLock\n o[\"modifierScrollLock\"] = modifierScrollLock\n o[\"modifierSuper\"] = modifierSuper\n o[\"modifierSymbol\"] = modifierSymbol\n o[\"modifierSymbolLock\"] = modifierSymbolLock\n o[\"view\"] = view\n o[\"detail\"] = detail\n o[\"bubbles\"] = bubbles\n o[\"cancelable\"] = cancelable\n o[\"composed\"] = composed\n return o\n}\n\n/**\n * Exposes the JavaScript [Window](https://developer.mozilla.org/en/docs/Web/API/Window) to Kotlin\n */\npublic external abstract class Window : EventTarget, GlobalEventHandlers, WindowEventHandlers, WindowOrWorkerGlobalScope, WindowSessionStorage, WindowLocalStorage, GlobalPerformance, UnionMessagePortOrWindowProxy {\n open val window: Window\n open val self: Window\n open val document: Document\n open var name: String\n open val location: Location\n open val history: History\n open val customElements: CustomElementRegistry\n open val locationbar: BarProp\n open val menubar: BarProp\n open val personalbar: BarProp\n open val scrollbars: BarProp\n open val statusbar: BarProp\n open val toolbar: BarProp\n open var status: String\n open val closed: Boolean\n open val frames: Window\n open val length: Int\n open val top: Window\n open var opener: Any?\n open val parent: Window\n open val frameElement: Element?\n open val navigator: Navigator\n open val applicationCache: ApplicationCache\n open val external: External\n open val screen: Screen\n open val innerWidth: Int\n open val innerHeight: Int\n open val scrollX: Double\n open val pageXOffset: Double\n open val scrollY: Double\n open val pageYOffset: Double\n open val screenX: Int\n open val screenY: Int\n open val outerWidth: Int\n open val outerHeight: Int\n open val devicePixelRatio: Double\n fun close()\n fun stop()\n fun focus()\n fun blur()\n fun open(url: String = definedExternally, target: String = definedExternally, features: String = definedExternally): Window?\n fun alert()\n fun alert(message: String)\n fun confirm(message: String = definedExternally): Boolean\n fun prompt(message: String = definedExternally, default: String = definedExternally): String?\n fun print()\n fun requestAnimationFrame(callback: (Double) -> Unit): Int\n fun cancelAnimationFrame(handle: Int)\n fun postMessage(message: Any?, targetOrigin: String, transfer: Array = definedExternally)\n fun captureEvents()\n fun releaseEvents()\n fun matchMedia(query: String): MediaQueryList\n fun moveTo(x: Int, y: Int)\n fun moveBy(x: Int, y: Int)\n fun resizeTo(x: Int, y: Int)\n fun resizeBy(x: Int, y: Int)\n fun scroll(options: ScrollToOptions = definedExternally)\n fun scroll(x: Double, y: Double)\n fun scrollTo(options: ScrollToOptions = definedExternally)\n fun scrollTo(x: Double, y: Double)\n fun scrollBy(options: ScrollToOptions = definedExternally)\n fun scrollBy(x: Double, y: Double)\n fun getComputedStyle(elt: Element, pseudoElt: String? = definedExternally): CSSStyleDeclaration\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun Window.get(name: String): dynamic = asDynamic()[name]\n\npublic external abstract class BarProp {\n open val visible: Boolean\n}\n\n/**\n * Exposes the JavaScript [History](https://developer.mozilla.org/en/docs/Web/API/History) to Kotlin\n */\npublic external abstract class History {\n open val length: Int\n open var scrollRestoration: ScrollRestoration\n open val state: Any?\n fun go(delta: Int = definedExternally)\n fun back()\n fun forward()\n fun pushState(data: Any?, title: String, url: String? = definedExternally)\n fun replaceState(data: Any?, title: String, url: String? = definedExternally)\n}\n\n/**\n * Exposes the JavaScript [Location](https://developer.mozilla.org/en/docs/Web/API/Location) to Kotlin\n */\npublic external abstract class Location {\n open var href: String\n open val origin: String\n open var protocol: String\n open var host: String\n open var hostname: String\n open var port: String\n open var pathname: String\n open var search: String\n open var hash: String\n open val ancestorOrigins: Array\n fun assign(url: String)\n fun replace(url: String)\n fun reload()\n}\n\n/**\n * Exposes the JavaScript [PopStateEvent](https://developer.mozilla.org/en/docs/Web/API/PopStateEvent) to Kotlin\n */\npublic external open class PopStateEvent(type: String, eventInitDict: PopStateEventInit = definedExternally) : Event {\n open val state: Any?\n\n companion object {\n val NONE: Short\n val CAPTURING_PHASE: Short\n val AT_TARGET: Short\n val BUBBLING_PHASE: Short\n }\n}\n\npublic external interface PopStateEventInit : EventInit {\n var state: Any? /* = null */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun PopStateEventInit(state: Any? = null, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): PopStateEventInit {\n val o = js(\"({})\")\n o[\"state\"] = state\n o[\"bubbles\"] = bubbles\n o[\"cancelable\"] = cancelable\n o[\"composed\"] = composed\n return o\n}\n\n/**\n * Exposes the JavaScript [HashChangeEvent](https://developer.mozilla.org/en/docs/Web/API/HashChangeEvent) to Kotlin\n */\npublic external open class HashChangeEvent(type: String, eventInitDict: HashChangeEventInit = definedExternally) : Event {\n open val oldURL: String\n open val newURL: String\n\n companion object {\n val NONE: Short\n val CAPTURING_PHASE: Short\n val AT_TARGET: Short\n val BUBBLING_PHASE: Short\n }\n}\n\npublic external interface HashChangeEventInit : EventInit {\n var oldURL: String? /* = \"\" */\n get() = definedExternally\n set(value) = definedExternally\n var newURL: String? /* = \"\" */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun HashChangeEventInit(oldURL: String? = \"\", newURL: String? = \"\", bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): HashChangeEventInit {\n val o = js(\"({})\")\n o[\"oldURL\"] = oldURL\n o[\"newURL\"] = newURL\n o[\"bubbles\"] = bubbles\n o[\"cancelable\"] = cancelable\n o[\"composed\"] = composed\n return o\n}\n\n/**\n * Exposes the JavaScript [PageTransitionEvent](https://developer.mozilla.org/en/docs/Web/API/PageTransitionEvent) to Kotlin\n */\npublic external open class PageTransitionEvent(type: String, eventInitDict: PageTransitionEventInit = definedExternally) : Event {\n open val persisted: Boolean\n\n companion object {\n val NONE: Short\n val CAPTURING_PHASE: Short\n val AT_TARGET: Short\n val BUBBLING_PHASE: Short\n }\n}\n\npublic external interface PageTransitionEventInit : EventInit {\n var persisted: Boolean? /* = false */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun PageTransitionEventInit(persisted: Boolean? = false, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): PageTransitionEventInit {\n val o = js(\"({})\")\n o[\"persisted\"] = persisted\n o[\"bubbles\"] = bubbles\n o[\"cancelable\"] = cancelable\n o[\"composed\"] = composed\n return o\n}\n\n/**\n * Exposes the JavaScript [BeforeUnloadEvent](https://developer.mozilla.org/en/docs/Web/API/BeforeUnloadEvent) to Kotlin\n */\npublic external open class BeforeUnloadEvent : Event {\n var returnValue: String\n\n companion object {\n val NONE: Short\n val CAPTURING_PHASE: Short\n val AT_TARGET: Short\n val BUBBLING_PHASE: Short\n }\n}\n\npublic external abstract class ApplicationCache : EventTarget {\n open val status: Short\n open var onchecking: ((Event) -> dynamic)?\n open var onerror: ((Event) -> dynamic)?\n open var onnoupdate: ((Event) -> dynamic)?\n open var ondownloading: ((Event) -> dynamic)?\n open var onprogress: ((ProgressEvent) -> dynamic)?\n open var onupdateready: ((Event) -> dynamic)?\n open var oncached: ((Event) -> dynamic)?\n open var onobsolete: ((Event) -> dynamic)?\n fun update()\n fun abort()\n fun swapCache()\n\n companion object {\n val UNCACHED: Short\n val IDLE: Short\n val CHECKING: Short\n val DOWNLOADING: Short\n val UPDATEREADY: Short\n val OBSOLETE: Short\n }\n}\n\n/**\n * Exposes the JavaScript [NavigatorOnLine](https://developer.mozilla.org/en/docs/Web/API/NavigatorOnLine) to Kotlin\n */\npublic external interface NavigatorOnLine {\n val onLine: Boolean\n}\n\n/**\n * Exposes the JavaScript [ErrorEvent](https://developer.mozilla.org/en/docs/Web/API/ErrorEvent) to Kotlin\n */\npublic external open class ErrorEvent(type: String, eventInitDict: ErrorEventInit = definedExternally) : Event {\n open val message: String\n open val filename: String\n open val lineno: Int\n open val colno: Int\n open val error: Any?\n\n companion object {\n val NONE: Short\n val CAPTURING_PHASE: Short\n val AT_TARGET: Short\n val BUBBLING_PHASE: Short\n }\n}\n\npublic external interface ErrorEventInit : EventInit {\n var message: String? /* = \"\" */\n get() = definedExternally\n set(value) = definedExternally\n var filename: String? /* = \"\" */\n get() = definedExternally\n set(value) = definedExternally\n var lineno: Int? /* = 0 */\n get() = definedExternally\n set(value) = definedExternally\n var colno: Int? /* = 0 */\n get() = definedExternally\n set(value) = definedExternally\n var error: Any? /* = null */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun ErrorEventInit(message: String? = \"\", filename: String? = \"\", lineno: Int? = 0, colno: Int? = 0, error: Any? = null, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): ErrorEventInit {\n val o = js(\"({})\")\n o[\"message\"] = message\n o[\"filename\"] = filename\n o[\"lineno\"] = lineno\n o[\"colno\"] = colno\n o[\"error\"] = error\n o[\"bubbles\"] = bubbles\n o[\"cancelable\"] = cancelable\n o[\"composed\"] = composed\n return o\n}\n\n/**\n * Exposes the JavaScript [PromiseRejectionEvent](https://developer.mozilla.org/en/docs/Web/API/PromiseRejectionEvent) to Kotlin\n */\npublic external open class PromiseRejectionEvent(type: String, eventInitDict: PromiseRejectionEventInit) : Event {\n open val promise: Promise\n open val reason: Any?\n\n companion object {\n val NONE: Short\n val CAPTURING_PHASE: Short\n val AT_TARGET: Short\n val BUBBLING_PHASE: Short\n }\n}\n\npublic external interface PromiseRejectionEventInit : EventInit {\n var promise: Promise?\n var reason: Any?\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun PromiseRejectionEventInit(promise: Promise?, reason: Any? = undefined, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): PromiseRejectionEventInit {\n val o = js(\"({})\")\n o[\"promise\"] = promise\n o[\"reason\"] = reason\n o[\"bubbles\"] = bubbles\n o[\"cancelable\"] = cancelable\n o[\"composed\"] = composed\n return o\n}\n\n/**\n * Exposes the JavaScript [GlobalEventHandlers](https://developer.mozilla.org/en/docs/Web/API/GlobalEventHandlers) to Kotlin\n */\npublic external interface GlobalEventHandlers {\n var onabort: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onblur: ((FocusEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var oncancel: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var oncanplay: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var oncanplaythrough: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onchange: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onclick: ((MouseEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onclose: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var oncontextmenu: ((MouseEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var oncuechange: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var ondblclick: ((MouseEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var ondrag: ((DragEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var ondragend: ((DragEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var ondragenter: ((DragEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var ondragexit: ((DragEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var ondragleave: ((DragEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var ondragover: ((DragEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var ondragstart: ((DragEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var ondrop: ((DragEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var ondurationchange: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onemptied: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onended: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onerror: ((dynamic, String, Int, Int, Any?) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onfocus: ((FocusEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var oninput: ((InputEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var oninvalid: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onkeydown: ((KeyboardEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onkeypress: ((KeyboardEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onkeyup: ((KeyboardEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onload: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onloadeddata: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onloadedmetadata: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onloadend: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onloadstart: ((ProgressEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onmousedown: ((MouseEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onmouseenter: ((MouseEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onmouseleave: ((MouseEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onmousemove: ((MouseEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onmouseout: ((MouseEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onmouseover: ((MouseEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onmouseup: ((MouseEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onwheel: ((WheelEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onpause: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onplay: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onplaying: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onprogress: ((ProgressEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onratechange: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onreset: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onresize: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onscroll: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onseeked: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onseeking: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onselect: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onshow: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onstalled: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onsubmit: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onsuspend: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var ontimeupdate: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var ontoggle: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onvolumechange: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onwaiting: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var ongotpointercapture: ((PointerEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onlostpointercapture: ((PointerEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onpointerdown: ((PointerEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onpointermove: ((PointerEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onpointerup: ((PointerEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onpointercancel: ((PointerEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onpointerover: ((PointerEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onpointerout: ((PointerEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onpointerenter: ((PointerEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onpointerleave: ((PointerEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n}\n\n/**\n * Exposes the JavaScript [WindowEventHandlers](https://developer.mozilla.org/en/docs/Web/API/WindowEventHandlers) to Kotlin\n */\npublic external interface WindowEventHandlers {\n var onafterprint: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onbeforeprint: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onbeforeunload: ((BeforeUnloadEvent) -> String?)?\n get() = definedExternally\n set(value) = definedExternally\n var onhashchange: ((HashChangeEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onlanguagechange: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onmessage: ((MessageEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onoffline: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var ononline: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onpagehide: ((PageTransitionEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onpageshow: ((PageTransitionEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onpopstate: ((PopStateEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onrejectionhandled: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onstorage: ((StorageEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onunhandledrejection: ((PromiseRejectionEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onunload: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n}\n\npublic external interface DocumentAndElementEventHandlers {\n var oncopy: ((ClipboardEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var oncut: ((ClipboardEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n var onpaste: ((ClipboardEvent) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n}\n\n/**\n * Exposes the JavaScript [WindowOrWorkerGlobalScope](https://developer.mozilla.org/en/docs/Web/API/WindowOrWorkerGlobalScope) to Kotlin\n */\npublic external interface WindowOrWorkerGlobalScope {\n val origin: String\n val caches: CacheStorage\n fun btoa(data: String): String\n fun atob(data: String): String\n fun setTimeout(handler: dynamic, timeout: Int = definedExternally, vararg arguments: Any?): Int\n fun clearTimeout(handle: Int = definedExternally)\n fun setInterval(handler: dynamic, timeout: Int = definedExternally, vararg arguments: Any?): Int\n fun clearInterval(handle: Int = definedExternally)\n fun createImageBitmap(image: ImageBitmapSource, options: ImageBitmapOptions = definedExternally): Promise\n fun createImageBitmap(image: ImageBitmapSource, sx: Int, sy: Int, sw: Int, sh: Int, options: ImageBitmapOptions = definedExternally): Promise\n fun fetch(input: dynamic, init: RequestInit = definedExternally): Promise\n}\n\n/**\n * Exposes the JavaScript [Navigator](https://developer.mozilla.org/en/docs/Web/API/Navigator) to Kotlin\n */\npublic external abstract class Navigator : NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorContentUtils, NavigatorCookies, NavigatorPlugins, NavigatorConcurrentHardware {\n open val clipboard: Clipboard\n open val mediaDevices: MediaDevices\n open val maxTouchPoints: Int\n open val serviceWorker: ServiceWorkerContainer\n fun requestMediaKeySystemAccess(keySystem: String, supportedConfigurations: Array): Promise\n fun getUserMedia(constraints: MediaStreamConstraints, successCallback: (MediaStream) -> Unit, errorCallback: (dynamic) -> Unit)\n fun vibrate(pattern: dynamic): Boolean\n}\n\n/**\n * Exposes the JavaScript [NavigatorID](https://developer.mozilla.org/en/docs/Web/API/NavigatorID) to Kotlin\n */\npublic external interface NavigatorID {\n val appCodeName: String\n val appName: String\n val appVersion: String\n val platform: String\n val product: String\n val productSub: String\n val userAgent: String\n val vendor: String\n val vendorSub: String\n val oscpu: String\n fun taintEnabled(): Boolean\n}\n\n/**\n * Exposes the JavaScript [NavigatorLanguage](https://developer.mozilla.org/en/docs/Web/API/NavigatorLanguage) to Kotlin\n */\npublic external interface NavigatorLanguage {\n val language: String\n val languages: Array\n}\n\npublic external interface NavigatorContentUtils {\n fun registerProtocolHandler(scheme: String, url: String, title: String)\n fun registerContentHandler(mimeType: String, url: String, title: String)\n fun isProtocolHandlerRegistered(scheme: String, url: String): String\n fun isContentHandlerRegistered(mimeType: String, url: String): String\n fun unregisterProtocolHandler(scheme: String, url: String)\n fun unregisterContentHandler(mimeType: String, url: String)\n}\n\npublic external interface NavigatorCookies {\n val cookieEnabled: Boolean\n}\n\n/**\n * Exposes the JavaScript [NavigatorPlugins](https://developer.mozilla.org/en/docs/Web/API/NavigatorPlugins) to Kotlin\n */\npublic external interface NavigatorPlugins {\n val plugins: PluginArray\n val mimeTypes: MimeTypeArray\n fun javaEnabled(): Boolean\n}\n\n/**\n * Exposes the JavaScript [PluginArray](https://developer.mozilla.org/en/docs/Web/API/PluginArray) to Kotlin\n */\npublic external abstract class PluginArray : ItemArrayLike {\n fun refresh(reload: Boolean = definedExternally)\n override fun item(index: Int): Plugin?\n fun namedItem(name: String): Plugin?\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun PluginArray.get(index: Int): Plugin? = asDynamic()[index]\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun PluginArray.get(name: String): Plugin? = asDynamic()[name]\n\n/**\n * Exposes the JavaScript [MimeTypeArray](https://developer.mozilla.org/en/docs/Web/API/MimeTypeArray) to Kotlin\n */\npublic external abstract class MimeTypeArray : ItemArrayLike {\n override fun item(index: Int): MimeType?\n fun namedItem(name: String): MimeType?\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun MimeTypeArray.get(index: Int): MimeType? = asDynamic()[index]\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun MimeTypeArray.get(name: String): MimeType? = asDynamic()[name]\n\n/**\n * Exposes the JavaScript [Plugin](https://developer.mozilla.org/en/docs/Web/API/Plugin) to Kotlin\n */\npublic external abstract class Plugin : ItemArrayLike {\n open val name: String\n open val description: String\n open val filename: String\n override fun item(index: Int): MimeType?\n fun namedItem(name: String): MimeType?\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun Plugin.get(index: Int): MimeType? = asDynamic()[index]\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun Plugin.get(name: String): MimeType? = asDynamic()[name]\n\n/**\n * Exposes the JavaScript [MimeType](https://developer.mozilla.org/en/docs/Web/API/MimeType) to Kotlin\n */\npublic external abstract class MimeType {\n open val type: String\n open val description: String\n open val suffixes: String\n open val enabledPlugin: Plugin\n}\n\n/**\n * Exposes the JavaScript [ImageBitmap](https://developer.mozilla.org/en/docs/Web/API/ImageBitmap) to Kotlin\n */\npublic external abstract class ImageBitmap : CanvasImageSource, TexImageSource {\n open val width: Int\n open val height: Int\n fun close()\n}\n\npublic external interface ImageBitmapOptions {\n var imageOrientation: ImageOrientation? /* = ImageOrientation.NONE */\n get() = definedExternally\n set(value) = definedExternally\n var premultiplyAlpha: PremultiplyAlpha? /* = PremultiplyAlpha.DEFAULT */\n get() = definedExternally\n set(value) = definedExternally\n var colorSpaceConversion: ColorSpaceConversion? /* = ColorSpaceConversion.DEFAULT */\n get() = definedExternally\n set(value) = definedExternally\n var resizeWidth: Int?\n get() = definedExternally\n set(value) = definedExternally\n var resizeHeight: Int?\n get() = definedExternally\n set(value) = definedExternally\n var resizeQuality: ResizeQuality? /* = ResizeQuality.LOW */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun ImageBitmapOptions(imageOrientation: ImageOrientation? = ImageOrientation.NONE, premultiplyAlpha: PremultiplyAlpha? = PremultiplyAlpha.DEFAULT, colorSpaceConversion: ColorSpaceConversion? = ColorSpaceConversion.DEFAULT, resizeWidth: Int? = undefined, resizeHeight: Int? = undefined, resizeQuality: ResizeQuality? = ResizeQuality.LOW): ImageBitmapOptions {\n val o = js(\"({})\")\n o[\"imageOrientation\"] = imageOrientation\n o[\"premultiplyAlpha\"] = premultiplyAlpha\n o[\"colorSpaceConversion\"] = colorSpaceConversion\n o[\"resizeWidth\"] = resizeWidth\n o[\"resizeHeight\"] = resizeHeight\n o[\"resizeQuality\"] = resizeQuality\n return o\n}\n\n/**\n * Exposes the JavaScript [MessageEvent](https://developer.mozilla.org/en/docs/Web/API/MessageEvent) to Kotlin\n */\npublic external open class MessageEvent(type: String, eventInitDict: MessageEventInit = definedExternally) : Event {\n open val data: Any?\n open val origin: String\n open val lastEventId: String\n open val source: UnionMessagePortOrWindowProxy?\n open val ports: Array\n fun initMessageEvent(type: String, bubbles: Boolean, cancelable: Boolean, data: Any?, origin: String, lastEventId: String, source: UnionMessagePortOrWindowProxy?, ports: Array)\n\n companion object {\n val NONE: Short\n val CAPTURING_PHASE: Short\n val AT_TARGET: Short\n val BUBBLING_PHASE: Short\n }\n}\n\npublic external interface MessageEventInit : EventInit {\n var data: Any? /* = null */\n get() = definedExternally\n set(value) = definedExternally\n var origin: String? /* = \"\" */\n get() = definedExternally\n set(value) = definedExternally\n var lastEventId: String? /* = \"\" */\n get() = definedExternally\n set(value) = definedExternally\n var source: UnionMessagePortOrWindowProxy? /* = null */\n get() = definedExternally\n set(value) = definedExternally\n var ports: Array? /* = arrayOf() */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun MessageEventInit(data: Any? = null, origin: String? = \"\", lastEventId: String? = \"\", source: UnionMessagePortOrWindowProxy? = null, ports: Array? = arrayOf(), bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): MessageEventInit {\n val o = js(\"({})\")\n o[\"data\"] = data\n o[\"origin\"] = origin\n o[\"lastEventId\"] = lastEventId\n o[\"source\"] = source\n o[\"ports\"] = ports\n o[\"bubbles\"] = bubbles\n o[\"cancelable\"] = cancelable\n o[\"composed\"] = composed\n return o\n}\n\n/**\n * Exposes the JavaScript [EventSource](https://developer.mozilla.org/en/docs/Web/API/EventSource) to Kotlin\n */\npublic external open class EventSource(url: String, eventSourceInitDict: EventSourceInit = definedExternally) : EventTarget {\n open val url: String\n open val withCredentials: Boolean\n open val readyState: Short\n var onopen: ((Event) -> dynamic)?\n var onmessage: ((MessageEvent) -> dynamic)?\n var onerror: ((Event) -> dynamic)?\n fun close()\n\n companion object {\n val CONNECTING: Short\n val OPEN: Short\n val CLOSED: Short\n }\n}\n\npublic external interface EventSourceInit {\n var withCredentials: Boolean? /* = false */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun EventSourceInit(withCredentials: Boolean? = false): EventSourceInit {\n val o = js(\"({})\")\n o[\"withCredentials\"] = withCredentials\n return o\n}\n\n/**\n * Exposes the JavaScript [WebSocket](https://developer.mozilla.org/en/docs/Web/API/WebSocket) to Kotlin\n */\npublic external open class WebSocket(url: String, protocols: dynamic = definedExternally) : EventTarget {\n open val url: String\n open val readyState: Short\n open val bufferedAmount: Number\n var onopen: ((Event) -> dynamic)?\n var onerror: ((Event) -> dynamic)?\n var onclose: ((Event) -> dynamic)?\n open val extensions: String\n open val protocol: String\n var onmessage: ((MessageEvent) -> dynamic)?\n var binaryType: BinaryType\n fun close(code: Short = definedExternally, reason: String = definedExternally)\n fun send(data: String)\n fun send(data: Blob)\n fun send(data: ArrayBuffer)\n fun send(data: ArrayBufferView)\n\n companion object {\n val CONNECTING: Short\n val OPEN: Short\n val CLOSING: Short\n val CLOSED: Short\n }\n}\n\n/**\n * Exposes the JavaScript [CloseEvent](https://developer.mozilla.org/en/docs/Web/API/CloseEvent) to Kotlin\n */\npublic external open class CloseEvent(type: String, eventInitDict: CloseEventInit = definedExternally) : Event {\n open val wasClean: Boolean\n open val code: Short\n open val reason: String\n\n companion object {\n val NONE: Short\n val CAPTURING_PHASE: Short\n val AT_TARGET: Short\n val BUBBLING_PHASE: Short\n }\n}\n\npublic external interface CloseEventInit : EventInit {\n var wasClean: Boolean? /* = false */\n get() = definedExternally\n set(value) = definedExternally\n var code: Short? /* = 0 */\n get() = definedExternally\n set(value) = definedExternally\n var reason: String? /* = \"\" */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun CloseEventInit(wasClean: Boolean? = false, code: Short? = 0, reason: String? = \"\", bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): CloseEventInit {\n val o = js(\"({})\")\n o[\"wasClean\"] = wasClean\n o[\"code\"] = code\n o[\"reason\"] = reason\n o[\"bubbles\"] = bubbles\n o[\"cancelable\"] = cancelable\n o[\"composed\"] = composed\n return o\n}\n\n/**\n * Exposes the JavaScript [MessageChannel](https://developer.mozilla.org/en/docs/Web/API/MessageChannel) to Kotlin\n */\npublic external open class MessageChannel {\n open val port1: MessagePort\n open val port2: MessagePort\n}\n\n/**\n * Exposes the JavaScript [MessagePort](https://developer.mozilla.org/en/docs/Web/API/MessagePort) to Kotlin\n */\npublic external abstract class MessagePort : EventTarget, UnionMessagePortOrWindowProxy, UnionMessagePortOrServiceWorker, UnionClientOrMessagePortOrServiceWorker {\n open var onmessage: ((MessageEvent) -> dynamic)?\n fun postMessage(message: Any?, transfer: Array = definedExternally)\n fun start()\n fun close()\n}\n\n/**\n * Exposes the JavaScript [BroadcastChannel](https://developer.mozilla.org/en/docs/Web/API/BroadcastChannel) to Kotlin\n */\npublic external open class BroadcastChannel(name: String) : EventTarget {\n open val name: String\n var onmessage: ((MessageEvent) -> dynamic)?\n fun postMessage(message: Any?)\n fun close()\n}\n\n/**\n * Exposes the JavaScript [WorkerGlobalScope](https://developer.mozilla.org/en/docs/Web/API/WorkerGlobalScope) to Kotlin\n */\npublic external abstract class WorkerGlobalScope : EventTarget, WindowOrWorkerGlobalScope, GlobalPerformance {\n open val self: WorkerGlobalScope\n open val location: WorkerLocation\n open val navigator: WorkerNavigator\n open var onerror: ((dynamic, String, Int, Int, Any?) -> dynamic)?\n open var onlanguagechange: ((Event) -> dynamic)?\n open var onoffline: ((Event) -> dynamic)?\n open var ononline: ((Event) -> dynamic)?\n open var onrejectionhandled: ((Event) -> dynamic)?\n open var onunhandledrejection: ((PromiseRejectionEvent) -> dynamic)?\n fun importScripts(vararg urls: String)\n}\n\n/**\n * Exposes the JavaScript [DedicatedWorkerGlobalScope](https://developer.mozilla.org/en/docs/Web/API/DedicatedWorkerGlobalScope) to Kotlin\n */\npublic external abstract class DedicatedWorkerGlobalScope : WorkerGlobalScope {\n open var onmessage: ((MessageEvent) -> dynamic)?\n fun postMessage(message: Any?, transfer: Array = definedExternally)\n fun close()\n}\n\n/**\n * Exposes the JavaScript [SharedWorkerGlobalScope](https://developer.mozilla.org/en/docs/Web/API/SharedWorkerGlobalScope) to Kotlin\n */\npublic external abstract class SharedWorkerGlobalScope : WorkerGlobalScope {\n open val name: String\n open val applicationCache: ApplicationCache\n open var onconnect: ((Event) -> dynamic)?\n fun close()\n}\n\n/**\n * Exposes the JavaScript [AbstractWorker](https://developer.mozilla.org/en/docs/Web/API/AbstractWorker) to Kotlin\n */\npublic external interface AbstractWorker {\n var onerror: ((Event) -> dynamic)?\n get() = definedExternally\n set(value) = definedExternally\n}\n\n/**\n * Exposes the JavaScript [Worker](https://developer.mozilla.org/en/docs/Web/API/Worker) to Kotlin\n */\npublic external open class Worker(scriptURL: String, options: WorkerOptions = definedExternally) : EventTarget, AbstractWorker {\n var onmessage: ((MessageEvent) -> dynamic)?\n override var onerror: ((Event) -> dynamic)?\n fun terminate()\n fun postMessage(message: Any?, transfer: Array = definedExternally)\n}\n\npublic external interface WorkerOptions {\n var type: WorkerType? /* = WorkerType.CLASSIC */\n get() = definedExternally\n set(value) = definedExternally\n var credentials: RequestCredentials? /* = RequestCredentials.OMIT */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun WorkerOptions(type: WorkerType? = WorkerType.CLASSIC, credentials: RequestCredentials? = RequestCredentials.OMIT): WorkerOptions {\n val o = js(\"({})\")\n o[\"type\"] = type\n o[\"credentials\"] = credentials\n return o\n}\n\n/**\n * Exposes the JavaScript [SharedWorker](https://developer.mozilla.org/en/docs/Web/API/SharedWorker) to Kotlin\n */\npublic external open class SharedWorker(scriptURL: String, name: String = definedExternally, options: WorkerOptions = definedExternally) : EventTarget, AbstractWorker {\n open val port: MessagePort\n override var onerror: ((Event) -> dynamic)?\n}\n\n/**\n * Exposes the JavaScript [NavigatorConcurrentHardware](https://developer.mozilla.org/en/docs/Web/API/NavigatorConcurrentHardware) to Kotlin\n */\npublic external interface NavigatorConcurrentHardware {\n val hardwareConcurrency: Number\n}\n\n/**\n * Exposes the JavaScript [WorkerNavigator](https://developer.mozilla.org/en/docs/Web/API/WorkerNavigator) to Kotlin\n */\npublic external abstract class WorkerNavigator : NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorConcurrentHardware {\n open val serviceWorker: ServiceWorkerContainer\n}\n\n/**\n * Exposes the JavaScript [WorkerLocation](https://developer.mozilla.org/en/docs/Web/API/WorkerLocation) to Kotlin\n */\npublic external abstract class WorkerLocation {\n open val href: String\n open val origin: String\n open val protocol: String\n open val host: String\n open val hostname: String\n open val port: String\n open val pathname: String\n open val search: String\n open val hash: String\n}\n\n/**\n * Exposes the JavaScript [Storage](https://developer.mozilla.org/en/docs/Web/API/Storage) to Kotlin\n */\npublic external abstract class Storage {\n open val length: Int\n fun key(index: Int): String?\n fun removeItem(key: String)\n fun clear()\n fun getItem(key: String): String?\n fun setItem(key: String, value: String)\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun Storage.get(key: String): String? = asDynamic()[key]\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun Storage.set(key: String, value: String) { asDynamic()[key] = value }\n\n/**\n * Exposes the JavaScript [WindowSessionStorage](https://developer.mozilla.org/en/docs/Web/API/WindowSessionStorage) to Kotlin\n */\npublic external interface WindowSessionStorage {\n val sessionStorage: Storage\n}\n\n/**\n * Exposes the JavaScript [WindowLocalStorage](https://developer.mozilla.org/en/docs/Web/API/WindowLocalStorage) to Kotlin\n */\npublic external interface WindowLocalStorage {\n val localStorage: Storage\n}\n\n/**\n * Exposes the JavaScript [StorageEvent](https://developer.mozilla.org/en/docs/Web/API/StorageEvent) to Kotlin\n */\npublic external open class StorageEvent(type: String, eventInitDict: StorageEventInit = definedExternally) : Event {\n open val key: String?\n open val oldValue: String?\n open val newValue: String?\n open val url: String\n open val storageArea: Storage?\n\n companion object {\n val NONE: Short\n val CAPTURING_PHASE: Short\n val AT_TARGET: Short\n val BUBBLING_PHASE: Short\n }\n}\n\npublic external interface StorageEventInit : EventInit {\n var key: String? /* = null */\n get() = definedExternally\n set(value) = definedExternally\n var oldValue: String? /* = null */\n get() = definedExternally\n set(value) = definedExternally\n var newValue: String? /* = null */\n get() = definedExternally\n set(value) = definedExternally\n var url: String? /* = \"\" */\n get() = definedExternally\n set(value) = definedExternally\n var storageArea: Storage? /* = null */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun StorageEventInit(key: String? = null, oldValue: String? = null, newValue: String? = null, url: String? = \"\", storageArea: Storage? = null, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): StorageEventInit {\n val o = js(\"({})\")\n o[\"key\"] = key\n o[\"oldValue\"] = oldValue\n o[\"newValue\"] = newValue\n o[\"url\"] = url\n o[\"storageArea\"] = storageArea\n o[\"bubbles\"] = bubbles\n o[\"cancelable\"] = cancelable\n o[\"composed\"] = composed\n return o\n}\n\npublic external abstract class HTMLAppletElement : HTMLElement {\n open var align: String\n open var alt: String\n open var archive: String\n open var code: String\n open var codeBase: String\n open var height: String\n open var hspace: Int\n open var name: String\n open var _object: String\n open var vspace: Int\n open var width: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLMarqueeElement](https://developer.mozilla.org/en/docs/Web/API/HTMLMarqueeElement) to Kotlin\n */\npublic external abstract class HTMLMarqueeElement : HTMLElement {\n open var behavior: String\n open var bgColor: String\n open var direction: String\n open var height: String\n open var hspace: Int\n open var loop: Int\n open var scrollAmount: Int\n open var scrollDelay: Int\n open var trueSpeed: Boolean\n open var vspace: Int\n open var width: String\n open var onbounce: ((Event) -> dynamic)?\n open var onfinish: ((Event) -> dynamic)?\n open var onstart: ((Event) -> dynamic)?\n fun start()\n fun stop()\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLFrameSetElement](https://developer.mozilla.org/en/docs/Web/API/HTMLFrameSetElement) to Kotlin\n */\npublic external abstract class HTMLFrameSetElement : HTMLElement, WindowEventHandlers {\n open var cols: String\n open var rows: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\npublic external abstract class HTMLFrameElement : HTMLElement {\n open var name: String\n open var scrolling: String\n open var src: String\n open var frameBorder: String\n open var longDesc: String\n open var noResize: Boolean\n open val contentDocument: Document?\n open val contentWindow: Window?\n open var marginHeight: String\n open var marginWidth: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\npublic external abstract class HTMLDirectoryElement : HTMLElement {\n open var compact: Boolean\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [HTMLFontElement](https://developer.mozilla.org/en/docs/Web/API/HTMLFontElement) to Kotlin\n */\npublic external abstract class HTMLFontElement : HTMLElement {\n open var color: String\n open var face: String\n open var size: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\npublic external interface External {\n fun AddSearchProvider()\n fun IsSearchProviderInstalled()\n}\n\npublic external interface EventInit {\n var bubbles: Boolean? /* = false */\n get() = definedExternally\n set(value) = definedExternally\n var cancelable: Boolean? /* = false */\n get() = definedExternally\n set(value) = definedExternally\n var composed: Boolean? /* = false */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun EventInit(bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): EventInit {\n val o = js(\"({})\")\n o[\"bubbles\"] = bubbles\n o[\"cancelable\"] = cancelable\n o[\"composed\"] = composed\n return o\n}\n\n/**\n * Exposes the JavaScript [CustomEvent](https://developer.mozilla.org/en/docs/Web/API/CustomEvent) to Kotlin\n */\npublic external open class CustomEvent(type: String, eventInitDict: CustomEventInit = definedExternally) : Event {\n open val detail: Any?\n fun initCustomEvent(type: String, bubbles: Boolean, cancelable: Boolean, detail: Any?)\n\n companion object {\n val NONE: Short\n val CAPTURING_PHASE: Short\n val AT_TARGET: Short\n val BUBBLING_PHASE: Short\n }\n}\n\npublic external interface CustomEventInit : EventInit {\n var detail: Any? /* = null */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun CustomEventInit(detail: Any? = null, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): CustomEventInit {\n val o = js(\"({})\")\n o[\"detail\"] = detail\n o[\"bubbles\"] = bubbles\n o[\"cancelable\"] = cancelable\n o[\"composed\"] = composed\n return o\n}\n\npublic external interface EventListenerOptions {\n var capture: Boolean? /* = false */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun EventListenerOptions(capture: Boolean? = false): EventListenerOptions {\n val o = js(\"({})\")\n o[\"capture\"] = capture\n return o\n}\n\npublic external interface AddEventListenerOptions : EventListenerOptions {\n var passive: Boolean? /* = false */\n get() = definedExternally\n set(value) = definedExternally\n var once: Boolean? /* = false */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun AddEventListenerOptions(passive: Boolean? = false, once: Boolean? = false, capture: Boolean? = false): AddEventListenerOptions {\n val o = js(\"({})\")\n o[\"passive\"] = passive\n o[\"once\"] = once\n o[\"capture\"] = capture\n return o\n}\n\npublic external interface NonElementParentNode {\n fun getElementById(elementId: String): Element?\n}\n\n/**\n * Exposes the JavaScript [DocumentOrShadowRoot](https://developer.mozilla.org/en/docs/Web/API/DocumentOrShadowRoot) to Kotlin\n */\npublic external interface DocumentOrShadowRoot {\n val fullscreenElement: Element?\n get() = definedExternally\n}\n\n/**\n * Exposes the JavaScript [ParentNode](https://developer.mozilla.org/en/docs/Web/API/ParentNode) to Kotlin\n */\npublic external interface ParentNode {\n val children: HTMLCollection\n val firstElementChild: Element?\n get() = definedExternally\n val lastElementChild: Element?\n get() = definedExternally\n val childElementCount: Int\n fun prepend(vararg nodes: dynamic)\n fun append(vararg nodes: dynamic)\n fun querySelector(selectors: String): Element?\n fun querySelectorAll(selectors: String): NodeList\n}\n\n/**\n * Exposes the JavaScript [NonDocumentTypeChildNode](https://developer.mozilla.org/en/docs/Web/API/NonDocumentTypeChildNode) to Kotlin\n */\npublic external interface NonDocumentTypeChildNode {\n val previousElementSibling: Element?\n get() = definedExternally\n val nextElementSibling: Element?\n get() = definedExternally\n}\n\n/**\n * Exposes the JavaScript [ChildNode](https://developer.mozilla.org/en/docs/Web/API/ChildNode) to Kotlin\n */\npublic external interface ChildNode {\n fun before(vararg nodes: dynamic)\n fun after(vararg nodes: dynamic)\n fun replaceWith(vararg nodes: dynamic)\n fun remove()\n}\n\n/**\n * Exposes the JavaScript [Slotable](https://developer.mozilla.org/en/docs/Web/API/Slotable) to Kotlin\n */\npublic external interface Slotable {\n val assignedSlot: HTMLSlotElement?\n get() = definedExternally\n}\n\n/**\n * Exposes the JavaScript [NodeList](https://developer.mozilla.org/en/docs/Web/API/NodeList) to Kotlin\n */\npublic external abstract class NodeList : ItemArrayLike {\n override fun item(index: Int): Node?\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun NodeList.get(index: Int): Node? = asDynamic()[index]\n\n/**\n * Exposes the JavaScript [HTMLCollection](https://developer.mozilla.org/en/docs/Web/API/HTMLCollection) to Kotlin\n */\npublic external abstract class HTMLCollection : ItemArrayLike, UnionElementOrHTMLCollection {\n override fun item(index: Int): Element?\n fun namedItem(name: String): Element?\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun HTMLCollection.get(index: Int): Element? = asDynamic()[index]\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun HTMLCollection.get(name: String): Element? = asDynamic()[name]\n\n/**\n * Exposes the JavaScript [MutationObserver](https://developer.mozilla.org/en/docs/Web/API/MutationObserver) to Kotlin\n */\npublic external open class MutationObserver(callback: (Array, MutationObserver) -> Unit) {\n fun observe(target: Node, options: MutationObserverInit = definedExternally)\n fun disconnect()\n fun takeRecords(): Array\n}\n\n/**\n * Exposes the JavaScript [MutationObserverInit](https://developer.mozilla.org/en/docs/Web/API/MutationObserverInit) to Kotlin\n */\npublic external interface MutationObserverInit {\n var childList: Boolean? /* = false */\n get() = definedExternally\n set(value) = definedExternally\n var attributes: Boolean?\n get() = definedExternally\n set(value) = definedExternally\n var characterData: Boolean?\n get() = definedExternally\n set(value) = definedExternally\n var subtree: Boolean? /* = false */\n get() = definedExternally\n set(value) = definedExternally\n var attributeOldValue: Boolean?\n get() = definedExternally\n set(value) = definedExternally\n var characterDataOldValue: Boolean?\n get() = definedExternally\n set(value) = definedExternally\n var attributeFilter: Array?\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun MutationObserverInit(childList: Boolean? = false, attributes: Boolean? = undefined, characterData: Boolean? = undefined, subtree: Boolean? = false, attributeOldValue: Boolean? = undefined, characterDataOldValue: Boolean? = undefined, attributeFilter: Array? = undefined): MutationObserverInit {\n val o = js(\"({})\")\n o[\"childList\"] = childList\n o[\"attributes\"] = attributes\n o[\"characterData\"] = characterData\n o[\"subtree\"] = subtree\n o[\"attributeOldValue\"] = attributeOldValue\n o[\"characterDataOldValue\"] = characterDataOldValue\n o[\"attributeFilter\"] = attributeFilter\n return o\n}\n\n/**\n * Exposes the JavaScript [MutationRecord](https://developer.mozilla.org/en/docs/Web/API/MutationRecord) to Kotlin\n */\npublic external abstract class MutationRecord {\n open val type: String\n open val target: Node\n open val addedNodes: NodeList\n open val removedNodes: NodeList\n open val previousSibling: Node?\n open val nextSibling: Node?\n open val attributeName: String?\n open val attributeNamespace: String?\n open val oldValue: String?\n}\n\n/**\n * Exposes the JavaScript [Node](https://developer.mozilla.org/en/docs/Web/API/Node) to Kotlin\n */\npublic external abstract class Node : EventTarget {\n open val nodeType: Short\n open val nodeName: String\n open val baseURI: String\n open val isConnected: Boolean\n open val ownerDocument: Document?\n open val parentNode: Node?\n open val parentElement: Element?\n open val childNodes: NodeList\n open val firstChild: Node?\n open val lastChild: Node?\n open val previousSibling: Node?\n open val nextSibling: Node?\n open var nodeValue: String?\n open var textContent: String?\n fun getRootNode(options: GetRootNodeOptions = definedExternally): Node\n fun hasChildNodes(): Boolean\n fun normalize()\n fun cloneNode(deep: Boolean = definedExternally): Node\n fun isEqualNode(otherNode: Node?): Boolean\n fun isSameNode(otherNode: Node?): Boolean\n fun compareDocumentPosition(other: Node): Short\n fun contains(other: Node?): Boolean\n fun lookupPrefix(namespace: String?): String?\n fun lookupNamespaceURI(prefix: String?): String?\n fun isDefaultNamespace(namespace: String?): Boolean\n fun insertBefore(node: Node, child: Node?): Node\n fun appendChild(node: Node): Node\n fun replaceChild(node: Node, child: Node): Node\n fun removeChild(child: Node): Node\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\npublic external interface GetRootNodeOptions {\n var composed: Boolean? /* = false */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun GetRootNodeOptions(composed: Boolean? = false): GetRootNodeOptions {\n val o = js(\"({})\")\n o[\"composed\"] = composed\n return o\n}\n\n/**\n * Exposes the JavaScript [Document](https://developer.mozilla.org/en/docs/Web/API/Document) to Kotlin\n */\npublic external open class Document : Node, GlobalEventHandlers, DocumentAndElementEventHandlers, NonElementParentNode, DocumentOrShadowRoot, ParentNode, GeometryUtils {\n open val implementation: DOMImplementation\n open val URL: String\n open val documentURI: String\n open val origin: String\n open val compatMode: String\n open val characterSet: String\n open val charset: String\n open val inputEncoding: String\n open val contentType: String\n open val doctype: DocumentType?\n open val documentElement: Element?\n open val location: Location?\n var domain: String\n open val referrer: String\n var cookie: String\n open val lastModified: String\n open val readyState: DocumentReadyState\n var title: String\n var dir: String\n var body: HTMLElement?\n open val head: HTMLHeadElement?\n open val images: HTMLCollection\n open val embeds: HTMLCollection\n open val plugins: HTMLCollection\n open val links: HTMLCollection\n open val forms: HTMLCollection\n open val scripts: HTMLCollection\n open val currentScript: HTMLOrSVGScriptElement?\n open val defaultView: Window?\n open val activeElement: Element?\n var designMode: String\n var onreadystatechange: ((Event) -> dynamic)?\n var fgColor: String\n var linkColor: String\n var vlinkColor: String\n var alinkColor: String\n var bgColor: String\n open val anchors: HTMLCollection\n open val applets: HTMLCollection\n open val all: HTMLAllCollection\n open val scrollingElement: Element?\n open val styleSheets: StyleSheetList\n open val rootElement: SVGSVGElement?\n open val fullscreenEnabled: Boolean\n open val fullscreen: Boolean\n var onfullscreenchange: ((Event) -> dynamic)?\n var onfullscreenerror: ((Event) -> dynamic)?\n override var onabort: ((Event) -> dynamic)?\n override var onblur: ((FocusEvent) -> dynamic)?\n override var oncancel: ((Event) -> dynamic)?\n override var oncanplay: ((Event) -> dynamic)?\n override var oncanplaythrough: ((Event) -> dynamic)?\n override var onchange: ((Event) -> dynamic)?\n override var onclick: ((MouseEvent) -> dynamic)?\n override var onclose: ((Event) -> dynamic)?\n override var oncontextmenu: ((MouseEvent) -> dynamic)?\n override var oncuechange: ((Event) -> dynamic)?\n override var ondblclick: ((MouseEvent) -> dynamic)?\n override var ondrag: ((DragEvent) -> dynamic)?\n override var ondragend: ((DragEvent) -> dynamic)?\n override var ondragenter: ((DragEvent) -> dynamic)?\n override var ondragexit: ((DragEvent) -> dynamic)?\n override var ondragleave: ((DragEvent) -> dynamic)?\n override var ondragover: ((DragEvent) -> dynamic)?\n override var ondragstart: ((DragEvent) -> dynamic)?\n override var ondrop: ((DragEvent) -> dynamic)?\n override var ondurationchange: ((Event) -> dynamic)?\n override var onemptied: ((Event) -> dynamic)?\n override var onended: ((Event) -> dynamic)?\n override var onerror: ((dynamic, String, Int, Int, Any?) -> dynamic)?\n override var onfocus: ((FocusEvent) -> dynamic)?\n override var oninput: ((InputEvent) -> dynamic)?\n override var oninvalid: ((Event) -> dynamic)?\n override var onkeydown: ((KeyboardEvent) -> dynamic)?\n override var onkeypress: ((KeyboardEvent) -> dynamic)?\n override var onkeyup: ((KeyboardEvent) -> dynamic)?\n override var onload: ((Event) -> dynamic)?\n override var onloadeddata: ((Event) -> dynamic)?\n override var onloadedmetadata: ((Event) -> dynamic)?\n override var onloadend: ((Event) -> dynamic)?\n override var onloadstart: ((ProgressEvent) -> dynamic)?\n override var onmousedown: ((MouseEvent) -> dynamic)?\n override var onmouseenter: ((MouseEvent) -> dynamic)?\n override var onmouseleave: ((MouseEvent) -> dynamic)?\n override var onmousemove: ((MouseEvent) -> dynamic)?\n override var onmouseout: ((MouseEvent) -> dynamic)?\n override var onmouseover: ((MouseEvent) -> dynamic)?\n override var onmouseup: ((MouseEvent) -> dynamic)?\n override var onwheel: ((WheelEvent) -> dynamic)?\n override var onpause: ((Event) -> dynamic)?\n override var onplay: ((Event) -> dynamic)?\n override var onplaying: ((Event) -> dynamic)?\n override var onprogress: ((ProgressEvent) -> dynamic)?\n override var onratechange: ((Event) -> dynamic)?\n override var onreset: ((Event) -> dynamic)?\n override var onresize: ((Event) -> dynamic)?\n override var onscroll: ((Event) -> dynamic)?\n override var onseeked: ((Event) -> dynamic)?\n override var onseeking: ((Event) -> dynamic)?\n override var onselect: ((Event) -> dynamic)?\n override var onshow: ((Event) -> dynamic)?\n override var onstalled: ((Event) -> dynamic)?\n override var onsubmit: ((Event) -> dynamic)?\n override var onsuspend: ((Event) -> dynamic)?\n override var ontimeupdate: ((Event) -> dynamic)?\n override var ontoggle: ((Event) -> dynamic)?\n override var onvolumechange: ((Event) -> dynamic)?\n override var onwaiting: ((Event) -> dynamic)?\n override var ongotpointercapture: ((PointerEvent) -> dynamic)?\n override var onlostpointercapture: ((PointerEvent) -> dynamic)?\n override var onpointerdown: ((PointerEvent) -> dynamic)?\n override var onpointermove: ((PointerEvent) -> dynamic)?\n override var onpointerup: ((PointerEvent) -> dynamic)?\n override var onpointercancel: ((PointerEvent) -> dynamic)?\n override var onpointerover: ((PointerEvent) -> dynamic)?\n override var onpointerout: ((PointerEvent) -> dynamic)?\n override var onpointerenter: ((PointerEvent) -> dynamic)?\n override var onpointerleave: ((PointerEvent) -> dynamic)?\n override var oncopy: ((ClipboardEvent) -> dynamic)?\n override var oncut: ((ClipboardEvent) -> dynamic)?\n override var onpaste: ((ClipboardEvent) -> dynamic)?\n override val fullscreenElement: Element?\n override val children: HTMLCollection\n override val firstElementChild: Element?\n override val lastElementChild: Element?\n override val childElementCount: Int\n fun getElementsByTagName(qualifiedName: String): HTMLCollection\n fun getElementsByTagNameNS(namespace: String?, localName: String): HTMLCollection\n fun getElementsByClassName(classNames: String): HTMLCollection\n fun createElement(localName: String, options: ElementCreationOptions = definedExternally): Element\n fun createElementNS(namespace: String?, qualifiedName: String, options: ElementCreationOptions = definedExternally): Element\n fun createDocumentFragment(): DocumentFragment\n fun createTextNode(data: String): Text\n fun createCDATASection(data: String): CDATASection\n fun createComment(data: String): Comment\n fun createProcessingInstruction(target: String, data: String): ProcessingInstruction\n fun importNode(node: Node, deep: Boolean = definedExternally): Node\n fun adoptNode(node: Node): Node\n fun createAttribute(localName: String): Attr\n fun createAttributeNS(namespace: String?, qualifiedName: String): Attr\n fun createEvent(`interface`: String): Event\n fun createRange(): Range\n fun createNodeIterator(root: Node, whatToShow: Int = definedExternally, filter: NodeFilter? = definedExternally): NodeIterator\n fun createNodeIterator(root: Node, whatToShow: Int = definedExternally, filter: ((Node) -> Short)? = definedExternally): NodeIterator\n fun createTreeWalker(root: Node, whatToShow: Int = definedExternally, filter: NodeFilter? = definedExternally): TreeWalker\n fun createTreeWalker(root: Node, whatToShow: Int = definedExternally, filter: ((Node) -> Short)? = definedExternally): TreeWalker\n fun getElementsByName(elementName: String): NodeList\n fun open(type: String = definedExternally, replace: String = definedExternally): Document\n fun open(url: String, name: String, features: String): Window\n fun close()\n fun write(vararg text: String)\n fun writeln(vararg text: String)\n fun hasFocus(): Boolean\n fun execCommand(commandId: String, showUI: Boolean = definedExternally, value: String = definedExternally): Boolean\n fun queryCommandEnabled(commandId: String): Boolean\n fun queryCommandIndeterm(commandId: String): Boolean\n fun queryCommandState(commandId: String): Boolean\n fun queryCommandSupported(commandId: String): Boolean\n fun queryCommandValue(commandId: String): String\n fun clear()\n fun captureEvents()\n fun releaseEvents()\n fun elementFromPoint(x: Double, y: Double): Element?\n fun elementsFromPoint(x: Double, y: Double): Array\n fun caretPositionFromPoint(x: Double, y: Double): CaretPosition?\n fun createTouch(view: Window, target: EventTarget, identifier: Int, pageX: Int, pageY: Int, screenX: Int, screenY: Int): Touch\n fun createTouchList(vararg touches: Touch): TouchList\n fun exitFullscreen(): Promise\n override fun getElementById(elementId: String): Element?\n override fun prepend(vararg nodes: dynamic)\n override fun append(vararg nodes: dynamic)\n override fun querySelector(selectors: String): Element?\n override fun querySelectorAll(selectors: String): NodeList\n override fun getBoxQuads(options: BoxQuadOptions /* = definedExternally */): Array\n override fun convertQuadFromNode(quad: dynamic, from: dynamic, options: ConvertCoordinateOptions /* = definedExternally */): DOMQuad\n override fun convertRectFromNode(rect: DOMRectReadOnly, from: dynamic, options: ConvertCoordinateOptions /* = definedExternally */): DOMQuad\n override fun convertPointFromNode(point: DOMPointInit, from: dynamic, options: ConvertCoordinateOptions /* = definedExternally */): DOMPoint\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun Document.get(name: String): dynamic = asDynamic()[name]\n\n/**\n * Exposes the JavaScript [XMLDocument](https://developer.mozilla.org/en/docs/Web/API/XMLDocument) to Kotlin\n */\npublic external open class XMLDocument : Document {\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\npublic external interface ElementCreationOptions {\n var `is`: String?\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun ElementCreationOptions(`is`: String? = undefined): ElementCreationOptions {\n val o = js(\"({})\")\n o[\"is\"] = `is`\n return o\n}\n\n/**\n * Exposes the JavaScript [DOMImplementation](https://developer.mozilla.org/en/docs/Web/API/DOMImplementation) to Kotlin\n */\npublic external abstract class DOMImplementation {\n fun createDocumentType(qualifiedName: String, publicId: String, systemId: String): DocumentType\n fun createDocument(namespace: String?, qualifiedName: String, doctype: DocumentType? = definedExternally): XMLDocument\n fun createHTMLDocument(title: String = definedExternally): Document\n fun hasFeature(): Boolean\n}\n\n/**\n * Exposes the JavaScript [DocumentType](https://developer.mozilla.org/en/docs/Web/API/DocumentType) to Kotlin\n */\npublic external abstract class DocumentType : Node, ChildNode {\n open val name: String\n open val publicId: String\n open val systemId: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [DocumentFragment](https://developer.mozilla.org/en/docs/Web/API/DocumentFragment) to Kotlin\n */\npublic external open class DocumentFragment : Node, NonElementParentNode, ParentNode {\n override val children: HTMLCollection\n override val firstElementChild: Element?\n override val lastElementChild: Element?\n override val childElementCount: Int\n override fun getElementById(elementId: String): Element?\n override fun prepend(vararg nodes: dynamic)\n override fun append(vararg nodes: dynamic)\n override fun querySelector(selectors: String): Element?\n override fun querySelectorAll(selectors: String): NodeList\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [ShadowRoot](https://developer.mozilla.org/en/docs/Web/API/ShadowRoot) to Kotlin\n */\npublic external open class ShadowRoot : DocumentFragment, DocumentOrShadowRoot {\n open val mode: ShadowRootMode\n open val host: Element\n override val fullscreenElement: Element?\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [Element](https://developer.mozilla.org/en/docs/Web/API/Element) to Kotlin\n */\npublic external abstract class Element : Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slotable, GeometryUtils, UnionElementOrHTMLCollection, UnionElementOrRadioNodeList, UnionElementOrMouseEvent, UnionElementOrProcessingInstruction {\n open val namespaceURI: String?\n open val prefix: String?\n open val localName: String\n open val tagName: String\n open var id: String\n open var className: String\n open val classList: DOMTokenList\n open var slot: String\n open val attributes: NamedNodeMap\n open val shadowRoot: ShadowRoot?\n open var scrollTop: Double\n open var scrollLeft: Double\n open val scrollWidth: Int\n open val scrollHeight: Int\n open val clientTop: Int\n open val clientLeft: Int\n open val clientWidth: Int\n open val clientHeight: Int\n open var innerHTML: String\n open var outerHTML: String\n fun hasAttributes(): Boolean\n fun getAttributeNames(): Array\n fun getAttribute(qualifiedName: String): String?\n fun getAttributeNS(namespace: String?, localName: String): String?\n fun setAttribute(qualifiedName: String, value: String)\n fun setAttributeNS(namespace: String?, qualifiedName: String, value: String)\n fun removeAttribute(qualifiedName: String)\n fun removeAttributeNS(namespace: String?, localName: String)\n fun hasAttribute(qualifiedName: String): Boolean\n fun hasAttributeNS(namespace: String?, localName: String): Boolean\n fun getAttributeNode(qualifiedName: String): Attr?\n fun getAttributeNodeNS(namespace: String?, localName: String): Attr?\n fun setAttributeNode(attr: Attr): Attr?\n fun setAttributeNodeNS(attr: Attr): Attr?\n fun removeAttributeNode(attr: Attr): Attr\n fun attachShadow(init: ShadowRootInit): ShadowRoot\n fun closest(selectors: String): Element?\n fun matches(selectors: String): Boolean\n fun webkitMatchesSelector(selectors: String): Boolean\n fun getElementsByTagName(qualifiedName: String): HTMLCollection\n fun getElementsByTagNameNS(namespace: String?, localName: String): HTMLCollection\n fun getElementsByClassName(classNames: String): HTMLCollection\n fun insertAdjacentElement(where: String, element: Element): Element?\n fun insertAdjacentText(where: String, data: String)\n fun getClientRects(): Array\n fun getBoundingClientRect(): DOMRect\n fun scrollIntoView()\n fun scrollIntoView(arg: dynamic)\n fun scroll(options: ScrollToOptions = definedExternally)\n fun scroll(x: Double, y: Double)\n fun scrollTo(options: ScrollToOptions = definedExternally)\n fun scrollTo(x: Double, y: Double)\n fun scrollBy(options: ScrollToOptions = definedExternally)\n fun scrollBy(x: Double, y: Double)\n fun insertAdjacentHTML(position: String, text: String)\n fun setPointerCapture(pointerId: Int)\n fun releasePointerCapture(pointerId: Int)\n fun hasPointerCapture(pointerId: Int): Boolean\n fun requestFullscreen(): Promise\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\npublic external interface ShadowRootInit {\n var mode: ShadowRootMode?\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun ShadowRootInit(mode: ShadowRootMode?): ShadowRootInit {\n val o = js(\"({})\")\n o[\"mode\"] = mode\n return o\n}\n\n/**\n * Exposes the JavaScript [NamedNodeMap](https://developer.mozilla.org/en/docs/Web/API/NamedNodeMap) to Kotlin\n */\npublic external abstract class NamedNodeMap : ItemArrayLike {\n fun getNamedItemNS(namespace: String?, localName: String): Attr?\n fun setNamedItem(attr: Attr): Attr?\n fun setNamedItemNS(attr: Attr): Attr?\n fun removeNamedItem(qualifiedName: String): Attr\n fun removeNamedItemNS(namespace: String?, localName: String): Attr\n override fun item(index: Int): Attr?\n fun getNamedItem(qualifiedName: String): Attr?\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun NamedNodeMap.get(index: Int): Attr? = asDynamic()[index]\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun NamedNodeMap.get(qualifiedName: String): Attr? = asDynamic()[qualifiedName]\n\n/**\n * Exposes the JavaScript [Attr](https://developer.mozilla.org/en/docs/Web/API/Attr) to Kotlin\n */\npublic external abstract class Attr : Node {\n open val namespaceURI: String?\n open val prefix: String?\n open val localName: String\n open val name: String\n open var value: String\n open val ownerElement: Element?\n open val specified: Boolean\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [CharacterData](https://developer.mozilla.org/en/docs/Web/API/CharacterData) to Kotlin\n */\npublic external abstract class CharacterData : Node, NonDocumentTypeChildNode, ChildNode {\n open var data: String\n open val length: Int\n fun substringData(offset: Int, count: Int): String\n fun appendData(data: String)\n fun insertData(offset: Int, data: String)\n fun deleteData(offset: Int, count: Int)\n fun replaceData(offset: Int, count: Int, data: String)\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [Text](https://developer.mozilla.org/en/docs/Web/API/Text) to Kotlin\n */\npublic external open class Text(data: String = definedExternally) : CharacterData, Slotable, GeometryUtils {\n open val wholeText: String\n override val assignedSlot: HTMLSlotElement?\n override val previousElementSibling: Element?\n override val nextElementSibling: Element?\n fun splitText(offset: Int): Text\n override fun getBoxQuads(options: BoxQuadOptions /* = definedExternally */): Array\n override fun convertQuadFromNode(quad: dynamic, from: dynamic, options: ConvertCoordinateOptions /* = definedExternally */): DOMQuad\n override fun convertRectFromNode(rect: DOMRectReadOnly, from: dynamic, options: ConvertCoordinateOptions /* = definedExternally */): DOMQuad\n override fun convertPointFromNode(point: DOMPointInit, from: dynamic, options: ConvertCoordinateOptions /* = definedExternally */): DOMPoint\n override fun before(vararg nodes: dynamic)\n override fun after(vararg nodes: dynamic)\n override fun replaceWith(vararg nodes: dynamic)\n override fun remove()\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [CDATASection](https://developer.mozilla.org/en/docs/Web/API/CDATASection) to Kotlin\n */\npublic external open class CDATASection : Text {\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [ProcessingInstruction](https://developer.mozilla.org/en/docs/Web/API/ProcessingInstruction) to Kotlin\n */\npublic external abstract class ProcessingInstruction : CharacterData, LinkStyle, UnionElementOrProcessingInstruction {\n open val target: String\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [Comment](https://developer.mozilla.org/en/docs/Web/API/Comment) to Kotlin\n */\npublic external open class Comment(data: String = definedExternally) : CharacterData {\n override val previousElementSibling: Element?\n override val nextElementSibling: Element?\n override fun before(vararg nodes: dynamic)\n override fun after(vararg nodes: dynamic)\n override fun replaceWith(vararg nodes: dynamic)\n override fun remove()\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [Range](https://developer.mozilla.org/en/docs/Web/API/Range) to Kotlin\n */\npublic external open class Range {\n open val startContainer: Node\n open val startOffset: Int\n open val endContainer: Node\n open val endOffset: Int\n open val collapsed: Boolean\n open val commonAncestorContainer: Node\n fun setStart(node: Node, offset: Int)\n fun setEnd(node: Node, offset: Int)\n fun setStartBefore(node: Node)\n fun setStartAfter(node: Node)\n fun setEndBefore(node: Node)\n fun setEndAfter(node: Node)\n fun collapse(toStart: Boolean = definedExternally)\n fun selectNode(node: Node)\n fun selectNodeContents(node: Node)\n fun compareBoundaryPoints(how: Short, sourceRange: Range): Short\n fun deleteContents()\n fun extractContents(): DocumentFragment\n fun cloneContents(): DocumentFragment\n fun insertNode(node: Node)\n fun surroundContents(newParent: Node)\n fun cloneRange(): Range\n fun detach()\n fun isPointInRange(node: Node, offset: Int): Boolean\n fun comparePoint(node: Node, offset: Int): Short\n fun intersectsNode(node: Node): Boolean\n fun getClientRects(): Array\n fun getBoundingClientRect(): DOMRect\n fun createContextualFragment(fragment: String): DocumentFragment\n\n companion object {\n val START_TO_START: Short\n val START_TO_END: Short\n val END_TO_END: Short\n val END_TO_START: Short\n }\n}\n\n/**\n * Exposes the JavaScript [NodeIterator](https://developer.mozilla.org/en/docs/Web/API/NodeIterator) to Kotlin\n */\npublic external abstract class NodeIterator {\n open val root: Node\n open val referenceNode: Node\n open val pointerBeforeReferenceNode: Boolean\n open val whatToShow: Int\n open val filter: NodeFilter?\n fun nextNode(): Node?\n fun previousNode(): Node?\n fun detach()\n}\n\n/**\n * Exposes the JavaScript [TreeWalker](https://developer.mozilla.org/en/docs/Web/API/TreeWalker) to Kotlin\n */\npublic external abstract class TreeWalker {\n open val root: Node\n open val whatToShow: Int\n open val filter: NodeFilter?\n open var currentNode: Node\n fun parentNode(): Node?\n fun firstChild(): Node?\n fun lastChild(): Node?\n fun previousSibling(): Node?\n fun nextSibling(): Node?\n fun previousNode(): Node?\n fun nextNode(): Node?\n}\n\n/**\n * Exposes the JavaScript [NodeFilter](https://developer.mozilla.org/en/docs/Web/API/NodeFilter) to Kotlin\n */\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface NodeFilter {\n fun acceptNode(node: Node): Short\n\n companion object {\n val FILTER_ACCEPT: Short\n val FILTER_REJECT: Short\n val FILTER_SKIP: Short\n val SHOW_ALL: Int\n val SHOW_ELEMENT: Int\n val SHOW_ATTRIBUTE: Int\n val SHOW_TEXT: Int\n val SHOW_CDATA_SECTION: Int\n val SHOW_ENTITY_REFERENCE: Int\n val SHOW_ENTITY: Int\n val SHOW_PROCESSING_INSTRUCTION: Int\n val SHOW_COMMENT: Int\n val SHOW_DOCUMENT: Int\n val SHOW_DOCUMENT_TYPE: Int\n val SHOW_DOCUMENT_FRAGMENT: Int\n val SHOW_NOTATION: Int\n }\n}\n\n/**\n * Exposes the JavaScript [DOMTokenList](https://developer.mozilla.org/en/docs/Web/API/DOMTokenList) to Kotlin\n */\npublic external abstract class DOMTokenList : ItemArrayLike {\n open var value: String\n fun contains(token: String): Boolean\n fun add(vararg tokens: String)\n fun remove(vararg tokens: String)\n fun toggle(token: String, force: Boolean = definedExternally): Boolean\n fun replace(token: String, newToken: String)\n fun supports(token: String): Boolean\n override fun item(index: Int): String?\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun DOMTokenList.get(index: Int): String? = asDynamic()[index]\n\n/**\n * Exposes the JavaScript [DOMPointReadOnly](https://developer.mozilla.org/en/docs/Web/API/DOMPointReadOnly) to Kotlin\n */\npublic external open class DOMPointReadOnly(x: Double, y: Double, z: Double, w: Double) {\n open val x: Double\n open val y: Double\n open val z: Double\n open val w: Double\n fun matrixTransform(matrix: DOMMatrixReadOnly): DOMPoint\n}\n\n/**\n * Exposes the JavaScript [DOMPoint](https://developer.mozilla.org/en/docs/Web/API/DOMPoint) to Kotlin\n */\npublic external open class DOMPoint : DOMPointReadOnly {\n constructor(point: DOMPointInit)\n constructor(x: Double = definedExternally, y: Double = definedExternally, z: Double = definedExternally, w: Double = definedExternally)\n override var x: Double\n override var y: Double\n override var z: Double\n override var w: Double\n}\n\n/**\n * Exposes the JavaScript [DOMPointInit](https://developer.mozilla.org/en/docs/Web/API/DOMPointInit) to Kotlin\n */\npublic external interface DOMPointInit {\n var x: Double? /* = 0.0 */\n get() = definedExternally\n set(value) = definedExternally\n var y: Double? /* = 0.0 */\n get() = definedExternally\n set(value) = definedExternally\n var z: Double? /* = 0.0 */\n get() = definedExternally\n set(value) = definedExternally\n var w: Double? /* = 1.0 */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun DOMPointInit(x: Double? = 0.0, y: Double? = 0.0, z: Double? = 0.0, w: Double? = 1.0): DOMPointInit {\n val o = js(\"({})\")\n o[\"x\"] = x\n o[\"y\"] = y\n o[\"z\"] = z\n o[\"w\"] = w\n return o\n}\n\n/**\n * Exposes the JavaScript [DOMRect](https://developer.mozilla.org/en/docs/Web/API/DOMRect) to Kotlin\n */\npublic external open class DOMRect(x: Double = definedExternally, y: Double = definedExternally, width: Double = definedExternally, height: Double = definedExternally) : DOMRectReadOnly {\n override var x: Double\n override var y: Double\n override var width: Double\n override var height: Double\n}\n\n/**\n * Exposes the JavaScript [DOMRectReadOnly](https://developer.mozilla.org/en/docs/Web/API/DOMRectReadOnly) to Kotlin\n */\npublic external open class DOMRectReadOnly(x: Double, y: Double, width: Double, height: Double) {\n open val x: Double\n open val y: Double\n open val width: Double\n open val height: Double\n open val top: Double\n open val right: Double\n open val bottom: Double\n open val left: Double\n}\n\npublic external interface DOMRectInit {\n var x: Double? /* = 0.0 */\n get() = definedExternally\n set(value) = definedExternally\n var y: Double? /* = 0.0 */\n get() = definedExternally\n set(value) = definedExternally\n var width: Double? /* = 0.0 */\n get() = definedExternally\n set(value) = definedExternally\n var height: Double? /* = 0.0 */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun DOMRectInit(x: Double? = 0.0, y: Double? = 0.0, width: Double? = 0.0, height: Double? = 0.0): DOMRectInit {\n val o = js(\"({})\")\n o[\"x\"] = x\n o[\"y\"] = y\n o[\"width\"] = width\n o[\"height\"] = height\n return o\n}\n\npublic external interface DOMRectList : ItemArrayLike {\n override fun item(index: Int): DOMRect?\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun DOMRectList.get(index: Int): DOMRect? = asDynamic()[index]\n\n/**\n * Exposes the JavaScript [DOMQuad](https://developer.mozilla.org/en/docs/Web/API/DOMQuad) to Kotlin\n */\npublic external open class DOMQuad {\n constructor(p1: DOMPointInit = definedExternally, p2: DOMPointInit = definedExternally, p3: DOMPointInit = definedExternally, p4: DOMPointInit = definedExternally)\n constructor(rect: DOMRectInit)\n open val p1: DOMPoint\n open val p2: DOMPoint\n open val p3: DOMPoint\n open val p4: DOMPoint\n open val bounds: DOMRectReadOnly\n}\n\n/**\n * Exposes the JavaScript [DOMMatrixReadOnly](https://developer.mozilla.org/en/docs/Web/API/DOMMatrixReadOnly) to Kotlin\n */\npublic external open class DOMMatrixReadOnly(numberSequence: Array) {\n open val a: Double\n open val b: Double\n open val c: Double\n open val d: Double\n open val e: Double\n open val f: Double\n open val m11: Double\n open val m12: Double\n open val m13: Double\n open val m14: Double\n open val m21: Double\n open val m22: Double\n open val m23: Double\n open val m24: Double\n open val m31: Double\n open val m32: Double\n open val m33: Double\n open val m34: Double\n open val m41: Double\n open val m42: Double\n open val m43: Double\n open val m44: Double\n open val is2D: Boolean\n open val isIdentity: Boolean\n fun translate(tx: Double, ty: Double, tz: Double = definedExternally): DOMMatrix\n fun scale(scale: Double, originX: Double = definedExternally, originY: Double = definedExternally): DOMMatrix\n fun scale3d(scale: Double, originX: Double = definedExternally, originY: Double = definedExternally, originZ: Double = definedExternally): DOMMatrix\n fun scaleNonUniform(scaleX: Double, scaleY: Double = definedExternally, scaleZ: Double = definedExternally, originX: Double = definedExternally, originY: Double = definedExternally, originZ: Double = definedExternally): DOMMatrix\n fun rotate(angle: Double, originX: Double = definedExternally, originY: Double = definedExternally): DOMMatrix\n fun rotateFromVector(x: Double, y: Double): DOMMatrix\n fun rotateAxisAngle(x: Double, y: Double, z: Double, angle: Double): DOMMatrix\n fun skewX(sx: Double): DOMMatrix\n fun skewY(sy: Double): DOMMatrix\n fun multiply(other: DOMMatrix): DOMMatrix\n fun flipX(): DOMMatrix\n fun flipY(): DOMMatrix\n fun inverse(): DOMMatrix\n fun transformPoint(point: DOMPointInit = definedExternally): DOMPoint\n fun toFloat32Array(): Float32Array\n fun toFloat64Array(): Float64Array\n}\n\n/**\n * Exposes the JavaScript [DOMMatrix](https://developer.mozilla.org/en/docs/Web/API/DOMMatrix) to Kotlin\n */\npublic external open class DOMMatrix() : DOMMatrixReadOnly {\n constructor(transformList: String)\n constructor(other: DOMMatrixReadOnly)\n constructor(array32: Float32Array)\n constructor(array64: Float64Array)\n constructor(numberSequence: Array)\n override var a: Double\n override var b: Double\n override var c: Double\n override var d: Double\n override var e: Double\n override var f: Double\n override var m11: Double\n override var m12: Double\n override var m13: Double\n override var m14: Double\n override var m21: Double\n override var m22: Double\n override var m23: Double\n override var m24: Double\n override var m31: Double\n override var m32: Double\n override var m33: Double\n override var m34: Double\n override var m41: Double\n override var m42: Double\n override var m43: Double\n override var m44: Double\n fun multiplySelf(other: DOMMatrix): DOMMatrix\n fun preMultiplySelf(other: DOMMatrix): DOMMatrix\n fun translateSelf(tx: Double, ty: Double, tz: Double = definedExternally): DOMMatrix\n fun scaleSelf(scale: Double, originX: Double = definedExternally, originY: Double = definedExternally): DOMMatrix\n fun scale3dSelf(scale: Double, originX: Double = definedExternally, originY: Double = definedExternally, originZ: Double = definedExternally): DOMMatrix\n fun scaleNonUniformSelf(scaleX: Double, scaleY: Double = definedExternally, scaleZ: Double = definedExternally, originX: Double = definedExternally, originY: Double = definedExternally, originZ: Double = definedExternally): DOMMatrix\n fun rotateSelf(angle: Double, originX: Double = definedExternally, originY: Double = definedExternally): DOMMatrix\n fun rotateFromVectorSelf(x: Double, y: Double): DOMMatrix\n fun rotateAxisAngleSelf(x: Double, y: Double, z: Double, angle: Double): DOMMatrix\n fun skewXSelf(sx: Double): DOMMatrix\n fun skewYSelf(sy: Double): DOMMatrix\n fun invertSelf(): DOMMatrix\n fun setMatrixValue(transformList: String): DOMMatrix\n}\n\npublic external interface ScrollOptions {\n var behavior: ScrollBehavior? /* = ScrollBehavior.AUTO */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun ScrollOptions(behavior: ScrollBehavior? = ScrollBehavior.AUTO): ScrollOptions {\n val o = js(\"({})\")\n o[\"behavior\"] = behavior\n return o\n}\n\n/**\n * Exposes the JavaScript [ScrollToOptions](https://developer.mozilla.org/en/docs/Web/API/ScrollToOptions) to Kotlin\n */\npublic external interface ScrollToOptions : ScrollOptions {\n var left: Double?\n get() = definedExternally\n set(value) = definedExternally\n var top: Double?\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun ScrollToOptions(left: Double? = undefined, top: Double? = undefined, behavior: ScrollBehavior? = ScrollBehavior.AUTO): ScrollToOptions {\n val o = js(\"({})\")\n o[\"left\"] = left\n o[\"top\"] = top\n o[\"behavior\"] = behavior\n return o\n}\n\n/**\n * Exposes the JavaScript [MediaQueryList](https://developer.mozilla.org/en/docs/Web/API/MediaQueryList) to Kotlin\n */\npublic external abstract class MediaQueryList : EventTarget {\n open val media: String\n open val matches: Boolean\n open var onchange: ((Event) -> dynamic)?\n fun addListener(listener: EventListener?)\n fun addListener(listener: ((Event) -> Unit)?)\n fun removeListener(listener: EventListener?)\n fun removeListener(listener: ((Event) -> Unit)?)\n}\n\n/**\n * Exposes the JavaScript [MediaQueryListEvent](https://developer.mozilla.org/en/docs/Web/API/MediaQueryListEvent) to Kotlin\n */\npublic external open class MediaQueryListEvent(type: String, eventInitDict: MediaQueryListEventInit = definedExternally) : Event {\n open val media: String\n open val matches: Boolean\n\n companion object {\n val NONE: Short\n val CAPTURING_PHASE: Short\n val AT_TARGET: Short\n val BUBBLING_PHASE: Short\n }\n}\n\npublic external interface MediaQueryListEventInit : EventInit {\n var media: String? /* = \"\" */\n get() = definedExternally\n set(value) = definedExternally\n var matches: Boolean? /* = false */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun MediaQueryListEventInit(media: String? = \"\", matches: Boolean? = false, bubbles: Boolean? = false, cancelable: Boolean? = false, composed: Boolean? = false): MediaQueryListEventInit {\n val o = js(\"({})\")\n o[\"media\"] = media\n o[\"matches\"] = matches\n o[\"bubbles\"] = bubbles\n o[\"cancelable\"] = cancelable\n o[\"composed\"] = composed\n return o\n}\n\n/**\n * Exposes the JavaScript [Screen](https://developer.mozilla.org/en/docs/Web/API/Screen) to Kotlin\n */\npublic external abstract class Screen {\n open val availWidth: Int\n open val availHeight: Int\n open val width: Int\n open val height: Int\n open val colorDepth: Int\n open val pixelDepth: Int\n}\n\n/**\n * Exposes the JavaScript [CaretPosition](https://developer.mozilla.org/en/docs/Web/API/CaretPosition) to Kotlin\n */\npublic external abstract class CaretPosition {\n open val offsetNode: Node\n open val offset: Int\n fun getClientRect(): DOMRect?\n}\n\npublic external interface ScrollIntoViewOptions : ScrollOptions {\n var block: ScrollLogicalPosition? /* = ScrollLogicalPosition.CENTER */\n get() = definedExternally\n set(value) = definedExternally\n var inline: ScrollLogicalPosition? /* = ScrollLogicalPosition.CENTER */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun ScrollIntoViewOptions(block: ScrollLogicalPosition? = ScrollLogicalPosition.CENTER, inline: ScrollLogicalPosition? = ScrollLogicalPosition.CENTER, behavior: ScrollBehavior? = ScrollBehavior.AUTO): ScrollIntoViewOptions {\n val o = js(\"({})\")\n o[\"block\"] = block\n o[\"inline\"] = inline\n o[\"behavior\"] = behavior\n return o\n}\n\npublic external interface BoxQuadOptions {\n var box: CSSBoxType? /* = CSSBoxType.BORDER */\n get() = definedExternally\n set(value) = definedExternally\n var relativeTo: dynamic\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun BoxQuadOptions(box: CSSBoxType? = CSSBoxType.BORDER, relativeTo: dynamic = undefined): BoxQuadOptions {\n val o = js(\"({})\")\n o[\"box\"] = box\n o[\"relativeTo\"] = relativeTo\n return o\n}\n\npublic external interface ConvertCoordinateOptions {\n var fromBox: CSSBoxType? /* = CSSBoxType.BORDER */\n get() = definedExternally\n set(value) = definedExternally\n var toBox: CSSBoxType? /* = CSSBoxType.BORDER */\n get() = definedExternally\n set(value) = definedExternally\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline fun ConvertCoordinateOptions(fromBox: CSSBoxType? = CSSBoxType.BORDER, toBox: CSSBoxType? = CSSBoxType.BORDER): ConvertCoordinateOptions {\n val o = js(\"({})\")\n o[\"fromBox\"] = fromBox\n o[\"toBox\"] = toBox\n return o\n}\n\n/**\n * Exposes the JavaScript [GeometryUtils](https://developer.mozilla.org/en/docs/Web/API/GeometryUtils) to Kotlin\n */\npublic external interface GeometryUtils {\n fun getBoxQuads(options: BoxQuadOptions = definedExternally): Array\n fun convertQuadFromNode(quad: dynamic, from: dynamic, options: ConvertCoordinateOptions = definedExternally): DOMQuad\n fun convertRectFromNode(rect: DOMRectReadOnly, from: dynamic, options: ConvertCoordinateOptions = definedExternally): DOMQuad\n fun convertPointFromNode(point: DOMPointInit, from: dynamic, options: ConvertCoordinateOptions = definedExternally): DOMPoint\n}\n\n/**\n * Exposes the JavaScript [Touch](https://developer.mozilla.org/en/docs/Web/API/Touch) to Kotlin\n */\npublic external abstract class Touch {\n open val identifier: Int\n open val target: EventTarget\n open val screenX: Int\n open val screenY: Int\n open val clientX: Int\n open val clientY: Int\n open val pageX: Int\n open val pageY: Int\n open val region: String?\n}\n\npublic external abstract class TouchList : ItemArrayLike {\n override fun item(index: Int): Touch?\n}\n\n@Suppress(\"INVISIBLE_REFERENCE\", \"INVISIBLE_MEMBER\")\n@kotlin.internal.InlineOnly\npublic inline operator fun TouchList.get(index: Int): Touch? = asDynamic()[index]\n\npublic external open class TouchEvent : UIEvent {\n open val touches: TouchList\n open val targetTouches: TouchList\n open val changedTouches: TouchList\n open val altKey: Boolean\n open val metaKey: Boolean\n open val ctrlKey: Boolean\n open val shiftKey: Boolean\n\n companion object {\n val NONE: Short\n val CAPTURING_PHASE: Short\n val AT_TARGET: Short\n val BUBBLING_PHASE: Short\n }\n}\n\n/**\n * Exposes the JavaScript [Image](https://developer.mozilla.org/en/docs/Web/API/Image) to Kotlin\n */\npublic external open class Image(width: Int = definedExternally, height: Int = definedExternally) : HTMLImageElement {\n override var onabort: ((Event) -> dynamic)?\n override var onblur: ((FocusEvent) -> dynamic)?\n override var oncancel: ((Event) -> dynamic)?\n override var oncanplay: ((Event) -> dynamic)?\n override var oncanplaythrough: ((Event) -> dynamic)?\n override var onchange: ((Event) -> dynamic)?\n override var onclick: ((MouseEvent) -> dynamic)?\n override var onclose: ((Event) -> dynamic)?\n override var oncontextmenu: ((MouseEvent) -> dynamic)?\n override var oncuechange: ((Event) -> dynamic)?\n override var ondblclick: ((MouseEvent) -> dynamic)?\n override var ondrag: ((DragEvent) -> dynamic)?\n override var ondragend: ((DragEvent) -> dynamic)?\n override var ondragenter: ((DragEvent) -> dynamic)?\n override var ondragexit: ((DragEvent) -> dynamic)?\n override var ondragleave: ((DragEvent) -> dynamic)?\n override var ondragover: ((DragEvent) -> dynamic)?\n override var ondragstart: ((DragEvent) -> dynamic)?\n override var ondrop: ((DragEvent) -> dynamic)?\n override var ondurationchange: ((Event) -> dynamic)?\n override var onemptied: ((Event) -> dynamic)?\n override var onended: ((Event) -> dynamic)?\n override var onerror: ((dynamic, String, Int, Int, Any?) -> dynamic)?\n override var onfocus: ((FocusEvent) -> dynamic)?\n override var oninput: ((InputEvent) -> dynamic)?\n override var oninvalid: ((Event) -> dynamic)?\n override var onkeydown: ((KeyboardEvent) -> dynamic)?\n override var onkeypress: ((KeyboardEvent) -> dynamic)?\n override var onkeyup: ((KeyboardEvent) -> dynamic)?\n override var onload: ((Event) -> dynamic)?\n override var onloadeddata: ((Event) -> dynamic)?\n override var onloadedmetadata: ((Event) -> dynamic)?\n override var onloadend: ((Event) -> dynamic)?\n override var onloadstart: ((ProgressEvent) -> dynamic)?\n override var onmousedown: ((MouseEvent) -> dynamic)?\n override var onmouseenter: ((MouseEvent) -> dynamic)?\n override var onmouseleave: ((MouseEvent) -> dynamic)?\n override var onmousemove: ((MouseEvent) -> dynamic)?\n override var onmouseout: ((MouseEvent) -> dynamic)?\n override var onmouseover: ((MouseEvent) -> dynamic)?\n override var onmouseup: ((MouseEvent) -> dynamic)?\n override var onwheel: ((WheelEvent) -> dynamic)?\n override var onpause: ((Event) -> dynamic)?\n override var onplay: ((Event) -> dynamic)?\n override var onplaying: ((Event) -> dynamic)?\n override var onprogress: ((ProgressEvent) -> dynamic)?\n override var onratechange: ((Event) -> dynamic)?\n override var onreset: ((Event) -> dynamic)?\n override var onresize: ((Event) -> dynamic)?\n override var onscroll: ((Event) -> dynamic)?\n override var onseeked: ((Event) -> dynamic)?\n override var onseeking: ((Event) -> dynamic)?\n override var onselect: ((Event) -> dynamic)?\n override var onshow: ((Event) -> dynamic)?\n override var onstalled: ((Event) -> dynamic)?\n override var onsubmit: ((Event) -> dynamic)?\n override var onsuspend: ((Event) -> dynamic)?\n override var ontimeupdate: ((Event) -> dynamic)?\n override var ontoggle: ((Event) -> dynamic)?\n override var onvolumechange: ((Event) -> dynamic)?\n override var onwaiting: ((Event) -> dynamic)?\n override var ongotpointercapture: ((PointerEvent) -> dynamic)?\n override var onlostpointercapture: ((PointerEvent) -> dynamic)?\n override var onpointerdown: ((PointerEvent) -> dynamic)?\n override var onpointermove: ((PointerEvent) -> dynamic)?\n override var onpointerup: ((PointerEvent) -> dynamic)?\n override var onpointercancel: ((PointerEvent) -> dynamic)?\n override var onpointerover: ((PointerEvent) -> dynamic)?\n override var onpointerout: ((PointerEvent) -> dynamic)?\n override var onpointerenter: ((PointerEvent) -> dynamic)?\n override var onpointerleave: ((PointerEvent) -> dynamic)?\n override var oncopy: ((ClipboardEvent) -> dynamic)?\n override var oncut: ((ClipboardEvent) -> dynamic)?\n override var onpaste: ((ClipboardEvent) -> dynamic)?\n override var contentEditable: String\n override val isContentEditable: Boolean\n override val style: CSSStyleDeclaration\n override val children: HTMLCollection\n override val firstElementChild: Element?\n override val lastElementChild: Element?\n override val childElementCount: Int\n override val previousElementSibling: Element?\n override val nextElementSibling: Element?\n override val assignedSlot: HTMLSlotElement?\n override fun prepend(vararg nodes: dynamic)\n override fun append(vararg nodes: dynamic)\n override fun querySelector(selectors: String): Element?\n override fun querySelectorAll(selectors: String): NodeList\n override fun before(vararg nodes: dynamic)\n override fun after(vararg nodes: dynamic)\n override fun replaceWith(vararg nodes: dynamic)\n override fun remove()\n override fun getBoxQuads(options: BoxQuadOptions /* = definedExternally */): Array\n override fun convertQuadFromNode(quad: dynamic, from: dynamic, options: ConvertCoordinateOptions /* = definedExternally */): DOMQuad\n override fun convertRectFromNode(rect: DOMRectReadOnly, from: dynamic, options: ConvertCoordinateOptions /* = definedExternally */): DOMQuad\n override fun convertPointFromNode(point: DOMPointInit, from: dynamic, options: ConvertCoordinateOptions /* = definedExternally */): DOMPoint\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\npublic external open class Audio(src: String = definedExternally) : HTMLAudioElement {\n override var onabort: ((Event) -> dynamic)?\n override var onblur: ((FocusEvent) -> dynamic)?\n override var oncancel: ((Event) -> dynamic)?\n override var oncanplay: ((Event) -> dynamic)?\n override var oncanplaythrough: ((Event) -> dynamic)?\n override var onchange: ((Event) -> dynamic)?\n override var onclick: ((MouseEvent) -> dynamic)?\n override var onclose: ((Event) -> dynamic)?\n override var oncontextmenu: ((MouseEvent) -> dynamic)?\n override var oncuechange: ((Event) -> dynamic)?\n override var ondblclick: ((MouseEvent) -> dynamic)?\n override var ondrag: ((DragEvent) -> dynamic)?\n override var ondragend: ((DragEvent) -> dynamic)?\n override var ondragenter: ((DragEvent) -> dynamic)?\n override var ondragexit: ((DragEvent) -> dynamic)?\n override var ondragleave: ((DragEvent) -> dynamic)?\n override var ondragover: ((DragEvent) -> dynamic)?\n override var ondragstart: ((DragEvent) -> dynamic)?\n override var ondrop: ((DragEvent) -> dynamic)?\n override var ondurationchange: ((Event) -> dynamic)?\n override var onemptied: ((Event) -> dynamic)?\n override var onended: ((Event) -> dynamic)?\n override var onerror: ((dynamic, String, Int, Int, Any?) -> dynamic)?\n override var onfocus: ((FocusEvent) -> dynamic)?\n override var oninput: ((InputEvent) -> dynamic)?\n override var oninvalid: ((Event) -> dynamic)?\n override var onkeydown: ((KeyboardEvent) -> dynamic)?\n override var onkeypress: ((KeyboardEvent) -> dynamic)?\n override var onkeyup: ((KeyboardEvent) -> dynamic)?\n override var onload: ((Event) -> dynamic)?\n override var onloadeddata: ((Event) -> dynamic)?\n override var onloadedmetadata: ((Event) -> dynamic)?\n override var onloadend: ((Event) -> dynamic)?\n override var onloadstart: ((ProgressEvent) -> dynamic)?\n override var onmousedown: ((MouseEvent) -> dynamic)?\n override var onmouseenter: ((MouseEvent) -> dynamic)?\n override var onmouseleave: ((MouseEvent) -> dynamic)?\n override var onmousemove: ((MouseEvent) -> dynamic)?\n override var onmouseout: ((MouseEvent) -> dynamic)?\n override var onmouseover: ((MouseEvent) -> dynamic)?\n override var onmouseup: ((MouseEvent) -> dynamic)?\n override var onwheel: ((WheelEvent) -> dynamic)?\n override var onpause: ((Event) -> dynamic)?\n override var onplay: ((Event) -> dynamic)?\n override var onplaying: ((Event) -> dynamic)?\n override var onprogress: ((ProgressEvent) -> dynamic)?\n override var onratechange: ((Event) -> dynamic)?\n override var onreset: ((Event) -> dynamic)?\n override var onresize: ((Event) -> dynamic)?\n override var onscroll: ((Event) -> dynamic)?\n override var onseeked: ((Event) -> dynamic)?\n override var onseeking: ((Event) -> dynamic)?\n override var onselect: ((Event) -> dynamic)?\n override var onshow: ((Event) -> dynamic)?\n override var onstalled: ((Event) -> dynamic)?\n override var onsubmit: ((Event) -> dynamic)?\n override var onsuspend: ((Event) -> dynamic)?\n override var ontimeupdate: ((Event) -> dynamic)?\n override var ontoggle: ((Event) -> dynamic)?\n override var onvolumechange: ((Event) -> dynamic)?\n override var onwaiting: ((Event) -> dynamic)?\n override var ongotpointercapture: ((PointerEvent) -> dynamic)?\n override var onlostpointercapture: ((PointerEvent) -> dynamic)?\n override var onpointerdown: ((PointerEvent) -> dynamic)?\n override var onpointermove: ((PointerEvent) -> dynamic)?\n override var onpointerup: ((PointerEvent) -> dynamic)?\n override var onpointercancel: ((PointerEvent) -> dynamic)?\n override var onpointerover: ((PointerEvent) -> dynamic)?\n override var onpointerout: ((PointerEvent) -> dynamic)?\n override var onpointerenter: ((PointerEvent) -> dynamic)?\n override var onpointerleave: ((PointerEvent) -> dynamic)?\n override var oncopy: ((ClipboardEvent) -> dynamic)?\n override var oncut: ((ClipboardEvent) -> dynamic)?\n override var onpaste: ((ClipboardEvent) -> dynamic)?\n override var contentEditable: String\n override val isContentEditable: Boolean\n override val style: CSSStyleDeclaration\n override val children: HTMLCollection\n override val firstElementChild: Element?\n override val lastElementChild: Element?\n override val childElementCount: Int\n override val previousElementSibling: Element?\n override val nextElementSibling: Element?\n override val assignedSlot: HTMLSlotElement?\n override fun prepend(vararg nodes: dynamic)\n override fun append(vararg nodes: dynamic)\n override fun querySelector(selectors: String): Element?\n override fun querySelectorAll(selectors: String): NodeList\n override fun before(vararg nodes: dynamic)\n override fun after(vararg nodes: dynamic)\n override fun replaceWith(vararg nodes: dynamic)\n override fun remove()\n override fun getBoxQuads(options: BoxQuadOptions /* = definedExternally */): Array\n override fun convertQuadFromNode(quad: dynamic, from: dynamic, options: ConvertCoordinateOptions /* = definedExternally */): DOMQuad\n override fun convertRectFromNode(rect: DOMRectReadOnly, from: dynamic, options: ConvertCoordinateOptions /* = definedExternally */): DOMQuad\n override fun convertPointFromNode(point: DOMPointInit, from: dynamic, options: ConvertCoordinateOptions /* = definedExternally */): DOMPoint\n\n companion object {\n val NETWORK_EMPTY: Short\n val NETWORK_IDLE: Short\n val NETWORK_LOADING: Short\n val NETWORK_NO_SOURCE: Short\n val HAVE_NOTHING: Short\n val HAVE_METADATA: Short\n val HAVE_CURRENT_DATA: Short\n val HAVE_FUTURE_DATA: Short\n val HAVE_ENOUGH_DATA: Short\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\n/**\n * Exposes the JavaScript [Option](https://developer.mozilla.org/en/docs/Web/API/Option) to Kotlin\n */\npublic external open class Option(text: String = definedExternally, value: String = definedExternally, defaultSelected: Boolean = definedExternally, selected: Boolean = definedExternally) : HTMLOptionElement {\n override var onabort: ((Event) -> dynamic)?\n override var onblur: ((FocusEvent) -> dynamic)?\n override var oncancel: ((Event) -> dynamic)?\n override var oncanplay: ((Event) -> dynamic)?\n override var oncanplaythrough: ((Event) -> dynamic)?\n override var onchange: ((Event) -> dynamic)?\n override var onclick: ((MouseEvent) -> dynamic)?\n override var onclose: ((Event) -> dynamic)?\n override var oncontextmenu: ((MouseEvent) -> dynamic)?\n override var oncuechange: ((Event) -> dynamic)?\n override var ondblclick: ((MouseEvent) -> dynamic)?\n override var ondrag: ((DragEvent) -> dynamic)?\n override var ondragend: ((DragEvent) -> dynamic)?\n override var ondragenter: ((DragEvent) -> dynamic)?\n override var ondragexit: ((DragEvent) -> dynamic)?\n override var ondragleave: ((DragEvent) -> dynamic)?\n override var ondragover: ((DragEvent) -> dynamic)?\n override var ondragstart: ((DragEvent) -> dynamic)?\n override var ondrop: ((DragEvent) -> dynamic)?\n override var ondurationchange: ((Event) -> dynamic)?\n override var onemptied: ((Event) -> dynamic)?\n override var onended: ((Event) -> dynamic)?\n override var onerror: ((dynamic, String, Int, Int, Any?) -> dynamic)?\n override var onfocus: ((FocusEvent) -> dynamic)?\n override var oninput: ((InputEvent) -> dynamic)?\n override var oninvalid: ((Event) -> dynamic)?\n override var onkeydown: ((KeyboardEvent) -> dynamic)?\n override var onkeypress: ((KeyboardEvent) -> dynamic)?\n override var onkeyup: ((KeyboardEvent) -> dynamic)?\n override var onload: ((Event) -> dynamic)?\n override var onloadeddata: ((Event) -> dynamic)?\n override var onloadedmetadata: ((Event) -> dynamic)?\n override var onloadend: ((Event) -> dynamic)?\n override var onloadstart: ((ProgressEvent) -> dynamic)?\n override var onmousedown: ((MouseEvent) -> dynamic)?\n override var onmouseenter: ((MouseEvent) -> dynamic)?\n override var onmouseleave: ((MouseEvent) -> dynamic)?\n override var onmousemove: ((MouseEvent) -> dynamic)?\n override var onmouseout: ((MouseEvent) -> dynamic)?\n override var onmouseover: ((MouseEvent) -> dynamic)?\n override var onmouseup: ((MouseEvent) -> dynamic)?\n override var onwheel: ((WheelEvent) -> dynamic)?\n override var onpause: ((Event) -> dynamic)?\n override var onplay: ((Event) -> dynamic)?\n override var onplaying: ((Event) -> dynamic)?\n override var onprogress: ((ProgressEvent) -> dynamic)?\n override var onratechange: ((Event) -> dynamic)?\n override var onreset: ((Event) -> dynamic)?\n override var onresize: ((Event) -> dynamic)?\n override var onscroll: ((Event) -> dynamic)?\n override var onseeked: ((Event) -> dynamic)?\n override var onseeking: ((Event) -> dynamic)?\n override var onselect: ((Event) -> dynamic)?\n override var onshow: ((Event) -> dynamic)?\n override var onstalled: ((Event) -> dynamic)?\n override var onsubmit: ((Event) -> dynamic)?\n override var onsuspend: ((Event) -> dynamic)?\n override var ontimeupdate: ((Event) -> dynamic)?\n override var ontoggle: ((Event) -> dynamic)?\n override var onvolumechange: ((Event) -> dynamic)?\n override var onwaiting: ((Event) -> dynamic)?\n override var ongotpointercapture: ((PointerEvent) -> dynamic)?\n override var onlostpointercapture: ((PointerEvent) -> dynamic)?\n override var onpointerdown: ((PointerEvent) -> dynamic)?\n override var onpointermove: ((PointerEvent) -> dynamic)?\n override var onpointerup: ((PointerEvent) -> dynamic)?\n override var onpointercancel: ((PointerEvent) -> dynamic)?\n override var onpointerover: ((PointerEvent) -> dynamic)?\n override var onpointerout: ((PointerEvent) -> dynamic)?\n override var onpointerenter: ((PointerEvent) -> dynamic)?\n override var onpointerleave: ((PointerEvent) -> dynamic)?\n override var oncopy: ((ClipboardEvent) -> dynamic)?\n override var oncut: ((ClipboardEvent) -> dynamic)?\n override var onpaste: ((ClipboardEvent) -> dynamic)?\n override var contentEditable: String\n override val isContentEditable: Boolean\n override val style: CSSStyleDeclaration\n override val children: HTMLCollection\n override val firstElementChild: Element?\n override val lastElementChild: Element?\n override val childElementCount: Int\n override val previousElementSibling: Element?\n override val nextElementSibling: Element?\n override val assignedSlot: HTMLSlotElement?\n override fun prepend(vararg nodes: dynamic)\n override fun append(vararg nodes: dynamic)\n override fun querySelector(selectors: String): Element?\n override fun querySelectorAll(selectors: String): NodeList\n override fun before(vararg nodes: dynamic)\n override fun after(vararg nodes: dynamic)\n override fun replaceWith(vararg nodes: dynamic)\n override fun remove()\n override fun getBoxQuads(options: BoxQuadOptions /* = definedExternally */): Array\n override fun convertQuadFromNode(quad: dynamic, from: dynamic, options: ConvertCoordinateOptions /* = definedExternally */): DOMQuad\n override fun convertRectFromNode(rect: DOMRectReadOnly, from: dynamic, options: ConvertCoordinateOptions /* = definedExternally */): DOMQuad\n override fun convertPointFromNode(point: DOMPointInit, from: dynamic, options: ConvertCoordinateOptions /* = definedExternally */): DOMPoint\n\n companion object {\n val ELEMENT_NODE: Short\n val ATTRIBUTE_NODE: Short\n val TEXT_NODE: Short\n val CDATA_SECTION_NODE: Short\n val ENTITY_REFERENCE_NODE: Short\n val ENTITY_NODE: Short\n val PROCESSING_INSTRUCTION_NODE: Short\n val COMMENT_NODE: Short\n val DOCUMENT_NODE: Short\n val DOCUMENT_TYPE_NODE: Short\n val DOCUMENT_FRAGMENT_NODE: Short\n val NOTATION_NODE: Short\n val DOCUMENT_POSITION_DISCONNECTED: Short\n val DOCUMENT_POSITION_PRECEDING: Short\n val DOCUMENT_POSITION_FOLLOWING: Short\n val DOCUMENT_POSITION_CONTAINS: Short\n val DOCUMENT_POSITION_CONTAINED_BY: Short\n val DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: Short\n }\n}\n\npublic external interface UnionElementOrHTMLCollection\n\npublic external interface UnionElementOrRadioNodeList\n\npublic external interface UnionHTMLOptGroupElementOrHTMLOptionElement\n\npublic external interface UnionAudioTrackOrTextTrackOrVideoTrack\n\npublic external interface UnionElementOrMouseEvent\n\npublic external interface UnionMessagePortOrWindowProxy\n\npublic external interface MediaProvider\n\npublic external interface RenderingContext\n\npublic external interface HTMLOrSVGImageElement : CanvasImageSource\n\npublic external interface CanvasImageSource : ImageBitmapSource\n\npublic external interface ImageBitmapSource\n\npublic external interface HTMLOrSVGScriptElement\n\n/* please, don't implement this interface! */\n@JsName(\"null\")\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface DocumentReadyState {\n companion object\n}\n\npublic inline val DocumentReadyState.Companion.LOADING: DocumentReadyState get() = \"loading\".asDynamic().unsafeCast()\n\npublic inline val DocumentReadyState.Companion.INTERACTIVE: DocumentReadyState get() = \"interactive\".asDynamic().unsafeCast()\n\npublic inline val DocumentReadyState.Companion.COMPLETE: DocumentReadyState get() = \"complete\".asDynamic().unsafeCast()\n\n/* please, don't implement this interface! */\n@JsName(\"null\")\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface CanPlayTypeResult {\n companion object\n}\n\npublic inline val CanPlayTypeResult.Companion.EMPTY: CanPlayTypeResult get() = \"\".asDynamic().unsafeCast()\n\npublic inline val CanPlayTypeResult.Companion.MAYBE: CanPlayTypeResult get() = \"maybe\".asDynamic().unsafeCast()\n\npublic inline val CanPlayTypeResult.Companion.PROBABLY: CanPlayTypeResult get() = \"probably\".asDynamic().unsafeCast()\n\n/* please, don't implement this interface! */\n@JsName(\"null\")\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface TextTrackMode {\n companion object\n}\n\npublic inline val TextTrackMode.Companion.DISABLED: TextTrackMode get() = \"disabled\".asDynamic().unsafeCast()\n\npublic inline val TextTrackMode.Companion.HIDDEN: TextTrackMode get() = \"hidden\".asDynamic().unsafeCast()\n\npublic inline val TextTrackMode.Companion.SHOWING: TextTrackMode get() = \"showing\".asDynamic().unsafeCast()\n\n/* please, don't implement this interface! */\n@JsName(\"null\")\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface TextTrackKind {\n companion object\n}\n\npublic inline val TextTrackKind.Companion.SUBTITLES: TextTrackKind get() = \"subtitles\".asDynamic().unsafeCast()\n\npublic inline val TextTrackKind.Companion.CAPTIONS: TextTrackKind get() = \"captions\".asDynamic().unsafeCast()\n\npublic inline val TextTrackKind.Companion.DESCRIPTIONS: TextTrackKind get() = \"descriptions\".asDynamic().unsafeCast()\n\npublic inline val TextTrackKind.Companion.CHAPTERS: TextTrackKind get() = \"chapters\".asDynamic().unsafeCast()\n\npublic inline val TextTrackKind.Companion.METADATA: TextTrackKind get() = \"metadata\".asDynamic().unsafeCast()\n\n/* please, don't implement this interface! */\n@JsName(\"null\")\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface SelectionMode {\n companion object\n}\n\npublic inline val SelectionMode.Companion.SELECT: SelectionMode get() = \"select\".asDynamic().unsafeCast()\n\npublic inline val SelectionMode.Companion.START: SelectionMode get() = \"start\".asDynamic().unsafeCast()\n\npublic inline val SelectionMode.Companion.END: SelectionMode get() = \"end\".asDynamic().unsafeCast()\n\npublic inline val SelectionMode.Companion.PRESERVE: SelectionMode get() = \"preserve\".asDynamic().unsafeCast()\n\n/* please, don't implement this interface! */\n@JsName(\"null\")\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface CanvasFillRule {\n companion object\n}\n\npublic inline val CanvasFillRule.Companion.NONZERO: CanvasFillRule get() = \"nonzero\".asDynamic().unsafeCast()\n\npublic inline val CanvasFillRule.Companion.EVENODD: CanvasFillRule get() = \"evenodd\".asDynamic().unsafeCast()\n\n/* please, don't implement this interface! */\n@JsName(\"null\")\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface ImageSmoothingQuality {\n companion object\n}\n\npublic inline val ImageSmoothingQuality.Companion.LOW: ImageSmoothingQuality get() = \"low\".asDynamic().unsafeCast()\n\npublic inline val ImageSmoothingQuality.Companion.MEDIUM: ImageSmoothingQuality get() = \"medium\".asDynamic().unsafeCast()\n\npublic inline val ImageSmoothingQuality.Companion.HIGH: ImageSmoothingQuality get() = \"high\".asDynamic().unsafeCast()\n\n/* please, don't implement this interface! */\n@JsName(\"null\")\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface CanvasLineCap {\n companion object\n}\n\npublic inline val CanvasLineCap.Companion.BUTT: CanvasLineCap get() = \"butt\".asDynamic().unsafeCast()\n\npublic inline val CanvasLineCap.Companion.ROUND: CanvasLineCap get() = \"round\".asDynamic().unsafeCast()\n\npublic inline val CanvasLineCap.Companion.SQUARE: CanvasLineCap get() = \"square\".asDynamic().unsafeCast()\n\n/* please, don't implement this interface! */\n@JsName(\"null\")\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface CanvasLineJoin {\n companion object\n}\n\npublic inline val CanvasLineJoin.Companion.ROUND: CanvasLineJoin get() = \"round\".asDynamic().unsafeCast()\n\npublic inline val CanvasLineJoin.Companion.BEVEL: CanvasLineJoin get() = \"bevel\".asDynamic().unsafeCast()\n\npublic inline val CanvasLineJoin.Companion.MITER: CanvasLineJoin get() = \"miter\".asDynamic().unsafeCast()\n\n/* please, don't implement this interface! */\n@JsName(\"null\")\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface CanvasTextAlign {\n companion object\n}\n\npublic inline val CanvasTextAlign.Companion.START: CanvasTextAlign get() = \"start\".asDynamic().unsafeCast()\n\npublic inline val CanvasTextAlign.Companion.END: CanvasTextAlign get() = \"end\".asDynamic().unsafeCast()\n\npublic inline val CanvasTextAlign.Companion.LEFT: CanvasTextAlign get() = \"left\".asDynamic().unsafeCast()\n\npublic inline val CanvasTextAlign.Companion.RIGHT: CanvasTextAlign get() = \"right\".asDynamic().unsafeCast()\n\npublic inline val CanvasTextAlign.Companion.CENTER: CanvasTextAlign get() = \"center\".asDynamic().unsafeCast()\n\n/* please, don't implement this interface! */\n@JsName(\"null\")\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface CanvasTextBaseline {\n companion object\n}\n\npublic inline val CanvasTextBaseline.Companion.TOP: CanvasTextBaseline get() = \"top\".asDynamic().unsafeCast()\n\npublic inline val CanvasTextBaseline.Companion.HANGING: CanvasTextBaseline get() = \"hanging\".asDynamic().unsafeCast()\n\npublic inline val CanvasTextBaseline.Companion.MIDDLE: CanvasTextBaseline get() = \"middle\".asDynamic().unsafeCast()\n\npublic inline val CanvasTextBaseline.Companion.ALPHABETIC: CanvasTextBaseline get() = \"alphabetic\".asDynamic().unsafeCast()\n\npublic inline val CanvasTextBaseline.Companion.IDEOGRAPHIC: CanvasTextBaseline get() = \"ideographic\".asDynamic().unsafeCast()\n\npublic inline val CanvasTextBaseline.Companion.BOTTOM: CanvasTextBaseline get() = \"bottom\".asDynamic().unsafeCast()\n\n/* please, don't implement this interface! */\n@JsName(\"null\")\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface CanvasDirection {\n companion object\n}\n\npublic inline val CanvasDirection.Companion.LTR: CanvasDirection get() = \"ltr\".asDynamic().unsafeCast()\n\npublic inline val CanvasDirection.Companion.RTL: CanvasDirection get() = \"rtl\".asDynamic().unsafeCast()\n\npublic inline val CanvasDirection.Companion.INHERIT: CanvasDirection get() = \"inherit\".asDynamic().unsafeCast()\n\n/* please, don't implement this interface! */\n@JsName(\"null\")\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface ScrollRestoration {\n companion object\n}\n\npublic inline val ScrollRestoration.Companion.AUTO: ScrollRestoration get() = \"auto\".asDynamic().unsafeCast()\n\npublic inline val ScrollRestoration.Companion.MANUAL: ScrollRestoration get() = \"manual\".asDynamic().unsafeCast()\n\n/* please, don't implement this interface! */\n@JsName(\"null\")\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface ImageOrientation {\n companion object\n}\n\npublic inline val ImageOrientation.Companion.NONE: ImageOrientation get() = \"none\".asDynamic().unsafeCast()\n\npublic inline val ImageOrientation.Companion.FLIPY: ImageOrientation get() = \"flipY\".asDynamic().unsafeCast()\n\n/* please, don't implement this interface! */\n@JsName(\"null\")\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface PremultiplyAlpha {\n companion object\n}\n\npublic inline val PremultiplyAlpha.Companion.NONE: PremultiplyAlpha get() = \"none\".asDynamic().unsafeCast()\n\npublic inline val PremultiplyAlpha.Companion.PREMULTIPLY: PremultiplyAlpha get() = \"premultiply\".asDynamic().unsafeCast()\n\npublic inline val PremultiplyAlpha.Companion.DEFAULT: PremultiplyAlpha get() = \"default\".asDynamic().unsafeCast()\n\n/* please, don't implement this interface! */\n@JsName(\"null\")\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface ColorSpaceConversion {\n companion object\n}\n\npublic inline val ColorSpaceConversion.Companion.NONE: ColorSpaceConversion get() = \"none\".asDynamic().unsafeCast()\n\npublic inline val ColorSpaceConversion.Companion.DEFAULT: ColorSpaceConversion get() = \"default\".asDynamic().unsafeCast()\n\n/* please, don't implement this interface! */\n@JsName(\"null\")\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface ResizeQuality {\n companion object\n}\n\npublic inline val ResizeQuality.Companion.PIXELATED: ResizeQuality get() = \"pixelated\".asDynamic().unsafeCast()\n\npublic inline val ResizeQuality.Companion.LOW: ResizeQuality get() = \"low\".asDynamic().unsafeCast()\n\npublic inline val ResizeQuality.Companion.MEDIUM: ResizeQuality get() = \"medium\".asDynamic().unsafeCast()\n\npublic inline val ResizeQuality.Companion.HIGH: ResizeQuality get() = \"high\".asDynamic().unsafeCast()\n\n/* please, don't implement this interface! */\n@JsName(\"null\")\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface BinaryType {\n companion object\n}\n\npublic inline val BinaryType.Companion.BLOB: BinaryType get() = \"blob\".asDynamic().unsafeCast()\n\npublic inline val BinaryType.Companion.ARRAYBUFFER: BinaryType get() = \"arraybuffer\".asDynamic().unsafeCast()\n\n/* please, don't implement this interface! */\n@JsName(\"null\")\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface WorkerType {\n companion object\n}\n\npublic inline val WorkerType.Companion.CLASSIC: WorkerType get() = \"classic\".asDynamic().unsafeCast()\n\npublic inline val WorkerType.Companion.MODULE: WorkerType get() = \"module\".asDynamic().unsafeCast()\n\n/* please, don't implement this interface! */\n@JsName(\"null\")\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface ShadowRootMode {\n companion object\n}\n\npublic inline val ShadowRootMode.Companion.OPEN: ShadowRootMode get() = \"open\".asDynamic().unsafeCast()\n\npublic inline val ShadowRootMode.Companion.CLOSED: ShadowRootMode get() = \"closed\".asDynamic().unsafeCast()\n\n/* please, don't implement this interface! */\n@JsName(\"null\")\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface ScrollBehavior {\n companion object\n}\n\npublic inline val ScrollBehavior.Companion.AUTO: ScrollBehavior get() = \"auto\".asDynamic().unsafeCast()\n\npublic inline val ScrollBehavior.Companion.INSTANT: ScrollBehavior get() = \"instant\".asDynamic().unsafeCast()\n\npublic inline val ScrollBehavior.Companion.SMOOTH: ScrollBehavior get() = \"smooth\".asDynamic().unsafeCast()\n\n/* please, don't implement this interface! */\n@JsName(\"null\")\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface ScrollLogicalPosition {\n companion object\n}\n\npublic inline val ScrollLogicalPosition.Companion.START: ScrollLogicalPosition get() = \"start\".asDynamic().unsafeCast()\n\npublic inline val ScrollLogicalPosition.Companion.CENTER: ScrollLogicalPosition get() = \"center\".asDynamic().unsafeCast()\n\npublic inline val ScrollLogicalPosition.Companion.END: ScrollLogicalPosition get() = \"end\".asDynamic().unsafeCast()\n\npublic inline val ScrollLogicalPosition.Companion.NEAREST: ScrollLogicalPosition get() = \"nearest\".asDynamic().unsafeCast()\n\n/* please, don't implement this interface! */\n@JsName(\"null\")\n@Suppress(\"NESTED_CLASS_IN_EXTERNAL_INTERFACE\")\npublic external interface CSSBoxType {\n companion object\n}\n\npublic inline val CSSBoxType.Companion.MARGIN: CSSBoxType get() = \"margin\".asDynamic().unsafeCast()\n\npublic inline val CSSBoxType.Companion.BORDER: CSSBoxType get() = \"border\".asDynamic().unsafeCast()\n\npublic inline val CSSBoxType.Companion.PADDING: CSSBoxType get() = \"padding\".asDynamic().unsafeCast()\n\npublic inline val CSSBoxType.Companion.CONTENT: CSSBoxType get() = \"content\".asDynamic().unsafeCast()","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.utils\n\nimport io.ktor.utils.io.*\n\n/**\n * If the exception contains cause that differs from [CancellationException] returns it otherwise returns itself.\n */\npublic actual fun Throwable.unwrapCancellationException(): Throwable = this\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.plugins\n\nimport io.ktor.client.*\nimport io.ktor.client.call.*\nimport io.ktor.client.plugins.HttpCallValidator.*\nimport io.ktor.client.request.*\nimport io.ktor.client.statement.*\nimport io.ktor.client.utils.*\nimport io.ktor.http.*\nimport io.ktor.http.content.*\nimport io.ktor.util.*\nimport io.ktor.util.pipeline.*\n\n/**\n * Response validator method.\n *\n * You could throw an exception to fail the response.\n */\npublic typealias ResponseValidator = suspend (response: HttpResponse) -> Unit\n\n/**\n * Response exception handler method.\n */\npublic typealias CallExceptionHandler = suspend (cause: Throwable) -> Unit\n\n/**\n * Response exception handler method. [request] is null if\n */\npublic typealias CallRequestExceptionHandler = suspend (cause: Throwable, request: HttpRequest) -> Unit\n\n/**\n * Response validator plugin is used for validate response and handle response exceptions.\n *\n * See also [Config] for additional details.\n */\npublic class HttpCallValidator internal constructor(\n private val responseValidators: List,\n private val callExceptionHandlers: List,\n private val expectSuccess: Boolean\n) {\n\n private suspend fun validateResponse(response: HttpResponse) {\n responseValidators.forEach { it(response) }\n }\n\n private suspend fun processException(cause: Throwable, request: HttpRequest) {\n callExceptionHandlers.forEach {\n when (it) {\n is ExceptionHandlerWrapper -> it.handler(cause)\n is RequestExceptionHandlerWrapper -> it.handler(cause, request)\n }\n }\n }\n\n /**\n * [HttpCallValidator] configuration.\n */\n @KtorDsl\n public class Config {\n internal val responseValidators: MutableList = mutableListOf()\n internal val responseExceptionHandlers: MutableList = mutableListOf()\n\n /**\n * Terminate [HttpClient.receivePipeline] if status code is not successful (>=300).\n */\n\n @Deprecated(\n \"This property is ignored. Please use `expectSuccess` property in HttpClientConfig. \" +\n \"This is going to become internal.\"\n )\n public var expectSuccess: Boolean = true\n\n /**\n * Add [CallExceptionHandler].\n * Last added handler executes first.\n */\n @Deprecated(\n \"Consider using `handleResponseExceptionWithRequest` instead\",\n replaceWith = ReplaceWith(\"this.handleResponseExceptionWithRequest(block)\"),\n level = DeprecationLevel.WARNING\n )\n public fun handleResponseException(block: CallExceptionHandler) {\n responseExceptionHandlers += ExceptionHandlerWrapper(block)\n }\n\n /**\n * Add [CallRequestExceptionHandler].\n * Last added handler executes first.\n */\n public fun handleResponseExceptionWithRequest(block: CallRequestExceptionHandler) {\n responseExceptionHandlers += RequestExceptionHandlerWrapper(block)\n }\n\n /**\n * Add [ResponseValidator].\n * Last added validator executes first.\n */\n public fun validateResponse(block: ResponseValidator) {\n responseValidators += block\n }\n }\n\n public companion object : HttpClientPlugin {\n override val key: AttributeKey = AttributeKey(\"HttpResponseValidator\")\n\n override fun prepare(block: Config.() -> Unit): HttpCallValidator {\n val config = Config().apply(block)\n\n @Suppress(\"DEPRECATION\")\n return HttpCallValidator(\n config.responseValidators.reversed(),\n config.responseExceptionHandlers.reversed(),\n config.expectSuccess\n )\n }\n\n @OptIn(InternalAPI::class)\n override fun install(plugin: HttpCallValidator, scope: HttpClient) {\n scope.requestPipeline.intercept(HttpRequestPipeline.Before) {\n try {\n context.attributes.computeIfAbsent(ExpectSuccessAttributeKey) { plugin.expectSuccess }\n proceedWith(it)\n } catch (cause: Throwable) {\n val unwrappedCause = cause.unwrapCancellationException()\n plugin.processException(unwrappedCause, HttpRequest(context))\n throw unwrappedCause\n }\n }\n\n val BeforeReceive = PipelinePhase(\"BeforeReceive\")\n scope.responsePipeline.insertPhaseBefore(HttpResponsePipeline.Receive, BeforeReceive)\n scope.responsePipeline.intercept(BeforeReceive) { container ->\n try {\n proceedWith(container)\n } catch (cause: Throwable) {\n val unwrappedCause = cause.unwrapCancellationException()\n plugin.processException(unwrappedCause, context.request)\n throw unwrappedCause\n }\n }\n\n scope.plugin(HttpSend).intercept { request ->\n val call = execute(request)\n plugin.validateResponse(call.response)\n call\n }\n }\n }\n}\n\nprivate fun HttpRequest(builder: HttpRequestBuilder) = object : HttpRequest {\n override val call: HttpClientCall get() = error(\"Call is not initialized\")\n override val method: HttpMethod = builder.method\n override val url: Url = builder.url.build()\n override val attributes: Attributes = builder.attributes\n override val headers: Headers = builder.headers.build()\n override val content: OutgoingContent\n get() = builder.body as? OutgoingContent\n ?: error(\"Content was not transformed to OutgoingContent yet. Current body is ${builder.body}\")\n}\n\n/**\n * Install [HttpCallValidator] with [block] configuration.\n */\npublic fun HttpClientConfig<*>.HttpResponseValidator(block: HttpCallValidator.Config.() -> Unit) {\n install(HttpCallValidator, block)\n}\n\n/**\n * Terminate [HttpClient.receivePipeline] if status code is not successful (>=300).\n */\npublic var HttpRequestBuilder.expectSuccess: Boolean\n get() = attributes.getOrNull(ExpectSuccessAttributeKey) ?: true\n set(value) = attributes.put(ExpectSuccessAttributeKey, value)\n\ninternal val ExpectSuccessAttributeKey = AttributeKey(\"ExpectSuccessAttributeKey\")\n\ninternal sealed interface HandlerWrapper\n\ninternal class ExceptionHandlerWrapper(val handler: CallExceptionHandler) : HandlerWrapper\n\ninternal class RequestExceptionHandlerWrapper(val handler: CallRequestExceptionHandler) : HandlerWrapper\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.engine\n\nimport io.ktor.client.*\nimport io.ktor.client.call.*\nimport io.ktor.client.request.*\nimport io.ktor.client.utils.*\nimport io.ktor.http.*\nimport io.ktor.util.*\nimport io.ktor.util.pipeline.*\nimport io.ktor.utils.io.core.*\nimport kotlinx.coroutines.*\nimport kotlin.coroutines.*\n\ninternal val CALL_COROUTINE = CoroutineName(\"call-context\")\ninternal val CLIENT_CONFIG = AttributeKey>(\"client-config\")\n\n/**\n * Base interface use to define engines for [HttpClient].\n */\npublic interface HttpClientEngine : CoroutineScope, Closeable {\n /**\n * [CoroutineDispatcher] specified for io operations.\n */\n public val dispatcher: CoroutineDispatcher\n\n /**\n * Engine configuration\n */\n public val config: HttpClientEngineConfig\n\n /**\n * Set of supported engine extensions.\n */\n public val supportedCapabilities: Set>\n get() = emptySet()\n\n private val closed: Boolean\n get() = !(coroutineContext[Job]?.isActive ?: false)\n\n /**\n * Creates a new [HttpClientCall] specific for this engine, using a request [data].\n */\n @InternalAPI\n public suspend fun execute(data: HttpRequestData): HttpResponseData\n\n /**\n * Install engine into [HttpClient].\n */\n @InternalAPI\n public fun install(client: HttpClient) {\n client.sendPipeline.intercept(HttpSendPipeline.Engine) { content ->\n val builder = HttpRequestBuilder().apply {\n takeFromWithExecutionContext(context)\n setBody(content)\n }\n\n client.monitor.raise(HttpRequestIsReadyForSending, builder)\n\n val requestData = builder.build().apply {\n attributes.put(CLIENT_CONFIG, client.config)\n }\n\n validateHeaders(requestData)\n checkExtensions(requestData)\n\n val responseData = executeWithinCallContext(requestData)\n val call = HttpClientCall(client, requestData, responseData)\n\n val response = call.response\n client.monitor.raise(HttpResponseReceived, response)\n\n response.coroutineContext.job.invokeOnCompletion {\n if (it != null) {\n client.monitor.raise(HttpResponseCancelled, response)\n }\n }\n\n proceedWith(call)\n }\n }\n\n /**\n * Create call context and use it as a coroutine context to [execute] request.\n */\n @OptIn(InternalAPI::class)\n private suspend fun executeWithinCallContext(requestData: HttpRequestData): HttpResponseData {\n val callContext = createCallContext(requestData.executionContext)\n\n val context = callContext + KtorCallContextElement(callContext)\n return async(context) {\n if (closed) {\n throw ClientEngineClosedException()\n }\n\n execute(requestData)\n }.await()\n }\n\n private fun checkExtensions(requestData: HttpRequestData) {\n for (requestedExtension in requestData.requiredCapabilities) {\n require(supportedCapabilities.contains(requestedExtension)) { \"Engine doesn't support $requestedExtension\" }\n }\n }\n}\n\n/**\n * Factory of [HttpClientEngine] with a specific [T] of [HttpClientEngineConfig].\n */\npublic interface HttpClientEngineFactory {\n /**\n * Creates a new [HttpClientEngine] optionally specifying a [block] configuring [T].\n */\n public fun create(block: T.() -> Unit = {}): HttpClientEngine\n}\n\n/**\n * Creates a new [HttpClientEngineFactory] based on this one\n * with further configurations from the [nested] block.\n */\npublic fun HttpClientEngineFactory.config(\n nested: T.() -> Unit\n): HttpClientEngineFactory {\n val parent = this\n\n return object : HttpClientEngineFactory {\n override fun create(block: T.() -> Unit): HttpClientEngine = parent.create {\n nested()\n block()\n }\n }\n}\n\n/**\n * Create call context with the specified [parentJob] to be used during call execution in the engine. Call context\n * inherits [coroutineContext], but overrides job and coroutine name so that call job's parent is [parentJob] and\n * call coroutine's name is \"call-context\".\n */\ninternal suspend fun HttpClientEngine.createCallContext(parentJob: Job): CoroutineContext {\n val callJob = Job(parentJob)\n val callContext = coroutineContext + callJob + CALL_COROUTINE\n\n attachToUserJob(callJob)\n\n return callContext\n}\n\n/**\n * Validates request headers and fails if there are unsafe headers supplied\n */\nprivate fun validateHeaders(request: HttpRequestData) {\n val requestHeaders = request.headers\n val unsafeRequestHeaders = requestHeaders.names().filter {\n it in HttpHeaders.UnsafeHeadersList\n }\n if (unsafeRequestHeaders.isNotEmpty()) {\n throw UnsafeHeaderException(unsafeRequestHeaders.toString())\n }\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.engine\n\nimport io.ktor.client.plugins.*\nimport io.ktor.util.*\nimport kotlin.native.concurrent.*\n\n/**\n * Key required to access capabilities.\n */\ninternal val ENGINE_CAPABILITIES_KEY =\n AttributeKey, Any>>(\"EngineCapabilities\")\n\n/**\n * Default capabilities expected to be supported by engine.\n */\npublic val DEFAULT_CAPABILITIES: Set = setOf(HttpTimeout)\n\n/**\n * Capability required by request to be supported by [HttpClientEngine] with [T] representing type of the capability\n * configuration.\n */\npublic interface HttpClientEngineCapability\n","/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.client.plugins\n\nimport io.ktor.client.*\nimport io.ktor.client.content.*\nimport io.ktor.client.plugins.observer.*\nimport io.ktor.client.request.*\nimport io.ktor.client.statement.*\nimport io.ktor.client.utils.*\nimport io.ktor.http.*\nimport io.ktor.http.content.*\nimport io.ktor.util.*\nimport io.ktor.util.pipeline.*\nimport kotlin.native.concurrent.*\n\nprivate val UploadProgressListenerAttributeKey =\n AttributeKey(\"UploadProgressListenerAttributeKey\")\n\nprivate val DownloadProgressListenerAttributeKey =\n AttributeKey(\"DownloadProgressListenerAttributeKey\")\n\n/**\n * Plugin that provides observable progress for uploads and downloads\n */\npublic class BodyProgress internal constructor() {\n\n private fun handle(scope: HttpClient) {\n val observableContentPhase = PipelinePhase(\"ObservableContent\")\n scope.requestPipeline.insertPhaseAfter(reference = HttpRequestPipeline.Render, phase = observableContentPhase)\n scope.requestPipeline.intercept(observableContentPhase) { content ->\n val listener = context.attributes\n .getOrNull(UploadProgressListenerAttributeKey) ?: return@intercept\n\n val observableContent = ObservableContent(content as OutgoingContent, context.executionContext, listener)\n proceedWith(observableContent)\n }\n\n scope.receivePipeline.intercept(HttpReceivePipeline.After) { response ->\n val listener = response.call.request.attributes\n .getOrNull(DownloadProgressListenerAttributeKey) ?: return@intercept\n val observableResponse = response.withObservableDownload(listener)\n proceedWith(observableResponse)\n }\n }\n\n public companion object Plugin : HttpClientPlugin {\n override val key: AttributeKey = AttributeKey(\"BodyProgress\")\n\n override fun prepare(block: Unit.() -> Unit): BodyProgress {\n return BodyProgress()\n }\n\n override fun install(plugin: BodyProgress, scope: HttpClient) {\n plugin.handle(scope)\n }\n }\n}\n\n@OptIn(InternalAPI::class)\ninternal fun HttpResponse.withObservableDownload(listener: ProgressListener): HttpResponse {\n val observableByteChannel = content.observable(coroutineContext, contentLength(), listener)\n return wrapWithContent(observableByteChannel)\n}\n\n/**\n * Registers listener to observe download progress.\n */\npublic fun HttpRequestBuilder.onDownload(listener: ProgressListener?) {\n if (listener == null) {\n attributes.remove(DownloadProgressListenerAttributeKey)\n } else {\n attributes.put(DownloadProgressListenerAttributeKey, listener)\n }\n}\n\n/**\n * Registers listener to observe upload progress.\n */\npublic fun HttpRequestBuilder.onUpload(listener: ProgressListener?) {\n if (listener == null) {\n attributes.remove(UploadProgressListenerAttributeKey)\n } else {\n attributes.put(UploadProgressListenerAttributeKey, listener)\n }\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.plugins\n\nimport io.ktor.client.*\nimport io.ktor.client.call.*\nimport io.ktor.client.statement.*\nimport io.ktor.util.*\nimport io.ktor.utils.io.charsets.*\nimport io.ktor.utils.io.concurrent.*\nimport kotlin.jvm.*\nimport kotlin.native.concurrent.*\n\nprivate val ValidateMark = AttributeKey(\"ValidateMark\")\n\n/**\n * Default response validation.\n * Check the response status code in range (0..299).\n */\npublic fun HttpClientConfig<*>.addDefaultResponseValidation() {\n HttpResponseValidator {\n @Suppress(\"DEPRECATION\")\n expectSuccess = this@addDefaultResponseValidation.expectSuccess\n\n validateResponse { response ->\n val expectSuccess = response.call.attributes[ExpectSuccessAttributeKey]\n if (!expectSuccess) {\n return@validateResponse\n }\n\n val statusCode = response.status.value\n val originCall = response.call\n if (statusCode < 300 || originCall.attributes.contains(ValidateMark)) {\n return@validateResponse\n }\n\n val exceptionCall = originCall.save().apply {\n attributes.put(ValidateMark, Unit)\n }\n\n val exceptionResponse = exceptionCall.response\n val exceptionResponseText = try {\n exceptionResponse.bodyAsText()\n } catch (_: MalformedInputException) {\n BODY_FAILED_DECODING\n }\n when (statusCode) {\n in 300..399 -> throw RedirectResponseException(exceptionResponse, exceptionResponseText)\n in 400..499 -> throw ClientRequestException(exceptionResponse, exceptionResponseText)\n in 500..599 -> throw ServerResponseException(exceptionResponse, exceptionResponseText)\n else -> throw ResponseException(exceptionResponse, exceptionResponseText)\n }\n }\n }\n}\n\nprivate const val NO_RESPONSE_TEXT: String = \"\"\nprivate const val BODY_FAILED_DECODING: String = \"\"\nprivate const val DEPRECATED_EXCEPTION_CTOR: String = \"Please, provide response text in constructor\"\n\n/**\n * Base for default response exceptions.\n * @param [response]: origin response\n */\npublic open class ResponseException(\n response: HttpResponse,\n cachedResponseText: String\n) : IllegalStateException(\"Bad response: $response. Text: \\\"$cachedResponseText\\\"\") {\n @Deprecated(level = DeprecationLevel.ERROR, message = DEPRECATED_EXCEPTION_CTOR)\n public constructor(response: HttpResponse) : this(response, NO_RESPONSE_TEXT)\n\n @Transient\n public val response: HttpResponse = response\n}\n\n/**\n * Unhandled redirect exception.\n */\n@Suppress(\"KDocMissingDocumentation\")\npublic class RedirectResponseException(response: HttpResponse, cachedResponseText: String) :\n ResponseException(response, cachedResponseText) {\n @Deprecated(level = DeprecationLevel.ERROR, message = DEPRECATED_EXCEPTION_CTOR)\n public constructor(response: HttpResponse) : this(response, NO_RESPONSE_TEXT)\n\n override val message: String =\n \"Unhandled redirect: ${response.call.request.method.value} ${response.call.request.url}. \" +\n \"Status: ${response.status}. Text: \\\"$cachedResponseText\\\"\"\n}\n\n/**\n * Server error exception.\n */\n@Suppress(\"KDocMissingDocumentation\")\npublic class ServerResponseException(\n response: HttpResponse,\n cachedResponseText: String\n) : ResponseException(response, cachedResponseText) {\n @Deprecated(level = DeprecationLevel.ERROR, message = DEPRECATED_EXCEPTION_CTOR)\n public constructor(response: HttpResponse) : this(response, NO_RESPONSE_TEXT)\n\n override val message: String = \"Server error(${response.call.request.method.value} ${response.call.request.url}: \" +\n \"${response.status}. Text: \\\"$cachedResponseText\\\"\"\n}\n\n/**\n * Bad client request exception.\n */\n@Suppress(\"KDocMissingDocumentation\")\npublic class ClientRequestException(\n response: HttpResponse,\n cachedResponseText: String\n) : ResponseException(response, cachedResponseText) {\n @Deprecated(level = DeprecationLevel.ERROR, message = DEPRECATED_EXCEPTION_CTOR)\n public constructor(response: HttpResponse) : this(response, NO_RESPONSE_TEXT)\n\n override val message: String =\n \"Client request(${response.call.request.method.value} ${response.call.request.url}) \" +\n \"invalid: ${response.status}. Text: \\\"$cachedResponseText\\\"\"\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.client.plugins\n\nimport io.ktor.client.*\nimport io.ktor.client.call.*\nimport io.ktor.client.request.*\nimport io.ktor.client.statement.*\nimport io.ktor.events.*\nimport io.ktor.http.*\nimport io.ktor.util.*\nimport kotlin.native.concurrent.*\n\nprivate val ALLOWED_FOR_REDIRECT: Set = setOf(HttpMethod.Get, HttpMethod.Head)\n\n/**\n * An [HttpClient] plugin that handles HTTP redirects\n */\npublic class HttpRedirect private constructor(\n private val checkHttpMethod: Boolean,\n private val allowHttpsDowngrade: Boolean\n) {\n\n @KtorDsl\n public class Config {\n\n /**\n * Checks whether the HTTP method is allowed for the redirect.\n * Only [HttpMethod.Get] and [HttpMethod.Head] are allowed for implicit redirection.\n *\n * Please note: changing this flag could lead to security issues, consider changing the request URL instead.\n */\n public var checkHttpMethod: Boolean = true\n\n /**\n * `true` allows a client to make a redirect with downgrading from HTTPS to plain HTTP.\n */\n public var allowHttpsDowngrade: Boolean = false\n }\n\n public companion object Plugin : HttpClientPlugin {\n override val key: AttributeKey = AttributeKey(\"HttpRedirect\")\n\n /**\n * Occurs when receiving a response with a redirect message.\n */\n public val HttpResponseRedirect: EventDefinition = EventDefinition()\n\n override fun prepare(block: Config.() -> Unit): HttpRedirect {\n val config = Config().apply(block)\n return HttpRedirect(\n checkHttpMethod = config.checkHttpMethod,\n allowHttpsDowngrade = config.allowHttpsDowngrade\n )\n }\n\n override fun install(plugin: HttpRedirect, scope: HttpClient) {\n scope.plugin(HttpSend).intercept { context ->\n val origin = execute(context)\n if (plugin.checkHttpMethod && origin.request.method !in ALLOWED_FOR_REDIRECT) {\n return@intercept origin\n }\n\n handleCall(context, origin, plugin.allowHttpsDowngrade, scope)\n }\n }\n\n @OptIn(InternalAPI::class)\n private suspend fun Sender.handleCall(\n context: HttpRequestBuilder,\n origin: HttpClientCall,\n allowHttpsDowngrade: Boolean,\n client: HttpClient\n ): HttpClientCall {\n if (!origin.response.status.isRedirect()) return origin\n\n var call = origin\n var requestBuilder = context\n val originProtocol = origin.request.url.protocol\n val originAuthority = origin.request.url.authority\n\n while (true) {\n client.monitor.raise(HttpResponseRedirect, call.response)\n\n val location = call.response.headers[HttpHeaders.Location]\n\n requestBuilder = HttpRequestBuilder().apply {\n takeFromWithExecutionContext(requestBuilder)\n url.parameters.clear()\n\n location?.let { url.takeFrom(it) }\n\n /**\n * Disallow redirect with a security downgrade.\n */\n if (!allowHttpsDowngrade && originProtocol.isSecure() && !url.protocol.isSecure()) {\n return call\n }\n\n if (originAuthority != url.authority) {\n headers.remove(HttpHeaders.Authorization)\n }\n }\n\n call = execute(requestBuilder)\n if (!call.response.status.isRedirect()) return call\n }\n }\n }\n}\n\nprivate fun HttpStatusCode.isRedirect(): Boolean = when (value) {\n HttpStatusCode.MovedPermanently.value,\n HttpStatusCode.Found.value,\n HttpStatusCode.TemporaryRedirect.value,\n HttpStatusCode.PermanentRedirect.value,\n HttpStatusCode.SeeOther.value -> true\n else -> false\n}\n","/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.client.utils\n\nimport io.ktor.client.request.*\nimport io.ktor.client.statement.*\nimport io.ktor.events.*\nimport kotlin.native.concurrent.*\n\n/**\n * Occurs after the creation of a new request\n */\npublic val HttpRequestCreated: EventDefinition = EventDefinition()\n\n/**\n * Occurs before sending the request, and after execution of all interceptors.\n */\npublic val HttpRequestIsReadyForSending: EventDefinition = EventDefinition()\n\n/**\n * Occurs after responses headers have been received.\n */\npublic val HttpResponseReceived: EventDefinition = EventDefinition()\n\n/**\n * Utility class containing response and fail reasons for an [HttpResponseReceiveFailed] event.\n */\npublic class HttpResponseReceiveFail(public val response: HttpResponse, public val cause: Throwable)\n\n/**\n * Occurs when an exception is thrown during receiving of body.\n */\npublic val HttpResponseReceiveFailed: EventDefinition = EventDefinition()\n\n/**\n * Occurs when the response is cancelled due to an exception.\n */\npublic val HttpResponseCancelled: EventDefinition = EventDefinition()\n","/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.events\n\nimport io.ktor.util.*\nimport io.ktor.util.collections.*\nimport kotlinx.coroutines.*\nimport kotlinx.coroutines.internal.*\n\n@OptIn(InternalAPI::class)\npublic class Events {\n @OptIn(InternalCoroutinesApi::class)\n private val handlers = CopyOnWriteHashMap, LockFreeLinkedListHead>()\n\n /**\n * Subscribe [handler] to an event specified by [definition]\n */\n public fun subscribe(definition: EventDefinition, handler: EventHandler): DisposableHandle {\n val registration = HandlerRegistration(handler)\n @OptIn(InternalCoroutinesApi::class)\n handlers.computeIfAbsent(definition) { LockFreeLinkedListHead() }.addLast(registration)\n return registration\n }\n\n /**\n * Unsubscribe [handler] from an event specified by [definition]\n */\n public fun unsubscribe(definition: EventDefinition, handler: EventHandler) {\n @OptIn(InternalCoroutinesApi::class)\n handlers[definition]?.forEach {\n if (it.handler == handler) it.remove()\n }\n }\n\n /**\n * Raises the event specified by [definition] with the [value] and calls all handlers.\n *\n * Handlers are called in order of subscriptions.\n * If some handler throws an exception, all remaining handlers will still run. The exception will eventually be re-thrown.\n */\n public fun raise(definition: EventDefinition, value: T) {\n var exception: Throwable? = null\n handlers[definition]?.forEach { registration ->\n try {\n @Suppress(\"UNCHECKED_CAST\")\n (registration.handler as EventHandler)(value)\n } catch (e: Throwable) {\n exception?.addSuppressed(e) ?: run { exception = e }\n }\n }\n exception?.let { throw it }\n }\n\n @OptIn(InternalCoroutinesApi::class)\n private class HandlerRegistration(val handler: EventHandler<*>) : LockFreeLinkedListNode(), DisposableHandle {\n override fun dispose() {\n remove()\n }\n }\n}\n\n/**\n * Specifies signature for the event handler\n */\npublic typealias EventHandler = (T) -> Unit\n\n// TODO: make two things: definition that is kept private to subsystem, and declaration which is public.\n// Invoke only by definition, subscribe by declaration\n\n/**\n * Definition of an event.\n * Event is used as a key so both [hashCode] and [equals] need to be implemented properly.\n * Inheriting of this class is an experimental feature.\n * Instantiate directly if inheritance not necessary.\n *\n * @param T specifies what is a type of a value passed to the event\n */\npublic open class EventDefinition\n","/*\n * Copyright 2014-2022 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.websocket\n\nimport io.ktor.util.*\nimport io.ktor.util.cio.*\nimport io.ktor.utils.io.core.*\nimport kotlinx.atomicfu.*\nimport kotlinx.coroutines.*\nimport kotlinx.coroutines.channels.*\nimport kotlin.coroutines.*\n\n/**\n * Default websocket session with ping-pong and timeout processing and built-in [closeReason] population\n */\npublic interface DefaultWebSocketSession : WebSocketSession {\n\n /**\n * Ping interval or `-1L` to disable pinger. Please note that pongs will be handled despite this setting.\n */\n public var pingIntervalMillis: Long\n\n /**\n * A timeout to wait for pong reply to ping otherwise the session will be terminated immediately.\n * It doesn't have any effect if [pingIntervalMillis] is `-1` (pinger is disabled).\n */\n public var timeoutMillis: Long\n\n /**\n * A close reason for this session. It could be `null` if a session is terminated with no close reason\n * (for example due to connection failure).\n */\n public val closeReason: Deferred\n\n /**\n * Start WebSocket conversation.\n *\n * @param negotiatedExtensions specify negotiated extensions list to use in current session.\n */\n @InternalAPI\n public fun start(negotiatedExtensions: List> = emptyList())\n}\n\n/**\n * Create [DefaultWebSocketSession] from session.\n */\npublic fun DefaultWebSocketSession(\n session: WebSocketSession,\n pingInterval: Long = -1L,\n timeoutMillis: Long = 15000L\n): DefaultWebSocketSession {\n require(session !is DefaultWebSocketSession) { \"Cannot wrap other DefaultWebSocketSession\" }\n return DefaultWebSocketSessionImpl(session, pingInterval, timeoutMillis)\n}\n\nprivate val IncomingProcessorCoroutineName = CoroutineName(\"ws-incoming-processor\")\nprivate val OutgoingProcessorCoroutineName = CoroutineName(\"ws-outgoing-processor\")\n\nprivate val NORMAL_CLOSE = CloseReason(CloseReason.Codes.NORMAL, \"OK\")\n\n/**\n * Default web socket session implementation that handles ping-pongs, close sequence and frame fragmentation\n */\ninternal class DefaultWebSocketSessionImpl(\n private val raw: WebSocketSession,\n pingInterval: Long,\n timeoutMillis: Long,\n) : DefaultWebSocketSession, WebSocketSession {\n private val pinger = atomic?>(null)\n private val closeReasonRef = CompletableDeferred()\n private val filtered = Channel(8)\n private val outgoingToBeProcessed = Channel(8)\n private val closed: AtomicBoolean = atomic(false)\n private val context = Job(raw.coroutineContext[Job])\n\n private val _extensions: MutableList> = mutableListOf()\n private val started = atomic(false)\n\n override val incoming: ReceiveChannel get() = filtered\n\n override val outgoing: SendChannel get() = outgoingToBeProcessed\n\n override val extensions: List>\n get() = _extensions\n\n override val coroutineContext: CoroutineContext = raw.coroutineContext + context + CoroutineName(\"ws-default\")\n\n override var masking: Boolean\n get() = raw.masking\n set(value) {\n raw.masking = value\n }\n\n override var maxFrameSize: Long\n get() = raw.maxFrameSize\n set(value) {\n raw.maxFrameSize = value\n }\n\n override var pingIntervalMillis: Long = pingInterval\n set(newValue) {\n field = newValue\n runOrCancelPinger()\n }\n\n override var timeoutMillis: Long = timeoutMillis\n set(newValue) {\n field = newValue\n runOrCancelPinger()\n }\n\n override val closeReason: Deferred = closeReasonRef\n\n @OptIn(InternalAPI::class)\n override fun start(negotiatedExtensions: List>) {\n if (!started.compareAndSet(false, true)) {\n error(\"WebSocket session is already started.\")\n }\n\n _extensions.addAll(negotiatedExtensions)\n runOrCancelPinger()\n runIncomingProcessor(ponger(outgoing))\n runOutgoingProcessor()\n }\n\n /**\n * Close session with GOING_AWAY reason\n */\n public suspend fun goingAway(message: String = \"Server is going down\") {\n sendCloseSequence(CloseReason(CloseReason.Codes.GOING_AWAY, message))\n }\n\n override suspend fun flush() {\n raw.flush()\n }\n\n @Deprecated(\n \"Use cancel() instead.\",\n ReplaceWith(\"cancel()\", \"kotlinx.coroutines.cancel\"),\n level = DeprecationLevel.ERROR\n )\n override fun terminate() {\n context.cancel()\n raw.cancel()\n }\n\n @OptIn(InternalAPI::class)\n private fun runIncomingProcessor(ponger: SendChannel): Job = launch(\n IncomingProcessorCoroutineName + Dispatchers.Unconfined\n ) {\n var last: BytePacketBuilder? = null\n var closeFramePresented = false\n try {\n @OptIn(ExperimentalCoroutinesApi::class)\n raw.incoming.consumeEach { frame ->\n when (frame) {\n is Frame.Close -> {\n if (!outgoing.isClosedForSend) {\n outgoing.send(Frame.Close(frame.readReason() ?: NORMAL_CLOSE))\n }\n closeFramePresented = true\n return@launch\n }\n is Frame.Pong -> pinger.value?.send(frame)\n is Frame.Ping -> ponger.send(frame)\n else -> {\n checkMaxFrameSize(last, frame)\n\n if (!frame.fin) {\n if (last == null) {\n last = BytePacketBuilder()\n }\n\n last!!.writeFully(frame.data)\n return@consumeEach\n }\n\n val frameToSend = last?.let { builder ->\n builder.writeFully(frame.data)\n Frame.byType(\n fin = true,\n frame.frameType,\n builder.build().readBytes(),\n frame.rsv1,\n frame.rsv2,\n frame.rsv3\n )\n } ?: frame\n\n last = null\n filtered.send(processIncomingExtensions(frameToSend))\n }\n }\n }\n } catch (ignore: ClosedSendChannelException) {\n } catch (cause: Throwable) {\n ponger.close()\n filtered.close(cause)\n } finally {\n ponger.close()\n last?.release()\n filtered.close()\n\n if (!closeFramePresented) {\n @Suppress(\"DEPRECATION\")\n close(CloseReason(CloseReason.Codes.CLOSED_ABNORMALLY, \"Connection was closed without close frame\"))\n }\n }\n }\n\n @OptIn(ExperimentalCoroutinesApi::class)\n private fun runOutgoingProcessor(): Job = launch(\n OutgoingProcessorCoroutineName + Dispatchers.Unconfined,\n start = CoroutineStart.UNDISPATCHED\n ) {\n try {\n outgoingProcessorLoop()\n } catch (ignore: ClosedSendChannelException) {\n } catch (ignore: ClosedReceiveChannelException) {\n } catch (ignore: CancellationException) {\n } catch (ignore: ChannelIOException) {\n } catch (cause: Throwable) {\n outgoingToBeProcessed.cancel(CancellationException(\"Failed to send frame\", cause))\n raw.closeExceptionally(cause)\n } finally {\n outgoingToBeProcessed.cancel()\n raw.close()\n }\n }\n\n private suspend fun outgoingProcessorLoop() {\n for (frame in outgoingToBeProcessed) {\n val processedFrame: Frame = when (frame) {\n is Frame.Close -> {\n sendCloseSequence(frame.readReason())\n break\n }\n is Frame.Text,\n is Frame.Binary -> processOutgoingExtensions(frame)\n else -> frame\n }\n\n raw.outgoing.send(processedFrame)\n }\n }\n\n @OptIn(InternalAPI::class)\n private suspend fun sendCloseSequence(reason: CloseReason?) {\n if (!tryClose()) return\n context.complete()\n\n val reasonToSend = reason ?: CloseReason(CloseReason.Codes.NORMAL, \"\")\n try {\n runOrCancelPinger()\n @Suppress(\"DEPRECATION\")\n if (reasonToSend.code != CloseReason.Codes.CLOSED_ABNORMALLY.code) {\n raw.outgoing.send(Frame.Close(reasonToSend))\n }\n } finally {\n closeReasonRef.complete(reasonToSend)\n }\n }\n\n private fun tryClose(): Boolean = closed.compareAndSet(false, true)\n\n private fun runOrCancelPinger() {\n val interval = pingIntervalMillis\n\n val newPinger: SendChannel? = when {\n closed.value -> null\n interval > 0L -> pinger(raw.outgoing, interval, timeoutMillis)\n else -> null\n }\n\n // pinger is always lazy so we publish it first and then start it by sending EmptyPong\n // otherwise it may send ping before it get published so corresponding pong will not be dispatched to pinger\n // that will cause it to terminate connection on timeout\n pinger.getAndSet(newPinger)?.close()\n\n // it is safe here to send dummy pong because pinger will ignore it\n newPinger?.trySend(EmptyPong)?.isSuccess\n\n if (closed.value && newPinger != null) {\n runOrCancelPinger()\n }\n }\n\n private suspend fun checkMaxFrameSize(\n packet: BytePacketBuilder?,\n frame: Frame\n ) {\n val size = frame.data.size + (packet?.size ?: 0)\n if (size > maxFrameSize) {\n packet?.release()\n close(CloseReason(CloseReason.Codes.TOO_BIG, \"Frame is too big: $size. Max size is $maxFrameSize\"))\n throw FrameTooBigException(size.toLong())\n }\n }\n\n private fun processIncomingExtensions(frame: Frame): Frame =\n extensions.fold(frame) { current, extension -> extension.processIncomingFrame(current) }\n\n private fun processOutgoingExtensions(frame: Frame): Frame =\n extensions.fold(frame) { current, extension -> extension.processOutgoingFrame(current) }\n\n companion object {\n private val EmptyPong = Frame.Pong(ByteArray(0), NonDisposableHandle)\n }\n}\n","/*\n * Copyright 2014-2022 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.websocket\n\nimport io.ktor.util.*\nimport io.ktor.util.cio.*\nimport io.ktor.utils.io.*\nimport io.ktor.utils.io.bits.*\nimport io.ktor.utils.io.core.*\nimport kotlinx.coroutines.*\nimport kotlinx.coroutines.CancellationException\nimport kotlinx.coroutines.channels.*\nimport kotlin.coroutines.*\nimport kotlin.random.*\n\n/**\n * Creates a RAW web socket session from connection\n *\n * @param input is a [ByteReadChannel] of connection\n * @param output is a [ByteWriteChannel] of connection\n * @param maxFrameSize is an initial [maxFrameSize] value for [WebSocketSession]\n * @param masking is an initial [masking] value for [WebSocketSession]\n * @param coroutineContext is a [CoroutineContext] to execute reading/writing from/to connection\n */\n@Suppress(\"FunctionName\")\npublic expect fun RawWebSocket(\n input: ByteReadChannel,\n output: ByteWriteChannel,\n maxFrameSize: Long = Int.MAX_VALUE.toLong(),\n masking: Boolean = false,\n coroutineContext: CoroutineContext\n): WebSocketSession\n\n@OptIn(ExperimentalCoroutinesApi::class, InternalAPI::class)\ninternal class RawWebSocketCommon(\n private val input: ByteReadChannel,\n private val output: ByteWriteChannel,\n override var maxFrameSize: Long = Int.MAX_VALUE.toLong(),\n override var masking: Boolean = false,\n coroutineContext: CoroutineContext\n) : WebSocketSession {\n private val socketJob: CompletableJob = Job(coroutineContext[Job])\n\n private val _incoming = Channel(capacity = 8)\n private val _outgoing = Channel(capacity = 8)\n\n private var lastOpcode = 0\n\n override val coroutineContext: CoroutineContext = coroutineContext + socketJob + CoroutineName(\"raw-ws\")\n override val incoming: ReceiveChannel get() = _incoming\n override val outgoing: SendChannel get() = _outgoing\n override val extensions: List> get() = emptyList()\n\n private val writerJob = launch(context = CoroutineName(\"ws-writer\"), start = CoroutineStart.ATOMIC) {\n try {\n mainLoop@ while (true) when (val message = _outgoing.receive()) {\n is Frame -> {\n output.writeFrame(message, masking)\n output.flush()\n if (message is Frame.Close) break@mainLoop\n }\n is FlushRequest -> {\n message.complete()\n }\n else -> throw IllegalArgumentException(\"unknown message $message\")\n }\n _outgoing.close()\n } catch (cause: ChannelWriteException) {\n _outgoing.close(CancellationException(\"Failed to write to WebSocket.\", cause))\n } catch (t: Throwable) {\n _outgoing.close(t)\n } finally {\n _outgoing.close(CancellationException(\"WebSocket closed.\", null))\n output.close()\n }\n\n while (true) when (val message = _outgoing.tryReceive().getOrNull() ?: break) {\n is FlushRequest -> message.complete()\n else -> {}\n }\n }\n\n private val readerJob = launch(CoroutineName(\"ws-reader\"), start = CoroutineStart.ATOMIC) {\n try {\n while (true) {\n val frame = input.readFrame(maxFrameSize, lastOpcode)\n if (!frame.frameType.controlFrame) {\n lastOpcode = frame.frameType.opcode\n }\n _incoming.send(frame)\n }\n } catch (cause: FrameTooBigException) {\n outgoing.send(Frame.Close(CloseReason(CloseReason.Codes.TOO_BIG, cause.message)))\n _incoming.close(cause)\n } catch (cause: CancellationException) {\n _incoming.cancel(cause)\n } catch (eof: EOFException) {\n // no more bytes is possible to read\n } catch (eof: ClosedReceiveChannelException) {\n // no more bytes is possible to read\n } catch (io: ChannelIOException) {\n _incoming.cancel()\n } catch (cause: Throwable) {\n _incoming.close(cause)\n throw cause\n } finally {\n _incoming.close()\n }\n }\n\n init {\n socketJob.complete()\n }\n\n override suspend fun flush(): Unit = FlushRequest(coroutineContext[Job]).also {\n try {\n _outgoing.send(it)\n } catch (closed: ClosedSendChannelException) {\n it.complete()\n writerJob.join()\n } catch (sendFailure: Throwable) {\n it.complete()\n throw sendFailure\n }\n }.await()\n\n @Deprecated(\n \"Use cancel() instead.\",\n ReplaceWith(\"cancel()\", \"kotlinx.coroutines.cancel\"),\n level = DeprecationLevel.ERROR\n )\n override fun terminate() {\n outgoing.close()\n socketJob.complete()\n }\n\n private class FlushRequest(parent: Job?) {\n private val done: CompletableJob = Job(parent)\n fun complete(): Boolean = done.complete()\n suspend fun await(): Unit = done.join()\n }\n}\n\nprivate fun ByteReadPacket.mask(maskKey: Int): ByteReadPacket = withMemory(4) { maskMemory ->\n maskMemory.storeIntAt(0, maskKey)\n buildPacket {\n repeat(remaining.toInt()) { i ->\n writeByte((readByte().toInt() xor (maskMemory[i % 4].toInt())).toByte())\n }\n }\n}\n\n/**\n * Serializes WebSocket [Frame] and writes the bits into the [ByteWriteChannel].\n * If [masking] is true, then data will be masked with random mask\n */\n@InternalAPI // used in tests\npublic suspend fun ByteWriteChannel.writeFrame(frame: Frame, masking: Boolean) {\n val length = frame.data.size\n\n val flagsAndOpcode = frame.fin.flagAt(7) or\n frame.rsv1.flagAt(6) or\n frame.rsv2.flagAt(5) or\n frame.rsv3.flagAt(4) or\n frame.frameType.opcode\n\n writeByte(flagsAndOpcode.toByte())\n\n val formattedLength = when {\n length < 126 -> length\n length <= 0xffff -> 126\n else -> 127\n }\n\n val maskAndLength = masking.flagAt(7) or formattedLength\n\n writeByte(maskAndLength.toByte())\n\n when (formattedLength) {\n 126 -> writeShort(length.toShort())\n 127 -> writeLong(length.toLong())\n }\n\n val data = ByteReadPacket(frame.data)\n\n val maskedData = when (masking) {\n true -> {\n val maskKey = Random.nextInt()\n writeInt(maskKey)\n data.mask(maskKey)\n }\n false -> data\n }\n writePacket(maskedData)\n}\n\n/**\n * Reads bits from [ByteReadChannel] and converts into Websocket [Frame].\n *\n * @param maxFrameSize maximum frame size that could be read\n * @param lastOpcode last read opcode\n */\n@InternalAPI // used in tests\npublic suspend fun ByteReadChannel.readFrame(maxFrameSize: Long, lastOpcode: Int): Frame {\n val flagsAndOpcode = readByte().toInt()\n val maskAndLength = readByte().toInt()\n\n val length = when (val length = maskAndLength and 0x7f) {\n 126 -> readShort().toLong() and 0xffff\n 127 -> readLong()\n else -> length.toLong()\n }\n\n val maskKey = when (maskAndLength and 0x80 != 0) {\n true -> readInt()\n false -> -1\n }\n\n if (length > Int.MAX_VALUE || length > maxFrameSize) {\n throw FrameTooBigException(length)\n }\n\n val data = readPacket(length.toInt())\n val maskedData = when (maskKey) {\n -1 -> data\n else -> data.mask(maskKey)\n }\n\n val opcode = (flagsAndOpcode and 0x0f).let { new -> if (new == 0) lastOpcode else new }\n val frameType = FrameType[opcode] ?: throw IllegalStateException(\"Unsupported opcode: $opcode\")\n return Frame.byType(\n fin = flagsAndOpcode and 0x80 != 0,\n frameType = frameType,\n data = maskedData.readBytes(),\n rsv1 = flagsAndOpcode and 0x40 != 0,\n rsv2 = flagsAndOpcode and 0x20 != 0,\n rsv3 = flagsAndOpcode and 0x10 != 0\n )\n}\n","package io.ktor.utils.io.bits\n\nimport io.ktor.utils.io.core.*\nimport io.ktor.utils.io.core.internal.*\nimport kotlin.contracts.*\n\n// TODO: length default argument should be this.size - offset but it doesn't work due to KT-29920\n/**\n * Execute [block] of code providing a temporary instance of [Memory] view of this byte array range\n * starting at the specified [offset] and having the specified bytes [length].\n * By default, if neither [offset] nor [length] specified, the whole array is used.\n * An instance of [Memory] provided into the [block] should be never captured and used outside of lambda.\n */\n/**\n * TODO KTOR-1673: Solve design problems\n * 1. length has no default (blocked by expect/actual with default value compiler bug (fixed in KT 1.4.3))\n * 2. no inline -> can't suspend inside block (blocked by inline compiler bug)\n */\npublic expect fun ByteArray.useMemory(offset: Int = 0, length: Int, block: (Memory) -> R): R\n\n/**\n * Invoke [block] function with a temporary [Memory] instance of the specified [size] in bytes.\n * The provided instance shouldn't be captured and used outside of the [block] otherwise an undefined behaviour\n * may occur including crash and/or data corruption.\n */\n@OptIn(ExperimentalContracts::class)\npublic inline fun withMemory(size: Int, block: (Memory) -> R): R {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n\n return withMemory(size.toLong(), block)\n}\n\n/**\n * Invoke [block] function with a temporary [Memory] instance of the specified [size] in bytes.\n * The provided instance shouldn't be captured and used outside of the [block] otherwise an undefined behaviour\n * may occur including crash and/or data corruption.\n */\n@OptIn(ExperimentalContracts::class)\npublic inline fun withMemory(size: Long, block: (Memory) -> R): R {\n contract {\n callsInPlace(block, InvocationKind.EXACTLY_ONCE)\n }\n\n val allocator = DefaultAllocator\n val memory = allocator.alloc(size)\n return try {\n block(memory)\n } finally {\n allocator.free(memory)\n }\n}\n\n@PublishedApi\ninternal expect object DefaultAllocator : Allocator\n\npublic interface Allocator {\n public fun alloc(size: Int): Memory\n\n public fun alloc(size: Long): Memory\n\n public fun free(instance: Memory)\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.websocket\n\nimport io.ktor.util.*\nimport kotlin.jvm.*\n\n/**\n * Websocket close reason\n * @property code - close reason code as per RFC 6455, recommended to be one of [CloseReason.Codes]\n * @property message - a close reason message, could be empty\n */\npublic data class CloseReason(val code: Short, val message: String) {\n public constructor(code: Codes, message: String) : this(code.code, message)\n\n /**\n * An enum value for this [code] or `null` if the [code] is not listed in [Codes]\n */\n val knownReason: Codes?\n get() = Codes.byCode(code)\n\n override fun toString(): String {\n return \"CloseReason(reason=${knownReason ?: code}, message=$message)\"\n }\n\n /**\n * Standard close reason codes\n *\n * see https://tools.ietf.org/html/rfc6455#section-7.4 for list of codes\n */\n @Suppress(\"KDocMissingDocumentation\")\n public enum class Codes(public val code: Short) {\n NORMAL(1000),\n GOING_AWAY(1001),\n PROTOCOL_ERROR(1002),\n CANNOT_ACCEPT(1003),\n\n @InternalAPI\n @Deprecated(\"This code MUST NOT be set as a status code in a Close control frame by an endpoint\")\n CLOSED_ABNORMALLY(1006),\n NOT_CONSISTENT(1007),\n VIOLATED_POLICY(1008),\n TOO_BIG(1009),\n NO_EXTENSION(1010),\n INTERNAL_ERROR(1011),\n SERVICE_RESTART(1012),\n TRY_AGAIN_LATER(1013);\n\n public companion object {\n private val byCodeMap = values().associateBy { it.code }\n\n @Deprecated(\n \"Use INTERNAL_ERROR instead.\",\n ReplaceWith(\n \"INTERNAL_ERROR\",\n \"io.ktor.websocket.CloseReason.Codes.INTERNAL_ERROR\"\n )\n )\n @JvmField\n @Suppress(\"UNUSED\")\n public val UNEXPECTED_CONDITION: Codes = INTERNAL_ERROR\n\n /**\n * Get enum value by close reason code\n * @return enum instance or null if [code] is not in standard\n */\n public fun byCode(code: Short): Codes? = byCodeMap[code]\n }\n }\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.websocket\n\nimport io.ktor.utils.io.charsets.*\nimport io.ktor.utils.io.core.*\nimport kotlinx.coroutines.*\n\n/**\n * A frame received or ready to be sent. It is not reusable and not thread-safe\n * @property fin is it final fragment, should be always `true` for control frames and if no fragmentation is used\n * @property frameType enum value\n * @property data - a frame content or fragment content\n * @property disposableHandle could be invoked when the frame is processed\n */\npublic expect sealed class Frame private constructor(\n fin: Boolean,\n frameType: FrameType,\n data: ByteArray,\n disposableHandle: DisposableHandle = NonDisposableHandle,\n rsv1: Boolean = false,\n rsv2: Boolean = false,\n rsv3: Boolean = false\n) {\n public val fin: Boolean\n\n /**\n * First extension bit.\n */\n public val rsv1: Boolean\n\n /**\n * Second extension bit.\n */\n public val rsv2: Boolean\n\n /**\n * Third extension bit.\n */\n public val rsv3: Boolean\n\n public val frameType: FrameType\n\n public val data: ByteArray\n\n public val disposableHandle: DisposableHandle\n\n /**\n * Represents an application level binary frame.\n * In a RAW web socket session a big text frame could be fragmented\n * (separated into several text frames so they have [fin] = false except the last one).\n * Note that usually there is no need to handle fragments unless you have a RAW web socket session.\n */\n public class Binary public constructor(\n fin: Boolean,\n data: ByteArray,\n rsv1: Boolean = false,\n rsv2: Boolean = false,\n rsv3: Boolean = false\n ) : Frame {\n public constructor(fin: Boolean, data: ByteArray)\n public constructor(fin: Boolean, packet: ByteReadPacket)\n }\n\n /**\n * Represents an application level text frame.\n * In a RAW web socket session a big text frame could be fragmented\n * (separated into several text frames so they have [fin] = false except the last one).\n * Please note that a boundary between fragments could be in the middle of multi-byte (unicode) character\n * so don't apply String constructor to every fragment but use decoder loop instead of concatenate fragments first.\n * Note that usually there is no need to handle fragments unless you have a RAW web socket session.\n */\n public class Text public constructor(\n fin: Boolean,\n data: ByteArray,\n rsv1: Boolean = false,\n rsv2: Boolean = false,\n rsv3: Boolean = false,\n ) : Frame {\n public constructor(fin: Boolean, data: ByteArray)\n public constructor(text: String)\n public constructor(fin: Boolean, packet: ByteReadPacket)\n }\n\n /**\n * Represents a low-level level close frame. It could be sent to indicate web socket session end.\n * Usually there is no need to send/handle it unless you have a RAW web socket session.\n */\n public class Close(data: ByteArray) : Frame {\n public constructor(reason: CloseReason)\n public constructor(packet: ByteReadPacket)\n public constructor()\n }\n\n /**\n * Represents a low-level ping frame. Could be sent to test connection (peer should reply with [Pong]).\n * Usually there is no need to send/handle it unless you have a RAW web socket session.\n */\n public class Ping(data: ByteArray) : Frame {\n public constructor(packet: ByteReadPacket)\n }\n\n /**\n * Represents a low-level pong frame. Should be sent in reply to a [Ping] frame.\n * Usually there is no need to send/handle it unless you have a RAW web socket session.\n */\n public class Pong(\n data: ByteArray,\n disposableHandle: DisposableHandle = NonDisposableHandle\n ) : Frame {\n public constructor(packet: ByteReadPacket)\n }\n\n /**\n * Creates a frame copy\n */\n public fun copy(): Frame\n\n public companion object {\n /**\n * Create a particular [Frame] instance by frame type\n */\n public fun byType(\n fin: Boolean,\n frameType: FrameType,\n data: ByteArray,\n rsv1: Boolean,\n rsv2: Boolean,\n rsv3: Boolean\n ): Frame\n }\n}\n\n/**\n * Read text content from text frame. Shouldn't be used for fragmented frames: such frames need to be reassembled first\n */\npublic fun Frame.Text.readText(): String {\n require(fin) { \"Text could be only extracted from non-fragmented frame\" }\n return Charsets.UTF_8.newDecoder().decode(buildPacket { writeFully(data) })\n}\n\n/**\n * Read binary content from a frame. For fragmented frames only returns this fragment.\n */\npublic fun Frame.readBytes(): ByteArray {\n return data.copyOf()\n}\n\n/**\n * Read close reason from close frame or null if no close reason provided\n */\n@Suppress(\"CONFLICTING_OVERLOADS\")\npublic fun Frame.Close.readReason(): CloseReason? {\n if (data.size < 2) {\n return null\n }\n\n val packet = buildPacket { writeFully(data) }\n\n val code = packet.readShort()\n val message = packet.readText()\n\n return CloseReason(code, message)\n}\n\ninternal object NonDisposableHandle : DisposableHandle {\n override fun dispose() {}\n override fun toString(): String = \"NonDisposableHandle\"\n}\n","/*\n * Copyright 2014-2022 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.websocket\n\nimport io.ktor.util.internal.*\nimport kotlinx.coroutines.*\n\n/**\n * Raised when the frame is bigger than allowed in a current websocket session\n * @param frameSize size of received or posted frame that is too big\n */\n@OptIn(ExperimentalCoroutinesApi::class)\npublic class FrameTooBigException(\n public val frameSize: Long\n) : Exception(), CopyableThrowable {\n\n override val message: String\n get() = \"Frame is too big: $frameSize\"\n\n override fun createCopy(): FrameTooBigException = FrameTooBigException(frameSize).also {\n it.initCauseBridge(this)\n }\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.websocket\n\n/**\n * Frame types enum\n * @property controlFrame if this is control frame type\n * @property opcode - frame type id that is used to transport it\n */\npublic enum class FrameType(public val controlFrame: Boolean, public val opcode: Int) {\n /**\n * Regular application level text frame\n */\n TEXT(false, 1),\n\n /**\n * Regular application level binary frame\n */\n BINARY(false, 2),\n\n /**\n * Low level close frame type\n */\n CLOSE(true, 8),\n\n /**\n * Low level ping frame type\n */\n PING(true, 9),\n\n /**\n * Low level pong frame type\n */\n PONG(true, 0xa);\n\n public companion object {\n private val maxOpcode = values().maxByOrNull { it.opcode }!!.opcode\n\n private val byOpcodeArray = Array(maxOpcode + 1) { op -> values().singleOrNull { it.opcode == op } }\n\n /**\n * Find [FrameType] instance by numeric [opcode]\n * @return a [FrameType] instance or `null` of the [opcode] value is not valid\n */\n public operator fun get(opcode: Int): FrameType? = if (opcode in 0..maxOpcode) byOpcodeArray[opcode] else null\n }\n}\n","/*\n * Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.websocket\n\nimport io.ktor.util.*\nimport io.ktor.util.date.*\nimport io.ktor.utils.io.charsets.*\nimport io.ktor.utils.io.core.*\nimport kotlinx.coroutines.*\nimport kotlinx.coroutines.channels.*\nimport kotlin.random.*\n\nprivate val PongerCoroutineName = CoroutineName(\"ws-ponger\")\n\nprivate val PingerCoroutineName = CoroutineName(\"ws-pinger\")\n\n/**\n * Launch a ponger actor job on the [CoroutineScope] sending pongs to [outgoing] channel.\n * It is acting for every client's ping frame and replying with corresponding pong\n */\ninternal fun CoroutineScope.ponger(\n outgoing: SendChannel,\n): SendChannel {\n val channel = Channel(5)\n\n launch(PongerCoroutineName) {\n try {\n channel.consumeEach {\n outgoing.send(Frame.Pong(it.data))\n }\n } catch (_: ClosedSendChannelException) {\n }\n }\n\n return channel\n}\n\n/**\n * Launch pinger coroutine on [CoroutineScope] that is sending ping every specified [periodMillis] to [outgoing] channel,\n * waiting for and verifying client's pong frames. It is also handling [timeoutMillis] and sending timeout close frame\n */\ninternal fun CoroutineScope.pinger(\n outgoing: SendChannel,\n periodMillis: Long,\n timeoutMillis: Long,\n): SendChannel {\n val actorJob = Job()\n\n val channel = Channel(Channel.UNLIMITED)\n\n launch(actorJob + PingerCoroutineName) {\n val random = Random(getTimeMillis())\n val pingIdBytes = ByteArray(32)\n\n try {\n while (true) {\n // drop pongs during period delay as they are irrelevant\n // here we expect a timeout, so ignore it\n withTimeoutOrNull(periodMillis) {\n while (true) {\n channel.receive() // timeout causes loop to break on receive\n }\n }\n\n random.nextBytes(pingIdBytes)\n val pingMessage = \"[ping ${hex(pingIdBytes)} ping]\"\n\n val rc = withTimeoutOrNull(timeoutMillis) {\n outgoing.send(Frame.Ping(pingMessage.toByteArray(Charsets.ISO_8859_1)))\n\n // wait for valid pong message\n while (true) {\n val msg = channel.receive()\n if (String(msg.data, charset = Charsets.ISO_8859_1) == pingMessage) break\n }\n }\n\n if (rc == null) {\n // timeout\n // we were unable to send the ping or hadn't got a valid pong message in time,\n // so we are triggering close sequence (if already started then the following close frame could be ignored)\n\n val closeFrame = Frame.Close(CloseReason(CloseReason.Codes.INTERNAL_ERROR, \"Ping timeout\"))\n outgoing.send(closeFrame)\n break\n }\n }\n } catch (ignore: CancellationException) {\n } catch (ignore: ClosedReceiveChannelException) {\n } catch (ignore: ClosedSendChannelException) {\n }\n }\n\n coroutineContext[Job]!!.invokeOnCompletion {\n actorJob.cancel()\n }\n\n return channel\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.websocket\n\nimport io.ktor.util.*\n\nprivate typealias ExtensionInstaller = () -> WebSocketExtension<*>\n\n/**\n * Factory that defines WebSocket extension. The factory is used in pair with [WebSocketExtensionsConfig.install]\n * method to install WebSocket extension in client or server.\n *\n * Usually this interface implemented in `companion object` of the origin [WebSocketExtension].\n */\npublic interface WebSocketExtensionFactory> {\n /**\n * Key is used to locate extension.\n */\n public val key: AttributeKey\n\n /**\n * First extension bit used by current extension.\n *\n * This flag is used to detect extension conflicts: only one plugin with enabled flag is allowed.\n * To set the flag value please consult with specification of the extension you're using.\n */\n public val rsv1: Boolean\n\n /**\n * Second extension bit used by current extension.\n *\n * This flag is used to detect extension conflicts: only one plugin with enabled flag is allowed.\n * To set the flag value please consult with specification of the extension you're using.\n */\n public val rsv2: Boolean\n\n /**\n * Third extension bit used by current extension.\n *\n * This flag is used to detect extension conflicts: only one plugin with enabled flag is allowed.\n * To set the flag value please consult with specification of the extension you're using.\n */\n public val rsv3: Boolean\n\n /**\n * Create extension instance using [config] block. The extension instance is created for each WebSocket request.\n */\n public fun install(config: ConfigType.() -> Unit): ExtensionType\n}\n\n/**\n * WebSocket extension instance. This instance is created for each WebSocket request, for every installed extension by\n * [WebSocketExtensionFactory].\n */\npublic interface WebSocketExtension {\n\n /**\n * Reference to the [WebSocketExtensionFactory], which produced this extension.\n */\n public val factory: WebSocketExtensionFactory>\n\n /**\n * List of WebSocket extension protocols which will be sent by client in headers.\n * They are required to inform server that client wants to negotiate current extension.\n */\n public val protocols: List\n\n /**\n * This method is called only for a client, when it receives the WebSocket upgrade response.\n *\n * @param negotiatedProtocols contains list of negotiated extensions from server (can be empty).\n *\n * It's up to extension to decide if it should be used or not.\n * @return `true` if the extension should be used by the client.\n */\n public fun clientNegotiation(negotiatedProtocols: List): Boolean\n\n /**\n * This method is called only for a server, when it receives websocket session.\n *\n * @param requestedProtocols contains list of requested extensions from client (can be empty).\n *\n * @return list of protocols (with parameters) which server prefer to use for current client request.\n */\n public fun serverNegotiation(\n requestedProtocols: List\n ): List\n\n /**\n * This method is called on each outgoing frame and handle it before sending.\n */\n public fun processOutgoingFrame(frame: Frame): Frame\n\n /**\n * This method is called on each incoming frame before handling it in WebSocket session.\n */\n public fun processIncomingFrame(frame: Frame): Frame\n}\n\n/**\n * Extensions configuration for WebSocket client and server plugins.\n */\npublic class WebSocketExtensionsConfig {\n private val installers: MutableList = mutableListOf()\n private val rcv: Array = arrayOf(false, false, false)\n\n /**\n * Install provided [extension] using [config]. Every extension is processed in order of installation.\n */\n public fun install(\n extension: WebSocketExtensionFactory,\n config: ConfigType.() -> Unit = {}\n ) {\n checkConflicts(extension)\n installers += { extension.install(config) }\n }\n\n /**\n * Instantiate all installed extensions.\n */\n public fun build(): List> = installers.map { it() }\n\n private fun checkConflicts(extensionFactory: WebSocketExtensionFactory<*, *>) {\n var hasConflict = extensionFactory.rsv1 && rcv[1]\n hasConflict = hasConflict || extensionFactory.rsv2 && rcv[2]\n hasConflict = hasConflict || extensionFactory.rsv3 && rcv[3]\n\n check(!hasConflict) { \"Failed to install extension. Please check configured extensions for conflicts.\" }\n }\n}\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.websocket\n\n/**\n * Parsed `Sec-WebSocket-Accept` header item representation.\n *\n * @param name is extension name.\n * @param parameters is list of extension parameters.\n */\npublic class WebSocketExtensionHeader(public val name: String, public val parameters: List) {\n\n /**\n * Parse parameters keys and values\n */\n public fun parseParameters(): Sequence> = parameters.asSequence().map {\n val equalsIndex = it.indexOf('=')\n if (equalsIndex < 0) return@map it to \"\"\n\n val key = it.substring(0 until equalsIndex)\n val value = if (equalsIndex + 1 < it.length) it.substring(equalsIndex + 1) else \"\"\n\n key to value\n }\n\n @Suppress(\"KDocMissingDocumentation\")\n override fun toString(): String = \"$name ${parametersToString()}\"\n\n private fun parametersToString(): String =\n if (parameters.isEmpty()) \"\" else \", ${parameters.joinToString(\",\")}\"\n}\n\n/**\n * Parse `Sec-WebSocket-Accept` header.\n */\npublic fun parseWebSocketExtensions(value: String): List = value\n .split(\",\")\n .map { it ->\n val extension = it.split(\";\")\n val name = extension.first().trim()\n val parameters = extension.drop(1).map { it.trim() }\n WebSocketExtensionHeader(name, parameters)\n }\n","/*\n* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n*/\n\npackage io.ktor.websocket\n\nimport io.ktor.util.*\nimport kotlinx.coroutines.*\nimport kotlinx.coroutines.channels.*\n\n/**\n * Represents a web socket session between two peers\n */\npublic interface WebSocketSession : CoroutineScope {\n /**\n * Enable or disable masking output messages by a random xor mask.\n * Please note that changing this flag on the fly could be applied to the messages already sent (enqueued earlier)\n * as the sending pipeline works asynchronously\n */\n public var masking: Boolean\n\n /**\n * Specifies frame size limit. Connection will be closed if violated\n */\n public var maxFrameSize: Long\n\n /**\n * Incoming frames channel\n */\n public val incoming: ReceiveChannel\n\n /**\n * Outgoing frames channel. It could have limited capacity so sending too much frames may lead to suspension at\n * corresponding send invocations. It also may suspend if a peer doesn't read frames for some reason.\n */\n public val outgoing: SendChannel\n\n /**\n * Negotiated WebSocket extensions.\n */\n public val extensions: List>\n\n /**\n * Enqueue frame, may suspend if outgoing queue is full. May throw an exception if outgoing channel is already\n * closed so it is impossible to transfer any message. Frames that were sent after close frame could be silently\n * ignored. Please note that close frame could be sent automatically in reply to a peer close frame unless it is\n * raw websocket session.\n */\n public suspend fun send(frame: Frame) {\n outgoing.send(frame)\n }\n\n /**\n * Flush all outstanding messages and suspend until all earlier sent messages will be written. Could be called\n * at any time even after close. May return immediately if the connection is already terminated.\n * However it may also fail with an exception (or cancellation) at any point due to session failure.\n * Please note that [flush] doesn't guarantee that frames were actually delivered.\n */\n public suspend fun flush()\n\n /**\n * Initiate connection termination immediately. Termination may complete asynchronously.\n */\n @Deprecated(\n \"Use cancel() instead.\",\n ReplaceWith(\"cancel()\", \"kotlinx.coroutines.cancel\")\n )\n public fun terminate()\n}\n\n/**\n * Find the extensions using [WebSocketExtensionFactory].\n *\n * @return extension instance.\n * @throws [IllegalStateException] if the extension is not found.\n */\npublic fun > WebSocketSession.extension(extension: WebSocketExtensionFactory<*, T>): T =\n extensionOrNull(extension) ?: error(\"Extension $extension not found.\")\n\n/**\n * Search the extensions using [WebSocketExtensionFactory].\n *\n * @return extension instance or `null` if the extension is not installed.\n */\n@Suppress(\"UNCHECKED_CAST\")\npublic fun > WebSocketSession.extensionOrNull(\n extension: WebSocketExtensionFactory<*, T>\n): T? = extensions.firstOrNull { it.factory.key === extension.key } as? T?\n\n/**\n * Enqueues a text frame for sending with the specified [content].\n *\n * May suspend if the outgoing queue is full, and throw an exception if the channel is already closed.\n */\npublic suspend fun WebSocketSession.send(content: String): Unit = send(Frame.Text(content))\n\n/**\n * Enqueues a final binary frame for sending with the specified [content].\n *\n * May suspend if the outgoing queue is full, and throw an exception if the channel is already closed.\n */\npublic suspend fun WebSocketSession.send(content: ByteArray): Unit = send(Frame.Binary(true, content))\n\n/**\n * Send a close frame with the specified [reason]. May suspend if outgoing channel is full.\n * The specified [reason] could be ignored if there was already\n * close frame sent (for example in reply to a peer close frame). It also may do nothing when a session or an outgoing\n * channel is already closed due to any reason.\n */\npublic suspend fun WebSocketSession.close(reason: CloseReason = CloseReason(CloseReason.Codes.NORMAL, \"\")) {\n try {\n send(Frame.Close(reason))\n flush()\n } catch (_: Throwable) {\n }\n}\n\n/**\n * Closes with reason depending on [cause] or normally if [cause] is `null`.\n * This is going to be removed. Close with a particular reason or terminate instead.\n */\n@Deprecated(\"Close with reason or terminate instead.\")\npublic suspend fun WebSocketSession.close(cause: Throwable?) {\n if (cause == null) {\n close()\n } else {\n closeExceptionally(cause)\n }\n}\n\n/**\n * Closes session with normal or error close reason, depending on whether [cause] is cancellation or not.\n */\npublic suspend fun WebSocketSession.closeExceptionally(cause: Throwable) {\n val reason = when (cause) {\n is CancellationException -> CloseReason(CloseReason.Codes.NORMAL, \"\")\n else -> CloseReason(CloseReason.Codes.INTERNAL_ERROR, cause.toString())\n }\n\n close(reason)\n}\n","// ktlint-disable filename\n/*\n * Copyright 2014-2022 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.\n */\n\npackage io.ktor.websocket\n\nimport io.ktor.utils.io.core.*\nimport kotlinx.coroutines.*\n\n/**\n * A frame received or ready to be sent. It is not reusable and not thread-safe\n * @property fin is it final fragment, should be always `true` for control frames and if no fragmentation is used\n * @property frameType enum value\n * @property data - a frame content or fragment content\n * @property disposableHandle could be invoked when the frame is processed\n */\npublic actual sealed class Frame actual constructor(\n public actual val fin: Boolean,\n public actual val frameType: FrameType,\n public actual val data: ByteArray,\n public actual val disposableHandle: DisposableHandle,\n public actual val rsv1: Boolean,\n public actual val rsv2: Boolean,\n public actual val rsv3: Boolean\n) {\n /**\n * Represents an application level binary frame.\n * In a RAW web socket session a big text frame could be fragmented\n * (separated into several text frames so they have [fin] = false except the last one).\n * Note that usually there is no need to handle fragments unless you have a RAW web socket session.\n */\n public actual class Binary actual constructor(\n fin: Boolean,\n data: ByteArray,\n rsv1: Boolean,\n rsv2: Boolean,\n rsv3: Boolean\n ) : Frame(fin, FrameType.BINARY, data, NonDisposableHandle, rsv1, rsv2, rsv3) {\n public actual constructor(fin: Boolean, data: ByteArray) : this(fin, data, false, false, false)\n public actual constructor(fin: Boolean, packet: ByteReadPacket) : this(fin, packet.readBytes())\n }\n\n /**\n * Represents an application level text frame.\n * In a RAW web socket session a big text frame could be fragmented\n * (separated into several text frames so they have [fin] = false except the last one).\n * Please note that a boundary between fragments could be in the middle of multi-byte (unicode) character\n * so don't apply String constructor to every fragment but use decoder loop instead of concatenate fragments first.\n * Note that usually there is no need to handle fragments unless you have a RAW web socket session.\n */\n public actual class Text actual constructor(\n fin: Boolean,\n data: ByteArray,\n rsv1: Boolean,\n rsv2: Boolean,\n rsv3: Boolean\n ) : Frame(fin, FrameType.TEXT, data, NonDisposableHandle, rsv1, rsv2, rsv3) {\n public actual constructor(fin: Boolean, data: ByteArray) : this(fin, data, false, false, false)\n public actual constructor(text: String) : this(true, text.toByteArray())\n public actual constructor(fin: Boolean, packet: ByteReadPacket) : this(fin, packet.readBytes())\n }\n\n /**\n * Represents a low-level level close frame. It could be sent to indicate web socket session end.\n * Usually there is no need to send/handle it unless you have a RAW web socket session.\n */\n public actual class Close actual constructor(\n data: ByteArray\n ) : Frame(true, FrameType.CLOSE, data, NonDisposableHandle, false, false, false) {\n public actual constructor(reason: CloseReason) : this(\n buildPacket {\n writeShort(reason.code)\n writeText(reason.message)\n }\n )\n\n public actual constructor(packet: ByteReadPacket) : this(packet.readBytes())\n public actual constructor() : this(Empty)\n }\n\n /**\n * Represents a low-level ping frame. Could be sent to test connection (peer should reply with [Pong]).\n * Usually there is no need to send/handle it unless you have a RAW web socket session.\n */\n public actual class Ping actual constructor(\n data: ByteArray\n ) : Frame(true, FrameType.PING, data, NonDisposableHandle, false, false, false) {\n public actual constructor(packet: ByteReadPacket) : this(packet.readBytes())\n }\n\n /**\n * Represents a low-level pong frame. Should be sent in reply to a [Ping] frame.\n * Usually there is no need to send/handle it unless you have a RAW web socket session.\n */\n public actual class Pong actual constructor(\n data: ByteArray,\n disposableHandle: DisposableHandle\n ) : Frame(true, FrameType.PONG, data, disposableHandle, false, false, false) {\n public actual constructor(packet: ByteReadPacket) : this(packet.readBytes(), NonDisposableHandle)\n }\n\n override fun toString(): String = \"Frame $frameType (fin=$fin, buffer len = ${data.size})\"\n\n /**\n * Creates a frame copy.\n */\n public actual fun copy(): Frame = byType(fin, frameType, data.copyOf(), rsv1, rsv2, rsv3)\n\n public actual companion object {\n private val Empty: ByteArray = ByteArray(0)\n\n /**\n * Create a particular [Frame] instance by frame type.\n */\n public actual fun byType(\n fin: Boolean,\n frameType: FrameType,\n data: ByteArray,\n rsv1: Boolean,\n rsv2: Boolean,\n rsv3: Boolean\n ): Frame = when (frameType) {\n FrameType.BINARY -> Binary(fin, data, rsv1, rsv2, rsv3)\n FrameType.TEXT -> Text(fin, data, rsv1, rsv2, rsv3)\n FrameType.CLOSE -> Close(data)\n FrameType.PING -> Ping(data)\n FrameType.PONG -> Pong(data, NonDisposableHandle)\n }\n }\n}\n","(function (factory) {\n if (typeof exports === 'object') {\n // Node/CommonJS\n module.exports = factory();\n } else if (typeof define === 'function' && define.amd) {\n // AMD\n define(factory);\n } else {\n // Browser globals (with support for web workers)\n var glob;\n\n try {\n glob = window;\n } catch (e) {\n glob = self;\n }\n\n glob.SparkMD5 = factory();\n }\n}(function (undefined) {\n\n 'use strict';\n\n /*\n * Fastest md5 implementation around (JKM md5).\n * Credits: Joseph Myers\n *\n * @see http://www.myersdaily.org/joseph/javascript/md5-text.html\n * @see http://jsperf.com/md5-shootout/7\n */\n\n /* this function is much faster,\n so if possible we use it. Some IEs\n are the only ones I know of that\n need the idiotic second function,\n generated by an if clause. */\n var add32 = function (a, b) {\n return (a + b) & 0xFFFFFFFF;\n },\n hex_chr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];\n\n\n function cmn(q, a, b, x, s, t) {\n a = add32(add32(a, q), add32(x, t));\n return add32((a << s) | (a >>> (32 - s)), b);\n }\n\n function md5cycle(x, k) {\n var a = x[0],\n b = x[1],\n c = x[2],\n d = x[3];\n\n a += (b & c | ~b & d) + k[0] - 680876936 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[1] - 389564586 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[2] + 606105819 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[3] - 1044525330 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[4] - 176418897 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[5] + 1200080426 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[6] - 1473231341 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[7] - 45705983 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[8] + 1770035416 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[9] - 1958414417 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[10] - 42063 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[11] - 1990404162 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n a += (b & c | ~b & d) + k[12] + 1804603682 | 0;\n a = (a << 7 | a >>> 25) + b | 0;\n d += (a & b | ~a & c) + k[13] - 40341101 | 0;\n d = (d << 12 | d >>> 20) + a | 0;\n c += (d & a | ~d & b) + k[14] - 1502002290 | 0;\n c = (c << 17 | c >>> 15) + d | 0;\n b += (c & d | ~c & a) + k[15] + 1236535329 | 0;\n b = (b << 22 | b >>> 10) + c | 0;\n\n a += (b & d | c & ~d) + k[1] - 165796510 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[6] - 1069501632 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[11] + 643717713 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[0] - 373897302 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[5] - 701558691 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[10] + 38016083 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[15] - 660478335 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[4] - 405537848 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[9] + 568446438 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[14] - 1019803690 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[3] - 187363961 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[8] + 1163531501 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n a += (b & d | c & ~d) + k[13] - 1444681467 | 0;\n a = (a << 5 | a >>> 27) + b | 0;\n d += (a & c | b & ~c) + k[2] - 51403784 | 0;\n d = (d << 9 | d >>> 23) + a | 0;\n c += (d & b | a & ~b) + k[7] + 1735328473 | 0;\n c = (c << 14 | c >>> 18) + d | 0;\n b += (c & a | d & ~a) + k[12] - 1926607734 | 0;\n b = (b << 20 | b >>> 12) + c | 0;\n\n a += (b ^ c ^ d) + k[5] - 378558 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[8] - 2022574463 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[11] + 1839030562 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[14] - 35309556 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[1] - 1530992060 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[4] + 1272893353 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[7] - 155497632 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[10] - 1094730640 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[13] + 681279174 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[0] - 358537222 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[3] - 722521979 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[6] + 76029189 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n a += (b ^ c ^ d) + k[9] - 640364487 | 0;\n a = (a << 4 | a >>> 28) + b | 0;\n d += (a ^ b ^ c) + k[12] - 421815835 | 0;\n d = (d << 11 | d >>> 21) + a | 0;\n c += (d ^ a ^ b) + k[15] + 530742520 | 0;\n c = (c << 16 | c >>> 16) + d | 0;\n b += (c ^ d ^ a) + k[2] - 995338651 | 0;\n b = (b << 23 | b >>> 9) + c | 0;\n\n a += (c ^ (b | ~d)) + k[0] - 198630844 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[7] + 1126891415 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[14] - 1416354905 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[5] - 57434055 | 0;\n b = (b << 21 |b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[12] + 1700485571 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[3] - 1894986606 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[10] - 1051523 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[1] - 2054922799 | 0;\n b = (b << 21 |b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[8] + 1873313359 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[15] - 30611744 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[6] - 1560198380 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[13] + 1309151649 | 0;\n b = (b << 21 |b >>> 11) + c | 0;\n a += (c ^ (b | ~d)) + k[4] - 145523070 | 0;\n a = (a << 6 | a >>> 26) + b | 0;\n d += (b ^ (a | ~c)) + k[11] - 1120210379 | 0;\n d = (d << 10 | d >>> 22) + a | 0;\n c += (a ^ (d | ~b)) + k[2] + 718787259 | 0;\n c = (c << 15 | c >>> 17) + d | 0;\n b += (d ^ (c | ~a)) + k[9] - 343485551 | 0;\n b = (b << 21 | b >>> 11) + c | 0;\n\n x[0] = a + x[0] | 0;\n x[1] = b + x[1] | 0;\n x[2] = c + x[2] | 0;\n x[3] = d + x[3] | 0;\n }\n\n function md5blk(s) {\n var md5blks = [],\n i; /* Andy King said do it this way. */\n\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24);\n }\n return md5blks;\n }\n\n function md5blk_array(a) {\n var md5blks = [],\n i; /* Andy King said do it this way. */\n\n for (i = 0; i < 64; i += 4) {\n md5blks[i >> 2] = a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24);\n }\n return md5blks;\n }\n\n function md51(s) {\n var n = s.length,\n state = [1732584193, -271733879, -1732584194, 271733878],\n i,\n length,\n tail,\n tmp,\n lo,\n hi;\n\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk(s.substring(i - 64, i)));\n }\n s = s.substring(i - 64);\n length = s.length;\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= s.charCodeAt(i) << ((i % 4) << 3);\n }\n tail[i >> 2] |= 0x80 << ((i % 4) << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n\n // Beware that the final length might not fit in 32 bits so we take care of that\n tmp = n * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n\n tail[14] = lo;\n tail[15] = hi;\n\n md5cycle(state, tail);\n return state;\n }\n\n function md51_array(a) {\n var n = a.length,\n state = [1732584193, -271733879, -1732584194, 271733878],\n i,\n length,\n tail,\n tmp,\n lo,\n hi;\n\n for (i = 64; i <= n; i += 64) {\n md5cycle(state, md5blk_array(a.subarray(i - 64, i)));\n }\n\n // Not sure if it is a bug, however IE10 will always produce a sub array of length 1\n // containing the last element of the parent array if the sub array specified starts\n // beyond the length of the parent array - weird.\n // https://connect.microsoft.com/IE/feedback/details/771452/typed-array-subarray-issue\n a = (i - 64) < n ? a.subarray(i - 64) : new Uint8Array(0);\n\n length = a.length;\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= a[i] << ((i % 4) << 3);\n }\n\n tail[i >> 2] |= 0x80 << ((i % 4) << 3);\n if (i > 55) {\n md5cycle(state, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n\n // Beware that the final length might not fit in 32 bits so we take care of that\n tmp = n * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n\n tail[14] = lo;\n tail[15] = hi;\n\n md5cycle(state, tail);\n\n return state;\n }\n\n function rhex(n) {\n var s = '',\n j;\n for (j = 0; j < 4; j += 1) {\n s += hex_chr[(n >> (j * 8 + 4)) & 0x0F] + hex_chr[(n >> (j * 8)) & 0x0F];\n }\n return s;\n }\n\n function hex(x) {\n var i;\n for (i = 0; i < x.length; i += 1) {\n x[i] = rhex(x[i]);\n }\n return x.join('');\n }\n\n // In some cases the fast add32 function cannot be used..\n if (hex(md51('hello')) !== '5d41402abc4b2a76b9719d911017c592') {\n add32 = function (x, y) {\n var lsw = (x & 0xFFFF) + (y & 0xFFFF),\n msw = (x >> 16) + (y >> 16) + (lsw >> 16);\n return (msw << 16) | (lsw & 0xFFFF);\n };\n }\n\n // ---------------------------------------------------\n\n /**\n * ArrayBuffer slice polyfill.\n *\n * @see https://github.com/ttaubert/node-arraybuffer-slice\n */\n\n if (typeof ArrayBuffer !== 'undefined' && !ArrayBuffer.prototype.slice) {\n (function () {\n function clamp(val, length) {\n val = (val | 0) || 0;\n\n if (val < 0) {\n return Math.max(val + length, 0);\n }\n\n return Math.min(val, length);\n }\n\n ArrayBuffer.prototype.slice = function (from, to) {\n var length = this.byteLength,\n begin = clamp(from, length),\n end = length,\n num,\n target,\n targetArray,\n sourceArray;\n\n if (to !== undefined) {\n end = clamp(to, length);\n }\n\n if (begin > end) {\n return new ArrayBuffer(0);\n }\n\n num = end - begin;\n target = new ArrayBuffer(num);\n targetArray = new Uint8Array(target);\n\n sourceArray = new Uint8Array(this, begin, num);\n targetArray.set(sourceArray);\n\n return target;\n };\n })();\n }\n\n // ---------------------------------------------------\n\n /**\n * Helpers.\n */\n\n function toUtf8(str) {\n if (/[\\u0080-\\uFFFF]/.test(str)) {\n str = unescape(encodeURIComponent(str));\n }\n\n return str;\n }\n\n function utf8Str2ArrayBuffer(str, returnUInt8Array) {\n var length = str.length,\n buff = new ArrayBuffer(length),\n arr = new Uint8Array(buff),\n i;\n\n for (i = 0; i < length; i += 1) {\n arr[i] = str.charCodeAt(i);\n }\n\n return returnUInt8Array ? arr : buff;\n }\n\n function arrayBuffer2Utf8Str(buff) {\n return String.fromCharCode.apply(null, new Uint8Array(buff));\n }\n\n function concatenateArrayBuffers(first, second, returnUInt8Array) {\n var result = new Uint8Array(first.byteLength + second.byteLength);\n\n result.set(new Uint8Array(first));\n result.set(new Uint8Array(second), first.byteLength);\n\n return returnUInt8Array ? result : result.buffer;\n }\n\n function hexToBinaryString(hex) {\n var bytes = [],\n length = hex.length,\n x;\n\n for (x = 0; x < length - 1; x += 2) {\n bytes.push(parseInt(hex.substr(x, 2), 16));\n }\n\n return String.fromCharCode.apply(String, bytes);\n }\n\n // ---------------------------------------------------\n\n /**\n * SparkMD5 OOP implementation.\n *\n * Use this class to perform an incremental md5, otherwise use the\n * static methods instead.\n */\n\n function SparkMD5() {\n // call reset to init the instance\n this.reset();\n }\n\n /**\n * Appends a string.\n * A conversion will be applied if an utf8 string is detected.\n *\n * @param {String} str The string to be appended\n *\n * @return {SparkMD5} The instance itself\n */\n SparkMD5.prototype.append = function (str) {\n // Converts the string to utf8 bytes if necessary\n // Then append as binary\n this.appendBinary(toUtf8(str));\n\n return this;\n };\n\n /**\n * Appends a binary string.\n *\n * @param {String} contents The binary string to be appended\n *\n * @return {SparkMD5} The instance itself\n */\n SparkMD5.prototype.appendBinary = function (contents) {\n this._buff += contents;\n this._length += contents.length;\n\n var length = this._buff.length,\n i;\n\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i)));\n }\n\n this._buff = this._buff.substring(i - 64);\n\n return this;\n };\n\n /**\n * Finishes the incremental computation, reseting the internal state and\n * returning the result.\n *\n * @param {Boolean} raw True to get the raw string, false to get the hex string\n *\n * @return {String} The result\n */\n SparkMD5.prototype.end = function (raw) {\n var buff = this._buff,\n length = buff.length,\n i,\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n ret;\n\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff.charCodeAt(i) << ((i % 4) << 3);\n }\n\n this._finish(tail, length);\n ret = hex(this._hash);\n\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n\n this.reset();\n\n return ret;\n };\n\n /**\n * Resets the internal state of the computation.\n *\n * @return {SparkMD5} The instance itself\n */\n SparkMD5.prototype.reset = function () {\n this._buff = '';\n this._length = 0;\n this._hash = [1732584193, -271733879, -1732584194, 271733878];\n\n return this;\n };\n\n /**\n * Gets the internal state of the computation.\n *\n * @return {Object} The state\n */\n SparkMD5.prototype.getState = function () {\n return {\n buff: this._buff,\n length: this._length,\n hash: this._hash.slice()\n };\n };\n\n /**\n * Gets the internal state of the computation.\n *\n * @param {Object} state The state\n *\n * @return {SparkMD5} The instance itself\n */\n SparkMD5.prototype.setState = function (state) {\n this._buff = state.buff;\n this._length = state.length;\n this._hash = state.hash;\n\n return this;\n };\n\n /**\n * Releases memory used by the incremental buffer and other additional\n * resources. If you plan to use the instance again, use reset instead.\n */\n SparkMD5.prototype.destroy = function () {\n delete this._hash;\n delete this._buff;\n delete this._length;\n };\n\n /**\n * Finish the final calculation based on the tail.\n *\n * @param {Array} tail The tail (will be modified)\n * @param {Number} length The length of the remaining buffer\n */\n SparkMD5.prototype._finish = function (tail, length) {\n var i = length,\n tmp,\n lo,\n hi;\n\n tail[i >> 2] |= 0x80 << ((i % 4) << 3);\n if (i > 55) {\n md5cycle(this._hash, tail);\n for (i = 0; i < 16; i += 1) {\n tail[i] = 0;\n }\n }\n\n // Do the final computation based on the tail and length\n // Beware that the final length may not fit in 32 bits so we take care of that\n tmp = this._length * 8;\n tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);\n lo = parseInt(tmp[2], 16);\n hi = parseInt(tmp[1], 16) || 0;\n\n tail[14] = lo;\n tail[15] = hi;\n md5cycle(this._hash, tail);\n };\n\n /**\n * Performs the md5 hash on a string.\n * A conversion will be applied if utf8 string is detected.\n *\n * @param {String} str The string\n * @param {Boolean} [raw] True to get the raw string, false to get the hex string\n *\n * @return {String} The result\n */\n SparkMD5.hash = function (str, raw) {\n // Converts the string to utf8 bytes if necessary\n // Then compute it using the binary function\n return SparkMD5.hashBinary(toUtf8(str), raw);\n };\n\n /**\n * Performs the md5 hash on a binary string.\n *\n * @param {String} content The binary string\n * @param {Boolean} [raw] True to get the raw string, false to get the hex string\n *\n * @return {String} The result\n */\n SparkMD5.hashBinary = function (content, raw) {\n var hash = md51(content),\n ret = hex(hash);\n\n return raw ? hexToBinaryString(ret) : ret;\n };\n\n // ---------------------------------------------------\n\n /**\n * SparkMD5 OOP implementation for array buffers.\n *\n * Use this class to perform an incremental md5 ONLY for array buffers.\n */\n SparkMD5.ArrayBuffer = function () {\n // call reset to init the instance\n this.reset();\n };\n\n /**\n * Appends an array buffer.\n *\n * @param {ArrayBuffer} arr The array to be appended\n *\n * @return {SparkMD5.ArrayBuffer} The instance itself\n */\n SparkMD5.ArrayBuffer.prototype.append = function (arr) {\n var buff = concatenateArrayBuffers(this._buff.buffer, arr, true),\n length = buff.length,\n i;\n\n this._length += arr.byteLength;\n\n for (i = 64; i <= length; i += 64) {\n md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i)));\n }\n\n this._buff = (i - 64) < length ? new Uint8Array(buff.buffer.slice(i - 64)) : new Uint8Array(0);\n\n return this;\n };\n\n /**\n * Finishes the incremental computation, reseting the internal state and\n * returning the result.\n *\n * @param {Boolean} raw True to get the raw string, false to get the hex string\n *\n * @return {String} The result\n */\n SparkMD5.ArrayBuffer.prototype.end = function (raw) {\n var buff = this._buff,\n length = buff.length,\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n i,\n ret;\n\n for (i = 0; i < length; i += 1) {\n tail[i >> 2] |= buff[i] << ((i % 4) << 3);\n }\n\n this._finish(tail, length);\n ret = hex(this._hash);\n\n if (raw) {\n ret = hexToBinaryString(ret);\n }\n\n this.reset();\n\n return ret;\n };\n\n /**\n * Resets the internal state of the computation.\n *\n * @return {SparkMD5.ArrayBuffer} The instance itself\n */\n SparkMD5.ArrayBuffer.prototype.reset = function () {\n this._buff = new Uint8Array(0);\n this._length = 0;\n this._hash = [1732584193, -271733879, -1732584194, 271733878];\n\n return this;\n };\n\n /**\n * Gets the internal state of the computation.\n *\n * @return {Object} The state\n */\n SparkMD5.ArrayBuffer.prototype.getState = function () {\n var state = SparkMD5.prototype.getState.call(this);\n\n // Convert buffer to a string\n state.buff = arrayBuffer2Utf8Str(state.buff);\n\n return state;\n };\n\n /**\n * Gets the internal state of the computation.\n *\n * @param {Object} state The state\n *\n * @return {SparkMD5.ArrayBuffer} The instance itself\n */\n SparkMD5.ArrayBuffer.prototype.setState = function (state) {\n // Convert string to buffer\n state.buff = utf8Str2ArrayBuffer(state.buff, true);\n\n return SparkMD5.prototype.setState.call(this, state);\n };\n\n SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;\n\n SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish;\n\n /**\n * Performs the md5 hash on an array buffer.\n *\n * @param {ArrayBuffer} arr The array buffer\n * @param {Boolean} [raw] True to get the raw string, false to get the hex one\n *\n * @return {String} The result\n */\n SparkMD5.ArrayBuffer.hash = function (arr, raw) {\n var hash = md51_array(new Uint8Array(arr)),\n ret = hex(hash);\n\n return raw ? hexToBinaryString(ret) : ret;\n };\n\n return SparkMD5;\n}));\n"],"sourceRoot":""}