diff --git a/demos/navigator/build.gradle.kts b/demos/navigator/build.gradle.kts index d76072ad17..af10f45e00 100644 --- a/demos/navigator/build.gradle.kts +++ b/demos/navigator/build.gradle.kts @@ -79,6 +79,7 @@ dependencies { implementation(libs.timber) implementation(libs.kotlinx.coroutines.android) implementation(libs.kotlinx.collections.immutable) + implementation(libs.kotlinx.serialization.json) implementation(libs.kotlin.stdlib) implementation(libs.bundles.compose) implementation(libs.google.material) diff --git a/demos/navigator/src/main/java/org/readium/demo/navigator/decorations/HighlightsManager.kt b/demos/navigator/src/main/java/org/readium/demo/navigator/decorations/HighlightsManager.kt index 667167e2f5..d33c9d72fe 100644 --- a/demos/navigator/src/main/java/org/readium/demo/navigator/decorations/HighlightsManager.kt +++ b/demos/navigator/src/main/java/org/readium/demo/navigator/decorations/HighlightsManager.kt @@ -44,7 +44,7 @@ sealed class HighlightsManager( decorationFactory: (Highlight, Long) -> List>, ) { - private val lastHighlightId: Long = -1 + private var lastHighlightId: Long = -1 private val highlightsMutable: MutableStateFlow> = MutableStateFlow(persistentMapOf()) @@ -62,7 +62,9 @@ sealed class HighlightsManager( @ColorInt tint: Int, annotation: String = "", ): Long { - val id = lastHighlightId + 1 + lastHighlightId += 1 + val id = lastHighlightId + val highlight = Highlight( locator = locator, style = style, diff --git a/demos/navigator/src/main/java/org/readium/demo/navigator/preferences/UserPreferences.kt b/demos/navigator/src/main/java/org/readium/demo/navigator/preferences/UserPreferences.kt index 6d458a9072..65ea221724 100644 --- a/demos/navigator/src/main/java/org/readium/demo/navigator/preferences/UserPreferences.kt +++ b/demos/navigator/src/main/java/org/readium/demo/navigator/preferences/UserPreferences.kt @@ -48,7 +48,6 @@ import org.readium.r2.shared.util.Language /** * Stateful user settings component. */ - @Composable fun

, S : Settings, E : PreferencesEditor> UserPreferences( editor: E, diff --git a/readium/navigator/src/main/java/org/readium/r2/navigator/epub/css/ReadiumCss.kt b/readium/navigator/src/main/java/org/readium/r2/navigator/epub/css/ReadiumCss.kt index 8c73ebe6b8..7b35cc681a 100644 --- a/readium/navigator/src/main/java/org/readium/r2/navigator/epub/css/ReadiumCss.kt +++ b/readium/navigator/src/main/java/org/readium/r2/navigator/epub/css/ReadiumCss.kt @@ -6,7 +6,7 @@ package org.readium.r2.navigator.epub.css -import android.net.Uri +import androidx.core.net.toUri import org.jsoup.Jsoup import org.jsoup.nodes.Document import org.jsoup.nodes.Element @@ -130,7 +130,7 @@ internal data class ReadiumCss( if (googleFonts.isNotEmpty()) { val families = googleFonts.joinToString("|") { it.name } - val uri = Uri.parse("https://fonts.googleapis.com/css") + val uri = "https://fonts.googleapis.com/css".toUri() .buildUpon() .appendQueryParameter("family", families) .build() diff --git a/readium/navigators/common/build.gradle.kts b/readium/navigators/common/build.gradle.kts index 3eba3cbc02..8e19c63c64 100644 --- a/readium/navigators/common/build.gradle.kts +++ b/readium/navigators/common/build.gradle.kts @@ -22,11 +22,9 @@ dependencies { api(project(":readium:readium-shared")) api(project(":readium:readium-navigator")) + api(libs.androidx.compose.foundation) api(libs.kotlinx.collections.immutable) implementation(libs.androidx.recyclerview) - implementation(libs.kotlinx.serialization.json) - implementation(libs.bundles.compose) implementation(libs.timber) - implementation(libs.kotlinx.coroutines.android) } diff --git a/readium/navigators/common/src/main/java/org/readium/navigator/common/LocationElements.kt b/readium/navigators/common/src/main/java/org/readium/navigator/common/LocationElements.kt index 7164bcea2c..caf8a3267f 100644 --- a/readium/navigators/common/src/main/java/org/readium/navigator/common/LocationElements.kt +++ b/readium/navigators/common/src/main/java/org/readium/navigator/common/LocationElements.kt @@ -7,6 +7,16 @@ package org.readium.navigator.common import org.readium.r2.shared.ExperimentalReadiumApi +import org.readium.r2.shared.publication.Locator + +/** + * An HTML Id. + */ +@ExperimentalReadiumApi +@JvmInline +public value class HtmlId( + public val value: String, +) /** * A CSS selector. @@ -24,7 +34,11 @@ public value class CssSelector( @JvmInline public value class Progression private constructor( public val value: Double, -) { +) : Comparable { + + override fun compareTo(other: Progression): Int { + return value.compareTo(other.value) + } public companion object { @@ -41,11 +55,16 @@ public value class Progression private constructor( @JvmInline public value class Position private constructor( public val value: Int, -) { +) : Comparable { + + override fun compareTo(other: Position): Int { + return value.compareTo(other.value) + } + public companion object { - public operator fun invoke(value: Double): Position? = - value.takeIf { value >= 0 } + public operator fun invoke(value: Int): Position? = + value.takeIf { value >= 1 } ?.let { Position(it) } } } @@ -60,3 +79,42 @@ public data class TextQuote( val prefix: String, val suffix: String, ) + +/** + * Returns a [TextAnchor] to the beginning or the end of the text quote. + */ +@ExperimentalReadiumApi +public fun TextQuote.toTextAnchor(end: Boolean = false): TextAnchor = + when (end) { + false -> TextAnchor( + textBefore = prefix, + textAfter = text + suffix + ) + true -> TextAnchor( + textBefore = prefix + text, + textAfter = suffix + ) + } + +/** + * A [TextAnchor] is a pair of short text snippets allowing to locate in a text. + */ +@ExperimentalReadiumApi +public data class TextAnchor( + val textBefore: String, + val textAfter: String, +) + +@ExperimentalReadiumApi +public fun Locator.Text.toTextQuote(): TextQuote? = + highlight?.let { highlight -> + TextQuote( + text = highlight, + prefix = before.orEmpty(), + suffix = after.orEmpty() + ) + } + +@ExperimentalReadiumApi +public fun Locator.Text.toTextAnchor(end: Boolean = false): TextAnchor? = + toTextQuote()?.toTextAnchor(end) diff --git a/readium/navigators/common/src/main/java/org/readium/navigator/common/Locations.kt b/readium/navigators/common/src/main/java/org/readium/navigator/common/Locations.kt index 97c9ba97a4..56181dd8b5 100644 --- a/readium/navigators/common/src/main/java/org/readium/navigator/common/Locations.kt +++ b/readium/navigators/common/src/main/java/org/readium/navigator/common/Locations.kt @@ -63,3 +63,9 @@ public interface PositionLocation : Location { public val position: Position } + +@ExperimentalReadiumApi +public interface TextAnchorLocation : Location { + + public val textAnchor: TextAnchor +} diff --git a/readium/navigators/web/common/build.gradle.kts b/readium/navigators/web/common/build.gradle.kts index e080b592d5..108f09a555 100644 --- a/readium/navigators/web/common/build.gradle.kts +++ b/readium/navigators/web/common/build.gradle.kts @@ -23,10 +23,7 @@ dependencies { api(project(":readium:readium-navigator")) api(project(":readium:navigators:readium-navigator-common")) - api(libs.kotlinx.collections.immutable) + api(libs.androidx.compose.foundation) - implementation(libs.kotlinx.serialization.json) - implementation(libs.bundles.compose) implementation(libs.timber) - implementation(libs.kotlinx.coroutines.android) } diff --git a/readium/navigators/web/common/src/main/kotlin/org/readium/navigator/web/common/FontFamilyDeclarations.kt b/readium/navigators/web/common/src/main/kotlin/org/readium/navigator/web/common/FontFamilyDeclarations.kt index 015e0a8b88..b0f01173c5 100644 --- a/readium/navigators/web/common/src/main/kotlin/org/readium/navigator/web/common/FontFamilyDeclarations.kt +++ b/readium/navigators/web/common/src/main/kotlin/org/readium/navigator/web/common/FontFamilyDeclarations.kt @@ -8,10 +8,11 @@ package org.readium.navigator.web.common -import kotlinx.collections.immutable.* import kotlinx.collections.immutable.ImmutableList +import kotlinx.collections.immutable.PersistentList import kotlinx.collections.immutable.persistentListOf -import kotlinx.serialization.Serializable +import kotlinx.collections.immutable.plus +import kotlinx.collections.immutable.toImmutableList import org.readium.r2.navigator.preferences.FontFamily import org.readium.r2.shared.ExperimentalReadiumApi import org.readium.r2.shared.util.Either @@ -214,29 +215,3 @@ public enum class FontWeight(public val value: Int) { EXTRA_BOLD(800), BLACK(900), } - -/** - * Typeface for a publication's text. - * - * For a list of vetted font families, see https://readium.org/readium-css/docs/CSS10-libre_fonts. - */ -@ExperimentalReadiumApi -@JvmInline -@Serializable -public value class FontFamily(public val name: String) { - - public companion object { - // Generic font families - // See https://www.w3.org/TR/css-fonts-4/#generic-font-families - public val SERIF: FontFamily = FontFamily("serif") - public val SANS_SERIF: FontFamily = FontFamily("sans-serif") - public val CURSIVE: FontFamily = FontFamily("cursive") - public val FANTASY: FontFamily = FontFamily("fantasy") - public val MONOSPACE: FontFamily = FontFamily("monospace") - - // Accessibility fonts embedded with Readium - public val ACCESSIBLE_DFA: FontFamily = FontFamily("AccessibleDfA") - public val IA_WRITER_DUOSPACE: FontFamily = FontFamily("IA Writer Duospace") - public val OPEN_DYSLEXIC: FontFamily = FontFamily("OpenDyslexic") - } -} diff --git a/readium/navigators/web/fixedlayout/build.gradle.kts b/readium/navigators/web/fixedlayout/build.gradle.kts index f08a020f87..93d9142de3 100644 --- a/readium/navigators/web/fixedlayout/build.gradle.kts +++ b/readium/navigators/web/fixedlayout/build.gradle.kts @@ -25,11 +25,9 @@ dependencies { api(project(":readium:navigators:web:readium-navigator-web-common")) implementation(project(":readium:navigators:web:readium-navigator-web-internals")) - implementation(libs.kotlinx.serialization.json) - implementation(libs.kotlinx.collections.immutable) - implementation(libs.bundles.compose) + api(libs.androidx.compose.foundation) + implementation(libs.timber) - implementation(libs.kotlinx.coroutines.android) implementation(libs.androidx.webkit) implementation(libs.jsoup) } diff --git a/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/FixedWebLocations.kt b/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/FixedWebLocations.kt index 34f7f1d2c2..2d0bd5c5cd 100644 --- a/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/FixedWebLocations.kt +++ b/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/FixedWebLocations.kt @@ -15,6 +15,9 @@ import org.readium.navigator.common.DecorationLocation import org.readium.navigator.common.ExportableLocation import org.readium.navigator.common.GoLocation import org.readium.navigator.common.Location +import org.readium.navigator.common.Position +import org.readium.navigator.common.PositionLocation +import org.readium.navigator.common.Progression import org.readium.navigator.common.SelectionLocation import org.readium.navigator.common.TextQuote import org.readium.navigator.common.TextQuoteLocation @@ -87,26 +90,32 @@ public sealed interface FixedWebDecorationLocation : DecorationLocation { internal data class FixedWebDecorationCssSelectorLocation( override val href: Url, - val cssSelector: CssSelector, -) : FixedWebDecorationLocation + override val cssSelector: CssSelector, +) : FixedWebDecorationLocation, CssSelectorLocation internal data class FixedWebDecorationTextQuoteLocation( override val href: Url, - val textQuote: TextQuote, + override val textQuote: TextQuote, val cssSelector: CssSelector?, -) : FixedWebDecorationLocation +) : FixedWebDecorationLocation, TextQuoteLocation @ExperimentalReadiumApi @ConsistentCopyVisibility public data class FixedWebLocation internal constructor( override val href: Url, + override val position: Position, + val totalProgression: Progression, private val mediaType: MediaType?, -) : ExportableLocation { +) : ExportableLocation, PositionLocation { override fun toLocator(): Locator = Locator( href = href, - mediaType = mediaType ?: MediaType.XHTML + mediaType = mediaType ?: MediaType.XHTML, + locations = Locator.Locations( + position = position.value, + totalProgression = totalProgression.value + ) ) } diff --git a/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/FixedWebRendition.kt b/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/FixedWebRendition.kt index be3842e71e..b7e173d34b 100644 --- a/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/FixedWebRendition.kt +++ b/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/FixedWebRendition.kt @@ -4,6 +4,8 @@ * available in the top-level LICENSE file of the project. */ +@file:OptIn(ExperimentalReadiumApi::class) + package org.readium.navigator.web.fixedlayout import android.annotation.SuppressLint @@ -13,7 +15,7 @@ import androidx.compose.foundation.layout.BoxWithConstraints import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.displayCutout import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.material3.MaterialTheme +import androidx.compose.foundation.pager.PagerState import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.LaunchedEffect @@ -34,11 +36,14 @@ import kotlinx.coroutines.launch import org.readium.navigator.common.DecorationListener import org.readium.navigator.common.HyperlinkListener import org.readium.navigator.common.InputListener +import org.readium.navigator.common.Position +import org.readium.navigator.common.Progression import org.readium.navigator.common.TapContext import org.readium.navigator.common.defaultDecorationListener import org.readium.navigator.common.defaultHyperlinkListener import org.readium.navigator.common.defaultInputListener import org.readium.navigator.web.fixedlayout.layout.DoubleViewportSpread +import org.readium.navigator.web.fixedlayout.layout.Layout import org.readium.navigator.web.fixedlayout.layout.SingleViewportSpread import org.readium.navigator.web.fixedlayout.spread.DoubleSpreadState import org.readium.navigator.web.fixedlayout.spread.DoubleViewportSpread @@ -53,9 +58,9 @@ import org.readium.navigator.web.internals.pager.RenditionPager import org.readium.navigator.web.internals.pager.RenditionScrollState import org.readium.navigator.web.internals.pager.pagingFlingBehavior import org.readium.navigator.web.internals.server.WebViewServer -import org.readium.navigator.web.internals.util.AbsolutePaddingValues import org.readium.navigator.web.internals.util.DisplayArea import org.readium.navigator.web.internals.util.HyperlinkProcessor +import org.readium.navigator.web.internals.util.asAbsolutePaddingValues import org.readium.navigator.web.internals.util.toLayoutDirection import org.readium.r2.shared.ExperimentalReadiumApi import org.readium.r2.shared.util.AbsoluteUrl @@ -73,132 +78,113 @@ import org.readium.r2.shared.util.Url public fun FixedWebRendition( state: FixedWebRenditionState, modifier: Modifier = Modifier, + backgroundColor: Color = Color.White, windowInsets: WindowInsets = WindowInsets.displayCutout, - backgroundColor: Color = MaterialTheme.colorScheme.background, inputListener: InputListener = defaultInputListener(state.controller), - hyperlinkListener: HyperlinkListener = defaultHyperlinkListener(controller = state.controller), + hyperlinkListener: HyperlinkListener = defaultHyperlinkListener(state.controller), decorationListener: DecorationListener = defaultDecorationListener(state.controller), textSelectionActionModeCallback: ActionMode.Callback? = null, ) { - val layoutDirection = - state.layoutDelegate.overflow.value.readingProgression.toLayoutDirection() + BoxWithConstraints( + modifier = modifier.fillMaxSize(), + propagateMinConstraints = true + ) { + val density = LocalDensity.current - CompositionLocalProvider(LocalLayoutDirection provides layoutDirection) { - BoxWithConstraints( - modifier = modifier.fillMaxSize(), - propagateMinConstraints = true - ) { - val viewportSize = rememberUpdatedState(DpSize(maxWidth, maxHeight)) + val coroutineScope = rememberCoroutineScope() - val safeDrawingPadding = windowInsets.asAbsolutePaddingValues() + val pagerStateNow = state.pagerState.value - val displayArea = - rememberUpdatedState(DisplayArea(viewportSize.value, safeDrawingPadding)) + val layoutNow = state.layoutDelegate.layout.value - fun currentLocation(): FixedWebLocation { - val spreadIndex = state.pagerState.currentPage - val itemIndex = state.layoutDelegate.layout.value.pageIndexForSpread(spreadIndex) - val href = state.publication.readingOrder[itemIndex].href - val mediaType = state.publication.readingOrder[itemIndex].mediaType + val selectionDelegateNow = state.selectionDelegate - return FixedWebLocation(href, mediaType) - } + val layoutDirectionNow = + state.layoutDelegate.overflow.value.readingProgression.toLayoutDirection() - if (state.controller == null) { - state.initController(location = currentLocation()) - } + val displayArea = rememberUpdatedState( + DisplayArea( + viewportSize = DpSize(maxWidth, maxHeight), + safeDrawingPadding = windowInsets.asAbsolutePaddingValues() + ) + ) - LaunchedEffect(state) { - snapshotFlow { - state.pagerState.currentPage - }.onEach { - state.navigationDelegate.updateLocation(currentLocation()) - }.launchIn(this) - } - - val coroutineScope = rememberCoroutineScope() - - val inputListenerState = rememberUpdatedState(inputListener) + val inputListenerState = rememberUpdatedState(inputListener) - val hyperlinkListenerState = rememberUpdatedState(hyperlinkListener) + val hyperlinkListenerState = rememberUpdatedState(hyperlinkListener) - val decorationListenerState = rememberUpdatedState(decorationListener) + val decorationListenerState = rememberUpdatedState(decorationListener) - val density = LocalDensity.current + CompositionLocalProvider(LocalLayoutDirection provides layoutDirectionNow) { + if (state.controller == null) { + val currentLocation = currentLocation(layoutNow, pagerStateNow, state.publication) + state.initController(location = currentLocation) + } - val scrollStates = remember(state, state.layoutDelegate.layout.value) { - state.layoutDelegate.layout.value.spreads - .map { SpreadScrollState() } + val scrollStates: List = remember(layoutNow) { + layoutNow.spreads.map { SpreadScrollState() } } val flingBehavior = run { - val pagingLayoutInfo = remember(state, scrollStates, layoutDirection) { + val pagingLayoutInfo = remember(density, pagerStateNow, scrollStates, layoutDirectionNow) { FixedPagingLayoutInfo( - pagerState = state.pagerState, + pagerState = pagerStateNow, pageStates = scrollStates, orientation = Orientation.Horizontal, - direction = layoutDirection, + direction = layoutDirectionNow, density = density ) } pagingFlingBehavior(pagingLayoutInfo) }.toFling2DBehavior(Orientation.Horizontal) - val scrollDispatcher = remember(state, scrollStates) { + val scrollDispatcher = remember(state, pagerStateNow, scrollStates) { RenditionScrollState( - pagerState = state.pagerState, + pagerState = pagerStateNow, pageStates = scrollStates, overflow = state.layoutDelegate.overflow ) } - LaunchedEffect(state.layoutDelegate.layout.value, state.controller) { - state.controller?.let { - val currentHref = it.location.href - val spreadIndex = checkNotNull( - state.layoutDelegate.layout.value.spreadIndexForHref(currentHref) - ) - state.pagerState.requestScrollToPage(spreadIndex) - } - } - val spreadFlingBehavior = Scrollable2DDefaults.flingBehavior() - val spreadNestedScrollConnection = - remember(state.pagerState, scrollStates) { - SpreadNestedScrollConnection( - pagerState = state.pagerState, - resourceStates = scrollStates, - flingBehavior = spreadFlingBehavior - ) - } + val spreadNestedScrollConnection = remember(pagerStateNow, scrollStates) { + SpreadNestedScrollConnection( + pagerState = pagerStateNow, + resourceStates = scrollStates, + flingBehavior = spreadFlingBehavior + ) + } + + LaunchedEffect(pagerStateNow, layoutNow) { + snapshotFlow { + pagerStateNow.currentPage + }.onEach { + val currentLocation = currentLocation(layoutNow, pagerStateNow, state.publication) + state.navigationDelegate.updateLocation(currentLocation) + }.launchIn(this) + } RenditionPager( modifier = Modifier.nestedScroll(spreadNestedScrollConnection), - state = state.pagerState, + state = pagerStateNow, scrollState = scrollDispatcher, flingBehavior = flingBehavior, orientation = Orientation.Horizontal, beyondViewportPageCount = 2, - enableScroll = true, - key = { index -> - val readingProgression = state.layoutDelegate.layout.value.readingProgression - val spread = state.layoutDelegate.layout.value.spreads[index] - val pages = spread.pages.map { it.index } - val fit = state.layoutDelegate.fit.value - "$readingProgression $spread $pages $fit" - }, + enableScroll = true ) { index -> val initialProgression = when { - index < state.pagerState.currentPage -> 1.0 + index < pagerStateNow.currentPage -> 1.0 else -> 0.0 } - val spread = state.layoutDelegate.layout.value.spreads[index] + val spread = layoutNow.spreads[index] val decorations = state.decorationDelegate.decorations - .mapValues { it.value.filter { it.location.href in spread.pages.map { it.href } } } - .toImmutableMap() + .mapValues { groupDecorations -> + groupDecorations.value.filter { spread.contains(it.location.href) } + }.toImmutableMap() when (spread) { is SingleViewportSpread -> { @@ -206,7 +192,7 @@ public fun FixedWebRendition( SingleSpreadState( index = index, htmlData = state.preloadedData.fixedSingleContent, - publicationBaseUrl = WebViewServer.Companion.publicationBaseHref, + publicationBaseUrl = WebViewServer.publicationBaseHref, webViewClient = state.webViewClient, spread = spread, fit = state.layoutDelegate.fit, @@ -214,13 +200,13 @@ public fun FixedWebRendition( ) SingleViewportSpread( - pagerState = state.pagerState, + pagerState = pagerStateNow, progression = initialProgression, - layoutDirection = layoutDirection, + layoutDirection = layoutDirectionNow, onTap = { inputListenerState.value.onTap( it, - TapContext(viewportSize.value) + TapContext(displayArea.value.viewportSize) ) }, onLinkActivated = { url, outerHtml -> @@ -234,7 +220,7 @@ public fun FixedWebRendition( } }, actionModeCallback = textSelectionActionModeCallback, - onSelectionApiChanged = { state.selectionDelegate.selectionApis[index] = it }, + onSelectionApiChanged = { selectionDelegateNow.selectionApis[index] = it }, state = spreadState, scrollState = scrollStates[index], backgroundColor = backgroundColor, @@ -251,7 +237,7 @@ public fun FixedWebRendition( DoubleSpreadState( index = index, htmlData = state.preloadedData.fixedDoubleContent, - publicationBaseUrl = WebViewServer.Companion.publicationBaseHref, + publicationBaseUrl = WebViewServer.publicationBaseHref, webViewClient = state.webViewClient, spread = spread, fit = state.layoutDelegate.fit, @@ -259,13 +245,13 @@ public fun FixedWebRendition( ) DoubleViewportSpread( - pagerState = state.pagerState, + pagerState = pagerStateNow, progression = initialProgression, - layoutDirection = layoutDirection, + layoutDirection = layoutDirectionNow, onTap = { inputListenerState.value.onTap( it, - TapContext(viewportSize.value) + TapContext(displayArea.value.viewportSize) ) }, onLinkActivated = { url, outerHtml -> @@ -279,7 +265,7 @@ public fun FixedWebRendition( } }, actionModeCallback = textSelectionActionModeCallback, - onSelectionApiChanged = { state.selectionDelegate.selectionApis[index] = it }, + onSelectionApiChanged = { selectionDelegateNow.selectionApis[index] = it }, state = spreadState, scrollState = scrollStates[index], backgroundColor = backgroundColor, @@ -296,18 +282,20 @@ public fun FixedWebRendition( } } -@Composable -private fun WindowInsets.asAbsolutePaddingValues(): AbsolutePaddingValues { - val density = LocalDensity.current - val layoutDirection = LocalLayoutDirection.current - val top = with(density) { getTop(density).toDp() } - val right = with(density) { getRight(density, layoutDirection).toDp() } - val bottom = with(density) { getBottom(density).toDp() } - val left = with(density) { getLeft(density, layoutDirection).toDp() } - return AbsolutePaddingValues(top = top, right = right, bottom = bottom, left = left) +private fun currentLocation( + layout: Layout, + pagerState: PagerState, + publication: FixedWebPublication, +): FixedWebLocation { + val currentSpreadIndex = pagerState.currentPage + val itemIndex = layout.pageIndexForSpread(currentSpreadIndex) + val href = publication.readingOrder[itemIndex].href + val mediaType = publication.readingOrder[itemIndex].mediaType + val position = Position(itemIndex + 1)!! + val totalProgression = Progression(currentSpreadIndex / layout.spreads.size.toDouble())!! + return FixedWebLocation(href, position, totalProgression, mediaType) } -@OptIn(ExperimentalReadiumApi::class) private suspend fun HyperlinkProcessor.onLinkActivated( url: Url, outerHtml: String, diff --git a/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/FixedWebRenditionFactory.kt b/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/FixedWebRenditionFactory.kt index 3ecfffc2c3..30e45697b0 100644 --- a/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/FixedWebRenditionFactory.kt +++ b/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/FixedWebRenditionFactory.kt @@ -24,6 +24,7 @@ import org.readium.r2.shared.publication.epub.EpubLayout import org.readium.r2.shared.publication.presentation.page import org.readium.r2.shared.publication.presentation.presentation import org.readium.r2.shared.publication.services.isProtected +import org.readium.r2.shared.publication.services.isRestricted import org.readium.r2.shared.util.ThrowableError import org.readium.r2.shared.util.Try import org.readium.r2.shared.util.getOrElse @@ -59,6 +60,10 @@ public class FixedWebRenditionFactory private constructor( return null } + if (publication.isRestricted) { + return null + } + return FixedWebRenditionFactory( application, publication, diff --git a/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/FixedWebRenditionState.kt b/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/FixedWebRenditionState.kt index 2649e56f9c..aa78ccb9ae 100644 --- a/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/FixedWebRenditionState.kt +++ b/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/FixedWebRenditionState.kt @@ -9,6 +9,8 @@ package org.readium.navigator.web.fixedlayout import android.app.Application +import androidx.compose.foundation.MutatePriority +import androidx.compose.foundation.MutatorMutex import androidx.compose.foundation.pager.PagerState import androidx.compose.runtime.MutableState import androidx.compose.runtime.Stable @@ -18,16 +20,12 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateMapOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.setValue +import androidx.compose.runtime.snapshots.Snapshot import androidx.compose.runtime.snapshots.SnapshotStateMap -import kotlin.coroutines.coroutineContext import kotlinx.collections.immutable.PersistentList import kotlinx.collections.immutable.PersistentMap import kotlinx.collections.immutable.persistentMapOf -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.SupervisorJob -import kotlinx.coroutines.async -import kotlinx.coroutines.awaitAll -import org.readium.navigator.common.Decoration +import kotlinx.coroutines.coroutineScope import org.readium.navigator.common.DecorationController import org.readium.navigator.common.NavigationController import org.readium.navigator.common.Overflow @@ -51,6 +49,9 @@ import org.readium.navigator.web.internals.server.WebViewClient import org.readium.navigator.web.internals.server.WebViewServer import org.readium.navigator.web.internals.server.WebViewServer.Companion.assetsBaseHref import org.readium.navigator.web.internals.util.HyperlinkProcessor +import org.readium.navigator.web.internals.util.MutableRef +import org.readium.navigator.web.internals.util.getValue +import org.readium.navigator.web.internals.util.setValue import org.readium.navigator.web.internals.webapi.Decoration as WebApiDecoration import org.readium.navigator.web.internals.webapi.FixedDoubleSelectionApi import org.readium.navigator.web.internals.webapi.FixedSelectionApi @@ -95,26 +96,49 @@ public class FixedWebRenditionState internal constructor( initialSettings ) - private val initialSpread = layoutDelegate.layout.value - .spreadIndexForHref(initialLocation.href) - ?: 0 - - internal val pagerState: PagerState = - PagerState( - currentPage = initialSpread, - pageCount = { layoutDelegate.layout.value.spreads.size } - ) + /* + * We need to get a fresh pagerState when the layout changes because of pagerState.pageCount. + * Let's assume we don't. + * After a state change affecting both (a layout change), pager items can be laid out again + * at the same time as the pager parent is recomposed. In that case, it's using stale values + * from previous composition. So when we get currentPage, we have no idea if it's referring to + * the old layout or the up to date one. + */ + internal val pagerState: State = run { + var holder by MutableRef?>(null) + + derivedStateOf { + val oldLayoutAndPagerState = holder + val newLayout = layoutDelegate.layout.value + val newCurrentSpread = if (oldLayoutAndPagerState == null) { + newLayout.spreadIndexForHref(initialLocation.href) ?: 0 + } else { + val oldCurrentSpread = Snapshot.withoutReadObservation { oldLayoutAndPagerState.second.currentPage } + val currentPages = oldLayoutAndPagerState.first.spreads[oldCurrentSpread].pages + val currentHref = currentPages.first().href + newLayout.spreadIndexForHref(currentHref)!! + } + val newPagerState = PagerState( + currentPage = newCurrentSpread, + pageCount = { newLayout.spreads.size } + ) + holder = newLayout to newPagerState + newPagerState + } + } - internal val selectionDelegate: FixedSelectionDelegate = - FixedSelectionDelegate( - pagerState = pagerState, - layout = layoutDelegate.layout - ) + internal val selectionDelegate: FixedSelectionDelegate by + derivedStateOf { + FixedSelectionDelegate( + pagerState.value, + layoutDelegate.layout.value + ) + } internal val decorationDelegate: FixedDecorationDelegate = FixedDecorationDelegate(configuration.decorationTemplates) - internal val hyperlinkProcessor = + internal val hyperlinkProcessor: HyperlinkProcessor = HyperlinkProcessor(publication.container) private val webViewServer = run { @@ -201,21 +225,25 @@ internal class FixedLayoutDelegate( } val layout: State = derivedStateOf { - val spreads = layoutResolver.layout(settings) - Layout(settings.readingProgression, spreads) + val newSpreads = layoutResolver.layout(settings) + Layout(settings.readingProgression, newSpreads) } - val fit: State = - derivedStateOf { settings.fit } + val fit: State = derivedStateOf { + settings.fit + } } internal class FixedNavigationDelegate( - private val pagerState: PagerState, + private val pagerState: State, private val layout: State, overflowState: State, initialLocation: FixedWebLocation, ) : NavigationController, OverflowController { + private val navigationMutex: MutatorMutex = + MutatorMutex() + private val locationMutable: MutableState = mutableStateOf(initialLocation) @@ -231,8 +259,19 @@ internal class FixedNavigationDelegate( } override suspend fun goTo(location: FixedWebGoLocation) { - val spreadIndex = layout.value.spreadIndexForHref(location.href) ?: return - pagerState.scrollToPage(spreadIndex) + coroutineScope { + navigationMutex.mutateWith( + receiver = this, + priority = MutatePriority.UserInput + ) { + val pagerStateNow = pagerState.value + + val spreadIndex = layout.value.spreadIndexForHref(location.href) + ?: return@mutateWith + + pagerStateNow.scrollToPage(spreadIndex) + } + } } override suspend fun goTo(location: FixedWebLocation) { @@ -240,20 +279,32 @@ internal class FixedNavigationDelegate( } override val canMoveForward: Boolean - get() = pagerState.currentPage < layout.value.spreads.size - 1 + get() = pagerState.value.currentPage < layout.value.spreads.size - 1 override val canMoveBackward: Boolean - get() = pagerState.currentPage > 0 + get() = pagerState.value.currentPage > 0 override suspend fun moveForward() { - if (canMoveForward) { - pagerState.scrollToPage(pagerState.currentPage + 1) + coroutineScope { + navigationMutex.tryMutate { + val pagerStateNow = pagerState.value + + if (canMoveForward) { + pagerStateNow.scrollToPage(pagerStateNow.currentPage + 1) + } + } } } override suspend fun moveBackward() { - if (canMoveBackward) { - pagerState.scrollToPage(pagerState.currentPage - 1) + coroutineScope { + navigationMutex.tryMutate { + val pagerStateNow = pagerState.value + + if (canMoveBackward) { + pagerStateNow.scrollToPage(pagerStateNow.currentPage - 1) + } + } } } } @@ -263,29 +314,23 @@ internal class FixedDecorationDelegate( ) : DecorationController { override var decorations: PersistentMap> by - mutableStateOf(persistentMapOf>>()) + mutableStateOf(persistentMapOf()) } internal class FixedSelectionDelegate( private val pagerState: PagerState, - private val layout: State, + private val layout: Layout, ) : SelectionController { val selectionApis: SnapshotStateMap = mutableStateMapOf() override suspend fun currentSelection(): Selection? { - val visiblePages = pagerState.layoutInfo.visiblePagesInfo.map { it.index } - val coroutineScope = CoroutineScope(coroutineContext + SupervisorJob()) - val (page, selection) = visiblePages - .mapNotNull { index -> selectionApis[index]?.let { index to it } } - .map { (index, api) -> - coroutineScope.async { - api.getCurrentSelection(index, layout.value) - } - }.awaitAll() - .filterNotNull() - .firstOrNull() + val currentSpreadNow = pagerState.currentPage + + // FIXME: resume coroutines when we get a new instance. Maybe in Resource composable. + val (page, selection) = selectionApis[currentSpreadNow] + ?.getCurrentSelection(currentSpreadNow, layout) ?: return null return Selection( diff --git a/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/spread/DoubleViewportSpread.kt b/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/spread/DoubleViewportSpread.kt index ddbebf1797..2b35585224 100644 --- a/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/spread/DoubleViewportSpread.kt +++ b/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/spread/DoubleViewportSpread.kt @@ -154,9 +154,13 @@ internal fun DoubleViewportSpread( var lastDecorations = emptyMap>() snapshotFlow { decorations.value } .onEach { - for ((group, decos) in it.entries) { - val lastInGroup = lastDecorations[group].orEmpty() - for ((href, changes) in lastInGroup.changesByHref(decos)) { + val oldAndUpdatedGroups = it.keys + lastDecorations.keys + for (group in oldAndUpdatedGroups) { + val updatedDecos = it[group].orEmpty() + val changesByHref = lastDecorations[group].orEmpty() + .changesByHref(updatedDecos) + + for ((href, changes) in changesByHref) { val iframe = when (href) { state.spread.leftPage?.href -> Iframe.Left state.spread.rightPage?.href -> Iframe.Right diff --git a/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/spread/SingleViewportSpread.kt b/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/spread/SingleViewportSpread.kt index 7dd51afe91..ef3f585fec 100644 --- a/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/spread/SingleViewportSpread.kt +++ b/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/spread/SingleViewportSpread.kt @@ -154,29 +154,33 @@ internal fun SingleViewportSpread( var lastDecorations = emptyMap>>() snapshotFlow { decorations.value } .onEach { - for ((group, decos) in it.entries) { - val lastInGroup = lastDecorations[group].orEmpty() - for ((_, changes) in lastInGroup.changesByHref(decos)) { - for (change in changes) { - when (change) { - is DecorationChange.Added -> { - val template = decorationTemplates[change.decoration.style::class] - ?: continue - - val webApiDecoration = change.decoration.toWebApiDecoration(template) - decorationApi.addDecoration(webApiDecoration, group) - } - is DecorationChange.Moved -> {} - is DecorationChange.Removed -> { - decorationApi.removeDecoration(change.id, group) - } - is DecorationChange.Updated -> { - decorationApi.removeDecoration(change.decoration.id, group) - val template = decorationTemplates[change.decoration.style::class] - ?: continue - val webApiDecoration = change.decoration.toWebApiDecoration(template) - decorationApi.addDecoration(webApiDecoration, group) - } + val oldAndUpdatedGroups = it.keys + lastDecorations.keys + for (group in oldAndUpdatedGroups) { + val updatedDecos = it[group].orEmpty() + val changes = lastDecorations[group].orEmpty() + .changesByHref(updatedDecos) + .values + .flatten() + + for (change in changes) { + when (change) { + is DecorationChange.Added -> { + val template = decorationTemplates[change.decoration.style::class] + ?: continue + + val webApiDecoration = change.decoration.toWebApiDecoration(template) + decorationApi.addDecoration(webApiDecoration, group) + } + is DecorationChange.Moved -> {} + is DecorationChange.Removed -> { + decorationApi.removeDecoration(change.id, group) + } + is DecorationChange.Updated -> { + decorationApi.removeDecoration(change.decoration.id, group) + val template = decorationTemplates[change.decoration.style::class] + ?: continue + val webApiDecoration = change.decoration.toWebApiDecoration(template) + decorationApi.addDecoration(webApiDecoration, group) } } } @@ -207,7 +211,7 @@ internal fun SingleViewportSpread( val decoration = decorations.value[group]?.firstOrNull { it.id.value == id } ?: return@SpreadWebView - val event = DecorationListener.OnActivatedEvent( + val event = DecorationListener.OnActivatedEvent( decoration = decoration, group = group, rect = rect, diff --git a/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/spread/SpreadWebView.kt b/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/spread/SpreadWebView.kt index 1b29c6643c..a8f86f2841 100644 --- a/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/spread/SpreadWebView.kt +++ b/readium/navigators/web/fixedlayout/src/main/kotlin/org/readium/navigator/web/fixedlayout/spread/SpreadWebView.kt @@ -120,6 +120,8 @@ internal fun SpreadWebView( state.webView?.setCustomSelectionActionModeCallback(actionModeCallback) } + state.webView?.setBackgroundColor(backgroundColor.toArgb()) + // Hide content before initial position is settled if (showPlaceholder) { Box( diff --git a/readium/navigators/web/internals/build.gradle.kts b/readium/navigators/web/internals/build.gradle.kts index d2617a0f9f..d8aa3f9d5d 100644 --- a/readium/navigators/web/internals/build.gradle.kts +++ b/readium/navigators/web/internals/build.gradle.kts @@ -24,10 +24,10 @@ dependencies { api(project(":readium:navigators:readium-navigator-common")) api(project(":readium:navigators:web:readium-navigator-web-common")) + api(libs.androidx.compose.foundation) + implementation(libs.kotlinx.serialization.json) - implementation(libs.bundles.compose) implementation(libs.timber) - implementation(libs.kotlinx.coroutines.android) implementation(libs.androidx.webkit) implementation(libs.jsoup) } diff --git a/readium/navigators/web/internals/scripts/package.json b/readium/navigators/web/internals/scripts/package.json index 618b1bc67b..5e162a9012 100644 --- a/readium/navigators/web/internals/scripts/package.json +++ b/readium/navigators/web/internals/scripts/package.json @@ -18,7 +18,7 @@ "devDependencies": { "@babel/core": "^7.23.0", "@babel/preset-env": "^7.22.20", - "@readium/css": "2.0.0-beta.13", + "@readium/css": "2.0.0-beta.24", "@types/string.prototype.matchall": "^4.0.4", "@typescript-eslint/eslint-plugin": "^8.3.0", "@typescript-eslint/parser": "^8.3.0", diff --git a/readium/navigators/web/internals/scripts/pnpm-lock.yaml b/readium/navigators/web/internals/scripts/pnpm-lock.yaml index 6c0d260386..8d1d8f1c00 100644 --- a/readium/navigators/web/internals/scripts/pnpm-lock.yaml +++ b/readium/navigators/web/internals/scripts/pnpm-lock.yaml @@ -22,7 +22,7 @@ dependencies: version: 4.0.10 ts-loader: specifier: ^9.5.1 - version: 9.5.1(typescript@5.8.3)(webpack@5.88.2) + version: 9.5.1(typescript@5.9.3)(webpack@5.88.2) devDependencies: '@babel/core': @@ -32,17 +32,17 @@ devDependencies: specifier: ^7.22.20 version: 7.22.20(@babel/core@7.23.0) '@readium/css': - specifier: 2.0.0-beta.13 - version: 2.0.0-beta.13 + specifier: 2.0.0-beta.24 + version: 2.0.0-beta.24 '@types/string.prototype.matchall': specifier: ^4.0.4 version: 4.0.4 '@typescript-eslint/eslint-plugin': specifier: ^8.3.0 - version: 8.3.0(@typescript-eslint/parser@8.3.0)(eslint@8.57.0)(typescript@5.8.3) + version: 8.3.0(@typescript-eslint/parser@8.3.0)(eslint@8.57.0)(typescript@5.9.3) '@typescript-eslint/parser': specifier: ^8.3.0 - version: 8.3.0(eslint@8.57.0)(typescript@5.8.3) + version: 8.3.0(eslint@8.57.0)(typescript@5.9.3) babel-loader: specifier: ^8.3.0 version: 8.3.0(@babel/core@7.23.0)(webpack@5.88.2) @@ -1556,8 +1556,8 @@ packages: fastq: 1.17.1 dev: true - /@readium/css@2.0.0-beta.13: - resolution: {integrity: sha512-45WweTkywrRmPiaKE0gCKOxyMJjCyNzv/FG4H31vxeOdmGpZXeoQSpK7jm5DGnrlCUHUPQzkLSwJtNJhXBY3AQ==} + /@readium/css@2.0.0-beta.24: + resolution: {integrity: sha512-vBI5Sw6JwlbTuDBvcD/ahJZqw2NGe1CDGQ7msAByc/491Q8V76baCkYIMFWyj5gPS1GS9oltlmIAWZAzxx3djg==} dev: true /@rollup/rollup-android-arm-eabi@4.20.0: @@ -1722,7 +1722,7 @@ packages: resolution: {integrity: sha512-E0KMS5FrWafbfKTGsoTZgrPHxBVknPeBxUTNwJima3t5KLdOlY285sisQC0mkVPTNNBc4nxza5ldly/ct+ISrQ==} dev: true - /@typescript-eslint/eslint-plugin@8.3.0(@typescript-eslint/parser@8.3.0)(eslint@8.57.0)(typescript@5.8.3): + /@typescript-eslint/eslint-plugin@8.3.0(@typescript-eslint/parser@8.3.0)(eslint@8.57.0)(typescript@5.9.3): resolution: {integrity: sha512-FLAIn63G5KH+adZosDYiutqkOkYEx0nvcwNNfJAf+c7Ae/H35qWwTYvPZUKFj5AS+WfHG/WJJfWnDnyNUlp8UA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: @@ -1734,22 +1734,22 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.11.0 - '@typescript-eslint/parser': 8.3.0(eslint@8.57.0)(typescript@5.8.3) + '@typescript-eslint/parser': 8.3.0(eslint@8.57.0)(typescript@5.9.3) '@typescript-eslint/scope-manager': 8.3.0 - '@typescript-eslint/type-utils': 8.3.0(eslint@8.57.0)(typescript@5.8.3) - '@typescript-eslint/utils': 8.3.0(eslint@8.57.0)(typescript@5.8.3) + '@typescript-eslint/type-utils': 8.3.0(eslint@8.57.0)(typescript@5.9.3) + '@typescript-eslint/utils': 8.3.0(eslint@8.57.0)(typescript@5.9.3) '@typescript-eslint/visitor-keys': 8.3.0 eslint: 8.57.0 graphemer: 1.4.0 ignore: 5.3.2 natural-compare: 1.4.0 - ts-api-utils: 1.3.0(typescript@5.8.3) - typescript: 5.8.3 + ts-api-utils: 1.3.0(typescript@5.9.3) + typescript: 5.9.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser@8.3.0(eslint@8.57.0)(typescript@5.8.3): + /@typescript-eslint/parser@8.3.0(eslint@8.57.0)(typescript@5.9.3): resolution: {integrity: sha512-h53RhVyLu6AtpUzVCYLPhZGL5jzTD9fZL+SYf/+hYOx2bDkyQXztXSc4tbvKYHzfMXExMLiL9CWqJmVz6+78IQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: @@ -1761,11 +1761,11 @@ packages: dependencies: '@typescript-eslint/scope-manager': 8.3.0 '@typescript-eslint/types': 8.3.0 - '@typescript-eslint/typescript-estree': 8.3.0(typescript@5.8.3) + '@typescript-eslint/typescript-estree': 8.3.0(typescript@5.9.3) '@typescript-eslint/visitor-keys': 8.3.0 debug: 4.3.4 eslint: 8.57.0 - typescript: 5.8.3 + typescript: 5.9.3 transitivePeerDependencies: - supports-color dev: true @@ -1778,7 +1778,7 @@ packages: '@typescript-eslint/visitor-keys': 8.3.0 dev: true - /@typescript-eslint/type-utils@8.3.0(eslint@8.57.0)(typescript@5.8.3): + /@typescript-eslint/type-utils@8.3.0(eslint@8.57.0)(typescript@5.9.3): resolution: {integrity: sha512-wrV6qh//nLbfXZQoj32EXKmwHf4b7L+xXLrP3FZ0GOUU72gSvLjeWUl5J5Ue5IwRxIV1TfF73j/eaBapxx99Lg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: @@ -1787,11 +1787,11 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 8.3.0(typescript@5.8.3) - '@typescript-eslint/utils': 8.3.0(eslint@8.57.0)(typescript@5.8.3) + '@typescript-eslint/typescript-estree': 8.3.0(typescript@5.9.3) + '@typescript-eslint/utils': 8.3.0(eslint@8.57.0)(typescript@5.9.3) debug: 4.3.4 - ts-api-utils: 1.3.0(typescript@5.8.3) - typescript: 5.8.3 + ts-api-utils: 1.3.0(typescript@5.9.3) + typescript: 5.9.3 transitivePeerDependencies: - eslint - supports-color @@ -1802,7 +1802,7 @@ packages: engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} dev: true - /@typescript-eslint/typescript-estree@8.3.0(typescript@5.8.3): + /@typescript-eslint/typescript-estree@8.3.0(typescript@5.9.3): resolution: {integrity: sha512-Mq7FTHl0R36EmWlCJWojIC1qn/ZWo2YiWYc1XVtasJ7FIgjo0MVv9rZWXEE7IK2CGrtwe1dVOxWwqXUdNgfRCA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: @@ -1818,13 +1818,13 @@ packages: is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.6.3 - ts-api-utils: 1.3.0(typescript@5.8.3) - typescript: 5.8.3 + ts-api-utils: 1.3.0(typescript@5.9.3) + typescript: 5.9.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils@8.3.0(eslint@8.57.0)(typescript@5.8.3): + /@typescript-eslint/utils@8.3.0(eslint@8.57.0)(typescript@5.9.3): resolution: {integrity: sha512-F77WwqxIi/qGkIGOGXNBLV7nykwfjLsdauRB/DOFPdv6LTF3BHHkBpq81/b5iMPSF055oO2BiivDJV4ChvNtXA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: @@ -1833,7 +1833,7 @@ packages: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) '@typescript-eslint/scope-manager': 8.3.0 '@typescript-eslint/types': 8.3.0 - '@typescript-eslint/typescript-estree': 8.3.0(typescript@5.8.3) + '@typescript-eslint/typescript-estree': 8.3.0(typescript@5.9.3) eslint: 8.57.0 transitivePeerDependencies: - supports-color @@ -3772,16 +3772,16 @@ packages: dependencies: is-number: 7.0.0 - /ts-api-utils@1.3.0(typescript@5.8.3): + /ts-api-utils@1.3.0(typescript@5.9.3): resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} engines: {node: '>=16'} peerDependencies: typescript: '>=4.2.0' dependencies: - typescript: 5.8.3 + typescript: 5.9.3 dev: true - /ts-loader@9.5.1(typescript@5.8.3)(webpack@5.88.2): + /ts-loader@9.5.1(typescript@5.9.3)(webpack@5.88.2): resolution: {integrity: sha512-rNH3sK9kGZcH9dYzC7CewQm4NtxJTjSEVRJ2DyBZR7f8/wcta+iV44UPCXc5+nzDzivKtlzV6c9P4e+oFhDLYg==} engines: {node: '>=12.0.0'} peerDependencies: @@ -3793,7 +3793,7 @@ packages: micromatch: 4.0.7 semver: 7.5.4 source-map: 0.7.4 - typescript: 5.8.3 + typescript: 5.9.3 webpack: 5.88.2(webpack-cli@5.1.4) dev: false @@ -3847,8 +3847,8 @@ packages: is-typed-array: 1.1.12 dev: false - /typescript@5.8.3: - resolution: {integrity: sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==} + /typescript@5.9.3: + resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} engines: {node: '>=14.17'} hasBin: true diff --git a/readium/navigators/web/internals/scripts/src/bridge/all-listener-bridge.ts b/readium/navigators/web/internals/scripts/src/bridge/all-listener-bridge.ts index ec631838b3..c585345f11 100644 --- a/readium/navigators/web/internals/scripts/src/bridge/all-listener-bridge.ts +++ b/readium/navigators/web/internals/scripts/src/bridge/all-listener-bridge.ts @@ -1,8 +1,14 @@ import { DecorationActivatedEvent as OriginalDecorationActivated } from "../common/decoration" import { GesturesListener } from "../common/gestures" +import { SelectionListener } from "../common/selection" import { AreaManager } from "../fixed/area-manager" import { DecorationActivatedEvent, TapEvent } from "../fixed/events" +export interface SelectionListenerBridge { + onSelectionStart(): void + onSelectionEnd(): void +} + export interface GesturesBridge { onTap(event: string): void onLinkActivated(href: string, outerHtml: string): void @@ -19,11 +25,18 @@ export interface DocumentStateBridge { onDocumentResized: () => void } -export class ReflowableListenerAdapter implements GesturesListener { +export class ReflowableListenerAdapter + implements GesturesListener, SelectionListener +{ readonly gesturesBridge: GesturesBridge + readonly selectionListenerBridge: SelectionListenerBridge - constructor(gesturesBridge: GesturesBridge) { + constructor( + gesturesBridge: GesturesBridge, + selectionListenerBridge: SelectionListenerBridge + ) { this.gesturesBridge = gesturesBridge + this.selectionListenerBridge = selectionListenerBridge } onTap(event: MouseEvent) { @@ -56,6 +69,14 @@ export class ReflowableListenerAdapter implements GesturesListener { stringOffset ) } + + onSelectionStart(): void { + this.selectionListenerBridge.onSelectionStart() + } + + onSelectionEnd(): void { + this.selectionListenerBridge.onSelectionEnd() + } } export class FixedListenerAdapter implements AreaManager.Listener { diff --git a/readium/navigators/web/internals/scripts/src/bridge/all-selection-bridge.ts b/readium/navigators/web/internals/scripts/src/bridge/all-selection-bridge.ts index d590e9e3f6..403edfa523 100644 --- a/readium/navigators/web/internals/scripts/src/bridge/all-selection-bridge.ts +++ b/readium/navigators/web/internals/scripts/src/bridge/all-selection-bridge.ts @@ -25,18 +25,35 @@ export class ReflowableSelectionBridge { } export class FixedSingleSelectionBridge { + private readonly iframe: HTMLIFrameElement + private readonly wrapper: SelectionWrapperParentSide private readonly listener: FixedSingleSelectionBridge.Listener - constructor(listener: FixedSingleSelectionBridge.Listener) { + constructor( + iframe: HTMLIFrameElement, + listener: FixedSingleSelectionBridge.Listener + ) { + this.iframe = iframe this.listener = listener const wrapperListener = { onSelectionAvailable: ( requestId: string, selection: Selection | null ) => { - const selectionAsJson = JSON.stringify(selection) + let adjustedSelection + + if (selection) { + adjustedSelection = selectionToParentCoordinates( + selection, + this.iframe + ) + } else { + adjustedSelection = selection + } + + const selectionAsJson = JSON.stringify(adjustedSelection) this.listener.onSelectionAvailable(requestId, selectionAsJson) }, } diff --git a/readium/navigators/web/internals/scripts/src/bridge/reflowable-initialization-bridge.ts b/readium/navigators/web/internals/scripts/src/bridge/reflowable-initialization-bridge.ts index 49651d7267..8c81806a5d 100644 --- a/readium/navigators/web/internals/scripts/src/bridge/reflowable-initialization-bridge.ts +++ b/readium/navigators/web/internals/scripts/src/bridge/reflowable-initialization-bridge.ts @@ -1,10 +1,11 @@ import { DecorationManager } from "../common/decoration" import { GesturesDetector } from "../common/gestures" -import { SelectionManager } from "../common/selection" +import { SelectionManager, SelectionReporter } from "../common/selection" import { ReflowableDecorationsBridge } from "./all-decoration-bridge" import { ReflowableListenerAdapter } from "./all-listener-bridge" import { ReflowableSelectionBridge } from "./all-selection-bridge" import { CssBridge } from "./reflowable-css-bridge" +import { ReflowableMoveBridge } from "./reflowable-move-bridge" export class ReflowableInitializationBridge { private readonly window: Window @@ -20,7 +21,13 @@ export class ReflowableInitializationBridge { } private initApis() { - const bridgeListener = new ReflowableListenerAdapter(window.gestures) + this.window.move = new ReflowableMoveBridge(this.window.document) + this.listener.onMoveApiAvailable() + + const bridgeListener = new ReflowableListenerAdapter( + window.gestures, + window.selectionListener + ) const decorationManager = new DecorationManager(window) @@ -40,6 +47,8 @@ export class ReflowableInitializationBridge { this.listener.onDecorationApiAvailable() new GesturesDetector(window, bridgeListener, decorationManager) + + new SelectionReporter(window, bridgeListener) } // Setups the `viewport` meta tag to disable overview. @@ -58,6 +67,7 @@ export class ReflowableInitializationBridge { export interface ReflowableApiStateListener { onCssApiAvailable(): void + onMoveApiAvailable(): void onSelectionApiAvailable(): void onDecorationApiAvailable(): void } diff --git a/readium/navigators/web/internals/scripts/src/bridge/reflowable-move-bridge.ts b/readium/navigators/web/internals/scripts/src/bridge/reflowable-move-bridge.ts new file mode 100644 index 0000000000..b1669d62ce --- /dev/null +++ b/readium/navigators/web/internals/scripts/src/bridge/reflowable-move-bridge.ts @@ -0,0 +1,107 @@ +import { TextQuoteAnchor } from "../vendor/hypothesis/annotator/anchoring/types" +import { log } from "../util/log" + +export class ReflowableMoveBridge { + readonly document: HTMLDocument + + constructor(document: HTMLDocument) { + this.document = document + } + + getOffsetForLocation(location: string, vertical: boolean): number | null { + const actualLocation = parseLocation(location) + + if (actualLocation.textAfter || actualLocation.textBefore) { + return this.getOffsetForTextAnchor( + actualLocation.textBefore ?? "", + actualLocation.textAfter ?? "", + vertical + ) + } + + if (actualLocation.cssSelector) { + return this.getOffsetForCssSelector(actualLocation.cssSelector, vertical) + } + + if (actualLocation.htmlId) { + return this.getOffsetForHtmlId(actualLocation.htmlId, vertical) + } + + return null + } + + private getOffsetForTextAnchor( + textBefore: string, + textAfter: string, + vertical: boolean + ): number | null { + const root = this.document.body + + const anchor = new TextQuoteAnchor(root, "", { + prefix: textBefore, + suffix: textAfter, + }) + + try { + const range = anchor.toRange() + return this.getOffsetForRect(range.getBoundingClientRect(), vertical) + } catch (e) { + log(e) + return null + } + } + + private getOffsetForCssSelector( + cssSelector: string, + vertical: boolean + ): number | null { + let element + try { + element = this.document.querySelector(cssSelector) + } catch (e) { + log(e) + } + + if (!element) { + return null + } + + return this.getOffsetForElement(element, vertical) + } + + private getOffsetForHtmlId(htmlId: string, vertical: boolean): number | null { + const element = this.document.getElementById(htmlId) + if (!element) { + return null + } + + return this.getOffsetForElement(element, vertical) + } + + private getOffsetForElement(element: Element, vertical: boolean): number { + const rect = element.getBoundingClientRect() + return this.getOffsetForRect(rect, vertical) + } + + private getOffsetForRect(rect: DOMRect, vertical: boolean): number { + if (vertical) { + return rect.top + window.scrollY + } else { + const offset = rect.left + window.scrollX + return offset + } + } +} + +interface Location { + progression: number + htmlId: string + cssSelector: string + textBefore: string + textAfter: string +} + +function parseLocation(location: string): Location { + const jsonLocation: Location = JSON.parse(location) + return jsonLocation +} diff --git a/readium/navigators/web/internals/scripts/src/common/decoration.ts b/readium/navigators/web/internals/scripts/src/common/decoration.ts index d89e7acd04..cfdbfabc96 100644 --- a/readium/navigators/web/internals/scripts/src/common/decoration.ts +++ b/readium/navigators/web/internals/scripts/src/common/decoration.ts @@ -194,6 +194,7 @@ class DecorationGroup { decoration.cssSelector, decoration.textQuote ) + log(`range ${range}`) if (!range) { log("Can't locate DOM range for decoration", decoration) return @@ -260,6 +261,7 @@ class DecorationGroup { * Layouts a single Decoration item. */ private layout(item: DecorationItem) { + log(`layout ${item}`) const groupContainer = this.requireContainer() const unsafeStyle = this.styles.get(item.decoration.style) @@ -509,7 +511,12 @@ export function rangeFromDecorationTarget( suffix: textQuote.textAfter, }) - return anchor.toRange() + try { + return anchor.toRange() + } catch (e) { + log(e) + return null + } } else { const range = document.createRange() range.setStartBefore(root) diff --git a/readium/navigators/web/internals/scripts/src/common/gestures.ts b/readium/navigators/web/internals/scripts/src/common/gestures.ts index 278cd15c28..e36595308d 100644 --- a/readium/navigators/web/internals/scripts/src/common/gestures.ts +++ b/readium/navigators/web/internals/scripts/src/common/gestures.ts @@ -36,14 +36,6 @@ export class GesturesDetector { return } - const selection = this.window.getSelection() - if (selection && selection.type == "Range") { - // There's an on-going selection, the tap will dismiss it so we don't forward it. - // selection.type might be None (collapsed) or Caret with a collapsed range - // when there is not true selection. - return - } - let nearestElement: Element | null if (event.target instanceof HTMLElement) { nearestElement = this.nearestInteractiveElement(event.target) @@ -60,9 +52,9 @@ export class GesturesDetector { event.stopPropagation() event.preventDefault() - } else { - return } + + return } let decorationActivatedEvent: DecorationActivatedEvent | null diff --git a/readium/navigators/web/internals/scripts/src/common/selection.ts b/readium/navigators/web/internals/scripts/src/common/selection.ts index 3bbecc7565..9a44b45c1f 100644 --- a/readium/navigators/web/internals/scripts/src/common/selection.ts +++ b/readium/navigators/web/internals/scripts/src/common/selection.ts @@ -19,6 +19,28 @@ export interface SelectionListener { onSelectionEnd(): void } +export class SelectionReporter { + private isSelecting = false + + constructor(window: Window, listener: SelectionListener) { + document.addEventListener( + "selectionchange", + // eslint-disable-next-line @typescript-eslint/no-unused-vars + (event) => { + const collapsed = window.getSelection()?.isCollapsed + if (collapsed && this.isSelecting) { + this.isSelecting = false + listener.onSelectionEnd() + } else if (!collapsed && !this.isSelecting) { + this.isSelecting = true + listener.onSelectionStart() + } + }, + false + ) + } +} + export interface Selection { selectedText: string textBefore: string diff --git a/readium/navigators/web/internals/scripts/src/index-fixed-single.ts b/readium/navigators/web/internals/scripts/src/index-fixed-single.ts index 8f2cd20258..be27e32ccd 100644 --- a/readium/navigators/web/internals/scripts/src/index-fixed-single.ts +++ b/readium/navigators/web/internals/scripts/src/index-fixed-single.ts @@ -50,6 +50,7 @@ window.singleArea = new FixedSingleAreaBridge( ) window.singleSelection = new FixedSingleSelectionBridge( + iframe, window.singleSelectionListener ) diff --git a/readium/navigators/web/internals/scripts/src/index-reflowable-injectable.ts b/readium/navigators/web/internals/scripts/src/index-reflowable-injectable.ts index 048a395ef2..0d57c82acf 100644 --- a/readium/navigators/web/internals/scripts/src/index-reflowable-injectable.ts +++ b/readium/navigators/web/internals/scripts/src/index-reflowable-injectable.ts @@ -9,10 +9,14 @@ */ import { ReflowableDecorationsBridge } from "./bridge/all-decoration-bridge" -import { GesturesBridge } from "./bridge/all-listener-bridge" +import { + GesturesBridge, + SelectionListenerBridge, +} from "./bridge/all-listener-bridge" import { DocumentStateBridge } from "./bridge/all-listener-bridge" import { ReflowableSelectionBridge } from "./bridge/all-selection-bridge" import { CssBridge } from "./bridge/reflowable-css-bridge" +import { ReflowableMoveBridge } from "./bridge/reflowable-move-bridge" import { ReflowableApiStateListener, ReflowableInitializationBridge as ReflowableInitializer, @@ -26,9 +30,11 @@ declare global { readiumcss: CssBridge decorations: ReflowableDecorationsBridge selection: ReflowableSelectionBridge + move: ReflowableMoveBridge // Native APIs available for web code documentState: DocumentStateBridge gestures: GesturesBridge + selectionListener: SelectionListenerBridge } } diff --git a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/fixed-double-script.js b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/fixed-double-script.js index 79e6561d0c..a0ab419f56 100644 --- a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/fixed-double-script.js +++ b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/fixed-double-script.js @@ -1,2 +1,2 @@ -!function(){var t={3099:function(t,e,r){"use strict";var n=r(2870),o=r(2755),i=o(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o(r):r}},2755:function(t,e,r){"use strict";var n=r(3569),o=r(2870),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||n.call(a,i),u=o("%Object.getOwnPropertyDescriptor%",!0),c=o("%Object.defineProperty%",!0),l=o("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var e=s(n,a,arguments);return u&&c&&u(e,"length").configurable&&c(e,"length",{value:1+l(0,t.length-(arguments.length-1))}),e};var f=function(){return s(n,i,arguments)};c?c(t.exports,"apply",{value:f}):t.exports.apply=f},6663:function(t,e,r){"use strict";var n=r(229)(),o=r(2870),i=n&&o("%Object.defineProperty%",!0),a=o("%SyntaxError%"),s=o("%TypeError%"),u=r(658);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new s("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new s("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new s("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!u&&u(t,e);if(i)i(t,e,{configurable:null===c&&f?f.configurable:!c,enumerable:null===n&&f?f.enumerable:!n,value:r,writable:null===o&&f?f.writable:!o});else{if(!l&&(n||o||c))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},9722:function(t,e,r){"use strict";var n=r(2051),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,s=r(6663),u=r(229)(),c=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;u?s(t,e,r,!0):s(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var s=0;s2&&arguments[2]&&arguments[2].force;!a||!r&&i(t,a)||(n?n(t,a,{configurable:!0,enumerable:!1,value:e,writable:!1}):t[a]=e)}},7358:function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(7959),i=r(3655),a=r(455),s=r(8760);t.exports=function(t){if(o(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!i(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):s(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var u=e.call(t,r);if(o(u))return u;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(a(t)||s(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,a,s="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a1&&"boolean"!=typeof e)throw new a('"allowMissing" argument must be a boolean');if(null===O(/^%?[^%]*%?$/,t))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=P(t,0,1),r=P(t,-1);if("%"===e&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return j(t,E,(function(t,e,r,o){n[n.length]=r?j(o,I,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=R("%"+n+"%",e),s=i.name,c=i.value,l=!1,f=i.alias;f&&(n=f[0],x(r,A([0,1],f)));for(var p=1,y=!0;p=r.length){var m=u(c,h);c=(y=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:c[h]}else y=S(c,h),c=c[h];y&&!l&&(d[s]=c)}}return c}},658:function(t,e,r){"use strict";var n=r(2870)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},229:function(t,e,r){"use strict";var n=r(2870)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},3413:function(t){"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},1143:function(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(9985);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},9985:function(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},3060:function(t,e,r){"use strict";var n=r(9985);t.exports=function(){return n()&&!!Symbol.toStringTag}},9545:function(t){"use strict";var e={}.hasOwnProperty,r=Function.prototype.call;t.exports=r.bind?r.bind(e):function(t,n){return r.call(e,t,n)}},7284:function(t,e,r){"use strict";var n=r(2870),o=r(9545),i=r(5714)(),a=n("%TypeError%"),s={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");if(i.assert(t),!s.has(t,e))throw new a("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");var r=i.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");var r=i.get(t);return!!r&&o(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");var n=i.get(t);n||(n={},i.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(s),t.exports=s},3655:function(t){"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},s=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},u=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;u.call(p)===u.call(document.all)&&(f=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=u.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&s(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(c)return s(t);if(a(t))return!1;var e=u.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&s(t)}},455:function(t,e,r){"use strict";var n=Date.prototype.getDay,o=Object.prototype.toString,i=r(3060)();t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},5494:function(t,e,r){"use strict";var n,o,i,a,s=r(3099),u=r(3060)();if(u){n=s("Object.prototype.hasOwnProperty"),o=s("RegExp.prototype.exec"),i={};var c=function(){throw i};a={toString:c,valueOf:c},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=c)}var l=s("Object.prototype.toString"),f=Object.getOwnPropertyDescriptor;t.exports=u?function(t){if(!t||"object"!=typeof t)return!1;var e=f(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{o(t,a)}catch(t){return t===i}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},8760:function(t,e,r){"use strict";var n=Object.prototype.toString;if(r(1143)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},4538:function(t,e,r){var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,u=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=s&&u&&"function"==typeof u.get?u.get:null,l=s&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,g=Object.prototype.toString,d=Function.prototype.toString,b=String.prototype.match,m=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,S=String.prototype.toLowerCase,A=RegExp.prototype.test,x=Array.prototype.concat,j=Array.prototype.join,P=Array.prototype.slice,O=Math.floor,E="function"==typeof BigInt?BigInt.prototype.valueOf:null,I=Object.getOwnPropertySymbols,R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,M="function"==typeof Symbol&&"object"==typeof Symbol.iterator,D="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,T=Object.prototype.propertyIsEnumerable,F=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function k(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||A.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-O(-t):O(t);if(n!==t){var o=String(n),i=m.call(e,o.length+1);return v.call(o,r,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var C=r(7002),W=C.custom,B=_(W)?W:null;function L(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function N(t){return v.call(String(t),/"/g,""")}function U(t){return!("[object Array]"!==q(t)||D&&"object"==typeof t&&D in t)}function $(t){return!("[object RegExp]"!==q(t)||D&&"object"==typeof t&&D in t)}function _(t){if(M)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!R)return!1;try{return R.call(t),!0}catch(t){}return!1}t.exports=function t(e,r,n,o){var s=r||{};if(G(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(G(s,"maxStringLength")&&("number"==typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!G(s,"customInspect")||s.customInspect;if("boolean"!=typeof u&&"symbol"!==u)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(G(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(G(s,"numericSeparator")&&"boolean"!=typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var g=s.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return H(e,s);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var w=String(e);return g?k(e,w):w}if("bigint"==typeof e){var A=String(e)+"n";return g?k(e,A):A}var O=void 0===s.depth?5:s.depth;if(void 0===n&&(n=0),n>=O&&O>0&&"object"==typeof e)return U(e)?"[Array]":"[Object]";var I,W=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=j.call(Array(t.indent+1)," ")}return{base:r,prev:j.call(Array(e+1),r)}}(s,n);if(void 0===o)o=[];else if(V(o,e)>=0)return"[Circular]";function z(e,r,i){if(r&&(o=P.call(o)).push(r),i){var a={depth:s.depth};return G(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),t(e,a,n+1,o)}return t(e,s,n+1,o)}if("function"==typeof e&&!$(e)){var J=function(t){if(t.name)return t.name;var e=b.call(d.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),tt=Z(e,z);return"[Function"+(J?": "+J:" (anonymous)")+"]"+(tt.length>0?" { "+j.call(tt,", ")+" }":"")}if(_(e)){var et=M?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):R.call(e);return"object"!=typeof e||M?et:K(et)}if((I=e)&&"object"==typeof I&&("undefined"!=typeof HTMLElement&&I instanceof HTMLElement||"string"==typeof I.nodeName&&"function"==typeof I.getAttribute)){for(var rt="<"+S.call(String(e.nodeName)),nt=e.attributes||[],ot=0;ot"}if(U(e)){if(0===e.length)return"[]";var it=Z(e,z);return W&&!function(t){for(var e=0;e=0)return!1;return!0}(it)?"["+Q(it,W)+"]":"[ "+j.call(it,", ")+" ]"}if(function(t){return!("[object Error]"!==q(t)||D&&"object"==typeof t&&D in t)}(e)){var at=Z(e,z);return"cause"in Error.prototype||!("cause"in e)||T.call(e,"cause")?0===at.length?"["+String(e)+"]":"{ ["+String(e)+"] "+j.call(at,", ")+" }":"{ ["+String(e)+"] "+j.call(x.call("[cause]: "+z(e.cause),at),", ")+" }"}if("object"==typeof e&&u){if(B&&"function"==typeof e[B]&&C)return C(e,{depth:O-n});if("symbol"!==u&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{c.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var st=[];return a&&a.call(e,(function(t,r){st.push(z(r,e,!0)+" => "+z(t,e))})),Y("Map",i.call(e),st,W)}if(function(t){if(!c||!t||"object"!=typeof t)return!1;try{c.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ut=[];return l&&l.call(e,(function(t){ut.push(z(t,e))})),Y("Set",c.call(e),ut,W)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return X("WeakMap");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return X("WeakSet");if(function(t){if(!y||!t||"object"!=typeof t)return!1;try{return y.call(t),!0}catch(t){}return!1}(e))return X("WeakRef");if(function(t){return!("[object Number]"!==q(t)||D&&"object"==typeof t&&D in t)}(e))return K(z(Number(e)));if(function(t){if(!t||"object"!=typeof t||!E)return!1;try{return E.call(t),!0}catch(t){}return!1}(e))return K(z(E.call(e)));if(function(t){return!("[object Boolean]"!==q(t)||D&&"object"==typeof t&&D in t)}(e))return K(h.call(e));if(function(t){return!("[object String]"!==q(t)||D&&"object"==typeof t&&D in t)}(e))return K(z(String(e)));if(!function(t){return!("[object Date]"!==q(t)||D&&"object"==typeof t&&D in t)}(e)&&!$(e)){var ct=Z(e,z),lt=F?F(e)===Object.prototype:e instanceof Object||e.constructor===Object,ft=e instanceof Object?"":"null prototype",pt=!lt&&D&&Object(e)===e&&D in e?m.call(q(e),8,-1):ft?"Object":"",yt=(lt||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(pt||ft?"["+j.call(x.call([],pt||[],ft||[]),": ")+"] ":"");return 0===ct.length?yt+"{}":W?yt+"{"+Q(ct,W)+"}":yt+"{ "+j.call(ct,", ")+" }"}return String(e)};var z=Object.prototype.hasOwnProperty||function(t){return t in this};function G(t,e){return z.call(t,e)}function q(t){return g.call(t)}function V(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return H(m.call(t,0,e.maxStringLength),e)+n}return L(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,J),"single",e)}function J(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function K(t){return"Object("+t+")"}function X(t){return t+" { ? }"}function Y(t,e,r,n){return t+" ("+e+") {"+(n?Q(r,n):j.call(r,", "))+"}"}function Q(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+j.call(t,","+r)+"\n"+e.prev}function Z(t,e){var r=U(t),n=[];if(r){n.length=t.length;for(var o=0;o0&&!o.call(t,0))for(var g=0;g0)for(var d=0;d=0&&"[object Function]"===e.call(t.callee)),n}},9766:function(t,e,r){"use strict";var n=r(8921),o=Object,i=TypeError;t.exports=n((function(){if(null!=this&&this!==o(this))throw new i("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t}),"get flags",!0)},483:function(t,e,r){"use strict";var n=r(9722),o=r(2755),i=r(9766),a=r(5113),s=r(7299),u=o(a());n(u,{getPolyfill:a,implementation:i,shim:s}),t.exports=u},5113:function(t,e,r){"use strict";var n=r(9766),o=r(9722).supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(o&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}},7299:function(t,e,r){"use strict";var n=r(9722).supportsDescriptors,o=r(5113),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,s=TypeError,u=Object.getPrototypeOf,c=/a/;t.exports=function(){if(!n||!u)throw new s("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=u(c),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},7582:function(t,e,r){"use strict";var n=r(3099),o=r(2870),i=r(5494),a=n("RegExp.prototype.exec"),s=o("%TypeError%");t.exports=function(t){if(!i(t))throw new s("`regex` must be a RegExp");return function(e){return null!==a(t,e)}}},8921:function(t,e,r){"use strict";var n=r(6663),o=r(229)(),i=r(5610).functionsHaveConfigurableNames(),a=TypeError;t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!i||(o?n(t,"name",e,!0,!0):n(t,"name",e)),t}},5714:function(t,e,r){"use strict";var n=r(2870),o=r(3099),i=r(4538),a=n("%TypeError%"),s=n("%WeakMap%",!0),u=n("%Map%",!0),c=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),y=o("Map.prototype.set",!0),h=o("Map.prototype.has",!0),g=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new a("Side channel does not contain "+i(t))},get:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(t)return c(t,n)}else if(u){if(e)return p(e,n)}else if(r)return function(t,e){var r=g(t,e);return r&&r.value}(r,n)},has:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(t)return f(t,n)}else if(u){if(e)return h(e,n)}else if(r)return function(t,e){return!!g(t,e)}(r,n);return!1},set:function(n,o){s&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new s),l(t,n,o)):u?(e||(e=new u),y(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=g(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n}},3073:function(t,e,r){"use strict";var n=r(7113),o=r(151),i=r(1959),a=r(9497),s=r(5128),u=r(6751),c=r(3099),l=r(1143)(),f=r(483),p=c("String.prototype.indexOf"),y=r(2009),h=function(t){var e=y();if(l&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===RegExp.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=u(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(u(r),p(s(r),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var i=h(t);if(void 0!==i)return n(i,t,[e])}var c=s(e),l=new RegExp(t,"g");return n(h(l),l,[c])}},5155:function(t,e,r){"use strict";var n=r(2755),o=r(9722),i=r(3073),a=r(1794),s=r(3911),u=n(i);o(u,{getPolyfill:a,implementation:i,shim:s}),t.exports=u},2009:function(t,e,r){"use strict";var n=r(1143)(),o=r(8012);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},1794:function(t,e,r){"use strict";var n=r(3073);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},8012:function(t,e,r){"use strict";var n=r(1398),o=r(151),i=r(8322),a=r(2449),s=r(3995),u=r(5128),c=r(1874),l=r(483),f=r(8921),p=r(3099)("String.prototype.indexOf"),y=RegExp,h="flags"in RegExp.prototype,g=f((function(t){var e=this;if("Object"!==c(e))throw new TypeError('"this" value must be an Object');var r=u(t),f=function(t,e){var r="flags"in e?o(e,"flags"):u(l(e));return{flags:r,matcher:new t(h&&"string"==typeof r?e:t===y?e.source:e,r)}}(a(e,y),e),g=f.flags,d=f.matcher,b=s(o(e,"lastIndex"));i(d,"lastIndex",b,!0);var m=p(g,"g")>-1,v=p(g,"u")>-1;return n(d,r,m,v)}),"[Symbol.matchAll]",!0);t.exports=g},3911:function(t,e,r){"use strict";var n=r(9722),o=r(1143)(),i=r(1794),a=r(2009),s=Object.defineProperty,u=Object.getOwnPropertyDescriptor;t.exports=function(){var t=i();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),o){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),s&&u){var r=u(Symbol,e);r&&!r.configurable||s(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var c=a(),l={};l[e]=c;var f={};f[e]=function(){return RegExp.prototype[e]!==c},n(RegExp.prototype,l,f)}return t}},8125:function(t,e,r){"use strict";var n=r(6751),o=r(5128),i=r(3099)("String.prototype.replace"),a=/^\s$/.test("᠎"),s=a?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,u=a?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=o(n(this));return i(i(t,s,""),u,"")}},9434:function(t,e,r){"use strict";var n=r(2755),o=r(9722),i=r(6751),a=r(8125),s=r(3228),u=r(818),c=n(s()),l=function(t){return i(t),c(t)};o(l,{getPolyfill:s,implementation:a,shim:u}),t.exports=l},3228:function(t,e,r){"use strict";var n=r(8125);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},818:function(t,e,r){"use strict";var n=r(9722),o=r(3228);t.exports=function(){var t=o();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},7002:function(){},1510:function(t,e,r){"use strict";var n=r(2870),o=r(6318),i=r(1874),a=r(2990),s=r(5674),u=n("%TypeError%");t.exports=function(t,e,r){if("String"!==i(t))throw new u("Assertion failed: `S` must be a String");if(!a(e)||e<0||e>s)throw new u("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==i(r))throw new u("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+o(t,e)["[[CodeUnitCount]]"]:e+1}},7113:function(t,e,r){"use strict";var n=r(2870),o=r(3099),i=n("%TypeError%"),a=r(6287),s=n("%Reflect.apply%",!0)||o("Function.prototype.apply");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!a(r))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return s(t,e,r)}},6318:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(3099),i=r(5541),a=r(959),s=r(1874),u=r(1751),c=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("String"!==s(t))throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var o=l(t,e),f=c(t,e),p=i(o),y=a(o);if(!p&&!y)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(y||e+1===r)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var h=l(t,e+1);return a(h)?{"[[CodePoint]]":u(o,h),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},5702:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(1874);t.exports=function(t,e){if("Boolean"!==o(e))throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},6782:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(2860),i=r(8357),a=r(3301),s=r(6284),u=r(8277),c=r(1874);t.exports=function(t,e,r){if("Object"!==c(t))throw new n("Assertion failed: Type(O) is not Object");if(!s(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return o(a,u,i,t,e,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0})}},1398:function(t,e,r){"use strict";var n=r(2870),o=r(1143)(),i=n("%TypeError%"),a=n("%IteratorPrototype%",!0),s=r(1510),u=r(5702),c=r(6782),l=r(151),f=r(5716),p=r(3500),y=r(8322),h=r(3995),g=r(5128),d=r(1874),b=r(7284),m=r(2263),v=function(t,e,r,n){if("String"!==d(e))throw new i("`S` must be a string");if("Boolean"!==d(r))throw new i("`global` must be a boolean");if("Boolean"!==d(n))throw new i("`fullUnicode` must be a boolean");b.set(this,"[[IteratingRegExp]]",t),b.set(this,"[[IteratedString]]",e),b.set(this,"[[Global]]",r),b.set(this,"[[Unicode]]",n),b.set(this,"[[Done]]",!1)};a&&(v.prototype=f(a)),c(v.prototype,"next",(function(){var t=this;if("Object"!==d(t))throw new i("receiver must be an object");if(!(t instanceof v&&b.has(t,"[[IteratingRegExp]]")&&b.has(t,"[[IteratedString]]")&&b.has(t,"[[Global]]")&&b.has(t,"[[Unicode]]")&&b.has(t,"[[Done]]")))throw new i('"this" value must be a RegExpStringIterator instance');if(b.get(t,"[[Done]]"))return u(void 0,!0);var e=b.get(t,"[[IteratingRegExp]]"),r=b.get(t,"[[IteratedString]]"),n=b.get(t,"[[Global]]"),o=b.get(t,"[[Unicode]]"),a=p(e,r);if(null===a)return b.set(t,"[[Done]]",!0),u(void 0,!0);if(n){if(""===g(l(a,"0"))){var c=h(l(e,"lastIndex")),f=s(r,c,o);y(e,"lastIndex",f,!0)}return u(a,!1)}return b.set(t,"[[Done]]",!0),u(a,!1)})),o&&(m(v.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof v.prototype[Symbol.iterator])&&c(v.prototype,Symbol.iterator,(function(){return this})),t.exports=function(t,e,r,n){return new v(t,e,r,n)}},3645:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(7999),i=r(2860),a=r(8357),s=r(8355),u=r(3301),c=r(6284),l=r(8277),f=r(7628),p=r(1874);t.exports=function(t,e,r){if("Object"!==p(t))throw new n("Assertion failed: Type(O) is not Object");if(!c(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var y=o({Type:p,IsDataDescriptor:u,IsAccessorDescriptor:s},r)?r:f(r);if(!o({Type:p,IsDataDescriptor:u,IsAccessorDescriptor:s},y))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return i(u,l,a,t,e,y)}},8357:function(t,e,r){"use strict";var n=r(1489),o=r(1598),i=r(1874);t.exports=function(t){return void 0!==t&&n(i,"Property Descriptor","Desc",t),o(t)}},151:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(4538),i=r(6284),a=r(1874);t.exports=function(t,e){if("Object"!==a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},1959:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(9374),i=r(7304),a=r(6284),s=r(4538);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var r=o(t,e);if(null!=r){if(!i(r))throw new n(s(e)+" is not a function: "+s(r));return r}}},9374:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(4538),i=r(6284);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},8355:function(t,e,r){"use strict";var n=r(9545),o=r(1874),i=r(1489);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Get]]")&&!n(t,"[[Set]]")))}},6287:function(t,e,r){"use strict";t.exports=r(2403)},7304:function(t,e,r){"use strict";t.exports=r(3655)},4791:function(t,e,r){"use strict";var n=r(6740)("%Reflect.construct%",!0),o=r(3645);try{o({},"",{"[[Get]]":function(){}})}catch(t){o=null}if(o&&n){var i={},a={};o(a,"length",{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,a)}catch(t){return t===i}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},3301:function(t,e,r){"use strict";var n=r(9545),o=r(1874),i=r(1489);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Value]]")&&!n(t,"[[Writable]]")))}},6284:function(t){"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},9497:function(t,e,r){"use strict";var n=r(2870)("%Symbol.match%",!0),o=r(5494),i=r(5695);t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(n){var e=t[n];if(void 0!==e)return i(e)}return o(t)}},5716:function(t,e,r){"use strict";var n=r(2870),o=n("%Object.create%",!0),i=n("%TypeError%"),a=n("%SyntaxError%"),s=r(6287),u=r(1874),c=r(7735),l=r(7284),f=r(3413)();t.exports=function(t){if(null!==t&&"Object"!==u(t))throw new i("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!s(r))throw new i("Assertion failed: `additionalInternalSlotsList` must be an Array");if(o)e=o(t);else if(f)e={__proto__:t};else{if(null===t)throw new a("native Object.create support is required to create null objects");var n=function(){};n.prototype=t,e=new n}return r.length>0&&c(r,(function(t){l.set(e,t,void 0)})),e}},3500:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(3099)("RegExp.prototype.exec"),i=r(7113),a=r(151),s=r(7304),u=r(1874);t.exports=function(t,e){if("Object"!==u(t))throw new n("Assertion failed: `R` must be an Object");if("String"!==u(e))throw new n("Assertion failed: `S` must be a String");var r=a(t,"exec");if(s(r)){var c=i(r,t,[e]);if(null===c||"Object"===u(c))return c;throw new n('"exec" method must return `null` or an Object')}return o(t,e)}},6751:function(t,e,r){"use strict";t.exports=r(9572)},8277:function(t,e,r){"use strict";var n=r(159);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},8322:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(6284),i=r(8277),a=r(1874),s=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,u){if("Object"!==a(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");if("Boolean"!==a(u))throw new n("Assertion failed: `Throw` must be a Boolean");if(u){if(t[e]=r,s&&!i(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!s||i(t[e],r)}catch(t){return!1}}},2449:function(t,e,r){"use strict";var n=r(2870),o=n("%Symbol.species%",!0),i=n("%TypeError%"),a=r(4791),s=r(1874);t.exports=function(t,e){if("Object"!==s(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==s(r))throw new i("O.constructor is not an Object");var n=o?r[o]:void 0;if(null==n)return e;if(a(n))return n;throw new i("no constructor found")}},6207:function(t,e,r){"use strict";var n=r(2870),o=n("%Number%"),i=n("%RegExp%"),a=n("%TypeError%"),s=n("%parseInt%"),u=r(3099),c=r(7582),l=u("String.prototype.slice"),f=c(/^0b[01]+$/i),p=c(/^0o[0-7]+$/i),y=c(/^[-+]0x[0-9a-f]+$/i),h=c(new i("["+["…","​","￾"].join("")+"]","g")),g=r(9434),d=r(1874);t.exports=function t(e){if("String"!==d(e))throw new a("Assertion failed: `argument` is not a String");if(f(e))return o(s(l(e,2),2));if(p(e))return o(s(l(e,2),8));if(h(e)||y(e))return NaN;var r=g(e);return r!==e?t(r):o(e)}},5695:function(t){"use strict";t.exports=function(t){return!!t}},1200:function(t,e,r){"use strict";var n=r(6542),o=r(5693),i=r(159),a=r(1117);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},3995:function(t,e,r){"use strict";var n=r(5674),o=r(1200);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},6542:function(t,e,r){"use strict";var n=r(2870),o=n("%TypeError%"),i=n("%Number%"),a=r(8606),s=r(703),u=r(6207);t.exports=function(t){var e=a(t)?t:s(t,i);if("symbol"==typeof e)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?u(e):i(e)}},703:function(t,e,r){"use strict";var n=r(7358);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},7628:function(t,e,r){"use strict";var n=r(9545),o=r(2870)("%TypeError%"),i=r(1874),a=r(5695),s=r(7304);t.exports=function(t){if("Object"!==i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=a(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=a(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=a(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!s(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var u=t.set;if(void 0!==u&&!s(u))throw new o("setter must be a function");e["[[Set]]"]=u}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},5128:function(t,e,r){"use strict";var n=r(2870),o=n("%String%"),i=n("%TypeError%");t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return o(t)}},1874:function(t,e,r){"use strict";var n=r(6101);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},1751:function(t,e,r){"use strict";var n=r(2870),o=n("%TypeError%"),i=n("%String.fromCharCode%"),a=r(5541),s=r(959);t.exports=function(t,e){if(!a(t)||!s(e))throw new o("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(t)+i(e)}},3567:function(t,e,r){"use strict";var n=r(1874),o=Math.floor;t.exports=function(t){return"BigInt"===n(t)?t:o(t)}},5693:function(t,e,r){"use strict";var n=r(2870),o=r(3567),i=n("%TypeError%");t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-o(-t):o(t);return 0===e?0:e}},9572:function(t,e,r){"use strict";var n=r(2870)("%TypeError%");t.exports=function(t,e){if(null==t)throw new n(e||"Cannot call method on "+t);return t}},6101:function(t){"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},6740:function(t,e,r){"use strict";t.exports=r(2870)},2860:function(t,e,r){"use strict";var n=r(229),o=r(2870),i=n()&&o("%Object.defineProperty%",!0),a=n.hasArrayLengthDefineBug(),s=a&&r(2403),u=r(3099)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,o,c){if(!i){if(!t(c))return!1;if(!c["[[Configurable]]"]||!c["[[Writable]]"])return!1;if(o in n&&u(n,o)!==!!c["[[Enumerable]]"])return!1;var l=c["[[Value]]"];return n[o]=l,e(n[o],l)}return a&&"length"===o&&"[[Value]]"in c&&s(n)&&n.length!==c["[[Value]]"]?(n.length=c["[[Value]]"],n.length===c["[[Value]]"]):(i(n,o,r(c)),!0)}},2403:function(t,e,r){"use strict";var n=r(2870)("%Array%"),o=!n.isArray&&r(3099)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},1489:function(t,e,r){"use strict";var n=r(2870),o=n("%TypeError%"),i=n("%SyntaxError%"),a=r(9545),s=r(2990),u={"Property Descriptor":function(t){var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!t)return!1;for(var r in t)if(a(t,r)&&!e[r])return!1;var n=a(t,"[[Value]]"),i=a(t,"[[Get]]")||a(t,"[[Set]]");if(n&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":r(900),"Iterator Record":function(t){return a(t,"[[Iterator]]")&&a(t,"[[NextMethod]]")&&a(t,"[[Done]]")},"PromiseCapability Record":function(t){return!!t&&a(t,"[[Resolve]]")&&"function"==typeof t["[[Resolve]]"]&&a(t,"[[Reject]]")&&"function"==typeof t["[[Reject]]"]&&a(t,"[[Promise]]")&&t["[[Promise]]"]&&"function"==typeof t["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(t){return!!t&&a(t,"[[Completion]]")&&a(t,"[[Capability]]")&&u["PromiseCapability Record"](t["[[Capability]]"])},"RegExp Record":function(t){return t&&a(t,"[[IgnoreCase]]")&&"boolean"==typeof t["[[IgnoreCase]]"]&&a(t,"[[Multiline]]")&&"boolean"==typeof t["[[Multiline]]"]&&a(t,"[[DotAll]]")&&"boolean"==typeof t["[[DotAll]]"]&&a(t,"[[Unicode]]")&&"boolean"==typeof t["[[Unicode]]"]&&a(t,"[[CapturingGroupsCount]]")&&"number"==typeof t["[[CapturingGroupsCount]]"]&&s(t["[[CapturingGroupsCount]]"])&&t["[[CapturingGroupsCount]]"]>=0}};t.exports=function(t,e,r,n){var a=u[e];if("function"!=typeof a)throw new i("unknown record type: "+e);if("Object"!==t(n)||!a(n))throw new o(r+" must be a "+e)}},7735:function(t){"use strict";t.exports=function(t,e){for(var r=0;r=55296&&t<=56319}},900:function(t,e,r){"use strict";var n=r(9545);t.exports=function(t){return n(t,"[[StartIndex]]")&&n(t,"[[EndIndex]]")&&t["[[StartIndex]]"]>=0&&t["[[EndIndex]]"]>=t["[[StartIndex]]"]&&String(parseInt(t["[[StartIndex]]"],10))===String(t["[[StartIndex]]"])&&String(parseInt(t["[[EndIndex]]"],10))===String(t["[[EndIndex]]"])}},159:function(t){"use strict";t.exports=Number.isNaN||function(t){return t!=t}},8606:function(t){"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},7999:function(t,e,r){"use strict";var n=r(2870),o=r(9545),i=n("%TypeError%");t.exports=function(t,e){if("Object"!==t.Type(e))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(o(e,n)&&!r[n])return!1;if(t.IsDataDescriptor(e)&&t.IsAccessorDescriptor(e))throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}},959:function(t){"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},5674:function(t){"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";class t{constructor(t,e,r){if(this.margins={top:0,right:0,bottom:0,left:0},!e.contentWindow)throw Error("Iframe argument must have been attached to DOM.");this.listener=r,this.iframe=e}setMessagePort(t){t.onmessage=t=>{this.onMessageFromIframe(t)}}show(){this.iframe.style.display="unset"}hide(){this.iframe.style.display="none"}setMargins(t){this.margins!=t&&(this.iframe.style.marginTop=this.margins.top+"px",this.iframe.style.marginLeft=this.margins.left+"px",this.iframe.style.marginBottom=this.margins.bottom+"px",this.iframe.style.marginRight=this.margins.right+"px")}loadPage(t){this.iframe.src=t}setPlaceholder(t){this.iframe.style.visibility="hidden",this.iframe.style.width=t.width+"px",this.iframe.style.height=t.height+"px",this.size=t}onMessageFromIframe(t){const e=t.data;switch(e.kind){case"contentSize":return this.onContentSizeAvailable(e.size);case"tap":return this.listener.onTap(e.event);case"linkActivated":return this.onLinkActivated(e);case"decorationActivated":return this.listener.onDecorationActivated(e.event)}}onLinkActivated(t){try{const e=new URL(t.href,this.iframe.src);this.listener.onLinkActivated(e.toString(),t.outerHtml)}catch(t){}}onContentSizeAvailable(t){t&&(this.iframe.style.width=t.width+"px",this.iframe.style.height=t.height+"px",this.size=t,this.listener.onIframeLoaded())}}function e(t,e){return{x:(t.x+e.left-visualViewport.offsetLeft)*visualViewport.scale,y:(t.y+e.top-visualViewport.offsetTop)*visualViewport.scale}}function n(t,r){const n={x:t.left,y:t.top},o={x:t.right,y:t.bottom},i=e(n,r),a=e(o,r);return{left:i.x,top:i.y,right:a.x,bottom:a.y,width:a.x-i.x,height:a.y-i.y}}class o{setInitialScale(t){return this.initialScale=t,this}setMinimumScale(t){return this.minimumScale=t,this}setWidth(t){return this.width=t,this}setHeight(t){return this.height=t,this}build(){const t=[];return this.initialScale&&t.push("initial-scale="+this.initialScale),this.minimumScale&&t.push("minimum-scale="+this.minimumScale),this.width&&t.push("width="+this.width),this.height&&t.push("height="+this.height),t.join(", ")}}class i{constructor(t,e,r){this.window=t,this.listener=e,this.decorationManager=r,document.addEventListener("click",(t=>{this.onClick(t)}),!1)}onClick(t){if(t.defaultPrevented)return;const e=this.window.getSelection();if(e&&"Range"==e.type)return;let r,n;if(r=t.target instanceof HTMLElement?this.nearestInteractiveElement(t.target):null,r){if(!(r instanceof HTMLAnchorElement))return;this.listener.onLinkActivated(r.href,r.outerHTML),t.stopPropagation(),t.preventDefault()}n=this.decorationManager?this.decorationManager.handleDecorationClickEvent(t):null,n?this.listener.onDecorationActivated(n):this.listener.onTap(t)}nearestInteractiveElement(t){return null==t?null:-1!=["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(t.nodeName.toLowerCase())||t.hasAttribute("contenteditable")&&"false"!=t.getAttribute("contenteditable").toLowerCase()?t:t.parentElement?this.nearestInteractiveElement(t.parentElement):null}}class a{constructor(r,o,a,s,u){this.fit="contain",this.insets={top:0,right:0,bottom:0,left:0},this.listener=u,new i(r,{onTap:t=>{const e={x:(t.clientX-visualViewport.offsetLeft)*visualViewport.scale,y:(t.clientY-visualViewport.offsetTop)*visualViewport.scale};u.onTap({offset:e})},onLinkActivated:t=>{throw Error("No interactive element in the root document.")},onDecorationActivated:t=>{throw Error("No decoration in the root document.")}});const c={onIframeLoaded:()=>{this.layout()},onTap:t=>{const r=o.getBoundingClientRect(),n=e(t.offset,r);u.onTap({offset:n})},onLinkActivated:(t,e)=>{u.onLinkActivated(t,e)},onDecorationActivated:t=>{const r=o.getBoundingClientRect(),i=e(t.offset,r),a=n(t.rect,r),s={id:t.id,group:t.group,rect:a,offset:i};u.onDecorationActivated(s)}},l={onIframeLoaded:()=>{this.layout()},onTap:t=>{const r=a.getBoundingClientRect(),n=e(t.offset,r);u.onTap({offset:n})},onLinkActivated:(t,e)=>{u.onLinkActivated(t,e)},onDecorationActivated:t=>{const r=a.getBoundingClientRect(),o=e(t.offset,r),i=n(t.rect,r),s={id:t.id,group:t.group,rect:i,offset:o};u.onDecorationActivated(s)}};this.leftPage=new t(r,o,c),this.rightPage=new t(r,a,l),this.metaViewport=s}setLeftMessagePort(t){this.leftPage.setMessagePort(t)}setRightMessagePort(t){this.rightPage.setMessagePort(t)}loadSpread(t){this.leftPage.hide(),this.rightPage.hide(),this.spread=t,t.left&&this.leftPage.loadPage(t.left),t.right&&this.rightPage.loadPage(t.right)}setViewport(t,e){this.viewport==t&&this.insets==e||(this.viewport=t,this.insets=e,this.layout())}setFit(t){this.fit!=t&&(this.fit=t,this.layout())}layout(){if(!this.viewport||!this.leftPage.size&&this.spread.left||!this.rightPage.size&&this.spread.right)return;const t={top:this.insets.top,right:0,bottom:this.insets.bottom,left:this.insets.left};this.leftPage.setMargins(t);const e={top:this.insets.top,right:this.insets.right,bottom:this.insets.bottom,left:0};this.rightPage.setMargins(e),this.spread.right?this.spread.left||this.leftPage.setPlaceholder(this.rightPage.size):this.rightPage.setPlaceholder(this.leftPage.size);const r=this.leftPage.size.width+this.rightPage.size.width,n=Math.max(this.leftPage.size.height,this.rightPage.size.height),i={width:r,height:n},a={width:this.viewport.width-this.insets.left-this.insets.right,height:this.viewport.height-this.insets.top-this.insets.bottom},s=function(t,e,r){switch(t){case"contain":return function(t,e){const r=e.width/t.width,n=e.height/t.height;return Math.min(r,n)}(e,r);case"width":return function(t,e){return e.width/t.width}(e,r);case"height":return function(t,e){return e.height/t.height}(e,r)}}(this.fit,i,a);this.metaViewport.content=(new o).setInitialScale(s).setMinimumScale(s).setWidth(r).setHeight(n).build(),this.leftPage.show(),this.rightPage.show(),this.listener.onLayout()}}class s{constructor(t,e,r){this.window=t,this.gesturesApi=e,this.documentApi=r,this.resizeObserverAdded=!1,this.documentLoadedFired=!1}onTap(t){this.gesturesApi.onTap(JSON.stringify(t.offset))}onLinkActivated(t,e){this.gesturesApi.onLinkActivated(t,e)}onDecorationActivated(t){const e=JSON.stringify(t.offset),r=JSON.stringify(t.rect);this.gesturesApi.onDecorationActivated(t.id,t.group,r,e)}onLayout(){this.resizeObserverAdded||new ResizeObserver((()=>{requestAnimationFrame((()=>{const t=this.window.document.scrollingElement;!this.documentLoadedFired&&(null==t||t.scrollHeight>0||t.scrollWidth>0)?(this.documentApi.onDocumentLoadedAndSized(),this.documentLoadedFired=!0):this.documentApi.onDocumentResized()}))})).observe(this.window.document.body),this.resizeObserverAdded=!0}}var u,c;!function(t){t[t.Forwards=1]="Forwards",t[t.Backwards=2]="Backwards"}(u||(u={})),function(t){t[t.FORWARDS=1]="FORWARDS",t[t.BACKWARDS=2]="BACKWARDS"}(c||(c={}));var l=r(5155);function f(t,e){const r=e.getBoundingClientRect(),o=n(t.selectionRect,r);return{selectedText:null==t?void 0:t.selectedText,selectionRect:o,textBefore:t.textBefore,textAfter:t.textAfter}}r.n(l)().shim();class p{constructor(t){this.selectionListener=t}setMessagePort(t){this.messagePort=t,t.onmessage=t=>{this.onFeedback(t.data)}}requestSelection(t){this.send({kind:"requestSelection",requestId:t})}clearSelection(){this.send({kind:"clearSelection"})}onFeedback(t){if("selectionAvailable"===t.kind)return this.onSelectionAvailable(t.requestId,t.selection)}onSelectionAvailable(t,e){this.selectionListener.onSelectionAvailable(t,e)}send(t){var e;null===(e=this.messagePort)||void 0===e||e.postMessage(t)}}class y{setMessagePort(t){this.messagePort=t}registerTemplates(t){this.send({kind:"registerTemplates",templates:t})}addDecoration(t,e){this.send({kind:"addDecoration",decoration:t,group:e})}removeDecoration(t,e){this.send({kind:"removeDecoration",id:t,group:e})}send(t){var e;null===(e=this.messagePort)||void 0===e||e.postMessage(t)}}const h=document.getElementById("page-left"),g=document.getElementById("page-right"),d=document.querySelector("meta[name=viewport]");Window.prototype.doubleArea=new class{constructor(t,e,r,n,o,i){const u=new s(t,o,i);this.manager=new a(t,e,r,n,u)}setLeftMessagePort(t){this.manager.setLeftMessagePort(t)}setRightMessagePort(t){this.manager.setRightMessagePort(t)}loadSpread(t){this.manager.loadSpread(t)}setViewport(t,e,r,n,o,i){const a={width:t,height:e},s={top:r,left:i,bottom:o,right:n};this.manager.setViewport(a,s)}setFit(t){if("contain"!=t&&"width"!=t&&"height"!=t)throw Error(`Invalid fit value: ${t}`);this.manager.setFit(t)}}(window,h,g,d,window.gestures,window.documentState),window.doubleSelection=new class{constructor(t,e,r){this.requestStates=new Map,this.isLeftInitialized=!1,this.isRightInitialized=!1,this.leftIframe=t,this.rightIframe=e,this.listener=r;const n={onSelectionAvailable:(t,e)=>{if(e){const r=f(e,this.leftIframe);this.onSelectionAvailable(t,"left",r)}else this.onSelectionAvailable(t,"left",e)}};this.leftWrapper=new p(n);const o={onSelectionAvailable:(t,e)=>{if(e){const r=f(e,this.rightIframe);this.onSelectionAvailable(t,"right",r)}else this.onSelectionAvailable(t,"right",e)}};this.rightWrapper=new p(o)}setLeftMessagePort(t){this.leftWrapper.setMessagePort(t),this.isLeftInitialized=!0}setRightMessagePort(t){this.rightWrapper.setMessagePort(t),this.isRightInitialized=!0}requestSelection(t){this.isLeftInitialized&&this.isRightInitialized?(this.requestStates.set(t,"pending"),this.leftWrapper.requestSelection(t),this.rightWrapper.requestSelection(t)):this.isLeftInitialized?(this.requestStates.set(t,"firstResponseWasNull"),this.leftWrapper.requestSelection(t)):this.isRightInitialized?(this.requestStates.set(t,"firstResponseWasNull"),this.rightWrapper.requestSelection(t)):(this.requestStates.set(t,"firstResponseWasNull"),this.onSelectionAvailable(t,"left",null))}clearSelection(){this.leftWrapper.clearSelection(),this.rightWrapper.clearSelection()}onSelectionAvailable(t,e,r){const n=this.requestStates.get(t);if(!n)return;if(!r&&"pending"===n)return void this.requestStates.set(t,"firstResponseWasNull");this.requestStates.delete(t);const o=JSON.stringify(r);this.listener.onSelectionAvailable(t,e,o)}}(h,g,window.doubleSelectionListener),window.doubleDecorations=new class{constructor(){this.leftWrapper=new y,this.rightWrapper=new y}setLeftMessagePort(t){this.leftWrapper.setMessagePort(t)}setRightMessagePort(t){this.rightWrapper.setMessagePort(t)}registerTemplates(t){const e=function(t){return new Map(Object.entries(JSON.parse(t)))}(t);this.leftWrapper.registerTemplates(e),this.rightWrapper.registerTemplates(e)}addDecoration(t,e,r){const n=function(t){return JSON.parse(t)}(t);switch(e){case"left":this.leftWrapper.addDecoration(n,r);break;case"right":this.rightWrapper.addDecoration(n,r);break;default:throw Error(`Unknown iframe type: ${e}`)}}removeDecoration(t,e){this.leftWrapper.removeDecoration(t,e),this.rightWrapper.removeDecoration(t,e)}},window.doubleInitialization=new class{constructor(t,e,r,n,o,i,a){this.areaReadySemaphore=2,this.selectionReadySemaphore=2,this.decorationReadySemaphore=2,this.listener=e,this.areaBridge=o,this.selectionBridge=i,this.decorationsBridge=a,t.addEventListener("message",(t=>{t.ports[0]&&(t.source===r.contentWindow?this.onInitMessageLeft(t):t.source==n.contentWindow&&this.onInitMessageRight(t))}))}loadSpread(t){const e=(t.left?1:0)+(t.right?1:0);this.areaReadySemaphore=e,this.selectionReadySemaphore=e,this.decorationReadySemaphore=e,this.areaBridge.loadSpread(t)}onInitMessageLeft(t){const e=t.data,r=t.ports[0];switch(e){case"InitAreaManager":this.areaBridge.setLeftMessagePort(r),this.onInitAreaMessage();break;case"InitSelection":this.selectionBridge.setLeftMessagePort(r),this.onInitSelectionMessage();break;case"InitDecorations":this.decorationsBridge.setLeftMessagePort(r),this.onInitDecorationMessage()}}onInitMessageRight(t){const e=t.data,r=t.ports[0];switch(e){case"InitAreaManager":this.areaBridge.setRightMessagePort(r),this.onInitAreaMessage();break;case"InitSelection":this.selectionBridge.setRightMessagePort(r),this.onInitSelectionMessage();break;case"InitDecorations":this.decorationsBridge.setRightMessagePort(r),this.onInitDecorationMessage()}}onInitAreaMessage(){this.areaReadySemaphore-=1,0==this.areaReadySemaphore&&this.listener.onAreaApiAvailable()}onInitSelectionMessage(){this.selectionReadySemaphore-=1,0==this.selectionReadySemaphore&&this.listener.onSelectionApiAvailable()}onInitDecorationMessage(){this.decorationReadySemaphore-=1,0==this.decorationReadySemaphore&&this.listener.onDecorationApiAvailable()}}(window,window.fixedApiState,h,g,window.doubleArea,window.doubleSelection,window.doubleDecorations),window.fixedApiState.onInitializationApiAvailable()}()}(); +!function(){var t={3099:function(t,e,r){"use strict";var n=r(2870),o=r(2755),i=o(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o(r):r}},2755:function(t,e,r){"use strict";var n=r(3569),o=r(2870),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||n.call(a,i),u=o("%Object.getOwnPropertyDescriptor%",!0),c=o("%Object.defineProperty%",!0),l=o("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var e=s(n,a,arguments);return u&&c&&u(e,"length").configurable&&c(e,"length",{value:1+l(0,t.length-(arguments.length-1))}),e};var f=function(){return s(n,i,arguments)};c?c(t.exports,"apply",{value:f}):t.exports.apply=f},6663:function(t,e,r){"use strict";var n=r(229)(),o=r(2870),i=n&&o("%Object.defineProperty%",!0),a=o("%SyntaxError%"),s=o("%TypeError%"),u=r(658);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new s("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new s("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new s("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!u&&u(t,e);if(i)i(t,e,{configurable:null===c&&f?f.configurable:!c,enumerable:null===n&&f?f.enumerable:!n,value:r,writable:null===o&&f?f.writable:!o});else{if(!l&&(n||o||c))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},9722:function(t,e,r){"use strict";var n=r(2051),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,s=r(6663),u=r(229)(),c=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;u?s(t,e,r,!0):s(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var s=0;s2&&arguments[2]&&arguments[2].force;!a||!r&&i(t,a)||(n?n(t,a,{configurable:!0,enumerable:!1,value:e,writable:!1}):t[a]=e)}},7358:function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(7959),i=r(3655),a=r(455),s=r(8760);t.exports=function(t){if(o(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!i(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):s(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var u=e.call(t,r);if(o(u))return u;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(a(t)||s(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,a,s="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a1&&"boolean"!=typeof e)throw new a('"allowMissing" argument must be a boolean');if(null===O(/^%?[^%]*%?$/,t))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=P(t,0,1),r=P(t,-1);if("%"===e&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return j(t,E,(function(t,e,r,o){n[n.length]=r?j(o,I,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=R("%"+n+"%",e),s=i.name,c=i.value,l=!1,f=i.alias;f&&(n=f[0],x(r,A([0,1],f)));for(var p=1,y=!0;p=r.length){var m=u(c,h);c=(y=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:c[h]}else y=S(c,h),c=c[h];y&&!l&&(d[s]=c)}}return c}},658:function(t,e,r){"use strict";var n=r(2870)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},229:function(t,e,r){"use strict";var n=r(2870)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},3413:function(t){"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},1143:function(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(9985);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},9985:function(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},3060:function(t,e,r){"use strict";var n=r(9985);t.exports=function(){return n()&&!!Symbol.toStringTag}},9545:function(t){"use strict";var e={}.hasOwnProperty,r=Function.prototype.call;t.exports=r.bind?r.bind(e):function(t,n){return r.call(e,t,n)}},7284:function(t,e,r){"use strict";var n=r(2870),o=r(9545),i=r(5714)(),a=n("%TypeError%"),s={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");if(i.assert(t),!s.has(t,e))throw new a("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");var r=i.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");var r=i.get(t);return!!r&&o(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");var n=i.get(t);n||(n={},i.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(s),t.exports=s},3655:function(t){"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},s=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},u=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;u.call(p)===u.call(document.all)&&(f=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=u.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&s(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(c)return s(t);if(a(t))return!1;var e=u.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&s(t)}},455:function(t,e,r){"use strict";var n=Date.prototype.getDay,o=Object.prototype.toString,i=r(3060)();t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},5494:function(t,e,r){"use strict";var n,o,i,a,s=r(3099),u=r(3060)();if(u){n=s("Object.prototype.hasOwnProperty"),o=s("RegExp.prototype.exec"),i={};var c=function(){throw i};a={toString:c,valueOf:c},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=c)}var l=s("Object.prototype.toString"),f=Object.getOwnPropertyDescriptor;t.exports=u?function(t){if(!t||"object"!=typeof t)return!1;var e=f(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{o(t,a)}catch(t){return t===i}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},8760:function(t,e,r){"use strict";var n=Object.prototype.toString;if(r(1143)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},4538:function(t,e,r){var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,u=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=s&&u&&"function"==typeof u.get?u.get:null,l=s&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,g=Object.prototype.toString,d=Function.prototype.toString,b=String.prototype.match,m=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,S=String.prototype.toLowerCase,A=RegExp.prototype.test,x=Array.prototype.concat,j=Array.prototype.join,P=Array.prototype.slice,O=Math.floor,E="function"==typeof BigInt?BigInt.prototype.valueOf:null,I=Object.getOwnPropertySymbols,R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,M="function"==typeof Symbol&&"object"==typeof Symbol.iterator,D="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,T=Object.prototype.propertyIsEnumerable,F=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function k(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||A.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-O(-t):O(t);if(n!==t){var o=String(n),i=m.call(e,o.length+1);return v.call(o,r,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var C=r(7002),W=C.custom,B=_(W)?W:null;function L(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function N(t){return v.call(String(t),/"/g,""")}function U(t){return!("[object Array]"!==q(t)||D&&"object"==typeof t&&D in t)}function $(t){return!("[object RegExp]"!==q(t)||D&&"object"==typeof t&&D in t)}function _(t){if(M)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!R)return!1;try{return R.call(t),!0}catch(t){}return!1}t.exports=function t(e,r,n,o){var s=r||{};if(G(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(G(s,"maxStringLength")&&("number"==typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!G(s,"customInspect")||s.customInspect;if("boolean"!=typeof u&&"symbol"!==u)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(G(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(G(s,"numericSeparator")&&"boolean"!=typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var g=s.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return H(e,s);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var w=String(e);return g?k(e,w):w}if("bigint"==typeof e){var A=String(e)+"n";return g?k(e,A):A}var O=void 0===s.depth?5:s.depth;if(void 0===n&&(n=0),n>=O&&O>0&&"object"==typeof e)return U(e)?"[Array]":"[Object]";var I,W=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=j.call(Array(t.indent+1)," ")}return{base:r,prev:j.call(Array(e+1),r)}}(s,n);if(void 0===o)o=[];else if(V(o,e)>=0)return"[Circular]";function z(e,r,i){if(r&&(o=P.call(o)).push(r),i){var a={depth:s.depth};return G(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),t(e,a,n+1,o)}return t(e,s,n+1,o)}if("function"==typeof e&&!$(e)){var J=function(t){if(t.name)return t.name;var e=b.call(d.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),tt=Z(e,z);return"[Function"+(J?": "+J:" (anonymous)")+"]"+(tt.length>0?" { "+j.call(tt,", ")+" }":"")}if(_(e)){var et=M?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):R.call(e);return"object"!=typeof e||M?et:K(et)}if((I=e)&&"object"==typeof I&&("undefined"!=typeof HTMLElement&&I instanceof HTMLElement||"string"==typeof I.nodeName&&"function"==typeof I.getAttribute)){for(var rt="<"+S.call(String(e.nodeName)),nt=e.attributes||[],ot=0;ot"}if(U(e)){if(0===e.length)return"[]";var it=Z(e,z);return W&&!function(t){for(var e=0;e=0)return!1;return!0}(it)?"["+Q(it,W)+"]":"[ "+j.call(it,", ")+" ]"}if(function(t){return!("[object Error]"!==q(t)||D&&"object"==typeof t&&D in t)}(e)){var at=Z(e,z);return"cause"in Error.prototype||!("cause"in e)||T.call(e,"cause")?0===at.length?"["+String(e)+"]":"{ ["+String(e)+"] "+j.call(at,", ")+" }":"{ ["+String(e)+"] "+j.call(x.call("[cause]: "+z(e.cause),at),", ")+" }"}if("object"==typeof e&&u){if(B&&"function"==typeof e[B]&&C)return C(e,{depth:O-n});if("symbol"!==u&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{c.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var st=[];return a&&a.call(e,(function(t,r){st.push(z(r,e,!0)+" => "+z(t,e))})),Y("Map",i.call(e),st,W)}if(function(t){if(!c||!t||"object"!=typeof t)return!1;try{c.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ut=[];return l&&l.call(e,(function(t){ut.push(z(t,e))})),Y("Set",c.call(e),ut,W)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return X("WeakMap");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return X("WeakSet");if(function(t){if(!y||!t||"object"!=typeof t)return!1;try{return y.call(t),!0}catch(t){}return!1}(e))return X("WeakRef");if(function(t){return!("[object Number]"!==q(t)||D&&"object"==typeof t&&D in t)}(e))return K(z(Number(e)));if(function(t){if(!t||"object"!=typeof t||!E)return!1;try{return E.call(t),!0}catch(t){}return!1}(e))return K(z(E.call(e)));if(function(t){return!("[object Boolean]"!==q(t)||D&&"object"==typeof t&&D in t)}(e))return K(h.call(e));if(function(t){return!("[object String]"!==q(t)||D&&"object"==typeof t&&D in t)}(e))return K(z(String(e)));if(!function(t){return!("[object Date]"!==q(t)||D&&"object"==typeof t&&D in t)}(e)&&!$(e)){var ct=Z(e,z),lt=F?F(e)===Object.prototype:e instanceof Object||e.constructor===Object,ft=e instanceof Object?"":"null prototype",pt=!lt&&D&&Object(e)===e&&D in e?m.call(q(e),8,-1):ft?"Object":"",yt=(lt||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(pt||ft?"["+j.call(x.call([],pt||[],ft||[]),": ")+"] ":"");return 0===ct.length?yt+"{}":W?yt+"{"+Q(ct,W)+"}":yt+"{ "+j.call(ct,", ")+" }"}return String(e)};var z=Object.prototype.hasOwnProperty||function(t){return t in this};function G(t,e){return z.call(t,e)}function q(t){return g.call(t)}function V(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return H(m.call(t,0,e.maxStringLength),e)+n}return L(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,J),"single",e)}function J(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function K(t){return"Object("+t+")"}function X(t){return t+" { ? }"}function Y(t,e,r,n){return t+" ("+e+") {"+(n?Q(r,n):j.call(r,", "))+"}"}function Q(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+j.call(t,","+r)+"\n"+e.prev}function Z(t,e){var r=U(t),n=[];if(r){n.length=t.length;for(var o=0;o0&&!o.call(t,0))for(var g=0;g0)for(var d=0;d=0&&"[object Function]"===e.call(t.callee)),n}},9766:function(t,e,r){"use strict";var n=r(8921),o=Object,i=TypeError;t.exports=n((function(){if(null!=this&&this!==o(this))throw new i("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t}),"get flags",!0)},483:function(t,e,r){"use strict";var n=r(9722),o=r(2755),i=r(9766),a=r(5113),s=r(7299),u=o(a());n(u,{getPolyfill:a,implementation:i,shim:s}),t.exports=u},5113:function(t,e,r){"use strict";var n=r(9766),o=r(9722).supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(o&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}},7299:function(t,e,r){"use strict";var n=r(9722).supportsDescriptors,o=r(5113),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,s=TypeError,u=Object.getPrototypeOf,c=/a/;t.exports=function(){if(!n||!u)throw new s("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=u(c),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},7582:function(t,e,r){"use strict";var n=r(3099),o=r(2870),i=r(5494),a=n("RegExp.prototype.exec"),s=o("%TypeError%");t.exports=function(t){if(!i(t))throw new s("`regex` must be a RegExp");return function(e){return null!==a(t,e)}}},8921:function(t,e,r){"use strict";var n=r(6663),o=r(229)(),i=r(5610).functionsHaveConfigurableNames(),a=TypeError;t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!i||(o?n(t,"name",e,!0,!0):n(t,"name",e)),t}},5714:function(t,e,r){"use strict";var n=r(2870),o=r(3099),i=r(4538),a=n("%TypeError%"),s=n("%WeakMap%",!0),u=n("%Map%",!0),c=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),y=o("Map.prototype.set",!0),h=o("Map.prototype.has",!0),g=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new a("Side channel does not contain "+i(t))},get:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(t)return c(t,n)}else if(u){if(e)return p(e,n)}else if(r)return function(t,e){var r=g(t,e);return r&&r.value}(r,n)},has:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(t)return f(t,n)}else if(u){if(e)return h(e,n)}else if(r)return function(t,e){return!!g(t,e)}(r,n);return!1},set:function(n,o){s&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new s),l(t,n,o)):u?(e||(e=new u),y(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=g(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n}},3073:function(t,e,r){"use strict";var n=r(7113),o=r(151),i=r(1959),a=r(9497),s=r(5128),u=r(6751),c=r(3099),l=r(1143)(),f=r(483),p=c("String.prototype.indexOf"),y=r(2009),h=function(t){var e=y();if(l&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===RegExp.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=u(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(u(r),p(s(r),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var i=h(t);if(void 0!==i)return n(i,t,[e])}var c=s(e),l=new RegExp(t,"g");return n(h(l),l,[c])}},5155:function(t,e,r){"use strict";var n=r(2755),o=r(9722),i=r(3073),a=r(1794),s=r(3911),u=n(i);o(u,{getPolyfill:a,implementation:i,shim:s}),t.exports=u},2009:function(t,e,r){"use strict";var n=r(1143)(),o=r(8012);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},1794:function(t,e,r){"use strict";var n=r(3073);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},8012:function(t,e,r){"use strict";var n=r(1398),o=r(151),i=r(8322),a=r(2449),s=r(3995),u=r(5128),c=r(1874),l=r(483),f=r(8921),p=r(3099)("String.prototype.indexOf"),y=RegExp,h="flags"in RegExp.prototype,g=f((function(t){var e=this;if("Object"!==c(e))throw new TypeError('"this" value must be an Object');var r=u(t),f=function(t,e){var r="flags"in e?o(e,"flags"):u(l(e));return{flags:r,matcher:new t(h&&"string"==typeof r?e:t===y?e.source:e,r)}}(a(e,y),e),g=f.flags,d=f.matcher,b=s(o(e,"lastIndex"));i(d,"lastIndex",b,!0);var m=p(g,"g")>-1,v=p(g,"u")>-1;return n(d,r,m,v)}),"[Symbol.matchAll]",!0);t.exports=g},3911:function(t,e,r){"use strict";var n=r(9722),o=r(1143)(),i=r(1794),a=r(2009),s=Object.defineProperty,u=Object.getOwnPropertyDescriptor;t.exports=function(){var t=i();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),o){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),s&&u){var r=u(Symbol,e);r&&!r.configurable||s(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var c=a(),l={};l[e]=c;var f={};f[e]=function(){return RegExp.prototype[e]!==c},n(RegExp.prototype,l,f)}return t}},8125:function(t,e,r){"use strict";var n=r(6751),o=r(5128),i=r(3099)("String.prototype.replace"),a=/^\s$/.test("᠎"),s=a?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,u=a?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=o(n(this));return i(i(t,s,""),u,"")}},9434:function(t,e,r){"use strict";var n=r(2755),o=r(9722),i=r(6751),a=r(8125),s=r(3228),u=r(818),c=n(s()),l=function(t){return i(t),c(t)};o(l,{getPolyfill:s,implementation:a,shim:u}),t.exports=l},3228:function(t,e,r){"use strict";var n=r(8125);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},818:function(t,e,r){"use strict";var n=r(9722),o=r(3228);t.exports=function(){var t=o();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},7002:function(){},1510:function(t,e,r){"use strict";var n=r(2870),o=r(6318),i=r(1874),a=r(2990),s=r(5674),u=n("%TypeError%");t.exports=function(t,e,r){if("String"!==i(t))throw new u("Assertion failed: `S` must be a String");if(!a(e)||e<0||e>s)throw new u("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==i(r))throw new u("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+o(t,e)["[[CodeUnitCount]]"]:e+1}},7113:function(t,e,r){"use strict";var n=r(2870),o=r(3099),i=n("%TypeError%"),a=r(6287),s=n("%Reflect.apply%",!0)||o("Function.prototype.apply");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!a(r))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return s(t,e,r)}},6318:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(3099),i=r(5541),a=r(959),s=r(1874),u=r(1751),c=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("String"!==s(t))throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var o=l(t,e),f=c(t,e),p=i(o),y=a(o);if(!p&&!y)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(y||e+1===r)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var h=l(t,e+1);return a(h)?{"[[CodePoint]]":u(o,h),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},5702:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(1874);t.exports=function(t,e){if("Boolean"!==o(e))throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},6782:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(2860),i=r(8357),a=r(3301),s=r(6284),u=r(8277),c=r(1874);t.exports=function(t,e,r){if("Object"!==c(t))throw new n("Assertion failed: Type(O) is not Object");if(!s(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return o(a,u,i,t,e,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0})}},1398:function(t,e,r){"use strict";var n=r(2870),o=r(1143)(),i=n("%TypeError%"),a=n("%IteratorPrototype%",!0),s=r(1510),u=r(5702),c=r(6782),l=r(151),f=r(5716),p=r(3500),y=r(8322),h=r(3995),g=r(5128),d=r(1874),b=r(7284),m=r(2263),v=function(t,e,r,n){if("String"!==d(e))throw new i("`S` must be a string");if("Boolean"!==d(r))throw new i("`global` must be a boolean");if("Boolean"!==d(n))throw new i("`fullUnicode` must be a boolean");b.set(this,"[[IteratingRegExp]]",t),b.set(this,"[[IteratedString]]",e),b.set(this,"[[Global]]",r),b.set(this,"[[Unicode]]",n),b.set(this,"[[Done]]",!1)};a&&(v.prototype=f(a)),c(v.prototype,"next",(function(){var t=this;if("Object"!==d(t))throw new i("receiver must be an object");if(!(t instanceof v&&b.has(t,"[[IteratingRegExp]]")&&b.has(t,"[[IteratedString]]")&&b.has(t,"[[Global]]")&&b.has(t,"[[Unicode]]")&&b.has(t,"[[Done]]")))throw new i('"this" value must be a RegExpStringIterator instance');if(b.get(t,"[[Done]]"))return u(void 0,!0);var e=b.get(t,"[[IteratingRegExp]]"),r=b.get(t,"[[IteratedString]]"),n=b.get(t,"[[Global]]"),o=b.get(t,"[[Unicode]]"),a=p(e,r);if(null===a)return b.set(t,"[[Done]]",!0),u(void 0,!0);if(n){if(""===g(l(a,"0"))){var c=h(l(e,"lastIndex")),f=s(r,c,o);y(e,"lastIndex",f,!0)}return u(a,!1)}return b.set(t,"[[Done]]",!0),u(a,!1)})),o&&(m(v.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof v.prototype[Symbol.iterator])&&c(v.prototype,Symbol.iterator,(function(){return this})),t.exports=function(t,e,r,n){return new v(t,e,r,n)}},3645:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(7999),i=r(2860),a=r(8357),s=r(8355),u=r(3301),c=r(6284),l=r(8277),f=r(7628),p=r(1874);t.exports=function(t,e,r){if("Object"!==p(t))throw new n("Assertion failed: Type(O) is not Object");if(!c(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var y=o({Type:p,IsDataDescriptor:u,IsAccessorDescriptor:s},r)?r:f(r);if(!o({Type:p,IsDataDescriptor:u,IsAccessorDescriptor:s},y))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return i(u,l,a,t,e,y)}},8357:function(t,e,r){"use strict";var n=r(1489),o=r(1598),i=r(1874);t.exports=function(t){return void 0!==t&&n(i,"Property Descriptor","Desc",t),o(t)}},151:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(4538),i=r(6284),a=r(1874);t.exports=function(t,e){if("Object"!==a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},1959:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(9374),i=r(7304),a=r(6284),s=r(4538);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var r=o(t,e);if(null!=r){if(!i(r))throw new n(s(e)+" is not a function: "+s(r));return r}}},9374:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(4538),i=r(6284);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},8355:function(t,e,r){"use strict";var n=r(9545),o=r(1874),i=r(1489);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Get]]")&&!n(t,"[[Set]]")))}},6287:function(t,e,r){"use strict";t.exports=r(2403)},7304:function(t,e,r){"use strict";t.exports=r(3655)},4791:function(t,e,r){"use strict";var n=r(6740)("%Reflect.construct%",!0),o=r(3645);try{o({},"",{"[[Get]]":function(){}})}catch(t){o=null}if(o&&n){var i={},a={};o(a,"length",{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,a)}catch(t){return t===i}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},3301:function(t,e,r){"use strict";var n=r(9545),o=r(1874),i=r(1489);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Value]]")&&!n(t,"[[Writable]]")))}},6284:function(t){"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},9497:function(t,e,r){"use strict";var n=r(2870)("%Symbol.match%",!0),o=r(5494),i=r(5695);t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(n){var e=t[n];if(void 0!==e)return i(e)}return o(t)}},5716:function(t,e,r){"use strict";var n=r(2870),o=n("%Object.create%",!0),i=n("%TypeError%"),a=n("%SyntaxError%"),s=r(6287),u=r(1874),c=r(7735),l=r(7284),f=r(3413)();t.exports=function(t){if(null!==t&&"Object"!==u(t))throw new i("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!s(r))throw new i("Assertion failed: `additionalInternalSlotsList` must be an Array");if(o)e=o(t);else if(f)e={__proto__:t};else{if(null===t)throw new a("native Object.create support is required to create null objects");var n=function(){};n.prototype=t,e=new n}return r.length>0&&c(r,(function(t){l.set(e,t,void 0)})),e}},3500:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(3099)("RegExp.prototype.exec"),i=r(7113),a=r(151),s=r(7304),u=r(1874);t.exports=function(t,e){if("Object"!==u(t))throw new n("Assertion failed: `R` must be an Object");if("String"!==u(e))throw new n("Assertion failed: `S` must be a String");var r=a(t,"exec");if(s(r)){var c=i(r,t,[e]);if(null===c||"Object"===u(c))return c;throw new n('"exec" method must return `null` or an Object')}return o(t,e)}},6751:function(t,e,r){"use strict";t.exports=r(9572)},8277:function(t,e,r){"use strict";var n=r(159);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},8322:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(6284),i=r(8277),a=r(1874),s=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,u){if("Object"!==a(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");if("Boolean"!==a(u))throw new n("Assertion failed: `Throw` must be a Boolean");if(u){if(t[e]=r,s&&!i(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!s||i(t[e],r)}catch(t){return!1}}},2449:function(t,e,r){"use strict";var n=r(2870),o=n("%Symbol.species%",!0),i=n("%TypeError%"),a=r(4791),s=r(1874);t.exports=function(t,e){if("Object"!==s(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==s(r))throw new i("O.constructor is not an Object");var n=o?r[o]:void 0;if(null==n)return e;if(a(n))return n;throw new i("no constructor found")}},6207:function(t,e,r){"use strict";var n=r(2870),o=n("%Number%"),i=n("%RegExp%"),a=n("%TypeError%"),s=n("%parseInt%"),u=r(3099),c=r(7582),l=u("String.prototype.slice"),f=c(/^0b[01]+$/i),p=c(/^0o[0-7]+$/i),y=c(/^[-+]0x[0-9a-f]+$/i),h=c(new i("["+["…","​","￾"].join("")+"]","g")),g=r(9434),d=r(1874);t.exports=function t(e){if("String"!==d(e))throw new a("Assertion failed: `argument` is not a String");if(f(e))return o(s(l(e,2),2));if(p(e))return o(s(l(e,2),8));if(h(e)||y(e))return NaN;var r=g(e);return r!==e?t(r):o(e)}},5695:function(t){"use strict";t.exports=function(t){return!!t}},1200:function(t,e,r){"use strict";var n=r(6542),o=r(5693),i=r(159),a=r(1117);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},3995:function(t,e,r){"use strict";var n=r(5674),o=r(1200);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},6542:function(t,e,r){"use strict";var n=r(2870),o=n("%TypeError%"),i=n("%Number%"),a=r(8606),s=r(703),u=r(6207);t.exports=function(t){var e=a(t)?t:s(t,i);if("symbol"==typeof e)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?u(e):i(e)}},703:function(t,e,r){"use strict";var n=r(7358);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},7628:function(t,e,r){"use strict";var n=r(9545),o=r(2870)("%TypeError%"),i=r(1874),a=r(5695),s=r(7304);t.exports=function(t){if("Object"!==i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=a(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=a(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=a(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!s(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var u=t.set;if(void 0!==u&&!s(u))throw new o("setter must be a function");e["[[Set]]"]=u}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},5128:function(t,e,r){"use strict";var n=r(2870),o=n("%String%"),i=n("%TypeError%");t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return o(t)}},1874:function(t,e,r){"use strict";var n=r(6101);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},1751:function(t,e,r){"use strict";var n=r(2870),o=n("%TypeError%"),i=n("%String.fromCharCode%"),a=r(5541),s=r(959);t.exports=function(t,e){if(!a(t)||!s(e))throw new o("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(t)+i(e)}},3567:function(t,e,r){"use strict";var n=r(1874),o=Math.floor;t.exports=function(t){return"BigInt"===n(t)?t:o(t)}},5693:function(t,e,r){"use strict";var n=r(2870),o=r(3567),i=n("%TypeError%");t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-o(-t):o(t);return 0===e?0:e}},9572:function(t,e,r){"use strict";var n=r(2870)("%TypeError%");t.exports=function(t,e){if(null==t)throw new n(e||"Cannot call method on "+t);return t}},6101:function(t){"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},6740:function(t,e,r){"use strict";t.exports=r(2870)},2860:function(t,e,r){"use strict";var n=r(229),o=r(2870),i=n()&&o("%Object.defineProperty%",!0),a=n.hasArrayLengthDefineBug(),s=a&&r(2403),u=r(3099)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,o,c){if(!i){if(!t(c))return!1;if(!c["[[Configurable]]"]||!c["[[Writable]]"])return!1;if(o in n&&u(n,o)!==!!c["[[Enumerable]]"])return!1;var l=c["[[Value]]"];return n[o]=l,e(n[o],l)}return a&&"length"===o&&"[[Value]]"in c&&s(n)&&n.length!==c["[[Value]]"]?(n.length=c["[[Value]]"],n.length===c["[[Value]]"]):(i(n,o,r(c)),!0)}},2403:function(t,e,r){"use strict";var n=r(2870)("%Array%"),o=!n.isArray&&r(3099)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},1489:function(t,e,r){"use strict";var n=r(2870),o=n("%TypeError%"),i=n("%SyntaxError%"),a=r(9545),s=r(2990),u={"Property Descriptor":function(t){var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!t)return!1;for(var r in t)if(a(t,r)&&!e[r])return!1;var n=a(t,"[[Value]]"),i=a(t,"[[Get]]")||a(t,"[[Set]]");if(n&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":r(900),"Iterator Record":function(t){return a(t,"[[Iterator]]")&&a(t,"[[NextMethod]]")&&a(t,"[[Done]]")},"PromiseCapability Record":function(t){return!!t&&a(t,"[[Resolve]]")&&"function"==typeof t["[[Resolve]]"]&&a(t,"[[Reject]]")&&"function"==typeof t["[[Reject]]"]&&a(t,"[[Promise]]")&&t["[[Promise]]"]&&"function"==typeof t["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(t){return!!t&&a(t,"[[Completion]]")&&a(t,"[[Capability]]")&&u["PromiseCapability Record"](t["[[Capability]]"])},"RegExp Record":function(t){return t&&a(t,"[[IgnoreCase]]")&&"boolean"==typeof t["[[IgnoreCase]]"]&&a(t,"[[Multiline]]")&&"boolean"==typeof t["[[Multiline]]"]&&a(t,"[[DotAll]]")&&"boolean"==typeof t["[[DotAll]]"]&&a(t,"[[Unicode]]")&&"boolean"==typeof t["[[Unicode]]"]&&a(t,"[[CapturingGroupsCount]]")&&"number"==typeof t["[[CapturingGroupsCount]]"]&&s(t["[[CapturingGroupsCount]]"])&&t["[[CapturingGroupsCount]]"]>=0}};t.exports=function(t,e,r,n){var a=u[e];if("function"!=typeof a)throw new i("unknown record type: "+e);if("Object"!==t(n)||!a(n))throw new o(r+" must be a "+e)}},7735:function(t){"use strict";t.exports=function(t,e){for(var r=0;r=55296&&t<=56319}},900:function(t,e,r){"use strict";var n=r(9545);t.exports=function(t){return n(t,"[[StartIndex]]")&&n(t,"[[EndIndex]]")&&t["[[StartIndex]]"]>=0&&t["[[EndIndex]]"]>=t["[[StartIndex]]"]&&String(parseInt(t["[[StartIndex]]"],10))===String(t["[[StartIndex]]"])&&String(parseInt(t["[[EndIndex]]"],10))===String(t["[[EndIndex]]"])}},159:function(t){"use strict";t.exports=Number.isNaN||function(t){return t!=t}},8606:function(t){"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},7999:function(t,e,r){"use strict";var n=r(2870),o=r(9545),i=n("%TypeError%");t.exports=function(t,e){if("Object"!==t.Type(e))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(o(e,n)&&!r[n])return!1;if(t.IsDataDescriptor(e)&&t.IsAccessorDescriptor(e))throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}},959:function(t){"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},5674:function(t){"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";class t{constructor(t,e,r){if(this.margins={top:0,right:0,bottom:0,left:0},!e.contentWindow)throw Error("Iframe argument must have been attached to DOM.");this.listener=r,this.iframe=e}setMessagePort(t){t.onmessage=t=>{this.onMessageFromIframe(t)}}show(){this.iframe.style.display="unset"}hide(){this.iframe.style.display="none"}setMargins(t){this.margins!=t&&(this.iframe.style.marginTop=this.margins.top+"px",this.iframe.style.marginLeft=this.margins.left+"px",this.iframe.style.marginBottom=this.margins.bottom+"px",this.iframe.style.marginRight=this.margins.right+"px")}loadPage(t){this.iframe.src=t}setPlaceholder(t){this.iframe.style.visibility="hidden",this.iframe.style.width=t.width+"px",this.iframe.style.height=t.height+"px",this.size=t}onMessageFromIframe(t){const e=t.data;switch(e.kind){case"contentSize":return this.onContentSizeAvailable(e.size);case"tap":return this.listener.onTap(e.event);case"linkActivated":return this.onLinkActivated(e);case"decorationActivated":return this.listener.onDecorationActivated(e.event)}}onLinkActivated(t){try{const e=new URL(t.href,this.iframe.src);this.listener.onLinkActivated(e.toString(),t.outerHtml)}catch(t){}}onContentSizeAvailable(t){t&&(this.iframe.style.width=t.width+"px",this.iframe.style.height=t.height+"px",this.size=t,this.listener.onIframeLoaded())}}function e(t,e){return{x:(t.x+e.left-visualViewport.offsetLeft)*visualViewport.scale,y:(t.y+e.top-visualViewport.offsetTop)*visualViewport.scale}}function n(t,r){const n={x:t.left,y:t.top},o={x:t.right,y:t.bottom},i=e(n,r),a=e(o,r);return{left:i.x,top:i.y,right:a.x,bottom:a.y,width:a.x-i.x,height:a.y-i.y}}class o{setInitialScale(t){return this.initialScale=t,this}setMinimumScale(t){return this.minimumScale=t,this}setWidth(t){return this.width=t,this}setHeight(t){return this.height=t,this}build(){const t=[];return this.initialScale&&t.push("initial-scale="+this.initialScale),this.minimumScale&&t.push("minimum-scale="+this.minimumScale),this.width&&t.push("width="+this.width),this.height&&t.push("height="+this.height),t.join(", ")}}class i{constructor(t,e,r){this.window=t,this.listener=e,this.decorationManager=r,document.addEventListener("click",(t=>{this.onClick(t)}),!1)}onClick(t){if(t.defaultPrevented)return;let e,r;e=t.target instanceof HTMLElement?this.nearestInteractiveElement(t.target):null,e?e instanceof HTMLAnchorElement&&(this.listener.onLinkActivated(e.href,e.outerHTML),t.stopPropagation(),t.preventDefault()):(r=this.decorationManager?this.decorationManager.handleDecorationClickEvent(t):null,r?this.listener.onDecorationActivated(r):this.listener.onTap(t))}nearestInteractiveElement(t){return null==t?null:-1!=["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(t.nodeName.toLowerCase())||t.hasAttribute("contenteditable")&&"false"!=t.getAttribute("contenteditable").toLowerCase()?t:t.parentElement?this.nearestInteractiveElement(t.parentElement):null}}class a{constructor(r,o,a,s,u){this.fit="contain",this.insets={top:0,right:0,bottom:0,left:0},this.listener=u,new i(r,{onTap:t=>{const e={x:(t.clientX-visualViewport.offsetLeft)*visualViewport.scale,y:(t.clientY-visualViewport.offsetTop)*visualViewport.scale};u.onTap({offset:e})},onLinkActivated:t=>{throw Error("No interactive element in the root document.")},onDecorationActivated:t=>{throw Error("No decoration in the root document.")}});const c={onIframeLoaded:()=>{this.layout()},onTap:t=>{const r=o.getBoundingClientRect(),n=e(t.offset,r);u.onTap({offset:n})},onLinkActivated:(t,e)=>{u.onLinkActivated(t,e)},onDecorationActivated:t=>{const r=o.getBoundingClientRect(),i=e(t.offset,r),a=n(t.rect,r),s={id:t.id,group:t.group,rect:a,offset:i};u.onDecorationActivated(s)}},l={onIframeLoaded:()=>{this.layout()},onTap:t=>{const r=a.getBoundingClientRect(),n=e(t.offset,r);u.onTap({offset:n})},onLinkActivated:(t,e)=>{u.onLinkActivated(t,e)},onDecorationActivated:t=>{const r=a.getBoundingClientRect(),o=e(t.offset,r),i=n(t.rect,r),s={id:t.id,group:t.group,rect:i,offset:o};u.onDecorationActivated(s)}};this.leftPage=new t(r,o,c),this.rightPage=new t(r,a,l),this.metaViewport=s}setLeftMessagePort(t){this.leftPage.setMessagePort(t)}setRightMessagePort(t){this.rightPage.setMessagePort(t)}loadSpread(t){this.leftPage.hide(),this.rightPage.hide(),this.spread=t,t.left&&this.leftPage.loadPage(t.left),t.right&&this.rightPage.loadPage(t.right)}setViewport(t,e){this.viewport==t&&this.insets==e||(this.viewport=t,this.insets=e,this.layout())}setFit(t){this.fit!=t&&(this.fit=t,this.layout())}layout(){if(!this.viewport||!this.leftPage.size&&this.spread.left||!this.rightPage.size&&this.spread.right)return;const t={top:this.insets.top,right:0,bottom:this.insets.bottom,left:this.insets.left};this.leftPage.setMargins(t);const e={top:this.insets.top,right:this.insets.right,bottom:this.insets.bottom,left:0};this.rightPage.setMargins(e),this.spread.right?this.spread.left||this.leftPage.setPlaceholder(this.rightPage.size):this.rightPage.setPlaceholder(this.leftPage.size);const r=this.leftPage.size.width+this.rightPage.size.width,n=Math.max(this.leftPage.size.height,this.rightPage.size.height),i={width:r,height:n},a={width:this.viewport.width-this.insets.left-this.insets.right,height:this.viewport.height-this.insets.top-this.insets.bottom},s=function(t,e,r){switch(t){case"contain":return function(t,e){const r=e.width/t.width,n=e.height/t.height;return Math.min(r,n)}(e,r);case"width":return function(t,e){return e.width/t.width}(e,r);case"height":return function(t,e){return e.height/t.height}(e,r)}}(this.fit,i,a);this.metaViewport.content=(new o).setInitialScale(s).setMinimumScale(s).setWidth(r).setHeight(n).build(),this.leftPage.show(),this.rightPage.show(),this.listener.onLayout()}}class s{constructor(t,e,r){this.window=t,this.gesturesApi=e,this.documentApi=r,this.resizeObserverAdded=!1,this.documentLoadedFired=!1}onTap(t){this.gesturesApi.onTap(JSON.stringify(t.offset))}onLinkActivated(t,e){this.gesturesApi.onLinkActivated(t,e)}onDecorationActivated(t){const e=JSON.stringify(t.offset),r=JSON.stringify(t.rect);this.gesturesApi.onDecorationActivated(t.id,t.group,r,e)}onLayout(){this.resizeObserverAdded||new ResizeObserver((()=>{requestAnimationFrame((()=>{const t=this.window.document.scrollingElement;!this.documentLoadedFired&&(null==t||t.scrollHeight>0||t.scrollWidth>0)?(this.documentApi.onDocumentLoadedAndSized(),this.documentLoadedFired=!0):this.documentApi.onDocumentResized()}))})).observe(this.window.document.body),this.resizeObserverAdded=!0}}var u,c;!function(t){t[t.Forwards=1]="Forwards",t[t.Backwards=2]="Backwards"}(u||(u={})),function(t){t[t.FORWARDS=1]="FORWARDS",t[t.BACKWARDS=2]="BACKWARDS"}(c||(c={}));var l=r(5155);function f(t,e){const r=e.getBoundingClientRect(),o=n(t.selectionRect,r);return{selectedText:null==t?void 0:t.selectedText,selectionRect:o,textBefore:t.textBefore,textAfter:t.textAfter}}r.n(l)().shim();class p{constructor(t){this.selectionListener=t}setMessagePort(t){this.messagePort=t,t.onmessage=t=>{this.onFeedback(t.data)}}requestSelection(t){this.send({kind:"requestSelection",requestId:t})}clearSelection(){this.send({kind:"clearSelection"})}onFeedback(t){if("selectionAvailable"===t.kind)return this.onSelectionAvailable(t.requestId,t.selection)}onSelectionAvailable(t,e){this.selectionListener.onSelectionAvailable(t,e)}send(t){var e;null===(e=this.messagePort)||void 0===e||e.postMessage(t)}}class y{setMessagePort(t){this.messagePort=t}registerTemplates(t){this.send({kind:"registerTemplates",templates:t})}addDecoration(t,e){this.send({kind:"addDecoration",decoration:t,group:e})}removeDecoration(t,e){this.send({kind:"removeDecoration",id:t,group:e})}send(t){var e;null===(e=this.messagePort)||void 0===e||e.postMessage(t)}}const h=document.getElementById("page-left"),g=document.getElementById("page-right"),d=document.querySelector("meta[name=viewport]");Window.prototype.doubleArea=new class{constructor(t,e,r,n,o,i){const u=new s(t,o,i);this.manager=new a(t,e,r,n,u)}setLeftMessagePort(t){this.manager.setLeftMessagePort(t)}setRightMessagePort(t){this.manager.setRightMessagePort(t)}loadSpread(t){this.manager.loadSpread(t)}setViewport(t,e,r,n,o,i){const a={width:t,height:e},s={top:r,left:i,bottom:o,right:n};this.manager.setViewport(a,s)}setFit(t){if("contain"!=t&&"width"!=t&&"height"!=t)throw Error(`Invalid fit value: ${t}`);this.manager.setFit(t)}}(window,h,g,d,window.gestures,window.documentState),window.doubleSelection=new class{constructor(t,e,r){this.requestStates=new Map,this.isLeftInitialized=!1,this.isRightInitialized=!1,this.leftIframe=t,this.rightIframe=e,this.listener=r;const n={onSelectionAvailable:(t,e)=>{if(e){const r=f(e,this.leftIframe);this.onSelectionAvailable(t,"left",r)}else this.onSelectionAvailable(t,"left",e)}};this.leftWrapper=new p(n);const o={onSelectionAvailable:(t,e)=>{if(e){const r=f(e,this.rightIframe);this.onSelectionAvailable(t,"right",r)}else this.onSelectionAvailable(t,"right",e)}};this.rightWrapper=new p(o)}setLeftMessagePort(t){this.leftWrapper.setMessagePort(t),this.isLeftInitialized=!0}setRightMessagePort(t){this.rightWrapper.setMessagePort(t),this.isRightInitialized=!0}requestSelection(t){this.isLeftInitialized&&this.isRightInitialized?(this.requestStates.set(t,"pending"),this.leftWrapper.requestSelection(t),this.rightWrapper.requestSelection(t)):this.isLeftInitialized?(this.requestStates.set(t,"firstResponseWasNull"),this.leftWrapper.requestSelection(t)):this.isRightInitialized?(this.requestStates.set(t,"firstResponseWasNull"),this.rightWrapper.requestSelection(t)):(this.requestStates.set(t,"firstResponseWasNull"),this.onSelectionAvailable(t,"left",null))}clearSelection(){this.leftWrapper.clearSelection(),this.rightWrapper.clearSelection()}onSelectionAvailable(t,e,r){const n=this.requestStates.get(t);if(!n)return;if(!r&&"pending"===n)return void this.requestStates.set(t,"firstResponseWasNull");this.requestStates.delete(t);const o=JSON.stringify(r);this.listener.onSelectionAvailable(t,e,o)}}(h,g,window.doubleSelectionListener),window.doubleDecorations=new class{constructor(){this.leftWrapper=new y,this.rightWrapper=new y}setLeftMessagePort(t){this.leftWrapper.setMessagePort(t)}setRightMessagePort(t){this.rightWrapper.setMessagePort(t)}registerTemplates(t){const e=function(t){return new Map(Object.entries(JSON.parse(t)))}(t);this.leftWrapper.registerTemplates(e),this.rightWrapper.registerTemplates(e)}addDecoration(t,e,r){const n=function(t){return JSON.parse(t)}(t);switch(e){case"left":this.leftWrapper.addDecoration(n,r);break;case"right":this.rightWrapper.addDecoration(n,r);break;default:throw Error(`Unknown iframe type: ${e}`)}}removeDecoration(t,e){this.leftWrapper.removeDecoration(t,e),this.rightWrapper.removeDecoration(t,e)}},window.doubleInitialization=new class{constructor(t,e,r,n,o,i,a){this.areaReadySemaphore=2,this.selectionReadySemaphore=2,this.decorationReadySemaphore=2,this.listener=e,this.areaBridge=o,this.selectionBridge=i,this.decorationsBridge=a,t.addEventListener("message",(t=>{t.ports[0]&&(t.source===r.contentWindow?this.onInitMessageLeft(t):t.source==n.contentWindow&&this.onInitMessageRight(t))}))}loadSpread(t){const e=(t.left?1:0)+(t.right?1:0);this.areaReadySemaphore=e,this.selectionReadySemaphore=e,this.decorationReadySemaphore=e,this.areaBridge.loadSpread(t)}onInitMessageLeft(t){const e=t.data,r=t.ports[0];switch(e){case"InitAreaManager":this.areaBridge.setLeftMessagePort(r),this.onInitAreaMessage();break;case"InitSelection":this.selectionBridge.setLeftMessagePort(r),this.onInitSelectionMessage();break;case"InitDecorations":this.decorationsBridge.setLeftMessagePort(r),this.onInitDecorationMessage()}}onInitMessageRight(t){const e=t.data,r=t.ports[0];switch(e){case"InitAreaManager":this.areaBridge.setRightMessagePort(r),this.onInitAreaMessage();break;case"InitSelection":this.selectionBridge.setRightMessagePort(r),this.onInitSelectionMessage();break;case"InitDecorations":this.decorationsBridge.setRightMessagePort(r),this.onInitDecorationMessage()}}onInitAreaMessage(){this.areaReadySemaphore-=1,0==this.areaReadySemaphore&&this.listener.onAreaApiAvailable()}onInitSelectionMessage(){this.selectionReadySemaphore-=1,0==this.selectionReadySemaphore&&this.listener.onSelectionApiAvailable()}onInitDecorationMessage(){this.decorationReadySemaphore-=1,0==this.decorationReadySemaphore&&this.listener.onDecorationApiAvailable()}}(window,window.fixedApiState,h,g,window.doubleArea,window.doubleSelection,window.doubleDecorations),window.fixedApiState.onInitializationApiAvailable()}()}(); //# sourceMappingURL=fixed-double-script.js.map \ No newline at end of file diff --git a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/fixed-double-script.js.map b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/fixed-double-script.js.map index 590868cc5d..1326e18f5d 100644 --- a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/fixed-double-script.js.map +++ b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/fixed-double-script.js.map @@ -1 +1 @@ -{"version":3,"file":"fixed-double-script.js","mappings":"qDAEA,IAAIA,EAAe,EAAQ,MAEvBC,EAAW,EAAQ,MAEnBC,EAAWD,EAASD,EAAa,6BAErCG,EAAOC,QAAU,SAA4BC,EAAMC,GAClD,IAAIC,EAAYP,EAAaK,IAAQC,GACrC,MAAyB,mBAAdC,GAA4BL,EAASG,EAAM,gBAAkB,EAChEJ,EAASM,GAEVA,CACR,C,oCCZA,IAAIC,EAAO,EAAQ,MACfR,EAAe,EAAQ,MAEvBS,EAAST,EAAa,8BACtBU,EAAQV,EAAa,6BACrBW,EAAgBX,EAAa,mBAAmB,IAASQ,EAAKI,KAAKF,EAAOD,GAE1EI,EAAQb,EAAa,qCAAqC,GAC1Dc,EAAkBd,EAAa,2BAA2B,GAC1De,EAAOf,EAAa,cAExB,GAAIc,EACH,IACCA,EAAgB,CAAC,EAAG,IAAK,CAAEE,MAAO,GACnC,CAAE,MAAOC,GAERH,EAAkB,IACnB,CAGDX,EAAOC,QAAU,SAAkBc,GAClC,IAAIC,EAAOR,EAAcH,EAAME,EAAOU,WAYtC,OAXIP,GAASC,GACDD,EAAMM,EAAM,UACdE,cAERP,EACCK,EACA,SACA,CAAEH,MAAO,EAAID,EAAK,EAAGG,EAAiBI,QAAUF,UAAU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,EAAcoB,EAAM8K,MAAM,GAChC,OAAQI,GACJ,IAAK,kBACDttB,KAAK4sB,WAAW9F,oBAAoB9F,GACpChhB,KAAKutB,oBACL,MACJ,IAAK,gBACDvtB,KAAK6sB,gBAAgB/F,oBAAoB9F,GACzChhB,KAAKwtB,yBACL,MACJ,IAAK,kBACDxtB,KAAK8sB,kBAAkBhG,oBAAoB9F,GAC3ChhB,KAAKytB,0BAGjB,CACA,iBAAAF,GACIvtB,KAAK+sB,oBAAsB,EACI,GAA3B/sB,KAAK+sB,oBACL/sB,KAAKwgB,SAASkN,oBAEtB,CACA,sBAAAF,GACIxtB,KAAKgtB,yBAA2B,EACI,GAAhChtB,KAAKgtB,yBACLhtB,KAAKwgB,SAASmN,yBAEtB,CACA,uBAAAF,GACIztB,KAAKitB,0BAA4B,EACI,GAAjCjtB,KAAKitB,0BACLjtB,KAAKwgB,SAASoN,0BAEtB,GJpH8Dha,OAAQA,OAAOia,cAAepI,EAAYC,EAAa9R,OAAOgX,WAAYhX,OAAO4X,gBAAiB5X,OAAOyY,mBAC3KzY,OAAOia,cAAcC,8B","sources":["webpack://readium-js/./node_modules/.pnpm/call-bind@1.0.2/node_modules/call-bind/callBound.js","webpack://readium-js/./node_modules/.pnpm/call-bind@1.0.2/node_modules/call-bind/index.js","webpack://readium-js/./node_modules/.pnpm/define-data-property@1.1.0/node_modules/define-data-property/index.js","webpack://readium-js/./node_modules/.pnpm/define-properties@1.2.1/node_modules/define-properties/index.js","webpack://readium-js/./node_modules/.pnpm/es-set-tostringtag@2.0.1/node_modules/es-set-tostringtag/index.js","webpack://readium-js/./node_modules/.pnpm/es-to-primitive@1.2.1/node_modules/es-to-primitive/es2015.js","webpack://readium-js/./node_modules/.pnpm/es-to-primitive@1.2.1/node_modules/es-to-primitive/helpers/isPrimitive.js","webpack://readium-js/./node_modules/.pnpm/function-bind@1.1.1/node_modules/function-bind/implementation.js","webpack://readium-js/./node_modules/.pnpm/function-bind@1.1.1/node_modules/function-bind/index.js","webpack://readium-js/./node_modules/.pnpm/functions-have-names@1.2.3/node_modules/functions-have-names/index.js","webpack://readium-js/./node_modules/.pnpm/get-intrinsic@1.2.1/node_modules/get-intrinsic/index.js","webpack://readium-js/./node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.js","webpack://readium-js/./node_modules/.pnpm/has-property-descriptors@1.0.0/node_modules/has-property-descriptors/index.js","webpack://readium-js/./node_modules/.pnpm/has-proto@1.0.1/node_modules/has-proto/index.js","webpack://readium-js/./node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/index.js","webpack://readium-js/./node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/shams.js","webpack://readium-js/./node_modules/.pnpm/has-tostringtag@1.0.0/node_modules/has-tostringtag/shams.js","webpack://readium-js/./node_modules/.pnpm/has@1.0.4/node_modules/has/src/index.js","webpack://readium-js/./node_modules/.pnpm/internal-slot@1.0.5/node_modules/internal-slot/index.js","webpack://readium-js/./node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/index.js","webpack://readium-js/./node_modules/.pnpm/is-date-object@1.0.5/node_modules/is-date-object/index.js","webpack://readium-js/./node_modules/.pnpm/is-regex@1.1.4/node_modules/is-regex/index.js","webpack://readium-js/./node_modules/.pnpm/is-symbol@1.0.4/node_modules/is-symbol/index.js","webpack://readium-js/./node_modules/.pnpm/object-inspect@1.12.3/node_modules/object-inspect/index.js","webpack://readium-js/./node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/implementation.js","webpack://readium-js/./node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/index.js","webpack://readium-js/./node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/isArguments.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/implementation.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/index.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/polyfill.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/shim.js","webpack://readium-js/./node_modules/.pnpm/safe-regex-test@1.0.0/node_modules/safe-regex-test/index.js","webpack://readium-js/./node_modules/.pnpm/set-function-name@2.0.1/node_modules/set-function-name/index.js","webpack://readium-js/./node_modules/.pnpm/side-channel@1.0.4/node_modules/side-channel/index.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/implementation.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/index.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/polyfill-regexp-matchall.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/polyfill.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/regexp-matchall.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/shim.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/implementation.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/index.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/polyfill.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/shim.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/AdvanceStringIndex.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Call.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CodePointAt.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CreateIterResultObject.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CreateMethodProperty.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CreateRegExpStringIterator.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/DefinePropertyOrThrow.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/FromPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Get.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/GetMethod.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/GetV.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsAccessorDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsArray.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsCallable.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsConstructor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsDataDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsPropertyKey.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsRegExp.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/OrdinaryObjectCreate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/RegExpExec.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/RequireObjectCoercible.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/SameValue.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Set.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/SpeciesConstructor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/StringToNumber.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToBoolean.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToIntegerOrInfinity.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToLength.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToNumber.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToPrimitive.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToString.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Type.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/UTF16SurrogatePairToCodePoint.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/floor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/truncate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/5/CheckObjectCoercible.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/5/Type.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/GetIntrinsic.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/DefineOwnProperty.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/IsArray.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/assertRecord.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/forEach.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/fromPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isFinite.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isInteger.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isLeadingSurrogate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isMatchRecord.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isNaN.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isPrimitive.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isTrailingSurrogate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/maxSafeInteger.js","webpack://readium-js/webpack/bootstrap","webpack://readium-js/webpack/runtime/compat get default export","webpack://readium-js/webpack/runtime/define property getters","webpack://readium-js/webpack/runtime/hasOwnProperty shorthand","webpack://readium-js/./src/fixed/page-manager.ts","webpack://readium-js/./src/common/geometry.ts","webpack://readium-js/./src/util/viewport.ts","webpack://readium-js/./src/common/gestures.ts","webpack://readium-js/./src/fixed/double-area-manager.ts","webpack://readium-js/./src/fixed/fit.ts","webpack://readium-js/./src/bridge/all-listener-bridge.ts","webpack://readium-js/./src/vendor/hypothesis/annotator/anchoring/trim-range.ts","webpack://readium-js/./src/vendor/hypothesis/annotator/anchoring/text-range.ts","webpack://readium-js/./src/common/selection.ts","webpack://readium-js/./src/fixed/selection-wrapper.ts","webpack://readium-js/./src/fixed/decoration-wrapper.ts","webpack://readium-js/./src/index-fixed-double.ts","webpack://readium-js/./src/bridge/fixed-area-bridge.ts","webpack://readium-js/./src/bridge/all-selection-bridge.ts","webpack://readium-js/./src/bridge/all-decoration-bridge.ts","webpack://readium-js/./src/bridge/all-initialization-bridge.ts"],"sourcesContent":["'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBind = require('./');\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = null;\n\t}\n}\n\nmodule.exports = function callBind(originalFunction) {\n\tvar func = $reflectApply(bind, $call, arguments);\n\tif ($gOPD && $defineProperty) {\n\t\tvar desc = $gOPD(func, 'length');\n\t\tif (desc.configurable) {\n\t\t\t// original length, plus the receiver, minus any additional arguments (after the receiver)\n\t\t\t$defineProperty(\n\t\t\t\tfunc,\n\t\t\t\t'length',\n\t\t\t\t{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }\n\t\t\t);\n\t\t}\n\t}\n\treturn func;\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","'use strict';\n\nvar hasPropertyDescriptors = require('has-property-descriptors')();\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = hasPropertyDescriptors && GetIntrinsic('%Object.defineProperty%', true);\n\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar gopd = require('gopd');\n\n/** @type {(obj: Record, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */\nmodule.exports = function defineDataProperty(\n\tobj,\n\tproperty,\n\tvalue\n) {\n\tif (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n\t\tthrow new $TypeError('`obj` must be an object or a function`');\n\t}\n\tif (typeof property !== 'string' && typeof property !== 'symbol') {\n\t\tthrow new $TypeError('`property` must be a string or a symbol`');\n\t}\n\tif (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {\n\t\tthrow new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {\n\t\tthrow new $TypeError('`nonWritable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {\n\t\tthrow new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 6 && typeof arguments[6] !== 'boolean') {\n\t\tthrow new $TypeError('`loose`, if provided, must be a boolean');\n\t}\n\n\tvar nonEnumerable = arguments.length > 3 ? arguments[3] : null;\n\tvar nonWritable = arguments.length > 4 ? arguments[4] : null;\n\tvar nonConfigurable = arguments.length > 5 ? arguments[5] : null;\n\tvar loose = arguments.length > 6 ? arguments[6] : false;\n\n\t/* @type {false | TypedPropertyDescriptor} */\n\tvar desc = !!gopd && gopd(obj, property);\n\n\tif ($defineProperty) {\n\t\t$defineProperty(obj, property, {\n\t\t\tconfigurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,\n\t\t\tenumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,\n\t\t\tvalue: value,\n\t\t\twritable: nonWritable === null && desc ? desc.writable : !nonWritable\n\t\t});\n\t} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {\n\t\t// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable\n\t\tobj[property] = value; // eslint-disable-line no-param-reassign\n\t} else {\n\t\tthrow new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');\n\t}\n};\n","'use strict';\n\nvar keys = require('object-keys');\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';\n\nvar toStr = Object.prototype.toString;\nvar concat = Array.prototype.concat;\nvar defineDataProperty = require('define-data-property');\n\nvar isFunction = function (fn) {\n\treturn typeof fn === 'function' && toStr.call(fn) === '[object Function]';\n};\n\nvar supportsDescriptors = require('has-property-descriptors')();\n\nvar defineProperty = function (object, name, value, predicate) {\n\tif (name in object) {\n\t\tif (predicate === true) {\n\t\t\tif (object[name] === value) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (!isFunction(predicate) || !predicate()) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (supportsDescriptors) {\n\t\tdefineDataProperty(object, name, value, true);\n\t} else {\n\t\tdefineDataProperty(object, name, value);\n\t}\n};\n\nvar defineProperties = function (object, map) {\n\tvar predicates = arguments.length > 2 ? arguments[2] : {};\n\tvar props = keys(map);\n\tif (hasSymbols) {\n\t\tprops = concat.call(props, Object.getOwnPropertySymbols(map));\n\t}\n\tfor (var i = 0; i < props.length; i += 1) {\n\t\tdefineProperty(object, props[i], map[props[i]], predicates[props[i]]);\n\t}\n};\n\ndefineProperties.supportsDescriptors = !!supportsDescriptors;\n\nmodule.exports = defineProperties;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar has = require('has');\n\nvar toStringTag = hasToStringTag ? Symbol.toStringTag : null;\n\nmodule.exports = function setToStringTag(object, value) {\n\tvar overrideIfSet = arguments.length > 2 && arguments[2] && arguments[2].force;\n\tif (toStringTag && (overrideIfSet || !has(object, toStringTag))) {\n\t\tif ($defineProperty) {\n\t\t\t$defineProperty(object, toStringTag, {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: false,\n\t\t\t\tvalue: value,\n\t\t\t\twritable: false\n\t\t\t});\n\t\t} else {\n\t\t\tobject[toStringTag] = value; // eslint-disable-line no-param-reassign\n\t\t}\n\t}\n};\n","'use strict';\n\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';\n\nvar isPrimitive = require('./helpers/isPrimitive');\nvar isCallable = require('is-callable');\nvar isDate = require('is-date-object');\nvar isSymbol = require('is-symbol');\n\nvar ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) {\n\tif (typeof O === 'undefined' || O === null) {\n\t\tthrow new TypeError('Cannot call method on ' + O);\n\t}\n\tif (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) {\n\t\tthrow new TypeError('hint must be \"string\" or \"number\"');\n\t}\n\tvar methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString'];\n\tvar method, result, i;\n\tfor (i = 0; i < methodNames.length; ++i) {\n\t\tmethod = O[methodNames[i]];\n\t\tif (isCallable(method)) {\n\t\t\tresult = method.call(O);\n\t\t\tif (isPrimitive(result)) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t}\n\tthrow new TypeError('No default value');\n};\n\nvar GetMethod = function GetMethod(O, P) {\n\tvar func = O[P];\n\tif (func !== null && typeof func !== 'undefined') {\n\t\tif (!isCallable(func)) {\n\t\t\tthrow new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function');\n\t\t}\n\t\treturn func;\n\t}\n\treturn void 0;\n};\n\n// http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive\nmodule.exports = function ToPrimitive(input) {\n\tif (isPrimitive(input)) {\n\t\treturn input;\n\t}\n\tvar hint = 'default';\n\tif (arguments.length > 1) {\n\t\tif (arguments[1] === String) {\n\t\t\thint = 'string';\n\t\t} else if (arguments[1] === Number) {\n\t\t\thint = 'number';\n\t\t}\n\t}\n\n\tvar exoticToPrim;\n\tif (hasSymbols) {\n\t\tif (Symbol.toPrimitive) {\n\t\t\texoticToPrim = GetMethod(input, Symbol.toPrimitive);\n\t\t} else if (isSymbol(input)) {\n\t\t\texoticToPrim = Symbol.prototype.valueOf;\n\t\t}\n\t}\n\tif (typeof exoticToPrim !== 'undefined') {\n\t\tvar result = exoticToPrim.call(input, hint);\n\t\tif (isPrimitive(result)) {\n\t\t\treturn result;\n\t\t}\n\t\tthrow new TypeError('unable to convert exotic object to primitive');\n\t}\n\tif (hint === 'default' && (isDate(input) || isSymbol(input))) {\n\t\thint = 'string';\n\t}\n\treturn ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint);\n};\n","'use strict';\n\nmodule.exports = function isPrimitive(value) {\n\treturn value === null || (typeof value !== 'function' && typeof value !== 'object');\n};\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slice.call(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n args.concat(slice.call(arguments))\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n } else {\n return target.apply(\n that,\n args.concat(slice.call(arguments))\n );\n }\n };\n\n var boundLength = Math.max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs.push('$' + i);\n }\n\n bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\nvar functionsHaveNames = function functionsHaveNames() {\n\treturn typeof function f() {}.name === 'string';\n};\n\nvar gOPD = Object.getOwnPropertyDescriptor;\nif (gOPD) {\n\ttry {\n\t\tgOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\tgOPD = null;\n\t}\n}\n\nfunctionsHaveNames.functionsHaveConfigurableNames = function functionsHaveConfigurableNames() {\n\tif (!functionsHaveNames() || !gOPD) {\n\t\treturn false;\n\t}\n\tvar desc = gOPD(function () {}, 'name');\n\treturn !!desc && !!desc.configurable;\n};\n\nvar $bind = Function.prototype.bind;\n\nfunctionsHaveNames.boundFunctionsHaveNames = function boundFunctionsHaveNames() {\n\treturn functionsHaveNames() && typeof $bind === 'function' && function f() {}.bind().name !== '';\n};\n\nmodule.exports = functionsHaveNames;\n","'use strict';\n\nvar undefined;\n\nvar $SyntaxError = SyntaxError;\nvar $Function = Function;\nvar $TypeError = TypeError;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\nif ($gOPD) {\n\ttry {\n\t\t$gOPD({}, '');\n\t} catch (e) {\n\t\t$gOPD = null; // this is IE 8, which has a broken gOPD\n\t}\n}\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\nvar hasProto = require('has-proto')();\n\nvar getProto = Object.getPrototypeOf || (\n\thasProto\n\t\t? function (x) { return x.__proto__; } // eslint-disable-line no-proto\n\t\t: null\n);\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,\n\t'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': EvalError,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': Object,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': RangeError,\n\t'%ReferenceError%': ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nif (getProto) {\n\ttry {\n\t\tnull.error; // eslint-disable-line no-unused-expressions\n\t} catch (e) {\n\t\t// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n\t\tvar errorProto = getProto(getProto(e));\n\t\tINTRINSICS['%Error.prototype%'] = errorProto;\n\t}\n}\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen && getProto) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('has');\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\nvar $exec = bind.call(Function.call, RegExp.prototype.exec);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tif ($exec(/^%?[^%]*%?$/, name) === null) {\n\t\tthrow new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');\n\t}\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\n\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasPropertyDescriptors = function hasPropertyDescriptors() {\n\tif ($defineProperty) {\n\t\ttry {\n\t\t\t$defineProperty({}, 'a', { value: 1 });\n\t\t\treturn true;\n\t\t} catch (e) {\n\t\t\t// IE 8 has a broken defineProperty\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn false;\n};\n\nhasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {\n\t// node v0.6 has a bug where array lengths can be Set but not Defined\n\tif (!hasPropertyDescriptors()) {\n\t\treturn null;\n\t}\n\ttry {\n\t\treturn $defineProperty([], 'length', { value: 1 }).length !== 1;\n\t} catch (e) {\n\t\t// In Firefox 4-22, defining length on an array throws an exception.\n\t\treturn true;\n\t}\n};\n\nmodule.exports = hasPropertyDescriptors;\n","'use strict';\n\nvar test = {\n\tfoo: {}\n};\n\nvar $Object = Object;\n\nmodule.exports = function hasProto() {\n\treturn { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar hasSymbols = require('has-symbols/shams');\n\nmodule.exports = function hasToStringTagShams() {\n\treturn hasSymbols() && !!Symbol.toStringTag;\n};\n","'use strict';\n\nvar hasOwnProperty = {}.hasOwnProperty;\nvar call = Function.prototype.call;\n\nmodule.exports = call.bind ? call.bind(hasOwnProperty) : function (O, P) {\n return call.call(hasOwnProperty, O, P);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar has = require('has');\nvar channel = require('side-channel')();\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar SLOT = {\n\tassert: function (O, slot) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tchannel.assert(O);\n\t\tif (!SLOT.has(O, slot)) {\n\t\t\tthrow new $TypeError('`' + slot + '` is not present on `O`');\n\t\t}\n\t},\n\tget: function (O, slot) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tvar slots = channel.get(O);\n\t\treturn slots && slots['$' + slot];\n\t},\n\thas: function (O, slot) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tvar slots = channel.get(O);\n\t\treturn !!slots && has(slots, '$' + slot);\n\t},\n\tset: function (O, slot, V) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tvar slots = channel.get(O);\n\t\tif (!slots) {\n\t\t\tslots = {};\n\t\t\tchannel.set(O, slots);\n\t\t}\n\t\tslots['$' + slot] = V;\n\t}\n};\n\nif (Object.freeze) {\n\tObject.freeze(SLOT);\n}\n\nmodule.exports = SLOT;\n","'use strict';\n\nvar fnToStr = Function.prototype.toString;\nvar reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;\nvar badArrayLike;\nvar isCallableMarker;\nif (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {\n\ttry {\n\t\tbadArrayLike = Object.defineProperty({}, 'length', {\n\t\t\tget: function () {\n\t\t\t\tthrow isCallableMarker;\n\t\t\t}\n\t\t});\n\t\tisCallableMarker = {};\n\t\t// eslint-disable-next-line no-throw-literal\n\t\treflectApply(function () { throw 42; }, null, badArrayLike);\n\t} catch (_) {\n\t\tif (_ !== isCallableMarker) {\n\t\t\treflectApply = null;\n\t\t}\n\t}\n} else {\n\treflectApply = null;\n}\n\nvar constructorRegex = /^\\s*class\\b/;\nvar isES6ClassFn = function isES6ClassFunction(value) {\n\ttry {\n\t\tvar fnStr = fnToStr.call(value);\n\t\treturn constructorRegex.test(fnStr);\n\t} catch (e) {\n\t\treturn false; // not a function\n\t}\n};\n\nvar tryFunctionObject = function tryFunctionToStr(value) {\n\ttry {\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tfnToStr.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\nvar toStr = Object.prototype.toString;\nvar objectClass = '[object Object]';\nvar fnClass = '[object Function]';\nvar genClass = '[object GeneratorFunction]';\nvar ddaClass = '[object HTMLAllCollection]'; // IE 11\nvar ddaClass2 = '[object HTML document.all class]';\nvar ddaClass3 = '[object HTMLCollection]'; // IE 9-10\nvar hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag`\n\nvar isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing\n\nvar isDDA = function isDocumentDotAll() { return false; };\nif (typeof document === 'object') {\n\t// Firefox 3 canonicalizes DDA to undefined when it's not accessed directly\n\tvar all = document.all;\n\tif (toStr.call(all) === toStr.call(document.all)) {\n\t\tisDDA = function isDocumentDotAll(value) {\n\t\t\t/* globals document: false */\n\t\t\t// in IE 6-8, typeof document.all is \"object\" and it's truthy\n\t\t\tif ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) {\n\t\t\t\ttry {\n\t\t\t\t\tvar str = toStr.call(value);\n\t\t\t\t\treturn (\n\t\t\t\t\t\tstr === ddaClass\n\t\t\t\t\t\t|| str === ddaClass2\n\t\t\t\t\t\t|| str === ddaClass3 // opera 12.16\n\t\t\t\t\t\t|| str === objectClass // IE 6-8\n\t\t\t\t\t) && value('') == null; // eslint-disable-line eqeqeq\n\t\t\t\t} catch (e) { /**/ }\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\t}\n}\n\nmodule.exports = reflectApply\n\t? function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\ttry {\n\t\t\treflectApply(value, null, badArrayLike);\n\t\t} catch (e) {\n\t\t\tif (e !== isCallableMarker) { return false; }\n\t\t}\n\t\treturn !isES6ClassFn(value) && tryFunctionObject(value);\n\t}\n\t: function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\tif (hasToStringTag) { return tryFunctionObject(value); }\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tvar strClass = toStr.call(value);\n\t\tif (strClass !== fnClass && strClass !== genClass && !(/^\\[object HTML/).test(strClass)) { return false; }\n\t\treturn tryFunctionObject(value);\n\t};\n","'use strict';\n\nvar getDay = Date.prototype.getDay;\nvar tryDateObject = function tryDateGetDayCall(value) {\n\ttry {\n\t\tgetDay.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\n\nvar toStr = Object.prototype.toString;\nvar dateClass = '[object Date]';\nvar hasToStringTag = require('has-tostringtag/shams')();\n\nmodule.exports = function isDateObject(value) {\n\tif (typeof value !== 'object' || value === null) {\n\t\treturn false;\n\t}\n\treturn hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass;\n};\n","'use strict';\n\nvar callBound = require('call-bind/callBound');\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar has;\nvar $exec;\nvar isRegexMarker;\nvar badStringifier;\n\nif (hasToStringTag) {\n\thas = callBound('Object.prototype.hasOwnProperty');\n\t$exec = callBound('RegExp.prototype.exec');\n\tisRegexMarker = {};\n\n\tvar throwRegexMarker = function () {\n\t\tthrow isRegexMarker;\n\t};\n\tbadStringifier = {\n\t\ttoString: throwRegexMarker,\n\t\tvalueOf: throwRegexMarker\n\t};\n\n\tif (typeof Symbol.toPrimitive === 'symbol') {\n\t\tbadStringifier[Symbol.toPrimitive] = throwRegexMarker;\n\t}\n}\n\nvar $toString = callBound('Object.prototype.toString');\nvar gOPD = Object.getOwnPropertyDescriptor;\nvar regexClass = '[object RegExp]';\n\nmodule.exports = hasToStringTag\n\t// eslint-disable-next-line consistent-return\n\t? function isRegex(value) {\n\t\tif (!value || typeof value !== 'object') {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar descriptor = gOPD(value, 'lastIndex');\n\t\tvar hasLastIndexDataProperty = descriptor && has(descriptor, 'value');\n\t\tif (!hasLastIndexDataProperty) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\t$exec(value, badStringifier);\n\t\t} catch (e) {\n\t\t\treturn e === isRegexMarker;\n\t\t}\n\t}\n\t: function isRegex(value) {\n\t\t// In older browsers, typeof regex incorrectly returns 'function'\n\t\tif (!value || (typeof value !== 'object' && typeof value !== 'function')) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $toString(value) === regexClass;\n\t};\n","'use strict';\n\nvar toStr = Object.prototype.toString;\nvar hasSymbols = require('has-symbols')();\n\nif (hasSymbols) {\n\tvar symToStr = Symbol.prototype.toString;\n\tvar symStringRegex = /^Symbol\\(.*\\)$/;\n\tvar isSymbolObject = function isRealSymbolObject(value) {\n\t\tif (typeof value.valueOf() !== 'symbol') {\n\t\t\treturn false;\n\t\t}\n\t\treturn symStringRegex.test(symToStr.call(value));\n\t};\n\n\tmodule.exports = function isSymbol(value) {\n\t\tif (typeof value === 'symbol') {\n\t\t\treturn true;\n\t\t}\n\t\tif (toStr.call(value) !== '[object Symbol]') {\n\t\t\treturn false;\n\t\t}\n\t\ttry {\n\t\t\treturn isSymbolObject(value);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n} else {\n\n\tmodule.exports = function isSymbol(value) {\n\t\t// this environment does not support Symbols.\n\t\treturn false && value;\n\t};\n}\n","var hasMap = typeof Map === 'function' && Map.prototype;\nvar mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;\nvar mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;\nvar mapForEach = hasMap && Map.prototype.forEach;\nvar hasSet = typeof Set === 'function' && Set.prototype;\nvar setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;\nvar setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;\nvar setForEach = hasSet && Set.prototype.forEach;\nvar hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;\nvar weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;\nvar hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;\nvar weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;\nvar hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;\nvar weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;\nvar booleanValueOf = Boolean.prototype.valueOf;\nvar objectToString = Object.prototype.toString;\nvar functionToString = Function.prototype.toString;\nvar $match = String.prototype.match;\nvar $slice = String.prototype.slice;\nvar $replace = String.prototype.replace;\nvar $toUpperCase = String.prototype.toUpperCase;\nvar $toLowerCase = String.prototype.toLowerCase;\nvar $test = RegExp.prototype.test;\nvar $concat = Array.prototype.concat;\nvar $join = Array.prototype.join;\nvar $arrSlice = Array.prototype.slice;\nvar $floor = Math.floor;\nvar bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;\nvar gOPS = Object.getOwnPropertySymbols;\nvar symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;\nvar hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';\n// ie, `has-tostringtag/shams\nvar toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')\n ? Symbol.toStringTag\n : null;\nvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\nvar gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (\n [].__proto__ === Array.prototype // eslint-disable-line no-proto\n ? function (O) {\n return O.__proto__; // eslint-disable-line no-proto\n }\n : null\n);\n\nfunction addNumericSeparator(num, str) {\n if (\n num === Infinity\n || num === -Infinity\n || num !== num\n || (num && num > -1000 && num < 1000)\n || $test.call(/e/, str)\n ) {\n return str;\n }\n var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;\n if (typeof num === 'number') {\n var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)\n if (int !== num) {\n var intStr = String(int);\n var dec = $slice.call(str, intStr.length + 1);\n return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');\n }\n }\n return $replace.call(str, sepRegex, '$&_');\n}\n\nvar utilInspect = require('./util.inspect');\nvar inspectCustom = utilInspect.custom;\nvar inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;\n\nmodule.exports = function inspect_(obj, options, depth, seen) {\n var opts = options || {};\n\n if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {\n throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');\n }\n if (\n has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'\n ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity\n : opts.maxStringLength !== null\n )\n ) {\n throw new TypeError('option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`');\n }\n var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;\n if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {\n throw new TypeError('option \"customInspect\", if provided, must be `true`, `false`, or `\\'symbol\\'`');\n }\n\n if (\n has(opts, 'indent')\n && opts.indent !== null\n && opts.indent !== '\\t'\n && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)\n ) {\n throw new TypeError('option \"indent\" must be \"\\\\t\", an integer > 0, or `null`');\n }\n if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {\n throw new TypeError('option \"numericSeparator\", if provided, must be `true` or `false`');\n }\n var numericSeparator = opts.numericSeparator;\n\n if (typeof obj === 'undefined') {\n return 'undefined';\n }\n if (obj === null) {\n return 'null';\n }\n if (typeof obj === 'boolean') {\n return obj ? 'true' : 'false';\n }\n\n if (typeof obj === 'string') {\n return inspectString(obj, opts);\n }\n if (typeof obj === 'number') {\n if (obj === 0) {\n return Infinity / obj > 0 ? '0' : '-0';\n }\n var str = String(obj);\n return numericSeparator ? addNumericSeparator(obj, str) : str;\n }\n if (typeof obj === 'bigint') {\n var bigIntStr = String(obj) + 'n';\n return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;\n }\n\n var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;\n if (typeof depth === 'undefined') { depth = 0; }\n if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {\n return isArray(obj) ? '[Array]' : '[Object]';\n }\n\n var indent = getIndent(opts, depth);\n\n if (typeof seen === 'undefined') {\n seen = [];\n } else if (indexOf(seen, obj) >= 0) {\n return '[Circular]';\n }\n\n function inspect(value, from, noIndent) {\n if (from) {\n seen = $arrSlice.call(seen);\n seen.push(from);\n }\n if (noIndent) {\n var newOpts = {\n depth: opts.depth\n };\n if (has(opts, 'quoteStyle')) {\n newOpts.quoteStyle = opts.quoteStyle;\n }\n return inspect_(value, newOpts, depth + 1, seen);\n }\n return inspect_(value, opts, depth + 1, seen);\n }\n\n if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable\n var name = nameOf(obj);\n var keys = arrObjKeys(obj, inspect);\n return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');\n }\n if (isSymbol(obj)) {\n var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\\(.*\\))_[^)]*$/, '$1') : symToString.call(obj);\n return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;\n }\n if (isElement(obj)) {\n var s = '<' + $toLowerCase.call(String(obj.nodeName));\n var attrs = obj.attributes || [];\n for (var i = 0; i < attrs.length; i++) {\n s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);\n }\n s += '>';\n if (obj.childNodes && obj.childNodes.length) { s += '...'; }\n s += '';\n return s;\n }\n if (isArray(obj)) {\n if (obj.length === 0) { return '[]'; }\n var xs = arrObjKeys(obj, inspect);\n if (indent && !singleLineValues(xs)) {\n return '[' + indentedJoin(xs, indent) + ']';\n }\n return '[ ' + $join.call(xs, ', ') + ' ]';\n }\n if (isError(obj)) {\n var parts = arrObjKeys(obj, inspect);\n if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {\n return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';\n }\n if (parts.length === 0) { return '[' + String(obj) + ']'; }\n return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';\n }\n if (typeof obj === 'object' && customInspect) {\n if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {\n return utilInspect(obj, { depth: maxDepth - depth });\n } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {\n return obj.inspect();\n }\n }\n if (isMap(obj)) {\n var mapParts = [];\n if (mapForEach) {\n mapForEach.call(obj, function (value, key) {\n mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));\n });\n }\n return collectionOf('Map', mapSize.call(obj), mapParts, indent);\n }\n if (isSet(obj)) {\n var setParts = [];\n if (setForEach) {\n setForEach.call(obj, function (value) {\n setParts.push(inspect(value, obj));\n });\n }\n return collectionOf('Set', setSize.call(obj), setParts, indent);\n }\n if (isWeakMap(obj)) {\n return weakCollectionOf('WeakMap');\n }\n if (isWeakSet(obj)) {\n return weakCollectionOf('WeakSet');\n }\n if (isWeakRef(obj)) {\n return weakCollectionOf('WeakRef');\n }\n if (isNumber(obj)) {\n return markBoxed(inspect(Number(obj)));\n }\n if (isBigInt(obj)) {\n return markBoxed(inspect(bigIntValueOf.call(obj)));\n }\n if (isBoolean(obj)) {\n return markBoxed(booleanValueOf.call(obj));\n }\n if (isString(obj)) {\n return markBoxed(inspect(String(obj)));\n }\n if (!isDate(obj) && !isRegExp(obj)) {\n var ys = arrObjKeys(obj, inspect);\n var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;\n var protoTag = obj instanceof Object ? '' : 'null prototype';\n var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';\n var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';\n var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');\n if (ys.length === 0) { return tag + '{}'; }\n if (indent) {\n return tag + '{' + indentedJoin(ys, indent) + '}';\n }\n return tag + '{ ' + $join.call(ys, ', ') + ' }';\n }\n return String(obj);\n};\n\nfunction wrapQuotes(s, defaultStyle, opts) {\n var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '\"' : \"'\";\n return quoteChar + s + quoteChar;\n}\n\nfunction quote(s) {\n return $replace.call(String(s), /\"/g, '"');\n}\n\nfunction isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\n\n// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives\nfunction isSymbol(obj) {\n if (hasShammedSymbols) {\n return obj && typeof obj === 'object' && obj instanceof Symbol;\n }\n if (typeof obj === 'symbol') {\n return true;\n }\n if (!obj || typeof obj !== 'object' || !symToString) {\n return false;\n }\n try {\n symToString.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isBigInt(obj) {\n if (!obj || typeof obj !== 'object' || !bigIntValueOf) {\n return false;\n }\n try {\n bigIntValueOf.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };\nfunction has(obj, key) {\n return hasOwn.call(obj, key);\n}\n\nfunction toStr(obj) {\n return objectToString.call(obj);\n}\n\nfunction nameOf(f) {\n if (f.name) { return f.name; }\n var m = $match.call(functionToString.call(f), /^function\\s*([\\w$]+)/);\n if (m) { return m[1]; }\n return null;\n}\n\nfunction indexOf(xs, x) {\n if (xs.indexOf) { return xs.indexOf(x); }\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) { return i; }\n }\n return -1;\n}\n\nfunction isMap(x) {\n if (!mapSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n mapSize.call(x);\n try {\n setSize.call(x);\n } catch (s) {\n return true;\n }\n return x instanceof Map; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakMap(x) {\n if (!weakMapHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakMapHas.call(x, weakMapHas);\n try {\n weakSetHas.call(x, weakSetHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakMap; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakRef(x) {\n if (!weakRefDeref || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakRefDeref.call(x);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isSet(x) {\n if (!setSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n setSize.call(x);\n try {\n mapSize.call(x);\n } catch (m) {\n return true;\n }\n return x instanceof Set; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakSet(x) {\n if (!weakSetHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakSetHas.call(x, weakSetHas);\n try {\n weakMapHas.call(x, weakMapHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakSet; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isElement(x) {\n if (!x || typeof x !== 'object') { return false; }\n if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {\n return true;\n }\n return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';\n}\n\nfunction inspectString(str, opts) {\n if (str.length > opts.maxStringLength) {\n var remaining = str.length - opts.maxStringLength;\n var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');\n return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;\n }\n // eslint-disable-next-line no-control-regex\n var s = $replace.call($replace.call(str, /(['\\\\])/g, '\\\\$1'), /[\\x00-\\x1f]/g, lowbyte);\n return wrapQuotes(s, 'single', opts);\n}\n\nfunction lowbyte(c) {\n var n = c.charCodeAt(0);\n var x = {\n 8: 'b',\n 9: 't',\n 10: 'n',\n 12: 'f',\n 13: 'r'\n }[n];\n if (x) { return '\\\\' + x; }\n return '\\\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));\n}\n\nfunction markBoxed(str) {\n return 'Object(' + str + ')';\n}\n\nfunction weakCollectionOf(type) {\n return type + ' { ? }';\n}\n\nfunction collectionOf(type, size, entries, indent) {\n var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');\n return type + ' (' + size + ') {' + joinedEntries + '}';\n}\n\nfunction singleLineValues(xs) {\n for (var i = 0; i < xs.length; i++) {\n if (indexOf(xs[i], '\\n') >= 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction getIndent(opts, depth) {\n var baseIndent;\n if (opts.indent === '\\t') {\n baseIndent = '\\t';\n } else if (typeof opts.indent === 'number' && opts.indent > 0) {\n baseIndent = $join.call(Array(opts.indent + 1), ' ');\n } else {\n return null;\n }\n return {\n base: baseIndent,\n prev: $join.call(Array(depth + 1), baseIndent)\n };\n}\n\nfunction indentedJoin(xs, indent) {\n if (xs.length === 0) { return ''; }\n var lineJoiner = '\\n' + indent.prev + indent.base;\n return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\\n' + indent.prev;\n}\n\nfunction arrObjKeys(obj, inspect) {\n var isArr = isArray(obj);\n var xs = [];\n if (isArr) {\n xs.length = obj.length;\n for (var i = 0; i < obj.length; i++) {\n xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';\n }\n }\n var syms = typeof gOPS === 'function' ? gOPS(obj) : [];\n var symMap;\n if (hasShammedSymbols) {\n symMap = {};\n for (var k = 0; k < syms.length; k++) {\n symMap['$' + syms[k]] = syms[k];\n }\n }\n\n for (var key in obj) { // eslint-disable-line no-restricted-syntax\n if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {\n // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section\n continue; // eslint-disable-line no-restricted-syntax, no-continue\n } else if ($test.call(/[^\\w$]/, key)) {\n xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));\n } else {\n xs.push(key + ': ' + inspect(obj[key], obj));\n }\n }\n if (typeof gOPS === 'function') {\n for (var j = 0; j < syms.length; j++) {\n if (isEnumerable.call(obj, syms[j])) {\n xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));\n }\n }\n }\n return xs;\n}\n","'use strict';\n\nvar keysShim;\nif (!Object.keys) {\n\t// modified from https://github.com/es-shims/es5-shim\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar toStr = Object.prototype.toString;\n\tvar isArgs = require('./isArguments'); // eslint-disable-line global-require\n\tvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\tvar hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');\n\tvar hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');\n\tvar dontEnums = [\n\t\t'toString',\n\t\t'toLocaleString',\n\t\t'valueOf',\n\t\t'hasOwnProperty',\n\t\t'isPrototypeOf',\n\t\t'propertyIsEnumerable',\n\t\t'constructor'\n\t];\n\tvar equalsConstructorPrototype = function (o) {\n\t\tvar ctor = o.constructor;\n\t\treturn ctor && ctor.prototype === o;\n\t};\n\tvar excludedKeys = {\n\t\t$applicationCache: true,\n\t\t$console: true,\n\t\t$external: true,\n\t\t$frame: true,\n\t\t$frameElement: true,\n\t\t$frames: true,\n\t\t$innerHeight: true,\n\t\t$innerWidth: true,\n\t\t$onmozfullscreenchange: true,\n\t\t$onmozfullscreenerror: true,\n\t\t$outerHeight: true,\n\t\t$outerWidth: true,\n\t\t$pageXOffset: true,\n\t\t$pageYOffset: true,\n\t\t$parent: true,\n\t\t$scrollLeft: true,\n\t\t$scrollTop: true,\n\t\t$scrollX: true,\n\t\t$scrollY: true,\n\t\t$self: true,\n\t\t$webkitIndexedDB: true,\n\t\t$webkitStorageInfo: true,\n\t\t$window: true\n\t};\n\tvar hasAutomationEqualityBug = (function () {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined') { return false; }\n\t\tfor (var k in window) {\n\t\t\ttry {\n\t\t\t\tif (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tequalsConstructorPrototype(window[k]);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}());\n\tvar equalsConstructorPrototypeIfNotBuggy = function (o) {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined' || !hasAutomationEqualityBug) {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t}\n\t\ttry {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tkeysShim = function keys(object) {\n\t\tvar isObject = object !== null && typeof object === 'object';\n\t\tvar isFunction = toStr.call(object) === '[object Function]';\n\t\tvar isArguments = isArgs(object);\n\t\tvar isString = isObject && toStr.call(object) === '[object String]';\n\t\tvar theKeys = [];\n\n\t\tif (!isObject && !isFunction && !isArguments) {\n\t\t\tthrow new TypeError('Object.keys called on a non-object');\n\t\t}\n\n\t\tvar skipProto = hasProtoEnumBug && isFunction;\n\t\tif (isString && object.length > 0 && !has.call(object, 0)) {\n\t\t\tfor (var i = 0; i < object.length; ++i) {\n\t\t\t\ttheKeys.push(String(i));\n\t\t\t}\n\t\t}\n\n\t\tif (isArguments && object.length > 0) {\n\t\t\tfor (var j = 0; j < object.length; ++j) {\n\t\t\t\ttheKeys.push(String(j));\n\t\t\t}\n\t\t} else {\n\t\t\tfor (var name in object) {\n\t\t\t\tif (!(skipProto && name === 'prototype') && has.call(object, name)) {\n\t\t\t\t\ttheKeys.push(String(name));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (hasDontEnumBug) {\n\t\t\tvar skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);\n\n\t\t\tfor (var k = 0; k < dontEnums.length; ++k) {\n\t\t\t\tif (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {\n\t\t\t\t\ttheKeys.push(dontEnums[k]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn theKeys;\n\t};\n}\nmodule.exports = keysShim;\n","'use strict';\n\nvar slice = Array.prototype.slice;\nvar isArgs = require('./isArguments');\n\nvar origKeys = Object.keys;\nvar keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');\n\nvar originalKeys = Object.keys;\n\nkeysShim.shim = function shimObjectKeys() {\n\tif (Object.keys) {\n\t\tvar keysWorksWithArguments = (function () {\n\t\t\t// Safari 5.0 bug\n\t\t\tvar args = Object.keys(arguments);\n\t\t\treturn args && args.length === arguments.length;\n\t\t}(1, 2));\n\t\tif (!keysWorksWithArguments) {\n\t\t\tObject.keys = function keys(object) { // eslint-disable-line func-name-matching\n\t\t\t\tif (isArgs(object)) {\n\t\t\t\t\treturn originalKeys(slice.call(object));\n\t\t\t\t}\n\t\t\t\treturn originalKeys(object);\n\t\t\t};\n\t\t}\n\t} else {\n\t\tObject.keys = keysShim;\n\t}\n\treturn Object.keys || keysShim;\n};\n\nmodule.exports = keysShim;\n","'use strict';\n\nvar toStr = Object.prototype.toString;\n\nmodule.exports = function isArguments(value) {\n\tvar str = toStr.call(value);\n\tvar isArgs = str === '[object Arguments]';\n\tif (!isArgs) {\n\t\tisArgs = str !== '[object Array]' &&\n\t\t\tvalue !== null &&\n\t\t\ttypeof value === 'object' &&\n\t\t\ttypeof value.length === 'number' &&\n\t\t\tvalue.length >= 0 &&\n\t\t\ttoStr.call(value.callee) === '[object Function]';\n\t}\n\treturn isArgs;\n};\n","'use strict';\n\nvar setFunctionName = require('set-function-name');\n\nvar $Object = Object;\nvar $TypeError = TypeError;\n\nmodule.exports = setFunctionName(function flags() {\n\tif (this != null && this !== $Object(this)) {\n\t\tthrow new $TypeError('RegExp.prototype.flags getter called on non-object');\n\t}\n\tvar result = '';\n\tif (this.hasIndices) {\n\t\tresult += 'd';\n\t}\n\tif (this.global) {\n\t\tresult += 'g';\n\t}\n\tif (this.ignoreCase) {\n\t\tresult += 'i';\n\t}\n\tif (this.multiline) {\n\t\tresult += 'm';\n\t}\n\tif (this.dotAll) {\n\t\tresult += 's';\n\t}\n\tif (this.unicode) {\n\t\tresult += 'u';\n\t}\n\tif (this.unicodeSets) {\n\t\tresult += 'v';\n\t}\n\tif (this.sticky) {\n\t\tresult += 'y';\n\t}\n\treturn result;\n}, 'get flags', true);\n\n","'use strict';\n\nvar define = require('define-properties');\nvar callBind = require('call-bind');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar flagsBound = callBind(getPolyfill());\n\ndefine(flagsBound, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = flagsBound;\n","'use strict';\n\nvar implementation = require('./implementation');\n\nvar supportsDescriptors = require('define-properties').supportsDescriptors;\nvar $gOPD = Object.getOwnPropertyDescriptor;\n\nmodule.exports = function getPolyfill() {\n\tif (supportsDescriptors && (/a/mig).flags === 'gim') {\n\t\tvar descriptor = $gOPD(RegExp.prototype, 'flags');\n\t\tif (\n\t\t\tdescriptor\n\t\t\t&& typeof descriptor.get === 'function'\n\t\t\t&& typeof RegExp.prototype.dotAll === 'boolean'\n\t\t\t&& typeof RegExp.prototype.hasIndices === 'boolean'\n\t\t) {\n\t\t\t/* eslint getter-return: 0 */\n\t\t\tvar calls = '';\n\t\t\tvar o = {};\n\t\t\tObject.defineProperty(o, 'hasIndices', {\n\t\t\t\tget: function () {\n\t\t\t\t\tcalls += 'd';\n\t\t\t\t}\n\t\t\t});\n\t\t\tObject.defineProperty(o, 'sticky', {\n\t\t\t\tget: function () {\n\t\t\t\t\tcalls += 'y';\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (calls === 'dy') {\n\t\t\t\treturn descriptor.get;\n\t\t\t}\n\t\t}\n\t}\n\treturn implementation;\n};\n","'use strict';\n\nvar supportsDescriptors = require('define-properties').supportsDescriptors;\nvar getPolyfill = require('./polyfill');\nvar gOPD = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar TypeErr = TypeError;\nvar getProto = Object.getPrototypeOf;\nvar regex = /a/;\n\nmodule.exports = function shimFlags() {\n\tif (!supportsDescriptors || !getProto) {\n\t\tthrow new TypeErr('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');\n\t}\n\tvar polyfill = getPolyfill();\n\tvar proto = getProto(regex);\n\tvar descriptor = gOPD(proto, 'flags');\n\tif (!descriptor || descriptor.get !== polyfill) {\n\t\tdefineProperty(proto, 'flags', {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tget: polyfill\n\t\t});\n\t}\n\treturn polyfill;\n};\n","'use strict';\n\nvar callBound = require('call-bind/callBound');\nvar GetIntrinsic = require('get-intrinsic');\nvar isRegex = require('is-regex');\n\nvar $exec = callBound('RegExp.prototype.exec');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nmodule.exports = function regexTester(regex) {\n\tif (!isRegex(regex)) {\n\t\tthrow new $TypeError('`regex` must be a RegExp');\n\t}\n\treturn function test(s) {\n\t\treturn $exec(regex, s) !== null;\n\t};\n};\n","'use strict';\n\nvar define = require('define-data-property');\nvar hasDescriptors = require('has-property-descriptors')();\nvar functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames();\n\nvar $TypeError = TypeError;\n\nmodule.exports = function setFunctionName(fn, name) {\n\tif (typeof fn !== 'function') {\n\t\tthrow new $TypeError('`fn` is not a function');\n\t}\n\tvar loose = arguments.length > 2 && !!arguments[2];\n\tif (!loose || functionsHaveConfigurableNames) {\n\t\tif (hasDescriptors) {\n\t\t\tdefine(fn, 'name', name, true, true);\n\t\t} else {\n\t\t\tdefine(fn, 'name', name);\n\t\t}\n\t}\n\treturn fn;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bind/callBound');\nvar inspect = require('object-inspect');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $WeakMap = GetIntrinsic('%WeakMap%', true);\nvar $Map = GetIntrinsic('%Map%', true);\n\nvar $weakMapGet = callBound('WeakMap.prototype.get', true);\nvar $weakMapSet = callBound('WeakMap.prototype.set', true);\nvar $weakMapHas = callBound('WeakMap.prototype.has', true);\nvar $mapGet = callBound('Map.prototype.get', true);\nvar $mapSet = callBound('Map.prototype.set', true);\nvar $mapHas = callBound('Map.prototype.has', true);\n\n/*\n * This function traverses the list returning the node corresponding to the\n * given key.\n *\n * That node is also moved to the head of the list, so that if it's accessed\n * again we don't need to traverse the whole list. By doing so, all the recently\n * used nodes can be accessed relatively quickly.\n */\nvar listGetNode = function (list, key) { // eslint-disable-line consistent-return\n\tfor (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {\n\t\tif (curr.key === key) {\n\t\t\tprev.next = curr.next;\n\t\t\tcurr.next = list.next;\n\t\t\tlist.next = curr; // eslint-disable-line no-param-reassign\n\t\t\treturn curr;\n\t\t}\n\t}\n};\n\nvar listGet = function (objects, key) {\n\tvar node = listGetNode(objects, key);\n\treturn node && node.value;\n};\nvar listSet = function (objects, key, value) {\n\tvar node = listGetNode(objects, key);\n\tif (node) {\n\t\tnode.value = value;\n\t} else {\n\t\t// Prepend the new node to the beginning of the list\n\t\tobjects.next = { // eslint-disable-line no-param-reassign\n\t\t\tkey: key,\n\t\t\tnext: objects.next,\n\t\t\tvalue: value\n\t\t};\n\t}\n};\nvar listHas = function (objects, key) {\n\treturn !!listGetNode(objects, key);\n};\n\nmodule.exports = function getSideChannel() {\n\tvar $wm;\n\tvar $m;\n\tvar $o;\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\tget: function (key) { // eslint-disable-line consistent-return\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapGet($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapGet($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listGet($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\thas: function (key) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapHas($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapHas($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listHas($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif (!$wm) {\n\t\t\t\t\t$wm = new $WeakMap();\n\t\t\t\t}\n\t\t\t\t$weakMapSet($wm, key, value);\n\t\t\t} else if ($Map) {\n\t\t\t\tif (!$m) {\n\t\t\t\t\t$m = new $Map();\n\t\t\t\t}\n\t\t\t\t$mapSet($m, key, value);\n\t\t\t} else {\n\t\t\t\tif (!$o) {\n\t\t\t\t\t/*\n\t\t\t\t\t * Initialize the linked list as an empty node, so that we don't have\n\t\t\t\t\t * to special-case handling of the first node: we can always refer to\n\t\t\t\t\t * it as (previous node).next, instead of something like (list).head\n\t\t\t\t\t */\n\t\t\t\t\t$o = { key: {}, next: null };\n\t\t\t\t}\n\t\t\t\tlistSet($o, key, value);\n\t\t\t}\n\t\t}\n\t};\n\treturn channel;\n};\n","'use strict';\n\nvar Call = require('es-abstract/2023/Call');\nvar Get = require('es-abstract/2023/Get');\nvar GetMethod = require('es-abstract/2023/GetMethod');\nvar IsRegExp = require('es-abstract/2023/IsRegExp');\nvar ToString = require('es-abstract/2023/ToString');\nvar RequireObjectCoercible = require('es-abstract/2023/RequireObjectCoercible');\nvar callBound = require('call-bind/callBound');\nvar hasSymbols = require('has-symbols')();\nvar flagsGetter = require('regexp.prototype.flags');\n\nvar $indexOf = callBound('String.prototype.indexOf');\n\nvar regexpMatchAllPolyfill = require('./polyfill-regexp-matchall');\n\nvar getMatcher = function getMatcher(regexp) { // eslint-disable-line consistent-return\n\tvar matcherPolyfill = regexpMatchAllPolyfill();\n\tif (hasSymbols && typeof Symbol.matchAll === 'symbol') {\n\t\tvar matcher = GetMethod(regexp, Symbol.matchAll);\n\t\tif (matcher === RegExp.prototype[Symbol.matchAll] && matcher !== matcherPolyfill) {\n\t\t\treturn matcherPolyfill;\n\t\t}\n\t\treturn matcher;\n\t}\n\t// fallback for pre-Symbol.matchAll environments\n\tif (IsRegExp(regexp)) {\n\t\treturn matcherPolyfill;\n\t}\n};\n\nmodule.exports = function matchAll(regexp) {\n\tvar O = RequireObjectCoercible(this);\n\n\tif (typeof regexp !== 'undefined' && regexp !== null) {\n\t\tvar isRegExp = IsRegExp(regexp);\n\t\tif (isRegExp) {\n\t\t\t// workaround for older engines that lack RegExp.prototype.flags\n\t\t\tvar flags = 'flags' in regexp ? Get(regexp, 'flags') : flagsGetter(regexp);\n\t\t\tRequireObjectCoercible(flags);\n\t\t\tif ($indexOf(ToString(flags), 'g') < 0) {\n\t\t\t\tthrow new TypeError('matchAll requires a global regular expression');\n\t\t\t}\n\t\t}\n\n\t\tvar matcher = getMatcher(regexp);\n\t\tif (typeof matcher !== 'undefined') {\n\t\t\treturn Call(matcher, regexp, [O]);\n\t\t}\n\t}\n\n\tvar S = ToString(O);\n\t// var rx = RegExpCreate(regexp, 'g');\n\tvar rx = new RegExp(regexp, 'g');\n\treturn Call(getMatcher(rx), rx, [S]);\n};\n","'use strict';\n\nvar callBind = require('call-bind');\nvar define = require('define-properties');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar boundMatchAll = callBind(implementation);\n\ndefine(boundMatchAll, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = boundMatchAll;\n","'use strict';\n\nvar hasSymbols = require('has-symbols')();\nvar regexpMatchAll = require('./regexp-matchall');\n\nmodule.exports = function getRegExpMatchAllPolyfill() {\n\tif (!hasSymbols || typeof Symbol.matchAll !== 'symbol' || typeof RegExp.prototype[Symbol.matchAll] !== 'function') {\n\t\treturn regexpMatchAll;\n\t}\n\treturn RegExp.prototype[Symbol.matchAll];\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = function getPolyfill() {\n\tif (String.prototype.matchAll) {\n\t\ttry {\n\t\t\t''.matchAll(RegExp.prototype);\n\t\t} catch (e) {\n\t\t\treturn String.prototype.matchAll;\n\t\t}\n\t}\n\treturn implementation;\n};\n","'use strict';\n\n// var Construct = require('es-abstract/2023/Construct');\nvar CreateRegExpStringIterator = require('es-abstract/2023/CreateRegExpStringIterator');\nvar Get = require('es-abstract/2023/Get');\nvar Set = require('es-abstract/2023/Set');\nvar SpeciesConstructor = require('es-abstract/2023/SpeciesConstructor');\nvar ToLength = require('es-abstract/2023/ToLength');\nvar ToString = require('es-abstract/2023/ToString');\nvar Type = require('es-abstract/2023/Type');\nvar flagsGetter = require('regexp.prototype.flags');\nvar setFunctionName = require('set-function-name');\nvar callBound = require('call-bind/callBound');\n\nvar $indexOf = callBound('String.prototype.indexOf');\n\nvar OrigRegExp = RegExp;\n\nvar supportsConstructingWithFlags = 'flags' in RegExp.prototype;\n\nvar constructRegexWithFlags = function constructRegex(C, R) {\n\tvar matcher;\n\t// workaround for older engines that lack RegExp.prototype.flags\n\tvar flags = 'flags' in R ? Get(R, 'flags') : ToString(flagsGetter(R));\n\tif (supportsConstructingWithFlags && typeof flags === 'string') {\n\t\tmatcher = new C(R, flags);\n\t} else if (C === OrigRegExp) {\n\t\t// workaround for older engines that can not construct a RegExp with flags\n\t\tmatcher = new C(R.source, flags);\n\t} else {\n\t\tmatcher = new C(R, flags);\n\t}\n\treturn { flags: flags, matcher: matcher };\n};\n\nvar regexMatchAll = setFunctionName(function SymbolMatchAll(string) {\n\tvar R = this;\n\tif (Type(R) !== 'Object') {\n\t\tthrow new TypeError('\"this\" value must be an Object');\n\t}\n\tvar S = ToString(string);\n\tvar C = SpeciesConstructor(R, OrigRegExp);\n\n\tvar tmp = constructRegexWithFlags(C, R);\n\t// var flags = ToString(Get(R, 'flags'));\n\tvar flags = tmp.flags;\n\t// var matcher = Construct(C, [R, flags]);\n\tvar matcher = tmp.matcher;\n\n\tvar lastIndex = ToLength(Get(R, 'lastIndex'));\n\tSet(matcher, 'lastIndex', lastIndex, true);\n\tvar global = $indexOf(flags, 'g') > -1;\n\tvar fullUnicode = $indexOf(flags, 'u') > -1;\n\treturn CreateRegExpStringIterator(matcher, S, global, fullUnicode);\n}, '[Symbol.matchAll]', true);\n\nmodule.exports = regexMatchAll;\n","'use strict';\n\nvar define = require('define-properties');\nvar hasSymbols = require('has-symbols')();\nvar getPolyfill = require('./polyfill');\nvar regexpMatchAllPolyfill = require('./polyfill-regexp-matchall');\n\nvar defineP = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nmodule.exports = function shimMatchAll() {\n\tvar polyfill = getPolyfill();\n\tdefine(\n\t\tString.prototype,\n\t\t{ matchAll: polyfill },\n\t\t{ matchAll: function () { return String.prototype.matchAll !== polyfill; } }\n\t);\n\tif (hasSymbols) {\n\t\t// eslint-disable-next-line no-restricted-properties\n\t\tvar symbol = Symbol.matchAll || (Symbol['for'] ? Symbol['for']('Symbol.matchAll') : Symbol('Symbol.matchAll'));\n\t\tdefine(\n\t\t\tSymbol,\n\t\t\t{ matchAll: symbol },\n\t\t\t{ matchAll: function () { return Symbol.matchAll !== symbol; } }\n\t\t);\n\n\t\tif (defineP && gOPD) {\n\t\t\tvar desc = gOPD(Symbol, symbol);\n\t\t\tif (!desc || desc.configurable) {\n\t\t\t\tdefineP(Symbol, symbol, {\n\t\t\t\t\tconfigurable: false,\n\t\t\t\t\tenumerable: false,\n\t\t\t\t\tvalue: symbol,\n\t\t\t\t\twritable: false\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tvar regexpMatchAll = regexpMatchAllPolyfill();\n\t\tvar func = {};\n\t\tfunc[symbol] = regexpMatchAll;\n\t\tvar predicate = {};\n\t\tpredicate[symbol] = function () {\n\t\t\treturn RegExp.prototype[symbol] !== regexpMatchAll;\n\t\t};\n\t\tdefine(RegExp.prototype, func, predicate);\n\t}\n\treturn polyfill;\n};\n","'use strict';\n\nvar RequireObjectCoercible = require('es-abstract/2023/RequireObjectCoercible');\nvar ToString = require('es-abstract/2023/ToString');\nvar callBound = require('call-bind/callBound');\nvar $replace = callBound('String.prototype.replace');\n\nvar mvsIsWS = (/^\\s$/).test('\\u180E');\n/* eslint-disable no-control-regex */\nvar leftWhitespace = mvsIsWS\n\t? /^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+/\n\t: /^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+/;\nvar rightWhitespace = mvsIsWS\n\t? /[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+$/\n\t: /[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+$/;\n/* eslint-enable no-control-regex */\n\nmodule.exports = function trim() {\n\tvar S = ToString(RequireObjectCoercible(this));\n\treturn $replace($replace(S, leftWhitespace, ''), rightWhitespace, '');\n};\n","'use strict';\n\nvar callBind = require('call-bind');\nvar define = require('define-properties');\nvar RequireObjectCoercible = require('es-abstract/2023/RequireObjectCoercible');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar bound = callBind(getPolyfill());\nvar boundMethod = function trim(receiver) {\n\tRequireObjectCoercible(receiver);\n\treturn bound(receiver);\n};\n\ndefine(boundMethod, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = boundMethod;\n","'use strict';\n\nvar implementation = require('./implementation');\n\nvar zeroWidthSpace = '\\u200b';\nvar mongolianVowelSeparator = '\\u180E';\n\nmodule.exports = function getPolyfill() {\n\tif (\n\t\tString.prototype.trim\n\t\t&& zeroWidthSpace.trim() === zeroWidthSpace\n\t\t&& mongolianVowelSeparator.trim() === mongolianVowelSeparator\n\t\t&& ('_' + mongolianVowelSeparator).trim() === ('_' + mongolianVowelSeparator)\n\t\t&& (mongolianVowelSeparator + '_').trim() === (mongolianVowelSeparator + '_')\n\t) {\n\t\treturn String.prototype.trim;\n\t}\n\treturn implementation;\n};\n","'use strict';\n\nvar define = require('define-properties');\nvar getPolyfill = require('./polyfill');\n\nmodule.exports = function shimStringTrim() {\n\tvar polyfill = getPolyfill();\n\tdefine(String.prototype, { trim: polyfill }, {\n\t\ttrim: function testTrim() {\n\t\t\treturn String.prototype.trim !== polyfill;\n\t\t}\n\t});\n\treturn polyfill;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar CodePointAt = require('./CodePointAt');\nvar Type = require('./Type');\n\nvar isInteger = require('../helpers/isInteger');\nvar MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// https://262.ecma-international.org/12.0/#sec-advancestringindex\n\nmodule.exports = function AdvanceStringIndex(S, index, unicode) {\n\tif (Type(S) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `S` must be a String');\n\t}\n\tif (!isInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) {\n\t\tthrow new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53');\n\t}\n\tif (Type(unicode) !== 'Boolean') {\n\t\tthrow new $TypeError('Assertion failed: `unicode` must be a Boolean');\n\t}\n\tif (!unicode) {\n\t\treturn index + 1;\n\t}\n\tvar length = S.length;\n\tif ((index + 1) >= length) {\n\t\treturn index + 1;\n\t}\n\tvar cp = CodePointAt(S, index);\n\treturn index + cp['[[CodeUnitCount]]'];\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bind/callBound');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar IsArray = require('./IsArray');\n\nvar $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('Function.prototype.apply');\n\n// https://262.ecma-international.org/6.0/#sec-call\n\nmodule.exports = function Call(F, V) {\n\tvar argumentsList = arguments.length > 2 ? arguments[2] : [];\n\tif (!IsArray(argumentsList)) {\n\t\tthrow new $TypeError('Assertion failed: optional `argumentsList`, if provided, must be a List');\n\t}\n\treturn $apply(F, V, argumentsList);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar callBound = require('call-bind/callBound');\nvar isLeadingSurrogate = require('../helpers/isLeadingSurrogate');\nvar isTrailingSurrogate = require('../helpers/isTrailingSurrogate');\n\nvar Type = require('./Type');\nvar UTF16SurrogatePairToCodePoint = require('./UTF16SurrogatePairToCodePoint');\n\nvar $charAt = callBound('String.prototype.charAt');\nvar $charCodeAt = callBound('String.prototype.charCodeAt');\n\n// https://262.ecma-international.org/12.0/#sec-codepointat\n\nmodule.exports = function CodePointAt(string, position) {\n\tif (Type(string) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `string` must be a String');\n\t}\n\tvar size = string.length;\n\tif (position < 0 || position >= size) {\n\t\tthrow new $TypeError('Assertion failed: `position` must be >= 0, and < the length of `string`');\n\t}\n\tvar first = $charCodeAt(string, position);\n\tvar cp = $charAt(string, position);\n\tvar firstIsLeading = isLeadingSurrogate(first);\n\tvar firstIsTrailing = isTrailingSurrogate(first);\n\tif (!firstIsLeading && !firstIsTrailing) {\n\t\treturn {\n\t\t\t'[[CodePoint]]': cp,\n\t\t\t'[[CodeUnitCount]]': 1,\n\t\t\t'[[IsUnpairedSurrogate]]': false\n\t\t};\n\t}\n\tif (firstIsTrailing || (position + 1 === size)) {\n\t\treturn {\n\t\t\t'[[CodePoint]]': cp,\n\t\t\t'[[CodeUnitCount]]': 1,\n\t\t\t'[[IsUnpairedSurrogate]]': true\n\t\t};\n\t}\n\tvar second = $charCodeAt(string, position + 1);\n\tif (!isTrailingSurrogate(second)) {\n\t\treturn {\n\t\t\t'[[CodePoint]]': cp,\n\t\t\t'[[CodeUnitCount]]': 1,\n\t\t\t'[[IsUnpairedSurrogate]]': true\n\t\t};\n\t}\n\n\treturn {\n\t\t'[[CodePoint]]': UTF16SurrogatePairToCodePoint(first, second),\n\t\t'[[CodeUnitCount]]': 2,\n\t\t'[[IsUnpairedSurrogate]]': false\n\t};\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-createiterresultobject\n\nmodule.exports = function CreateIterResultObject(value, done) {\n\tif (Type(done) !== 'Boolean') {\n\t\tthrow new $TypeError('Assertion failed: Type(done) is not Boolean');\n\t}\n\treturn {\n\t\tvalue: value,\n\t\tdone: done\n\t};\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar DefineOwnProperty = require('../helpers/DefineOwnProperty');\n\nvar FromPropertyDescriptor = require('./FromPropertyDescriptor');\nvar IsDataDescriptor = require('./IsDataDescriptor');\nvar IsPropertyKey = require('./IsPropertyKey');\nvar SameValue = require('./SameValue');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-createmethodproperty\n\nmodule.exports = function CreateMethodProperty(O, P, V) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true');\n\t}\n\n\tvar newDesc = {\n\t\t'[[Configurable]]': true,\n\t\t'[[Enumerable]]': false,\n\t\t'[[Value]]': V,\n\t\t'[[Writable]]': true\n\t};\n\treturn DefineOwnProperty(\n\t\tIsDataDescriptor,\n\t\tSameValue,\n\t\tFromPropertyDescriptor,\n\t\tO,\n\t\tP,\n\t\tnewDesc\n\t);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar hasSymbols = require('has-symbols')();\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar IteratorPrototype = GetIntrinsic('%IteratorPrototype%', true);\n\nvar AdvanceStringIndex = require('./AdvanceStringIndex');\nvar CreateIterResultObject = require('./CreateIterResultObject');\nvar CreateMethodProperty = require('./CreateMethodProperty');\nvar Get = require('./Get');\nvar OrdinaryObjectCreate = require('./OrdinaryObjectCreate');\nvar RegExpExec = require('./RegExpExec');\nvar Set = require('./Set');\nvar ToLength = require('./ToLength');\nvar ToString = require('./ToString');\nvar Type = require('./Type');\n\nvar SLOT = require('internal-slot');\nvar setToStringTag = require('es-set-tostringtag');\n\nvar RegExpStringIterator = function RegExpStringIterator(R, S, global, fullUnicode) {\n\tif (Type(S) !== 'String') {\n\t\tthrow new $TypeError('`S` must be a string');\n\t}\n\tif (Type(global) !== 'Boolean') {\n\t\tthrow new $TypeError('`global` must be a boolean');\n\t}\n\tif (Type(fullUnicode) !== 'Boolean') {\n\t\tthrow new $TypeError('`fullUnicode` must be a boolean');\n\t}\n\tSLOT.set(this, '[[IteratingRegExp]]', R);\n\tSLOT.set(this, '[[IteratedString]]', S);\n\tSLOT.set(this, '[[Global]]', global);\n\tSLOT.set(this, '[[Unicode]]', fullUnicode);\n\tSLOT.set(this, '[[Done]]', false);\n};\n\nif (IteratorPrototype) {\n\tRegExpStringIterator.prototype = OrdinaryObjectCreate(IteratorPrototype);\n}\n\nvar RegExpStringIteratorNext = function next() {\n\tvar O = this; // eslint-disable-line no-invalid-this\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('receiver must be an object');\n\t}\n\tif (\n\t\t!(O instanceof RegExpStringIterator)\n\t\t|| !SLOT.has(O, '[[IteratingRegExp]]')\n\t\t|| !SLOT.has(O, '[[IteratedString]]')\n\t\t|| !SLOT.has(O, '[[Global]]')\n\t\t|| !SLOT.has(O, '[[Unicode]]')\n\t\t|| !SLOT.has(O, '[[Done]]')\n\t) {\n\t\tthrow new $TypeError('\"this\" value must be a RegExpStringIterator instance');\n\t}\n\tif (SLOT.get(O, '[[Done]]')) {\n\t\treturn CreateIterResultObject(undefined, true);\n\t}\n\tvar R = SLOT.get(O, '[[IteratingRegExp]]');\n\tvar S = SLOT.get(O, '[[IteratedString]]');\n\tvar global = SLOT.get(O, '[[Global]]');\n\tvar fullUnicode = SLOT.get(O, '[[Unicode]]');\n\tvar match = RegExpExec(R, S);\n\tif (match === null) {\n\t\tSLOT.set(O, '[[Done]]', true);\n\t\treturn CreateIterResultObject(undefined, true);\n\t}\n\tif (global) {\n\t\tvar matchStr = ToString(Get(match, '0'));\n\t\tif (matchStr === '') {\n\t\t\tvar thisIndex = ToLength(Get(R, 'lastIndex'));\n\t\t\tvar nextIndex = AdvanceStringIndex(S, thisIndex, fullUnicode);\n\t\t\tSet(R, 'lastIndex', nextIndex, true);\n\t\t}\n\t\treturn CreateIterResultObject(match, false);\n\t}\n\tSLOT.set(O, '[[Done]]', true);\n\treturn CreateIterResultObject(match, false);\n};\nCreateMethodProperty(RegExpStringIterator.prototype, 'next', RegExpStringIteratorNext);\n\nif (hasSymbols) {\n\tsetToStringTag(RegExpStringIterator.prototype, 'RegExp String Iterator');\n\n\tif (Symbol.iterator && typeof RegExpStringIterator.prototype[Symbol.iterator] !== 'function') {\n\t\tvar iteratorFn = function SymbolIterator() {\n\t\t\treturn this;\n\t\t};\n\t\tCreateMethodProperty(RegExpStringIterator.prototype, Symbol.iterator, iteratorFn);\n\t}\n}\n\n// https://262.ecma-international.org/11.0/#sec-createregexpstringiterator\nmodule.exports = function CreateRegExpStringIterator(R, S, global, fullUnicode) {\n\t// assert R.global === global && R.unicode === fullUnicode?\n\treturn new RegExpStringIterator(R, S, global, fullUnicode);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar isPropertyDescriptor = require('../helpers/isPropertyDescriptor');\nvar DefineOwnProperty = require('../helpers/DefineOwnProperty');\n\nvar FromPropertyDescriptor = require('./FromPropertyDescriptor');\nvar IsAccessorDescriptor = require('./IsAccessorDescriptor');\nvar IsDataDescriptor = require('./IsDataDescriptor');\nvar IsPropertyKey = require('./IsPropertyKey');\nvar SameValue = require('./SameValue');\nvar ToPropertyDescriptor = require('./ToPropertyDescriptor');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-definepropertyorthrow\n\nmodule.exports = function DefinePropertyOrThrow(O, P, desc) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true');\n\t}\n\n\tvar Desc = isPropertyDescriptor({\n\t\tType: Type,\n\t\tIsDataDescriptor: IsDataDescriptor,\n\t\tIsAccessorDescriptor: IsAccessorDescriptor\n\t}, desc) ? desc : ToPropertyDescriptor(desc);\n\tif (!isPropertyDescriptor({\n\t\tType: Type,\n\t\tIsDataDescriptor: IsDataDescriptor,\n\t\tIsAccessorDescriptor: IsAccessorDescriptor\n\t}, Desc)) {\n\t\tthrow new $TypeError('Assertion failed: Desc is not a valid Property Descriptor');\n\t}\n\n\treturn DefineOwnProperty(\n\t\tIsDataDescriptor,\n\t\tSameValue,\n\t\tFromPropertyDescriptor,\n\t\tO,\n\t\tP,\n\t\tDesc\n\t);\n};\n","'use strict';\n\nvar assertRecord = require('../helpers/assertRecord');\nvar fromPropertyDescriptor = require('../helpers/fromPropertyDescriptor');\n\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-frompropertydescriptor\n\nmodule.exports = function FromPropertyDescriptor(Desc) {\n\tif (typeof Desc !== 'undefined') {\n\t\tassertRecord(Type, 'Property Descriptor', 'Desc', Desc);\n\t}\n\n\treturn fromPropertyDescriptor(Desc);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar inspect = require('object-inspect');\n\nvar IsPropertyKey = require('./IsPropertyKey');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-get-o-p\n\nmodule.exports = function Get(O, P) {\n\t// 7.3.1.1\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\t// 7.3.1.2\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P));\n\t}\n\t// 7.3.1.3\n\treturn O[P];\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar GetV = require('./GetV');\nvar IsCallable = require('./IsCallable');\nvar IsPropertyKey = require('./IsPropertyKey');\n\nvar inspect = require('object-inspect');\n\n// https://262.ecma-international.org/6.0/#sec-getmethod\n\nmodule.exports = function GetMethod(O, P) {\n\t// 7.3.9.1\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true');\n\t}\n\n\t// 7.3.9.2\n\tvar func = GetV(O, P);\n\n\t// 7.3.9.4\n\tif (func == null) {\n\t\treturn void 0;\n\t}\n\n\t// 7.3.9.5\n\tif (!IsCallable(func)) {\n\t\tthrow new $TypeError(inspect(P) + ' is not a function: ' + inspect(func));\n\t}\n\n\t// 7.3.9.6\n\treturn func;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar inspect = require('object-inspect');\n\nvar IsPropertyKey = require('./IsPropertyKey');\n// var ToObject = require('./ToObject');\n\n// https://262.ecma-international.org/6.0/#sec-getv\n\nmodule.exports = function GetV(V, P) {\n\t// 7.3.2.1\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P));\n\t}\n\n\t// 7.3.2.2-3\n\t// var O = ToObject(V);\n\n\t// 7.3.2.4\n\treturn V[P];\n};\n","'use strict';\n\nvar has = require('has');\n\nvar Type = require('./Type');\n\nvar assertRecord = require('../helpers/assertRecord');\n\n// https://262.ecma-international.org/5.1/#sec-8.10.1\n\nmodule.exports = function IsAccessorDescriptor(Desc) {\n\tif (typeof Desc === 'undefined') {\n\t\treturn false;\n\t}\n\n\tassertRecord(Type, 'Property Descriptor', 'Desc', Desc);\n\n\tif (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n","'use strict';\n\n// https://262.ecma-international.org/6.0/#sec-isarray\nmodule.exports = require('../helpers/IsArray');\n","'use strict';\n\n// http://262.ecma-international.org/5.1/#sec-9.11\n\nmodule.exports = require('is-callable');\n","'use strict';\n\nvar GetIntrinsic = require('../GetIntrinsic.js');\n\nvar $construct = GetIntrinsic('%Reflect.construct%', true);\n\nvar DefinePropertyOrThrow = require('./DefinePropertyOrThrow');\ntry {\n\tDefinePropertyOrThrow({}, '', { '[[Get]]': function () {} });\n} catch (e) {\n\t// Accessor properties aren't supported\n\tDefinePropertyOrThrow = null;\n}\n\n// https://262.ecma-international.org/6.0/#sec-isconstructor\n\nif (DefinePropertyOrThrow && $construct) {\n\tvar isConstructorMarker = {};\n\tvar badArrayLike = {};\n\tDefinePropertyOrThrow(badArrayLike, 'length', {\n\t\t'[[Get]]': function () {\n\t\t\tthrow isConstructorMarker;\n\t\t},\n\t\t'[[Enumerable]]': true\n\t});\n\n\tmodule.exports = function IsConstructor(argument) {\n\t\ttry {\n\t\t\t// `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`:\n\t\t\t$construct(argument, badArrayLike);\n\t\t} catch (err) {\n\t\t\treturn err === isConstructorMarker;\n\t\t}\n\t};\n} else {\n\tmodule.exports = function IsConstructor(argument) {\n\t\t// unfortunately there's no way to truly check this without try/catch `new argument` in old environments\n\t\treturn typeof argument === 'function' && !!argument.prototype;\n\t};\n}\n","'use strict';\n\nvar has = require('has');\n\nvar Type = require('./Type');\n\nvar assertRecord = require('../helpers/assertRecord');\n\n// https://262.ecma-international.org/5.1/#sec-8.10.2\n\nmodule.exports = function IsDataDescriptor(Desc) {\n\tif (typeof Desc === 'undefined') {\n\t\treturn false;\n\t}\n\n\tassertRecord(Type, 'Property Descriptor', 'Desc', Desc);\n\n\tif (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n","'use strict';\n\n// https://262.ecma-international.org/6.0/#sec-ispropertykey\n\nmodule.exports = function IsPropertyKey(argument) {\n\treturn typeof argument === 'string' || typeof argument === 'symbol';\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $match = GetIntrinsic('%Symbol.match%', true);\n\nvar hasRegExpMatcher = require('is-regex');\n\nvar ToBoolean = require('./ToBoolean');\n\n// https://262.ecma-international.org/6.0/#sec-isregexp\n\nmodule.exports = function IsRegExp(argument) {\n\tif (!argument || typeof argument !== 'object') {\n\t\treturn false;\n\t}\n\tif ($match) {\n\t\tvar isRegExp = argument[$match];\n\t\tif (typeof isRegExp !== 'undefined') {\n\t\t\treturn ToBoolean(isRegExp);\n\t\t}\n\t}\n\treturn hasRegExpMatcher(argument);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $ObjectCreate = GetIntrinsic('%Object.create%', true);\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\n\nvar IsArray = require('./IsArray');\nvar Type = require('./Type');\n\nvar forEach = require('../helpers/forEach');\n\nvar SLOT = require('internal-slot');\n\nvar hasProto = require('has-proto')();\n\n// https://262.ecma-international.org/11.0/#sec-objectcreate\n\nmodule.exports = function OrdinaryObjectCreate(proto) {\n\tif (proto !== null && Type(proto) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: `proto` must be null or an object');\n\t}\n\tvar additionalInternalSlotsList = arguments.length < 2 ? [] : arguments[1];\n\tif (!IsArray(additionalInternalSlotsList)) {\n\t\tthrow new $TypeError('Assertion failed: `additionalInternalSlotsList` must be an Array');\n\t}\n\n\t// var internalSlotsList = ['[[Prototype]]', '[[Extensible]]']; // step 1\n\t// internalSlotsList.push(...additionalInternalSlotsList); // step 2\n\t// var O = MakeBasicObject(internalSlotsList); // step 3\n\t// setProto(O, proto); // step 4\n\t// return O; // step 5\n\n\tvar O;\n\tif ($ObjectCreate) {\n\t\tO = $ObjectCreate(proto);\n\t} else if (hasProto) {\n\t\tO = { __proto__: proto };\n\t} else {\n\t\tif (proto === null) {\n\t\t\tthrow new $SyntaxError('native Object.create support is required to create null objects');\n\t\t}\n\t\tvar T = function T() {};\n\t\tT.prototype = proto;\n\t\tO = new T();\n\t}\n\n\tif (additionalInternalSlotsList.length > 0) {\n\t\tforEach(additionalInternalSlotsList, function (slot) {\n\t\t\tSLOT.set(O, slot, void undefined);\n\t\t});\n\t}\n\n\treturn O;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar regexExec = require('call-bind/callBound')('RegExp.prototype.exec');\n\nvar Call = require('./Call');\nvar Get = require('./Get');\nvar IsCallable = require('./IsCallable');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-regexpexec\n\nmodule.exports = function RegExpExec(R, S) {\n\tif (Type(R) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: `R` must be an Object');\n\t}\n\tif (Type(S) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `S` must be a String');\n\t}\n\tvar exec = Get(R, 'exec');\n\tif (IsCallable(exec)) {\n\t\tvar result = Call(exec, R, [S]);\n\t\tif (result === null || Type(result) === 'Object') {\n\t\t\treturn result;\n\t\t}\n\t\tthrow new $TypeError('\"exec\" method must return `null` or an Object');\n\t}\n\treturn regexExec(R, S);\n};\n","'use strict';\n\nmodule.exports = require('../5/CheckObjectCoercible');\n","'use strict';\n\nvar $isNaN = require('../helpers/isNaN');\n\n// http://262.ecma-international.org/5.1/#sec-9.12\n\nmodule.exports = function SameValue(x, y) {\n\tif (x === y) { // 0 === -0, but they are not identical.\n\t\tif (x === 0) { return 1 / x === 1 / y; }\n\t\treturn true;\n\t}\n\treturn $isNaN(x) && $isNaN(y);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar IsPropertyKey = require('./IsPropertyKey');\nvar SameValue = require('./SameValue');\nvar Type = require('./Type');\n\n// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated\nvar noThrowOnStrictViolation = (function () {\n\ttry {\n\t\tdelete [].length;\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n}());\n\n// https://262.ecma-international.org/6.0/#sec-set-o-p-v-throw\n\nmodule.exports = function Set(O, P, V, Throw) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: `O` must be an Object');\n\t}\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: `P` must be a Property Key');\n\t}\n\tif (Type(Throw) !== 'Boolean') {\n\t\tthrow new $TypeError('Assertion failed: `Throw` must be a Boolean');\n\t}\n\tif (Throw) {\n\t\tO[P] = V; // eslint-disable-line no-param-reassign\n\t\tif (noThrowOnStrictViolation && !SameValue(O[P], V)) {\n\t\t\tthrow new $TypeError('Attempted to assign to readonly property.');\n\t\t}\n\t\treturn true;\n\t}\n\ttry {\n\t\tO[P] = V; // eslint-disable-line no-param-reassign\n\t\treturn noThrowOnStrictViolation ? SameValue(O[P], V) : true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $species = GetIntrinsic('%Symbol.species%', true);\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar IsConstructor = require('./IsConstructor');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-speciesconstructor\n\nmodule.exports = function SpeciesConstructor(O, defaultConstructor) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\tvar C = O.constructor;\n\tif (typeof C === 'undefined') {\n\t\treturn defaultConstructor;\n\t}\n\tif (Type(C) !== 'Object') {\n\t\tthrow new $TypeError('O.constructor is not an Object');\n\t}\n\tvar S = $species ? C[$species] : void 0;\n\tif (S == null) {\n\t\treturn defaultConstructor;\n\t}\n\tif (IsConstructor(S)) {\n\t\treturn S;\n\t}\n\tthrow new $TypeError('no constructor found');\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $Number = GetIntrinsic('%Number%');\nvar $RegExp = GetIntrinsic('%RegExp%');\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $parseInteger = GetIntrinsic('%parseInt%');\n\nvar callBound = require('call-bind/callBound');\nvar regexTester = require('safe-regex-test');\n\nvar $strSlice = callBound('String.prototype.slice');\nvar isBinary = regexTester(/^0b[01]+$/i);\nvar isOctal = regexTester(/^0o[0-7]+$/i);\nvar isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i);\nvar nonWS = ['\\u0085', '\\u200b', '\\ufffe'].join('');\nvar nonWSregex = new $RegExp('[' + nonWS + ']', 'g');\nvar hasNonWS = regexTester(nonWSregex);\n\nvar $trim = require('string.prototype.trim');\n\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/13.0/#sec-stringtonumber\n\nmodule.exports = function StringToNumber(argument) {\n\tif (Type(argument) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `argument` is not a String');\n\t}\n\tif (isBinary(argument)) {\n\t\treturn $Number($parseInteger($strSlice(argument, 2), 2));\n\t}\n\tif (isOctal(argument)) {\n\t\treturn $Number($parseInteger($strSlice(argument, 2), 8));\n\t}\n\tif (hasNonWS(argument) || isInvalidHexLiteral(argument)) {\n\t\treturn NaN;\n\t}\n\tvar trimmed = $trim(argument);\n\tif (trimmed !== argument) {\n\t\treturn StringToNumber(trimmed);\n\t}\n\treturn $Number(argument);\n};\n","'use strict';\n\n// http://262.ecma-international.org/5.1/#sec-9.2\n\nmodule.exports = function ToBoolean(value) { return !!value; };\n","'use strict';\n\nvar ToNumber = require('./ToNumber');\nvar truncate = require('./truncate');\n\nvar $isNaN = require('../helpers/isNaN');\nvar $isFinite = require('../helpers/isFinite');\n\n// https://262.ecma-international.org/14.0/#sec-tointegerorinfinity\n\nmodule.exports = function ToIntegerOrInfinity(value) {\n\tvar number = ToNumber(value);\n\tif ($isNaN(number) || number === 0) { return 0; }\n\tif (!$isFinite(number)) { return number; }\n\treturn truncate(number);\n};\n","'use strict';\n\nvar MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');\n\nvar ToIntegerOrInfinity = require('./ToIntegerOrInfinity');\n\nmodule.exports = function ToLength(argument) {\n\tvar len = ToIntegerOrInfinity(argument);\n\tif (len <= 0) { return 0; } // includes converting -0 to +0\n\tif (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; }\n\treturn len;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $Number = GetIntrinsic('%Number%');\nvar isPrimitive = require('../helpers/isPrimitive');\n\nvar ToPrimitive = require('./ToPrimitive');\nvar StringToNumber = require('./StringToNumber');\n\n// https://262.ecma-international.org/13.0/#sec-tonumber\n\nmodule.exports = function ToNumber(argument) {\n\tvar value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number);\n\tif (typeof value === 'symbol') {\n\t\tthrow new $TypeError('Cannot convert a Symbol value to a number');\n\t}\n\tif (typeof value === 'bigint') {\n\t\tthrow new $TypeError('Conversion from \\'BigInt\\' to \\'number\\' is not allowed.');\n\t}\n\tif (typeof value === 'string') {\n\t\treturn StringToNumber(value);\n\t}\n\treturn $Number(value);\n};\n","'use strict';\n\nvar toPrimitive = require('es-to-primitive/es2015');\n\n// https://262.ecma-international.org/6.0/#sec-toprimitive\n\nmodule.exports = function ToPrimitive(input) {\n\tif (arguments.length > 1) {\n\t\treturn toPrimitive(input, arguments[1]);\n\t}\n\treturn toPrimitive(input);\n};\n","'use strict';\n\nvar has = require('has');\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar Type = require('./Type');\nvar ToBoolean = require('./ToBoolean');\nvar IsCallable = require('./IsCallable');\n\n// https://262.ecma-international.org/5.1/#sec-8.10.5\n\nmodule.exports = function ToPropertyDescriptor(Obj) {\n\tif (Type(Obj) !== 'Object') {\n\t\tthrow new $TypeError('ToPropertyDescriptor requires an object');\n\t}\n\n\tvar desc = {};\n\tif (has(Obj, 'enumerable')) {\n\t\tdesc['[[Enumerable]]'] = ToBoolean(Obj.enumerable);\n\t}\n\tif (has(Obj, 'configurable')) {\n\t\tdesc['[[Configurable]]'] = ToBoolean(Obj.configurable);\n\t}\n\tif (has(Obj, 'value')) {\n\t\tdesc['[[Value]]'] = Obj.value;\n\t}\n\tif (has(Obj, 'writable')) {\n\t\tdesc['[[Writable]]'] = ToBoolean(Obj.writable);\n\t}\n\tif (has(Obj, 'get')) {\n\t\tvar getter = Obj.get;\n\t\tif (typeof getter !== 'undefined' && !IsCallable(getter)) {\n\t\t\tthrow new $TypeError('getter must be a function');\n\t\t}\n\t\tdesc['[[Get]]'] = getter;\n\t}\n\tif (has(Obj, 'set')) {\n\t\tvar setter = Obj.set;\n\t\tif (typeof setter !== 'undefined' && !IsCallable(setter)) {\n\t\t\tthrow new $TypeError('setter must be a function');\n\t\t}\n\t\tdesc['[[Set]]'] = setter;\n\t}\n\n\tif ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) {\n\t\tthrow new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');\n\t}\n\treturn desc;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $String = GetIntrinsic('%String%');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// https://262.ecma-international.org/6.0/#sec-tostring\n\nmodule.exports = function ToString(argument) {\n\tif (typeof argument === 'symbol') {\n\t\tthrow new $TypeError('Cannot convert a Symbol value to a string');\n\t}\n\treturn $String(argument);\n};\n","'use strict';\n\nvar ES5Type = require('../5/Type');\n\n// https://262.ecma-international.org/11.0/#sec-ecmascript-data-types-and-values\n\nmodule.exports = function Type(x) {\n\tif (typeof x === 'symbol') {\n\t\treturn 'Symbol';\n\t}\n\tif (typeof x === 'bigint') {\n\t\treturn 'BigInt';\n\t}\n\treturn ES5Type(x);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $fromCharCode = GetIntrinsic('%String.fromCharCode%');\n\nvar isLeadingSurrogate = require('../helpers/isLeadingSurrogate');\nvar isTrailingSurrogate = require('../helpers/isTrailingSurrogate');\n\n// https://tc39.es/ecma262/2020/#sec-utf16decodesurrogatepair\n\nmodule.exports = function UTF16SurrogatePairToCodePoint(lead, trail) {\n\tif (!isLeadingSurrogate(lead) || !isTrailingSurrogate(trail)) {\n\t\tthrow new $TypeError('Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code');\n\t}\n\t// var cp = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;\n\treturn $fromCharCode(lead) + $fromCharCode(trail);\n};\n","'use strict';\n\nvar Type = require('./Type');\n\n// var modulo = require('./modulo');\nvar $floor = Math.floor;\n\n// http://262.ecma-international.org/11.0/#eqn-floor\n\nmodule.exports = function floor(x) {\n\t// return x - modulo(x, 1);\n\tif (Type(x) === 'BigInt') {\n\t\treturn x;\n\t}\n\treturn $floor(x);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar floor = require('./floor');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// https://262.ecma-international.org/14.0/#eqn-truncate\n\nmodule.exports = function truncate(x) {\n\tif (typeof x !== 'number' && typeof x !== 'bigint') {\n\t\tthrow new $TypeError('argument must be a Number or a BigInt');\n\t}\n\tvar result = x < 0 ? -floor(-x) : floor(x);\n\treturn result === 0 ? 0 : result; // in the spec, these are math values, so we filter out -0 here\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// http://262.ecma-international.org/5.1/#sec-9.10\n\nmodule.exports = function CheckObjectCoercible(value, optMessage) {\n\tif (value == null) {\n\t\tthrow new $TypeError(optMessage || ('Cannot call method on ' + value));\n\t}\n\treturn value;\n};\n","'use strict';\n\n// https://262.ecma-international.org/5.1/#sec-8\n\nmodule.exports = function Type(x) {\n\tif (x === null) {\n\t\treturn 'Null';\n\t}\n\tif (typeof x === 'undefined') {\n\t\treturn 'Undefined';\n\t}\n\tif (typeof x === 'function' || typeof x === 'object') {\n\t\treturn 'Object';\n\t}\n\tif (typeof x === 'number') {\n\t\treturn 'Number';\n\t}\n\tif (typeof x === 'boolean') {\n\t\treturn 'Boolean';\n\t}\n\tif (typeof x === 'string') {\n\t\treturn 'String';\n\t}\n};\n","'use strict';\n\n// TODO: remove, semver-major\n\nmodule.exports = require('get-intrinsic');\n","'use strict';\n\nvar hasPropertyDescriptors = require('has-property-descriptors');\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = hasPropertyDescriptors() && GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasArrayLengthDefineBug = hasPropertyDescriptors.hasArrayLengthDefineBug();\n\n// eslint-disable-next-line global-require\nvar isArray = hasArrayLengthDefineBug && require('../helpers/IsArray');\n\nvar callBound = require('call-bind/callBound');\n\nvar $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');\n\n// eslint-disable-next-line max-params\nmodule.exports = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) {\n\tif (!$defineProperty) {\n\t\tif (!IsDataDescriptor(desc)) {\n\t\t\t// ES3 does not support getters/setters\n\t\t\treturn false;\n\t\t}\n\t\tif (!desc['[[Configurable]]'] || !desc['[[Writable]]']) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// fallback for ES3\n\t\tif (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) {\n\t\t\t// a non-enumerable existing property\n\t\t\treturn false;\n\t\t}\n\n\t\t// property does not exist at all, or exists but is enumerable\n\t\tvar V = desc['[[Value]]'];\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tO[P] = V; // will use [[Define]]\n\t\treturn SameValue(O[P], V);\n\t}\n\tif (\n\t\thasArrayLengthDefineBug\n\t\t&& P === 'length'\n\t\t&& '[[Value]]' in desc\n\t\t&& isArray(O)\n\t\t&& O.length !== desc['[[Value]]']\n\t) {\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tO.length = desc['[[Value]]'];\n\t\treturn O.length === desc['[[Value]]'];\n\t}\n\n\t$defineProperty(O, P, FromPropertyDescriptor(desc));\n\treturn true;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $Array = GetIntrinsic('%Array%');\n\n// eslint-disable-next-line global-require\nvar toStr = !$Array.isArray && require('call-bind/callBound')('Object.prototype.toString');\n\nmodule.exports = $Array.isArray || function IsArray(argument) {\n\treturn toStr(argument) === '[object Array]';\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\n\nvar has = require('has');\nvar isInteger = require('./isInteger');\n\nvar isMatchRecord = require('./isMatchRecord');\n\nvar predicates = {\n\t// https://262.ecma-international.org/6.0/#sec-property-descriptor-specification-type\n\t'Property Descriptor': function isPropertyDescriptor(Desc) {\n\t\tvar allowed = {\n\t\t\t'[[Configurable]]': true,\n\t\t\t'[[Enumerable]]': true,\n\t\t\t'[[Get]]': true,\n\t\t\t'[[Set]]': true,\n\t\t\t'[[Value]]': true,\n\t\t\t'[[Writable]]': true\n\t\t};\n\n\t\tif (!Desc) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (var key in Desc) { // eslint-disable-line\n\t\t\tif (has(Desc, key) && !allowed[key]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tvar isData = has(Desc, '[[Value]]');\n\t\tvar IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]');\n\t\tif (isData && IsAccessor) {\n\t\t\tthrow new $TypeError('Property Descriptors may not be both accessor and data descriptors');\n\t\t}\n\t\treturn true;\n\t},\n\t// https://262.ecma-international.org/13.0/#sec-match-records\n\t'Match Record': isMatchRecord,\n\t'Iterator Record': function isIteratorRecord(value) {\n\t\treturn has(value, '[[Iterator]]') && has(value, '[[NextMethod]]') && has(value, '[[Done]]');\n\t},\n\t'PromiseCapability Record': function isPromiseCapabilityRecord(value) {\n\t\treturn !!value\n\t\t\t&& has(value, '[[Resolve]]')\n\t\t\t&& typeof value['[[Resolve]]'] === 'function'\n\t\t\t&& has(value, '[[Reject]]')\n\t\t\t&& typeof value['[[Reject]]'] === 'function'\n\t\t\t&& has(value, '[[Promise]]')\n\t\t\t&& value['[[Promise]]']\n\t\t\t&& typeof value['[[Promise]]'].then === 'function';\n\t},\n\t'AsyncGeneratorRequest Record': function isAsyncGeneratorRequestRecord(value) {\n\t\treturn !!value\n\t\t\t&& has(value, '[[Completion]]') // TODO: confirm is a completion record\n\t\t\t&& has(value, '[[Capability]]')\n\t\t\t&& predicates['PromiseCapability Record'](value['[[Capability]]']);\n\t},\n\t'RegExp Record': function isRegExpRecord(value) {\n\t\treturn value\n\t\t\t&& has(value, '[[IgnoreCase]]')\n\t\t\t&& typeof value['[[IgnoreCase]]'] === 'boolean'\n\t\t\t&& has(value, '[[Multiline]]')\n\t\t\t&& typeof value['[[Multiline]]'] === 'boolean'\n\t\t\t&& has(value, '[[DotAll]]')\n\t\t\t&& typeof value['[[DotAll]]'] === 'boolean'\n\t\t\t&& has(value, '[[Unicode]]')\n\t\t\t&& typeof value['[[Unicode]]'] === 'boolean'\n\t\t\t&& has(value, '[[CapturingGroupsCount]]')\n\t\t\t&& typeof value['[[CapturingGroupsCount]]'] === 'number'\n\t\t\t&& isInteger(value['[[CapturingGroupsCount]]'])\n\t\t\t&& value['[[CapturingGroupsCount]]'] >= 0;\n\t}\n};\n\nmodule.exports = function assertRecord(Type, recordType, argumentName, value) {\n\tvar predicate = predicates[recordType];\n\tif (typeof predicate !== 'function') {\n\t\tthrow new $SyntaxError('unknown record type: ' + recordType);\n\t}\n\tif (Type(value) !== 'Object' || !predicate(value)) {\n\t\tthrow new $TypeError(argumentName + ' must be a ' + recordType);\n\t}\n};\n","'use strict';\n\nmodule.exports = function forEach(array, callback) {\n\tfor (var i = 0; i < array.length; i += 1) {\n\t\tcallback(array[i], i, array); // eslint-disable-line callback-return\n\t}\n};\n","'use strict';\n\nmodule.exports = function fromPropertyDescriptor(Desc) {\n\tif (typeof Desc === 'undefined') {\n\t\treturn Desc;\n\t}\n\tvar obj = {};\n\tif ('[[Value]]' in Desc) {\n\t\tobj.value = Desc['[[Value]]'];\n\t}\n\tif ('[[Writable]]' in Desc) {\n\t\tobj.writable = !!Desc['[[Writable]]'];\n\t}\n\tif ('[[Get]]' in Desc) {\n\t\tobj.get = Desc['[[Get]]'];\n\t}\n\tif ('[[Set]]' in Desc) {\n\t\tobj.set = Desc['[[Set]]'];\n\t}\n\tif ('[[Enumerable]]' in Desc) {\n\t\tobj.enumerable = !!Desc['[[Enumerable]]'];\n\t}\n\tif ('[[Configurable]]' in Desc) {\n\t\tobj.configurable = !!Desc['[[Configurable]]'];\n\t}\n\treturn obj;\n};\n","'use strict';\n\nvar $isNaN = require('./isNaN');\n\nmodule.exports = function (x) { return (typeof x === 'number' || typeof x === 'bigint') && !$isNaN(x) && x !== Infinity && x !== -Infinity; };\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $abs = GetIntrinsic('%Math.abs%');\nvar $floor = GetIntrinsic('%Math.floor%');\n\nvar $isNaN = require('./isNaN');\nvar $isFinite = require('./isFinite');\n\nmodule.exports = function isInteger(argument) {\n\tif (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {\n\t\treturn false;\n\t}\n\tvar absValue = $abs(argument);\n\treturn $floor(absValue) === absValue;\n};\n\n","'use strict';\n\nmodule.exports = function isLeadingSurrogate(charCode) {\n\treturn typeof charCode === 'number' && charCode >= 0xD800 && charCode <= 0xDBFF;\n};\n","'use strict';\n\nvar has = require('has');\n\n// https://262.ecma-international.org/13.0/#sec-match-records\n\nmodule.exports = function isMatchRecord(record) {\n\treturn (\n\t\thas(record, '[[StartIndex]]')\n && has(record, '[[EndIndex]]')\n && record['[[StartIndex]]'] >= 0\n && record['[[EndIndex]]'] >= record['[[StartIndex]]']\n && String(parseInt(record['[[StartIndex]]'], 10)) === String(record['[[StartIndex]]'])\n && String(parseInt(record['[[EndIndex]]'], 10)) === String(record['[[EndIndex]]'])\n\t);\n};\n","'use strict';\n\nmodule.exports = Number.isNaN || function isNaN(a) {\n\treturn a !== a;\n};\n","'use strict';\n\nmodule.exports = function isPrimitive(value) {\n\treturn value === null || (typeof value !== 'function' && typeof value !== 'object');\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar has = require('has');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nmodule.exports = function IsPropertyDescriptor(ES, Desc) {\n\tif (ES.Type(Desc) !== 'Object') {\n\t\treturn false;\n\t}\n\tvar allowed = {\n\t\t'[[Configurable]]': true,\n\t\t'[[Enumerable]]': true,\n\t\t'[[Get]]': true,\n\t\t'[[Set]]': true,\n\t\t'[[Value]]': true,\n\t\t'[[Writable]]': true\n\t};\n\n\tfor (var key in Desc) { // eslint-disable-line no-restricted-syntax\n\t\tif (has(Desc, key) && !allowed[key]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tif (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) {\n\t\tthrow new $TypeError('Property Descriptors may not be both accessor and data descriptors');\n\t}\n\treturn true;\n};\n","'use strict';\n\nmodule.exports = function isTrailingSurrogate(charCode) {\n\treturn typeof charCode === 'number' && charCode >= 0xDC00 && charCode <= 0xDFFF;\n};\n","'use strict';\n\nmodule.exports = Number.MAX_SAFE_INTEGER || 9007199254740991; // Math.pow(2, 53) - 1;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","/** Manages a fixed layout resource embedded in an iframe. */\nexport class PageManager {\n constructor(window, iframe, listener) {\n this.margins = { top: 0, right: 0, bottom: 0, left: 0 };\n if (!iframe.contentWindow) {\n throw Error(\"Iframe argument must have been attached to DOM.\");\n }\n this.listener = listener;\n this.iframe = iframe;\n }\n setMessagePort(messagePort) {\n messagePort.onmessage = (message) => {\n this.onMessageFromIframe(message);\n };\n }\n show() {\n this.iframe.style.display = \"unset\";\n }\n hide() {\n this.iframe.style.display = \"none\";\n }\n /** Sets page margins. */\n setMargins(margins) {\n if (this.margins == margins) {\n return;\n }\n this.iframe.style.marginTop = this.margins.top + \"px\";\n this.iframe.style.marginLeft = this.margins.left + \"px\";\n this.iframe.style.marginBottom = this.margins.bottom + \"px\";\n this.iframe.style.marginRight = this.margins.right + \"px\";\n }\n /** Loads page content. */\n loadPage(url) {\n this.iframe.src = url;\n }\n /** Sets the size of this page without content. */\n setPlaceholder(size) {\n this.iframe.style.visibility = \"hidden\";\n this.iframe.style.width = size.width + \"px\";\n this.iframe.style.height = size.height + \"px\";\n this.size = size;\n }\n onMessageFromIframe(event) {\n const message = event.data;\n switch (message.kind) {\n case \"contentSize\":\n return this.onContentSizeAvailable(message.size);\n case \"tap\":\n return this.listener.onTap(message.event);\n case \"linkActivated\":\n return this.onLinkActivated(message);\n case \"decorationActivated\":\n return this.listener.onDecorationActivated(message.event);\n }\n }\n onLinkActivated(message) {\n try {\n const url = new URL(message.href, this.iframe.src);\n this.listener.onLinkActivated(url.toString(), message.outerHtml);\n }\n catch (_a) {\n // Do nothing if url is not valid.\n }\n }\n onContentSizeAvailable(size) {\n if (!size) {\n //FIXME: handle edge case\n return;\n }\n this.iframe.style.width = size.width + \"px\";\n this.iframe.style.height = size.height + \"px\";\n this.size = size;\n this.listener.onIframeLoaded();\n }\n}\n","export function offsetToParentCoordinates(offset, iframeRect) {\n return {\n x: (offset.x + iframeRect.left - visualViewport.offsetLeft) *\n visualViewport.scale,\n y: (offset.y + iframeRect.top - visualViewport.offsetTop) *\n visualViewport.scale,\n };\n}\nexport function rectToParentCoordinates(rect, iframeRect) {\n const topLeft = { x: rect.left, y: rect.top };\n const bottomRight = { x: rect.right, y: rect.bottom };\n const shiftedTopLeft = offsetToParentCoordinates(topLeft, iframeRect);\n const shiftedBottomRight = offsetToParentCoordinates(bottomRight, iframeRect);\n return {\n left: shiftedTopLeft.x,\n top: shiftedTopLeft.y,\n right: shiftedBottomRight.x,\n bottom: shiftedBottomRight.y,\n width: shiftedBottomRight.x - shiftedTopLeft.x,\n height: shiftedBottomRight.y - shiftedTopLeft.y,\n };\n}\n","export class ViewportStringBuilder {\n setInitialScale(scale) {\n this.initialScale = scale;\n return this;\n }\n setMinimumScale(scale) {\n this.minimumScale = scale;\n return this;\n }\n setWidth(width) {\n this.width = width;\n return this;\n }\n setHeight(height) {\n this.height = height;\n return this;\n }\n build() {\n const components = [];\n if (this.initialScale) {\n components.push(\"initial-scale=\" + this.initialScale);\n }\n if (this.minimumScale) {\n components.push(\"minimum-scale=\" + this.minimumScale);\n }\n if (this.width) {\n components.push(\"width=\" + this.width);\n }\n if (this.height) {\n components.push(\"height=\" + this.height);\n }\n return components.join(\", \");\n }\n}\nexport function parseViewportString(viewportString) {\n const regex = /(\\w+) *= *([^\\s,]+)/g;\n const properties = new Map();\n let match;\n while ((match = regex.exec(viewportString))) {\n if (match != null) {\n properties.set(match[1], match[2]);\n }\n }\n const width = parseFloat(properties.get(\"width\"));\n const height = parseFloat(properties.get(\"height\"));\n if (width && height) {\n return { width, height };\n }\n else {\n return undefined;\n }\n}\n","export class GesturesDetector {\n constructor(window, listener, decorationManager) {\n this.window = window;\n this.listener = listener;\n this.decorationManager = decorationManager;\n document.addEventListener(\"click\", (event) => {\n this.onClick(event);\n }, false);\n }\n onClick(event) {\n if (event.defaultPrevented) {\n return;\n }\n const selection = this.window.getSelection();\n if (selection && selection.type == \"Range\") {\n // There's an on-going selection, the tap will dismiss it so we don't forward it.\n // selection.type might be None (collapsed) or Caret with a collapsed range\n // when there is not true selection.\n return;\n }\n let nearestElement;\n if (event.target instanceof HTMLElement) {\n nearestElement = this.nearestInteractiveElement(event.target);\n }\n else {\n nearestElement = null;\n }\n if (nearestElement) {\n if (nearestElement instanceof HTMLAnchorElement) {\n this.listener.onLinkActivated(nearestElement.href, nearestElement.outerHTML);\n event.stopPropagation();\n event.preventDefault();\n }\n else {\n return;\n }\n }\n let decorationActivatedEvent;\n if (this.decorationManager) {\n decorationActivatedEvent =\n this.decorationManager.handleDecorationClickEvent(event);\n }\n else {\n decorationActivatedEvent = null;\n }\n if (decorationActivatedEvent) {\n this.listener.onDecorationActivated(decorationActivatedEvent);\n }\n else {\n this.listener.onTap(event);\n }\n // event.stopPropagation()\n // event.preventDefault()\n }\n // See. https://github.com/JayPanoz/architecture/tree/touch-handling/misc/touch-handling\n nearestInteractiveElement(element) {\n if (element == null) {\n return null;\n }\n const interactiveTags = [\n \"a\",\n \"audio\",\n \"button\",\n \"canvas\",\n \"details\",\n \"input\",\n \"label\",\n \"option\",\n \"select\",\n \"submit\",\n \"textarea\",\n \"video\",\n ];\n if (interactiveTags.indexOf(element.nodeName.toLowerCase()) != -1) {\n return element;\n }\n // Checks whether the element is editable by the user.\n if (element.hasAttribute(\"contenteditable\") &&\n element.getAttribute(\"contenteditable\").toLowerCase() != \"false\") {\n return element;\n }\n // Checks parents recursively because the touch might be for example on an inside a .\n if (element.parentElement) {\n return this.nearestInteractiveElement(element.parentElement);\n }\n return null;\n }\n}\n","import { computeScale } from \"./fit\";\nimport { PageManager } from \"./page-manager\";\nimport { offsetToParentCoordinates } from \"../common/geometry\";\nimport { rectToParentCoordinates } from \"../common/geometry\";\nimport { ViewportStringBuilder } from \"../util/viewport\";\nimport { GesturesDetector } from \"../common/gestures\";\nexport class DoubleAreaManager {\n constructor(window, leftIframe, rightIframe, metaViewport, listener) {\n this.fit = \"contain\";\n this.insets = { top: 0, right: 0, bottom: 0, left: 0 };\n this.listener = listener;\n const wrapperGesturesListener = {\n onTap: (event) => {\n const offset = {\n x: (event.clientX - visualViewport.offsetLeft) *\n visualViewport.scale,\n y: (event.clientY - visualViewport.offsetTop) * visualViewport.scale,\n };\n listener.onTap({ offset: offset });\n },\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onLinkActivated: (_) => {\n throw Error(\"No interactive element in the root document.\");\n },\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onDecorationActivated: (_) => {\n throw Error(\"No decoration in the root document.\");\n },\n };\n new GesturesDetector(window, wrapperGesturesListener);\n const leftPageListener = {\n onIframeLoaded: () => {\n this.layout();\n },\n onTap: (gestureEvent) => {\n const boundingRect = leftIframe.getBoundingClientRect();\n const shiftedOffset = offsetToParentCoordinates(gestureEvent.offset, boundingRect);\n listener.onTap({ offset: shiftedOffset });\n },\n onLinkActivated: (href, outerHtml) => {\n listener.onLinkActivated(href, outerHtml);\n },\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onDecorationActivated: (gestureEvent) => {\n const boundingRect = leftIframe.getBoundingClientRect();\n const shiftedOffset = offsetToParentCoordinates(gestureEvent.offset, boundingRect);\n const shiftedRect = rectToParentCoordinates(gestureEvent.rect, boundingRect);\n const shiftedEvent = {\n id: gestureEvent.id,\n group: gestureEvent.group,\n rect: shiftedRect,\n offset: shiftedOffset,\n };\n listener.onDecorationActivated(shiftedEvent);\n },\n };\n const rightPageListener = {\n onIframeLoaded: () => {\n this.layout();\n },\n onTap: (gestureEvent) => {\n const boundingRect = rightIframe.getBoundingClientRect();\n const shiftedOffset = offsetToParentCoordinates(gestureEvent.offset, boundingRect);\n listener.onTap({ offset: shiftedOffset });\n },\n onLinkActivated: (href, outerHtml) => {\n listener.onLinkActivated(href, outerHtml);\n },\n onDecorationActivated: (gestureEvent) => {\n const boundingRect = rightIframe.getBoundingClientRect();\n const shiftedOffset = offsetToParentCoordinates(gestureEvent.offset, boundingRect);\n const shiftedRect = rectToParentCoordinates(gestureEvent.rect, boundingRect);\n const shiftedEvent = {\n id: gestureEvent.id,\n group: gestureEvent.group,\n rect: shiftedRect,\n offset: shiftedOffset,\n };\n listener.onDecorationActivated(shiftedEvent);\n },\n };\n this.leftPage = new PageManager(window, leftIframe, leftPageListener);\n this.rightPage = new PageManager(window, rightIframe, rightPageListener);\n this.metaViewport = metaViewport;\n }\n setLeftMessagePort(messagePort) {\n this.leftPage.setMessagePort(messagePort);\n }\n setRightMessagePort(messagePort) {\n this.rightPage.setMessagePort(messagePort);\n }\n loadSpread(spread) {\n this.leftPage.hide();\n this.rightPage.hide();\n this.spread = spread;\n if (spread.left) {\n this.leftPage.loadPage(spread.left);\n }\n if (spread.right) {\n this.rightPage.loadPage(spread.right);\n }\n }\n setViewport(size, insets) {\n if (this.viewport == size && this.insets == insets) {\n return;\n }\n this.viewport = size;\n this.insets = insets;\n this.layout();\n }\n setFit(fit) {\n if (this.fit == fit) {\n return;\n }\n this.fit = fit;\n this.layout();\n }\n layout() {\n if (!this.viewport ||\n (!this.leftPage.size && this.spread.left) ||\n (!this.rightPage.size && this.spread.right)) {\n return;\n }\n const leftMargins = {\n top: this.insets.top,\n right: 0,\n bottom: this.insets.bottom,\n left: this.insets.left,\n };\n this.leftPage.setMargins(leftMargins);\n const rightMargins = {\n top: this.insets.top,\n right: this.insets.right,\n bottom: this.insets.bottom,\n left: 0,\n };\n this.rightPage.setMargins(rightMargins);\n if (!this.spread.right) {\n this.rightPage.setPlaceholder(this.leftPage.size);\n }\n else if (!this.spread.left) {\n this.leftPage.setPlaceholder(this.rightPage.size);\n }\n const contentWidth = this.leftPage.size.width + this.rightPage.size.width;\n const contentHeight = Math.max(this.leftPage.size.height, this.rightPage.size.height);\n const contentSize = { width: contentWidth, height: contentHeight };\n const safeDrawingSize = {\n width: this.viewport.width - this.insets.left - this.insets.right,\n height: this.viewport.height - this.insets.top - this.insets.bottom,\n };\n const scale = computeScale(this.fit, contentSize, safeDrawingSize);\n this.metaViewport.content = new ViewportStringBuilder()\n .setInitialScale(scale)\n .setMinimumScale(scale)\n .setWidth(contentWidth)\n .setHeight(contentHeight)\n .build();\n this.leftPage.show();\n this.rightPage.show();\n this.listener.onLayout();\n }\n}\n","export function computeScale(fit, content, container) {\n switch (fit) {\n case \"contain\":\n return fitContain(content, container);\n case \"width\":\n return fitWidth(content, container);\n case \"height\":\n return fitHeight(content, container);\n }\n}\nfunction fitContain(content, container) {\n const widthRatio = container.width / content.width;\n const heightRatio = container.height / content.height;\n return Math.min(widthRatio, heightRatio);\n}\nfunction fitWidth(content, container) {\n return container.width / content.width;\n}\nfunction fitHeight(content, container) {\n return container.height / content.height;\n}\n","export class ReflowableListenerAdapter {\n constructor(gesturesBridge) {\n this.gesturesBridge = gesturesBridge;\n }\n onTap(event) {\n const tapEvent = {\n x: (event.clientX - visualViewport.offsetLeft) * visualViewport.scale,\n y: (event.clientY - visualViewport.offsetTop) * visualViewport.scale,\n };\n const stringEvent = JSON.stringify(tapEvent);\n this.gesturesBridge.onTap(stringEvent);\n }\n onLinkActivated(href, outerHtml) {\n this.gesturesBridge.onLinkActivated(href, outerHtml);\n }\n onDecorationActivated(event) {\n const offset = {\n x: (event.event.clientX - visualViewport.offsetLeft) *\n visualViewport.scale,\n y: (event.event.clientY - visualViewport.offsetTop) *\n visualViewport.scale,\n };\n const stringOffset = JSON.stringify(offset);\n const stringRect = JSON.stringify(event.rect);\n this.gesturesBridge.onDecorationActivated(event.id, event.group, stringRect, stringOffset);\n }\n}\nexport class FixedListenerAdapter {\n constructor(window, gesturesApi, documentApi) {\n this.window = window;\n this.gesturesApi = gesturesApi;\n this.documentApi = documentApi;\n this.resizeObserverAdded = false;\n this.documentLoadedFired = false;\n }\n onTap(event) {\n this.gesturesApi.onTap(JSON.stringify(event.offset));\n }\n onLinkActivated(href, outerHtml) {\n this.gesturesApi.onLinkActivated(href, outerHtml);\n }\n onDecorationActivated(event) {\n const stringOffset = JSON.stringify(event.offset);\n const stringRect = JSON.stringify(event.rect);\n this.gesturesApi.onDecorationActivated(event.id, event.group, stringRect, stringOffset);\n }\n onLayout() {\n if (!this.resizeObserverAdded) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const observer = new ResizeObserver(() => {\n requestAnimationFrame(() => {\n const scrollingElement = this.window.document.scrollingElement;\n if (!this.documentLoadedFired &&\n (scrollingElement == null ||\n scrollingElement.scrollHeight > 0 ||\n scrollingElement.scrollWidth > 0)) {\n this.documentApi.onDocumentLoadedAndSized();\n this.documentLoadedFired = true;\n }\n else {\n this.documentApi.onDocumentResized();\n }\n });\n });\n observer.observe(this.window.document.body);\n }\n this.resizeObserverAdded = true;\n }\n}\n","/**\n * From which direction to evaluate strings or nodes: from the start of a string\n * or range seeking Forwards, or from the end seeking Backwards.\n */\nvar TrimDirection;\n(function (TrimDirection) {\n TrimDirection[TrimDirection[\"Forwards\"] = 1] = \"Forwards\";\n TrimDirection[TrimDirection[\"Backwards\"] = 2] = \"Backwards\";\n})(TrimDirection || (TrimDirection = {}));\n/**\n * Return the offset of the nearest non-whitespace character to `baseOffset`\n * within the string `text`, looking in the `direction` indicated. Return -1 if\n * no non-whitespace character exists between `baseOffset` (inclusive) and the\n * terminus of the string (start or end depending on `direction`).\n */\nfunction closestNonSpaceInString(text, baseOffset, direction) {\n const nextChar = direction === TrimDirection.Forwards ? baseOffset : baseOffset - 1;\n if (text.charAt(nextChar).trim() !== \"\") {\n // baseOffset is already valid: it points at a non-whitespace character\n return baseOffset;\n }\n let availableChars;\n let availableNonWhitespaceChars;\n if (direction === TrimDirection.Backwards) {\n availableChars = text.substring(0, baseOffset);\n availableNonWhitespaceChars = availableChars.trimEnd();\n }\n else {\n availableChars = text.substring(baseOffset);\n availableNonWhitespaceChars = availableChars.trimStart();\n }\n if (!availableNonWhitespaceChars.length) {\n return -1;\n }\n const offsetDelta = availableChars.length - availableNonWhitespaceChars.length;\n return direction === TrimDirection.Backwards\n ? baseOffset - offsetDelta\n : baseOffset + offsetDelta;\n}\n/**\n * Calculate a new Range start position (TrimDirection.Forwards) or end position\n * (Backwards) for `range` that represents the nearest non-whitespace character,\n * moving into the `range` away from the relevant initial boundary node towards\n * the terminating boundary node.\n *\n * @throws {RangeError} If no text node with non-whitespace characters found\n */\nfunction closestNonSpaceInRange(range, direction) {\n const nodeIter = range.commonAncestorContainer.ownerDocument.createNodeIterator(range.commonAncestorContainer, NodeFilter.SHOW_TEXT);\n const initialBoundaryNode = direction === TrimDirection.Forwards\n ? range.startContainer\n : range.endContainer;\n const terminalBoundaryNode = direction === TrimDirection.Forwards\n ? range.endContainer\n : range.startContainer;\n let currentNode = nodeIter.nextNode();\n // Advance the NodeIterator to the `initialBoundaryNode`\n while (currentNode && currentNode !== initialBoundaryNode) {\n currentNode = nodeIter.nextNode();\n }\n if (direction === TrimDirection.Backwards) {\n // Reverse the NodeIterator direction. This will return the same node\n // as the previous `nextNode()` call (initial boundary node).\n currentNode = nodeIter.previousNode();\n }\n let trimmedOffset = -1;\n const advance = () => {\n currentNode =\n direction === TrimDirection.Forwards\n ? nodeIter.nextNode()\n : nodeIter.previousNode();\n if (currentNode) {\n const nodeText = currentNode.textContent;\n const baseOffset = direction === TrimDirection.Forwards ? 0 : nodeText.length;\n trimmedOffset = closestNonSpaceInString(nodeText, baseOffset, direction);\n }\n };\n while (currentNode &&\n trimmedOffset === -1 &&\n currentNode !== terminalBoundaryNode) {\n advance();\n }\n if (currentNode && trimmedOffset >= 0) {\n return { node: currentNode, offset: trimmedOffset };\n }\n /* istanbul ignore next */\n throw new RangeError(\"No text nodes with non-whitespace text found in range\");\n}\n/**\n * Return a new DOM Range that adjusts the start and end positions of `range` as\n * needed such that:\n *\n * - `startContainer` and `endContainer` text nodes both contain at least one\n * non-whitespace character within the Range's text content\n * - `startOffset` and `endOffset` both reference non-whitespace characters,\n * with `startOffset` immediately before the first non-whitespace character\n * and `endOffset` immediately after the last\n *\n * Whitespace characters are those that are removed by `String.prototype.trim()`\n *\n * @param range - A DOM Range that whose `startContainer` and `endContainer` are\n * both text nodes, and which contains at least one non-whitespace character.\n * @throws {RangeError}\n */\nexport function trimRange(range) {\n if (!range.toString().trim().length) {\n throw new RangeError(\"Range contains no non-whitespace text\");\n }\n if (range.startContainer.nodeType !== Node.TEXT_NODE) {\n throw new RangeError(\"Range startContainer is not a text node\");\n }\n if (range.endContainer.nodeType !== Node.TEXT_NODE) {\n throw new RangeError(\"Range endContainer is not a text node\");\n }\n const trimmedRange = range.cloneRange();\n let startTrimmed = false;\n let endTrimmed = false;\n const trimmedOffsets = {\n start: closestNonSpaceInString(range.startContainer.textContent, range.startOffset, TrimDirection.Forwards),\n end: closestNonSpaceInString(range.endContainer.textContent, range.endOffset, TrimDirection.Backwards),\n };\n if (trimmedOffsets.start >= 0) {\n trimmedRange.setStart(range.startContainer, trimmedOffsets.start);\n startTrimmed = true;\n }\n // Note: An offset of 0 is invalid for an end offset, as no text in the\n // node would be included in the range.\n if (trimmedOffsets.end > 0) {\n trimmedRange.setEnd(range.endContainer, trimmedOffsets.end);\n endTrimmed = true;\n }\n if (startTrimmed && endTrimmed) {\n return trimmedRange;\n }\n if (!startTrimmed) {\n // There are no (non-whitespace) characters between `startOffset` and the\n // end of the `startContainer` node.\n const { node, offset } = closestNonSpaceInRange(trimmedRange, TrimDirection.Forwards);\n if (node && offset >= 0) {\n trimmedRange.setStart(node, offset);\n }\n }\n if (!endTrimmed) {\n // There are no (non-whitespace) characters between the start of the Range's\n // `endContainer` text content and the `endOffset`.\n const { node, offset } = closestNonSpaceInRange(trimmedRange, TrimDirection.Backwards);\n if (node && offset > 0) {\n trimmedRange.setEnd(node, offset);\n }\n }\n return trimmedRange;\n}\n","import { trimRange } from \"./trim-range\";\n/**\n * Return the combined length of text nodes contained in `node`.\n */\nfunction nodeTextLength(node) {\n var _a, _b;\n switch (node.nodeType) {\n case Node.ELEMENT_NODE:\n case Node.TEXT_NODE:\n // nb. `textContent` excludes text in comments and processing instructions\n // when called on a parent element, so we don't need to subtract that here.\n return (_b = (_a = node.textContent) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;\n default:\n return 0;\n }\n}\n/**\n * Return the total length of the text of all previous siblings of `node`.\n */\nfunction previousSiblingsTextLength(node) {\n let sibling = node.previousSibling;\n let length = 0;\n while (sibling) {\n length += nodeTextLength(sibling);\n sibling = sibling.previousSibling;\n }\n return length;\n}\n/**\n * Resolve one or more character offsets within an element to (text node,\n * position) pairs.\n *\n * @param element\n * @param offsets - Offsets, which must be sorted in ascending order\n * @throws {RangeError}\n */\nfunction resolveOffsets(element, ...offsets) {\n let nextOffset = offsets.shift();\n const nodeIter = element.ownerDocument.createNodeIterator(element, NodeFilter.SHOW_TEXT);\n const results = [];\n let currentNode = nodeIter.nextNode();\n let textNode;\n let length = 0;\n // Find the text node containing the `nextOffset`th character from the start\n // of `element`.\n while (nextOffset !== undefined && currentNode) {\n textNode = currentNode;\n if (length + textNode.data.length > nextOffset) {\n results.push({ node: textNode, offset: nextOffset - length });\n nextOffset = offsets.shift();\n }\n else {\n currentNode = nodeIter.nextNode();\n length += textNode.data.length;\n }\n }\n // Boundary case.\n while (nextOffset !== undefined && textNode && length === nextOffset) {\n results.push({ node: textNode, offset: textNode.data.length });\n nextOffset = offsets.shift();\n }\n if (nextOffset !== undefined) {\n throw new RangeError(\"Offset exceeds text length\");\n }\n return results;\n}\n/**\n * When resolving a TextPosition, specifies the direction to search for the\n * nearest text node if `offset` is `0` and the element has no text.\n */\nexport var ResolveDirection;\n(function (ResolveDirection) {\n ResolveDirection[ResolveDirection[\"FORWARDS\"] = 1] = \"FORWARDS\";\n ResolveDirection[ResolveDirection[\"BACKWARDS\"] = 2] = \"BACKWARDS\";\n})(ResolveDirection || (ResolveDirection = {}));\n/**\n * Represents an offset within the text content of an element.\n *\n * This position can be resolved to a specific descendant node in the current\n * DOM subtree of the element using the `resolve` method.\n */\nexport class TextPosition {\n constructor(element, offset) {\n if (offset < 0) {\n throw new Error(\"Offset is invalid\");\n }\n /** Element that `offset` is relative to. */\n this.element = element;\n /** Character offset from the start of the element's `textContent`. */\n this.offset = offset;\n }\n /**\n * Return a copy of this position with offset relative to a given ancestor\n * element.\n *\n * @param parent - Ancestor of `this.element`\n */\n relativeTo(parent) {\n if (!parent.contains(this.element)) {\n throw new Error(\"Parent is not an ancestor of current element\");\n }\n let el = this.element;\n let offset = this.offset;\n while (el !== parent) {\n offset += previousSiblingsTextLength(el);\n el = el.parentElement;\n }\n return new TextPosition(el, offset);\n }\n /**\n * Resolve the position to a specific text node and offset within that node.\n *\n * Throws if `this.offset` exceeds the length of the element's text. In the\n * case where the element has no text and `this.offset` is 0, the `direction`\n * option determines what happens.\n *\n * Offsets at the boundary between two nodes are resolved to the start of the\n * node that begins at the boundary.\n *\n * @param options.direction - Specifies in which direction to search for the\n * nearest text node if `this.offset` is `0` and\n * `this.element` has no text. If not specified an\n * error is thrown.\n *\n * @throws {RangeError}\n */\n resolve(options = {}) {\n try {\n return resolveOffsets(this.element, this.offset)[0];\n }\n catch (err) {\n if (this.offset === 0 && options.direction !== undefined) {\n const tw = document.createTreeWalker(this.element.getRootNode(), NodeFilter.SHOW_TEXT);\n tw.currentNode = this.element;\n const forwards = options.direction === ResolveDirection.FORWARDS;\n const text = forwards\n ? tw.nextNode()\n : tw.previousNode();\n if (!text) {\n throw err;\n }\n return { node: text, offset: forwards ? 0 : text.data.length };\n }\n else {\n throw err;\n }\n }\n }\n /**\n * Construct a `TextPosition` that refers to the `offset`th character within\n * `node`.\n */\n static fromCharOffset(node, offset) {\n switch (node.nodeType) {\n case Node.TEXT_NODE:\n return TextPosition.fromPoint(node, offset);\n case Node.ELEMENT_NODE:\n return new TextPosition(node, offset);\n default:\n throw new Error(\"Node is not an element or text node\");\n }\n }\n /**\n * Construct a `TextPosition` representing the range start or end point (node, offset).\n *\n * @param node\n * @param offset - Offset within the node\n */\n static fromPoint(node, offset) {\n switch (node.nodeType) {\n case Node.TEXT_NODE: {\n if (offset < 0 || offset > node.data.length) {\n throw new Error(\"Text node offset is out of range\");\n }\n if (!node.parentElement) {\n throw new Error(\"Text node has no parent\");\n }\n // Get the offset from the start of the parent element.\n const textOffset = previousSiblingsTextLength(node) + offset;\n return new TextPosition(node.parentElement, textOffset);\n }\n case Node.ELEMENT_NODE: {\n if (offset < 0 || offset > node.childNodes.length) {\n throw new Error(\"Child node offset is out of range\");\n }\n // Get the text length before the `offset`th child of element.\n let textOffset = 0;\n for (let i = 0; i < offset; i++) {\n textOffset += nodeTextLength(node.childNodes[i]);\n }\n return new TextPosition(node, textOffset);\n }\n default:\n throw new Error(\"Point is not in an element or text node\");\n }\n }\n}\n/**\n * Represents a region of a document as a (start, end) pair of `TextPosition` points.\n *\n * Representing a range in this way allows for changes in the DOM content of the\n * range which don't affect its text content, without affecting the text content\n * of the range itself.\n */\nexport class TextRange {\n constructor(start, end) {\n this.start = start;\n this.end = end;\n }\n /**\n * Create a new TextRange whose `start` and `end` are computed relative to\n * `element`. `element` must be an ancestor of both `start.element` and\n * `end.element`.\n */\n relativeTo(element) {\n return new TextRange(this.start.relativeTo(element), this.end.relativeTo(element));\n }\n /**\n * Resolve this TextRange to a (DOM) Range.\n *\n * The resulting DOM Range will always start and end in a `Text` node.\n * Hence `TextRange.fromRange(range).toRange()` can be used to \"shrink\" a\n * range to the text it contains.\n *\n * May throw if the `start` or `end` positions cannot be resolved to a range.\n */\n toRange() {\n let start;\n let end;\n if (this.start.element === this.end.element &&\n this.start.offset <= this.end.offset) {\n // Fast path for start and end points in same element.\n [start, end] = resolveOffsets(this.start.element, this.start.offset, this.end.offset);\n }\n else {\n start = this.start.resolve({\n direction: ResolveDirection.FORWARDS,\n });\n end = this.end.resolve({ direction: ResolveDirection.BACKWARDS });\n }\n const range = new Range();\n range.setStart(start.node, start.offset);\n range.setEnd(end.node, end.offset);\n return range;\n }\n /**\n * Create a TextRange from a (DOM) Range\n */\n static fromRange(range) {\n const start = TextPosition.fromPoint(range.startContainer, range.startOffset);\n const end = TextPosition.fromPoint(range.endContainer, range.endOffset);\n return new TextRange(start, end);\n }\n /**\n * Create a TextRange representing the `start`th to `end`th characters in\n * `root`\n */\n static fromOffsets(root, start, end) {\n return new TextRange(new TextPosition(root, start), new TextPosition(root, end));\n }\n /**\n * Return a new Range representing `range` trimmed of any leading or trailing\n * whitespace\n */\n static trimmedRange(range) {\n return trimRange(TextRange.fromRange(range).toRange());\n }\n}\n","//\n// Copyright 2021 Readium Foundation. All rights reserved.\n// Use of this source code is governed by the BSD-style license\n// available in the top-level LICENSE file of the project.\n//\nimport { dezoomRect, domRectToRect } from \"../util/rect\";\nimport { log } from \"../util/log\";\nimport { TextRange } from \"../vendor/hypothesis/annotator/anchoring/text-range\";\n// Polyfill for Android API 26\nimport matchAll from \"string.prototype.matchall\";\nimport { rectToParentCoordinates } from \"./geometry\";\nmatchAll.shim();\nexport function selectionToParentCoordinates(selection, iframe) {\n const boundingRect = iframe.getBoundingClientRect();\n const shiftedRect = rectToParentCoordinates(selection.selectionRect, boundingRect);\n return {\n selectedText: selection === null || selection === void 0 ? void 0 : selection.selectedText,\n selectionRect: shiftedRect,\n textBefore: selection.textBefore,\n textAfter: selection.textAfter,\n };\n}\nexport class SelectionManager {\n constructor(window) {\n this.isSelecting = false;\n //, listener: SelectionListener) {\n this.window = window;\n /*this.listener = listener\n document.addEventListener(\n \"selectionchange\",\n () => {\n const selection = window.getSelection()!\n const collapsed = selection.isCollapsed\n \n if (collapsed && this.isSelecting) {\n this.isSelecting = false\n this.listener.onSelectionEnd()\n } else if (!collapsed && !this.isSelecting) {\n this.isSelecting = true\n this.listener.onSelectionStart()\n }\n },\n false\n )*/\n }\n clearSelection() {\n var _a;\n (_a = this.window.getSelection()) === null || _a === void 0 ? void 0 : _a.removeAllRanges();\n }\n getCurrentSelection() {\n const text = this.getCurrentSelectionText();\n if (!text) {\n return null;\n }\n const rect = this.getSelectionRect();\n return {\n selectedText: text.highlight,\n textBefore: text.before,\n textAfter: text.after,\n selectionRect: rect,\n };\n }\n getSelectionRect() {\n try {\n const selection = this.window.getSelection();\n const range = selection.getRangeAt(0);\n const zoom = this.window.document.body.currentCSSZoom;\n return dezoomRect(domRectToRect(range.getBoundingClientRect()), zoom);\n }\n catch (e) {\n log(e);\n throw e;\n //return null\n }\n }\n getCurrentSelectionText() {\n const selection = this.window.getSelection();\n if (selection.isCollapsed) {\n return undefined;\n }\n const highlight = selection.toString();\n const cleanHighlight = highlight\n .trim()\n .replace(/\\n/g, \" \")\n .replace(/\\s\\s+/g, \" \");\n if (cleanHighlight.length === 0) {\n return undefined;\n }\n if (!selection.anchorNode || !selection.focusNode) {\n return undefined;\n }\n const range = selection.rangeCount === 1\n ? selection.getRangeAt(0)\n : createOrderedRange(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);\n if (!range || range.collapsed) {\n log(\"$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!\");\n return undefined;\n }\n const text = document.body.textContent;\n const textRange = TextRange.fromRange(range).relativeTo(document.body);\n const start = textRange.start.offset;\n const end = textRange.end.offset;\n const snippetLength = 200;\n // Compute the text before the highlight, ignoring the first \"word\", which might be cut.\n let before = text.slice(Math.max(0, start - snippetLength), start);\n const firstWordStart = before.search(/\\P{L}\\p{L}/gu);\n if (firstWordStart !== -1) {\n before = before.slice(firstWordStart + 1);\n }\n // Compute the text after the highlight, ignoring the last \"word\", which might be cut.\n let after = text.slice(end, Math.min(text.length, end + snippetLength));\n const lastWordEnd = Array.from(after.matchAll(/\\p{L}\\P{L}/gu)).pop();\n if (lastWordEnd !== undefined && lastWordEnd.index > 1) {\n after = after.slice(0, lastWordEnd.index + 1);\n }\n return { highlight, before, after };\n }\n}\nfunction createOrderedRange(startNode, startOffset, endNode, endOffset) {\n const range = new Range();\n range.setStart(startNode, startOffset);\n range.setEnd(endNode, endOffset);\n if (!range.collapsed) {\n return range;\n }\n log(\">>> createOrderedRange COLLAPSED ... RANGE REVERSE?\");\n const rangeReverse = new Range();\n rangeReverse.setStart(endNode, endOffset);\n rangeReverse.setEnd(startNode, startOffset);\n if (!rangeReverse.collapsed) {\n log(\">>> createOrderedRange RANGE REVERSE OK.\");\n return range;\n }\n log(\">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!\");\n return undefined;\n}\n/*\nexport function convertRangeInfo(document: Document, rangeInfo) {\n const startElement = document.querySelector(\n rangeInfo.startContainerElementCssSelector\n );\n if (!startElement) {\n log(\"^^^ convertRangeInfo NO START ELEMENT CSS SELECTOR?!\");\n return undefined;\n }\n let startContainer = startElement;\n if (rangeInfo.startContainerChildTextNodeIndex >= 0) {\n if (\n rangeInfo.startContainerChildTextNodeIndex >=\n startElement.childNodes.length\n ) {\n log(\n \"^^^ convertRangeInfo rangeInfo.startContainerChildTextNodeIndex >= startElement.childNodes.length?!\"\n );\n return undefined;\n }\n startContainer =\n startElement.childNodes[rangeInfo.startContainerChildTextNodeIndex];\n if (startContainer.nodeType !== Node.TEXT_NODE) {\n log(\"^^^ convertRangeInfo startContainer.nodeType !== Node.TEXT_NODE?!\");\n return undefined;\n }\n }\n const endElement = document.querySelector(\n rangeInfo.endContainerElementCssSelector\n );\n if (!endElement) {\n log(\"^^^ convertRangeInfo NO END ELEMENT CSS SELECTOR?!\");\n return undefined;\n }\n let endContainer = endElement;\n if (rangeInfo.endContainerChildTextNodeIndex >= 0) {\n if (\n rangeInfo.endContainerChildTextNodeIndex >= endElement.childNodes.length\n ) {\n log(\n \"^^^ convertRangeInfo rangeInfo.endContainerChildTextNodeIndex >= endElement.childNodes.length?!\"\n );\n return undefined;\n }\n endContainer =\n endElement.childNodes[rangeInfo.endContainerChildTextNodeIndex];\n if (endContainer.nodeType !== Node.TEXT_NODE) {\n log(\"^^^ convertRangeInfo endContainer.nodeType !== Node.TEXT_NODE?!\");\n return undefined;\n }\n }\n return createOrderedRange(\n startContainer,\n rangeInfo.startOffset,\n endContainer,\n rangeInfo.endOffset\n );\n}\n\nexport function location2RangeInfo(location) {\n const locations = location.locations;\n const domRange = locations.domRange;\n const start = domRange.start;\n const end = domRange.end;\n\n return {\n endContainerChildTextNodeIndex: end.textNodeIndex,\n endContainerElementCssSelector: end.cssSelector,\n endOffset: end.offset,\n startContainerChildTextNodeIndex: start.textNodeIndex,\n startContainerElementCssSelector: start.cssSelector,\n startOffset: start.offset,\n };\n}\n*/\n","export class SelectionWrapperParentSide {\n constructor(listener) {\n this.selectionListener = listener;\n }\n setMessagePort(messagePort) {\n this.messagePort = messagePort;\n messagePort.onmessage = (message) => {\n this.onFeedback(message.data);\n };\n }\n requestSelection(requestId) {\n this.send({ kind: \"requestSelection\", requestId: requestId });\n }\n clearSelection() {\n this.send({ kind: \"clearSelection\" });\n }\n onFeedback(feedback) {\n switch (feedback.kind) {\n case \"selectionAvailable\":\n return this.onSelectionAvailable(feedback.requestId, feedback.selection);\n }\n }\n onSelectionAvailable(requestId, selection) {\n this.selectionListener.onSelectionAvailable(requestId, selection);\n }\n send(message) {\n var _a;\n (_a = this.messagePort) === null || _a === void 0 ? void 0 : _a.postMessage(message);\n }\n}\nexport class SelectionWrapperIframeSide {\n constructor(messagePort, manager) {\n this.selectionManager = manager;\n this.messagePort = messagePort;\n messagePort.onmessage = (message) => {\n this.onCommand(message.data);\n };\n }\n onCommand(command) {\n switch (command.kind) {\n case \"requestSelection\":\n return this.onRequestSelection(command.requestId);\n case \"clearSelection\":\n return this.onClearSelection();\n }\n }\n onRequestSelection(requestId) {\n const selection = this.selectionManager.getCurrentSelection();\n const feedback = {\n kind: \"selectionAvailable\",\n requestId: requestId,\n selection: selection,\n };\n this.sendFeedback(feedback);\n }\n onClearSelection() {\n this.selectionManager.clearSelection();\n }\n sendFeedback(message) {\n this.messagePort.postMessage(message);\n }\n}\n","export class DecorationWrapperParentSide {\n setMessagePort(messagePort) {\n this.messagePort = messagePort;\n }\n registerTemplates(templates) {\n this.send({ kind: \"registerTemplates\", templates });\n }\n addDecoration(decoration, group) {\n this.send({ kind: \"addDecoration\", decoration, group });\n }\n removeDecoration(id, group) {\n this.send({ kind: \"removeDecoration\", id, group });\n }\n send(message) {\n var _a;\n (_a = this.messagePort) === null || _a === void 0 ? void 0 : _a.postMessage(message);\n }\n}\nexport class DecorationWrapperIframeSide {\n constructor(messagePort, decorationManager) {\n this.decorationManager = decorationManager;\n messagePort.onmessage = (message) => {\n this.onCommand(message.data);\n };\n }\n onCommand(command) {\n switch (command.kind) {\n case \"registerTemplates\":\n return this.registerTemplates(command.templates);\n case \"addDecoration\":\n return this.addDecoration(command.decoration, command.group);\n case \"removeDecoration\":\n return this.removeDecoration(command.id, command.group);\n }\n }\n registerTemplates(templates) {\n this.decorationManager.registerTemplates(templates);\n }\n addDecoration(decoration, group) {\n this.decorationManager.addDecoration(decoration, group);\n }\n removeDecoration(id, group) {\n this.decorationManager.removeDecoration(id, group);\n }\n}\n","//\n// Copyright 2024 Readium Foundation. All rights reserved.\n// Use of this source code is governed by the BSD-style license\n// available in the top-level LICENSE file of the project.\n//\nimport { FixedDoubleAreaBridge as FixedDoubleAreaBridge } from \"./bridge/fixed-area-bridge\";\nimport { FixedDoubleSelectionBridge } from \"./bridge/all-selection-bridge\";\nimport { FixedDoubleDecorationsBridge } from \"./bridge/all-decoration-bridge\";\nimport { FixedDoubleInitializationBridge, } from \"./bridge/all-initialization-bridge\";\nconst leftIframe = document.getElementById(\"page-left\");\nconst rightIframe = document.getElementById(\"page-right\");\nconst metaViewport = document.querySelector(\"meta[name=viewport]\");\nWindow.prototype.doubleArea = new FixedDoubleAreaBridge(window, leftIframe, rightIframe, metaViewport, window.gestures, window.documentState);\nwindow.doubleSelection = new FixedDoubleSelectionBridge(leftIframe, rightIframe, window.doubleSelectionListener);\nwindow.doubleDecorations = new FixedDoubleDecorationsBridge();\nwindow.doubleInitialization = new FixedDoubleInitializationBridge(window, window.fixedApiState, leftIframe, rightIframe, window.doubleArea, window.doubleSelection, window.doubleDecorations);\nwindow.fixedApiState.onInitializationApiAvailable();\n","import { DoubleAreaManager } from \"../fixed/double-area-manager\";\nimport { FixedListenerAdapter, } from \"./all-listener-bridge\";\nimport { SingleAreaManager } from \"../fixed/single-area-manager\";\nexport class FixedSingleAreaBridge {\n constructor(window, iframe, metaViewport, gesturesBridge, documentBridge) {\n const listener = new FixedListenerAdapter(window, gesturesBridge, documentBridge);\n this.manager = new SingleAreaManager(window, iframe, metaViewport, listener);\n }\n setMessagePort(messagePort) {\n this.manager.setMessagePort(messagePort);\n }\n loadResource(url) {\n this.manager.loadResource(url);\n }\n setViewport(viewporttWidth, viewportHeight, insetTop, insetRight, insetBottom, insetLeft) {\n const viewport = { width: viewporttWidth, height: viewportHeight };\n const insets = {\n top: insetTop,\n left: insetLeft,\n bottom: insetBottom,\n right: insetRight,\n };\n this.manager.setViewport(viewport, insets);\n }\n setFit(fit) {\n if (fit != \"contain\" && fit != \"width\" && fit != \"height\") {\n throw Error(`Invalid fit value: ${fit}`);\n }\n this.manager.setFit(fit);\n }\n}\nexport class FixedDoubleAreaBridge {\n constructor(window, leftIframe, rightIframe, metaViewport, gesturesBridge, documentBridge) {\n const listener = new FixedListenerAdapter(window, gesturesBridge, documentBridge);\n this.manager = new DoubleAreaManager(window, leftIframe, rightIframe, metaViewport, listener);\n }\n setLeftMessagePort(messagePort) {\n this.manager.setLeftMessagePort(messagePort);\n }\n setRightMessagePort(messagePort) {\n this.manager.setRightMessagePort(messagePort);\n }\n loadSpread(spread) {\n this.manager.loadSpread(spread);\n }\n setViewport(viewporttWidth, viewportHeight, insetTop, insetRight, insetBottom, insetLeft) {\n const viewport = { width: viewporttWidth, height: viewportHeight };\n const insets = {\n top: insetTop,\n left: insetLeft,\n bottom: insetBottom,\n right: insetRight,\n };\n this.manager.setViewport(viewport, insets);\n }\n setFit(fit) {\n if (fit != \"contain\" && fit != \"width\" && fit != \"height\") {\n throw Error(`Invalid fit value: ${fit}`);\n }\n this.manager.setFit(fit);\n }\n}\n","import { selectionToParentCoordinates, } from \"../common/selection\";\nimport { SelectionWrapperParentSide } from \"../fixed/selection-wrapper\";\nexport class ReflowableSelectionBridge {\n constructor(window, manager) {\n this.window = window;\n this.manager = manager;\n }\n getCurrentSelection() {\n return this.manager.getCurrentSelection();\n }\n clearSelection() {\n this.manager.clearSelection();\n }\n}\nexport class FixedSingleSelectionBridge {\n constructor(listener) {\n this.listener = listener;\n const wrapperListener = {\n onSelectionAvailable: (requestId, selection) => {\n const selectionAsJson = JSON.stringify(selection);\n this.listener.onSelectionAvailable(requestId, selectionAsJson);\n },\n };\n this.wrapper = new SelectionWrapperParentSide(wrapperListener);\n }\n setMessagePort(messagePort) {\n this.wrapper.setMessagePort(messagePort);\n }\n requestSelection(requestId) {\n this.wrapper.requestSelection(requestId);\n }\n clearSelection() {\n this.wrapper.clearSelection();\n }\n}\nexport class FixedDoubleSelectionBridge {\n constructor(leftIframe, rightIframe, listener) {\n this.requestStates = new Map();\n this.isLeftInitialized = false;\n this.isRightInitialized = false;\n this.leftIframe = leftIframe;\n this.rightIframe = rightIframe;\n this.listener = listener;\n const leftWrapperListener = {\n onSelectionAvailable: (requestId, selection) => {\n if (selection) {\n const resolvedSelection = selectionToParentCoordinates(selection, this.leftIframe);\n this.onSelectionAvailable(requestId, \"left\", resolvedSelection);\n }\n else {\n this.onSelectionAvailable(requestId, \"left\", selection);\n }\n },\n };\n this.leftWrapper = new SelectionWrapperParentSide(leftWrapperListener);\n const rightWrapperListener = {\n onSelectionAvailable: (requestId, selection) => {\n if (selection) {\n const resolvedSelection = selectionToParentCoordinates(selection, this.rightIframe);\n this.onSelectionAvailable(requestId, \"right\", resolvedSelection);\n }\n else {\n this.onSelectionAvailable(requestId, \"right\", selection);\n }\n },\n };\n this.rightWrapper = new SelectionWrapperParentSide(rightWrapperListener);\n }\n setLeftMessagePort(messagePort) {\n this.leftWrapper.setMessagePort(messagePort);\n this.isLeftInitialized = true;\n }\n setRightMessagePort(messagePort) {\n this.rightWrapper.setMessagePort(messagePort);\n this.isRightInitialized = true;\n }\n requestSelection(requestId) {\n if (this.isLeftInitialized && this.isRightInitialized) {\n this.requestStates.set(requestId, \"pending\");\n this.leftWrapper.requestSelection(requestId);\n this.rightWrapper.requestSelection(requestId);\n }\n else if (this.isLeftInitialized) {\n this.requestStates.set(requestId, \"firstResponseWasNull\");\n this.leftWrapper.requestSelection(requestId);\n }\n else if (this.isRightInitialized) {\n this.requestStates.set(requestId, \"firstResponseWasNull\");\n this.rightWrapper.requestSelection(requestId);\n }\n else {\n this.requestStates.set(requestId, \"firstResponseWasNull\");\n this.onSelectionAvailable(requestId, \"left\", null);\n }\n }\n clearSelection() {\n this.leftWrapper.clearSelection();\n this.rightWrapper.clearSelection();\n }\n onSelectionAvailable(requestId, iframe, selection) {\n const requestState = this.requestStates.get(requestId);\n if (!requestState) {\n return;\n }\n if (!selection && requestState === \"pending\") {\n this.requestStates.set(requestId, \"firstResponseWasNull\");\n return;\n }\n this.requestStates.delete(requestId);\n const selectionAsJson = JSON.stringify(selection);\n this.listener.onSelectionAvailable(requestId, iframe, selectionAsJson);\n }\n}\n","import { DecorationWrapperParentSide } from \"../fixed/decoration-wrapper\";\nexport class ReflowableDecorationsBridge {\n constructor(window, manager) {\n this.window = window;\n this.manager = manager;\n }\n registerTemplates(templates) {\n const templatesAsMap = parseTemplates(templates);\n this.manager.registerTemplates(templatesAsMap);\n }\n addDecoration(decoration, group) {\n const actualDecoration = parseDecoration(decoration);\n this.manager.addDecoration(actualDecoration, group);\n }\n removeDecoration(id, group) {\n this.manager.removeDecoration(id, group);\n }\n}\nexport class FixedSingleDecorationsBridge {\n constructor() {\n this.wrapper = new DecorationWrapperParentSide();\n }\n setMessagePort(messagePort) {\n this.wrapper.setMessagePort(messagePort);\n }\n registerTemplates(templates) {\n const actualTemplates = parseTemplates(templates);\n this.wrapper.registerTemplates(actualTemplates);\n }\n addDecoration(decoration, group) {\n const actualDecoration = parseDecoration(decoration);\n this.wrapper.addDecoration(actualDecoration, group);\n }\n removeDecoration(id, group) {\n this.wrapper.removeDecoration(id, group);\n }\n}\nexport class FixedDoubleDecorationsBridge {\n constructor() {\n this.leftWrapper = new DecorationWrapperParentSide();\n this.rightWrapper = new DecorationWrapperParentSide();\n }\n setLeftMessagePort(messagePort) {\n this.leftWrapper.setMessagePort(messagePort);\n }\n setRightMessagePort(messagePort) {\n this.rightWrapper.setMessagePort(messagePort);\n }\n registerTemplates(templates) {\n const actualTemplates = parseTemplates(templates);\n this.leftWrapper.registerTemplates(actualTemplates);\n this.rightWrapper.registerTemplates(actualTemplates);\n }\n addDecoration(decoration, iframe, group) {\n const actualDecoration = parseDecoration(decoration);\n switch (iframe) {\n case \"left\":\n this.leftWrapper.addDecoration(actualDecoration, group);\n break;\n case \"right\":\n this.rightWrapper.addDecoration(actualDecoration, group);\n break;\n default:\n throw Error(`Unknown iframe type: ${iframe}`);\n }\n }\n removeDecoration(id, group) {\n this.leftWrapper.removeDecoration(id, group);\n this.rightWrapper.removeDecoration(id, group);\n }\n}\nfunction parseTemplates(templates) {\n return new Map(Object.entries(JSON.parse(templates)));\n}\nfunction parseDecoration(decoration) {\n const jsonDecoration = JSON.parse(decoration);\n return jsonDecoration;\n}\n","import { DecorationWrapperIframeSide } from \"../fixed/decoration-wrapper\";\nimport { IframeMessageSender } from \"../fixed/iframe-message\";\nimport { SelectionWrapperIframeSide } from \"../fixed/selection-wrapper\";\nexport class FixedSingleInitializationBridge {\n constructor(window, listener, iframe, areaBridge, selectionBridge, decorationsBridge) {\n this.window = window;\n this.listener = listener;\n this.iframe = iframe;\n this.areaBridge = areaBridge;\n this.selectionBridge = selectionBridge;\n this.decorationsBridge = decorationsBridge;\n }\n loadResource(url) {\n this.iframe.src = url;\n this.window.addEventListener(\"message\", (event) => {\n console.log(\"message\");\n if (!event.ports[0]) {\n return;\n }\n if (event.source === this.iframe.contentWindow) {\n this.onInitMessage(event);\n }\n });\n }\n onInitMessage(event) {\n console.log(`receiving init message ${event}`);\n const initMessage = event.data;\n const messagePort = event.ports[0];\n switch (initMessage) {\n case \"InitAreaManager\":\n return this.initAreaManager(messagePort);\n case \"InitSelection\":\n return this.initSelection(messagePort);\n case \"InitDecorations\":\n return this.initDecorations(messagePort);\n }\n }\n initAreaManager(messagePort) {\n this.areaBridge.setMessagePort(messagePort);\n this.listener.onAreaApiAvailable();\n }\n initSelection(messagePort) {\n this.selectionBridge.setMessagePort(messagePort);\n this.listener.onSelectionApiAvailable();\n }\n initDecorations(messagePort) {\n this.decorationsBridge.setMessagePort(messagePort);\n this.listener.onDecorationApiAvailable();\n }\n}\nexport class FixedDoubleInitializationBridge {\n constructor(window, listener, leftIframe, rightIframe, areaBridge, selectionBridge, decorationsBridge) {\n this.areaReadySemaphore = 2;\n this.selectionReadySemaphore = 2;\n this.decorationReadySemaphore = 2;\n this.listener = listener;\n this.areaBridge = areaBridge;\n this.selectionBridge = selectionBridge;\n this.decorationsBridge = decorationsBridge;\n window.addEventListener(\"message\", (event) => {\n if (!event.ports[0]) {\n return;\n }\n if (event.source === leftIframe.contentWindow) {\n this.onInitMessageLeft(event);\n }\n else if (event.source == rightIframe.contentWindow) {\n this.onInitMessageRight(event);\n }\n });\n }\n loadSpread(spread) {\n const pageNb = (spread.left ? 1 : 0) + (spread.right ? 1 : 0);\n this.areaReadySemaphore = pageNb;\n this.selectionReadySemaphore = pageNb;\n this.decorationReadySemaphore = pageNb;\n this.areaBridge.loadSpread(spread);\n }\n onInitMessageLeft(event) {\n const initMessage = event.data;\n const messagePort = event.ports[0];\n switch (initMessage) {\n case \"InitAreaManager\":\n this.areaBridge.setLeftMessagePort(messagePort);\n this.onInitAreaMessage();\n break;\n case \"InitSelection\":\n this.selectionBridge.setLeftMessagePort(messagePort);\n this.onInitSelectionMessage();\n break;\n case \"InitDecorations\":\n this.decorationsBridge.setLeftMessagePort(messagePort);\n this.onInitDecorationMessage();\n break;\n }\n }\n onInitMessageRight(event) {\n const initMessage = event.data;\n const messagePort = event.ports[0];\n switch (initMessage) {\n case \"InitAreaManager\":\n this.areaBridge.setRightMessagePort(messagePort);\n this.onInitAreaMessage();\n break;\n case \"InitSelection\":\n this.selectionBridge.setRightMessagePort(messagePort);\n this.onInitSelectionMessage();\n break;\n case \"InitDecorations\":\n this.decorationsBridge.setRightMessagePort(messagePort);\n this.onInitDecorationMessage();\n break;\n }\n }\n onInitAreaMessage() {\n this.areaReadySemaphore -= 1;\n if (this.areaReadySemaphore == 0) {\n this.listener.onAreaApiAvailable();\n }\n }\n onInitSelectionMessage() {\n this.selectionReadySemaphore -= 1;\n if (this.selectionReadySemaphore == 0) {\n this.listener.onSelectionApiAvailable();\n }\n }\n onInitDecorationMessage() {\n this.decorationReadySemaphore -= 1;\n if (this.decorationReadySemaphore == 0) {\n this.listener.onDecorationApiAvailable();\n }\n }\n}\nexport class FixedInitializerIframeSide {\n constructor(window) {\n this.window = window;\n }\n initAreaManager() {\n const messagePort = this.initChannel(\"InitAreaManager\");\n return new IframeMessageSender(messagePort);\n }\n initSelection(selectionManager) {\n const messagePort = this.initChannel(\"InitSelection\");\n new SelectionWrapperIframeSide(messagePort, selectionManager);\n }\n initDecorations(decorationManager) {\n const messagePort = this.initChannel(\"InitDecorations\");\n new DecorationWrapperIframeSide(messagePort, decorationManager);\n }\n initChannel(initMessage) {\n const messageChannel = new MessageChannel();\n this.window.parent.postMessage(initMessage, \"*\", [messageChannel.port2]);\n return messageChannel.port1;\n }\n}\n"],"names":["GetIntrinsic","callBind","$indexOf","module","exports","name","allowMissing","intrinsic","bind","$apply","$call","$reflectApply","call","$gOPD","$defineProperty","$max","value","e","originalFunction","func","arguments","configurable","length","applyBind","apply","hasPropertyDescriptors","$SyntaxError","$TypeError","gopd","obj","property","nonEnumerable","nonWritable","nonConfigurable","loose","desc","enumerable","writable","keys","hasSymbols","Symbol","toStr","Object","prototype","toString","concat","Array","defineDataProperty","supportsDescriptors","defineProperty","object","predicate","fn","defineProperties","map","predicates","props","getOwnPropertySymbols","i","hasToStringTag","has","toStringTag","overrideIfSet","force","iterator","isPrimitive","isCallable","isDate","isSymbol","input","exoticToPrim","hint","String","Number","toPrimitive","O","P","TypeError","GetMethod","valueOf","result","method","methodNames","ordinaryToPrimitive","slice","that","target","this","bound","args","boundLength","Math","max","boundArgs","push","Function","join","Empty","implementation","functionsHaveNames","gOPD","getOwnPropertyDescriptor","functionsHaveConfigurableNames","$bind","boundFunctionsHaveNames","undefined","SyntaxError","$Function","getEvalledConstructor","expressionSyntax","throwTypeError","ThrowTypeError","calleeThrows","get","gOPDthrows","hasProto","getProto","getPrototypeOf","x","__proto__","needsEval","TypedArray","Uint8Array","INTRINSICS","AggregateError","ArrayBuffer","Atomics","BigInt","BigInt64Array","BigUint64Array","Boolean","DataView","Date","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","Error","eval","EvalError","Float32Array","Float64Array","FinalizationRegistry","Int8Array","Int16Array","Int32Array","isFinite","isNaN","JSON","Map","parseFloat","parseInt","Promise","Proxy","RangeError","ReferenceError","Reflect","RegExp","Set","SharedArrayBuffer","Uint8ClampedArray","Uint16Array","Uint32Array","URIError","WeakMap","WeakRef","WeakSet","error","errorProto","doEval","gen","LEGACY_ALIASES","hasOwn","$concat","$spliceApply","splice","$replace","replace","$strSlice","$exec","exec","rePropName","reEscapeChar","getBaseIntrinsic","alias","intrinsicName","parts","string","first","last","match","number","quote","subString","stringToPath","intrinsicBaseName","intrinsicRealName","skipFurtherCaching","isOwn","part","hasArrayLengthDefineBug","test","foo","$Object","origSymbol","hasSymbolSham","sym","symObj","getOwnPropertyNames","syms","propertyIsEnumerable","descriptor","hasOwnProperty","channel","SLOT","assert","slot","slots","set","V","freeze","badArrayLike","isCallableMarker","fnToStr","reflectApply","_","constructorRegex","isES6ClassFn","fnStr","tryFunctionObject","isIE68","isDDA","document","all","str","strClass","getDay","tryDateObject","isRegexMarker","badStringifier","callBound","throwRegexMarker","$toString","symToStr","symStringRegex","isSymbolObject","hasMap","mapSizeDescriptor","mapSize","mapForEach","forEach","hasSet","setSizeDescriptor","setSize","setForEach","weakMapHas","weakSetHas","weakRefDeref","deref","booleanValueOf","objectToString","functionToString","$match","$slice","$toUpperCase","toUpperCase","$toLowerCase","toLowerCase","$test","$join","$arrSlice","$floor","floor","bigIntValueOf","gOPS","symToString","hasShammedSymbols","isEnumerable","gPO","addNumericSeparator","num","Infinity","sepRegex","int","intStr","dec","utilInspect","inspectCustom","custom","inspectSymbol","wrapQuotes","s","defaultStyle","opts","quoteChar","quoteStyle","isArray","isRegExp","inspect_","options","depth","seen","maxStringLength","customInspect","indent","numericSeparator","inspectString","bigIntStr","maxDepth","baseIndent","base","prev","getIndent","indexOf","inspect","from","noIndent","newOpts","f","m","nameOf","arrObjKeys","symString","markBoxed","HTMLElement","nodeName","getAttribute","attrs","attributes","childNodes","xs","singleLineValues","indentedJoin","isError","cause","isMap","mapParts","key","collectionOf","isSet","setParts","isWeakMap","weakCollectionOf","isWeakSet","isWeakRef","isNumber","isBigInt","isBoolean","isString","ys","isPlainObject","constructor","protoTag","stringTag","tag","l","remaining","trailer","lowbyte","c","n","charCodeAt","type","size","entries","lineJoiner","isArr","symMap","k","j","keysShim","isArgs","hasDontEnumBug","hasProtoEnumBug","dontEnums","equalsConstructorPrototype","o","ctor","excludedKeys","$applicationCache","$console","$external","$frame","$frameElement","$frames","$innerHeight","$innerWidth","$onmozfullscreenchange","$onmozfullscreenerror","$outerHeight","$outerWidth","$pageXOffset","$pageYOffset","$parent","$scrollLeft","$scrollTop","$scrollX","$scrollY","$self","$webkitIndexedDB","$webkitStorageInfo","$window","hasAutomationEqualityBug","window","isObject","isFunction","isArguments","theKeys","skipProto","skipConstructor","equalsConstructorPrototypeIfNotBuggy","origKeys","originalKeys","shim","keysWorksWithArguments","callee","setFunctionName","hasIndices","global","ignoreCase","multiline","dotAll","unicode","unicodeSets","sticky","define","getPolyfill","flagsBound","flags","calls","TypeErr","regex","polyfill","proto","isRegex","hasDescriptors","$WeakMap","$Map","$weakMapGet","$weakMapSet","$weakMapHas","$mapGet","$mapSet","$mapHas","listGetNode","list","curr","next","$wm","$m","$o","objects","node","listGet","listHas","listSet","Call","Get","IsRegExp","ToString","RequireObjectCoercible","flagsGetter","regexpMatchAllPolyfill","getMatcher","regexp","matcherPolyfill","matchAll","matcher","S","rx","boundMatchAll","regexpMatchAll","CreateRegExpStringIterator","SpeciesConstructor","ToLength","Type","OrigRegExp","supportsConstructingWithFlags","regexMatchAll","R","tmp","C","source","constructRegexWithFlags","lastIndex","fullUnicode","defineP","symbol","mvsIsWS","leftWhitespace","rightWhitespace","boundMethod","receiver","trim","CodePointAt","isInteger","MAX_SAFE_INTEGER","index","IsArray","F","argumentsList","isLeadingSurrogate","isTrailingSurrogate","UTF16SurrogatePairToCodePoint","$charAt","$charCodeAt","position","cp","firstIsLeading","firstIsTrailing","second","done","DefineOwnProperty","FromPropertyDescriptor","IsDataDescriptor","IsPropertyKey","SameValue","IteratorPrototype","AdvanceStringIndex","CreateIterResultObject","CreateMethodProperty","OrdinaryObjectCreate","RegExpExec","setToStringTag","RegExpStringIterator","thisIndex","nextIndex","isPropertyDescriptor","IsAccessorDescriptor","ToPropertyDescriptor","Desc","assertRecord","fromPropertyDescriptor","GetV","IsCallable","$construct","DefinePropertyOrThrow","isConstructorMarker","argument","err","hasRegExpMatcher","ToBoolean","$ObjectCreate","additionalInternalSlotsList","T","regexExec","$isNaN","y","noThrowOnStrictViolation","Throw","$species","IsConstructor","defaultConstructor","$Number","$RegExp","$parseInteger","regexTester","isBinary","isOctal","isInvalidHexLiteral","hasNonWS","$trim","StringToNumber","NaN","trimmed","ToNumber","truncate","$isFinite","ToIntegerOrInfinity","len","ToPrimitive","Obj","getter","setter","$String","ES5Type","$fromCharCode","lead","trail","optMessage","$isEnumerable","$Array","allowed","isData","IsAccessor","then","recordType","argumentName","array","callback","$abs","absValue","charCode","record","a","ES","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","__esModule","d","definition","prop","PageManager","iframe","listener","margins","top","right","bottom","left","contentWindow","setMessagePort","messagePort","onmessage","message","onMessageFromIframe","show","style","display","hide","setMargins","marginTop","marginLeft","marginBottom","marginRight","loadPage","url","src","setPlaceholder","visibility","width","height","event","data","kind","onContentSizeAvailable","onTap","onLinkActivated","onDecorationActivated","URL","href","outerHtml","_a","onIframeLoaded","offsetToParentCoordinates","offset","iframeRect","visualViewport","offsetLeft","scale","offsetTop","rectToParentCoordinates","rect","topLeft","bottomRight","shiftedTopLeft","shiftedBottomRight","ViewportStringBuilder","setInitialScale","initialScale","setMinimumScale","minimumScale","setWidth","setHeight","build","components","GesturesDetector","decorationManager","addEventListener","onClick","defaultPrevented","selection","getSelection","nearestElement","decorationActivatedEvent","nearestInteractiveElement","HTMLAnchorElement","outerHTML","stopPropagation","preventDefault","handleDecorationClickEvent","element","hasAttribute","parentElement","DoubleAreaManager","leftIframe","rightIframe","metaViewport","fit","insets","clientX","clientY","leftPageListener","layout","gestureEvent","boundingRect","getBoundingClientRect","shiftedOffset","shiftedRect","shiftedEvent","id","group","rightPageListener","leftPage","rightPage","setLeftMessagePort","setRightMessagePort","loadSpread","spread","setViewport","viewport","setFit","leftMargins","rightMargins","contentWidth","contentHeight","contentSize","safeDrawingSize","content","container","widthRatio","heightRatio","min","fitContain","fitWidth","fitHeight","computeScale","onLayout","gesturesApi","documentApi","resizeObserverAdded","documentLoadedFired","stringify","stringOffset","stringRect","ResizeObserver","requestAnimationFrame","scrollingElement","scrollHeight","scrollWidth","onDocumentLoadedAndSized","onDocumentResized","observe","body","TrimDirection","ResolveDirection","selectionToParentCoordinates","selectionRect","selectedText","textBefore","textAfter","selectionListener","onFeedback","requestSelection","requestId","send","clearSelection","feedback","onSelectionAvailable","postMessage","registerTemplates","templates","addDecoration","decoration","removeDecoration","getElementById","querySelector","Window","doubleArea","gesturesBridge","documentBridge","manager","viewporttWidth","viewportHeight","insetTop","insetRight","insetBottom","insetLeft","gestures","documentState","doubleSelection","requestStates","isLeftInitialized","isRightInitialized","leftWrapperListener","resolvedSelection","leftWrapper","rightWrapperListener","rightWrapper","requestState","delete","selectionAsJson","doubleSelectionListener","doubleDecorations","actualTemplates","parse","parseTemplates","actualDecoration","parseDecoration","doubleInitialization","areaBridge","selectionBridge","decorationsBridge","areaReadySemaphore","selectionReadySemaphore","decorationReadySemaphore","ports","onInitMessageLeft","onInitMessageRight","pageNb","initMessage","onInitAreaMessage","onInitSelectionMessage","onInitDecorationMessage","onAreaApiAvailable","onSelectionApiAvailable","onDecorationApiAvailable","fixedApiState","onInitializationApiAvailable"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"fixed-double-script.js","mappings":"qDAEA,IAAIA,EAAe,EAAQ,MAEvBC,EAAW,EAAQ,MAEnBC,EAAWD,EAASD,EAAa,6BAErCG,EAAOC,QAAU,SAA4BC,EAAMC,GAClD,IAAIC,EAAYP,EAAaK,IAAQC,GACrC,MAAyB,mBAAdC,GAA4BL,EAASG,EAAM,gBAAkB,EAChEJ,EAASM,GAEVA,CACR,C,oCCZA,IAAIC,EAAO,EAAQ,MACfR,EAAe,EAAQ,MAEvBS,EAAST,EAAa,8BACtBU,EAAQV,EAAa,6BACrBW,EAAgBX,EAAa,mBAAmB,IAASQ,EAAKI,KAAKF,EAAOD,GAE1EI,EAAQb,EAAa,qCAAqC,GAC1Dc,EAAkBd,EAAa,2BAA2B,GAC1De,EAAOf,EAAa,cAExB,GAAIc,EACH,IACCA,EAAgB,CAAC,EAAG,IAAK,CAAEE,MAAO,GACnC,CAAE,MAAOC,GAERH,EAAkB,IACnB,CAGDX,EAAOC,QAAU,SAAkBc,GAClC,IAAIC,EAAOR,EAAcH,EAAME,EAAOU,WAYtC,OAXIP,GAASC,GACDD,EAAMM,EAAM,UACdE,cAERP,EACCK,EACA,SACA,CAAEH,MAAO,EAAID,EAAK,EAAGG,EAAiBI,QAAUF,UAAUE,OAAS,MAI/DH,CACR,EAEA,IAAII,EAAY,WACf,OAAOZ,EAAcH,EAAMC,EAAQW,UACpC,EAEIN,EACHA,EAAgBX,EAAOC,QAAS,QAAS,CAAEY,MAAOO,IAElDpB,EAAOC,QAAQoB,MAAQD,C,oCC3CxB,IAAIE,EAAyB,EAAQ,IAAR,GAEzBzB,EAAe,EAAQ,MAEvBc,EAAkBW,GAA0BzB,EAAa,2BAA2B,GAEpF0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9sB,KAAKwgB,SAASiN,yBAEtB,CACA,uBAAAF,GACIvtB,KAAK+sB,0BAA4B,EACI,GAAjC/sB,KAAK+sB,0BACL/sB,KAAKwgB,SAASkN,0BAEtB,GJpH8D9Z,OAAQA,OAAO+Z,cAAepI,EAAYC,EAAa5R,OAAO8W,WAAY9W,OAAO0X,gBAAiB1X,OAAOuY,mBAC3KvY,OAAO+Z,cAAcC,8B","sources":["webpack://readium-js/./node_modules/.pnpm/call-bind@1.0.2/node_modules/call-bind/callBound.js","webpack://readium-js/./node_modules/.pnpm/call-bind@1.0.2/node_modules/call-bind/index.js","webpack://readium-js/./node_modules/.pnpm/define-data-property@1.1.0/node_modules/define-data-property/index.js","webpack://readium-js/./node_modules/.pnpm/define-properties@1.2.1/node_modules/define-properties/index.js","webpack://readium-js/./node_modules/.pnpm/es-set-tostringtag@2.0.1/node_modules/es-set-tostringtag/index.js","webpack://readium-js/./node_modules/.pnpm/es-to-primitive@1.2.1/node_modules/es-to-primitive/es2015.js","webpack://readium-js/./node_modules/.pnpm/es-to-primitive@1.2.1/node_modules/es-to-primitive/helpers/isPrimitive.js","webpack://readium-js/./node_modules/.pnpm/function-bind@1.1.1/node_modules/function-bind/implementation.js","webpack://readium-js/./node_modules/.pnpm/function-bind@1.1.1/node_modules/function-bind/index.js","webpack://readium-js/./node_modules/.pnpm/functions-have-names@1.2.3/node_modules/functions-have-names/index.js","webpack://readium-js/./node_modules/.pnpm/get-intrinsic@1.2.1/node_modules/get-intrinsic/index.js","webpack://readium-js/./node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.js","webpack://readium-js/./node_modules/.pnpm/has-property-descriptors@1.0.0/node_modules/has-property-descriptors/index.js","webpack://readium-js/./node_modules/.pnpm/has-proto@1.0.1/node_modules/has-proto/index.js","webpack://readium-js/./node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/index.js","webpack://readium-js/./node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/shams.js","webpack://readium-js/./node_modules/.pnpm/has-tostringtag@1.0.0/node_modules/has-tostringtag/shams.js","webpack://readium-js/./node_modules/.pnpm/has@1.0.4/node_modules/has/src/index.js","webpack://readium-js/./node_modules/.pnpm/internal-slot@1.0.5/node_modules/internal-slot/index.js","webpack://readium-js/./node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/index.js","webpack://readium-js/./node_modules/.pnpm/is-date-object@1.0.5/node_modules/is-date-object/index.js","webpack://readium-js/./node_modules/.pnpm/is-regex@1.1.4/node_modules/is-regex/index.js","webpack://readium-js/./node_modules/.pnpm/is-symbol@1.0.4/node_modules/is-symbol/index.js","webpack://readium-js/./node_modules/.pnpm/object-inspect@1.12.3/node_modules/object-inspect/index.js","webpack://readium-js/./node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/implementation.js","webpack://readium-js/./node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/index.js","webpack://readium-js/./node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/isArguments.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/implementation.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/index.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/polyfill.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/shim.js","webpack://readium-js/./node_modules/.pnpm/safe-regex-test@1.0.0/node_modules/safe-regex-test/index.js","webpack://readium-js/./node_modules/.pnpm/set-function-name@2.0.1/node_modules/set-function-name/index.js","webpack://readium-js/./node_modules/.pnpm/side-channel@1.0.4/node_modules/side-channel/index.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/implementation.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/index.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/polyfill-regexp-matchall.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/polyfill.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/regexp-matchall.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/shim.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/implementation.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/index.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/polyfill.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/shim.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/AdvanceStringIndex.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Call.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CodePointAt.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CreateIterResultObject.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CreateMethodProperty.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CreateRegExpStringIterator.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/DefinePropertyOrThrow.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/FromPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Get.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/GetMethod.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/GetV.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsAccessorDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsArray.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsCallable.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsConstructor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsDataDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsPropertyKey.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsRegExp.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/OrdinaryObjectCreate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/RegExpExec.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/RequireObjectCoercible.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/SameValue.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Set.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/SpeciesConstructor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/StringToNumber.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToBoolean.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToIntegerOrInfinity.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToLength.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToNumber.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToPrimitive.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToString.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Type.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/UTF16SurrogatePairToCodePoint.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/floor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/truncate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/5/CheckObjectCoercible.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/5/Type.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/GetIntrinsic.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/DefineOwnProperty.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/IsArray.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/assertRecord.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/forEach.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/fromPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isFinite.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isInteger.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isLeadingSurrogate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isMatchRecord.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isNaN.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isPrimitive.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isTrailingSurrogate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/maxSafeInteger.js","webpack://readium-js/webpack/bootstrap","webpack://readium-js/webpack/runtime/compat get default export","webpack://readium-js/webpack/runtime/define property getters","webpack://readium-js/webpack/runtime/hasOwnProperty shorthand","webpack://readium-js/./src/fixed/page-manager.ts","webpack://readium-js/./src/common/geometry.ts","webpack://readium-js/./src/util/viewport.ts","webpack://readium-js/./src/common/gestures.ts","webpack://readium-js/./src/fixed/double-area-manager.ts","webpack://readium-js/./src/fixed/fit.ts","webpack://readium-js/./src/bridge/all-listener-bridge.ts","webpack://readium-js/./src/vendor/hypothesis/annotator/anchoring/trim-range.ts","webpack://readium-js/./src/vendor/hypothesis/annotator/anchoring/text-range.ts","webpack://readium-js/./src/common/selection.ts","webpack://readium-js/./src/fixed/selection-wrapper.ts","webpack://readium-js/./src/fixed/decoration-wrapper.ts","webpack://readium-js/./src/index-fixed-double.ts","webpack://readium-js/./src/bridge/fixed-area-bridge.ts","webpack://readium-js/./src/bridge/all-selection-bridge.ts","webpack://readium-js/./src/bridge/all-decoration-bridge.ts","webpack://readium-js/./src/bridge/all-initialization-bridge.ts"],"sourcesContent":["'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBind = require('./');\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = null;\n\t}\n}\n\nmodule.exports = function callBind(originalFunction) {\n\tvar func = $reflectApply(bind, $call, arguments);\n\tif ($gOPD && $defineProperty) {\n\t\tvar desc = $gOPD(func, 'length');\n\t\tif (desc.configurable) {\n\t\t\t// original length, plus the receiver, minus any additional arguments (after the receiver)\n\t\t\t$defineProperty(\n\t\t\t\tfunc,\n\t\t\t\t'length',\n\t\t\t\t{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }\n\t\t\t);\n\t\t}\n\t}\n\treturn func;\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","'use strict';\n\nvar hasPropertyDescriptors = require('has-property-descriptors')();\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = hasPropertyDescriptors && GetIntrinsic('%Object.defineProperty%', true);\n\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar gopd = require('gopd');\n\n/** @type {(obj: Record, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */\nmodule.exports = function defineDataProperty(\n\tobj,\n\tproperty,\n\tvalue\n) {\n\tif (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n\t\tthrow new $TypeError('`obj` must be an object or a function`');\n\t}\n\tif (typeof property !== 'string' && typeof property !== 'symbol') {\n\t\tthrow new $TypeError('`property` must be a string or a symbol`');\n\t}\n\tif (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {\n\t\tthrow new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {\n\t\tthrow new $TypeError('`nonWritable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {\n\t\tthrow new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 6 && typeof arguments[6] !== 'boolean') {\n\t\tthrow new $TypeError('`loose`, if provided, must be a boolean');\n\t}\n\n\tvar nonEnumerable = arguments.length > 3 ? arguments[3] : null;\n\tvar nonWritable = arguments.length > 4 ? arguments[4] : null;\n\tvar nonConfigurable = arguments.length > 5 ? arguments[5] : null;\n\tvar loose = arguments.length > 6 ? arguments[6] : false;\n\n\t/* @type {false | TypedPropertyDescriptor} */\n\tvar desc = !!gopd && gopd(obj, property);\n\n\tif ($defineProperty) {\n\t\t$defineProperty(obj, property, {\n\t\t\tconfigurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,\n\t\t\tenumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,\n\t\t\tvalue: value,\n\t\t\twritable: nonWritable === null && desc ? desc.writable : !nonWritable\n\t\t});\n\t} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {\n\t\t// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable\n\t\tobj[property] = value; // eslint-disable-line no-param-reassign\n\t} else {\n\t\tthrow new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');\n\t}\n};\n","'use strict';\n\nvar keys = require('object-keys');\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';\n\nvar toStr = Object.prototype.toString;\nvar concat = Array.prototype.concat;\nvar defineDataProperty = require('define-data-property');\n\nvar isFunction = function (fn) {\n\treturn typeof fn === 'function' && toStr.call(fn) === '[object Function]';\n};\n\nvar supportsDescriptors = require('has-property-descriptors')();\n\nvar defineProperty = function (object, name, value, predicate) {\n\tif (name in object) {\n\t\tif (predicate === true) {\n\t\t\tif (object[name] === value) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (!isFunction(predicate) || !predicate()) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (supportsDescriptors) {\n\t\tdefineDataProperty(object, name, value, true);\n\t} else {\n\t\tdefineDataProperty(object, name, value);\n\t}\n};\n\nvar defineProperties = function (object, map) {\n\tvar predicates = arguments.length > 2 ? arguments[2] : {};\n\tvar props = keys(map);\n\tif (hasSymbols) {\n\t\tprops = concat.call(props, Object.getOwnPropertySymbols(map));\n\t}\n\tfor (var i = 0; i < props.length; i += 1) {\n\t\tdefineProperty(object, props[i], map[props[i]], predicates[props[i]]);\n\t}\n};\n\ndefineProperties.supportsDescriptors = !!supportsDescriptors;\n\nmodule.exports = defineProperties;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar has = require('has');\n\nvar toStringTag = hasToStringTag ? Symbol.toStringTag : null;\n\nmodule.exports = function setToStringTag(object, value) {\n\tvar overrideIfSet = arguments.length > 2 && arguments[2] && arguments[2].force;\n\tif (toStringTag && (overrideIfSet || !has(object, toStringTag))) {\n\t\tif ($defineProperty) {\n\t\t\t$defineProperty(object, toStringTag, {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: false,\n\t\t\t\tvalue: value,\n\t\t\t\twritable: false\n\t\t\t});\n\t\t} else {\n\t\t\tobject[toStringTag] = value; // eslint-disable-line no-param-reassign\n\t\t}\n\t}\n};\n","'use strict';\n\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';\n\nvar isPrimitive = require('./helpers/isPrimitive');\nvar isCallable = require('is-callable');\nvar isDate = require('is-date-object');\nvar isSymbol = require('is-symbol');\n\nvar ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) {\n\tif (typeof O === 'undefined' || O === null) {\n\t\tthrow new TypeError('Cannot call method on ' + O);\n\t}\n\tif (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) {\n\t\tthrow new TypeError('hint must be \"string\" or \"number\"');\n\t}\n\tvar methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString'];\n\tvar method, result, i;\n\tfor (i = 0; i < methodNames.length; ++i) {\n\t\tmethod = O[methodNames[i]];\n\t\tif (isCallable(method)) {\n\t\t\tresult = method.call(O);\n\t\t\tif (isPrimitive(result)) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t}\n\tthrow new TypeError('No default value');\n};\n\nvar GetMethod = function GetMethod(O, P) {\n\tvar func = O[P];\n\tif (func !== null && typeof func !== 'undefined') {\n\t\tif (!isCallable(func)) {\n\t\t\tthrow new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function');\n\t\t}\n\t\treturn func;\n\t}\n\treturn void 0;\n};\n\n// http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive\nmodule.exports = function ToPrimitive(input) {\n\tif (isPrimitive(input)) {\n\t\treturn input;\n\t}\n\tvar hint = 'default';\n\tif (arguments.length > 1) {\n\t\tif (arguments[1] === String) {\n\t\t\thint = 'string';\n\t\t} else if (arguments[1] === Number) {\n\t\t\thint = 'number';\n\t\t}\n\t}\n\n\tvar exoticToPrim;\n\tif (hasSymbols) {\n\t\tif (Symbol.toPrimitive) {\n\t\t\texoticToPrim = GetMethod(input, Symbol.toPrimitive);\n\t\t} else if (isSymbol(input)) {\n\t\t\texoticToPrim = Symbol.prototype.valueOf;\n\t\t}\n\t}\n\tif (typeof exoticToPrim !== 'undefined') {\n\t\tvar result = exoticToPrim.call(input, hint);\n\t\tif (isPrimitive(result)) {\n\t\t\treturn result;\n\t\t}\n\t\tthrow new TypeError('unable to convert exotic object to primitive');\n\t}\n\tif (hint === 'default' && (isDate(input) || isSymbol(input))) {\n\t\thint = 'string';\n\t}\n\treturn ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint);\n};\n","'use strict';\n\nmodule.exports = function isPrimitive(value) {\n\treturn value === null || (typeof value !== 'function' && typeof value !== 'object');\n};\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slice.call(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n args.concat(slice.call(arguments))\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n } else {\n return target.apply(\n that,\n args.concat(slice.call(arguments))\n );\n }\n };\n\n var boundLength = Math.max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs.push('$' + i);\n }\n\n bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\nvar functionsHaveNames = function functionsHaveNames() {\n\treturn typeof function f() {}.name === 'string';\n};\n\nvar gOPD = Object.getOwnPropertyDescriptor;\nif (gOPD) {\n\ttry {\n\t\tgOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\tgOPD = null;\n\t}\n}\n\nfunctionsHaveNames.functionsHaveConfigurableNames = function functionsHaveConfigurableNames() {\n\tif (!functionsHaveNames() || !gOPD) {\n\t\treturn false;\n\t}\n\tvar desc = gOPD(function () {}, 'name');\n\treturn !!desc && !!desc.configurable;\n};\n\nvar $bind = Function.prototype.bind;\n\nfunctionsHaveNames.boundFunctionsHaveNames = function boundFunctionsHaveNames() {\n\treturn functionsHaveNames() && typeof $bind === 'function' && function f() {}.bind().name !== '';\n};\n\nmodule.exports = functionsHaveNames;\n","'use strict';\n\nvar undefined;\n\nvar $SyntaxError = SyntaxError;\nvar $Function = Function;\nvar $TypeError = TypeError;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\nif ($gOPD) {\n\ttry {\n\t\t$gOPD({}, '');\n\t} catch (e) {\n\t\t$gOPD = null; // this is IE 8, which has a broken gOPD\n\t}\n}\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\nvar hasProto = require('has-proto')();\n\nvar getProto = Object.getPrototypeOf || (\n\thasProto\n\t\t? function (x) { return x.__proto__; } // eslint-disable-line no-proto\n\t\t: null\n);\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,\n\t'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': EvalError,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': Object,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': RangeError,\n\t'%ReferenceError%': ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nif (getProto) {\n\ttry {\n\t\tnull.error; // eslint-disable-line no-unused-expressions\n\t} catch (e) {\n\t\t// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n\t\tvar errorProto = getProto(getProto(e));\n\t\tINTRINSICS['%Error.prototype%'] = errorProto;\n\t}\n}\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen && getProto) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('has');\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\nvar $exec = bind.call(Function.call, RegExp.prototype.exec);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tif ($exec(/^%?[^%]*%?$/, name) === null) {\n\t\tthrow new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');\n\t}\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\n\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasPropertyDescriptors = function hasPropertyDescriptors() {\n\tif ($defineProperty) {\n\t\ttry {\n\t\t\t$defineProperty({}, 'a', { value: 1 });\n\t\t\treturn true;\n\t\t} catch (e) {\n\t\t\t// IE 8 has a broken defineProperty\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn false;\n};\n\nhasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {\n\t// node v0.6 has a bug where array lengths can be Set but not Defined\n\tif (!hasPropertyDescriptors()) {\n\t\treturn null;\n\t}\n\ttry {\n\t\treturn $defineProperty([], 'length', { value: 1 }).length !== 1;\n\t} catch (e) {\n\t\t// In Firefox 4-22, defining length on an array throws an exception.\n\t\treturn true;\n\t}\n};\n\nmodule.exports = hasPropertyDescriptors;\n","'use strict';\n\nvar test = {\n\tfoo: {}\n};\n\nvar $Object = Object;\n\nmodule.exports = function hasProto() {\n\treturn { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar hasSymbols = require('has-symbols/shams');\n\nmodule.exports = function hasToStringTagShams() {\n\treturn hasSymbols() && !!Symbol.toStringTag;\n};\n","'use strict';\n\nvar hasOwnProperty = {}.hasOwnProperty;\nvar call = Function.prototype.call;\n\nmodule.exports = call.bind ? call.bind(hasOwnProperty) : function (O, P) {\n return call.call(hasOwnProperty, O, P);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar has = require('has');\nvar channel = require('side-channel')();\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar SLOT = {\n\tassert: function (O, slot) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tchannel.assert(O);\n\t\tif (!SLOT.has(O, slot)) {\n\t\t\tthrow new $TypeError('`' + slot + '` is not present on `O`');\n\t\t}\n\t},\n\tget: function (O, slot) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tvar slots = channel.get(O);\n\t\treturn slots && slots['$' + slot];\n\t},\n\thas: function (O, slot) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tvar slots = channel.get(O);\n\t\treturn !!slots && has(slots, '$' + slot);\n\t},\n\tset: function (O, slot, V) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tvar slots = channel.get(O);\n\t\tif (!slots) {\n\t\t\tslots = {};\n\t\t\tchannel.set(O, slots);\n\t\t}\n\t\tslots['$' + slot] = V;\n\t}\n};\n\nif (Object.freeze) {\n\tObject.freeze(SLOT);\n}\n\nmodule.exports = SLOT;\n","'use strict';\n\nvar fnToStr = Function.prototype.toString;\nvar reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;\nvar badArrayLike;\nvar isCallableMarker;\nif (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {\n\ttry {\n\t\tbadArrayLike = Object.defineProperty({}, 'length', {\n\t\t\tget: function () {\n\t\t\t\tthrow isCallableMarker;\n\t\t\t}\n\t\t});\n\t\tisCallableMarker = {};\n\t\t// eslint-disable-next-line no-throw-literal\n\t\treflectApply(function () { throw 42; }, null, badArrayLike);\n\t} catch (_) {\n\t\tif (_ !== isCallableMarker) {\n\t\t\treflectApply = null;\n\t\t}\n\t}\n} else {\n\treflectApply = null;\n}\n\nvar constructorRegex = /^\\s*class\\b/;\nvar isES6ClassFn = function isES6ClassFunction(value) {\n\ttry {\n\t\tvar fnStr = fnToStr.call(value);\n\t\treturn constructorRegex.test(fnStr);\n\t} catch (e) {\n\t\treturn false; // not a function\n\t}\n};\n\nvar tryFunctionObject = function tryFunctionToStr(value) {\n\ttry {\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tfnToStr.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\nvar toStr = Object.prototype.toString;\nvar objectClass = '[object Object]';\nvar fnClass = '[object Function]';\nvar genClass = '[object GeneratorFunction]';\nvar ddaClass = '[object HTMLAllCollection]'; // IE 11\nvar ddaClass2 = '[object HTML document.all class]';\nvar ddaClass3 = '[object HTMLCollection]'; // IE 9-10\nvar hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag`\n\nvar isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing\n\nvar isDDA = function isDocumentDotAll() { return false; };\nif (typeof document === 'object') {\n\t// Firefox 3 canonicalizes DDA to undefined when it's not accessed directly\n\tvar all = document.all;\n\tif (toStr.call(all) === toStr.call(document.all)) {\n\t\tisDDA = function isDocumentDotAll(value) {\n\t\t\t/* globals document: false */\n\t\t\t// in IE 6-8, typeof document.all is \"object\" and it's truthy\n\t\t\tif ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) {\n\t\t\t\ttry {\n\t\t\t\t\tvar str = toStr.call(value);\n\t\t\t\t\treturn (\n\t\t\t\t\t\tstr === ddaClass\n\t\t\t\t\t\t|| str === ddaClass2\n\t\t\t\t\t\t|| str === ddaClass3 // opera 12.16\n\t\t\t\t\t\t|| str === objectClass // IE 6-8\n\t\t\t\t\t) && value('') == null; // eslint-disable-line eqeqeq\n\t\t\t\t} catch (e) { /**/ }\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\t}\n}\n\nmodule.exports = reflectApply\n\t? function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\ttry {\n\t\t\treflectApply(value, null, badArrayLike);\n\t\t} catch (e) {\n\t\t\tif (e !== isCallableMarker) { return false; }\n\t\t}\n\t\treturn !isES6ClassFn(value) && tryFunctionObject(value);\n\t}\n\t: function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\tif (hasToStringTag) { return tryFunctionObject(value); }\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tvar strClass = toStr.call(value);\n\t\tif (strClass !== fnClass && strClass !== genClass && !(/^\\[object HTML/).test(strClass)) { return false; }\n\t\treturn tryFunctionObject(value);\n\t};\n","'use strict';\n\nvar getDay = Date.prototype.getDay;\nvar tryDateObject = function tryDateGetDayCall(value) {\n\ttry {\n\t\tgetDay.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\n\nvar toStr = Object.prototype.toString;\nvar dateClass = '[object Date]';\nvar hasToStringTag = require('has-tostringtag/shams')();\n\nmodule.exports = function isDateObject(value) {\n\tif (typeof value !== 'object' || value === null) {\n\t\treturn false;\n\t}\n\treturn hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass;\n};\n","'use strict';\n\nvar callBound = require('call-bind/callBound');\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar has;\nvar $exec;\nvar isRegexMarker;\nvar badStringifier;\n\nif (hasToStringTag) {\n\thas = callBound('Object.prototype.hasOwnProperty');\n\t$exec = callBound('RegExp.prototype.exec');\n\tisRegexMarker = {};\n\n\tvar throwRegexMarker = function () {\n\t\tthrow isRegexMarker;\n\t};\n\tbadStringifier = {\n\t\ttoString: throwRegexMarker,\n\t\tvalueOf: throwRegexMarker\n\t};\n\n\tif (typeof Symbol.toPrimitive === 'symbol') {\n\t\tbadStringifier[Symbol.toPrimitive] = throwRegexMarker;\n\t}\n}\n\nvar $toString = callBound('Object.prototype.toString');\nvar gOPD = Object.getOwnPropertyDescriptor;\nvar regexClass = '[object RegExp]';\n\nmodule.exports = hasToStringTag\n\t// eslint-disable-next-line consistent-return\n\t? function isRegex(value) {\n\t\tif (!value || typeof value !== 'object') {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar descriptor = gOPD(value, 'lastIndex');\n\t\tvar hasLastIndexDataProperty = descriptor && has(descriptor, 'value');\n\t\tif (!hasLastIndexDataProperty) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\t$exec(value, badStringifier);\n\t\t} catch (e) {\n\t\t\treturn e === isRegexMarker;\n\t\t}\n\t}\n\t: function isRegex(value) {\n\t\t// In older browsers, typeof regex incorrectly returns 'function'\n\t\tif (!value || (typeof value !== 'object' && typeof value !== 'function')) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $toString(value) === regexClass;\n\t};\n","'use strict';\n\nvar toStr = Object.prototype.toString;\nvar hasSymbols = require('has-symbols')();\n\nif (hasSymbols) {\n\tvar symToStr = Symbol.prototype.toString;\n\tvar symStringRegex = /^Symbol\\(.*\\)$/;\n\tvar isSymbolObject = function isRealSymbolObject(value) {\n\t\tif (typeof value.valueOf() !== 'symbol') {\n\t\t\treturn false;\n\t\t}\n\t\treturn symStringRegex.test(symToStr.call(value));\n\t};\n\n\tmodule.exports = function isSymbol(value) {\n\t\tif (typeof value === 'symbol') {\n\t\t\treturn true;\n\t\t}\n\t\tif (toStr.call(value) !== '[object Symbol]') {\n\t\t\treturn false;\n\t\t}\n\t\ttry {\n\t\t\treturn isSymbolObject(value);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n} else {\n\n\tmodule.exports = function isSymbol(value) {\n\t\t// this environment does not support Symbols.\n\t\treturn false && value;\n\t};\n}\n","var hasMap = typeof Map === 'function' && Map.prototype;\nvar mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;\nvar mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;\nvar mapForEach = hasMap && Map.prototype.forEach;\nvar hasSet = typeof Set === 'function' && Set.prototype;\nvar setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;\nvar setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;\nvar setForEach = hasSet && Set.prototype.forEach;\nvar hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;\nvar weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;\nvar hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;\nvar weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;\nvar hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;\nvar weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;\nvar booleanValueOf = Boolean.prototype.valueOf;\nvar objectToString = Object.prototype.toString;\nvar functionToString = Function.prototype.toString;\nvar $match = String.prototype.match;\nvar $slice = String.prototype.slice;\nvar $replace = String.prototype.replace;\nvar $toUpperCase = String.prototype.toUpperCase;\nvar $toLowerCase = String.prototype.toLowerCase;\nvar $test = RegExp.prototype.test;\nvar $concat = Array.prototype.concat;\nvar $join = Array.prototype.join;\nvar $arrSlice = Array.prototype.slice;\nvar $floor = Math.floor;\nvar bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;\nvar gOPS = Object.getOwnPropertySymbols;\nvar symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;\nvar hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';\n// ie, `has-tostringtag/shams\nvar toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')\n ? Symbol.toStringTag\n : null;\nvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\nvar gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (\n [].__proto__ === Array.prototype // eslint-disable-line no-proto\n ? function (O) {\n return O.__proto__; // eslint-disable-line no-proto\n }\n : null\n);\n\nfunction addNumericSeparator(num, str) {\n if (\n num === Infinity\n || num === -Infinity\n || num !== num\n || (num && num > -1000 && num < 1000)\n || $test.call(/e/, str)\n ) {\n return str;\n }\n var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;\n if (typeof num === 'number') {\n var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)\n if (int !== num) {\n var intStr = String(int);\n var dec = $slice.call(str, intStr.length + 1);\n return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');\n }\n }\n return $replace.call(str, sepRegex, '$&_');\n}\n\nvar utilInspect = require('./util.inspect');\nvar inspectCustom = utilInspect.custom;\nvar inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;\n\nmodule.exports = function inspect_(obj, options, depth, seen) {\n var opts = options || {};\n\n if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {\n throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');\n }\n if (\n has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'\n ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity\n : opts.maxStringLength !== null\n )\n ) {\n throw new TypeError('option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`');\n }\n var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;\n if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {\n throw new TypeError('option \"customInspect\", if provided, must be `true`, `false`, or `\\'symbol\\'`');\n }\n\n if (\n has(opts, 'indent')\n && opts.indent !== null\n && opts.indent !== '\\t'\n && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)\n ) {\n throw new TypeError('option \"indent\" must be \"\\\\t\", an integer > 0, or `null`');\n }\n if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {\n throw new TypeError('option \"numericSeparator\", if provided, must be `true` or `false`');\n }\n var numericSeparator = opts.numericSeparator;\n\n if (typeof obj === 'undefined') {\n return 'undefined';\n }\n if (obj === null) {\n return 'null';\n }\n if (typeof obj === 'boolean') {\n return obj ? 'true' : 'false';\n }\n\n if (typeof obj === 'string') {\n return inspectString(obj, opts);\n }\n if (typeof obj === 'number') {\n if (obj === 0) {\n return Infinity / obj > 0 ? '0' : '-0';\n }\n var str = String(obj);\n return numericSeparator ? addNumericSeparator(obj, str) : str;\n }\n if (typeof obj === 'bigint') {\n var bigIntStr = String(obj) + 'n';\n return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;\n }\n\n var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;\n if (typeof depth === 'undefined') { depth = 0; }\n if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {\n return isArray(obj) ? '[Array]' : '[Object]';\n }\n\n var indent = getIndent(opts, depth);\n\n if (typeof seen === 'undefined') {\n seen = [];\n } else if (indexOf(seen, obj) >= 0) {\n return '[Circular]';\n }\n\n function inspect(value, from, noIndent) {\n if (from) {\n seen = $arrSlice.call(seen);\n seen.push(from);\n }\n if (noIndent) {\n var newOpts = {\n depth: opts.depth\n };\n if (has(opts, 'quoteStyle')) {\n newOpts.quoteStyle = opts.quoteStyle;\n }\n return inspect_(value, newOpts, depth + 1, seen);\n }\n return inspect_(value, opts, depth + 1, seen);\n }\n\n if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable\n var name = nameOf(obj);\n var keys = arrObjKeys(obj, inspect);\n return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');\n }\n if (isSymbol(obj)) {\n var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\\(.*\\))_[^)]*$/, '$1') : symToString.call(obj);\n return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;\n }\n if (isElement(obj)) {\n var s = '<' + $toLowerCase.call(String(obj.nodeName));\n var attrs = obj.attributes || [];\n for (var i = 0; i < attrs.length; i++) {\n s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);\n }\n s += '>';\n if (obj.childNodes && obj.childNodes.length) { s += '...'; }\n s += '';\n return s;\n }\n if (isArray(obj)) {\n if (obj.length === 0) { return '[]'; }\n var xs = arrObjKeys(obj, inspect);\n if (indent && !singleLineValues(xs)) {\n return '[' + indentedJoin(xs, indent) + ']';\n }\n return '[ ' + $join.call(xs, ', ') + ' ]';\n }\n if (isError(obj)) {\n var parts = arrObjKeys(obj, inspect);\n if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {\n return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';\n }\n if (parts.length === 0) { return '[' + String(obj) + ']'; }\n return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';\n }\n if (typeof obj === 'object' && customInspect) {\n if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {\n return utilInspect(obj, { depth: maxDepth - depth });\n } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {\n return obj.inspect();\n }\n }\n if (isMap(obj)) {\n var mapParts = [];\n if (mapForEach) {\n mapForEach.call(obj, function (value, key) {\n mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));\n });\n }\n return collectionOf('Map', mapSize.call(obj), mapParts, indent);\n }\n if (isSet(obj)) {\n var setParts = [];\n if (setForEach) {\n setForEach.call(obj, function (value) {\n setParts.push(inspect(value, obj));\n });\n }\n return collectionOf('Set', setSize.call(obj), setParts, indent);\n }\n if (isWeakMap(obj)) {\n return weakCollectionOf('WeakMap');\n }\n if (isWeakSet(obj)) {\n return weakCollectionOf('WeakSet');\n }\n if (isWeakRef(obj)) {\n return weakCollectionOf('WeakRef');\n }\n if (isNumber(obj)) {\n return markBoxed(inspect(Number(obj)));\n }\n if (isBigInt(obj)) {\n return markBoxed(inspect(bigIntValueOf.call(obj)));\n }\n if (isBoolean(obj)) {\n return markBoxed(booleanValueOf.call(obj));\n }\n if (isString(obj)) {\n return markBoxed(inspect(String(obj)));\n }\n if (!isDate(obj) && !isRegExp(obj)) {\n var ys = arrObjKeys(obj, inspect);\n var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;\n var protoTag = obj instanceof Object ? '' : 'null prototype';\n var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';\n var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';\n var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');\n if (ys.length === 0) { return tag + '{}'; }\n if (indent) {\n return tag + '{' + indentedJoin(ys, indent) + '}';\n }\n return tag + '{ ' + $join.call(ys, ', ') + ' }';\n }\n return String(obj);\n};\n\nfunction wrapQuotes(s, defaultStyle, opts) {\n var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '\"' : \"'\";\n return quoteChar + s + quoteChar;\n}\n\nfunction quote(s) {\n return $replace.call(String(s), /\"/g, '"');\n}\n\nfunction isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\n\n// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives\nfunction isSymbol(obj) {\n if (hasShammedSymbols) {\n return obj && typeof obj === 'object' && obj instanceof Symbol;\n }\n if (typeof obj === 'symbol') {\n return true;\n }\n if (!obj || typeof obj !== 'object' || !symToString) {\n return false;\n }\n try {\n symToString.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isBigInt(obj) {\n if (!obj || typeof obj !== 'object' || !bigIntValueOf) {\n return false;\n }\n try {\n bigIntValueOf.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };\nfunction has(obj, key) {\n return hasOwn.call(obj, key);\n}\n\nfunction toStr(obj) {\n return objectToString.call(obj);\n}\n\nfunction nameOf(f) {\n if (f.name) { return f.name; }\n var m = $match.call(functionToString.call(f), /^function\\s*([\\w$]+)/);\n if (m) { return m[1]; }\n return null;\n}\n\nfunction indexOf(xs, x) {\n if (xs.indexOf) { return xs.indexOf(x); }\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) { return i; }\n }\n return -1;\n}\n\nfunction isMap(x) {\n if (!mapSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n mapSize.call(x);\n try {\n setSize.call(x);\n } catch (s) {\n return true;\n }\n return x instanceof Map; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakMap(x) {\n if (!weakMapHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakMapHas.call(x, weakMapHas);\n try {\n weakSetHas.call(x, weakSetHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakMap; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakRef(x) {\n if (!weakRefDeref || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakRefDeref.call(x);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isSet(x) {\n if (!setSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n setSize.call(x);\n try {\n mapSize.call(x);\n } catch (m) {\n return true;\n }\n return x instanceof Set; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakSet(x) {\n if (!weakSetHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakSetHas.call(x, weakSetHas);\n try {\n weakMapHas.call(x, weakMapHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakSet; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isElement(x) {\n if (!x || typeof x !== 'object') { return false; }\n if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {\n return true;\n }\n return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';\n}\n\nfunction inspectString(str, opts) {\n if (str.length > opts.maxStringLength) {\n var remaining = str.length - opts.maxStringLength;\n var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');\n return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;\n }\n // eslint-disable-next-line no-control-regex\n var s = $replace.call($replace.call(str, /(['\\\\])/g, '\\\\$1'), /[\\x00-\\x1f]/g, lowbyte);\n return wrapQuotes(s, 'single', opts);\n}\n\nfunction lowbyte(c) {\n var n = c.charCodeAt(0);\n var x = {\n 8: 'b',\n 9: 't',\n 10: 'n',\n 12: 'f',\n 13: 'r'\n }[n];\n if (x) { return '\\\\' + x; }\n return '\\\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));\n}\n\nfunction markBoxed(str) {\n return 'Object(' + str + ')';\n}\n\nfunction weakCollectionOf(type) {\n return type + ' { ? }';\n}\n\nfunction collectionOf(type, size, entries, indent) {\n var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');\n return type + ' (' + size + ') {' + joinedEntries + '}';\n}\n\nfunction singleLineValues(xs) {\n for (var i = 0; i < xs.length; i++) {\n if (indexOf(xs[i], '\\n') >= 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction getIndent(opts, depth) {\n var baseIndent;\n if (opts.indent === '\\t') {\n baseIndent = '\\t';\n } else if (typeof opts.indent === 'number' && opts.indent > 0) {\n baseIndent = $join.call(Array(opts.indent + 1), ' ');\n } else {\n return null;\n }\n return {\n base: baseIndent,\n prev: $join.call(Array(depth + 1), baseIndent)\n };\n}\n\nfunction indentedJoin(xs, indent) {\n if (xs.length === 0) { return ''; }\n var lineJoiner = '\\n' + indent.prev + indent.base;\n return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\\n' + indent.prev;\n}\n\nfunction arrObjKeys(obj, inspect) {\n var isArr = isArray(obj);\n var xs = [];\n if (isArr) {\n xs.length = obj.length;\n for (var i = 0; i < obj.length; i++) {\n xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';\n }\n }\n var syms = typeof gOPS === 'function' ? gOPS(obj) : [];\n var symMap;\n if (hasShammedSymbols) {\n symMap = {};\n for (var k = 0; k < syms.length; k++) {\n symMap['$' + syms[k]] = syms[k];\n }\n }\n\n for (var key in obj) { // eslint-disable-line no-restricted-syntax\n if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {\n // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section\n continue; // eslint-disable-line no-restricted-syntax, no-continue\n } else if ($test.call(/[^\\w$]/, key)) {\n xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));\n } else {\n xs.push(key + ': ' + inspect(obj[key], obj));\n }\n }\n if (typeof gOPS === 'function') {\n for (var j = 0; j < syms.length; j++) {\n if (isEnumerable.call(obj, syms[j])) {\n xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));\n }\n }\n }\n return xs;\n}\n","'use strict';\n\nvar keysShim;\nif (!Object.keys) {\n\t// modified from https://github.com/es-shims/es5-shim\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar toStr = Object.prototype.toString;\n\tvar isArgs = require('./isArguments'); // eslint-disable-line global-require\n\tvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\tvar hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');\n\tvar hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');\n\tvar dontEnums = [\n\t\t'toString',\n\t\t'toLocaleString',\n\t\t'valueOf',\n\t\t'hasOwnProperty',\n\t\t'isPrototypeOf',\n\t\t'propertyIsEnumerable',\n\t\t'constructor'\n\t];\n\tvar equalsConstructorPrototype = function (o) {\n\t\tvar ctor = o.constructor;\n\t\treturn ctor && ctor.prototype === o;\n\t};\n\tvar excludedKeys = {\n\t\t$applicationCache: true,\n\t\t$console: true,\n\t\t$external: true,\n\t\t$frame: true,\n\t\t$frameElement: true,\n\t\t$frames: true,\n\t\t$innerHeight: true,\n\t\t$innerWidth: true,\n\t\t$onmozfullscreenchange: true,\n\t\t$onmozfullscreenerror: true,\n\t\t$outerHeight: true,\n\t\t$outerWidth: true,\n\t\t$pageXOffset: true,\n\t\t$pageYOffset: true,\n\t\t$parent: true,\n\t\t$scrollLeft: true,\n\t\t$scrollTop: true,\n\t\t$scrollX: true,\n\t\t$scrollY: true,\n\t\t$self: true,\n\t\t$webkitIndexedDB: true,\n\t\t$webkitStorageInfo: true,\n\t\t$window: true\n\t};\n\tvar hasAutomationEqualityBug = (function () {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined') { return false; }\n\t\tfor (var k in window) {\n\t\t\ttry {\n\t\t\t\tif (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tequalsConstructorPrototype(window[k]);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}());\n\tvar equalsConstructorPrototypeIfNotBuggy = function (o) {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined' || !hasAutomationEqualityBug) {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t}\n\t\ttry {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tkeysShim = function keys(object) {\n\t\tvar isObject = object !== null && typeof object === 'object';\n\t\tvar isFunction = toStr.call(object) === '[object Function]';\n\t\tvar isArguments = isArgs(object);\n\t\tvar isString = isObject && toStr.call(object) === '[object String]';\n\t\tvar theKeys = [];\n\n\t\tif (!isObject && !isFunction && !isArguments) {\n\t\t\tthrow new TypeError('Object.keys called on a non-object');\n\t\t}\n\n\t\tvar skipProto = hasProtoEnumBug && isFunction;\n\t\tif (isString && object.length > 0 && !has.call(object, 0)) {\n\t\t\tfor (var i = 0; i < object.length; ++i) {\n\t\t\t\ttheKeys.push(String(i));\n\t\t\t}\n\t\t}\n\n\t\tif (isArguments && object.length > 0) {\n\t\t\tfor (var j = 0; j < object.length; ++j) {\n\t\t\t\ttheKeys.push(String(j));\n\t\t\t}\n\t\t} else {\n\t\t\tfor (var name in object) {\n\t\t\t\tif (!(skipProto && name === 'prototype') && has.call(object, name)) {\n\t\t\t\t\ttheKeys.push(String(name));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (hasDontEnumBug) {\n\t\t\tvar skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);\n\n\t\t\tfor (var k = 0; k < dontEnums.length; ++k) {\n\t\t\t\tif (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {\n\t\t\t\t\ttheKeys.push(dontEnums[k]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn theKeys;\n\t};\n}\nmodule.exports = keysShim;\n","'use strict';\n\nvar slice = Array.prototype.slice;\nvar isArgs = require('./isArguments');\n\nvar origKeys = Object.keys;\nvar keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');\n\nvar originalKeys = Object.keys;\n\nkeysShim.shim = function shimObjectKeys() {\n\tif (Object.keys) {\n\t\tvar keysWorksWithArguments = (function () {\n\t\t\t// Safari 5.0 bug\n\t\t\tvar args = Object.keys(arguments);\n\t\t\treturn args && args.length === arguments.length;\n\t\t}(1, 2));\n\t\tif (!keysWorksWithArguments) {\n\t\t\tObject.keys = function keys(object) { // eslint-disable-line func-name-matching\n\t\t\t\tif (isArgs(object)) {\n\t\t\t\t\treturn originalKeys(slice.call(object));\n\t\t\t\t}\n\t\t\t\treturn originalKeys(object);\n\t\t\t};\n\t\t}\n\t} else {\n\t\tObject.keys = keysShim;\n\t}\n\treturn Object.keys || keysShim;\n};\n\nmodule.exports = keysShim;\n","'use strict';\n\nvar toStr = Object.prototype.toString;\n\nmodule.exports = function isArguments(value) {\n\tvar str = toStr.call(value);\n\tvar isArgs = str === '[object Arguments]';\n\tif (!isArgs) {\n\t\tisArgs = str !== '[object Array]' &&\n\t\t\tvalue !== null &&\n\t\t\ttypeof value === 'object' &&\n\t\t\ttypeof value.length === 'number' &&\n\t\t\tvalue.length >= 0 &&\n\t\t\ttoStr.call(value.callee) === '[object Function]';\n\t}\n\treturn isArgs;\n};\n","'use strict';\n\nvar setFunctionName = require('set-function-name');\n\nvar $Object = Object;\nvar $TypeError = TypeError;\n\nmodule.exports = setFunctionName(function flags() {\n\tif (this != null && this !== $Object(this)) {\n\t\tthrow new $TypeError('RegExp.prototype.flags getter called on non-object');\n\t}\n\tvar result = '';\n\tif (this.hasIndices) {\n\t\tresult += 'd';\n\t}\n\tif (this.global) {\n\t\tresult += 'g';\n\t}\n\tif (this.ignoreCase) {\n\t\tresult += 'i';\n\t}\n\tif (this.multiline) {\n\t\tresult += 'm';\n\t}\n\tif (this.dotAll) {\n\t\tresult += 's';\n\t}\n\tif (this.unicode) {\n\t\tresult += 'u';\n\t}\n\tif (this.unicodeSets) {\n\t\tresult += 'v';\n\t}\n\tif (this.sticky) {\n\t\tresult += 'y';\n\t}\n\treturn result;\n}, 'get flags', true);\n\n","'use strict';\n\nvar define = require('define-properties');\nvar callBind = require('call-bind');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar flagsBound = callBind(getPolyfill());\n\ndefine(flagsBound, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = flagsBound;\n","'use strict';\n\nvar implementation = require('./implementation');\n\nvar supportsDescriptors = require('define-properties').supportsDescriptors;\nvar $gOPD = Object.getOwnPropertyDescriptor;\n\nmodule.exports = function getPolyfill() {\n\tif (supportsDescriptors && (/a/mig).flags === 'gim') {\n\t\tvar descriptor = $gOPD(RegExp.prototype, 'flags');\n\t\tif (\n\t\t\tdescriptor\n\t\t\t&& typeof descriptor.get === 'function'\n\t\t\t&& typeof RegExp.prototype.dotAll === 'boolean'\n\t\t\t&& typeof RegExp.prototype.hasIndices === 'boolean'\n\t\t) {\n\t\t\t/* eslint getter-return: 0 */\n\t\t\tvar calls = '';\n\t\t\tvar o = {};\n\t\t\tObject.defineProperty(o, 'hasIndices', {\n\t\t\t\tget: function () {\n\t\t\t\t\tcalls += 'd';\n\t\t\t\t}\n\t\t\t});\n\t\t\tObject.defineProperty(o, 'sticky', {\n\t\t\t\tget: function () {\n\t\t\t\t\tcalls += 'y';\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (calls === 'dy') {\n\t\t\t\treturn descriptor.get;\n\t\t\t}\n\t\t}\n\t}\n\treturn implementation;\n};\n","'use strict';\n\nvar supportsDescriptors = require('define-properties').supportsDescriptors;\nvar getPolyfill = require('./polyfill');\nvar gOPD = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar TypeErr = TypeError;\nvar getProto = Object.getPrototypeOf;\nvar regex = /a/;\n\nmodule.exports = function shimFlags() {\n\tif (!supportsDescriptors || !getProto) {\n\t\tthrow new TypeErr('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');\n\t}\n\tvar polyfill = getPolyfill();\n\tvar proto = getProto(regex);\n\tvar descriptor = gOPD(proto, 'flags');\n\tif (!descriptor || descriptor.get !== polyfill) {\n\t\tdefineProperty(proto, 'flags', {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tget: polyfill\n\t\t});\n\t}\n\treturn polyfill;\n};\n","'use strict';\n\nvar callBound = require('call-bind/callBound');\nvar GetIntrinsic = require('get-intrinsic');\nvar isRegex = require('is-regex');\n\nvar $exec = callBound('RegExp.prototype.exec');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nmodule.exports = function regexTester(regex) {\n\tif (!isRegex(regex)) {\n\t\tthrow new $TypeError('`regex` must be a RegExp');\n\t}\n\treturn function test(s) {\n\t\treturn $exec(regex, s) !== null;\n\t};\n};\n","'use strict';\n\nvar define = require('define-data-property');\nvar hasDescriptors = require('has-property-descriptors')();\nvar functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames();\n\nvar $TypeError = TypeError;\n\nmodule.exports = function setFunctionName(fn, name) {\n\tif (typeof fn !== 'function') {\n\t\tthrow new $TypeError('`fn` is not a function');\n\t}\n\tvar loose = arguments.length > 2 && !!arguments[2];\n\tif (!loose || functionsHaveConfigurableNames) {\n\t\tif (hasDescriptors) {\n\t\t\tdefine(fn, 'name', name, true, true);\n\t\t} else {\n\t\t\tdefine(fn, 'name', name);\n\t\t}\n\t}\n\treturn fn;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bind/callBound');\nvar inspect = require('object-inspect');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $WeakMap = GetIntrinsic('%WeakMap%', true);\nvar $Map = GetIntrinsic('%Map%', true);\n\nvar $weakMapGet = callBound('WeakMap.prototype.get', true);\nvar $weakMapSet = callBound('WeakMap.prototype.set', true);\nvar $weakMapHas = callBound('WeakMap.prototype.has', true);\nvar $mapGet = callBound('Map.prototype.get', true);\nvar $mapSet = callBound('Map.prototype.set', true);\nvar $mapHas = callBound('Map.prototype.has', true);\n\n/*\n * This function traverses the list returning the node corresponding to the\n * given key.\n *\n * That node is also moved to the head of the list, so that if it's accessed\n * again we don't need to traverse the whole list. By doing so, all the recently\n * used nodes can be accessed relatively quickly.\n */\nvar listGetNode = function (list, key) { // eslint-disable-line consistent-return\n\tfor (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {\n\t\tif (curr.key === key) {\n\t\t\tprev.next = curr.next;\n\t\t\tcurr.next = list.next;\n\t\t\tlist.next = curr; // eslint-disable-line no-param-reassign\n\t\t\treturn curr;\n\t\t}\n\t}\n};\n\nvar listGet = function (objects, key) {\n\tvar node = listGetNode(objects, key);\n\treturn node && node.value;\n};\nvar listSet = function (objects, key, value) {\n\tvar node = listGetNode(objects, key);\n\tif (node) {\n\t\tnode.value = value;\n\t} else {\n\t\t// Prepend the new node to the beginning of the list\n\t\tobjects.next = { // eslint-disable-line no-param-reassign\n\t\t\tkey: key,\n\t\t\tnext: objects.next,\n\t\t\tvalue: value\n\t\t};\n\t}\n};\nvar listHas = function (objects, key) {\n\treturn !!listGetNode(objects, key);\n};\n\nmodule.exports = function getSideChannel() {\n\tvar $wm;\n\tvar $m;\n\tvar $o;\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\tget: function (key) { // eslint-disable-line consistent-return\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapGet($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapGet($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listGet($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\thas: function (key) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapHas($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapHas($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listHas($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif (!$wm) {\n\t\t\t\t\t$wm = new $WeakMap();\n\t\t\t\t}\n\t\t\t\t$weakMapSet($wm, key, value);\n\t\t\t} else if ($Map) {\n\t\t\t\tif (!$m) {\n\t\t\t\t\t$m = new $Map();\n\t\t\t\t}\n\t\t\t\t$mapSet($m, key, value);\n\t\t\t} else {\n\t\t\t\tif (!$o) {\n\t\t\t\t\t/*\n\t\t\t\t\t * Initialize the linked list as an empty node, so that we don't have\n\t\t\t\t\t * to special-case handling of the first node: we can always refer to\n\t\t\t\t\t * it as (previous node).next, instead of something like (list).head\n\t\t\t\t\t */\n\t\t\t\t\t$o = { key: {}, next: null };\n\t\t\t\t}\n\t\t\t\tlistSet($o, key, value);\n\t\t\t}\n\t\t}\n\t};\n\treturn channel;\n};\n","'use strict';\n\nvar Call = require('es-abstract/2023/Call');\nvar Get = require('es-abstract/2023/Get');\nvar GetMethod = require('es-abstract/2023/GetMethod');\nvar IsRegExp = require('es-abstract/2023/IsRegExp');\nvar ToString = require('es-abstract/2023/ToString');\nvar RequireObjectCoercible = require('es-abstract/2023/RequireObjectCoercible');\nvar callBound = require('call-bind/callBound');\nvar hasSymbols = require('has-symbols')();\nvar flagsGetter = require('regexp.prototype.flags');\n\nvar $indexOf = callBound('String.prototype.indexOf');\n\nvar regexpMatchAllPolyfill = require('./polyfill-regexp-matchall');\n\nvar getMatcher = function getMatcher(regexp) { // eslint-disable-line consistent-return\n\tvar matcherPolyfill = regexpMatchAllPolyfill();\n\tif (hasSymbols && typeof Symbol.matchAll === 'symbol') {\n\t\tvar matcher = GetMethod(regexp, Symbol.matchAll);\n\t\tif (matcher === RegExp.prototype[Symbol.matchAll] && matcher !== matcherPolyfill) {\n\t\t\treturn matcherPolyfill;\n\t\t}\n\t\treturn matcher;\n\t}\n\t// fallback for pre-Symbol.matchAll environments\n\tif (IsRegExp(regexp)) {\n\t\treturn matcherPolyfill;\n\t}\n};\n\nmodule.exports = function matchAll(regexp) {\n\tvar O = RequireObjectCoercible(this);\n\n\tif (typeof regexp !== 'undefined' && regexp !== null) {\n\t\tvar isRegExp = IsRegExp(regexp);\n\t\tif (isRegExp) {\n\t\t\t// workaround for older engines that lack RegExp.prototype.flags\n\t\t\tvar flags = 'flags' in regexp ? Get(regexp, 'flags') : flagsGetter(regexp);\n\t\t\tRequireObjectCoercible(flags);\n\t\t\tif ($indexOf(ToString(flags), 'g') < 0) {\n\t\t\t\tthrow new TypeError('matchAll requires a global regular expression');\n\t\t\t}\n\t\t}\n\n\t\tvar matcher = getMatcher(regexp);\n\t\tif (typeof matcher !== 'undefined') {\n\t\t\treturn Call(matcher, regexp, [O]);\n\t\t}\n\t}\n\n\tvar S = ToString(O);\n\t// var rx = RegExpCreate(regexp, 'g');\n\tvar rx = new RegExp(regexp, 'g');\n\treturn Call(getMatcher(rx), rx, [S]);\n};\n","'use strict';\n\nvar callBind = require('call-bind');\nvar define = require('define-properties');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar boundMatchAll = callBind(implementation);\n\ndefine(boundMatchAll, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = boundMatchAll;\n","'use strict';\n\nvar hasSymbols = require('has-symbols')();\nvar regexpMatchAll = require('./regexp-matchall');\n\nmodule.exports = function getRegExpMatchAllPolyfill() {\n\tif (!hasSymbols || typeof Symbol.matchAll !== 'symbol' || typeof RegExp.prototype[Symbol.matchAll] !== 'function') {\n\t\treturn regexpMatchAll;\n\t}\n\treturn RegExp.prototype[Symbol.matchAll];\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = function getPolyfill() {\n\tif (String.prototype.matchAll) {\n\t\ttry {\n\t\t\t''.matchAll(RegExp.prototype);\n\t\t} catch (e) {\n\t\t\treturn String.prototype.matchAll;\n\t\t}\n\t}\n\treturn implementation;\n};\n","'use strict';\n\n// var Construct = require('es-abstract/2023/Construct');\nvar CreateRegExpStringIterator = require('es-abstract/2023/CreateRegExpStringIterator');\nvar Get = require('es-abstract/2023/Get');\nvar Set = require('es-abstract/2023/Set');\nvar SpeciesConstructor = require('es-abstract/2023/SpeciesConstructor');\nvar ToLength = require('es-abstract/2023/ToLength');\nvar ToString = require('es-abstract/2023/ToString');\nvar Type = require('es-abstract/2023/Type');\nvar flagsGetter = require('regexp.prototype.flags');\nvar setFunctionName = require('set-function-name');\nvar callBound = require('call-bind/callBound');\n\nvar $indexOf = callBound('String.prototype.indexOf');\n\nvar OrigRegExp = RegExp;\n\nvar supportsConstructingWithFlags = 'flags' in RegExp.prototype;\n\nvar constructRegexWithFlags = function constructRegex(C, R) {\n\tvar matcher;\n\t// workaround for older engines that lack RegExp.prototype.flags\n\tvar flags = 'flags' in R ? Get(R, 'flags') : ToString(flagsGetter(R));\n\tif (supportsConstructingWithFlags && typeof flags === 'string') {\n\t\tmatcher = new C(R, flags);\n\t} else if (C === OrigRegExp) {\n\t\t// workaround for older engines that can not construct a RegExp with flags\n\t\tmatcher = new C(R.source, flags);\n\t} else {\n\t\tmatcher = new C(R, flags);\n\t}\n\treturn { flags: flags, matcher: matcher };\n};\n\nvar regexMatchAll = setFunctionName(function SymbolMatchAll(string) {\n\tvar R = this;\n\tif (Type(R) !== 'Object') {\n\t\tthrow new TypeError('\"this\" value must be an Object');\n\t}\n\tvar S = ToString(string);\n\tvar C = SpeciesConstructor(R, OrigRegExp);\n\n\tvar tmp = constructRegexWithFlags(C, R);\n\t// var flags = ToString(Get(R, 'flags'));\n\tvar flags = tmp.flags;\n\t// var matcher = Construct(C, [R, flags]);\n\tvar matcher = tmp.matcher;\n\n\tvar lastIndex = ToLength(Get(R, 'lastIndex'));\n\tSet(matcher, 'lastIndex', lastIndex, true);\n\tvar global = $indexOf(flags, 'g') > -1;\n\tvar fullUnicode = $indexOf(flags, 'u') > -1;\n\treturn CreateRegExpStringIterator(matcher, S, global, fullUnicode);\n}, '[Symbol.matchAll]', true);\n\nmodule.exports = regexMatchAll;\n","'use strict';\n\nvar define = require('define-properties');\nvar hasSymbols = require('has-symbols')();\nvar getPolyfill = require('./polyfill');\nvar regexpMatchAllPolyfill = require('./polyfill-regexp-matchall');\n\nvar defineP = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nmodule.exports = function shimMatchAll() {\n\tvar polyfill = getPolyfill();\n\tdefine(\n\t\tString.prototype,\n\t\t{ matchAll: polyfill },\n\t\t{ matchAll: function () { return String.prototype.matchAll !== polyfill; } }\n\t);\n\tif (hasSymbols) {\n\t\t// eslint-disable-next-line no-restricted-properties\n\t\tvar symbol = Symbol.matchAll || (Symbol['for'] ? Symbol['for']('Symbol.matchAll') : Symbol('Symbol.matchAll'));\n\t\tdefine(\n\t\t\tSymbol,\n\t\t\t{ matchAll: symbol },\n\t\t\t{ matchAll: function () { return Symbol.matchAll !== symbol; } }\n\t\t);\n\n\t\tif (defineP && gOPD) {\n\t\t\tvar desc = gOPD(Symbol, symbol);\n\t\t\tif (!desc || desc.configurable) {\n\t\t\t\tdefineP(Symbol, symbol, {\n\t\t\t\t\tconfigurable: false,\n\t\t\t\t\tenumerable: false,\n\t\t\t\t\tvalue: symbol,\n\t\t\t\t\twritable: false\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tvar regexpMatchAll = regexpMatchAllPolyfill();\n\t\tvar func = {};\n\t\tfunc[symbol] = regexpMatchAll;\n\t\tvar predicate = {};\n\t\tpredicate[symbol] = function () {\n\t\t\treturn RegExp.prototype[symbol] !== regexpMatchAll;\n\t\t};\n\t\tdefine(RegExp.prototype, func, predicate);\n\t}\n\treturn polyfill;\n};\n","'use strict';\n\nvar RequireObjectCoercible = require('es-abstract/2023/RequireObjectCoercible');\nvar ToString = require('es-abstract/2023/ToString');\nvar callBound = require('call-bind/callBound');\nvar $replace = callBound('String.prototype.replace');\n\nvar mvsIsWS = (/^\\s$/).test('\\u180E');\n/* eslint-disable no-control-regex */\nvar leftWhitespace = mvsIsWS\n\t? /^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+/\n\t: /^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+/;\nvar rightWhitespace = mvsIsWS\n\t? /[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+$/\n\t: /[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+$/;\n/* eslint-enable no-control-regex */\n\nmodule.exports = function trim() {\n\tvar S = ToString(RequireObjectCoercible(this));\n\treturn $replace($replace(S, leftWhitespace, ''), rightWhitespace, '');\n};\n","'use strict';\n\nvar callBind = require('call-bind');\nvar define = require('define-properties');\nvar RequireObjectCoercible = require('es-abstract/2023/RequireObjectCoercible');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar bound = callBind(getPolyfill());\nvar boundMethod = function trim(receiver) {\n\tRequireObjectCoercible(receiver);\n\treturn bound(receiver);\n};\n\ndefine(boundMethod, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = boundMethod;\n","'use strict';\n\nvar implementation = require('./implementation');\n\nvar zeroWidthSpace = '\\u200b';\nvar mongolianVowelSeparator = '\\u180E';\n\nmodule.exports = function getPolyfill() {\n\tif (\n\t\tString.prototype.trim\n\t\t&& zeroWidthSpace.trim() === zeroWidthSpace\n\t\t&& mongolianVowelSeparator.trim() === mongolianVowelSeparator\n\t\t&& ('_' + mongolianVowelSeparator).trim() === ('_' + mongolianVowelSeparator)\n\t\t&& (mongolianVowelSeparator + '_').trim() === (mongolianVowelSeparator + '_')\n\t) {\n\t\treturn String.prototype.trim;\n\t}\n\treturn implementation;\n};\n","'use strict';\n\nvar define = require('define-properties');\nvar getPolyfill = require('./polyfill');\n\nmodule.exports = function shimStringTrim() {\n\tvar polyfill = getPolyfill();\n\tdefine(String.prototype, { trim: polyfill }, {\n\t\ttrim: function testTrim() {\n\t\t\treturn String.prototype.trim !== polyfill;\n\t\t}\n\t});\n\treturn polyfill;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar CodePointAt = require('./CodePointAt');\nvar Type = require('./Type');\n\nvar isInteger = require('../helpers/isInteger');\nvar MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// https://262.ecma-international.org/12.0/#sec-advancestringindex\n\nmodule.exports = function AdvanceStringIndex(S, index, unicode) {\n\tif (Type(S) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `S` must be a String');\n\t}\n\tif (!isInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) {\n\t\tthrow new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53');\n\t}\n\tif (Type(unicode) !== 'Boolean') {\n\t\tthrow new $TypeError('Assertion failed: `unicode` must be a Boolean');\n\t}\n\tif (!unicode) {\n\t\treturn index + 1;\n\t}\n\tvar length = S.length;\n\tif ((index + 1) >= length) {\n\t\treturn index + 1;\n\t}\n\tvar cp = CodePointAt(S, index);\n\treturn index + cp['[[CodeUnitCount]]'];\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bind/callBound');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar IsArray = require('./IsArray');\n\nvar $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('Function.prototype.apply');\n\n// https://262.ecma-international.org/6.0/#sec-call\n\nmodule.exports = function Call(F, V) {\n\tvar argumentsList = arguments.length > 2 ? arguments[2] : [];\n\tif (!IsArray(argumentsList)) {\n\t\tthrow new $TypeError('Assertion failed: optional `argumentsList`, if provided, must be a List');\n\t}\n\treturn $apply(F, V, argumentsList);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar callBound = require('call-bind/callBound');\nvar isLeadingSurrogate = require('../helpers/isLeadingSurrogate');\nvar isTrailingSurrogate = require('../helpers/isTrailingSurrogate');\n\nvar Type = require('./Type');\nvar UTF16SurrogatePairToCodePoint = require('./UTF16SurrogatePairToCodePoint');\n\nvar $charAt = callBound('String.prototype.charAt');\nvar $charCodeAt = callBound('String.prototype.charCodeAt');\n\n// https://262.ecma-international.org/12.0/#sec-codepointat\n\nmodule.exports = function CodePointAt(string, position) {\n\tif (Type(string) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `string` must be a String');\n\t}\n\tvar size = string.length;\n\tif (position < 0 || position >= size) {\n\t\tthrow new $TypeError('Assertion failed: `position` must be >= 0, and < the length of `string`');\n\t}\n\tvar first = $charCodeAt(string, position);\n\tvar cp = $charAt(string, position);\n\tvar firstIsLeading = isLeadingSurrogate(first);\n\tvar firstIsTrailing = isTrailingSurrogate(first);\n\tif (!firstIsLeading && !firstIsTrailing) {\n\t\treturn {\n\t\t\t'[[CodePoint]]': cp,\n\t\t\t'[[CodeUnitCount]]': 1,\n\t\t\t'[[IsUnpairedSurrogate]]': false\n\t\t};\n\t}\n\tif (firstIsTrailing || (position + 1 === size)) {\n\t\treturn {\n\t\t\t'[[CodePoint]]': cp,\n\t\t\t'[[CodeUnitCount]]': 1,\n\t\t\t'[[IsUnpairedSurrogate]]': true\n\t\t};\n\t}\n\tvar second = $charCodeAt(string, position + 1);\n\tif (!isTrailingSurrogate(second)) {\n\t\treturn {\n\t\t\t'[[CodePoint]]': cp,\n\t\t\t'[[CodeUnitCount]]': 1,\n\t\t\t'[[IsUnpairedSurrogate]]': true\n\t\t};\n\t}\n\n\treturn {\n\t\t'[[CodePoint]]': UTF16SurrogatePairToCodePoint(first, second),\n\t\t'[[CodeUnitCount]]': 2,\n\t\t'[[IsUnpairedSurrogate]]': false\n\t};\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-createiterresultobject\n\nmodule.exports = function CreateIterResultObject(value, done) {\n\tif (Type(done) !== 'Boolean') {\n\t\tthrow new $TypeError('Assertion failed: Type(done) is not Boolean');\n\t}\n\treturn {\n\t\tvalue: value,\n\t\tdone: done\n\t};\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar DefineOwnProperty = require('../helpers/DefineOwnProperty');\n\nvar FromPropertyDescriptor = require('./FromPropertyDescriptor');\nvar IsDataDescriptor = require('./IsDataDescriptor');\nvar IsPropertyKey = require('./IsPropertyKey');\nvar SameValue = require('./SameValue');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-createmethodproperty\n\nmodule.exports = function CreateMethodProperty(O, P, V) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true');\n\t}\n\n\tvar newDesc = {\n\t\t'[[Configurable]]': true,\n\t\t'[[Enumerable]]': false,\n\t\t'[[Value]]': V,\n\t\t'[[Writable]]': true\n\t};\n\treturn DefineOwnProperty(\n\t\tIsDataDescriptor,\n\t\tSameValue,\n\t\tFromPropertyDescriptor,\n\t\tO,\n\t\tP,\n\t\tnewDesc\n\t);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar hasSymbols = require('has-symbols')();\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar IteratorPrototype = GetIntrinsic('%IteratorPrototype%', true);\n\nvar AdvanceStringIndex = require('./AdvanceStringIndex');\nvar CreateIterResultObject = require('./CreateIterResultObject');\nvar CreateMethodProperty = require('./CreateMethodProperty');\nvar Get = require('./Get');\nvar OrdinaryObjectCreate = require('./OrdinaryObjectCreate');\nvar RegExpExec = require('./RegExpExec');\nvar Set = require('./Set');\nvar ToLength = require('./ToLength');\nvar ToString = require('./ToString');\nvar Type = require('./Type');\n\nvar SLOT = require('internal-slot');\nvar setToStringTag = require('es-set-tostringtag');\n\nvar RegExpStringIterator = function RegExpStringIterator(R, S, global, fullUnicode) {\n\tif (Type(S) !== 'String') {\n\t\tthrow new $TypeError('`S` must be a string');\n\t}\n\tif (Type(global) !== 'Boolean') {\n\t\tthrow new $TypeError('`global` must be a boolean');\n\t}\n\tif (Type(fullUnicode) !== 'Boolean') {\n\t\tthrow new $TypeError('`fullUnicode` must be a boolean');\n\t}\n\tSLOT.set(this, '[[IteratingRegExp]]', R);\n\tSLOT.set(this, '[[IteratedString]]', S);\n\tSLOT.set(this, '[[Global]]', global);\n\tSLOT.set(this, '[[Unicode]]', fullUnicode);\n\tSLOT.set(this, '[[Done]]', false);\n};\n\nif (IteratorPrototype) {\n\tRegExpStringIterator.prototype = OrdinaryObjectCreate(IteratorPrototype);\n}\n\nvar RegExpStringIteratorNext = function next() {\n\tvar O = this; // eslint-disable-line no-invalid-this\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('receiver must be an object');\n\t}\n\tif (\n\t\t!(O instanceof RegExpStringIterator)\n\t\t|| !SLOT.has(O, '[[IteratingRegExp]]')\n\t\t|| !SLOT.has(O, '[[IteratedString]]')\n\t\t|| !SLOT.has(O, '[[Global]]')\n\t\t|| !SLOT.has(O, '[[Unicode]]')\n\t\t|| !SLOT.has(O, '[[Done]]')\n\t) {\n\t\tthrow new $TypeError('\"this\" value must be a RegExpStringIterator instance');\n\t}\n\tif (SLOT.get(O, '[[Done]]')) {\n\t\treturn CreateIterResultObject(undefined, true);\n\t}\n\tvar R = SLOT.get(O, '[[IteratingRegExp]]');\n\tvar S = SLOT.get(O, '[[IteratedString]]');\n\tvar global = SLOT.get(O, '[[Global]]');\n\tvar fullUnicode = SLOT.get(O, '[[Unicode]]');\n\tvar match = RegExpExec(R, S);\n\tif (match === null) {\n\t\tSLOT.set(O, '[[Done]]', true);\n\t\treturn CreateIterResultObject(undefined, true);\n\t}\n\tif (global) {\n\t\tvar matchStr = ToString(Get(match, '0'));\n\t\tif (matchStr === '') {\n\t\t\tvar thisIndex = ToLength(Get(R, 'lastIndex'));\n\t\t\tvar nextIndex = AdvanceStringIndex(S, thisIndex, fullUnicode);\n\t\t\tSet(R, 'lastIndex', nextIndex, true);\n\t\t}\n\t\treturn CreateIterResultObject(match, false);\n\t}\n\tSLOT.set(O, '[[Done]]', true);\n\treturn CreateIterResultObject(match, false);\n};\nCreateMethodProperty(RegExpStringIterator.prototype, 'next', RegExpStringIteratorNext);\n\nif (hasSymbols) {\n\tsetToStringTag(RegExpStringIterator.prototype, 'RegExp String Iterator');\n\n\tif (Symbol.iterator && typeof RegExpStringIterator.prototype[Symbol.iterator] !== 'function') {\n\t\tvar iteratorFn = function SymbolIterator() {\n\t\t\treturn this;\n\t\t};\n\t\tCreateMethodProperty(RegExpStringIterator.prototype, Symbol.iterator, iteratorFn);\n\t}\n}\n\n// https://262.ecma-international.org/11.0/#sec-createregexpstringiterator\nmodule.exports = function CreateRegExpStringIterator(R, S, global, fullUnicode) {\n\t// assert R.global === global && R.unicode === fullUnicode?\n\treturn new RegExpStringIterator(R, S, global, fullUnicode);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar isPropertyDescriptor = require('../helpers/isPropertyDescriptor');\nvar DefineOwnProperty = require('../helpers/DefineOwnProperty');\n\nvar FromPropertyDescriptor = require('./FromPropertyDescriptor');\nvar IsAccessorDescriptor = require('./IsAccessorDescriptor');\nvar IsDataDescriptor = require('./IsDataDescriptor');\nvar IsPropertyKey = require('./IsPropertyKey');\nvar SameValue = require('./SameValue');\nvar ToPropertyDescriptor = require('./ToPropertyDescriptor');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-definepropertyorthrow\n\nmodule.exports = function DefinePropertyOrThrow(O, P, desc) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true');\n\t}\n\n\tvar Desc = isPropertyDescriptor({\n\t\tType: Type,\n\t\tIsDataDescriptor: IsDataDescriptor,\n\t\tIsAccessorDescriptor: IsAccessorDescriptor\n\t}, desc) ? desc : ToPropertyDescriptor(desc);\n\tif (!isPropertyDescriptor({\n\t\tType: Type,\n\t\tIsDataDescriptor: IsDataDescriptor,\n\t\tIsAccessorDescriptor: IsAccessorDescriptor\n\t}, Desc)) {\n\t\tthrow new $TypeError('Assertion failed: Desc is not a valid Property Descriptor');\n\t}\n\n\treturn DefineOwnProperty(\n\t\tIsDataDescriptor,\n\t\tSameValue,\n\t\tFromPropertyDescriptor,\n\t\tO,\n\t\tP,\n\t\tDesc\n\t);\n};\n","'use strict';\n\nvar assertRecord = require('../helpers/assertRecord');\nvar fromPropertyDescriptor = require('../helpers/fromPropertyDescriptor');\n\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-frompropertydescriptor\n\nmodule.exports = function FromPropertyDescriptor(Desc) {\n\tif (typeof Desc !== 'undefined') {\n\t\tassertRecord(Type, 'Property Descriptor', 'Desc', Desc);\n\t}\n\n\treturn fromPropertyDescriptor(Desc);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar inspect = require('object-inspect');\n\nvar IsPropertyKey = require('./IsPropertyKey');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-get-o-p\n\nmodule.exports = function Get(O, P) {\n\t// 7.3.1.1\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\t// 7.3.1.2\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P));\n\t}\n\t// 7.3.1.3\n\treturn O[P];\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar GetV = require('./GetV');\nvar IsCallable = require('./IsCallable');\nvar IsPropertyKey = require('./IsPropertyKey');\n\nvar inspect = require('object-inspect');\n\n// https://262.ecma-international.org/6.0/#sec-getmethod\n\nmodule.exports = function GetMethod(O, P) {\n\t// 7.3.9.1\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true');\n\t}\n\n\t// 7.3.9.2\n\tvar func = GetV(O, P);\n\n\t// 7.3.9.4\n\tif (func == null) {\n\t\treturn void 0;\n\t}\n\n\t// 7.3.9.5\n\tif (!IsCallable(func)) {\n\t\tthrow new $TypeError(inspect(P) + ' is not a function: ' + inspect(func));\n\t}\n\n\t// 7.3.9.6\n\treturn func;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar inspect = require('object-inspect');\n\nvar IsPropertyKey = require('./IsPropertyKey');\n// var ToObject = require('./ToObject');\n\n// https://262.ecma-international.org/6.0/#sec-getv\n\nmodule.exports = function GetV(V, P) {\n\t// 7.3.2.1\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P));\n\t}\n\n\t// 7.3.2.2-3\n\t// var O = ToObject(V);\n\n\t// 7.3.2.4\n\treturn V[P];\n};\n","'use strict';\n\nvar has = require('has');\n\nvar Type = require('./Type');\n\nvar assertRecord = require('../helpers/assertRecord');\n\n// https://262.ecma-international.org/5.1/#sec-8.10.1\n\nmodule.exports = function IsAccessorDescriptor(Desc) {\n\tif (typeof Desc === 'undefined') {\n\t\treturn false;\n\t}\n\n\tassertRecord(Type, 'Property Descriptor', 'Desc', Desc);\n\n\tif (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n","'use strict';\n\n// https://262.ecma-international.org/6.0/#sec-isarray\nmodule.exports = require('../helpers/IsArray');\n","'use strict';\n\n// http://262.ecma-international.org/5.1/#sec-9.11\n\nmodule.exports = require('is-callable');\n","'use strict';\n\nvar GetIntrinsic = require('../GetIntrinsic.js');\n\nvar $construct = GetIntrinsic('%Reflect.construct%', true);\n\nvar DefinePropertyOrThrow = require('./DefinePropertyOrThrow');\ntry {\n\tDefinePropertyOrThrow({}, '', { '[[Get]]': function () {} });\n} catch (e) {\n\t// Accessor properties aren't supported\n\tDefinePropertyOrThrow = null;\n}\n\n// https://262.ecma-international.org/6.0/#sec-isconstructor\n\nif (DefinePropertyOrThrow && $construct) {\n\tvar isConstructorMarker = {};\n\tvar badArrayLike = {};\n\tDefinePropertyOrThrow(badArrayLike, 'length', {\n\t\t'[[Get]]': function () {\n\t\t\tthrow isConstructorMarker;\n\t\t},\n\t\t'[[Enumerable]]': true\n\t});\n\n\tmodule.exports = function IsConstructor(argument) {\n\t\ttry {\n\t\t\t// `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`:\n\t\t\t$construct(argument, badArrayLike);\n\t\t} catch (err) {\n\t\t\treturn err === isConstructorMarker;\n\t\t}\n\t};\n} else {\n\tmodule.exports = function IsConstructor(argument) {\n\t\t// unfortunately there's no way to truly check this without try/catch `new argument` in old environments\n\t\treturn typeof argument === 'function' && !!argument.prototype;\n\t};\n}\n","'use strict';\n\nvar has = require('has');\n\nvar Type = require('./Type');\n\nvar assertRecord = require('../helpers/assertRecord');\n\n// https://262.ecma-international.org/5.1/#sec-8.10.2\n\nmodule.exports = function IsDataDescriptor(Desc) {\n\tif (typeof Desc === 'undefined') {\n\t\treturn false;\n\t}\n\n\tassertRecord(Type, 'Property Descriptor', 'Desc', Desc);\n\n\tif (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n","'use strict';\n\n// https://262.ecma-international.org/6.0/#sec-ispropertykey\n\nmodule.exports = function IsPropertyKey(argument) {\n\treturn typeof argument === 'string' || typeof argument === 'symbol';\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $match = GetIntrinsic('%Symbol.match%', true);\n\nvar hasRegExpMatcher = require('is-regex');\n\nvar ToBoolean = require('./ToBoolean');\n\n// https://262.ecma-international.org/6.0/#sec-isregexp\n\nmodule.exports = function IsRegExp(argument) {\n\tif (!argument || typeof argument !== 'object') {\n\t\treturn false;\n\t}\n\tif ($match) {\n\t\tvar isRegExp = argument[$match];\n\t\tif (typeof isRegExp !== 'undefined') {\n\t\t\treturn ToBoolean(isRegExp);\n\t\t}\n\t}\n\treturn hasRegExpMatcher(argument);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $ObjectCreate = GetIntrinsic('%Object.create%', true);\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\n\nvar IsArray = require('./IsArray');\nvar Type = require('./Type');\n\nvar forEach = require('../helpers/forEach');\n\nvar SLOT = require('internal-slot');\n\nvar hasProto = require('has-proto')();\n\n// https://262.ecma-international.org/11.0/#sec-objectcreate\n\nmodule.exports = function OrdinaryObjectCreate(proto) {\n\tif (proto !== null && Type(proto) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: `proto` must be null or an object');\n\t}\n\tvar additionalInternalSlotsList = arguments.length < 2 ? [] : arguments[1];\n\tif (!IsArray(additionalInternalSlotsList)) {\n\t\tthrow new $TypeError('Assertion failed: `additionalInternalSlotsList` must be an Array');\n\t}\n\n\t// var internalSlotsList = ['[[Prototype]]', '[[Extensible]]']; // step 1\n\t// internalSlotsList.push(...additionalInternalSlotsList); // step 2\n\t// var O = MakeBasicObject(internalSlotsList); // step 3\n\t// setProto(O, proto); // step 4\n\t// return O; // step 5\n\n\tvar O;\n\tif ($ObjectCreate) {\n\t\tO = $ObjectCreate(proto);\n\t} else if (hasProto) {\n\t\tO = { __proto__: proto };\n\t} else {\n\t\tif (proto === null) {\n\t\t\tthrow new $SyntaxError('native Object.create support is required to create null objects');\n\t\t}\n\t\tvar T = function T() {};\n\t\tT.prototype = proto;\n\t\tO = new T();\n\t}\n\n\tif (additionalInternalSlotsList.length > 0) {\n\t\tforEach(additionalInternalSlotsList, function (slot) {\n\t\t\tSLOT.set(O, slot, void undefined);\n\t\t});\n\t}\n\n\treturn O;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar regexExec = require('call-bind/callBound')('RegExp.prototype.exec');\n\nvar Call = require('./Call');\nvar Get = require('./Get');\nvar IsCallable = require('./IsCallable');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-regexpexec\n\nmodule.exports = function RegExpExec(R, S) {\n\tif (Type(R) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: `R` must be an Object');\n\t}\n\tif (Type(S) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `S` must be a String');\n\t}\n\tvar exec = Get(R, 'exec');\n\tif (IsCallable(exec)) {\n\t\tvar result = Call(exec, R, [S]);\n\t\tif (result === null || Type(result) === 'Object') {\n\t\t\treturn result;\n\t\t}\n\t\tthrow new $TypeError('\"exec\" method must return `null` or an Object');\n\t}\n\treturn regexExec(R, S);\n};\n","'use strict';\n\nmodule.exports = require('../5/CheckObjectCoercible');\n","'use strict';\n\nvar $isNaN = require('../helpers/isNaN');\n\n// http://262.ecma-international.org/5.1/#sec-9.12\n\nmodule.exports = function SameValue(x, y) {\n\tif (x === y) { // 0 === -0, but they are not identical.\n\t\tif (x === 0) { return 1 / x === 1 / y; }\n\t\treturn true;\n\t}\n\treturn $isNaN(x) && $isNaN(y);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar IsPropertyKey = require('./IsPropertyKey');\nvar SameValue = require('./SameValue');\nvar Type = require('./Type');\n\n// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated\nvar noThrowOnStrictViolation = (function () {\n\ttry {\n\t\tdelete [].length;\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n}());\n\n// https://262.ecma-international.org/6.0/#sec-set-o-p-v-throw\n\nmodule.exports = function Set(O, P, V, Throw) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: `O` must be an Object');\n\t}\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: `P` must be a Property Key');\n\t}\n\tif (Type(Throw) !== 'Boolean') {\n\t\tthrow new $TypeError('Assertion failed: `Throw` must be a Boolean');\n\t}\n\tif (Throw) {\n\t\tO[P] = V; // eslint-disable-line no-param-reassign\n\t\tif (noThrowOnStrictViolation && !SameValue(O[P], V)) {\n\t\t\tthrow new $TypeError('Attempted to assign to readonly property.');\n\t\t}\n\t\treturn true;\n\t}\n\ttry {\n\t\tO[P] = V; // eslint-disable-line no-param-reassign\n\t\treturn noThrowOnStrictViolation ? SameValue(O[P], V) : true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $species = GetIntrinsic('%Symbol.species%', true);\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar IsConstructor = require('./IsConstructor');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-speciesconstructor\n\nmodule.exports = function SpeciesConstructor(O, defaultConstructor) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\tvar C = O.constructor;\n\tif (typeof C === 'undefined') {\n\t\treturn defaultConstructor;\n\t}\n\tif (Type(C) !== 'Object') {\n\t\tthrow new $TypeError('O.constructor is not an Object');\n\t}\n\tvar S = $species ? C[$species] : void 0;\n\tif (S == null) {\n\t\treturn defaultConstructor;\n\t}\n\tif (IsConstructor(S)) {\n\t\treturn S;\n\t}\n\tthrow new $TypeError('no constructor found');\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $Number = GetIntrinsic('%Number%');\nvar $RegExp = GetIntrinsic('%RegExp%');\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $parseInteger = GetIntrinsic('%parseInt%');\n\nvar callBound = require('call-bind/callBound');\nvar regexTester = require('safe-regex-test');\n\nvar $strSlice = callBound('String.prototype.slice');\nvar isBinary = regexTester(/^0b[01]+$/i);\nvar isOctal = regexTester(/^0o[0-7]+$/i);\nvar isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i);\nvar nonWS = ['\\u0085', '\\u200b', '\\ufffe'].join('');\nvar nonWSregex = new $RegExp('[' + nonWS + ']', 'g');\nvar hasNonWS = regexTester(nonWSregex);\n\nvar $trim = require('string.prototype.trim');\n\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/13.0/#sec-stringtonumber\n\nmodule.exports = function StringToNumber(argument) {\n\tif (Type(argument) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `argument` is not a String');\n\t}\n\tif (isBinary(argument)) {\n\t\treturn $Number($parseInteger($strSlice(argument, 2), 2));\n\t}\n\tif (isOctal(argument)) {\n\t\treturn $Number($parseInteger($strSlice(argument, 2), 8));\n\t}\n\tif (hasNonWS(argument) || isInvalidHexLiteral(argument)) {\n\t\treturn NaN;\n\t}\n\tvar trimmed = $trim(argument);\n\tif (trimmed !== argument) {\n\t\treturn StringToNumber(trimmed);\n\t}\n\treturn $Number(argument);\n};\n","'use strict';\n\n// http://262.ecma-international.org/5.1/#sec-9.2\n\nmodule.exports = function ToBoolean(value) { return !!value; };\n","'use strict';\n\nvar ToNumber = require('./ToNumber');\nvar truncate = require('./truncate');\n\nvar $isNaN = require('../helpers/isNaN');\nvar $isFinite = require('../helpers/isFinite');\n\n// https://262.ecma-international.org/14.0/#sec-tointegerorinfinity\n\nmodule.exports = function ToIntegerOrInfinity(value) {\n\tvar number = ToNumber(value);\n\tif ($isNaN(number) || number === 0) { return 0; }\n\tif (!$isFinite(number)) { return number; }\n\treturn truncate(number);\n};\n","'use strict';\n\nvar MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');\n\nvar ToIntegerOrInfinity = require('./ToIntegerOrInfinity');\n\nmodule.exports = function ToLength(argument) {\n\tvar len = ToIntegerOrInfinity(argument);\n\tif (len <= 0) { return 0; } // includes converting -0 to +0\n\tif (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; }\n\treturn len;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $Number = GetIntrinsic('%Number%');\nvar isPrimitive = require('../helpers/isPrimitive');\n\nvar ToPrimitive = require('./ToPrimitive');\nvar StringToNumber = require('./StringToNumber');\n\n// https://262.ecma-international.org/13.0/#sec-tonumber\n\nmodule.exports = function ToNumber(argument) {\n\tvar value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number);\n\tif (typeof value === 'symbol') {\n\t\tthrow new $TypeError('Cannot convert a Symbol value to a number');\n\t}\n\tif (typeof value === 'bigint') {\n\t\tthrow new $TypeError('Conversion from \\'BigInt\\' to \\'number\\' is not allowed.');\n\t}\n\tif (typeof value === 'string') {\n\t\treturn StringToNumber(value);\n\t}\n\treturn $Number(value);\n};\n","'use strict';\n\nvar toPrimitive = require('es-to-primitive/es2015');\n\n// https://262.ecma-international.org/6.0/#sec-toprimitive\n\nmodule.exports = function ToPrimitive(input) {\n\tif (arguments.length > 1) {\n\t\treturn toPrimitive(input, arguments[1]);\n\t}\n\treturn toPrimitive(input);\n};\n","'use strict';\n\nvar has = require('has');\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar Type = require('./Type');\nvar ToBoolean = require('./ToBoolean');\nvar IsCallable = require('./IsCallable');\n\n// https://262.ecma-international.org/5.1/#sec-8.10.5\n\nmodule.exports = function ToPropertyDescriptor(Obj) {\n\tif (Type(Obj) !== 'Object') {\n\t\tthrow new $TypeError('ToPropertyDescriptor requires an object');\n\t}\n\n\tvar desc = {};\n\tif (has(Obj, 'enumerable')) {\n\t\tdesc['[[Enumerable]]'] = ToBoolean(Obj.enumerable);\n\t}\n\tif (has(Obj, 'configurable')) {\n\t\tdesc['[[Configurable]]'] = ToBoolean(Obj.configurable);\n\t}\n\tif (has(Obj, 'value')) {\n\t\tdesc['[[Value]]'] = Obj.value;\n\t}\n\tif (has(Obj, 'writable')) {\n\t\tdesc['[[Writable]]'] = ToBoolean(Obj.writable);\n\t}\n\tif (has(Obj, 'get')) {\n\t\tvar getter = Obj.get;\n\t\tif (typeof getter !== 'undefined' && !IsCallable(getter)) {\n\t\t\tthrow new $TypeError('getter must be a function');\n\t\t}\n\t\tdesc['[[Get]]'] = getter;\n\t}\n\tif (has(Obj, 'set')) {\n\t\tvar setter = Obj.set;\n\t\tif (typeof setter !== 'undefined' && !IsCallable(setter)) {\n\t\t\tthrow new $TypeError('setter must be a function');\n\t\t}\n\t\tdesc['[[Set]]'] = setter;\n\t}\n\n\tif ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) {\n\t\tthrow new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');\n\t}\n\treturn desc;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $String = GetIntrinsic('%String%');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// https://262.ecma-international.org/6.0/#sec-tostring\n\nmodule.exports = function ToString(argument) {\n\tif (typeof argument === 'symbol') {\n\t\tthrow new $TypeError('Cannot convert a Symbol value to a string');\n\t}\n\treturn $String(argument);\n};\n","'use strict';\n\nvar ES5Type = require('../5/Type');\n\n// https://262.ecma-international.org/11.0/#sec-ecmascript-data-types-and-values\n\nmodule.exports = function Type(x) {\n\tif (typeof x === 'symbol') {\n\t\treturn 'Symbol';\n\t}\n\tif (typeof x === 'bigint') {\n\t\treturn 'BigInt';\n\t}\n\treturn ES5Type(x);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $fromCharCode = GetIntrinsic('%String.fromCharCode%');\n\nvar isLeadingSurrogate = require('../helpers/isLeadingSurrogate');\nvar isTrailingSurrogate = require('../helpers/isTrailingSurrogate');\n\n// https://tc39.es/ecma262/2020/#sec-utf16decodesurrogatepair\n\nmodule.exports = function UTF16SurrogatePairToCodePoint(lead, trail) {\n\tif (!isLeadingSurrogate(lead) || !isTrailingSurrogate(trail)) {\n\t\tthrow new $TypeError('Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code');\n\t}\n\t// var cp = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;\n\treturn $fromCharCode(lead) + $fromCharCode(trail);\n};\n","'use strict';\n\nvar Type = require('./Type');\n\n// var modulo = require('./modulo');\nvar $floor = Math.floor;\n\n// http://262.ecma-international.org/11.0/#eqn-floor\n\nmodule.exports = function floor(x) {\n\t// return x - modulo(x, 1);\n\tif (Type(x) === 'BigInt') {\n\t\treturn x;\n\t}\n\treturn $floor(x);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar floor = require('./floor');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// https://262.ecma-international.org/14.0/#eqn-truncate\n\nmodule.exports = function truncate(x) {\n\tif (typeof x !== 'number' && typeof x !== 'bigint') {\n\t\tthrow new $TypeError('argument must be a Number or a BigInt');\n\t}\n\tvar result = x < 0 ? -floor(-x) : floor(x);\n\treturn result === 0 ? 0 : result; // in the spec, these are math values, so we filter out -0 here\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// http://262.ecma-international.org/5.1/#sec-9.10\n\nmodule.exports = function CheckObjectCoercible(value, optMessage) {\n\tif (value == null) {\n\t\tthrow new $TypeError(optMessage || ('Cannot call method on ' + value));\n\t}\n\treturn value;\n};\n","'use strict';\n\n// https://262.ecma-international.org/5.1/#sec-8\n\nmodule.exports = function Type(x) {\n\tif (x === null) {\n\t\treturn 'Null';\n\t}\n\tif (typeof x === 'undefined') {\n\t\treturn 'Undefined';\n\t}\n\tif (typeof x === 'function' || typeof x === 'object') {\n\t\treturn 'Object';\n\t}\n\tif (typeof x === 'number') {\n\t\treturn 'Number';\n\t}\n\tif (typeof x === 'boolean') {\n\t\treturn 'Boolean';\n\t}\n\tif (typeof x === 'string') {\n\t\treturn 'String';\n\t}\n};\n","'use strict';\n\n// TODO: remove, semver-major\n\nmodule.exports = require('get-intrinsic');\n","'use strict';\n\nvar hasPropertyDescriptors = require('has-property-descriptors');\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = hasPropertyDescriptors() && GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasArrayLengthDefineBug = hasPropertyDescriptors.hasArrayLengthDefineBug();\n\n// eslint-disable-next-line global-require\nvar isArray = hasArrayLengthDefineBug && require('../helpers/IsArray');\n\nvar callBound = require('call-bind/callBound');\n\nvar $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');\n\n// eslint-disable-next-line max-params\nmodule.exports = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) {\n\tif (!$defineProperty) {\n\t\tif (!IsDataDescriptor(desc)) {\n\t\t\t// ES3 does not support getters/setters\n\t\t\treturn false;\n\t\t}\n\t\tif (!desc['[[Configurable]]'] || !desc['[[Writable]]']) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// fallback for ES3\n\t\tif (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) {\n\t\t\t// a non-enumerable existing property\n\t\t\treturn false;\n\t\t}\n\n\t\t// property does not exist at all, or exists but is enumerable\n\t\tvar V = desc['[[Value]]'];\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tO[P] = V; // will use [[Define]]\n\t\treturn SameValue(O[P], V);\n\t}\n\tif (\n\t\thasArrayLengthDefineBug\n\t\t&& P === 'length'\n\t\t&& '[[Value]]' in desc\n\t\t&& isArray(O)\n\t\t&& O.length !== desc['[[Value]]']\n\t) {\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tO.length = desc['[[Value]]'];\n\t\treturn O.length === desc['[[Value]]'];\n\t}\n\n\t$defineProperty(O, P, FromPropertyDescriptor(desc));\n\treturn true;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $Array = GetIntrinsic('%Array%');\n\n// eslint-disable-next-line global-require\nvar toStr = !$Array.isArray && require('call-bind/callBound')('Object.prototype.toString');\n\nmodule.exports = $Array.isArray || function IsArray(argument) {\n\treturn toStr(argument) === '[object Array]';\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\n\nvar has = require('has');\nvar isInteger = require('./isInteger');\n\nvar isMatchRecord = require('./isMatchRecord');\n\nvar predicates = {\n\t// https://262.ecma-international.org/6.0/#sec-property-descriptor-specification-type\n\t'Property Descriptor': function isPropertyDescriptor(Desc) {\n\t\tvar allowed = {\n\t\t\t'[[Configurable]]': true,\n\t\t\t'[[Enumerable]]': true,\n\t\t\t'[[Get]]': true,\n\t\t\t'[[Set]]': true,\n\t\t\t'[[Value]]': true,\n\t\t\t'[[Writable]]': true\n\t\t};\n\n\t\tif (!Desc) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (var key in Desc) { // eslint-disable-line\n\t\t\tif (has(Desc, key) && !allowed[key]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tvar isData = has(Desc, '[[Value]]');\n\t\tvar IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]');\n\t\tif (isData && IsAccessor) {\n\t\t\tthrow new $TypeError('Property Descriptors may not be both accessor and data descriptors');\n\t\t}\n\t\treturn true;\n\t},\n\t// https://262.ecma-international.org/13.0/#sec-match-records\n\t'Match Record': isMatchRecord,\n\t'Iterator Record': function isIteratorRecord(value) {\n\t\treturn has(value, '[[Iterator]]') && has(value, '[[NextMethod]]') && has(value, '[[Done]]');\n\t},\n\t'PromiseCapability Record': function isPromiseCapabilityRecord(value) {\n\t\treturn !!value\n\t\t\t&& has(value, '[[Resolve]]')\n\t\t\t&& typeof value['[[Resolve]]'] === 'function'\n\t\t\t&& has(value, '[[Reject]]')\n\t\t\t&& typeof value['[[Reject]]'] === 'function'\n\t\t\t&& has(value, '[[Promise]]')\n\t\t\t&& value['[[Promise]]']\n\t\t\t&& typeof value['[[Promise]]'].then === 'function';\n\t},\n\t'AsyncGeneratorRequest Record': function isAsyncGeneratorRequestRecord(value) {\n\t\treturn !!value\n\t\t\t&& has(value, '[[Completion]]') // TODO: confirm is a completion record\n\t\t\t&& has(value, '[[Capability]]')\n\t\t\t&& predicates['PromiseCapability Record'](value['[[Capability]]']);\n\t},\n\t'RegExp Record': function isRegExpRecord(value) {\n\t\treturn value\n\t\t\t&& has(value, '[[IgnoreCase]]')\n\t\t\t&& typeof value['[[IgnoreCase]]'] === 'boolean'\n\t\t\t&& has(value, '[[Multiline]]')\n\t\t\t&& typeof value['[[Multiline]]'] === 'boolean'\n\t\t\t&& has(value, '[[DotAll]]')\n\t\t\t&& typeof value['[[DotAll]]'] === 'boolean'\n\t\t\t&& has(value, '[[Unicode]]')\n\t\t\t&& typeof value['[[Unicode]]'] === 'boolean'\n\t\t\t&& has(value, '[[CapturingGroupsCount]]')\n\t\t\t&& typeof value['[[CapturingGroupsCount]]'] === 'number'\n\t\t\t&& isInteger(value['[[CapturingGroupsCount]]'])\n\t\t\t&& value['[[CapturingGroupsCount]]'] >= 0;\n\t}\n};\n\nmodule.exports = function assertRecord(Type, recordType, argumentName, value) {\n\tvar predicate = predicates[recordType];\n\tif (typeof predicate !== 'function') {\n\t\tthrow new $SyntaxError('unknown record type: ' + recordType);\n\t}\n\tif (Type(value) !== 'Object' || !predicate(value)) {\n\t\tthrow new $TypeError(argumentName + ' must be a ' + recordType);\n\t}\n};\n","'use strict';\n\nmodule.exports = function forEach(array, callback) {\n\tfor (var i = 0; i < array.length; i += 1) {\n\t\tcallback(array[i], i, array); // eslint-disable-line callback-return\n\t}\n};\n","'use strict';\n\nmodule.exports = function fromPropertyDescriptor(Desc) {\n\tif (typeof Desc === 'undefined') {\n\t\treturn Desc;\n\t}\n\tvar obj = {};\n\tif ('[[Value]]' in Desc) {\n\t\tobj.value = Desc['[[Value]]'];\n\t}\n\tif ('[[Writable]]' in Desc) {\n\t\tobj.writable = !!Desc['[[Writable]]'];\n\t}\n\tif ('[[Get]]' in Desc) {\n\t\tobj.get = Desc['[[Get]]'];\n\t}\n\tif ('[[Set]]' in Desc) {\n\t\tobj.set = Desc['[[Set]]'];\n\t}\n\tif ('[[Enumerable]]' in Desc) {\n\t\tobj.enumerable = !!Desc['[[Enumerable]]'];\n\t}\n\tif ('[[Configurable]]' in Desc) {\n\t\tobj.configurable = !!Desc['[[Configurable]]'];\n\t}\n\treturn obj;\n};\n","'use strict';\n\nvar $isNaN = require('./isNaN');\n\nmodule.exports = function (x) { return (typeof x === 'number' || typeof x === 'bigint') && !$isNaN(x) && x !== Infinity && x !== -Infinity; };\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $abs = GetIntrinsic('%Math.abs%');\nvar $floor = GetIntrinsic('%Math.floor%');\n\nvar $isNaN = require('./isNaN');\nvar $isFinite = require('./isFinite');\n\nmodule.exports = function isInteger(argument) {\n\tif (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {\n\t\treturn false;\n\t}\n\tvar absValue = $abs(argument);\n\treturn $floor(absValue) === absValue;\n};\n\n","'use strict';\n\nmodule.exports = function isLeadingSurrogate(charCode) {\n\treturn typeof charCode === 'number' && charCode >= 0xD800 && charCode <= 0xDBFF;\n};\n","'use strict';\n\nvar has = require('has');\n\n// https://262.ecma-international.org/13.0/#sec-match-records\n\nmodule.exports = function isMatchRecord(record) {\n\treturn (\n\t\thas(record, '[[StartIndex]]')\n && has(record, '[[EndIndex]]')\n && record['[[StartIndex]]'] >= 0\n && record['[[EndIndex]]'] >= record['[[StartIndex]]']\n && String(parseInt(record['[[StartIndex]]'], 10)) === String(record['[[StartIndex]]'])\n && String(parseInt(record['[[EndIndex]]'], 10)) === String(record['[[EndIndex]]'])\n\t);\n};\n","'use strict';\n\nmodule.exports = Number.isNaN || function isNaN(a) {\n\treturn a !== a;\n};\n","'use strict';\n\nmodule.exports = function isPrimitive(value) {\n\treturn value === null || (typeof value !== 'function' && typeof value !== 'object');\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar has = require('has');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nmodule.exports = function IsPropertyDescriptor(ES, Desc) {\n\tif (ES.Type(Desc) !== 'Object') {\n\t\treturn false;\n\t}\n\tvar allowed = {\n\t\t'[[Configurable]]': true,\n\t\t'[[Enumerable]]': true,\n\t\t'[[Get]]': true,\n\t\t'[[Set]]': true,\n\t\t'[[Value]]': true,\n\t\t'[[Writable]]': true\n\t};\n\n\tfor (var key in Desc) { // eslint-disable-line no-restricted-syntax\n\t\tif (has(Desc, key) && !allowed[key]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tif (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) {\n\t\tthrow new $TypeError('Property Descriptors may not be both accessor and data descriptors');\n\t}\n\treturn true;\n};\n","'use strict';\n\nmodule.exports = function isTrailingSurrogate(charCode) {\n\treturn typeof charCode === 'number' && charCode >= 0xDC00 && charCode <= 0xDFFF;\n};\n","'use strict';\n\nmodule.exports = Number.MAX_SAFE_INTEGER || 9007199254740991; // Math.pow(2, 53) - 1;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","/** Manages a fixed layout resource embedded in an iframe. */\nexport class PageManager {\n constructor(window, iframe, listener) {\n this.margins = { top: 0, right: 0, bottom: 0, left: 0 };\n if (!iframe.contentWindow) {\n throw Error(\"Iframe argument must have been attached to DOM.\");\n }\n this.listener = listener;\n this.iframe = iframe;\n }\n setMessagePort(messagePort) {\n messagePort.onmessage = (message) => {\n this.onMessageFromIframe(message);\n };\n }\n show() {\n this.iframe.style.display = \"unset\";\n }\n hide() {\n this.iframe.style.display = \"none\";\n }\n /** Sets page margins. */\n setMargins(margins) {\n if (this.margins == margins) {\n return;\n }\n this.iframe.style.marginTop = this.margins.top + \"px\";\n this.iframe.style.marginLeft = this.margins.left + \"px\";\n this.iframe.style.marginBottom = this.margins.bottom + \"px\";\n this.iframe.style.marginRight = this.margins.right + \"px\";\n }\n /** Loads page content. */\n loadPage(url) {\n this.iframe.src = url;\n }\n /** Sets the size of this page without content. */\n setPlaceholder(size) {\n this.iframe.style.visibility = \"hidden\";\n this.iframe.style.width = size.width + \"px\";\n this.iframe.style.height = size.height + \"px\";\n this.size = size;\n }\n onMessageFromIframe(event) {\n const message = event.data;\n switch (message.kind) {\n case \"contentSize\":\n return this.onContentSizeAvailable(message.size);\n case \"tap\":\n return this.listener.onTap(message.event);\n case \"linkActivated\":\n return this.onLinkActivated(message);\n case \"decorationActivated\":\n return this.listener.onDecorationActivated(message.event);\n }\n }\n onLinkActivated(message) {\n try {\n const url = new URL(message.href, this.iframe.src);\n this.listener.onLinkActivated(url.toString(), message.outerHtml);\n }\n catch (_a) {\n // Do nothing if url is not valid.\n }\n }\n onContentSizeAvailable(size) {\n if (!size) {\n //FIXME: handle edge case\n return;\n }\n this.iframe.style.width = size.width + \"px\";\n this.iframe.style.height = size.height + \"px\";\n this.size = size;\n this.listener.onIframeLoaded();\n }\n}\n","export function offsetToParentCoordinates(offset, iframeRect) {\n return {\n x: (offset.x + iframeRect.left - visualViewport.offsetLeft) *\n visualViewport.scale,\n y: (offset.y + iframeRect.top - visualViewport.offsetTop) *\n visualViewport.scale,\n };\n}\nexport function rectToParentCoordinates(rect, iframeRect) {\n const topLeft = { x: rect.left, y: rect.top };\n const bottomRight = { x: rect.right, y: rect.bottom };\n const shiftedTopLeft = offsetToParentCoordinates(topLeft, iframeRect);\n const shiftedBottomRight = offsetToParentCoordinates(bottomRight, iframeRect);\n return {\n left: shiftedTopLeft.x,\n top: shiftedTopLeft.y,\n right: shiftedBottomRight.x,\n bottom: shiftedBottomRight.y,\n width: shiftedBottomRight.x - shiftedTopLeft.x,\n height: shiftedBottomRight.y - shiftedTopLeft.y,\n };\n}\n","export class ViewportStringBuilder {\n setInitialScale(scale) {\n this.initialScale = scale;\n return this;\n }\n setMinimumScale(scale) {\n this.minimumScale = scale;\n return this;\n }\n setWidth(width) {\n this.width = width;\n return this;\n }\n setHeight(height) {\n this.height = height;\n return this;\n }\n build() {\n const components = [];\n if (this.initialScale) {\n components.push(\"initial-scale=\" + this.initialScale);\n }\n if (this.minimumScale) {\n components.push(\"minimum-scale=\" + this.minimumScale);\n }\n if (this.width) {\n components.push(\"width=\" + this.width);\n }\n if (this.height) {\n components.push(\"height=\" + this.height);\n }\n return components.join(\", \");\n }\n}\nexport function parseViewportString(viewportString) {\n const regex = /(\\w+) *= *([^\\s,]+)/g;\n const properties = new Map();\n let match;\n while ((match = regex.exec(viewportString))) {\n if (match != null) {\n properties.set(match[1], match[2]);\n }\n }\n const width = parseFloat(properties.get(\"width\"));\n const height = parseFloat(properties.get(\"height\"));\n if (width && height) {\n return { width, height };\n }\n else {\n return undefined;\n }\n}\n","export class GesturesDetector {\n constructor(window, listener, decorationManager) {\n this.window = window;\n this.listener = listener;\n this.decorationManager = decorationManager;\n document.addEventListener(\"click\", (event) => {\n this.onClick(event);\n }, false);\n }\n onClick(event) {\n if (event.defaultPrevented) {\n return;\n }\n let nearestElement;\n if (event.target instanceof HTMLElement) {\n nearestElement = this.nearestInteractiveElement(event.target);\n }\n else {\n nearestElement = null;\n }\n if (nearestElement) {\n if (nearestElement instanceof HTMLAnchorElement) {\n this.listener.onLinkActivated(nearestElement.href, nearestElement.outerHTML);\n event.stopPropagation();\n event.preventDefault();\n }\n return;\n }\n let decorationActivatedEvent;\n if (this.decorationManager) {\n decorationActivatedEvent =\n this.decorationManager.handleDecorationClickEvent(event);\n }\n else {\n decorationActivatedEvent = null;\n }\n if (decorationActivatedEvent) {\n this.listener.onDecorationActivated(decorationActivatedEvent);\n }\n else {\n this.listener.onTap(event);\n }\n // event.stopPropagation()\n // event.preventDefault()\n }\n // See. https://github.com/JayPanoz/architecture/tree/touch-handling/misc/touch-handling\n nearestInteractiveElement(element) {\n if (element == null) {\n return null;\n }\n const interactiveTags = [\n \"a\",\n \"audio\",\n \"button\",\n \"canvas\",\n \"details\",\n \"input\",\n \"label\",\n \"option\",\n \"select\",\n \"submit\",\n \"textarea\",\n \"video\",\n ];\n if (interactiveTags.indexOf(element.nodeName.toLowerCase()) != -1) {\n return element;\n }\n // Checks whether the element is editable by the user.\n if (element.hasAttribute(\"contenteditable\") &&\n element.getAttribute(\"contenteditable\").toLowerCase() != \"false\") {\n return element;\n }\n // Checks parents recursively because the touch might be for example on an inside a .\n if (element.parentElement) {\n return this.nearestInteractiveElement(element.parentElement);\n }\n return null;\n }\n}\n","import { computeScale } from \"./fit\";\nimport { PageManager } from \"./page-manager\";\nimport { offsetToParentCoordinates } from \"../common/geometry\";\nimport { rectToParentCoordinates } from \"../common/geometry\";\nimport { ViewportStringBuilder } from \"../util/viewport\";\nimport { GesturesDetector } from \"../common/gestures\";\nexport class DoubleAreaManager {\n constructor(window, leftIframe, rightIframe, metaViewport, listener) {\n this.fit = \"contain\";\n this.insets = { top: 0, right: 0, bottom: 0, left: 0 };\n this.listener = listener;\n const wrapperGesturesListener = {\n onTap: (event) => {\n const offset = {\n x: (event.clientX - visualViewport.offsetLeft) *\n visualViewport.scale,\n y: (event.clientY - visualViewport.offsetTop) * visualViewport.scale,\n };\n listener.onTap({ offset: offset });\n },\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onLinkActivated: (_) => {\n throw Error(\"No interactive element in the root document.\");\n },\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onDecorationActivated: (_) => {\n throw Error(\"No decoration in the root document.\");\n },\n };\n new GesturesDetector(window, wrapperGesturesListener);\n const leftPageListener = {\n onIframeLoaded: () => {\n this.layout();\n },\n onTap: (gestureEvent) => {\n const boundingRect = leftIframe.getBoundingClientRect();\n const shiftedOffset = offsetToParentCoordinates(gestureEvent.offset, boundingRect);\n listener.onTap({ offset: shiftedOffset });\n },\n onLinkActivated: (href, outerHtml) => {\n listener.onLinkActivated(href, outerHtml);\n },\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onDecorationActivated: (gestureEvent) => {\n const boundingRect = leftIframe.getBoundingClientRect();\n const shiftedOffset = offsetToParentCoordinates(gestureEvent.offset, boundingRect);\n const shiftedRect = rectToParentCoordinates(gestureEvent.rect, boundingRect);\n const shiftedEvent = {\n id: gestureEvent.id,\n group: gestureEvent.group,\n rect: shiftedRect,\n offset: shiftedOffset,\n };\n listener.onDecorationActivated(shiftedEvent);\n },\n };\n const rightPageListener = {\n onIframeLoaded: () => {\n this.layout();\n },\n onTap: (gestureEvent) => {\n const boundingRect = rightIframe.getBoundingClientRect();\n const shiftedOffset = offsetToParentCoordinates(gestureEvent.offset, boundingRect);\n listener.onTap({ offset: shiftedOffset });\n },\n onLinkActivated: (href, outerHtml) => {\n listener.onLinkActivated(href, outerHtml);\n },\n onDecorationActivated: (gestureEvent) => {\n const boundingRect = rightIframe.getBoundingClientRect();\n const shiftedOffset = offsetToParentCoordinates(gestureEvent.offset, boundingRect);\n const shiftedRect = rectToParentCoordinates(gestureEvent.rect, boundingRect);\n const shiftedEvent = {\n id: gestureEvent.id,\n group: gestureEvent.group,\n rect: shiftedRect,\n offset: shiftedOffset,\n };\n listener.onDecorationActivated(shiftedEvent);\n },\n };\n this.leftPage = new PageManager(window, leftIframe, leftPageListener);\n this.rightPage = new PageManager(window, rightIframe, rightPageListener);\n this.metaViewport = metaViewport;\n }\n setLeftMessagePort(messagePort) {\n this.leftPage.setMessagePort(messagePort);\n }\n setRightMessagePort(messagePort) {\n this.rightPage.setMessagePort(messagePort);\n }\n loadSpread(spread) {\n this.leftPage.hide();\n this.rightPage.hide();\n this.spread = spread;\n if (spread.left) {\n this.leftPage.loadPage(spread.left);\n }\n if (spread.right) {\n this.rightPage.loadPage(spread.right);\n }\n }\n setViewport(size, insets) {\n if (this.viewport == size && this.insets == insets) {\n return;\n }\n this.viewport = size;\n this.insets = insets;\n this.layout();\n }\n setFit(fit) {\n if (this.fit == fit) {\n return;\n }\n this.fit = fit;\n this.layout();\n }\n layout() {\n if (!this.viewport ||\n (!this.leftPage.size && this.spread.left) ||\n (!this.rightPage.size && this.spread.right)) {\n return;\n }\n const leftMargins = {\n top: this.insets.top,\n right: 0,\n bottom: this.insets.bottom,\n left: this.insets.left,\n };\n this.leftPage.setMargins(leftMargins);\n const rightMargins = {\n top: this.insets.top,\n right: this.insets.right,\n bottom: this.insets.bottom,\n left: 0,\n };\n this.rightPage.setMargins(rightMargins);\n if (!this.spread.right) {\n this.rightPage.setPlaceholder(this.leftPage.size);\n }\n else if (!this.spread.left) {\n this.leftPage.setPlaceholder(this.rightPage.size);\n }\n const contentWidth = this.leftPage.size.width + this.rightPage.size.width;\n const contentHeight = Math.max(this.leftPage.size.height, this.rightPage.size.height);\n const contentSize = { width: contentWidth, height: contentHeight };\n const safeDrawingSize = {\n width: this.viewport.width - this.insets.left - this.insets.right,\n height: this.viewport.height - this.insets.top - this.insets.bottom,\n };\n const scale = computeScale(this.fit, contentSize, safeDrawingSize);\n this.metaViewport.content = new ViewportStringBuilder()\n .setInitialScale(scale)\n .setMinimumScale(scale)\n .setWidth(contentWidth)\n .setHeight(contentHeight)\n .build();\n this.leftPage.show();\n this.rightPage.show();\n this.listener.onLayout();\n }\n}\n","export function computeScale(fit, content, container) {\n switch (fit) {\n case \"contain\":\n return fitContain(content, container);\n case \"width\":\n return fitWidth(content, container);\n case \"height\":\n return fitHeight(content, container);\n }\n}\nfunction fitContain(content, container) {\n const widthRatio = container.width / content.width;\n const heightRatio = container.height / content.height;\n return Math.min(widthRatio, heightRatio);\n}\nfunction fitWidth(content, container) {\n return container.width / content.width;\n}\nfunction fitHeight(content, container) {\n return container.height / content.height;\n}\n","export class ReflowableListenerAdapter {\n constructor(gesturesBridge, selectionListenerBridge) {\n this.gesturesBridge = gesturesBridge;\n this.selectionListenerBridge = selectionListenerBridge;\n }\n onTap(event) {\n const tapEvent = {\n x: (event.clientX - visualViewport.offsetLeft) * visualViewport.scale,\n y: (event.clientY - visualViewport.offsetTop) * visualViewport.scale,\n };\n const stringEvent = JSON.stringify(tapEvent);\n this.gesturesBridge.onTap(stringEvent);\n }\n onLinkActivated(href, outerHtml) {\n this.gesturesBridge.onLinkActivated(href, outerHtml);\n }\n onDecorationActivated(event) {\n const offset = {\n x: (event.event.clientX - visualViewport.offsetLeft) *\n visualViewport.scale,\n y: (event.event.clientY - visualViewport.offsetTop) *\n visualViewport.scale,\n };\n const stringOffset = JSON.stringify(offset);\n const stringRect = JSON.stringify(event.rect);\n this.gesturesBridge.onDecorationActivated(event.id, event.group, stringRect, stringOffset);\n }\n onSelectionStart() {\n this.selectionListenerBridge.onSelectionStart();\n }\n onSelectionEnd() {\n this.selectionListenerBridge.onSelectionEnd();\n }\n}\nexport class FixedListenerAdapter {\n constructor(window, gesturesApi, documentApi) {\n this.window = window;\n this.gesturesApi = gesturesApi;\n this.documentApi = documentApi;\n this.resizeObserverAdded = false;\n this.documentLoadedFired = false;\n }\n onTap(event) {\n this.gesturesApi.onTap(JSON.stringify(event.offset));\n }\n onLinkActivated(href, outerHtml) {\n this.gesturesApi.onLinkActivated(href, outerHtml);\n }\n onDecorationActivated(event) {\n const stringOffset = JSON.stringify(event.offset);\n const stringRect = JSON.stringify(event.rect);\n this.gesturesApi.onDecorationActivated(event.id, event.group, stringRect, stringOffset);\n }\n onLayout() {\n if (!this.resizeObserverAdded) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const observer = new ResizeObserver(() => {\n requestAnimationFrame(() => {\n const scrollingElement = this.window.document.scrollingElement;\n if (!this.documentLoadedFired &&\n (scrollingElement == null ||\n scrollingElement.scrollHeight > 0 ||\n scrollingElement.scrollWidth > 0)) {\n this.documentApi.onDocumentLoadedAndSized();\n this.documentLoadedFired = true;\n }\n else {\n this.documentApi.onDocumentResized();\n }\n });\n });\n observer.observe(this.window.document.body);\n }\n this.resizeObserverAdded = true;\n }\n}\n","/**\n * From which direction to evaluate strings or nodes: from the start of a string\n * or range seeking Forwards, or from the end seeking Backwards.\n */\nvar TrimDirection;\n(function (TrimDirection) {\n TrimDirection[TrimDirection[\"Forwards\"] = 1] = \"Forwards\";\n TrimDirection[TrimDirection[\"Backwards\"] = 2] = \"Backwards\";\n})(TrimDirection || (TrimDirection = {}));\n/**\n * Return the offset of the nearest non-whitespace character to `baseOffset`\n * within the string `text`, looking in the `direction` indicated. Return -1 if\n * no non-whitespace character exists between `baseOffset` (inclusive) and the\n * terminus of the string (start or end depending on `direction`).\n */\nfunction closestNonSpaceInString(text, baseOffset, direction) {\n const nextChar = direction === TrimDirection.Forwards ? baseOffset : baseOffset - 1;\n if (text.charAt(nextChar).trim() !== \"\") {\n // baseOffset is already valid: it points at a non-whitespace character\n return baseOffset;\n }\n let availableChars;\n let availableNonWhitespaceChars;\n if (direction === TrimDirection.Backwards) {\n availableChars = text.substring(0, baseOffset);\n availableNonWhitespaceChars = availableChars.trimEnd();\n }\n else {\n availableChars = text.substring(baseOffset);\n availableNonWhitespaceChars = availableChars.trimStart();\n }\n if (!availableNonWhitespaceChars.length) {\n return -1;\n }\n const offsetDelta = availableChars.length - availableNonWhitespaceChars.length;\n return direction === TrimDirection.Backwards\n ? baseOffset - offsetDelta\n : baseOffset + offsetDelta;\n}\n/**\n * Calculate a new Range start position (TrimDirection.Forwards) or end position\n * (Backwards) for `range` that represents the nearest non-whitespace character,\n * moving into the `range` away from the relevant initial boundary node towards\n * the terminating boundary node.\n *\n * @throws {RangeError} If no text node with non-whitespace characters found\n */\nfunction closestNonSpaceInRange(range, direction) {\n const nodeIter = range.commonAncestorContainer.ownerDocument.createNodeIterator(range.commonAncestorContainer, NodeFilter.SHOW_TEXT);\n const initialBoundaryNode = direction === TrimDirection.Forwards\n ? range.startContainer\n : range.endContainer;\n const terminalBoundaryNode = direction === TrimDirection.Forwards\n ? range.endContainer\n : range.startContainer;\n let currentNode = nodeIter.nextNode();\n // Advance the NodeIterator to the `initialBoundaryNode`\n while (currentNode && currentNode !== initialBoundaryNode) {\n currentNode = nodeIter.nextNode();\n }\n if (direction === TrimDirection.Backwards) {\n // Reverse the NodeIterator direction. This will return the same node\n // as the previous `nextNode()` call (initial boundary node).\n currentNode = nodeIter.previousNode();\n }\n let trimmedOffset = -1;\n const advance = () => {\n currentNode =\n direction === TrimDirection.Forwards\n ? nodeIter.nextNode()\n : nodeIter.previousNode();\n if (currentNode) {\n const nodeText = currentNode.textContent;\n const baseOffset = direction === TrimDirection.Forwards ? 0 : nodeText.length;\n trimmedOffset = closestNonSpaceInString(nodeText, baseOffset, direction);\n }\n };\n while (currentNode &&\n trimmedOffset === -1 &&\n currentNode !== terminalBoundaryNode) {\n advance();\n }\n if (currentNode && trimmedOffset >= 0) {\n return { node: currentNode, offset: trimmedOffset };\n }\n /* istanbul ignore next */\n throw new RangeError(\"No text nodes with non-whitespace text found in range\");\n}\n/**\n * Return a new DOM Range that adjusts the start and end positions of `range` as\n * needed such that:\n *\n * - `startContainer` and `endContainer` text nodes both contain at least one\n * non-whitespace character within the Range's text content\n * - `startOffset` and `endOffset` both reference non-whitespace characters,\n * with `startOffset` immediately before the first non-whitespace character\n * and `endOffset` immediately after the last\n *\n * Whitespace characters are those that are removed by `String.prototype.trim()`\n *\n * @param range - A DOM Range that whose `startContainer` and `endContainer` are\n * both text nodes, and which contains at least one non-whitespace character.\n * @throws {RangeError}\n */\nexport function trimRange(range) {\n if (!range.toString().trim().length) {\n throw new RangeError(\"Range contains no non-whitespace text\");\n }\n if (range.startContainer.nodeType !== Node.TEXT_NODE) {\n throw new RangeError(\"Range startContainer is not a text node\");\n }\n if (range.endContainer.nodeType !== Node.TEXT_NODE) {\n throw new RangeError(\"Range endContainer is not a text node\");\n }\n const trimmedRange = range.cloneRange();\n let startTrimmed = false;\n let endTrimmed = false;\n const trimmedOffsets = {\n start: closestNonSpaceInString(range.startContainer.textContent, range.startOffset, TrimDirection.Forwards),\n end: closestNonSpaceInString(range.endContainer.textContent, range.endOffset, TrimDirection.Backwards),\n };\n if (trimmedOffsets.start >= 0) {\n trimmedRange.setStart(range.startContainer, trimmedOffsets.start);\n startTrimmed = true;\n }\n // Note: An offset of 0 is invalid for an end offset, as no text in the\n // node would be included in the range.\n if (trimmedOffsets.end > 0) {\n trimmedRange.setEnd(range.endContainer, trimmedOffsets.end);\n endTrimmed = true;\n }\n if (startTrimmed && endTrimmed) {\n return trimmedRange;\n }\n if (!startTrimmed) {\n // There are no (non-whitespace) characters between `startOffset` and the\n // end of the `startContainer` node.\n const { node, offset } = closestNonSpaceInRange(trimmedRange, TrimDirection.Forwards);\n if (node && offset >= 0) {\n trimmedRange.setStart(node, offset);\n }\n }\n if (!endTrimmed) {\n // There are no (non-whitespace) characters between the start of the Range's\n // `endContainer` text content and the `endOffset`.\n const { node, offset } = closestNonSpaceInRange(trimmedRange, TrimDirection.Backwards);\n if (node && offset > 0) {\n trimmedRange.setEnd(node, offset);\n }\n }\n return trimmedRange;\n}\n","import { trimRange } from \"./trim-range\";\n/**\n * Return the combined length of text nodes contained in `node`.\n */\nfunction nodeTextLength(node) {\n var _a, _b;\n switch (node.nodeType) {\n case Node.ELEMENT_NODE:\n case Node.TEXT_NODE:\n // nb. `textContent` excludes text in comments and processing instructions\n // when called on a parent element, so we don't need to subtract that here.\n return (_b = (_a = node.textContent) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;\n default:\n return 0;\n }\n}\n/**\n * Return the total length of the text of all previous siblings of `node`.\n */\nfunction previousSiblingsTextLength(node) {\n let sibling = node.previousSibling;\n let length = 0;\n while (sibling) {\n length += nodeTextLength(sibling);\n sibling = sibling.previousSibling;\n }\n return length;\n}\n/**\n * Resolve one or more character offsets within an element to (text node,\n * position) pairs.\n *\n * @param element\n * @param offsets - Offsets, which must be sorted in ascending order\n * @throws {RangeError}\n */\nfunction resolveOffsets(element, ...offsets) {\n let nextOffset = offsets.shift();\n const nodeIter = element.ownerDocument.createNodeIterator(element, NodeFilter.SHOW_TEXT);\n const results = [];\n let currentNode = nodeIter.nextNode();\n let textNode;\n let length = 0;\n // Find the text node containing the `nextOffset`th character from the start\n // of `element`.\n while (nextOffset !== undefined && currentNode) {\n textNode = currentNode;\n if (length + textNode.data.length > nextOffset) {\n results.push({ node: textNode, offset: nextOffset - length });\n nextOffset = offsets.shift();\n }\n else {\n currentNode = nodeIter.nextNode();\n length += textNode.data.length;\n }\n }\n // Boundary case.\n while (nextOffset !== undefined && textNode && length === nextOffset) {\n results.push({ node: textNode, offset: textNode.data.length });\n nextOffset = offsets.shift();\n }\n if (nextOffset !== undefined) {\n throw new RangeError(\"Offset exceeds text length\");\n }\n return results;\n}\n/**\n * When resolving a TextPosition, specifies the direction to search for the\n * nearest text node if `offset` is `0` and the element has no text.\n */\nexport var ResolveDirection;\n(function (ResolveDirection) {\n ResolveDirection[ResolveDirection[\"FORWARDS\"] = 1] = \"FORWARDS\";\n ResolveDirection[ResolveDirection[\"BACKWARDS\"] = 2] = \"BACKWARDS\";\n})(ResolveDirection || (ResolveDirection = {}));\n/**\n * Represents an offset within the text content of an element.\n *\n * This position can be resolved to a specific descendant node in the current\n * DOM subtree of the element using the `resolve` method.\n */\nexport class TextPosition {\n constructor(element, offset) {\n if (offset < 0) {\n throw new Error(\"Offset is invalid\");\n }\n /** Element that `offset` is relative to. */\n this.element = element;\n /** Character offset from the start of the element's `textContent`. */\n this.offset = offset;\n }\n /**\n * Return a copy of this position with offset relative to a given ancestor\n * element.\n *\n * @param parent - Ancestor of `this.element`\n */\n relativeTo(parent) {\n if (!parent.contains(this.element)) {\n throw new Error(\"Parent is not an ancestor of current element\");\n }\n let el = this.element;\n let offset = this.offset;\n while (el !== parent) {\n offset += previousSiblingsTextLength(el);\n el = el.parentElement;\n }\n return new TextPosition(el, offset);\n }\n /**\n * Resolve the position to a specific text node and offset within that node.\n *\n * Throws if `this.offset` exceeds the length of the element's text. In the\n * case where the element has no text and `this.offset` is 0, the `direction`\n * option determines what happens.\n *\n * Offsets at the boundary between two nodes are resolved to the start of the\n * node that begins at the boundary.\n *\n * @param options.direction - Specifies in which direction to search for the\n * nearest text node if `this.offset` is `0` and\n * `this.element` has no text. If not specified an\n * error is thrown.\n *\n * @throws {RangeError}\n */\n resolve(options = {}) {\n try {\n return resolveOffsets(this.element, this.offset)[0];\n }\n catch (err) {\n if (this.offset === 0 && options.direction !== undefined) {\n const tw = document.createTreeWalker(this.element.getRootNode(), NodeFilter.SHOW_TEXT);\n tw.currentNode = this.element;\n const forwards = options.direction === ResolveDirection.FORWARDS;\n const text = forwards\n ? tw.nextNode()\n : tw.previousNode();\n if (!text) {\n throw err;\n }\n return { node: text, offset: forwards ? 0 : text.data.length };\n }\n else {\n throw err;\n }\n }\n }\n /**\n * Construct a `TextPosition` that refers to the `offset`th character within\n * `node`.\n */\n static fromCharOffset(node, offset) {\n switch (node.nodeType) {\n case Node.TEXT_NODE:\n return TextPosition.fromPoint(node, offset);\n case Node.ELEMENT_NODE:\n return new TextPosition(node, offset);\n default:\n throw new Error(\"Node is not an element or text node\");\n }\n }\n /**\n * Construct a `TextPosition` representing the range start or end point (node, offset).\n *\n * @param node\n * @param offset - Offset within the node\n */\n static fromPoint(node, offset) {\n switch (node.nodeType) {\n case Node.TEXT_NODE: {\n if (offset < 0 || offset > node.data.length) {\n throw new Error(\"Text node offset is out of range\");\n }\n if (!node.parentElement) {\n throw new Error(\"Text node has no parent\");\n }\n // Get the offset from the start of the parent element.\n const textOffset = previousSiblingsTextLength(node) + offset;\n return new TextPosition(node.parentElement, textOffset);\n }\n case Node.ELEMENT_NODE: {\n if (offset < 0 || offset > node.childNodes.length) {\n throw new Error(\"Child node offset is out of range\");\n }\n // Get the text length before the `offset`th child of element.\n let textOffset = 0;\n for (let i = 0; i < offset; i++) {\n textOffset += nodeTextLength(node.childNodes[i]);\n }\n return new TextPosition(node, textOffset);\n }\n default:\n throw new Error(\"Point is not in an element or text node\");\n }\n }\n}\n/**\n * Represents a region of a document as a (start, end) pair of `TextPosition` points.\n *\n * Representing a range in this way allows for changes in the DOM content of the\n * range which don't affect its text content, without affecting the text content\n * of the range itself.\n */\nexport class TextRange {\n constructor(start, end) {\n this.start = start;\n this.end = end;\n }\n /**\n * Create a new TextRange whose `start` and `end` are computed relative to\n * `element`. `element` must be an ancestor of both `start.element` and\n * `end.element`.\n */\n relativeTo(element) {\n return new TextRange(this.start.relativeTo(element), this.end.relativeTo(element));\n }\n /**\n * Resolve this TextRange to a (DOM) Range.\n *\n * The resulting DOM Range will always start and end in a `Text` node.\n * Hence `TextRange.fromRange(range).toRange()` can be used to \"shrink\" a\n * range to the text it contains.\n *\n * May throw if the `start` or `end` positions cannot be resolved to a range.\n */\n toRange() {\n let start;\n let end;\n if (this.start.element === this.end.element &&\n this.start.offset <= this.end.offset) {\n // Fast path for start and end points in same element.\n [start, end] = resolveOffsets(this.start.element, this.start.offset, this.end.offset);\n }\n else {\n start = this.start.resolve({\n direction: ResolveDirection.FORWARDS,\n });\n end = this.end.resolve({ direction: ResolveDirection.BACKWARDS });\n }\n const range = new Range();\n range.setStart(start.node, start.offset);\n range.setEnd(end.node, end.offset);\n return range;\n }\n /**\n * Create a TextRange from a (DOM) Range\n */\n static fromRange(range) {\n const start = TextPosition.fromPoint(range.startContainer, range.startOffset);\n const end = TextPosition.fromPoint(range.endContainer, range.endOffset);\n return new TextRange(start, end);\n }\n /**\n * Create a TextRange representing the `start`th to `end`th characters in\n * `root`\n */\n static fromOffsets(root, start, end) {\n return new TextRange(new TextPosition(root, start), new TextPosition(root, end));\n }\n /**\n * Return a new Range representing `range` trimmed of any leading or trailing\n * whitespace\n */\n static trimmedRange(range) {\n return trimRange(TextRange.fromRange(range).toRange());\n }\n}\n","//\n// Copyright 2021 Readium Foundation. All rights reserved.\n// Use of this source code is governed by the BSD-style license\n// available in the top-level LICENSE file of the project.\n//\nimport { dezoomRect, domRectToRect } from \"../util/rect\";\nimport { log } from \"../util/log\";\nimport { TextRange } from \"../vendor/hypothesis/annotator/anchoring/text-range\";\n// Polyfill for Android API 26\nimport matchAll from \"string.prototype.matchall\";\nimport { rectToParentCoordinates } from \"./geometry\";\nmatchAll.shim();\nexport class SelectionReporter {\n constructor(window, listener) {\n this.isSelecting = false;\n document.addEventListener(\"selectionchange\", \n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n (event) => {\n var _a;\n const collapsed = (_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.isCollapsed;\n if (collapsed && this.isSelecting) {\n this.isSelecting = false;\n listener.onSelectionEnd();\n }\n else if (!collapsed && !this.isSelecting) {\n this.isSelecting = true;\n listener.onSelectionStart();\n }\n }, false);\n }\n}\nexport function selectionToParentCoordinates(selection, iframe) {\n const boundingRect = iframe.getBoundingClientRect();\n const shiftedRect = rectToParentCoordinates(selection.selectionRect, boundingRect);\n return {\n selectedText: selection === null || selection === void 0 ? void 0 : selection.selectedText,\n selectionRect: shiftedRect,\n textBefore: selection.textBefore,\n textAfter: selection.textAfter,\n };\n}\nexport class SelectionManager {\n constructor(window) {\n this.isSelecting = false;\n //, listener: SelectionListener) {\n this.window = window;\n /*this.listener = listener\n document.addEventListener(\n \"selectionchange\",\n () => {\n const selection = window.getSelection()!\n const collapsed = selection.isCollapsed\n \n if (collapsed && this.isSelecting) {\n this.isSelecting = false\n this.listener.onSelectionEnd()\n } else if (!collapsed && !this.isSelecting) {\n this.isSelecting = true\n this.listener.onSelectionStart()\n }\n },\n false\n )*/\n }\n clearSelection() {\n var _a;\n (_a = this.window.getSelection()) === null || _a === void 0 ? void 0 : _a.removeAllRanges();\n }\n getCurrentSelection() {\n const text = this.getCurrentSelectionText();\n if (!text) {\n return null;\n }\n const rect = this.getSelectionRect();\n return {\n selectedText: text.highlight,\n textBefore: text.before,\n textAfter: text.after,\n selectionRect: rect,\n };\n }\n getSelectionRect() {\n try {\n const selection = this.window.getSelection();\n const range = selection.getRangeAt(0);\n const zoom = this.window.document.body.currentCSSZoom;\n return dezoomRect(domRectToRect(range.getBoundingClientRect()), zoom);\n }\n catch (e) {\n log(e);\n throw e;\n //return null\n }\n }\n getCurrentSelectionText() {\n const selection = this.window.getSelection();\n if (selection.isCollapsed) {\n return undefined;\n }\n const highlight = selection.toString();\n const cleanHighlight = highlight\n .trim()\n .replace(/\\n/g, \" \")\n .replace(/\\s\\s+/g, \" \");\n if (cleanHighlight.length === 0) {\n return undefined;\n }\n if (!selection.anchorNode || !selection.focusNode) {\n return undefined;\n }\n const range = selection.rangeCount === 1\n ? selection.getRangeAt(0)\n : createOrderedRange(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);\n if (!range || range.collapsed) {\n log(\"$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!\");\n return undefined;\n }\n const text = document.body.textContent;\n const textRange = TextRange.fromRange(range).relativeTo(document.body);\n const start = textRange.start.offset;\n const end = textRange.end.offset;\n const snippetLength = 200;\n // Compute the text before the highlight, ignoring the first \"word\", which might be cut.\n let before = text.slice(Math.max(0, start - snippetLength), start);\n const firstWordStart = before.search(/\\P{L}\\p{L}/gu);\n if (firstWordStart !== -1) {\n before = before.slice(firstWordStart + 1);\n }\n // Compute the text after the highlight, ignoring the last \"word\", which might be cut.\n let after = text.slice(end, Math.min(text.length, end + snippetLength));\n const lastWordEnd = Array.from(after.matchAll(/\\p{L}\\P{L}/gu)).pop();\n if (lastWordEnd !== undefined && lastWordEnd.index > 1) {\n after = after.slice(0, lastWordEnd.index + 1);\n }\n return { highlight, before, after };\n }\n}\nfunction createOrderedRange(startNode, startOffset, endNode, endOffset) {\n const range = new Range();\n range.setStart(startNode, startOffset);\n range.setEnd(endNode, endOffset);\n if (!range.collapsed) {\n return range;\n }\n log(\">>> createOrderedRange COLLAPSED ... RANGE REVERSE?\");\n const rangeReverse = new Range();\n rangeReverse.setStart(endNode, endOffset);\n rangeReverse.setEnd(startNode, startOffset);\n if (!rangeReverse.collapsed) {\n log(\">>> createOrderedRange RANGE REVERSE OK.\");\n return range;\n }\n log(\">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!\");\n return undefined;\n}\n/*\nexport function convertRangeInfo(document: Document, rangeInfo) {\n const startElement = document.querySelector(\n rangeInfo.startContainerElementCssSelector\n );\n if (!startElement) {\n log(\"^^^ convertRangeInfo NO START ELEMENT CSS SELECTOR?!\");\n return undefined;\n }\n let startContainer = startElement;\n if (rangeInfo.startContainerChildTextNodeIndex >= 0) {\n if (\n rangeInfo.startContainerChildTextNodeIndex >=\n startElement.childNodes.length\n ) {\n log(\n \"^^^ convertRangeInfo rangeInfo.startContainerChildTextNodeIndex >= startElement.childNodes.length?!\"\n );\n return undefined;\n }\n startContainer =\n startElement.childNodes[rangeInfo.startContainerChildTextNodeIndex];\n if (startContainer.nodeType !== Node.TEXT_NODE) {\n log(\"^^^ convertRangeInfo startContainer.nodeType !== Node.TEXT_NODE?!\");\n return undefined;\n }\n }\n const endElement = document.querySelector(\n rangeInfo.endContainerElementCssSelector\n );\n if (!endElement) {\n log(\"^^^ convertRangeInfo NO END ELEMENT CSS SELECTOR?!\");\n return undefined;\n }\n let endContainer = endElement;\n if (rangeInfo.endContainerChildTextNodeIndex >= 0) {\n if (\n rangeInfo.endContainerChildTextNodeIndex >= endElement.childNodes.length\n ) {\n log(\n \"^^^ convertRangeInfo rangeInfo.endContainerChildTextNodeIndex >= endElement.childNodes.length?!\"\n );\n return undefined;\n }\n endContainer =\n endElement.childNodes[rangeInfo.endContainerChildTextNodeIndex];\n if (endContainer.nodeType !== Node.TEXT_NODE) {\n log(\"^^^ convertRangeInfo endContainer.nodeType !== Node.TEXT_NODE?!\");\n return undefined;\n }\n }\n return createOrderedRange(\n startContainer,\n rangeInfo.startOffset,\n endContainer,\n rangeInfo.endOffset\n );\n}\n\nexport function location2RangeInfo(location) {\n const locations = location.locations;\n const domRange = locations.domRange;\n const start = domRange.start;\n const end = domRange.end;\n\n return {\n endContainerChildTextNodeIndex: end.textNodeIndex,\n endContainerElementCssSelector: end.cssSelector,\n endOffset: end.offset,\n startContainerChildTextNodeIndex: start.textNodeIndex,\n startContainerElementCssSelector: start.cssSelector,\n startOffset: start.offset,\n };\n}\n*/\n","export class SelectionWrapperParentSide {\n constructor(listener) {\n this.selectionListener = listener;\n }\n setMessagePort(messagePort) {\n this.messagePort = messagePort;\n messagePort.onmessage = (message) => {\n this.onFeedback(message.data);\n };\n }\n requestSelection(requestId) {\n this.send({ kind: \"requestSelection\", requestId: requestId });\n }\n clearSelection() {\n this.send({ kind: \"clearSelection\" });\n }\n onFeedback(feedback) {\n switch (feedback.kind) {\n case \"selectionAvailable\":\n return this.onSelectionAvailable(feedback.requestId, feedback.selection);\n }\n }\n onSelectionAvailable(requestId, selection) {\n this.selectionListener.onSelectionAvailable(requestId, selection);\n }\n send(message) {\n var _a;\n (_a = this.messagePort) === null || _a === void 0 ? void 0 : _a.postMessage(message);\n }\n}\nexport class SelectionWrapperIframeSide {\n constructor(messagePort, manager) {\n this.selectionManager = manager;\n this.messagePort = messagePort;\n messagePort.onmessage = (message) => {\n this.onCommand(message.data);\n };\n }\n onCommand(command) {\n switch (command.kind) {\n case \"requestSelection\":\n return this.onRequestSelection(command.requestId);\n case \"clearSelection\":\n return this.onClearSelection();\n }\n }\n onRequestSelection(requestId) {\n const selection = this.selectionManager.getCurrentSelection();\n const feedback = {\n kind: \"selectionAvailable\",\n requestId: requestId,\n selection: selection,\n };\n this.sendFeedback(feedback);\n }\n onClearSelection() {\n this.selectionManager.clearSelection();\n }\n sendFeedback(message) {\n this.messagePort.postMessage(message);\n }\n}\n","export class DecorationWrapperParentSide {\n setMessagePort(messagePort) {\n this.messagePort = messagePort;\n }\n registerTemplates(templates) {\n this.send({ kind: \"registerTemplates\", templates });\n }\n addDecoration(decoration, group) {\n this.send({ kind: \"addDecoration\", decoration, group });\n }\n removeDecoration(id, group) {\n this.send({ kind: \"removeDecoration\", id, group });\n }\n send(message) {\n var _a;\n (_a = this.messagePort) === null || _a === void 0 ? void 0 : _a.postMessage(message);\n }\n}\nexport class DecorationWrapperIframeSide {\n constructor(messagePort, decorationManager) {\n this.decorationManager = decorationManager;\n messagePort.onmessage = (message) => {\n this.onCommand(message.data);\n };\n }\n onCommand(command) {\n switch (command.kind) {\n case \"registerTemplates\":\n return this.registerTemplates(command.templates);\n case \"addDecoration\":\n return this.addDecoration(command.decoration, command.group);\n case \"removeDecoration\":\n return this.removeDecoration(command.id, command.group);\n }\n }\n registerTemplates(templates) {\n this.decorationManager.registerTemplates(templates);\n }\n addDecoration(decoration, group) {\n this.decorationManager.addDecoration(decoration, group);\n }\n removeDecoration(id, group) {\n this.decorationManager.removeDecoration(id, group);\n }\n}\n","//\n// Copyright 2024 Readium Foundation. All rights reserved.\n// Use of this source code is governed by the BSD-style license\n// available in the top-level LICENSE file of the project.\n//\nimport { FixedDoubleAreaBridge as FixedDoubleAreaBridge } from \"./bridge/fixed-area-bridge\";\nimport { FixedDoubleSelectionBridge } from \"./bridge/all-selection-bridge\";\nimport { FixedDoubleDecorationsBridge } from \"./bridge/all-decoration-bridge\";\nimport { FixedDoubleInitializationBridge, } from \"./bridge/all-initialization-bridge\";\nconst leftIframe = document.getElementById(\"page-left\");\nconst rightIframe = document.getElementById(\"page-right\");\nconst metaViewport = document.querySelector(\"meta[name=viewport]\");\nWindow.prototype.doubleArea = new FixedDoubleAreaBridge(window, leftIframe, rightIframe, metaViewport, window.gestures, window.documentState);\nwindow.doubleSelection = new FixedDoubleSelectionBridge(leftIframe, rightIframe, window.doubleSelectionListener);\nwindow.doubleDecorations = new FixedDoubleDecorationsBridge();\nwindow.doubleInitialization = new FixedDoubleInitializationBridge(window, window.fixedApiState, leftIframe, rightIframe, window.doubleArea, window.doubleSelection, window.doubleDecorations);\nwindow.fixedApiState.onInitializationApiAvailable();\n","import { DoubleAreaManager } from \"../fixed/double-area-manager\";\nimport { FixedListenerAdapter, } from \"./all-listener-bridge\";\nimport { SingleAreaManager } from \"../fixed/single-area-manager\";\nexport class FixedSingleAreaBridge {\n constructor(window, iframe, metaViewport, gesturesBridge, documentBridge) {\n const listener = new FixedListenerAdapter(window, gesturesBridge, documentBridge);\n this.manager = new SingleAreaManager(window, iframe, metaViewport, listener);\n }\n setMessagePort(messagePort) {\n this.manager.setMessagePort(messagePort);\n }\n loadResource(url) {\n this.manager.loadResource(url);\n }\n setViewport(viewporttWidth, viewportHeight, insetTop, insetRight, insetBottom, insetLeft) {\n const viewport = { width: viewporttWidth, height: viewportHeight };\n const insets = {\n top: insetTop,\n left: insetLeft,\n bottom: insetBottom,\n right: insetRight,\n };\n this.manager.setViewport(viewport, insets);\n }\n setFit(fit) {\n if (fit != \"contain\" && fit != \"width\" && fit != \"height\") {\n throw Error(`Invalid fit value: ${fit}`);\n }\n this.manager.setFit(fit);\n }\n}\nexport class FixedDoubleAreaBridge {\n constructor(window, leftIframe, rightIframe, metaViewport, gesturesBridge, documentBridge) {\n const listener = new FixedListenerAdapter(window, gesturesBridge, documentBridge);\n this.manager = new DoubleAreaManager(window, leftIframe, rightIframe, metaViewport, listener);\n }\n setLeftMessagePort(messagePort) {\n this.manager.setLeftMessagePort(messagePort);\n }\n setRightMessagePort(messagePort) {\n this.manager.setRightMessagePort(messagePort);\n }\n loadSpread(spread) {\n this.manager.loadSpread(spread);\n }\n setViewport(viewporttWidth, viewportHeight, insetTop, insetRight, insetBottom, insetLeft) {\n const viewport = { width: viewporttWidth, height: viewportHeight };\n const insets = {\n top: insetTop,\n left: insetLeft,\n bottom: insetBottom,\n right: insetRight,\n };\n this.manager.setViewport(viewport, insets);\n }\n setFit(fit) {\n if (fit != \"contain\" && fit != \"width\" && fit != \"height\") {\n throw Error(`Invalid fit value: ${fit}`);\n }\n this.manager.setFit(fit);\n }\n}\n","import { selectionToParentCoordinates, } from \"../common/selection\";\nimport { SelectionWrapperParentSide } from \"../fixed/selection-wrapper\";\nexport class ReflowableSelectionBridge {\n constructor(window, manager) {\n this.window = window;\n this.manager = manager;\n }\n getCurrentSelection() {\n return this.manager.getCurrentSelection();\n }\n clearSelection() {\n this.manager.clearSelection();\n }\n}\nexport class FixedSingleSelectionBridge {\n constructor(iframe, listener) {\n this.iframe = iframe;\n this.listener = listener;\n const wrapperListener = {\n onSelectionAvailable: (requestId, selection) => {\n let adjustedSelection;\n if (selection) {\n adjustedSelection = selectionToParentCoordinates(selection, this.iframe);\n }\n else {\n adjustedSelection = selection;\n }\n const selectionAsJson = JSON.stringify(adjustedSelection);\n this.listener.onSelectionAvailable(requestId, selectionAsJson);\n },\n };\n this.wrapper = new SelectionWrapperParentSide(wrapperListener);\n }\n setMessagePort(messagePort) {\n this.wrapper.setMessagePort(messagePort);\n }\n requestSelection(requestId) {\n this.wrapper.requestSelection(requestId);\n }\n clearSelection() {\n this.wrapper.clearSelection();\n }\n}\nexport class FixedDoubleSelectionBridge {\n constructor(leftIframe, rightIframe, listener) {\n this.requestStates = new Map();\n this.isLeftInitialized = false;\n this.isRightInitialized = false;\n this.leftIframe = leftIframe;\n this.rightIframe = rightIframe;\n this.listener = listener;\n const leftWrapperListener = {\n onSelectionAvailable: (requestId, selection) => {\n if (selection) {\n const resolvedSelection = selectionToParentCoordinates(selection, this.leftIframe);\n this.onSelectionAvailable(requestId, \"left\", resolvedSelection);\n }\n else {\n this.onSelectionAvailable(requestId, \"left\", selection);\n }\n },\n };\n this.leftWrapper = new SelectionWrapperParentSide(leftWrapperListener);\n const rightWrapperListener = {\n onSelectionAvailable: (requestId, selection) => {\n if (selection) {\n const resolvedSelection = selectionToParentCoordinates(selection, this.rightIframe);\n this.onSelectionAvailable(requestId, \"right\", resolvedSelection);\n }\n else {\n this.onSelectionAvailable(requestId, \"right\", selection);\n }\n },\n };\n this.rightWrapper = new SelectionWrapperParentSide(rightWrapperListener);\n }\n setLeftMessagePort(messagePort) {\n this.leftWrapper.setMessagePort(messagePort);\n this.isLeftInitialized = true;\n }\n setRightMessagePort(messagePort) {\n this.rightWrapper.setMessagePort(messagePort);\n this.isRightInitialized = true;\n }\n requestSelection(requestId) {\n if (this.isLeftInitialized && this.isRightInitialized) {\n this.requestStates.set(requestId, \"pending\");\n this.leftWrapper.requestSelection(requestId);\n this.rightWrapper.requestSelection(requestId);\n }\n else if (this.isLeftInitialized) {\n this.requestStates.set(requestId, \"firstResponseWasNull\");\n this.leftWrapper.requestSelection(requestId);\n }\n else if (this.isRightInitialized) {\n this.requestStates.set(requestId, \"firstResponseWasNull\");\n this.rightWrapper.requestSelection(requestId);\n }\n else {\n this.requestStates.set(requestId, \"firstResponseWasNull\");\n this.onSelectionAvailable(requestId, \"left\", null);\n }\n }\n clearSelection() {\n this.leftWrapper.clearSelection();\n this.rightWrapper.clearSelection();\n }\n onSelectionAvailable(requestId, iframe, selection) {\n const requestState = this.requestStates.get(requestId);\n if (!requestState) {\n return;\n }\n if (!selection && requestState === \"pending\") {\n this.requestStates.set(requestId, \"firstResponseWasNull\");\n return;\n }\n this.requestStates.delete(requestId);\n const selectionAsJson = JSON.stringify(selection);\n this.listener.onSelectionAvailable(requestId, iframe, selectionAsJson);\n }\n}\n","import { DecorationWrapperParentSide } from \"../fixed/decoration-wrapper\";\nexport class ReflowableDecorationsBridge {\n constructor(window, manager) {\n this.window = window;\n this.manager = manager;\n }\n registerTemplates(templates) {\n const templatesAsMap = parseTemplates(templates);\n this.manager.registerTemplates(templatesAsMap);\n }\n addDecoration(decoration, group) {\n const actualDecoration = parseDecoration(decoration);\n this.manager.addDecoration(actualDecoration, group);\n }\n removeDecoration(id, group) {\n this.manager.removeDecoration(id, group);\n }\n}\nexport class FixedSingleDecorationsBridge {\n constructor() {\n this.wrapper = new DecorationWrapperParentSide();\n }\n setMessagePort(messagePort) {\n this.wrapper.setMessagePort(messagePort);\n }\n registerTemplates(templates) {\n const actualTemplates = parseTemplates(templates);\n this.wrapper.registerTemplates(actualTemplates);\n }\n addDecoration(decoration, group) {\n const actualDecoration = parseDecoration(decoration);\n this.wrapper.addDecoration(actualDecoration, group);\n }\n removeDecoration(id, group) {\n this.wrapper.removeDecoration(id, group);\n }\n}\nexport class FixedDoubleDecorationsBridge {\n constructor() {\n this.leftWrapper = new DecorationWrapperParentSide();\n this.rightWrapper = new DecorationWrapperParentSide();\n }\n setLeftMessagePort(messagePort) {\n this.leftWrapper.setMessagePort(messagePort);\n }\n setRightMessagePort(messagePort) {\n this.rightWrapper.setMessagePort(messagePort);\n }\n registerTemplates(templates) {\n const actualTemplates = parseTemplates(templates);\n this.leftWrapper.registerTemplates(actualTemplates);\n this.rightWrapper.registerTemplates(actualTemplates);\n }\n addDecoration(decoration, iframe, group) {\n const actualDecoration = parseDecoration(decoration);\n switch (iframe) {\n case \"left\":\n this.leftWrapper.addDecoration(actualDecoration, group);\n break;\n case \"right\":\n this.rightWrapper.addDecoration(actualDecoration, group);\n break;\n default:\n throw Error(`Unknown iframe type: ${iframe}`);\n }\n }\n removeDecoration(id, group) {\n this.leftWrapper.removeDecoration(id, group);\n this.rightWrapper.removeDecoration(id, group);\n }\n}\nfunction parseTemplates(templates) {\n return new Map(Object.entries(JSON.parse(templates)));\n}\nfunction parseDecoration(decoration) {\n const jsonDecoration = JSON.parse(decoration);\n return jsonDecoration;\n}\n","import { DecorationWrapperIframeSide } from \"../fixed/decoration-wrapper\";\nimport { IframeMessageSender } from \"../fixed/iframe-message\";\nimport { SelectionWrapperIframeSide } from \"../fixed/selection-wrapper\";\nexport class FixedSingleInitializationBridge {\n constructor(window, listener, iframe, areaBridge, selectionBridge, decorationsBridge) {\n this.window = window;\n this.listener = listener;\n this.iframe = iframe;\n this.areaBridge = areaBridge;\n this.selectionBridge = selectionBridge;\n this.decorationsBridge = decorationsBridge;\n }\n loadResource(url) {\n this.iframe.src = url;\n this.window.addEventListener(\"message\", (event) => {\n console.log(\"message\");\n if (!event.ports[0]) {\n return;\n }\n if (event.source === this.iframe.contentWindow) {\n this.onInitMessage(event);\n }\n });\n }\n onInitMessage(event) {\n console.log(`receiving init message ${event}`);\n const initMessage = event.data;\n const messagePort = event.ports[0];\n switch (initMessage) {\n case \"InitAreaManager\":\n return this.initAreaManager(messagePort);\n case \"InitSelection\":\n return this.initSelection(messagePort);\n case \"InitDecorations\":\n return this.initDecorations(messagePort);\n }\n }\n initAreaManager(messagePort) {\n this.areaBridge.setMessagePort(messagePort);\n this.listener.onAreaApiAvailable();\n }\n initSelection(messagePort) {\n this.selectionBridge.setMessagePort(messagePort);\n this.listener.onSelectionApiAvailable();\n }\n initDecorations(messagePort) {\n this.decorationsBridge.setMessagePort(messagePort);\n this.listener.onDecorationApiAvailable();\n }\n}\nexport class FixedDoubleInitializationBridge {\n constructor(window, listener, leftIframe, rightIframe, areaBridge, selectionBridge, decorationsBridge) {\n this.areaReadySemaphore = 2;\n this.selectionReadySemaphore = 2;\n this.decorationReadySemaphore = 2;\n this.listener = listener;\n this.areaBridge = areaBridge;\n this.selectionBridge = selectionBridge;\n this.decorationsBridge = decorationsBridge;\n window.addEventListener(\"message\", (event) => {\n if (!event.ports[0]) {\n return;\n }\n if (event.source === leftIframe.contentWindow) {\n this.onInitMessageLeft(event);\n }\n else if (event.source == rightIframe.contentWindow) {\n this.onInitMessageRight(event);\n }\n });\n }\n loadSpread(spread) {\n const pageNb = (spread.left ? 1 : 0) + (spread.right ? 1 : 0);\n this.areaReadySemaphore = pageNb;\n this.selectionReadySemaphore = pageNb;\n this.decorationReadySemaphore = pageNb;\n this.areaBridge.loadSpread(spread);\n }\n onInitMessageLeft(event) {\n const initMessage = event.data;\n const messagePort = event.ports[0];\n switch (initMessage) {\n case \"InitAreaManager\":\n this.areaBridge.setLeftMessagePort(messagePort);\n this.onInitAreaMessage();\n break;\n case \"InitSelection\":\n this.selectionBridge.setLeftMessagePort(messagePort);\n this.onInitSelectionMessage();\n break;\n case \"InitDecorations\":\n this.decorationsBridge.setLeftMessagePort(messagePort);\n this.onInitDecorationMessage();\n break;\n }\n }\n onInitMessageRight(event) {\n const initMessage = event.data;\n const messagePort = event.ports[0];\n switch (initMessage) {\n case \"InitAreaManager\":\n this.areaBridge.setRightMessagePort(messagePort);\n this.onInitAreaMessage();\n break;\n case \"InitSelection\":\n this.selectionBridge.setRightMessagePort(messagePort);\n this.onInitSelectionMessage();\n break;\n case \"InitDecorations\":\n this.decorationsBridge.setRightMessagePort(messagePort);\n this.onInitDecorationMessage();\n break;\n }\n }\n onInitAreaMessage() {\n this.areaReadySemaphore -= 1;\n if (this.areaReadySemaphore == 0) {\n this.listener.onAreaApiAvailable();\n }\n }\n onInitSelectionMessage() {\n this.selectionReadySemaphore -= 1;\n if (this.selectionReadySemaphore == 0) {\n this.listener.onSelectionApiAvailable();\n }\n }\n onInitDecorationMessage() {\n this.decorationReadySemaphore -= 1;\n if (this.decorationReadySemaphore == 0) {\n this.listener.onDecorationApiAvailable();\n }\n }\n}\nexport class FixedInitializerIframeSide {\n constructor(window) {\n this.window = window;\n }\n initAreaManager() {\n const messagePort = this.initChannel(\"InitAreaManager\");\n return new IframeMessageSender(messagePort);\n }\n initSelection(selectionManager) {\n const messagePort = this.initChannel(\"InitSelection\");\n new SelectionWrapperIframeSide(messagePort, selectionManager);\n }\n initDecorations(decorationManager) {\n const messagePort = this.initChannel(\"InitDecorations\");\n new DecorationWrapperIframeSide(messagePort, decorationManager);\n }\n initChannel(initMessage) {\n const messageChannel = new MessageChannel();\n this.window.parent.postMessage(initMessage, \"*\", [messageChannel.port2]);\n return messageChannel.port1;\n }\n}\n"],"names":["GetIntrinsic","callBind","$indexOf","module","exports","name","allowMissing","intrinsic","bind","$apply","$call","$reflectApply","call","$gOPD","$defineProperty","$max","value","e","originalFunction","func","arguments","configurable","length","applyBind","apply","hasPropertyDescriptors","$SyntaxError","$TypeError","gopd","obj","property","nonEnumerable","nonWritable","nonConfigurable","loose","desc","enumerable","writable","keys","hasSymbols","Symbol","toStr","Object","prototype","toString","concat","Array","defineDataProperty","supportsDescriptors","defineProperty","object","predicate","fn","defineProperties","map","predicates","props","getOwnPropertySymbols","i","hasToStringTag","has","toStringTag","overrideIfSet","force","iterator","isPrimitive","isCallable","isDate","isSymbol","input","exoticToPrim","hint","String","Number","toPrimitive","O","P","TypeError","GetMethod","valueOf","result","method","methodNames","ordinaryToPrimitive","slice","that","target","this","bound","args","boundLength","Math","max","boundArgs","push","Function","join","Empty","implementation","functionsHaveNames","gOPD","getOwnPropertyDescriptor","functionsHaveConfigurableNames","$bind","boundFunctionsHaveNames","undefined","SyntaxError","$Function","getEvalledConstructor","expressionSyntax","throwTypeError","ThrowTypeError","calleeThrows","get","gOPDthrows","hasProto","getProto","getPrototypeOf","x","__proto__","needsEval","TypedArray","Uint8Array","INTRINSICS","AggregateError","ArrayBuffer","Atomics","BigInt","BigInt64Array","BigUint64Array","Boolean","DataView","Date","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","Error","eval","EvalError","Float32Array","Float64Array","FinalizationRegistry","Int8Array","Int16Array","Int32Array","isFinite","isNaN","JSON","Map","parseFloat","parseInt","Promise","Proxy","RangeError","ReferenceError","Reflect","RegExp","Set","SharedArrayBuffer","Uint8ClampedArray","Uint16Array","Uint32Array","URIError","WeakMap","WeakRef","WeakSet","error","errorProto","doEval","gen","LEGACY_ALIASES","hasOwn","$concat","$spliceApply","splice","$replace","replace","$strSlice","$exec","exec","rePropName","reEscapeChar","getBaseIntrinsic","alias","intrinsicName","parts","string","first","last","match","number","quote","subString","stringToPath","intrinsicBaseName","intrinsicRealName","skipFurtherCaching","isOwn","part","hasArrayLengthDefineBug","test","foo","$Object","origSymbol","hasSymbolSham","sym","symObj","getOwnPropertyNames","syms","propertyIsEnumerable","descriptor","hasOwnProperty","channel","SLOT","assert","slot","slots","set","V","freeze","badArrayLike","isCallableMarker","fnToStr","reflectApply","_","constructorRegex","isES6ClassFn","fnStr","tryFunctionObject","isIE68","isDDA","document","all","str","strClass","getDay","tryDateObject","isRegexMarker","badStringifier","callBound","throwRegexMarker","$toString","symToStr","symStringRegex","isSymbolObject","hasMap","mapSizeDescriptor","mapSize","mapForEach","forEach","hasSet","setSizeDescriptor","setSize","setForEach","weakMapHas","weakSetHas","weakRefDeref","deref","booleanValueOf","objectToString","functionToString","$match","$slice","$toUpperCase","toUpperCase","$toLowerCase","toLowerCase","$test","$join","$arrSlice","$floor","floor","bigIntValueOf","gOPS","symToString","hasShammedSymbols","isEnumerable","gPO","addNumericSeparator","num","Infinity","sepRegex","int","intStr","dec","utilInspect","inspectCustom","custom","inspectSymbol","wrapQuotes","s","defaultStyle","opts","quoteChar","quoteStyle","isArray","isRegExp","inspect_","options","depth","seen","maxStringLength","customInspect","indent","numericSeparator","inspectString","bigIntStr","maxDepth","baseIndent","base","prev","getIndent","indexOf","inspect","from","noIndent","newOpts","f","m","nameOf","arrObjKeys","symString","markBoxed","HTMLElement","nodeName","getAttribute","attrs","attributes","childNodes","xs","singleLineValues","indentedJoin","isError","cause","isMap","mapParts","key","collectionOf","isSet","setParts","isWeakMap","weakCollectionOf","isWeakSet","isWeakRef","isNumber","isBigInt","isBoolean","isString","ys","isPlainObject","constructor","protoTag","stringTag","tag","l","remaining","trailer","lowbyte","c","n","charCodeAt","type","size","entries","lineJoiner","isArr","symMap","k","j","keysShim","isArgs","hasDontEnumBug","hasProtoEnumBug","dontEnums","equalsConstructorPrototype","o","ctor","excludedKeys","$applicationCache","$console","$external","$frame","$frameElement","$frames","$innerHeight","$innerWidth","$onmozfullscreenchange","$onmozfullscreenerror","$outerHeight","$outerWidth","$pageXOffset","$pageYOffset","$parent","$scrollLeft","$scrollTop","$scrollX","$scrollY","$self","$webkitIndexedDB","$webkitStorageInfo","$window","hasAutomationEqualityBug","window","isObject","isFunction","isArguments","theKeys","skipProto","skipConstructor","equalsConstructorPrototypeIfNotBuggy","origKeys","originalKeys","shim","keysWorksWithArguments","callee","setFunctionName","hasIndices","global","ignoreCase","multiline","dotAll","unicode","unicodeSets","sticky","define","getPolyfill","flagsBound","flags","calls","TypeErr","regex","polyfill","proto","isRegex","hasDescriptors","$WeakMap","$Map","$weakMapGet","$weakMapSet","$weakMapHas","$mapGet","$mapSet","$mapHas","listGetNode","list","curr","next","$wm","$m","$o","objects","node","listGet","listHas","listSet","Call","Get","IsRegExp","ToString","RequireObjectCoercible","flagsGetter","regexpMatchAllPolyfill","getMatcher","regexp","matcherPolyfill","matchAll","matcher","S","rx","boundMatchAll","regexpMatchAll","CreateRegExpStringIterator","SpeciesConstructor","ToLength","Type","OrigRegExp","supportsConstructingWithFlags","regexMatchAll","R","tmp","C","source","constructRegexWithFlags","lastIndex","fullUnicode","defineP","symbol","mvsIsWS","leftWhitespace","rightWhitespace","boundMethod","receiver","trim","CodePointAt","isInteger","MAX_SAFE_INTEGER","index","IsArray","F","argumentsList","isLeadingSurrogate","isTrailingSurrogate","UTF16SurrogatePairToCodePoint","$charAt","$charCodeAt","position","cp","firstIsLeading","firstIsTrailing","second","done","DefineOwnProperty","FromPropertyDescriptor","IsDataDescriptor","IsPropertyKey","SameValue","IteratorPrototype","AdvanceStringIndex","CreateIterResultObject","CreateMethodProperty","OrdinaryObjectCreate","RegExpExec","setToStringTag","RegExpStringIterator","thisIndex","nextIndex","isPropertyDescriptor","IsAccessorDescriptor","ToPropertyDescriptor","Desc","assertRecord","fromPropertyDescriptor","GetV","IsCallable","$construct","DefinePropertyOrThrow","isConstructorMarker","argument","err","hasRegExpMatcher","ToBoolean","$ObjectCreate","additionalInternalSlotsList","T","regexExec","$isNaN","y","noThrowOnStrictViolation","Throw","$species","IsConstructor","defaultConstructor","$Number","$RegExp","$parseInteger","regexTester","isBinary","isOctal","isInvalidHexLiteral","hasNonWS","$trim","StringToNumber","NaN","trimmed","ToNumber","truncate","$isFinite","ToIntegerOrInfinity","len","ToPrimitive","Obj","getter","setter","$String","ES5Type","$fromCharCode","lead","trail","optMessage","$isEnumerable","$Array","allowed","isData","IsAccessor","then","recordType","argumentName","array","callback","$abs","absValue","charCode","record","a","ES","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","__esModule","d","definition","prop","PageManager","iframe","listener","margins","top","right","bottom","left","contentWindow","setMessagePort","messagePort","onmessage","message","onMessageFromIframe","show","style","display","hide","setMargins","marginTop","marginLeft","marginBottom","marginRight","loadPage","url","src","setPlaceholder","visibility","width","height","event","data","kind","onContentSizeAvailable","onTap","onLinkActivated","onDecorationActivated","URL","href","outerHtml","_a","onIframeLoaded","offsetToParentCoordinates","offset","iframeRect","visualViewport","offsetLeft","scale","offsetTop","rectToParentCoordinates","rect","topLeft","bottomRight","shiftedTopLeft","shiftedBottomRight","ViewportStringBuilder","setInitialScale","initialScale","setMinimumScale","minimumScale","setWidth","setHeight","build","components","GesturesDetector","decorationManager","addEventListener","onClick","defaultPrevented","nearestElement","decorationActivatedEvent","nearestInteractiveElement","HTMLAnchorElement","outerHTML","stopPropagation","preventDefault","handleDecorationClickEvent","element","hasAttribute","parentElement","DoubleAreaManager","leftIframe","rightIframe","metaViewport","fit","insets","clientX","clientY","leftPageListener","layout","gestureEvent","boundingRect","getBoundingClientRect","shiftedOffset","shiftedRect","shiftedEvent","id","group","rightPageListener","leftPage","rightPage","setLeftMessagePort","setRightMessagePort","loadSpread","spread","setViewport","viewport","setFit","leftMargins","rightMargins","contentWidth","contentHeight","contentSize","safeDrawingSize","content","container","widthRatio","heightRatio","min","fitContain","fitWidth","fitHeight","computeScale","onLayout","gesturesApi","documentApi","resizeObserverAdded","documentLoadedFired","stringify","stringOffset","stringRect","ResizeObserver","requestAnimationFrame","scrollingElement","scrollHeight","scrollWidth","onDocumentLoadedAndSized","onDocumentResized","observe","body","TrimDirection","ResolveDirection","selection","selectionRect","selectedText","textBefore","textAfter","selectionListener","onFeedback","requestSelection","requestId","send","clearSelection","feedback","onSelectionAvailable","postMessage","registerTemplates","templates","addDecoration","decoration","removeDecoration","getElementById","querySelector","Window","doubleArea","gesturesBridge","documentBridge","manager","viewporttWidth","viewportHeight","insetTop","insetRight","insetBottom","insetLeft","gestures","documentState","doubleSelection","requestStates","isLeftInitialized","isRightInitialized","leftWrapperListener","resolvedSelection","leftWrapper","rightWrapperListener","rightWrapper","requestState","delete","selectionAsJson","doubleSelectionListener","doubleDecorations","actualTemplates","parse","parseTemplates","actualDecoration","parseDecoration","doubleInitialization","areaBridge","selectionBridge","decorationsBridge","areaReadySemaphore","selectionReadySemaphore","decorationReadySemaphore","ports","onInitMessageLeft","onInitMessageRight","pageNb","initMessage","onInitAreaMessage","onInitSelectionMessage","onInitDecorationMessage","onAreaApiAvailable","onSelectionApiAvailable","onDecorationApiAvailable","fixedApiState","onInitializationApiAvailable"],"sourceRoot":""} \ No newline at end of file diff --git a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/fixed-injectable-script.js b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/fixed-injectable-script.js index d8cef38ae3..657ecb9768 100644 --- a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/fixed-injectable-script.js +++ b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/fixed-injectable-script.js @@ -1,2 +1,2 @@ -!function(){var t={1844:function(t,e){"use strict";function r(t){return t.split("").reverse().join("")}function n(t){return(t|-t)>>31&1}function o(t,e,r,o){var i=t.P[r],a=t.M[r],s=o>>>31,c=e[r]|s,u=c|a,l=(c&i)+i^i|c,f=a|~(l|i),p=i&l,y=n(f&t.lastRowMask[r])-n(p&t.lastRowMask[r]);return f<<=1,p<<=1,i=(p|=s)|~(u|(f|=n(o)-s)),a=f&u,t.P[r]=i,t.M[r]=a,y}function i(t,e,r){if(0===e.length)return[];r=Math.min(r,e.length);var n=[],i=32,a=Math.ceil(e.length/i)-1,s={P:new Uint32Array(a+1),M:new Uint32Array(a+1),lastRowMask:new Uint32Array(a+1)};s.lastRowMask.fill(1<<31),s.lastRowMask[a]=1<<(e.length-1)%i;for(var c=new Uint32Array(a+1),u=new Map,l=[],f=0;f<256;f++)l.push(c);for(var p=0;p=e.length||e.charCodeAt(b)===y&&(h[g]|=1<0&&w[m]>=r+i;)m-=1;m===a&&w[m]<=r&&(w[m]-1?o(r):r}},2755:function(t,e,r){"use strict";var n=r(3569),o=r(2870),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||n.call(a,i),c=o("%Object.getOwnPropertyDescriptor%",!0),u=o("%Object.defineProperty%",!0),l=o("%Math.max%");if(u)try{u({},"a",{value:1})}catch(t){u=null}t.exports=function(t){var e=s(n,a,arguments);return c&&u&&c(e,"length").configurable&&u(e,"length",{value:1+l(0,t.length-(arguments.length-1))}),e};var f=function(){return s(n,i,arguments)};u?u(t.exports,"apply",{value:f}):t.exports.apply=f},6663:function(t,e,r){"use strict";var n=r(229)(),o=r(2870),i=n&&o("%Object.defineProperty%",!0),a=o("%SyntaxError%"),s=o("%TypeError%"),c=r(658);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new s("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new s("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new s("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!c&&c(t,e);if(i)i(t,e,{configurable:null===u&&f?f.configurable:!u,enumerable:null===n&&f?f.enumerable:!n,value:r,writable:null===o&&f?f.writable:!o});else{if(!l&&(n||o||u))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},9722:function(t,e,r){"use strict";var n=r(2051),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,s=r(6663),c=r(229)(),u=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;c?s(t,e,r,!0):s(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var s=0;s2&&arguments[2]&&arguments[2].force;!a||!r&&i(t,a)||(n?n(t,a,{configurable:!0,enumerable:!1,value:e,writable:!1}):t[a]=e)}},7358:function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(7959),i=r(3655),a=r(455),s=r(8760);t.exports=function(t){if(o(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!i(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):s(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(o(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(a(t)||s(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,a,s="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a1&&"boolean"!=typeof e)throw new a('"allowMissing" argument must be a boolean');if(null===j(/^%?[^%]*%?$/,t))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=O(t,0,1),r=O(t,-1);if("%"===e&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return A(t,P,(function(t,e,r,o){n[n.length]=r?A(o,R,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=C("%"+n+"%",e),s=i.name,u=i.value,l=!1,f=i.alias;f&&(n=f[0],E(r,S([0,1],f)));for(var p=1,y=!0;p=r.length){var m=c(u,h);u=(y=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:u[h]}else y=x(u,h),u=u[h];y&&!l&&(d[s]=u)}}return u}},658:function(t,e,r){"use strict";var n=r(2870)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},229:function(t,e,r){"use strict";var n=r(2870)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},3413:function(t){"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},1143:function(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(9985);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},9985:function(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},3060:function(t,e,r){"use strict";var n=r(9985);t.exports=function(){return n()&&!!Symbol.toStringTag}},9545:function(t){"use strict";var e={}.hasOwnProperty,r=Function.prototype.call;t.exports=r.bind?r.bind(e):function(t,n){return r.call(e,t,n)}},7284:function(t,e,r){"use strict";var n=r(2870),o=r(9545),i=r(5714)(),a=n("%TypeError%"),s={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");if(i.assert(t),!s.has(t,e))throw new a("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");var r=i.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");var r=i.get(t);return!!r&&o(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");var n=i.get(t);n||(n={},i.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(s),t.exports=s},3655:function(t){"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},s=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;c.call(p)===c.call(document.all)&&(f=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&s(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(u)return s(t);if(a(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&s(t)}},455:function(t,e,r){"use strict";var n=Date.prototype.getDay,o=Object.prototype.toString,i=r(3060)();t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},5494:function(t,e,r){"use strict";var n,o,i,a,s=r(3099),c=r(3060)();if(c){n=s("Object.prototype.hasOwnProperty"),o=s("RegExp.prototype.exec"),i={};var u=function(){throw i};a={toString:u,valueOf:u},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=u)}var l=s("Object.prototype.toString"),f=Object.getOwnPropertyDescriptor;t.exports=c?function(t){if(!t||"object"!=typeof t)return!1;var e=f(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{o(t,a)}catch(t){return t===i}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},8760:function(t,e,r){"use strict";var n=Object.prototype.toString;if(r(1143)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},4538:function(t,e,r){var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=s&&c&&"function"==typeof c.get?c.get:null,l=s&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,g=Object.prototype.toString,d=Function.prototype.toString,b=String.prototype.match,m=String.prototype.slice,w=String.prototype.replace,v=String.prototype.toUpperCase,x=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,O=Array.prototype.slice,j=Math.floor,P="function"==typeof BigInt?BigInt.prototype.valueOf:null,R=Object.getOwnPropertySymbols,C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,T="function"==typeof Symbol&&"object"==typeof Symbol.iterator,I="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,M=Object.prototype.propertyIsEnumerable,$=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function D(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||S.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-j(-t):j(t);if(n!==t){var o=String(n),i=m.call(e,o.length+1);return w.call(o,r,"$&_")+"."+w.call(w.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return w.call(e,r,"$&_")}var N=r(7002),F=N.custom,k=_(F)?F:null;function B(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function W(t){return w.call(String(t),/"/g,""")}function L(t){return!("[object Array]"!==H(t)||I&&"object"==typeof t&&I in t)}function U(t){return!("[object RegExp]"!==H(t)||I&&"object"==typeof t&&I in t)}function _(t){if(T)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!C)return!1;try{return C.call(t),!0}catch(t){}return!1}t.exports=function t(e,r,n,o){var s=r||{};if(q(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(q(s,"maxStringLength")&&("number"==typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=!q(s,"customInspect")||s.customInspect;if("boolean"!=typeof c&&"symbol"!==c)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(q(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(q(s,"numericSeparator")&&"boolean"!=typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var g=s.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return X(e,s);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var v=String(e);return g?D(e,v):v}if("bigint"==typeof e){var S=String(e)+"n";return g?D(e,S):S}var j=void 0===s.depth?5:s.depth;if(void 0===n&&(n=0),n>=j&&j>0&&"object"==typeof e)return L(e)?"[Array]":"[Object]";var R,F=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=A.call(Array(t.indent+1)," ")}return{base:r,prev:A.call(Array(e+1),r)}}(s,n);if(void 0===o)o=[];else if(V(o,e)>=0)return"[Circular]";function G(e,r,i){if(r&&(o=O.call(o)).push(r),i){var a={depth:s.depth};return q(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),t(e,a,n+1,o)}return t(e,s,n+1,o)}if("function"==typeof e&&!U(e)){var z=function(t){if(t.name)return t.name;var e=b.call(d.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),tt=Q(e,G);return"[Function"+(z?": "+z:" (anonymous)")+"]"+(tt.length>0?" { "+A.call(tt,", ")+" }":"")}if(_(e)){var et=T?w.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):C.call(e);return"object"!=typeof e||T?et:K(et)}if((R=e)&&"object"==typeof R&&("undefined"!=typeof HTMLElement&&R instanceof HTMLElement||"string"==typeof R.nodeName&&"function"==typeof R.getAttribute)){for(var rt="<"+x.call(String(e.nodeName)),nt=e.attributes||[],ot=0;ot"}if(L(e)){if(0===e.length)return"[]";var it=Q(e,G);return F&&!function(t){for(var e=0;e=0)return!1;return!0}(it)?"["+Z(it,F)+"]":"[ "+A.call(it,", ")+" ]"}if(function(t){return!("[object Error]"!==H(t)||I&&"object"==typeof t&&I in t)}(e)){var at=Q(e,G);return"cause"in Error.prototype||!("cause"in e)||M.call(e,"cause")?0===at.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(at,", ")+" }":"{ ["+String(e)+"] "+A.call(E.call("[cause]: "+G(e.cause),at),", ")+" }"}if("object"==typeof e&&c){if(k&&"function"==typeof e[k]&&N)return N(e,{depth:j-n});if("symbol"!==c&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{u.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var st=[];return a&&a.call(e,(function(t,r){st.push(G(r,e,!0)+" => "+G(t,e))})),Y("Map",i.call(e),st,F)}if(function(t){if(!u||!t||"object"!=typeof t)return!1;try{u.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ct=[];return l&&l.call(e,(function(t){ct.push(G(t,e))})),Y("Set",u.call(e),ct,F)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return J("WeakMap");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return J("WeakSet");if(function(t){if(!y||!t||"object"!=typeof t)return!1;try{return y.call(t),!0}catch(t){}return!1}(e))return J("WeakRef");if(function(t){return!("[object Number]"!==H(t)||I&&"object"==typeof t&&I in t)}(e))return K(G(Number(e)));if(function(t){if(!t||"object"!=typeof t||!P)return!1;try{return P.call(t),!0}catch(t){}return!1}(e))return K(G(P.call(e)));if(function(t){return!("[object Boolean]"!==H(t)||I&&"object"==typeof t&&I in t)}(e))return K(h.call(e));if(function(t){return!("[object String]"!==H(t)||I&&"object"==typeof t&&I in t)}(e))return K(G(String(e)));if(!function(t){return!("[object Date]"!==H(t)||I&&"object"==typeof t&&I in t)}(e)&&!U(e)){var ut=Q(e,G),lt=$?$(e)===Object.prototype:e instanceof Object||e.constructor===Object,ft=e instanceof Object?"":"null prototype",pt=!lt&&I&&Object(e)===e&&I in e?m.call(H(e),8,-1):ft?"Object":"",yt=(lt||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(pt||ft?"["+A.call(E.call([],pt||[],ft||[]),": ")+"] ":"");return 0===ut.length?yt+"{}":F?yt+"{"+Z(ut,F)+"}":yt+"{ "+A.call(ut,", ")+" }"}return String(e)};var G=Object.prototype.hasOwnProperty||function(t){return t in this};function q(t,e){return G.call(t,e)}function H(t){return g.call(t)}function V(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return X(m.call(t,0,e.maxStringLength),e)+n}return B(w.call(w.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,z),"single",e)}function z(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+v.call(e.toString(16))}function K(t){return"Object("+t+")"}function J(t){return t+" { ? }"}function Y(t,e,r,n){return t+" ("+e+") {"+(n?Z(r,n):A.call(r,", "))+"}"}function Z(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+A.call(t,","+r)+"\n"+e.prev}function Q(t,e){var r=L(t),n=[];if(r){n.length=t.length;for(var o=0;o0&&!o.call(t,0))for(var g=0;g0)for(var d=0;d=0&&"[object Function]"===e.call(t.callee)),n}},9766:function(t,e,r){"use strict";var n=r(8921),o=Object,i=TypeError;t.exports=n((function(){if(null!=this&&this!==o(this))throw new i("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t}),"get flags",!0)},483:function(t,e,r){"use strict";var n=r(9722),o=r(2755),i=r(9766),a=r(5113),s=r(7299),c=o(a());n(c,{getPolyfill:a,implementation:i,shim:s}),t.exports=c},5113:function(t,e,r){"use strict";var n=r(9766),o=r(9722).supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(o&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}},7299:function(t,e,r){"use strict";var n=r(9722).supportsDescriptors,o=r(5113),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,s=TypeError,c=Object.getPrototypeOf,u=/a/;t.exports=function(){if(!n||!c)throw new s("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=c(u),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},7582:function(t,e,r){"use strict";var n=r(3099),o=r(2870),i=r(5494),a=n("RegExp.prototype.exec"),s=o("%TypeError%");t.exports=function(t){if(!i(t))throw new s("`regex` must be a RegExp");return function(e){return null!==a(t,e)}}},8921:function(t,e,r){"use strict";var n=r(6663),o=r(229)(),i=r(5610).functionsHaveConfigurableNames(),a=TypeError;t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!i||(o?n(t,"name",e,!0,!0):n(t,"name",e)),t}},5714:function(t,e,r){"use strict";var n=r(2870),o=r(3099),i=r(4538),a=n("%TypeError%"),s=n("%WeakMap%",!0),c=n("%Map%",!0),u=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),y=o("Map.prototype.set",!0),h=o("Map.prototype.has",!0),g=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new a("Side channel does not contain "+i(t))},get:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(t)return u(t,n)}else if(c){if(e)return p(e,n)}else if(r)return function(t,e){var r=g(t,e);return r&&r.value}(r,n)},has:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(t)return f(t,n)}else if(c){if(e)return h(e,n)}else if(r)return function(t,e){return!!g(t,e)}(r,n);return!1},set:function(n,o){s&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new s),l(t,n,o)):c?(e||(e=new c),y(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=g(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n}},3073:function(t,e,r){"use strict";var n=r(7113),o=r(151),i=r(1959),a=r(9497),s=r(5128),c=r(6751),u=r(3099),l=r(1143)(),f=r(483),p=u("String.prototype.indexOf"),y=r(2009),h=function(t){var e=y();if(l&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===RegExp.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=c(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(c(r),p(s(r),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var i=h(t);if(void 0!==i)return n(i,t,[e])}var u=s(e),l=new RegExp(t,"g");return n(h(l),l,[u])}},5155:function(t,e,r){"use strict";var n=r(2755),o=r(9722),i=r(3073),a=r(1794),s=r(3911),c=n(i);o(c,{getPolyfill:a,implementation:i,shim:s}),t.exports=c},2009:function(t,e,r){"use strict";var n=r(1143)(),o=r(8012);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},1794:function(t,e,r){"use strict";var n=r(3073);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},8012:function(t,e,r){"use strict";var n=r(1398),o=r(151),i=r(8322),a=r(2449),s=r(3995),c=r(5128),u=r(1874),l=r(483),f=r(8921),p=r(3099)("String.prototype.indexOf"),y=RegExp,h="flags"in RegExp.prototype,g=f((function(t){var e=this;if("Object"!==u(e))throw new TypeError('"this" value must be an Object');var r=c(t),f=function(t,e){var r="flags"in e?o(e,"flags"):c(l(e));return{flags:r,matcher:new t(h&&"string"==typeof r?e:t===y?e.source:e,r)}}(a(e,y),e),g=f.flags,d=f.matcher,b=s(o(e,"lastIndex"));i(d,"lastIndex",b,!0);var m=p(g,"g")>-1,w=p(g,"u")>-1;return n(d,r,m,w)}),"[Symbol.matchAll]",!0);t.exports=g},3911:function(t,e,r){"use strict";var n=r(9722),o=r(1143)(),i=r(1794),a=r(2009),s=Object.defineProperty,c=Object.getOwnPropertyDescriptor;t.exports=function(){var t=i();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),o){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),s&&c){var r=c(Symbol,e);r&&!r.configurable||s(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var u=a(),l={};l[e]=u;var f={};f[e]=function(){return RegExp.prototype[e]!==u},n(RegExp.prototype,l,f)}return t}},8125:function(t,e,r){"use strict";var n=r(6751),o=r(5128),i=r(3099)("String.prototype.replace"),a=/^\s$/.test("᠎"),s=a?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,c=a?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=o(n(this));return i(i(t,s,""),c,"")}},9434:function(t,e,r){"use strict";var n=r(2755),o=r(9722),i=r(6751),a=r(8125),s=r(3228),c=r(818),u=n(s()),l=function(t){return i(t),u(t)};o(l,{getPolyfill:s,implementation:a,shim:c}),t.exports=l},3228:function(t,e,r){"use strict";var n=r(8125);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},818:function(t,e,r){"use strict";var n=r(9722),o=r(3228);t.exports=function(){var t=o();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},7002:function(){},1510:function(t,e,r){"use strict";var n=r(2870),o=r(6318),i=r(1874),a=r(2990),s=r(5674),c=n("%TypeError%");t.exports=function(t,e,r){if("String"!==i(t))throw new c("Assertion failed: `S` must be a String");if(!a(e)||e<0||e>s)throw new c("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==i(r))throw new c("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+o(t,e)["[[CodeUnitCount]]"]:e+1}},7113:function(t,e,r){"use strict";var n=r(2870),o=r(3099),i=n("%TypeError%"),a=r(6287),s=n("%Reflect.apply%",!0)||o("Function.prototype.apply");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!a(r))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return s(t,e,r)}},6318:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(3099),i=r(5541),a=r(959),s=r(1874),c=r(1751),u=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("String"!==s(t))throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var o=l(t,e),f=u(t,e),p=i(o),y=a(o);if(!p&&!y)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(y||e+1===r)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var h=l(t,e+1);return a(h)?{"[[CodePoint]]":c(o,h),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},5702:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(1874);t.exports=function(t,e){if("Boolean"!==o(e))throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},6782:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(2860),i=r(8357),a=r(3301),s=r(6284),c=r(8277),u=r(1874);t.exports=function(t,e,r){if("Object"!==u(t))throw new n("Assertion failed: Type(O) is not Object");if(!s(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return o(a,c,i,t,e,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0})}},1398:function(t,e,r){"use strict";var n=r(2870),o=r(1143)(),i=n("%TypeError%"),a=n("%IteratorPrototype%",!0),s=r(1510),c=r(5702),u=r(6782),l=r(151),f=r(5716),p=r(3500),y=r(8322),h=r(3995),g=r(5128),d=r(1874),b=r(7284),m=r(2263),w=function(t,e,r,n){if("String"!==d(e))throw new i("`S` must be a string");if("Boolean"!==d(r))throw new i("`global` must be a boolean");if("Boolean"!==d(n))throw new i("`fullUnicode` must be a boolean");b.set(this,"[[IteratingRegExp]]",t),b.set(this,"[[IteratedString]]",e),b.set(this,"[[Global]]",r),b.set(this,"[[Unicode]]",n),b.set(this,"[[Done]]",!1)};a&&(w.prototype=f(a)),u(w.prototype,"next",(function(){var t=this;if("Object"!==d(t))throw new i("receiver must be an object");if(!(t instanceof w&&b.has(t,"[[IteratingRegExp]]")&&b.has(t,"[[IteratedString]]")&&b.has(t,"[[Global]]")&&b.has(t,"[[Unicode]]")&&b.has(t,"[[Done]]")))throw new i('"this" value must be a RegExpStringIterator instance');if(b.get(t,"[[Done]]"))return c(void 0,!0);var e=b.get(t,"[[IteratingRegExp]]"),r=b.get(t,"[[IteratedString]]"),n=b.get(t,"[[Global]]"),o=b.get(t,"[[Unicode]]"),a=p(e,r);if(null===a)return b.set(t,"[[Done]]",!0),c(void 0,!0);if(n){if(""===g(l(a,"0"))){var u=h(l(e,"lastIndex")),f=s(r,u,o);y(e,"lastIndex",f,!0)}return c(a,!1)}return b.set(t,"[[Done]]",!0),c(a,!1)})),o&&(m(w.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof w.prototype[Symbol.iterator])&&u(w.prototype,Symbol.iterator,(function(){return this})),t.exports=function(t,e,r,n){return new w(t,e,r,n)}},3645:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(7999),i=r(2860),a=r(8357),s=r(8355),c=r(3301),u=r(6284),l=r(8277),f=r(7628),p=r(1874);t.exports=function(t,e,r){if("Object"!==p(t))throw new n("Assertion failed: Type(O) is not Object");if(!u(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var y=o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:s},r)?r:f(r);if(!o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:s},y))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return i(c,l,a,t,e,y)}},8357:function(t,e,r){"use strict";var n=r(1489),o=r(1598),i=r(1874);t.exports=function(t){return void 0!==t&&n(i,"Property Descriptor","Desc",t),o(t)}},151:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(4538),i=r(6284),a=r(1874);t.exports=function(t,e){if("Object"!==a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},1959:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(9374),i=r(7304),a=r(6284),s=r(4538);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var r=o(t,e);if(null!=r){if(!i(r))throw new n(s(e)+" is not a function: "+s(r));return r}}},9374:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(4538),i=r(6284);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},8355:function(t,e,r){"use strict";var n=r(9545),o=r(1874),i=r(1489);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Get]]")&&!n(t,"[[Set]]")))}},6287:function(t,e,r){"use strict";t.exports=r(2403)},7304:function(t,e,r){"use strict";t.exports=r(3655)},4791:function(t,e,r){"use strict";var n=r(6740)("%Reflect.construct%",!0),o=r(3645);try{o({},"",{"[[Get]]":function(){}})}catch(t){o=null}if(o&&n){var i={},a={};o(a,"length",{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,a)}catch(t){return t===i}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},3301:function(t,e,r){"use strict";var n=r(9545),o=r(1874),i=r(1489);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Value]]")&&!n(t,"[[Writable]]")))}},6284:function(t){"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},9497:function(t,e,r){"use strict";var n=r(2870)("%Symbol.match%",!0),o=r(5494),i=r(5695);t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(n){var e=t[n];if(void 0!==e)return i(e)}return o(t)}},5716:function(t,e,r){"use strict";var n=r(2870),o=n("%Object.create%",!0),i=n("%TypeError%"),a=n("%SyntaxError%"),s=r(6287),c=r(1874),u=r(7735),l=r(7284),f=r(3413)();t.exports=function(t){if(null!==t&&"Object"!==c(t))throw new i("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!s(r))throw new i("Assertion failed: `additionalInternalSlotsList` must be an Array");if(o)e=o(t);else if(f)e={__proto__:t};else{if(null===t)throw new a("native Object.create support is required to create null objects");var n=function(){};n.prototype=t,e=new n}return r.length>0&&u(r,(function(t){l.set(e,t,void 0)})),e}},3500:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(3099)("RegExp.prototype.exec"),i=r(7113),a=r(151),s=r(7304),c=r(1874);t.exports=function(t,e){if("Object"!==c(t))throw new n("Assertion failed: `R` must be an Object");if("String"!==c(e))throw new n("Assertion failed: `S` must be a String");var r=a(t,"exec");if(s(r)){var u=i(r,t,[e]);if(null===u||"Object"===c(u))return u;throw new n('"exec" method must return `null` or an Object')}return o(t,e)}},6751:function(t,e,r){"use strict";t.exports=r(9572)},8277:function(t,e,r){"use strict";var n=r(159);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},8322:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(6284),i=r(8277),a=r(1874),s=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if("Object"!==a(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");if("Boolean"!==a(c))throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,s&&!i(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!s||i(t[e],r)}catch(t){return!1}}},2449:function(t,e,r){"use strict";var n=r(2870),o=n("%Symbol.species%",!0),i=n("%TypeError%"),a=r(4791),s=r(1874);t.exports=function(t,e){if("Object"!==s(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==s(r))throw new i("O.constructor is not an Object");var n=o?r[o]:void 0;if(null==n)return e;if(a(n))return n;throw new i("no constructor found")}},6207:function(t,e,r){"use strict";var n=r(2870),o=n("%Number%"),i=n("%RegExp%"),a=n("%TypeError%"),s=n("%parseInt%"),c=r(3099),u=r(7582),l=c("String.prototype.slice"),f=u(/^0b[01]+$/i),p=u(/^0o[0-7]+$/i),y=u(/^[-+]0x[0-9a-f]+$/i),h=u(new i("["+["…","​","￾"].join("")+"]","g")),g=r(9434),d=r(1874);t.exports=function t(e){if("String"!==d(e))throw new a("Assertion failed: `argument` is not a String");if(f(e))return o(s(l(e,2),2));if(p(e))return o(s(l(e,2),8));if(h(e)||y(e))return NaN;var r=g(e);return r!==e?t(r):o(e)}},5695:function(t){"use strict";t.exports=function(t){return!!t}},1200:function(t,e,r){"use strict";var n=r(6542),o=r(5693),i=r(159),a=r(1117);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},3995:function(t,e,r){"use strict";var n=r(5674),o=r(1200);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},6542:function(t,e,r){"use strict";var n=r(2870),o=n("%TypeError%"),i=n("%Number%"),a=r(8606),s=r(703),c=r(6207);t.exports=function(t){var e=a(t)?t:s(t,i);if("symbol"==typeof e)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?c(e):i(e)}},703:function(t,e,r){"use strict";var n=r(7358);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},7628:function(t,e,r){"use strict";var n=r(9545),o=r(2870)("%TypeError%"),i=r(1874),a=r(5695),s=r(7304);t.exports=function(t){if("Object"!==i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=a(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=a(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=a(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!s(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!s(c))throw new o("setter must be a function");e["[[Set]]"]=c}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},5128:function(t,e,r){"use strict";var n=r(2870),o=n("%String%"),i=n("%TypeError%");t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return o(t)}},1874:function(t,e,r){"use strict";var n=r(6101);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},1751:function(t,e,r){"use strict";var n=r(2870),o=n("%TypeError%"),i=n("%String.fromCharCode%"),a=r(5541),s=r(959);t.exports=function(t,e){if(!a(t)||!s(e))throw new o("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(t)+i(e)}},3567:function(t,e,r){"use strict";var n=r(1874),o=Math.floor;t.exports=function(t){return"BigInt"===n(t)?t:o(t)}},5693:function(t,e,r){"use strict";var n=r(2870),o=r(3567),i=n("%TypeError%");t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-o(-t):o(t);return 0===e?0:e}},9572:function(t,e,r){"use strict";var n=r(2870)("%TypeError%");t.exports=function(t,e){if(null==t)throw new n(e||"Cannot call method on "+t);return t}},6101:function(t){"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},6740:function(t,e,r){"use strict";t.exports=r(2870)},2860:function(t,e,r){"use strict";var n=r(229),o=r(2870),i=n()&&o("%Object.defineProperty%",!0),a=n.hasArrayLengthDefineBug(),s=a&&r(2403),c=r(3099)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,o,u){if(!i){if(!t(u))return!1;if(!u["[[Configurable]]"]||!u["[[Writable]]"])return!1;if(o in n&&c(n,o)!==!!u["[[Enumerable]]"])return!1;var l=u["[[Value]]"];return n[o]=l,e(n[o],l)}return a&&"length"===o&&"[[Value]]"in u&&s(n)&&n.length!==u["[[Value]]"]?(n.length=u["[[Value]]"],n.length===u["[[Value]]"]):(i(n,o,r(u)),!0)}},2403:function(t,e,r){"use strict";var n=r(2870)("%Array%"),o=!n.isArray&&r(3099)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},1489:function(t,e,r){"use strict";var n=r(2870),o=n("%TypeError%"),i=n("%SyntaxError%"),a=r(9545),s=r(2990),c={"Property Descriptor":function(t){var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!t)return!1;for(var r in t)if(a(t,r)&&!e[r])return!1;var n=a(t,"[[Value]]"),i=a(t,"[[Get]]")||a(t,"[[Set]]");if(n&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":r(900),"Iterator Record":function(t){return a(t,"[[Iterator]]")&&a(t,"[[NextMethod]]")&&a(t,"[[Done]]")},"PromiseCapability Record":function(t){return!!t&&a(t,"[[Resolve]]")&&"function"==typeof t["[[Resolve]]"]&&a(t,"[[Reject]]")&&"function"==typeof t["[[Reject]]"]&&a(t,"[[Promise]]")&&t["[[Promise]]"]&&"function"==typeof t["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(t){return!!t&&a(t,"[[Completion]]")&&a(t,"[[Capability]]")&&c["PromiseCapability Record"](t["[[Capability]]"])},"RegExp Record":function(t){return t&&a(t,"[[IgnoreCase]]")&&"boolean"==typeof t["[[IgnoreCase]]"]&&a(t,"[[Multiline]]")&&"boolean"==typeof t["[[Multiline]]"]&&a(t,"[[DotAll]]")&&"boolean"==typeof t["[[DotAll]]"]&&a(t,"[[Unicode]]")&&"boolean"==typeof t["[[Unicode]]"]&&a(t,"[[CapturingGroupsCount]]")&&"number"==typeof t["[[CapturingGroupsCount]]"]&&s(t["[[CapturingGroupsCount]]"])&&t["[[CapturingGroupsCount]]"]>=0}};t.exports=function(t,e,r,n){var a=c[e];if("function"!=typeof a)throw new i("unknown record type: "+e);if("Object"!==t(n)||!a(n))throw new o(r+" must be a "+e)}},7735:function(t){"use strict";t.exports=function(t,e){for(var r=0;r=55296&&t<=56319}},900:function(t,e,r){"use strict";var n=r(9545);t.exports=function(t){return n(t,"[[StartIndex]]")&&n(t,"[[EndIndex]]")&&t["[[StartIndex]]"]>=0&&t["[[EndIndex]]"]>=t["[[StartIndex]]"]&&String(parseInt(t["[[StartIndex]]"],10))===String(t["[[StartIndex]]"])&&String(parseInt(t["[[EndIndex]]"],10))===String(t["[[EndIndex]]"])}},159:function(t){"use strict";t.exports=Number.isNaN||function(t){return t!=t}},8606:function(t){"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},7999:function(t,e,r){"use strict";var n=r(2870),o=r(9545),i=n("%TypeError%");t.exports=function(t,e){if("Object"!==t.Type(e))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(o(e,n)&&!r[n])return!1;if(t.IsDataDescriptor(e)&&t.IsAccessorDescriptor(e))throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}},959:function(t){"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},5674:function(t){"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";const t=!1;function e(...e){t&&console.log(...e)}function n(t,e){return{bottom:t.bottom/e,height:t.height/e,left:t.left/e,right:t.right/e,top:t.top/e,width:t.width/e}}function o(t){return{width:t.width,height:t.height,left:t.left,top:t.top,right:t.right,bottom:t.bottom}}function i(t,r){const n=t.getClientRects(),o=[];for(const t of n)o.push({bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width});const i=l(function(t,r){const n=new Set(t);for(const r of t)if(r.width>1&&r.height>1){for(const o of t)if(r!==o&&n.has(o)&&c(o,r,1)){e("CLIENT RECT: remove contained"),n.delete(r);break}}else e("CLIENT RECT: remove tiny"),n.delete(r);return Array.from(n)}(a(o,1,r)));for(let t=i.length-1;t>=0;t--){const r=i[t];if(!(r.width*r.height>4)){if(!(i.length>1)){e("CLIENT RECT: remove small, but keep otherwise empty!");break}e("CLIENT RECT: remove small"),i.splice(t,1)}}return e(`CLIENT RECT: reduced ${o.length} --\x3e ${i.length}`),i}function a(t,r,n){for(let o=0;ot!==c&&t!==u)),i=s(c,u);return o.push(i),a(o,r,n)}}return t}function s(t,e){const r=Math.min(t.left,e.left),n=Math.max(t.right,e.right),o=Math.min(t.top,e.top),i=Math.max(t.bottom,e.bottom);return{bottom:i,height:i-o,left:r,right:n,top:o,width:n-r}}function c(t,e,r){return u(t,e.left,e.top,r)&&u(t,e.right,e.top,r)&&u(t,e.left,e.bottom,r)&&u(t,e.right,e.bottom,r)}function u(t,e,r,n){return(t.lefte||y(t.right,e,n))&&(t.topr||y(t.bottom,r,n))}function l(t){for(let r=0;rt!==r));return Array.prototype.push.apply(s,n),l(s)}}else e("replaceOverlapingRects rect1 === rect2 ??!")}return t}function f(t,e){const r=function(t,e){const r=Math.max(t.left,e.left),n=Math.min(t.right,e.right),o=Math.max(t.top,e.top),i=Math.min(t.bottom,e.bottom);return{bottom:i,height:Math.max(0,i-o),left:r,right:n,top:o,width:Math.max(0,n-r)}}(e,t);if(0===r.height||0===r.width)return[t];const n=[];{const e={bottom:t.bottom,height:0,left:t.left,right:r.left,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:r.top,height:0,left:r.left,right:r.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.left,right:r.right,top:r.bottom,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.right,right:t.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}return n}function p(t,e,r){return(t.left=0&&y(t.left,e.right,r))&&(e.left=0&&y(e.left,t.right,r))&&(t.top=0&&y(t.top,e.bottom,r))&&(e.top=0&&y(e.top,t.bottom,r))}function y(t,e,r){return Math.abs(t-e)<=r}var h,g,d=r(1844);function b(t,e,r){let n=0;const o=[];for(;-1!==n;)n=t.indexOf(e,n),-1!==n&&(o.push({start:n,end:n+e.length,errors:0}),n+=1);return o.length>0?o:(0,d.Z)(t,e,r)}function m(t,e){return 0===e.length||0===t.length?0:1-b(t,e,e.length)[0].errors/e.length}function w(t,e,r){const n=r===h.Forwards?e:e-1;if(""!==t.charAt(n).trim())return e;let o,i;if(r===h.Backwards?(o=t.substring(0,e),i=o.trimEnd()):(o=t.substring(e),i=o.trimStart()),!i.length)return-1;const a=o.length-i.length;return r===h.Backwards?e-a:e+a}function v(t,e){const r=t.commonAncestorContainer.ownerDocument.createNodeIterator(t.commonAncestorContainer,NodeFilter.SHOW_TEXT),n=e===h.Forwards?t.startContainer:t.endContainer,o=e===h.Forwards?t.endContainer:t.startContainer;let i=r.nextNode();for(;i&&i!==n;)i=r.nextNode();e===h.Backwards&&(i=r.previousNode());let a=-1;const s=()=>{if(i=e===h.Forwards?r.nextNode():r.previousNode(),i){const t=i.textContent,r=e===h.Forwards?0:t.length;a=w(t,r,e)}};for(;i&&-1===a&&i!==o;)s();if(i&&a>=0)return{node:i,offset:a};throw new RangeError("No text nodes with non-whitespace text found in range")}function x(t){var e,r;switch(t.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return null!==(r=null===(e=t.textContent)||void 0===e?void 0:e.length)&&void 0!==r?r:0;default:return 0}}function S(t){let e=t.previousSibling,r=0;for(;e;)r+=x(e),e=e.previousSibling;return r}function E(t,...e){let r=e.shift();const n=t.ownerDocument.createNodeIterator(t,NodeFilter.SHOW_TEXT),o=[];let i,a=n.nextNode(),s=0;for(;void 0!==r&&a;)i=a,s+i.data.length>r?(o.push({node:i,offset:r-s}),r=e.shift()):(a=n.nextNode(),s+=i.data.length);for(;void 0!==r&&i&&s===r;)o.push({node:i,offset:i.data.length}),r=e.shift();if(void 0!==r)throw new RangeError("Offset exceeds text length");return o}!function(t){t[t.Forwards=1]="Forwards",t[t.Backwards=2]="Backwards"}(h||(h={})),function(t){t[t.FORWARDS=1]="FORWARDS",t[t.BACKWARDS=2]="BACKWARDS"}(g||(g={}));class A{constructor(t,e){if(e<0)throw new Error("Offset is invalid");this.element=t,this.offset=e}relativeTo(t){if(!t.contains(this.element))throw new Error("Parent is not an ancestor of current element");let e=this.element,r=this.offset;for(;e!==t;)r+=S(e),e=e.parentElement;return new A(e,r)}resolve(t={}){try{return E(this.element,this.offset)[0]}catch(e){if(0===this.offset&&void 0!==t.direction){const r=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);r.currentNode=this.element;const n=t.direction===g.FORWARDS,o=n?r.nextNode():r.previousNode();if(!o)throw e;return{node:o,offset:n?0:o.data.length}}throw e}}static fromCharOffset(t,e){switch(t.nodeType){case Node.TEXT_NODE:return A.fromPoint(t,e);case Node.ELEMENT_NODE:return new A(t,e);default:throw new Error("Node is not an element or text node")}}static fromPoint(t,e){switch(t.nodeType){case Node.TEXT_NODE:{if(e<0||e>t.data.length)throw new Error("Text node offset is out of range");if(!t.parentElement)throw new Error("Text node has no parent");const r=S(t)+e;return new A(t.parentElement,r)}case Node.ELEMENT_NODE:{if(e<0||e>t.childNodes.length)throw new Error("Child node offset is out of range");let r=0;for(let n=0;n=0&&(e.setStart(t.startContainer,o.start),r=!0),o.end>0&&(e.setEnd(t.endContainer,o.end),n=!0),r&&n)return e;if(!r){const{node:t,offset:r}=v(e,h.Forwards);t&&r>=0&&e.setStart(t,r)}if(!n){const{node:t,offset:r}=v(e,h.Backwards);t&&r>0&&e.setEnd(t,r)}return e}(O.fromRange(t).toRange())}}class j{constructor(t,e,r){this.root=t,this.start=e,this.end=r}static fromRange(t,e){const r=O.fromRange(e).relativeTo(t);return new j(t,r.start.offset,r.end.offset)}static fromSelector(t,e){return new j(t,e.start,e.end)}toSelector(){return{type:"TextPositionSelector",start:this.start,end:this.end}}toRange(){return O.fromOffsets(this.root,this.start,this.end).toRange()}}class P{constructor(t,e,r={}){this.root=t,this.exact=e,this.context=r}static fromRange(t,e){const r=t.textContent,n=O.fromRange(e).relativeTo(t),o=n.start.offset,i=n.end.offset;return new P(t,r.slice(o,i),{prefix:r.slice(Math.max(0,o-32),o),suffix:r.slice(i,Math.min(r.length,i+32))})}static fromSelector(t,e){const{prefix:r,suffix:n}=e;return new P(t,e.exact,{prefix:r,suffix:n})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(t={}){return this.toPositionAnchor(t).toRange()}toPositionAnchor(t={}){const e=function(t,e,r={}){if(0===e.length)return null;const n=Math.min(256,e.length/2),o=b(t,e,n);if(0===o.length)return null;const i=n=>{const o=1-n.errors/e.length,i=r.prefix?m(t.slice(Math.max(0,n.start-r.prefix.length),n.start),r.prefix):1,a=r.suffix?m(t.slice(n.end,n.end+r.suffix.length),r.suffix):1;let s=1;return"number"==typeof r.hint&&(s=1-Math.abs(n.start-r.hint)/t.length),(50*o+20*i+20*a+2*s)/92},a=o.map((t=>({start:t.start,end:t.end,score:i(t)})));return a.sort(((t,e)=>e.score-t.score)),a[0]}(this.root.textContent,this.exact,Object.assign(Object.assign({},this.context),{hint:t.hint}));if(!e)throw new Error("Quote not found");return new j(this.root,e.start,e.end)}}class R{constructor(t,e,r){this.items=[],this.lastItemId=0,this.container=null,this.groupId=t,this.groupName=e,this.styles=r}add(t){const r=this.groupId+"-"+this.lastItemId++,n=function(t,r){let n;if(t)try{n=document.querySelector(t)}catch(t){e(t)}if(!n&&!r)return null;if(n||(n=document.body),r)return new P(n,r.quotedText,{prefix:r.textBefore,suffix:r.textAfter}).toRange();{const t=document.createRange();return t.setStartBefore(n),t.setEndAfter(n),t}}(t.cssSelector,t.textQuote);if(!n)return void e("Can't locate DOM range for decoration",t);const o={id:r,decoration:t,range:n,container:null,clickableElements:null};this.items.push(o),this.layout(o)}remove(t){const e=this.items.findIndex((e=>e.decoration.id===t));if(-1===e)return;const r=this.items[e];this.items.splice(e,1),r.clickableElements=null,r.container&&(r.container.remove(),r.container=null)}relayout(){this.clearContainer();for(const t of this.items)this.layout(t)}requireContainer(){return this.container||(this.container=document.createElement("div"),this.container.id=this.groupId,this.container.dataset.group=this.groupName,this.container.style.pointerEvents="none",document.body.append(this.container)),this.container}clearContainer(){this.container&&(this.container.remove(),this.container=null)}layout(t){const e=this.requireContainer(),r=this.styles.get(t.decoration.style);if(!r)return void console.log(`Unknown decoration style: ${t.decoration.style}`);const o=r,a=document.createElement("div");a.id=t.id,a.dataset.style=t.decoration.style,a.style.pointerEvents="none";const s=getComputedStyle(document.body).writingMode,c="vertical-rl"===s||"vertical-lr"===s,u=e.currentCSSZoom,l=document.scrollingElement,f=l.scrollLeft/u,p=l.scrollTop/u,y=c?window.innerHeight:window.innerWidth,h=c?window.innerWidth:window.innerHeight,g=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count"))||1,d=(c?h:y)/g;function b(t,e,r,n){t.style.position="absolute";const i="vertical-rl"===n;if(i||"vertical-lr"===n){if("wrap"===o.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,i?t.style.right=`${-e.right-f+l.clientWidth}px`:t.style.left=`${e.left+f}px`,t.style.top=`${e.top+p}px`;else if("viewport"===o.width){t.style.width=`${e.height}px`,t.style.height=`${y}px`;const r=Math.floor(e.top/y)*y;i?t.style.right=-e.right-f+"px":t.style.left=`${e.left+f}px`,t.style.top=`${r+p}px`}else if("bounds"===o.width)t.style.width=`${r.height}px`,t.style.height=`${y}px`,i?t.style.right=`${-r.right-f+l.clientWidth}px`:t.style.left=`${r.left+f}px`,t.style.top=`${r.top+p}px`;else if("page"===o.width){t.style.width=`${e.height}px`,t.style.height=`${d}px`;const r=Math.floor(e.top/d)*d;i?t.style.right=`${-e.right-f+l.clientWidth}px`:t.style.left=`${e.left+f}px`,t.style.top=`${r+p}px`}}else if("wrap"===o.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.left=`${e.left+f}px`,t.style.top=`${e.top+p}px`;else if("viewport"===o.width){t.style.width=`${y}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/y)*y;t.style.left=`${r+f}px`,t.style.top=`${e.top+p}px`}else if("bounds"===o.width)t.style.width=`${r.width}px`,t.style.height=`${e.height}px`,t.style.left=`${r.left+f}px`,t.style.top=`${e.top+p}px`;else if("page"===o.width){t.style.width=`${d}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/d)*d;t.style.left=`${r+f}px`,t.style.top=`${e.top+p}px`}}const m=(w=t.range.getBoundingClientRect(),v=u,new DOMRect(w.x/v,w.y/v,w.width/v,w.height/v));var w,v;let x;try{const e=document.createElement("template");e.innerHTML=t.decoration.element.trim(),x=e.content.firstElementChild}catch(e){let r;return r="message"in e?e.message:null,void console.log(`Invalid decoration element "${t.decoration.element}": ${r}`)}if("boxes"===o.layout){const e=!s.startsWith("vertical"),r=(S=t.range.startContainer).nodeType===Node.ELEMENT_NODE?S:S.parentElement,o=getComputedStyle(r).writingMode,c=i(t.range,e).map((t=>n(t,u))).sort(((t,e)=>t.top!==e.top?t.top-e.top:"vertical-rl"===o?e.left-t.left:t.left-e.left));for(const t of c){const e=x.cloneNode(!0);e.style.pointerEvents="none",e.dataset.writingMode=o,b(e,t,m,s),a.append(e)}}else if("bounds"===o.layout){const t=x.cloneNode(!0);t.style.pointerEvents="none",t.dataset.writingMode=s,b(t,m,m,s),a.append(t)}var S;e.append(a),t.container=a,t.clickableElements=Array.from(a.querySelectorAll("[data-activable='1']")),0===t.clickableElements.length&&(t.clickableElements=Array.from(a.children))}}var C=r(5155);r.n(C)().shim();class T{constructor(t,e){this.decorationManager=e,t.onmessage=t=>{this.onCommand(t.data)}}onCommand(t){switch(t.kind){case"registerTemplates":return this.registerTemplates(t.templates);case"addDecoration":return this.addDecoration(t.decoration,t.group);case"removeDecoration":return this.removeDecoration(t.id,t.group)}}registerTemplates(t){this.decorationManager.registerTemplates(t)}addDecoration(t,e){this.decorationManager.addDecoration(t,e)}removeDecoration(t,e){this.decorationManager.removeDecoration(t,e)}}class I{constructor(t){this.messagePort=t}send(t){this.messagePort.postMessage(t)}}class M{constructor(t,e){this.selectionManager=e,this.messagePort=t,t.onmessage=t=>{this.onCommand(t.data)}}onCommand(t){switch(t.kind){case"requestSelection":return this.onRequestSelection(t.requestId);case"clearSelection":return this.onClearSelection()}}onRequestSelection(t){const e={kind:"selectionAvailable",requestId:t,selection:this.selectionManager.getCurrentSelection()};this.sendFeedback(e)}onClearSelection(){this.selectionManager.clearSelection()}sendFeedback(t){this.messagePort.postMessage(t)}}const $=new class{constructor(t){this.window=t}initAreaManager(){const t=this.initChannel("InitAreaManager");return new I(t)}initSelection(t){const e=this.initChannel("InitSelection");new M(e,t)}initDecorations(t){const e=this.initChannel("InitDecorations");new T(e,t)}initChannel(t){const e=new MessageChannel;return this.window.parent.postMessage(t,"*",[e.port2]),e.port1}}(window),D=$.initAreaManager(),N=new class{constructor(t){this.isSelecting=!1,this.window=t}clearSelection(){var t;null===(t=this.window.getSelection())||void 0===t||t.removeAllRanges()}getCurrentSelection(){const t=this.getCurrentSelectionText();if(!t)return null;const e=this.getSelectionRect();return{selectedText:t.highlight,textBefore:t.before,textAfter:t.after,selectionRect:e}}getSelectionRect(){try{const t=this.window.getSelection().getRangeAt(0),e=this.window.document.body.currentCSSZoom;return n(o(t.getBoundingClientRect()),e)}catch(t){throw e(t),t}}getCurrentSelectionText(){const t=this.window.getSelection();if(t.isCollapsed)return;const r=t.toString();if(0===r.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!t.anchorNode||!t.focusNode)return;const n=1===t.rangeCount?t.getRangeAt(0):function(t,r,n,o){const i=new Range;if(i.setStart(t,r),i.setEnd(n,o),!i.collapsed)return i;e(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const a=new Range;if(a.setStart(n,o),a.setEnd(t,r),!a.collapsed)return e(">>> createOrderedRange RANGE REVERSE OK."),i;e(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset);if(!n||n.collapsed)return void e("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const o=document.body.textContent,i=O.fromRange(n).relativeTo(document.body),a=i.start.offset,s=i.end.offset;let c=o.slice(Math.max(0,a-200),a);const u=c.search(/\P{L}\p{L}/gu);-1!==u&&(c=c.slice(u+1));let l=o.slice(s,Math.min(o.length,s+200));const f=Array.from(l.matchAll(/\p{L}\P{L}/gu)).pop();return void 0!==f&&f.index>1&&(l=l.slice(0,f.index+1)),{highlight:r,before:c,after:l}}}(window);$.initSelection(N);const F=new class{constructor(t){this.styles=new Map,this.groups=new Map,this.lastGroupId=0,this.window=t,t.addEventListener("load",(()=>{const e=t.document.body;let r={width:0,height:0};new ResizeObserver((()=>{requestAnimationFrame((()=>{r.width===e.clientWidth&&r.height===e.clientHeight||(r={width:e.clientWidth,height:e.clientHeight},this.relayoutDecorations())}))})).observe(e)}),!1)}registerTemplates(t){let e="";for(const[r,n]of t)this.styles.set(r,n),n.stylesheet&&(e+=n.stylesheet+"\n");if(e){const t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}}addDecoration(t,e){console.log(`addDecoration ${t.id} ${e}`),this.getGroup(e).add(t)}removeDecoration(t,e){console.log(`removeDecoration ${t} ${e}`),this.getGroup(e).remove(t)}relayoutDecorations(){console.log("relayoutDecorations");for(const t of this.groups.values())t.relayout()}getGroup(t){let e=this.groups.get(t);if(!e){const r="readium-decoration-"+this.lastGroupId++;e=new R(r,t,this.styles),this.groups.set(t,e)}return e}handleDecorationClickEvent(t){if(0===this.groups.size)return null;const e=(()=>{for(const[e,r]of this.groups)for(const n of r.items.reverse())if(n.clickableElements)for(const r of n.clickableElements)if(u(o(r.getBoundingClientRect()),t.clientX,t.clientY,1))return{group:e,item:n,element:r}})();return e?{id:e.item.decoration.id,group:e.group,rect:o(e.item.range.getBoundingClientRect()),event:t}:null}}(window);$.initDecorations(F);const k=function(t){const e=window.document.querySelector("meta[name=viewport]");if(e&&e instanceof HTMLMetaElement)return function(t){const e=/(\w+) *= *([^\s,]+)/g,r=new Map;let n;for(;n=e.exec(t);)null!=n&&r.set(n[1],n[2]);const o=parseFloat(r.get("width")),i=parseFloat(r.get("height"));return o&&i?{width:o,height:i}:void 0}(e.content)}();D.send({kind:"contentSize",size:k});const B=new class{constructor(t){this.messageSender=t}onTap(t){const e={offset:{x:t.clientX,y:t.clientY}};this.messageSender.send({kind:"tap",event:e})}onLinkActivated(t,e){this.messageSender.send({kind:"linkActivated",href:t,outerHtml:e})}onDecorationActivated(t){const e={id:t.id,group:t.group,rect:t.rect,offset:{x:t.event.clientX,y:t.event.clientY}};this.messageSender.send({kind:"decorationActivated",event:e})}}(D);new class{constructor(t,e,r){this.window=t,this.listener=e,this.decorationManager=r,document.addEventListener("click",(t=>{this.onClick(t)}),!1)}onClick(t){if(t.defaultPrevented)return;const e=this.window.getSelection();if(e&&"Range"==e.type)return;let r,n;if(r=t.target instanceof HTMLElement?this.nearestInteractiveElement(t.target):null,r){if(!(r instanceof HTMLAnchorElement))return;this.listener.onLinkActivated(r.href,r.outerHTML),t.stopPropagation(),t.preventDefault()}n=this.decorationManager?this.decorationManager.handleDecorationClickEvent(t):null,n?this.listener.onDecorationActivated(n):this.listener.onTap(t)}nearestInteractiveElement(t){return null==t?null:-1!=["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(t.nodeName.toLowerCase())||t.hasAttribute("contenteditable")&&"false"!=t.getAttribute("contenteditable").toLowerCase()?t:t.parentElement?this.nearestInteractiveElement(t.parentElement):null}}(window,B,F)}()}(); +!function(){var t={1844:function(t,e){"use strict";function r(t){return t.split("").reverse().join("")}function n(t){return(t|-t)>>31&1}function o(t,e,r,o){var i=t.P[r],a=t.M[r],s=o>>>31,c=e[r]|s,u=c|a,l=(c&i)+i^i|c,f=a|~(l|i),p=i&l,y=n(f&t.lastRowMask[r])-n(p&t.lastRowMask[r]);return f<<=1,p<<=1,i=(p|=s)|~(u|(f|=n(o)-s)),a=f&u,t.P[r]=i,t.M[r]=a,y}function i(t,e,r){if(0===e.length)return[];r=Math.min(r,e.length);var n=[],i=32,a=Math.ceil(e.length/i)-1,s={P:new Uint32Array(a+1),M:new Uint32Array(a+1),lastRowMask:new Uint32Array(a+1)};s.lastRowMask.fill(1<<31),s.lastRowMask[a]=1<<(e.length-1)%i;for(var c=new Uint32Array(a+1),u=new Map,l=[],f=0;f<256;f++)l.push(c);for(var p=0;p=e.length||e.charCodeAt(b)===y&&(h[g]|=1<0&&w[m]>=r+i;)m-=1;m===a&&w[m]<=r&&(w[m]-1?o(r):r}},2755:function(t,e,r){"use strict";var n=r(3569),o=r(2870),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||n.call(a,i),c=o("%Object.getOwnPropertyDescriptor%",!0),u=o("%Object.defineProperty%",!0),l=o("%Math.max%");if(u)try{u({},"a",{value:1})}catch(t){u=null}t.exports=function(t){var e=s(n,a,arguments);return c&&u&&c(e,"length").configurable&&u(e,"length",{value:1+l(0,t.length-(arguments.length-1))}),e};var f=function(){return s(n,i,arguments)};u?u(t.exports,"apply",{value:f}):t.exports.apply=f},6663:function(t,e,r){"use strict";var n=r(229)(),o=r(2870),i=n&&o("%Object.defineProperty%",!0),a=o("%SyntaxError%"),s=o("%TypeError%"),c=r(658);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new s("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new s("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new s("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!c&&c(t,e);if(i)i(t,e,{configurable:null===u&&f?f.configurable:!u,enumerable:null===n&&f?f.enumerable:!n,value:r,writable:null===o&&f?f.writable:!o});else{if(!l&&(n||o||u))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},9722:function(t,e,r){"use strict";var n=r(2051),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,s=r(6663),c=r(229)(),u=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;c?s(t,e,r,!0):s(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var s=0;s2&&arguments[2]&&arguments[2].force;!a||!r&&i(t,a)||(n?n(t,a,{configurable:!0,enumerable:!1,value:e,writable:!1}):t[a]=e)}},7358:function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(7959),i=r(3655),a=r(455),s=r(8760);t.exports=function(t){if(o(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!i(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):s(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(o(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(a(t)||s(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,a,s="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a1&&"boolean"!=typeof e)throw new a('"allowMissing" argument must be a boolean');if(null===j(/^%?[^%]*%?$/,t))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=O(t,0,1),r=O(t,-1);if("%"===e&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return A(t,P,(function(t,e,r,o){n[n.length]=r?A(o,R,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=C("%"+n+"%",e),s=i.name,u=i.value,l=!1,f=i.alias;f&&(n=f[0],E(r,S([0,1],f)));for(var p=1,y=!0;p=r.length){var m=c(u,h);u=(y=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:u[h]}else y=x(u,h),u=u[h];y&&!l&&(d[s]=u)}}return u}},658:function(t,e,r){"use strict";var n=r(2870)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},229:function(t,e,r){"use strict";var n=r(2870)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},3413:function(t){"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},1143:function(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(9985);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},9985:function(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},3060:function(t,e,r){"use strict";var n=r(9985);t.exports=function(){return n()&&!!Symbol.toStringTag}},9545:function(t){"use strict";var e={}.hasOwnProperty,r=Function.prototype.call;t.exports=r.bind?r.bind(e):function(t,n){return r.call(e,t,n)}},7284:function(t,e,r){"use strict";var n=r(2870),o=r(9545),i=r(5714)(),a=n("%TypeError%"),s={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");if(i.assert(t),!s.has(t,e))throw new a("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");var r=i.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");var r=i.get(t);return!!r&&o(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");var n=i.get(t);n||(n={},i.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(s),t.exports=s},3655:function(t){"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},s=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;c.call(p)===c.call(document.all)&&(f=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&s(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(u)return s(t);if(a(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&s(t)}},455:function(t,e,r){"use strict";var n=Date.prototype.getDay,o=Object.prototype.toString,i=r(3060)();t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},5494:function(t,e,r){"use strict";var n,o,i,a,s=r(3099),c=r(3060)();if(c){n=s("Object.prototype.hasOwnProperty"),o=s("RegExp.prototype.exec"),i={};var u=function(){throw i};a={toString:u,valueOf:u},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=u)}var l=s("Object.prototype.toString"),f=Object.getOwnPropertyDescriptor;t.exports=c?function(t){if(!t||"object"!=typeof t)return!1;var e=f(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{o(t,a)}catch(t){return t===i}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},8760:function(t,e,r){"use strict";var n=Object.prototype.toString;if(r(1143)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},4538:function(t,e,r){var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=s&&c&&"function"==typeof c.get?c.get:null,l=s&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,g=Object.prototype.toString,d=Function.prototype.toString,b=String.prototype.match,m=String.prototype.slice,w=String.prototype.replace,v=String.prototype.toUpperCase,x=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,O=Array.prototype.slice,j=Math.floor,P="function"==typeof BigInt?BigInt.prototype.valueOf:null,R=Object.getOwnPropertySymbols,C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,T="function"==typeof Symbol&&"object"==typeof Symbol.iterator,I="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,M=Object.prototype.propertyIsEnumerable,$=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function D(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||S.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-j(-t):j(t);if(n!==t){var o=String(n),i=m.call(e,o.length+1);return w.call(o,r,"$&_")+"."+w.call(w.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return w.call(e,r,"$&_")}var N=r(7002),F=N.custom,k=_(F)?F:null;function B(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function W(t){return w.call(String(t),/"/g,""")}function L(t){return!("[object Array]"!==H(t)||I&&"object"==typeof t&&I in t)}function U(t){return!("[object RegExp]"!==H(t)||I&&"object"==typeof t&&I in t)}function _(t){if(T)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!C)return!1;try{return C.call(t),!0}catch(t){}return!1}t.exports=function t(e,r,n,o){var s=r||{};if(q(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(q(s,"maxStringLength")&&("number"==typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=!q(s,"customInspect")||s.customInspect;if("boolean"!=typeof c&&"symbol"!==c)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(q(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(q(s,"numericSeparator")&&"boolean"!=typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var g=s.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return X(e,s);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var v=String(e);return g?D(e,v):v}if("bigint"==typeof e){var S=String(e)+"n";return g?D(e,S):S}var j=void 0===s.depth?5:s.depth;if(void 0===n&&(n=0),n>=j&&j>0&&"object"==typeof e)return L(e)?"[Array]":"[Object]";var R,F=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=A.call(Array(t.indent+1)," ")}return{base:r,prev:A.call(Array(e+1),r)}}(s,n);if(void 0===o)o=[];else if(V(o,e)>=0)return"[Circular]";function G(e,r,i){if(r&&(o=O.call(o)).push(r),i){var a={depth:s.depth};return q(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),t(e,a,n+1,o)}return t(e,s,n+1,o)}if("function"==typeof e&&!U(e)){var z=function(t){if(t.name)return t.name;var e=b.call(d.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),tt=Q(e,G);return"[Function"+(z?": "+z:" (anonymous)")+"]"+(tt.length>0?" { "+A.call(tt,", ")+" }":"")}if(_(e)){var et=T?w.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):C.call(e);return"object"!=typeof e||T?et:K(et)}if((R=e)&&"object"==typeof R&&("undefined"!=typeof HTMLElement&&R instanceof HTMLElement||"string"==typeof R.nodeName&&"function"==typeof R.getAttribute)){for(var rt="<"+x.call(String(e.nodeName)),nt=e.attributes||[],ot=0;ot"}if(L(e)){if(0===e.length)return"[]";var it=Q(e,G);return F&&!function(t){for(var e=0;e=0)return!1;return!0}(it)?"["+Z(it,F)+"]":"[ "+A.call(it,", ")+" ]"}if(function(t){return!("[object Error]"!==H(t)||I&&"object"==typeof t&&I in t)}(e)){var at=Q(e,G);return"cause"in Error.prototype||!("cause"in e)||M.call(e,"cause")?0===at.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(at,", ")+" }":"{ ["+String(e)+"] "+A.call(E.call("[cause]: "+G(e.cause),at),", ")+" }"}if("object"==typeof e&&c){if(k&&"function"==typeof e[k]&&N)return N(e,{depth:j-n});if("symbol"!==c&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{u.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var st=[];return a&&a.call(e,(function(t,r){st.push(G(r,e,!0)+" => "+G(t,e))})),Y("Map",i.call(e),st,F)}if(function(t){if(!u||!t||"object"!=typeof t)return!1;try{u.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ct=[];return l&&l.call(e,(function(t){ct.push(G(t,e))})),Y("Set",u.call(e),ct,F)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return J("WeakMap");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return J("WeakSet");if(function(t){if(!y||!t||"object"!=typeof t)return!1;try{return y.call(t),!0}catch(t){}return!1}(e))return J("WeakRef");if(function(t){return!("[object Number]"!==H(t)||I&&"object"==typeof t&&I in t)}(e))return K(G(Number(e)));if(function(t){if(!t||"object"!=typeof t||!P)return!1;try{return P.call(t),!0}catch(t){}return!1}(e))return K(G(P.call(e)));if(function(t){return!("[object Boolean]"!==H(t)||I&&"object"==typeof t&&I in t)}(e))return K(h.call(e));if(function(t){return!("[object String]"!==H(t)||I&&"object"==typeof t&&I in t)}(e))return K(G(String(e)));if(!function(t){return!("[object Date]"!==H(t)||I&&"object"==typeof t&&I in t)}(e)&&!U(e)){var ut=Q(e,G),lt=$?$(e)===Object.prototype:e instanceof Object||e.constructor===Object,ft=e instanceof Object?"":"null prototype",pt=!lt&&I&&Object(e)===e&&I in e?m.call(H(e),8,-1):ft?"Object":"",yt=(lt||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(pt||ft?"["+A.call(E.call([],pt||[],ft||[]),": ")+"] ":"");return 0===ut.length?yt+"{}":F?yt+"{"+Z(ut,F)+"}":yt+"{ "+A.call(ut,", ")+" }"}return String(e)};var G=Object.prototype.hasOwnProperty||function(t){return t in this};function q(t,e){return G.call(t,e)}function H(t){return g.call(t)}function V(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return X(m.call(t,0,e.maxStringLength),e)+n}return B(w.call(w.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,z),"single",e)}function z(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+v.call(e.toString(16))}function K(t){return"Object("+t+")"}function J(t){return t+" { ? }"}function Y(t,e,r,n){return t+" ("+e+") {"+(n?Z(r,n):A.call(r,", "))+"}"}function Z(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+A.call(t,","+r)+"\n"+e.prev}function Q(t,e){var r=L(t),n=[];if(r){n.length=t.length;for(var o=0;o0&&!o.call(t,0))for(var g=0;g0)for(var d=0;d=0&&"[object Function]"===e.call(t.callee)),n}},9766:function(t,e,r){"use strict";var n=r(8921),o=Object,i=TypeError;t.exports=n((function(){if(null!=this&&this!==o(this))throw new i("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t}),"get flags",!0)},483:function(t,e,r){"use strict";var n=r(9722),o=r(2755),i=r(9766),a=r(5113),s=r(7299),c=o(a());n(c,{getPolyfill:a,implementation:i,shim:s}),t.exports=c},5113:function(t,e,r){"use strict";var n=r(9766),o=r(9722).supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(o&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}},7299:function(t,e,r){"use strict";var n=r(9722).supportsDescriptors,o=r(5113),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,s=TypeError,c=Object.getPrototypeOf,u=/a/;t.exports=function(){if(!n||!c)throw new s("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=c(u),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},7582:function(t,e,r){"use strict";var n=r(3099),o=r(2870),i=r(5494),a=n("RegExp.prototype.exec"),s=o("%TypeError%");t.exports=function(t){if(!i(t))throw new s("`regex` must be a RegExp");return function(e){return null!==a(t,e)}}},8921:function(t,e,r){"use strict";var n=r(6663),o=r(229)(),i=r(5610).functionsHaveConfigurableNames(),a=TypeError;t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!i||(o?n(t,"name",e,!0,!0):n(t,"name",e)),t}},5714:function(t,e,r){"use strict";var n=r(2870),o=r(3099),i=r(4538),a=n("%TypeError%"),s=n("%WeakMap%",!0),c=n("%Map%",!0),u=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),y=o("Map.prototype.set",!0),h=o("Map.prototype.has",!0),g=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new a("Side channel does not contain "+i(t))},get:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(t)return u(t,n)}else if(c){if(e)return p(e,n)}else if(r)return function(t,e){var r=g(t,e);return r&&r.value}(r,n)},has:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(t)return f(t,n)}else if(c){if(e)return h(e,n)}else if(r)return function(t,e){return!!g(t,e)}(r,n);return!1},set:function(n,o){s&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new s),l(t,n,o)):c?(e||(e=new c),y(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=g(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n}},3073:function(t,e,r){"use strict";var n=r(7113),o=r(151),i=r(1959),a=r(9497),s=r(5128),c=r(6751),u=r(3099),l=r(1143)(),f=r(483),p=u("String.prototype.indexOf"),y=r(2009),h=function(t){var e=y();if(l&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===RegExp.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=c(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(c(r),p(s(r),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var i=h(t);if(void 0!==i)return n(i,t,[e])}var u=s(e),l=new RegExp(t,"g");return n(h(l),l,[u])}},5155:function(t,e,r){"use strict";var n=r(2755),o=r(9722),i=r(3073),a=r(1794),s=r(3911),c=n(i);o(c,{getPolyfill:a,implementation:i,shim:s}),t.exports=c},2009:function(t,e,r){"use strict";var n=r(1143)(),o=r(8012);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},1794:function(t,e,r){"use strict";var n=r(3073);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},8012:function(t,e,r){"use strict";var n=r(1398),o=r(151),i=r(8322),a=r(2449),s=r(3995),c=r(5128),u=r(1874),l=r(483),f=r(8921),p=r(3099)("String.prototype.indexOf"),y=RegExp,h="flags"in RegExp.prototype,g=f((function(t){var e=this;if("Object"!==u(e))throw new TypeError('"this" value must be an Object');var r=c(t),f=function(t,e){var r="flags"in e?o(e,"flags"):c(l(e));return{flags:r,matcher:new t(h&&"string"==typeof r?e:t===y?e.source:e,r)}}(a(e,y),e),g=f.flags,d=f.matcher,b=s(o(e,"lastIndex"));i(d,"lastIndex",b,!0);var m=p(g,"g")>-1,w=p(g,"u")>-1;return n(d,r,m,w)}),"[Symbol.matchAll]",!0);t.exports=g},3911:function(t,e,r){"use strict";var n=r(9722),o=r(1143)(),i=r(1794),a=r(2009),s=Object.defineProperty,c=Object.getOwnPropertyDescriptor;t.exports=function(){var t=i();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),o){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),s&&c){var r=c(Symbol,e);r&&!r.configurable||s(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var u=a(),l={};l[e]=u;var f={};f[e]=function(){return RegExp.prototype[e]!==u},n(RegExp.prototype,l,f)}return t}},8125:function(t,e,r){"use strict";var n=r(6751),o=r(5128),i=r(3099)("String.prototype.replace"),a=/^\s$/.test("᠎"),s=a?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,c=a?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=o(n(this));return i(i(t,s,""),c,"")}},9434:function(t,e,r){"use strict";var n=r(2755),o=r(9722),i=r(6751),a=r(8125),s=r(3228),c=r(818),u=n(s()),l=function(t){return i(t),u(t)};o(l,{getPolyfill:s,implementation:a,shim:c}),t.exports=l},3228:function(t,e,r){"use strict";var n=r(8125);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},818:function(t,e,r){"use strict";var n=r(9722),o=r(3228);t.exports=function(){var t=o();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},7002:function(){},1510:function(t,e,r){"use strict";var n=r(2870),o=r(6318),i=r(1874),a=r(2990),s=r(5674),c=n("%TypeError%");t.exports=function(t,e,r){if("String"!==i(t))throw new c("Assertion failed: `S` must be a String");if(!a(e)||e<0||e>s)throw new c("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==i(r))throw new c("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+o(t,e)["[[CodeUnitCount]]"]:e+1}},7113:function(t,e,r){"use strict";var n=r(2870),o=r(3099),i=n("%TypeError%"),a=r(6287),s=n("%Reflect.apply%",!0)||o("Function.prototype.apply");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!a(r))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return s(t,e,r)}},6318:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(3099),i=r(5541),a=r(959),s=r(1874),c=r(1751),u=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("String"!==s(t))throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var o=l(t,e),f=u(t,e),p=i(o),y=a(o);if(!p&&!y)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(y||e+1===r)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var h=l(t,e+1);return a(h)?{"[[CodePoint]]":c(o,h),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},5702:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(1874);t.exports=function(t,e){if("Boolean"!==o(e))throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},6782:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(2860),i=r(8357),a=r(3301),s=r(6284),c=r(8277),u=r(1874);t.exports=function(t,e,r){if("Object"!==u(t))throw new n("Assertion failed: Type(O) is not Object");if(!s(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return o(a,c,i,t,e,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0})}},1398:function(t,e,r){"use strict";var n=r(2870),o=r(1143)(),i=n("%TypeError%"),a=n("%IteratorPrototype%",!0),s=r(1510),c=r(5702),u=r(6782),l=r(151),f=r(5716),p=r(3500),y=r(8322),h=r(3995),g=r(5128),d=r(1874),b=r(7284),m=r(2263),w=function(t,e,r,n){if("String"!==d(e))throw new i("`S` must be a string");if("Boolean"!==d(r))throw new i("`global` must be a boolean");if("Boolean"!==d(n))throw new i("`fullUnicode` must be a boolean");b.set(this,"[[IteratingRegExp]]",t),b.set(this,"[[IteratedString]]",e),b.set(this,"[[Global]]",r),b.set(this,"[[Unicode]]",n),b.set(this,"[[Done]]",!1)};a&&(w.prototype=f(a)),u(w.prototype,"next",(function(){var t=this;if("Object"!==d(t))throw new i("receiver must be an object");if(!(t instanceof w&&b.has(t,"[[IteratingRegExp]]")&&b.has(t,"[[IteratedString]]")&&b.has(t,"[[Global]]")&&b.has(t,"[[Unicode]]")&&b.has(t,"[[Done]]")))throw new i('"this" value must be a RegExpStringIterator instance');if(b.get(t,"[[Done]]"))return c(void 0,!0);var e=b.get(t,"[[IteratingRegExp]]"),r=b.get(t,"[[IteratedString]]"),n=b.get(t,"[[Global]]"),o=b.get(t,"[[Unicode]]"),a=p(e,r);if(null===a)return b.set(t,"[[Done]]",!0),c(void 0,!0);if(n){if(""===g(l(a,"0"))){var u=h(l(e,"lastIndex")),f=s(r,u,o);y(e,"lastIndex",f,!0)}return c(a,!1)}return b.set(t,"[[Done]]",!0),c(a,!1)})),o&&(m(w.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof w.prototype[Symbol.iterator])&&u(w.prototype,Symbol.iterator,(function(){return this})),t.exports=function(t,e,r,n){return new w(t,e,r,n)}},3645:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(7999),i=r(2860),a=r(8357),s=r(8355),c=r(3301),u=r(6284),l=r(8277),f=r(7628),p=r(1874);t.exports=function(t,e,r){if("Object"!==p(t))throw new n("Assertion failed: Type(O) is not Object");if(!u(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var y=o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:s},r)?r:f(r);if(!o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:s},y))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return i(c,l,a,t,e,y)}},8357:function(t,e,r){"use strict";var n=r(1489),o=r(1598),i=r(1874);t.exports=function(t){return void 0!==t&&n(i,"Property Descriptor","Desc",t),o(t)}},151:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(4538),i=r(6284),a=r(1874);t.exports=function(t,e){if("Object"!==a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},1959:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(9374),i=r(7304),a=r(6284),s=r(4538);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var r=o(t,e);if(null!=r){if(!i(r))throw new n(s(e)+" is not a function: "+s(r));return r}}},9374:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(4538),i=r(6284);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},8355:function(t,e,r){"use strict";var n=r(9545),o=r(1874),i=r(1489);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Get]]")&&!n(t,"[[Set]]")))}},6287:function(t,e,r){"use strict";t.exports=r(2403)},7304:function(t,e,r){"use strict";t.exports=r(3655)},4791:function(t,e,r){"use strict";var n=r(6740)("%Reflect.construct%",!0),o=r(3645);try{o({},"",{"[[Get]]":function(){}})}catch(t){o=null}if(o&&n){var i={},a={};o(a,"length",{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,a)}catch(t){return t===i}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},3301:function(t,e,r){"use strict";var n=r(9545),o=r(1874),i=r(1489);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Value]]")&&!n(t,"[[Writable]]")))}},6284:function(t){"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},9497:function(t,e,r){"use strict";var n=r(2870)("%Symbol.match%",!0),o=r(5494),i=r(5695);t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(n){var e=t[n];if(void 0!==e)return i(e)}return o(t)}},5716:function(t,e,r){"use strict";var n=r(2870),o=n("%Object.create%",!0),i=n("%TypeError%"),a=n("%SyntaxError%"),s=r(6287),c=r(1874),u=r(7735),l=r(7284),f=r(3413)();t.exports=function(t){if(null!==t&&"Object"!==c(t))throw new i("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!s(r))throw new i("Assertion failed: `additionalInternalSlotsList` must be an Array");if(o)e=o(t);else if(f)e={__proto__:t};else{if(null===t)throw new a("native Object.create support is required to create null objects");var n=function(){};n.prototype=t,e=new n}return r.length>0&&u(r,(function(t){l.set(e,t,void 0)})),e}},3500:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(3099)("RegExp.prototype.exec"),i=r(7113),a=r(151),s=r(7304),c=r(1874);t.exports=function(t,e){if("Object"!==c(t))throw new n("Assertion failed: `R` must be an Object");if("String"!==c(e))throw new n("Assertion failed: `S` must be a String");var r=a(t,"exec");if(s(r)){var u=i(r,t,[e]);if(null===u||"Object"===c(u))return u;throw new n('"exec" method must return `null` or an Object')}return o(t,e)}},6751:function(t,e,r){"use strict";t.exports=r(9572)},8277:function(t,e,r){"use strict";var n=r(159);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},8322:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(6284),i=r(8277),a=r(1874),s=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if("Object"!==a(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");if("Boolean"!==a(c))throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,s&&!i(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!s||i(t[e],r)}catch(t){return!1}}},2449:function(t,e,r){"use strict";var n=r(2870),o=n("%Symbol.species%",!0),i=n("%TypeError%"),a=r(4791),s=r(1874);t.exports=function(t,e){if("Object"!==s(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==s(r))throw new i("O.constructor is not an Object");var n=o?r[o]:void 0;if(null==n)return e;if(a(n))return n;throw new i("no constructor found")}},6207:function(t,e,r){"use strict";var n=r(2870),o=n("%Number%"),i=n("%RegExp%"),a=n("%TypeError%"),s=n("%parseInt%"),c=r(3099),u=r(7582),l=c("String.prototype.slice"),f=u(/^0b[01]+$/i),p=u(/^0o[0-7]+$/i),y=u(/^[-+]0x[0-9a-f]+$/i),h=u(new i("["+["…","​","￾"].join("")+"]","g")),g=r(9434),d=r(1874);t.exports=function t(e){if("String"!==d(e))throw new a("Assertion failed: `argument` is not a String");if(f(e))return o(s(l(e,2),2));if(p(e))return o(s(l(e,2),8));if(h(e)||y(e))return NaN;var r=g(e);return r!==e?t(r):o(e)}},5695:function(t){"use strict";t.exports=function(t){return!!t}},1200:function(t,e,r){"use strict";var n=r(6542),o=r(5693),i=r(159),a=r(1117);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},3995:function(t,e,r){"use strict";var n=r(5674),o=r(1200);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},6542:function(t,e,r){"use strict";var n=r(2870),o=n("%TypeError%"),i=n("%Number%"),a=r(8606),s=r(703),c=r(6207);t.exports=function(t){var e=a(t)?t:s(t,i);if("symbol"==typeof e)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?c(e):i(e)}},703:function(t,e,r){"use strict";var n=r(7358);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},7628:function(t,e,r){"use strict";var n=r(9545),o=r(2870)("%TypeError%"),i=r(1874),a=r(5695),s=r(7304);t.exports=function(t){if("Object"!==i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=a(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=a(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=a(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!s(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!s(c))throw new o("setter must be a function");e["[[Set]]"]=c}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},5128:function(t,e,r){"use strict";var n=r(2870),o=n("%String%"),i=n("%TypeError%");t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return o(t)}},1874:function(t,e,r){"use strict";var n=r(6101);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},1751:function(t,e,r){"use strict";var n=r(2870),o=n("%TypeError%"),i=n("%String.fromCharCode%"),a=r(5541),s=r(959);t.exports=function(t,e){if(!a(t)||!s(e))throw new o("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(t)+i(e)}},3567:function(t,e,r){"use strict";var n=r(1874),o=Math.floor;t.exports=function(t){return"BigInt"===n(t)?t:o(t)}},5693:function(t,e,r){"use strict";var n=r(2870),o=r(3567),i=n("%TypeError%");t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-o(-t):o(t);return 0===e?0:e}},9572:function(t,e,r){"use strict";var n=r(2870)("%TypeError%");t.exports=function(t,e){if(null==t)throw new n(e||"Cannot call method on "+t);return t}},6101:function(t){"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},6740:function(t,e,r){"use strict";t.exports=r(2870)},2860:function(t,e,r){"use strict";var n=r(229),o=r(2870),i=n()&&o("%Object.defineProperty%",!0),a=n.hasArrayLengthDefineBug(),s=a&&r(2403),c=r(3099)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,o,u){if(!i){if(!t(u))return!1;if(!u["[[Configurable]]"]||!u["[[Writable]]"])return!1;if(o in n&&c(n,o)!==!!u["[[Enumerable]]"])return!1;var l=u["[[Value]]"];return n[o]=l,e(n[o],l)}return a&&"length"===o&&"[[Value]]"in u&&s(n)&&n.length!==u["[[Value]]"]?(n.length=u["[[Value]]"],n.length===u["[[Value]]"]):(i(n,o,r(u)),!0)}},2403:function(t,e,r){"use strict";var n=r(2870)("%Array%"),o=!n.isArray&&r(3099)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},1489:function(t,e,r){"use strict";var n=r(2870),o=n("%TypeError%"),i=n("%SyntaxError%"),a=r(9545),s=r(2990),c={"Property Descriptor":function(t){var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!t)return!1;for(var r in t)if(a(t,r)&&!e[r])return!1;var n=a(t,"[[Value]]"),i=a(t,"[[Get]]")||a(t,"[[Set]]");if(n&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":r(900),"Iterator Record":function(t){return a(t,"[[Iterator]]")&&a(t,"[[NextMethod]]")&&a(t,"[[Done]]")},"PromiseCapability Record":function(t){return!!t&&a(t,"[[Resolve]]")&&"function"==typeof t["[[Resolve]]"]&&a(t,"[[Reject]]")&&"function"==typeof t["[[Reject]]"]&&a(t,"[[Promise]]")&&t["[[Promise]]"]&&"function"==typeof t["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(t){return!!t&&a(t,"[[Completion]]")&&a(t,"[[Capability]]")&&c["PromiseCapability Record"](t["[[Capability]]"])},"RegExp Record":function(t){return t&&a(t,"[[IgnoreCase]]")&&"boolean"==typeof t["[[IgnoreCase]]"]&&a(t,"[[Multiline]]")&&"boolean"==typeof t["[[Multiline]]"]&&a(t,"[[DotAll]]")&&"boolean"==typeof t["[[DotAll]]"]&&a(t,"[[Unicode]]")&&"boolean"==typeof t["[[Unicode]]"]&&a(t,"[[CapturingGroupsCount]]")&&"number"==typeof t["[[CapturingGroupsCount]]"]&&s(t["[[CapturingGroupsCount]]"])&&t["[[CapturingGroupsCount]]"]>=0}};t.exports=function(t,e,r,n){var a=c[e];if("function"!=typeof a)throw new i("unknown record type: "+e);if("Object"!==t(n)||!a(n))throw new o(r+" must be a "+e)}},7735:function(t){"use strict";t.exports=function(t,e){for(var r=0;r=55296&&t<=56319}},900:function(t,e,r){"use strict";var n=r(9545);t.exports=function(t){return n(t,"[[StartIndex]]")&&n(t,"[[EndIndex]]")&&t["[[StartIndex]]"]>=0&&t["[[EndIndex]]"]>=t["[[StartIndex]]"]&&String(parseInt(t["[[StartIndex]]"],10))===String(t["[[StartIndex]]"])&&String(parseInt(t["[[EndIndex]]"],10))===String(t["[[EndIndex]]"])}},159:function(t){"use strict";t.exports=Number.isNaN||function(t){return t!=t}},8606:function(t){"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},7999:function(t,e,r){"use strict";var n=r(2870),o=r(9545),i=n("%TypeError%");t.exports=function(t,e){if("Object"!==t.Type(e))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(o(e,n)&&!r[n])return!1;if(t.IsDataDescriptor(e)&&t.IsAccessorDescriptor(e))throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}},959:function(t){"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},5674:function(t){"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";const t=!1;function e(...e){t&&console.log(...e)}function n(t,e){return{bottom:t.bottom/e,height:t.height/e,left:t.left/e,right:t.right/e,top:t.top/e,width:t.width/e}}function o(t){return{width:t.width,height:t.height,left:t.left,top:t.top,right:t.right,bottom:t.bottom}}function i(t,r){const n=t.getClientRects(),o=[];for(const t of n)o.push({bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width});const i=l(function(t,r){const n=new Set(t);for(const r of t)if(r.width>1&&r.height>1){for(const o of t)if(r!==o&&n.has(o)&&c(o,r,1)){e("CLIENT RECT: remove contained"),n.delete(r);break}}else e("CLIENT RECT: remove tiny"),n.delete(r);return Array.from(n)}(a(o,1,r)));for(let t=i.length-1;t>=0;t--){const r=i[t];if(!(r.width*r.height>4)){if(!(i.length>1)){e("CLIENT RECT: remove small, but keep otherwise empty!");break}e("CLIENT RECT: remove small"),i.splice(t,1)}}return e(`CLIENT RECT: reduced ${o.length} --\x3e ${i.length}`),i}function a(t,r,n){for(let o=0;ot!==c&&t!==u)),i=s(c,u);return o.push(i),a(o,r,n)}}return t}function s(t,e){const r=Math.min(t.left,e.left),n=Math.max(t.right,e.right),o=Math.min(t.top,e.top),i=Math.max(t.bottom,e.bottom);return{bottom:i,height:i-o,left:r,right:n,top:o,width:n-r}}function c(t,e,r){return u(t,e.left,e.top,r)&&u(t,e.right,e.top,r)&&u(t,e.left,e.bottom,r)&&u(t,e.right,e.bottom,r)}function u(t,e,r,n){return(t.lefte||y(t.right,e,n))&&(t.topr||y(t.bottom,r,n))}function l(t){for(let r=0;rt!==r));return Array.prototype.push.apply(s,n),l(s)}}else e("replaceOverlapingRects rect1 === rect2 ??!")}return t}function f(t,e){const r=function(t,e){const r=Math.max(t.left,e.left),n=Math.min(t.right,e.right),o=Math.max(t.top,e.top),i=Math.min(t.bottom,e.bottom);return{bottom:i,height:Math.max(0,i-o),left:r,right:n,top:o,width:Math.max(0,n-r)}}(e,t);if(0===r.height||0===r.width)return[t];const n=[];{const e={bottom:t.bottom,height:0,left:t.left,right:r.left,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:r.top,height:0,left:r.left,right:r.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.left,right:r.right,top:r.bottom,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.right,right:t.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}return n}function p(t,e,r){return(t.left=0&&y(t.left,e.right,r))&&(e.left=0&&y(e.left,t.right,r))&&(t.top=0&&y(t.top,e.bottom,r))&&(e.top=0&&y(e.top,t.bottom,r))}function y(t,e,r){return Math.abs(t-e)<=r}var h,g,d=r(1844);function b(t,e,r){let n=0;const o=[];for(;-1!==n;)n=t.indexOf(e,n),-1!==n&&(o.push({start:n,end:n+e.length,errors:0}),n+=1);return o.length>0?o:(0,d.Z)(t,e,r)}function m(t,e){return 0===e.length||0===t.length?0:1-b(t,e,e.length)[0].errors/e.length}function w(t,e,r){const n=r===h.Forwards?e:e-1;if(""!==t.charAt(n).trim())return e;let o,i;if(r===h.Backwards?(o=t.substring(0,e),i=o.trimEnd()):(o=t.substring(e),i=o.trimStart()),!i.length)return-1;const a=o.length-i.length;return r===h.Backwards?e-a:e+a}function v(t,e){const r=t.commonAncestorContainer.ownerDocument.createNodeIterator(t.commonAncestorContainer,NodeFilter.SHOW_TEXT),n=e===h.Forwards?t.startContainer:t.endContainer,o=e===h.Forwards?t.endContainer:t.startContainer;let i=r.nextNode();for(;i&&i!==n;)i=r.nextNode();e===h.Backwards&&(i=r.previousNode());let a=-1;const s=()=>{if(i=e===h.Forwards?r.nextNode():r.previousNode(),i){const t=i.textContent,r=e===h.Forwards?0:t.length;a=w(t,r,e)}};for(;i&&-1===a&&i!==o;)s();if(i&&a>=0)return{node:i,offset:a};throw new RangeError("No text nodes with non-whitespace text found in range")}function x(t){var e,r;switch(t.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return null!==(r=null===(e=t.textContent)||void 0===e?void 0:e.length)&&void 0!==r?r:0;default:return 0}}function S(t){let e=t.previousSibling,r=0;for(;e;)r+=x(e),e=e.previousSibling;return r}function E(t,...e){let r=e.shift();const n=t.ownerDocument.createNodeIterator(t,NodeFilter.SHOW_TEXT),o=[];let i,a=n.nextNode(),s=0;for(;void 0!==r&&a;)i=a,s+i.data.length>r?(o.push({node:i,offset:r-s}),r=e.shift()):(a=n.nextNode(),s+=i.data.length);for(;void 0!==r&&i&&s===r;)o.push({node:i,offset:i.data.length}),r=e.shift();if(void 0!==r)throw new RangeError("Offset exceeds text length");return o}!function(t){t[t.Forwards=1]="Forwards",t[t.Backwards=2]="Backwards"}(h||(h={})),function(t){t[t.FORWARDS=1]="FORWARDS",t[t.BACKWARDS=2]="BACKWARDS"}(g||(g={}));class A{constructor(t,e){if(e<0)throw new Error("Offset is invalid");this.element=t,this.offset=e}relativeTo(t){if(!t.contains(this.element))throw new Error("Parent is not an ancestor of current element");let e=this.element,r=this.offset;for(;e!==t;)r+=S(e),e=e.parentElement;return new A(e,r)}resolve(t={}){try{return E(this.element,this.offset)[0]}catch(e){if(0===this.offset&&void 0!==t.direction){const r=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);r.currentNode=this.element;const n=t.direction===g.FORWARDS,o=n?r.nextNode():r.previousNode();if(!o)throw e;return{node:o,offset:n?0:o.data.length}}throw e}}static fromCharOffset(t,e){switch(t.nodeType){case Node.TEXT_NODE:return A.fromPoint(t,e);case Node.ELEMENT_NODE:return new A(t,e);default:throw new Error("Node is not an element or text node")}}static fromPoint(t,e){switch(t.nodeType){case Node.TEXT_NODE:{if(e<0||e>t.data.length)throw new Error("Text node offset is out of range");if(!t.parentElement)throw new Error("Text node has no parent");const r=S(t)+e;return new A(t.parentElement,r)}case Node.ELEMENT_NODE:{if(e<0||e>t.childNodes.length)throw new Error("Child node offset is out of range");let r=0;for(let n=0;n=0&&(e.setStart(t.startContainer,o.start),r=!0),o.end>0&&(e.setEnd(t.endContainer,o.end),n=!0),r&&n)return e;if(!r){const{node:t,offset:r}=v(e,h.Forwards);t&&r>=0&&e.setStart(t,r)}if(!n){const{node:t,offset:r}=v(e,h.Backwards);t&&r>0&&e.setEnd(t,r)}return e}(O.fromRange(t).toRange())}}class j{constructor(t,e,r){this.root=t,this.start=e,this.end=r}static fromRange(t,e){const r=O.fromRange(e).relativeTo(t);return new j(t,r.start.offset,r.end.offset)}static fromSelector(t,e){return new j(t,e.start,e.end)}toSelector(){return{type:"TextPositionSelector",start:this.start,end:this.end}}toRange(){return O.fromOffsets(this.root,this.start,this.end).toRange()}}class P{constructor(t,e,r={}){this.root=t,this.exact=e,this.context=r}static fromRange(t,e){const r=t.textContent,n=O.fromRange(e).relativeTo(t),o=n.start.offset,i=n.end.offset;return new P(t,r.slice(o,i),{prefix:r.slice(Math.max(0,o-32),o),suffix:r.slice(i,Math.min(r.length,i+32))})}static fromSelector(t,e){const{prefix:r,suffix:n}=e;return new P(t,e.exact,{prefix:r,suffix:n})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(t={}){return this.toPositionAnchor(t).toRange()}toPositionAnchor(t={}){const e=function(t,e,r={}){if(0===e.length)return null;const n=Math.min(256,e.length/2),o=b(t,e,n);if(0===o.length)return null;const i=n=>{const o=1-n.errors/e.length,i=r.prefix?m(t.slice(Math.max(0,n.start-r.prefix.length),n.start),r.prefix):1,a=r.suffix?m(t.slice(n.end,n.end+r.suffix.length),r.suffix):1;let s=1;return"number"==typeof r.hint&&(s=1-Math.abs(n.start-r.hint)/t.length),(50*o+20*i+20*a+2*s)/92},a=o.map((t=>({start:t.start,end:t.end,score:i(t)})));return a.sort(((t,e)=>e.score-t.score)),a[0]}(this.root.textContent,this.exact,Object.assign(Object.assign({},this.context),{hint:t.hint}));if(!e)throw new Error("Quote not found");return new j(this.root,e.start,e.end)}}class R{constructor(t,e,r){this.items=[],this.lastItemId=0,this.container=null,this.groupId=t,this.groupName=e,this.styles=r}add(t){const r=this.groupId+"-"+this.lastItemId++,n=function(t,r){let n;if(t)try{n=document.querySelector(t)}catch(t){e(t)}if(!n&&!r)return null;if(n||(n=document.body),!r){const t=document.createRange();return t.setStartBefore(n),t.setEndAfter(n),t}{const t=new P(n,r.quotedText,{prefix:r.textBefore,suffix:r.textAfter});try{return t.toRange()}catch(t){return e(t),null}}}(t.cssSelector,t.textQuote);if(e(`range ${n}`),!n)return void e("Can't locate DOM range for decoration",t);const o={id:r,decoration:t,range:n,container:null,clickableElements:null};this.items.push(o),this.layout(o)}remove(t){const e=this.items.findIndex((e=>e.decoration.id===t));if(-1===e)return;const r=this.items[e];this.items.splice(e,1),r.clickableElements=null,r.container&&(r.container.remove(),r.container=null)}relayout(){this.clearContainer();for(const t of this.items)this.layout(t)}requireContainer(){return this.container||(this.container=document.createElement("div"),this.container.id=this.groupId,this.container.dataset.group=this.groupName,this.container.style.pointerEvents="none",document.body.append(this.container)),this.container}clearContainer(){this.container&&(this.container.remove(),this.container=null)}layout(t){e(`layout ${t}`);const r=this.requireContainer(),o=this.styles.get(t.decoration.style);if(!o)return void console.log(`Unknown decoration style: ${t.decoration.style}`);const a=o,s=document.createElement("div");s.id=t.id,s.dataset.style=t.decoration.style,s.style.pointerEvents="none";const c=getComputedStyle(document.body).writingMode,u="vertical-rl"===c||"vertical-lr"===c,l=r.currentCSSZoom,f=document.scrollingElement,p=f.scrollLeft/l,y=f.scrollTop/l,h=u?window.innerHeight:window.innerWidth,g=u?window.innerWidth:window.innerHeight,d=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count"))||1,b=(u?g:h)/d;function m(t,e,r,n){t.style.position="absolute";const o="vertical-rl"===n;if(o||"vertical-lr"===n){if("wrap"===a.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,o?t.style.right=`${-e.right-p+f.clientWidth}px`:t.style.left=`${e.left+p}px`,t.style.top=`${e.top+y}px`;else if("viewport"===a.width){t.style.width=`${e.height}px`,t.style.height=`${h}px`;const r=Math.floor(e.top/h)*h;o?t.style.right=-e.right-p+"px":t.style.left=`${e.left+p}px`,t.style.top=`${r+y}px`}else if("bounds"===a.width)t.style.width=`${r.height}px`,t.style.height=`${h}px`,o?t.style.right=`${-r.right-p+f.clientWidth}px`:t.style.left=`${r.left+p}px`,t.style.top=`${r.top+y}px`;else if("page"===a.width){t.style.width=`${e.height}px`,t.style.height=`${b}px`;const r=Math.floor(e.top/b)*b;o?t.style.right=`${-e.right-p+f.clientWidth}px`:t.style.left=`${e.left+p}px`,t.style.top=`${r+y}px`}}else if("wrap"===a.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.left=`${e.left+p}px`,t.style.top=`${e.top+y}px`;else if("viewport"===a.width){t.style.width=`${h}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/h)*h;t.style.left=`${r+p}px`,t.style.top=`${e.top+y}px`}else if("bounds"===a.width)t.style.width=`${r.width}px`,t.style.height=`${e.height}px`,t.style.left=`${r.left+p}px`,t.style.top=`${e.top+y}px`;else if("page"===a.width){t.style.width=`${b}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/b)*b;t.style.left=`${r+p}px`,t.style.top=`${e.top+y}px`}}const w=(v=t.range.getBoundingClientRect(),x=l,new DOMRect(v.x/x,v.y/x,v.width/x,v.height/x));var v,x;let S;try{const e=document.createElement("template");e.innerHTML=t.decoration.element.trim(),S=e.content.firstElementChild}catch(e){let r;return r="message"in e?e.message:null,void console.log(`Invalid decoration element "${t.decoration.element}": ${r}`)}if("boxes"===a.layout){const e=!c.startsWith("vertical"),r=(E=t.range.startContainer).nodeType===Node.ELEMENT_NODE?E:E.parentElement,o=getComputedStyle(r).writingMode,a=i(t.range,e).map((t=>n(t,l))).sort(((t,e)=>t.top!==e.top?t.top-e.top:"vertical-rl"===o?e.left-t.left:t.left-e.left));for(const t of a){const e=S.cloneNode(!0);e.style.pointerEvents="none",e.dataset.writingMode=o,m(e,t,w,c),s.append(e)}}else if("bounds"===a.layout){const t=S.cloneNode(!0);t.style.pointerEvents="none",t.dataset.writingMode=c,m(t,w,w,c),s.append(t)}var E;r.append(s),t.container=s,t.clickableElements=Array.from(s.querySelectorAll("[data-activable='1']")),0===t.clickableElements.length&&(t.clickableElements=Array.from(s.children))}}var C=r(5155);r.n(C)().shim();class T{constructor(t,e){this.decorationManager=e,t.onmessage=t=>{this.onCommand(t.data)}}onCommand(t){switch(t.kind){case"registerTemplates":return this.registerTemplates(t.templates);case"addDecoration":return this.addDecoration(t.decoration,t.group);case"removeDecoration":return this.removeDecoration(t.id,t.group)}}registerTemplates(t){this.decorationManager.registerTemplates(t)}addDecoration(t,e){this.decorationManager.addDecoration(t,e)}removeDecoration(t,e){this.decorationManager.removeDecoration(t,e)}}class I{constructor(t){this.messagePort=t}send(t){this.messagePort.postMessage(t)}}class M{constructor(t,e){this.selectionManager=e,this.messagePort=t,t.onmessage=t=>{this.onCommand(t.data)}}onCommand(t){switch(t.kind){case"requestSelection":return this.onRequestSelection(t.requestId);case"clearSelection":return this.onClearSelection()}}onRequestSelection(t){const e={kind:"selectionAvailable",requestId:t,selection:this.selectionManager.getCurrentSelection()};this.sendFeedback(e)}onClearSelection(){this.selectionManager.clearSelection()}sendFeedback(t){this.messagePort.postMessage(t)}}const $=new class{constructor(t){this.window=t}initAreaManager(){const t=this.initChannel("InitAreaManager");return new I(t)}initSelection(t){const e=this.initChannel("InitSelection");new M(e,t)}initDecorations(t){const e=this.initChannel("InitDecorations");new T(e,t)}initChannel(t){const e=new MessageChannel;return this.window.parent.postMessage(t,"*",[e.port2]),e.port1}}(window),D=$.initAreaManager(),N=new class{constructor(t){this.isSelecting=!1,this.window=t}clearSelection(){var t;null===(t=this.window.getSelection())||void 0===t||t.removeAllRanges()}getCurrentSelection(){const t=this.getCurrentSelectionText();if(!t)return null;const e=this.getSelectionRect();return{selectedText:t.highlight,textBefore:t.before,textAfter:t.after,selectionRect:e}}getSelectionRect(){try{const t=this.window.getSelection().getRangeAt(0),e=this.window.document.body.currentCSSZoom;return n(o(t.getBoundingClientRect()),e)}catch(t){throw e(t),t}}getCurrentSelectionText(){const t=this.window.getSelection();if(t.isCollapsed)return;const r=t.toString();if(0===r.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!t.anchorNode||!t.focusNode)return;const n=1===t.rangeCount?t.getRangeAt(0):function(t,r,n,o){const i=new Range;if(i.setStart(t,r),i.setEnd(n,o),!i.collapsed)return i;e(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const a=new Range;if(a.setStart(n,o),a.setEnd(t,r),!a.collapsed)return e(">>> createOrderedRange RANGE REVERSE OK."),i;e(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset);if(!n||n.collapsed)return void e("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const o=document.body.textContent,i=O.fromRange(n).relativeTo(document.body),a=i.start.offset,s=i.end.offset;let c=o.slice(Math.max(0,a-200),a);const u=c.search(/\P{L}\p{L}/gu);-1!==u&&(c=c.slice(u+1));let l=o.slice(s,Math.min(o.length,s+200));const f=Array.from(l.matchAll(/\p{L}\P{L}/gu)).pop();return void 0!==f&&f.index>1&&(l=l.slice(0,f.index+1)),{highlight:r,before:c,after:l}}}(window);$.initSelection(N);const F=new class{constructor(t){this.styles=new Map,this.groups=new Map,this.lastGroupId=0,this.window=t,t.addEventListener("load",(()=>{const e=t.document.body;let r={width:0,height:0};new ResizeObserver((()=>{requestAnimationFrame((()=>{r.width===e.clientWidth&&r.height===e.clientHeight||(r={width:e.clientWidth,height:e.clientHeight},this.relayoutDecorations())}))})).observe(e)}),!1)}registerTemplates(t){let e="";for(const[r,n]of t)this.styles.set(r,n),n.stylesheet&&(e+=n.stylesheet+"\n");if(e){const t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}}addDecoration(t,e){console.log(`addDecoration ${t.id} ${e}`),this.getGroup(e).add(t)}removeDecoration(t,e){console.log(`removeDecoration ${t} ${e}`),this.getGroup(e).remove(t)}relayoutDecorations(){console.log("relayoutDecorations");for(const t of this.groups.values())t.relayout()}getGroup(t){let e=this.groups.get(t);if(!e){const r="readium-decoration-"+this.lastGroupId++;e=new R(r,t,this.styles),this.groups.set(t,e)}return e}handleDecorationClickEvent(t){if(0===this.groups.size)return null;const e=(()=>{for(const[e,r]of this.groups)for(const n of r.items.reverse())if(n.clickableElements)for(const r of n.clickableElements)if(u(o(r.getBoundingClientRect()),t.clientX,t.clientY,1))return{group:e,item:n,element:r}})();return e?{id:e.item.decoration.id,group:e.group,rect:o(e.item.range.getBoundingClientRect()),event:t}:null}}(window);$.initDecorations(F);const k=function(t){const e=window.document.querySelector("meta[name=viewport]");if(e&&e instanceof HTMLMetaElement)return function(t){const e=/(\w+) *= *([^\s,]+)/g,r=new Map;let n;for(;n=e.exec(t);)null!=n&&r.set(n[1],n[2]);const o=parseFloat(r.get("width")),i=parseFloat(r.get("height"));return o&&i?{width:o,height:i}:void 0}(e.content)}();D.send({kind:"contentSize",size:k});const B=new class{constructor(t){this.messageSender=t}onTap(t){const e={offset:{x:t.clientX,y:t.clientY}};this.messageSender.send({kind:"tap",event:e})}onLinkActivated(t,e){this.messageSender.send({kind:"linkActivated",href:t,outerHtml:e})}onDecorationActivated(t){const e={id:t.id,group:t.group,rect:t.rect,offset:{x:t.event.clientX,y:t.event.clientY}};this.messageSender.send({kind:"decorationActivated",event:e})}}(D);new class{constructor(t,e,r){this.window=t,this.listener=e,this.decorationManager=r,document.addEventListener("click",(t=>{this.onClick(t)}),!1)}onClick(t){if(t.defaultPrevented)return;let e,r;e=t.target instanceof HTMLElement?this.nearestInteractiveElement(t.target):null,e?e instanceof HTMLAnchorElement&&(this.listener.onLinkActivated(e.href,e.outerHTML),t.stopPropagation(),t.preventDefault()):(r=this.decorationManager?this.decorationManager.handleDecorationClickEvent(t):null,r?this.listener.onDecorationActivated(r):this.listener.onTap(t))}nearestInteractiveElement(t){return null==t?null:-1!=["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(t.nodeName.toLowerCase())||t.hasAttribute("contenteditable")&&"false"!=t.getAttribute("contenteditable").toLowerCase()?t:t.parentElement?this.nearestInteractiveElement(t.parentElement):null}}(window,B,F)}()}(); //# sourceMappingURL=fixed-injectable-script.js.map \ No newline at end of file diff --git a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/fixed-injectable-script.js.map b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/fixed-injectable-script.js.map index 9e859a7c7a..8922d6e340 100644 --- a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/fixed-injectable-script.js.map +++ b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/fixed-injectable-script.js.map @@ -1 +1 @@ -{"version":3,"file":"fixed-injectable-script.js","mappings":"mDAmCA,SAASA,EAAQC,GACb,OAAOA,EACFC,MAAM,IACNF,UACAG,KAAK,GACd,CAwCA,SAASC,EAAaC,GAClB,OAASA,GAAKA,IAAM,GAAM,CAC9B,CAaA,SAASC,EAAaC,EAAKC,EAAKC,EAAGC,GAC/B,IAAIC,EAAKJ,EAAIK,EAAEH,GACXI,EAAKN,EAAIO,EAAEL,GACXM,EAAgBL,IAAQ,GACxBM,EAAKR,EAAIC,GAAKM,EAEdE,EAAKD,EAAKH,EACVK,GAAQF,EAAKL,GAAMA,EAAMA,EAAMK,EAC/BG,EAAKN,IAAOK,EAAKP,GACjBS,EAAKT,EAAKO,EAEVG,EAAOjB,EAAae,EAAKZ,EAAIe,YAAYb,IACzCL,EAAagB,EAAKb,EAAIe,YAAYb,IAUtC,OARAU,IAAO,EACPC,IAAO,EAGPT,GAFAS,GAAML,KAEME,GADZE,GAAMf,EAAaM,GAAOK,IAE1BF,EAAKM,EAAKF,EACVV,EAAIK,EAAEH,GAAKE,EACXJ,EAAIO,EAAEL,GAAKI,EACJQ,CACX,CASA,SAASE,EAAcC,EAAMC,EAASC,GAClC,GAAuB,IAAnBD,EAAQE,OACR,MAAO,GAIXD,EAAYE,KAAKC,IAAIH,EAAWD,EAAQE,QACxC,IAAIG,EAAU,GAEVC,EAAI,GAEJC,EAAOJ,KAAKK,KAAKR,EAAQE,OAASI,GAAK,EAEvCxB,EAAM,CACNK,EAAG,IAAIsB,YAAYF,EAAO,GAC1BlB,EAAG,IAAIoB,YAAYF,EAAO,GAC1BV,YAAa,IAAIY,YAAYF,EAAO,IAExCzB,EAAIe,YAAYa,KAAK,GAAK,IAC1B5B,EAAIe,YAAYU,GAAQ,IAAMP,EAAQE,OAAS,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zB,KAAK4wB,cAAcvB,KAAK,CACpBN,KAAM,sBACNuE,MAAOA,GAEf,GAEoD1C,GACxD,IGrDO,MACH,WAAA/gB,CAAYgD,EAAQ4hB,EAAU9F,GAC1B3uB,KAAK6S,OAASA,EACd7S,KAAKy0B,SAAWA,EAChBz0B,KAAK2uB,kBAAoBA,EACzBnmB,SAASgqB,iBAAiB,SAAUc,IAChCtzB,KAAK00B,QAAQpB,EAAM,IACpB,EACP,CACA,OAAAoB,CAAQpB,GACJ,GAAIA,EAAMqB,iBACN,OAEJ,MAAM7E,EAAY9vB,KAAK6S,OAAOie,eAC9B,GAAIhB,GAA+B,SAAlBA,EAAUzf,KAIvB,OAEJ,IAAIukB,EAiBAC,EAVJ,GALID,EADAtB,EAAMvzB,kBAAkBmO,YACPlO,KAAK80B,0BAA0BxB,EAAMvzB,QAGrC,KAEjB60B,EAAgB,CAChB,KAAIA,aAA0BG,mBAM1B,OALA/0B,KAAKy0B,SAASJ,gBAAgBO,EAAeN,KAAMM,EAAeI,WAClE1B,EAAM2B,kBACN3B,EAAM4B,gBAKd,CAGIL,EADA70B,KAAK2uB,kBAED3uB,KAAK2uB,kBAAkB0E,2BAA2BC,GAG3B,KAE3BuB,EACA70B,KAAKy0B,SAASD,sBAAsBK,GAGpC70B,KAAKy0B,SAASN,MAAMb,EAI5B,CAEA,yBAAAwB,CAA0BhP,GACtB,OAAe,MAAXA,EACO,MAgBqD,GAdxC,CACpB,IACA,QACA,SACA,SACA,UACA,QACA,QACA,SACA,SACA,SACA,WACA,SAEgBtY,QAAQsY,EAAQ3X,SAASxD,gBAIzCmb,EAAQqP,aAAa,oBACoC,SAAzDrP,EAAQ1X,aAAa,mBAAmBzD,cAJjCmb,EAQPA,EAAQW,cACDzmB,KAAK80B,0BAA0BhP,EAAQW,eAE3C,IACX,GHjCiB5T,OAAQqhB,EAAmBvF,E","sources":["webpack://readium-js/./node_modules/.pnpm/approx-string-match@1.1.0/node_modules/approx-string-match/dist/index.js","webpack://readium-js/./node_modules/.pnpm/call-bind@1.0.2/node_modules/call-bind/callBound.js","webpack://readium-js/./node_modules/.pnpm/call-bind@1.0.2/node_modules/call-bind/index.js","webpack://readium-js/./node_modules/.pnpm/define-data-property@1.1.0/node_modules/define-data-property/index.js","webpack://readium-js/./node_modules/.pnpm/define-properties@1.2.1/node_modules/define-properties/index.js","webpack://readium-js/./node_modules/.pnpm/es-set-tostringtag@2.0.1/node_modules/es-set-tostringtag/index.js","webpack://readium-js/./node_modules/.pnpm/es-to-primitive@1.2.1/node_modules/es-to-primitive/es2015.js","webpack://readium-js/./node_modules/.pnpm/es-to-primitive@1.2.1/node_modules/es-to-primitive/helpers/isPrimitive.js","webpack://readium-js/./node_modules/.pnpm/function-bind@1.1.1/node_modules/function-bind/implementation.js","webpack://readium-js/./node_modules/.pnpm/function-bind@1.1.1/node_modules/function-bind/index.js","webpack://readium-js/./node_modules/.pnpm/functions-have-names@1.2.3/node_modules/functions-have-names/index.js","webpack://readium-js/./node_modules/.pnpm/get-intrinsic@1.2.1/node_modules/get-intrinsic/index.js","webpack://readium-js/./node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.js","webpack://readium-js/./node_modules/.pnpm/has-property-descriptors@1.0.0/node_modules/has-property-descriptors/index.js","webpack://readium-js/./node_modules/.pnpm/has-proto@1.0.1/node_modules/has-proto/index.js","webpack://readium-js/./node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/index.js","webpack://readium-js/./node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/shams.js","webpack://readium-js/./node_modules/.pnpm/has-tostringtag@1.0.0/node_modules/has-tostringtag/shams.js","webpack://readium-js/./node_modules/.pnpm/has@1.0.4/node_modules/has/src/index.js","webpack://readium-js/./node_modules/.pnpm/internal-slot@1.0.5/node_modules/internal-slot/index.js","webpack://readium-js/./node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/index.js","webpack://readium-js/./node_modules/.pnpm/is-date-object@1.0.5/node_modules/is-date-object/index.js","webpack://readium-js/./node_modules/.pnpm/is-regex@1.1.4/node_modules/is-regex/index.js","webpack://readium-js/./node_modules/.pnpm/is-symbol@1.0.4/node_modules/is-symbol/index.js","webpack://readium-js/./node_modules/.pnpm/object-inspect@1.12.3/node_modules/object-inspect/index.js","webpack://readium-js/./node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/implementation.js","webpack://readium-js/./node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/index.js","webpack://readium-js/./node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/isArguments.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/implementation.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/index.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/polyfill.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/shim.js","webpack://readium-js/./node_modules/.pnpm/safe-regex-test@1.0.0/node_modules/safe-regex-test/index.js","webpack://readium-js/./node_modules/.pnpm/set-function-name@2.0.1/node_modules/set-function-name/index.js","webpack://readium-js/./node_modules/.pnpm/side-channel@1.0.4/node_modules/side-channel/index.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/implementation.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/index.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/polyfill-regexp-matchall.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/polyfill.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/regexp-matchall.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/shim.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/implementation.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/index.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/polyfill.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/shim.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/AdvanceStringIndex.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Call.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CodePointAt.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CreateIterResultObject.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CreateMethodProperty.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CreateRegExpStringIterator.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/DefinePropertyOrThrow.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/FromPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Get.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/GetMethod.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/GetV.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsAccessorDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsArray.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsCallable.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsConstructor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsDataDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsPropertyKey.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsRegExp.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/OrdinaryObjectCreate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/RegExpExec.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/RequireObjectCoercible.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/SameValue.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Set.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/SpeciesConstructor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/StringToNumber.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToBoolean.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToIntegerOrInfinity.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToLength.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToNumber.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToPrimitive.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToString.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Type.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/UTF16SurrogatePairToCodePoint.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/floor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/truncate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/5/CheckObjectCoercible.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/5/Type.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/GetIntrinsic.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/DefineOwnProperty.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/IsArray.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/assertRecord.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/forEach.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/fromPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isFinite.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isInteger.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isLeadingSurrogate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isMatchRecord.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isNaN.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isPrimitive.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isTrailingSurrogate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/maxSafeInteger.js","webpack://readium-js/webpack/bootstrap","webpack://readium-js/webpack/runtime/compat get default export","webpack://readium-js/webpack/runtime/define property getters","webpack://readium-js/webpack/runtime/hasOwnProperty shorthand","webpack://readium-js/./src/util/log.ts","webpack://readium-js/./src/util/rect.ts","webpack://readium-js/./src/vendor/hypothesis/annotator/anchoring/trim-range.ts","webpack://readium-js/./src/vendor/hypothesis/annotator/anchoring/text-range.ts","webpack://readium-js/./src/vendor/hypothesis/annotator/anchoring/match-quote.ts","webpack://readium-js/./src/vendor/hypothesis/annotator/anchoring/types.ts","webpack://readium-js/./src/common/decoration.ts","webpack://readium-js/./src/common/selection.ts","webpack://readium-js/./src/fixed/decoration-wrapper.ts","webpack://readium-js/./src/fixed/iframe-message.ts","webpack://readium-js/./src/fixed/selection-wrapper.ts","webpack://readium-js/./src/index-fixed-injectable.ts","webpack://readium-js/./src/bridge/all-initialization-bridge.ts","webpack://readium-js/./src/util/viewport.ts","webpack://readium-js/./src/common/gestures.ts"],"sourcesContent":["\"use strict\";\n/**\n * Implementation of Myers' online approximate string matching algorithm [1],\n * with additional optimizations suggested by [2].\n *\n * This has O((k/w) * n) complexity where `n` is the length of the text, `k` is\n * the maximum number of errors allowed (always <= the pattern length) and `w`\n * is the word size. Because JS only supports bitwise operations on 32 bit\n * integers, `w` is 32.\n *\n * As far as I am aware, there aren't any online algorithms which are\n * significantly better for a wide range of input parameters. The problem can be\n * solved faster using \"filter then verify\" approaches which first filter out\n * regions of the text that cannot match using a \"cheap\" check and then verify\n * the remaining potential matches. The verify step requires an algorithm such\n * as this one however.\n *\n * The algorithm's approach is essentially to optimize the classic dynamic\n * programming solution to the problem by computing columns of the matrix in\n * word-sized chunks (ie. dealing with 32 chars of the pattern at a time) and\n * avoiding calculating regions of the matrix where the minimum error count is\n * guaranteed to exceed the input threshold.\n *\n * The paper consists of two parts, the first describes the core algorithm for\n * matching patterns <= the size of a word (implemented by `advanceBlock` here).\n * The second uses the core algorithm as part of a larger block-based algorithm\n * to handle longer patterns.\n *\n * [1] G. Myers, “A Fast Bit-Vector Algorithm for Approximate String Matching\n * Based on Dynamic Programming,” vol. 46, no. 3, pp. 395–415, 1999.\n *\n * [2] Šošić, M. (2014). An simd dynamic programming c/c++ library (Doctoral\n * dissertation, Fakultet Elektrotehnike i računarstva, Sveučilište u Zagrebu).\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction reverse(s) {\n return s\n .split(\"\")\n .reverse()\n .join(\"\");\n}\n/**\n * Given the ends of approximate matches for `pattern` in `text`, find\n * the start of the matches.\n *\n * @param findEndFn - Function for finding the end of matches in\n * text.\n * @return Matches with the `start` property set.\n */\nfunction findMatchStarts(text, pattern, matches) {\n var patRev = reverse(pattern);\n return matches.map(function (m) {\n // Find start of each match by reversing the pattern and matching segment\n // of text and searching for an approx match with the same number of\n // errors.\n var minStart = Math.max(0, m.end - pattern.length - m.errors);\n var textRev = reverse(text.slice(minStart, m.end));\n // If there are multiple possible start points, choose the one that\n // maximizes the length of the match.\n var start = findMatchEnds(textRev, patRev, m.errors).reduce(function (min, rm) {\n if (m.end - rm.end < min) {\n return m.end - rm.end;\n }\n return min;\n }, m.end);\n return {\n start: start,\n end: m.end,\n errors: m.errors\n };\n });\n}\n/**\n * Return 1 if a number is non-zero or zero otherwise, without using\n * conditional operators.\n *\n * This should get inlined into `advanceBlock` below by the JIT.\n *\n * Adapted from https://stackoverflow.com/a/3912218/434243\n */\nfunction oneIfNotZero(n) {\n return ((n | -n) >> 31) & 1;\n}\n/**\n * Block calculation step of the algorithm.\n *\n * From Fig 8. on p. 408 of [1], additionally optimized to replace conditional\n * checks with bitwise operations as per Section 4.2.3 of [2].\n *\n * @param ctx - The pattern context object\n * @param peq - The `peq` array for the current character (`ctx.peq.get(ch)`)\n * @param b - The block level\n * @param hIn - Horizontal input delta ∈ {1,0,-1}\n * @return Horizontal output delta ∈ {1,0,-1}\n */\nfunction advanceBlock(ctx, peq, b, hIn) {\n var pV = ctx.P[b];\n var mV = ctx.M[b];\n var hInIsNegative = hIn >>> 31; // 1 if hIn < 0 or 0 otherwise.\n var eq = peq[b] | hInIsNegative;\n // Step 1: Compute horizontal deltas.\n var xV = eq | mV;\n var xH = (((eq & pV) + pV) ^ pV) | eq;\n var pH = mV | ~(xH | pV);\n var mH = pV & xH;\n // Step 2: Update score (value of last row of this block).\n var hOut = oneIfNotZero(pH & ctx.lastRowMask[b]) -\n oneIfNotZero(mH & ctx.lastRowMask[b]);\n // Step 3: Update vertical deltas for use when processing next char.\n pH <<= 1;\n mH <<= 1;\n mH |= hInIsNegative;\n pH |= oneIfNotZero(hIn) - hInIsNegative; // set pH[0] if hIn > 0\n pV = mH | ~(xV | pH);\n mV = pH & xV;\n ctx.P[b] = pV;\n ctx.M[b] = mV;\n return hOut;\n}\n/**\n * Find the ends and error counts for matches of `pattern` in `text`.\n *\n * Only the matches with the lowest error count are reported. Other matches\n * with error counts <= maxErrors are discarded.\n *\n * This is the block-based search algorithm from Fig. 9 on p.410 of [1].\n */\nfunction findMatchEnds(text, pattern, maxErrors) {\n if (pattern.length === 0) {\n return [];\n }\n // Clamp error count so we can rely on the `maxErrors` and `pattern.length`\n // rows being in the same block below.\n maxErrors = Math.min(maxErrors, pattern.length);\n var matches = [];\n // Word size.\n var w = 32;\n // Index of maximum block level.\n var bMax = Math.ceil(pattern.length / w) - 1;\n // Context used across block calculations.\n var ctx = {\n P: new Uint32Array(bMax + 1),\n M: new Uint32Array(bMax + 1),\n lastRowMask: new Uint32Array(bMax + 1)\n };\n ctx.lastRowMask.fill(1 << 31);\n ctx.lastRowMask[bMax] = 1 << (pattern.length - 1) % w;\n // Dummy \"peq\" array for chars in the text which do not occur in the pattern.\n var emptyPeq = new Uint32Array(bMax + 1);\n // Map of UTF-16 character code to bit vector indicating positions in the\n // pattern that equal that character.\n var peq = new Map();\n // Version of `peq` that only stores mappings for small characters. This\n // allows faster lookups when iterating through the text because a simple\n // array lookup can be done instead of a hash table lookup.\n var asciiPeq = [];\n for (var i = 0; i < 256; i++) {\n asciiPeq.push(emptyPeq);\n }\n // Calculate `ctx.peq` - a map of character values to bitmasks indicating\n // positions of that character within the pattern, where each bit represents\n // a position in the pattern.\n for (var c = 0; c < pattern.length; c += 1) {\n var val = pattern.charCodeAt(c);\n if (peq.has(val)) {\n // Duplicate char in pattern.\n continue;\n }\n var charPeq = new Uint32Array(bMax + 1);\n peq.set(val, charPeq);\n if (val < asciiPeq.length) {\n asciiPeq[val] = charPeq;\n }\n for (var b = 0; b <= bMax; b += 1) {\n charPeq[b] = 0;\n // Set all the bits where the pattern matches the current char (ch).\n // For indexes beyond the end of the pattern, always set the bit as if the\n // pattern contained a wildcard char in that position.\n for (var r = 0; r < w; r += 1) {\n var idx = b * w + r;\n if (idx >= pattern.length) {\n continue;\n }\n var match = pattern.charCodeAt(idx) === val;\n if (match) {\n charPeq[b] |= 1 << r;\n }\n }\n }\n }\n // Index of last-active block level in the column.\n var y = Math.max(0, Math.ceil(maxErrors / w) - 1);\n // Initialize maximum error count at bottom of each block.\n var score = new Uint32Array(bMax + 1);\n for (var b = 0; b <= y; b += 1) {\n score[b] = (b + 1) * w;\n }\n score[bMax] = pattern.length;\n // Initialize vertical deltas for each block.\n for (var b = 0; b <= y; b += 1) {\n ctx.P[b] = ~0;\n ctx.M[b] = 0;\n }\n // Process each char of the text, computing the error count for `w` chars of\n // the pattern at a time.\n for (var j = 0; j < text.length; j += 1) {\n // Lookup the bitmask representing the positions of the current char from\n // the text within the pattern.\n var charCode = text.charCodeAt(j);\n var charPeq = void 0;\n if (charCode < asciiPeq.length) {\n // Fast array lookup.\n charPeq = asciiPeq[charCode];\n }\n else {\n // Slower hash table lookup.\n charPeq = peq.get(charCode);\n if (typeof charPeq === \"undefined\") {\n charPeq = emptyPeq;\n }\n }\n // Calculate error count for blocks that we definitely have to process for\n // this column.\n var carry = 0;\n for (var b = 0; b <= y; b += 1) {\n carry = advanceBlock(ctx, charPeq, b, carry);\n score[b] += carry;\n }\n // Check if we also need to compute an additional block, or if we can reduce\n // the number of blocks processed for the next column.\n if (score[y] - carry <= maxErrors &&\n y < bMax &&\n (charPeq[y + 1] & 1 || carry < 0)) {\n // Error count for bottom block is under threshold, increase the number of\n // blocks processed for this column & next by 1.\n y += 1;\n ctx.P[y] = ~0;\n ctx.M[y] = 0;\n var maxBlockScore = y === bMax ? pattern.length % w : w;\n score[y] =\n score[y - 1] +\n maxBlockScore -\n carry +\n advanceBlock(ctx, charPeq, y, carry);\n }\n else {\n // Error count for bottom block exceeds threshold, reduce the number of\n // blocks processed for the next column.\n while (y > 0 && score[y] >= maxErrors + w) {\n y -= 1;\n }\n }\n // If error count is under threshold, report a match.\n if (y === bMax && score[y] <= maxErrors) {\n if (score[y] < maxErrors) {\n // Discard any earlier, worse matches.\n matches.splice(0, matches.length);\n }\n matches.push({\n start: -1,\n end: j + 1,\n errors: score[y]\n });\n // Because `search` only reports the matches with the lowest error count,\n // we can \"ratchet down\" the max error threshold whenever a match is\n // encountered and thereby save a small amount of work for the remainder\n // of the text.\n maxErrors = score[y];\n }\n }\n return matches;\n}\n/**\n * Search for matches for `pattern` in `text` allowing up to `maxErrors` errors.\n *\n * Returns the start, and end positions and error counts for each lowest-cost\n * match. Only the \"best\" matches are returned.\n */\nfunction search(text, pattern, maxErrors) {\n var matches = findMatchEnds(text, pattern, maxErrors);\n return findMatchStarts(text, pattern, matches);\n}\nexports.default = search;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBind = require('./');\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = null;\n\t}\n}\n\nmodule.exports = function callBind(originalFunction) {\n\tvar func = $reflectApply(bind, $call, arguments);\n\tif ($gOPD && $defineProperty) {\n\t\tvar desc = $gOPD(func, 'length');\n\t\tif (desc.configurable) {\n\t\t\t// original length, plus the receiver, minus any additional arguments (after the receiver)\n\t\t\t$defineProperty(\n\t\t\t\tfunc,\n\t\t\t\t'length',\n\t\t\t\t{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }\n\t\t\t);\n\t\t}\n\t}\n\treturn func;\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","'use strict';\n\nvar hasPropertyDescriptors = require('has-property-descriptors')();\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = hasPropertyDescriptors && GetIntrinsic('%Object.defineProperty%', true);\n\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar gopd = require('gopd');\n\n/** @type {(obj: Record, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */\nmodule.exports = function defineDataProperty(\n\tobj,\n\tproperty,\n\tvalue\n) {\n\tif (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n\t\tthrow new $TypeError('`obj` must be an object or a function`');\n\t}\n\tif (typeof property !== 'string' && typeof property !== 'symbol') {\n\t\tthrow new $TypeError('`property` must be a string or a symbol`');\n\t}\n\tif (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {\n\t\tthrow new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {\n\t\tthrow new $TypeError('`nonWritable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {\n\t\tthrow new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 6 && typeof arguments[6] !== 'boolean') {\n\t\tthrow new $TypeError('`loose`, if provided, must be a boolean');\n\t}\n\n\tvar nonEnumerable = arguments.length > 3 ? arguments[3] : null;\n\tvar nonWritable = arguments.length > 4 ? arguments[4] : null;\n\tvar nonConfigurable = arguments.length > 5 ? arguments[5] : null;\n\tvar loose = arguments.length > 6 ? arguments[6] : false;\n\n\t/* @type {false | TypedPropertyDescriptor} */\n\tvar desc = !!gopd && gopd(obj, property);\n\n\tif ($defineProperty) {\n\t\t$defineProperty(obj, property, {\n\t\t\tconfigurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,\n\t\t\tenumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,\n\t\t\tvalue: value,\n\t\t\twritable: nonWritable === null && desc ? desc.writable : !nonWritable\n\t\t});\n\t} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {\n\t\t// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable\n\t\tobj[property] = value; // eslint-disable-line no-param-reassign\n\t} else {\n\t\tthrow new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');\n\t}\n};\n","'use strict';\n\nvar keys = require('object-keys');\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';\n\nvar toStr = Object.prototype.toString;\nvar concat = Array.prototype.concat;\nvar defineDataProperty = require('define-data-property');\n\nvar isFunction = function (fn) {\n\treturn typeof fn === 'function' && toStr.call(fn) === '[object Function]';\n};\n\nvar supportsDescriptors = require('has-property-descriptors')();\n\nvar defineProperty = function (object, name, value, predicate) {\n\tif (name in object) {\n\t\tif (predicate === true) {\n\t\t\tif (object[name] === value) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (!isFunction(predicate) || !predicate()) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (supportsDescriptors) {\n\t\tdefineDataProperty(object, name, value, true);\n\t} else {\n\t\tdefineDataProperty(object, name, value);\n\t}\n};\n\nvar defineProperties = function (object, map) {\n\tvar predicates = arguments.length > 2 ? arguments[2] : {};\n\tvar props = keys(map);\n\tif (hasSymbols) {\n\t\tprops = concat.call(props, Object.getOwnPropertySymbols(map));\n\t}\n\tfor (var i = 0; i < props.length; i += 1) {\n\t\tdefineProperty(object, props[i], map[props[i]], predicates[props[i]]);\n\t}\n};\n\ndefineProperties.supportsDescriptors = !!supportsDescriptors;\n\nmodule.exports = defineProperties;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar has = require('has');\n\nvar toStringTag = hasToStringTag ? Symbol.toStringTag : null;\n\nmodule.exports = function setToStringTag(object, value) {\n\tvar overrideIfSet = arguments.length > 2 && arguments[2] && arguments[2].force;\n\tif (toStringTag && (overrideIfSet || !has(object, toStringTag))) {\n\t\tif ($defineProperty) {\n\t\t\t$defineProperty(object, toStringTag, {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: false,\n\t\t\t\tvalue: value,\n\t\t\t\twritable: false\n\t\t\t});\n\t\t} else {\n\t\t\tobject[toStringTag] = value; // eslint-disable-line no-param-reassign\n\t\t}\n\t}\n};\n","'use strict';\n\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';\n\nvar isPrimitive = require('./helpers/isPrimitive');\nvar isCallable = require('is-callable');\nvar isDate = require('is-date-object');\nvar isSymbol = require('is-symbol');\n\nvar ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) {\n\tif (typeof O === 'undefined' || O === null) {\n\t\tthrow new TypeError('Cannot call method on ' + O);\n\t}\n\tif (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) {\n\t\tthrow new TypeError('hint must be \"string\" or \"number\"');\n\t}\n\tvar methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString'];\n\tvar method, result, i;\n\tfor (i = 0; i < methodNames.length; ++i) {\n\t\tmethod = O[methodNames[i]];\n\t\tif (isCallable(method)) {\n\t\t\tresult = method.call(O);\n\t\t\tif (isPrimitive(result)) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t}\n\tthrow new TypeError('No default value');\n};\n\nvar GetMethod = function GetMethod(O, P) {\n\tvar func = O[P];\n\tif (func !== null && typeof func !== 'undefined') {\n\t\tif (!isCallable(func)) {\n\t\t\tthrow new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function');\n\t\t}\n\t\treturn func;\n\t}\n\treturn void 0;\n};\n\n// http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive\nmodule.exports = function ToPrimitive(input) {\n\tif (isPrimitive(input)) {\n\t\treturn input;\n\t}\n\tvar hint = 'default';\n\tif (arguments.length > 1) {\n\t\tif (arguments[1] === String) {\n\t\t\thint = 'string';\n\t\t} else if (arguments[1] === Number) {\n\t\t\thint = 'number';\n\t\t}\n\t}\n\n\tvar exoticToPrim;\n\tif (hasSymbols) {\n\t\tif (Symbol.toPrimitive) {\n\t\t\texoticToPrim = GetMethod(input, Symbol.toPrimitive);\n\t\t} else if (isSymbol(input)) {\n\t\t\texoticToPrim = Symbol.prototype.valueOf;\n\t\t}\n\t}\n\tif (typeof exoticToPrim !== 'undefined') {\n\t\tvar result = exoticToPrim.call(input, hint);\n\t\tif (isPrimitive(result)) {\n\t\t\treturn result;\n\t\t}\n\t\tthrow new TypeError('unable to convert exotic object to primitive');\n\t}\n\tif (hint === 'default' && (isDate(input) || isSymbol(input))) {\n\t\thint = 'string';\n\t}\n\treturn ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint);\n};\n","'use strict';\n\nmodule.exports = function isPrimitive(value) {\n\treturn value === null || (typeof value !== 'function' && typeof value !== 'object');\n};\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slice.call(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n args.concat(slice.call(arguments))\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n } else {\n return target.apply(\n that,\n args.concat(slice.call(arguments))\n );\n }\n };\n\n var boundLength = Math.max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs.push('$' + i);\n }\n\n bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\nvar functionsHaveNames = function functionsHaveNames() {\n\treturn typeof function f() {}.name === 'string';\n};\n\nvar gOPD = Object.getOwnPropertyDescriptor;\nif (gOPD) {\n\ttry {\n\t\tgOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\tgOPD = null;\n\t}\n}\n\nfunctionsHaveNames.functionsHaveConfigurableNames = function functionsHaveConfigurableNames() {\n\tif (!functionsHaveNames() || !gOPD) {\n\t\treturn false;\n\t}\n\tvar desc = gOPD(function () {}, 'name');\n\treturn !!desc && !!desc.configurable;\n};\n\nvar $bind = Function.prototype.bind;\n\nfunctionsHaveNames.boundFunctionsHaveNames = function boundFunctionsHaveNames() {\n\treturn functionsHaveNames() && typeof $bind === 'function' && function f() {}.bind().name !== '';\n};\n\nmodule.exports = functionsHaveNames;\n","'use strict';\n\nvar undefined;\n\nvar $SyntaxError = SyntaxError;\nvar $Function = Function;\nvar $TypeError = TypeError;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\nif ($gOPD) {\n\ttry {\n\t\t$gOPD({}, '');\n\t} catch (e) {\n\t\t$gOPD = null; // this is IE 8, which has a broken gOPD\n\t}\n}\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\nvar hasProto = require('has-proto')();\n\nvar getProto = Object.getPrototypeOf || (\n\thasProto\n\t\t? function (x) { return x.__proto__; } // eslint-disable-line no-proto\n\t\t: null\n);\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,\n\t'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': EvalError,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': Object,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': RangeError,\n\t'%ReferenceError%': ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nif (getProto) {\n\ttry {\n\t\tnull.error; // eslint-disable-line no-unused-expressions\n\t} catch (e) {\n\t\t// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n\t\tvar errorProto = getProto(getProto(e));\n\t\tINTRINSICS['%Error.prototype%'] = errorProto;\n\t}\n}\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen && getProto) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('has');\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\nvar $exec = bind.call(Function.call, RegExp.prototype.exec);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tif ($exec(/^%?[^%]*%?$/, name) === null) {\n\t\tthrow new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');\n\t}\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\n\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasPropertyDescriptors = function hasPropertyDescriptors() {\n\tif ($defineProperty) {\n\t\ttry {\n\t\t\t$defineProperty({}, 'a', { value: 1 });\n\t\t\treturn true;\n\t\t} catch (e) {\n\t\t\t// IE 8 has a broken defineProperty\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn false;\n};\n\nhasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {\n\t// node v0.6 has a bug where array lengths can be Set but not Defined\n\tif (!hasPropertyDescriptors()) {\n\t\treturn null;\n\t}\n\ttry {\n\t\treturn $defineProperty([], 'length', { value: 1 }).length !== 1;\n\t} catch (e) {\n\t\t// In Firefox 4-22, defining length on an array throws an exception.\n\t\treturn true;\n\t}\n};\n\nmodule.exports = hasPropertyDescriptors;\n","'use strict';\n\nvar test = {\n\tfoo: {}\n};\n\nvar $Object = Object;\n\nmodule.exports = function hasProto() {\n\treturn { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar hasSymbols = require('has-symbols/shams');\n\nmodule.exports = function hasToStringTagShams() {\n\treturn hasSymbols() && !!Symbol.toStringTag;\n};\n","'use strict';\n\nvar hasOwnProperty = {}.hasOwnProperty;\nvar call = Function.prototype.call;\n\nmodule.exports = call.bind ? call.bind(hasOwnProperty) : function (O, P) {\n return call.call(hasOwnProperty, O, P);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar has = require('has');\nvar channel = require('side-channel')();\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar SLOT = {\n\tassert: function (O, slot) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tchannel.assert(O);\n\t\tif (!SLOT.has(O, slot)) {\n\t\t\tthrow new $TypeError('`' + slot + '` is not present on `O`');\n\t\t}\n\t},\n\tget: function (O, slot) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tvar slots = channel.get(O);\n\t\treturn slots && slots['$' + slot];\n\t},\n\thas: function (O, slot) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tvar slots = channel.get(O);\n\t\treturn !!slots && has(slots, '$' + slot);\n\t},\n\tset: function (O, slot, V) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tvar slots = channel.get(O);\n\t\tif (!slots) {\n\t\t\tslots = {};\n\t\t\tchannel.set(O, slots);\n\t\t}\n\t\tslots['$' + slot] = V;\n\t}\n};\n\nif (Object.freeze) {\n\tObject.freeze(SLOT);\n}\n\nmodule.exports = SLOT;\n","'use strict';\n\nvar fnToStr = Function.prototype.toString;\nvar reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;\nvar badArrayLike;\nvar isCallableMarker;\nif (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {\n\ttry {\n\t\tbadArrayLike = Object.defineProperty({}, 'length', {\n\t\t\tget: function () {\n\t\t\t\tthrow isCallableMarker;\n\t\t\t}\n\t\t});\n\t\tisCallableMarker = {};\n\t\t// eslint-disable-next-line no-throw-literal\n\t\treflectApply(function () { throw 42; }, null, badArrayLike);\n\t} catch (_) {\n\t\tif (_ !== isCallableMarker) {\n\t\t\treflectApply = null;\n\t\t}\n\t}\n} else {\n\treflectApply = null;\n}\n\nvar constructorRegex = /^\\s*class\\b/;\nvar isES6ClassFn = function isES6ClassFunction(value) {\n\ttry {\n\t\tvar fnStr = fnToStr.call(value);\n\t\treturn constructorRegex.test(fnStr);\n\t} catch (e) {\n\t\treturn false; // not a function\n\t}\n};\n\nvar tryFunctionObject = function tryFunctionToStr(value) {\n\ttry {\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tfnToStr.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\nvar toStr = Object.prototype.toString;\nvar objectClass = '[object Object]';\nvar fnClass = '[object Function]';\nvar genClass = '[object GeneratorFunction]';\nvar ddaClass = '[object HTMLAllCollection]'; // IE 11\nvar ddaClass2 = '[object HTML document.all class]';\nvar ddaClass3 = '[object HTMLCollection]'; // IE 9-10\nvar hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag`\n\nvar isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing\n\nvar isDDA = function isDocumentDotAll() { return false; };\nif (typeof document === 'object') {\n\t// Firefox 3 canonicalizes DDA to undefined when it's not accessed directly\n\tvar all = document.all;\n\tif (toStr.call(all) === toStr.call(document.all)) {\n\t\tisDDA = function isDocumentDotAll(value) {\n\t\t\t/* globals document: false */\n\t\t\t// in IE 6-8, typeof document.all is \"object\" and it's truthy\n\t\t\tif ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) {\n\t\t\t\ttry {\n\t\t\t\t\tvar str = toStr.call(value);\n\t\t\t\t\treturn (\n\t\t\t\t\t\tstr === ddaClass\n\t\t\t\t\t\t|| str === ddaClass2\n\t\t\t\t\t\t|| str === ddaClass3 // opera 12.16\n\t\t\t\t\t\t|| str === objectClass // IE 6-8\n\t\t\t\t\t) && value('') == null; // eslint-disable-line eqeqeq\n\t\t\t\t} catch (e) { /**/ }\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\t}\n}\n\nmodule.exports = reflectApply\n\t? function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\ttry {\n\t\t\treflectApply(value, null, badArrayLike);\n\t\t} catch (e) {\n\t\t\tif (e !== isCallableMarker) { return false; }\n\t\t}\n\t\treturn !isES6ClassFn(value) && tryFunctionObject(value);\n\t}\n\t: function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\tif (hasToStringTag) { return tryFunctionObject(value); }\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tvar strClass = toStr.call(value);\n\t\tif (strClass !== fnClass && strClass !== genClass && !(/^\\[object HTML/).test(strClass)) { return false; }\n\t\treturn tryFunctionObject(value);\n\t};\n","'use strict';\n\nvar getDay = Date.prototype.getDay;\nvar tryDateObject = function tryDateGetDayCall(value) {\n\ttry {\n\t\tgetDay.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\n\nvar toStr = Object.prototype.toString;\nvar dateClass = '[object Date]';\nvar hasToStringTag = require('has-tostringtag/shams')();\n\nmodule.exports = function isDateObject(value) {\n\tif (typeof value !== 'object' || value === null) {\n\t\treturn false;\n\t}\n\treturn hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass;\n};\n","'use strict';\n\nvar callBound = require('call-bind/callBound');\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar has;\nvar $exec;\nvar isRegexMarker;\nvar badStringifier;\n\nif (hasToStringTag) {\n\thas = callBound('Object.prototype.hasOwnProperty');\n\t$exec = callBound('RegExp.prototype.exec');\n\tisRegexMarker = {};\n\n\tvar throwRegexMarker = function () {\n\t\tthrow isRegexMarker;\n\t};\n\tbadStringifier = {\n\t\ttoString: throwRegexMarker,\n\t\tvalueOf: throwRegexMarker\n\t};\n\n\tif (typeof Symbol.toPrimitive === 'symbol') {\n\t\tbadStringifier[Symbol.toPrimitive] = throwRegexMarker;\n\t}\n}\n\nvar $toString = callBound('Object.prototype.toString');\nvar gOPD = Object.getOwnPropertyDescriptor;\nvar regexClass = '[object RegExp]';\n\nmodule.exports = hasToStringTag\n\t// eslint-disable-next-line consistent-return\n\t? function isRegex(value) {\n\t\tif (!value || typeof value !== 'object') {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar descriptor = gOPD(value, 'lastIndex');\n\t\tvar hasLastIndexDataProperty = descriptor && has(descriptor, 'value');\n\t\tif (!hasLastIndexDataProperty) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\t$exec(value, badStringifier);\n\t\t} catch (e) {\n\t\t\treturn e === isRegexMarker;\n\t\t}\n\t}\n\t: function isRegex(value) {\n\t\t// In older browsers, typeof regex incorrectly returns 'function'\n\t\tif (!value || (typeof value !== 'object' && typeof value !== 'function')) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $toString(value) === regexClass;\n\t};\n","'use strict';\n\nvar toStr = Object.prototype.toString;\nvar hasSymbols = require('has-symbols')();\n\nif (hasSymbols) {\n\tvar symToStr = Symbol.prototype.toString;\n\tvar symStringRegex = /^Symbol\\(.*\\)$/;\n\tvar isSymbolObject = function isRealSymbolObject(value) {\n\t\tif (typeof value.valueOf() !== 'symbol') {\n\t\t\treturn false;\n\t\t}\n\t\treturn symStringRegex.test(symToStr.call(value));\n\t};\n\n\tmodule.exports = function isSymbol(value) {\n\t\tif (typeof value === 'symbol') {\n\t\t\treturn true;\n\t\t}\n\t\tif (toStr.call(value) !== '[object Symbol]') {\n\t\t\treturn false;\n\t\t}\n\t\ttry {\n\t\t\treturn isSymbolObject(value);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n} else {\n\n\tmodule.exports = function isSymbol(value) {\n\t\t// this environment does not support Symbols.\n\t\treturn false && value;\n\t};\n}\n","var hasMap = typeof Map === 'function' && Map.prototype;\nvar mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;\nvar mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;\nvar mapForEach = hasMap && Map.prototype.forEach;\nvar hasSet = typeof Set === 'function' && Set.prototype;\nvar setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;\nvar setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;\nvar setForEach = hasSet && Set.prototype.forEach;\nvar hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;\nvar weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;\nvar hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;\nvar weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;\nvar hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;\nvar weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;\nvar booleanValueOf = Boolean.prototype.valueOf;\nvar objectToString = Object.prototype.toString;\nvar functionToString = Function.prototype.toString;\nvar $match = String.prototype.match;\nvar $slice = String.prototype.slice;\nvar $replace = String.prototype.replace;\nvar $toUpperCase = String.prototype.toUpperCase;\nvar $toLowerCase = String.prototype.toLowerCase;\nvar $test = RegExp.prototype.test;\nvar $concat = Array.prototype.concat;\nvar $join = Array.prototype.join;\nvar $arrSlice = Array.prototype.slice;\nvar $floor = Math.floor;\nvar bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;\nvar gOPS = Object.getOwnPropertySymbols;\nvar symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;\nvar hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';\n// ie, `has-tostringtag/shams\nvar toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')\n ? Symbol.toStringTag\n : null;\nvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\nvar gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (\n [].__proto__ === Array.prototype // eslint-disable-line no-proto\n ? function (O) {\n return O.__proto__; // eslint-disable-line no-proto\n }\n : null\n);\n\nfunction addNumericSeparator(num, str) {\n if (\n num === Infinity\n || num === -Infinity\n || num !== num\n || (num && num > -1000 && num < 1000)\n || $test.call(/e/, str)\n ) {\n return str;\n }\n var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;\n if (typeof num === 'number') {\n var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)\n if (int !== num) {\n var intStr = String(int);\n var dec = $slice.call(str, intStr.length + 1);\n return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');\n }\n }\n return $replace.call(str, sepRegex, '$&_');\n}\n\nvar utilInspect = require('./util.inspect');\nvar inspectCustom = utilInspect.custom;\nvar inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;\n\nmodule.exports = function inspect_(obj, options, depth, seen) {\n var opts = options || {};\n\n if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {\n throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');\n }\n if (\n has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'\n ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity\n : opts.maxStringLength !== null\n )\n ) {\n throw new TypeError('option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`');\n }\n var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;\n if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {\n throw new TypeError('option \"customInspect\", if provided, must be `true`, `false`, or `\\'symbol\\'`');\n }\n\n if (\n has(opts, 'indent')\n && opts.indent !== null\n && opts.indent !== '\\t'\n && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)\n ) {\n throw new TypeError('option \"indent\" must be \"\\\\t\", an integer > 0, or `null`');\n }\n if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {\n throw new TypeError('option \"numericSeparator\", if provided, must be `true` or `false`');\n }\n var numericSeparator = opts.numericSeparator;\n\n if (typeof obj === 'undefined') {\n return 'undefined';\n }\n if (obj === null) {\n return 'null';\n }\n if (typeof obj === 'boolean') {\n return obj ? 'true' : 'false';\n }\n\n if (typeof obj === 'string') {\n return inspectString(obj, opts);\n }\n if (typeof obj === 'number') {\n if (obj === 0) {\n return Infinity / obj > 0 ? '0' : '-0';\n }\n var str = String(obj);\n return numericSeparator ? addNumericSeparator(obj, str) : str;\n }\n if (typeof obj === 'bigint') {\n var bigIntStr = String(obj) + 'n';\n return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;\n }\n\n var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;\n if (typeof depth === 'undefined') { depth = 0; }\n if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {\n return isArray(obj) ? '[Array]' : '[Object]';\n }\n\n var indent = getIndent(opts, depth);\n\n if (typeof seen === 'undefined') {\n seen = [];\n } else if (indexOf(seen, obj) >= 0) {\n return '[Circular]';\n }\n\n function inspect(value, from, noIndent) {\n if (from) {\n seen = $arrSlice.call(seen);\n seen.push(from);\n }\n if (noIndent) {\n var newOpts = {\n depth: opts.depth\n };\n if (has(opts, 'quoteStyle')) {\n newOpts.quoteStyle = opts.quoteStyle;\n }\n return inspect_(value, newOpts, depth + 1, seen);\n }\n return inspect_(value, opts, depth + 1, seen);\n }\n\n if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable\n var name = nameOf(obj);\n var keys = arrObjKeys(obj, inspect);\n return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');\n }\n if (isSymbol(obj)) {\n var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\\(.*\\))_[^)]*$/, '$1') : symToString.call(obj);\n return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;\n }\n if (isElement(obj)) {\n var s = '<' + $toLowerCase.call(String(obj.nodeName));\n var attrs = obj.attributes || [];\n for (var i = 0; i < attrs.length; i++) {\n s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);\n }\n s += '>';\n if (obj.childNodes && obj.childNodes.length) { s += '...'; }\n s += '';\n return s;\n }\n if (isArray(obj)) {\n if (obj.length === 0) { return '[]'; }\n var xs = arrObjKeys(obj, inspect);\n if (indent && !singleLineValues(xs)) {\n return '[' + indentedJoin(xs, indent) + ']';\n }\n return '[ ' + $join.call(xs, ', ') + ' ]';\n }\n if (isError(obj)) {\n var parts = arrObjKeys(obj, inspect);\n if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {\n return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';\n }\n if (parts.length === 0) { return '[' + String(obj) + ']'; }\n return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';\n }\n if (typeof obj === 'object' && customInspect) {\n if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {\n return utilInspect(obj, { depth: maxDepth - depth });\n } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {\n return obj.inspect();\n }\n }\n if (isMap(obj)) {\n var mapParts = [];\n if (mapForEach) {\n mapForEach.call(obj, function (value, key) {\n mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));\n });\n }\n return collectionOf('Map', mapSize.call(obj), mapParts, indent);\n }\n if (isSet(obj)) {\n var setParts = [];\n if (setForEach) {\n setForEach.call(obj, function (value) {\n setParts.push(inspect(value, obj));\n });\n }\n return collectionOf('Set', setSize.call(obj), setParts, indent);\n }\n if (isWeakMap(obj)) {\n return weakCollectionOf('WeakMap');\n }\n if (isWeakSet(obj)) {\n return weakCollectionOf('WeakSet');\n }\n if (isWeakRef(obj)) {\n return weakCollectionOf('WeakRef');\n }\n if (isNumber(obj)) {\n return markBoxed(inspect(Number(obj)));\n }\n if (isBigInt(obj)) {\n return markBoxed(inspect(bigIntValueOf.call(obj)));\n }\n if (isBoolean(obj)) {\n return markBoxed(booleanValueOf.call(obj));\n }\n if (isString(obj)) {\n return markBoxed(inspect(String(obj)));\n }\n if (!isDate(obj) && !isRegExp(obj)) {\n var ys = arrObjKeys(obj, inspect);\n var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;\n var protoTag = obj instanceof Object ? '' : 'null prototype';\n var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';\n var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';\n var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');\n if (ys.length === 0) { return tag + '{}'; }\n if (indent) {\n return tag + '{' + indentedJoin(ys, indent) + '}';\n }\n return tag + '{ ' + $join.call(ys, ', ') + ' }';\n }\n return String(obj);\n};\n\nfunction wrapQuotes(s, defaultStyle, opts) {\n var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '\"' : \"'\";\n return quoteChar + s + quoteChar;\n}\n\nfunction quote(s) {\n return $replace.call(String(s), /\"/g, '"');\n}\n\nfunction isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\n\n// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives\nfunction isSymbol(obj) {\n if (hasShammedSymbols) {\n return obj && typeof obj === 'object' && obj instanceof Symbol;\n }\n if (typeof obj === 'symbol') {\n return true;\n }\n if (!obj || typeof obj !== 'object' || !symToString) {\n return false;\n }\n try {\n symToString.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isBigInt(obj) {\n if (!obj || typeof obj !== 'object' || !bigIntValueOf) {\n return false;\n }\n try {\n bigIntValueOf.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };\nfunction has(obj, key) {\n return hasOwn.call(obj, key);\n}\n\nfunction toStr(obj) {\n return objectToString.call(obj);\n}\n\nfunction nameOf(f) {\n if (f.name) { return f.name; }\n var m = $match.call(functionToString.call(f), /^function\\s*([\\w$]+)/);\n if (m) { return m[1]; }\n return null;\n}\n\nfunction indexOf(xs, x) {\n if (xs.indexOf) { return xs.indexOf(x); }\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) { return i; }\n }\n return -1;\n}\n\nfunction isMap(x) {\n if (!mapSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n mapSize.call(x);\n try {\n setSize.call(x);\n } catch (s) {\n return true;\n }\n return x instanceof Map; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakMap(x) {\n if (!weakMapHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakMapHas.call(x, weakMapHas);\n try {\n weakSetHas.call(x, weakSetHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakMap; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakRef(x) {\n if (!weakRefDeref || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakRefDeref.call(x);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isSet(x) {\n if (!setSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n setSize.call(x);\n try {\n mapSize.call(x);\n } catch (m) {\n return true;\n }\n return x instanceof Set; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakSet(x) {\n if (!weakSetHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakSetHas.call(x, weakSetHas);\n try {\n weakMapHas.call(x, weakMapHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakSet; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isElement(x) {\n if (!x || typeof x !== 'object') { return false; }\n if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {\n return true;\n }\n return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';\n}\n\nfunction inspectString(str, opts) {\n if (str.length > opts.maxStringLength) {\n var remaining = str.length - opts.maxStringLength;\n var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');\n return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;\n }\n // eslint-disable-next-line no-control-regex\n var s = $replace.call($replace.call(str, /(['\\\\])/g, '\\\\$1'), /[\\x00-\\x1f]/g, lowbyte);\n return wrapQuotes(s, 'single', opts);\n}\n\nfunction lowbyte(c) {\n var n = c.charCodeAt(0);\n var x = {\n 8: 'b',\n 9: 't',\n 10: 'n',\n 12: 'f',\n 13: 'r'\n }[n];\n if (x) { return '\\\\' + x; }\n return '\\\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));\n}\n\nfunction markBoxed(str) {\n return 'Object(' + str + ')';\n}\n\nfunction weakCollectionOf(type) {\n return type + ' { ? }';\n}\n\nfunction collectionOf(type, size, entries, indent) {\n var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');\n return type + ' (' + size + ') {' + joinedEntries + '}';\n}\n\nfunction singleLineValues(xs) {\n for (var i = 0; i < xs.length; i++) {\n if (indexOf(xs[i], '\\n') >= 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction getIndent(opts, depth) {\n var baseIndent;\n if (opts.indent === '\\t') {\n baseIndent = '\\t';\n } else if (typeof opts.indent === 'number' && opts.indent > 0) {\n baseIndent = $join.call(Array(opts.indent + 1), ' ');\n } else {\n return null;\n }\n return {\n base: baseIndent,\n prev: $join.call(Array(depth + 1), baseIndent)\n };\n}\n\nfunction indentedJoin(xs, indent) {\n if (xs.length === 0) { return ''; }\n var lineJoiner = '\\n' + indent.prev + indent.base;\n return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\\n' + indent.prev;\n}\n\nfunction arrObjKeys(obj, inspect) {\n var isArr = isArray(obj);\n var xs = [];\n if (isArr) {\n xs.length = obj.length;\n for (var i = 0; i < obj.length; i++) {\n xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';\n }\n }\n var syms = typeof gOPS === 'function' ? gOPS(obj) : [];\n var symMap;\n if (hasShammedSymbols) {\n symMap = {};\n for (var k = 0; k < syms.length; k++) {\n symMap['$' + syms[k]] = syms[k];\n }\n }\n\n for (var key in obj) { // eslint-disable-line no-restricted-syntax\n if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {\n // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section\n continue; // eslint-disable-line no-restricted-syntax, no-continue\n } else if ($test.call(/[^\\w$]/, key)) {\n xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));\n } else {\n xs.push(key + ': ' + inspect(obj[key], obj));\n }\n }\n if (typeof gOPS === 'function') {\n for (var j = 0; j < syms.length; j++) {\n if (isEnumerable.call(obj, syms[j])) {\n xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));\n }\n }\n }\n return xs;\n}\n","'use strict';\n\nvar keysShim;\nif (!Object.keys) {\n\t// modified from https://github.com/es-shims/es5-shim\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar toStr = Object.prototype.toString;\n\tvar isArgs = require('./isArguments'); // eslint-disable-line global-require\n\tvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\tvar hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');\n\tvar hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');\n\tvar dontEnums = [\n\t\t'toString',\n\t\t'toLocaleString',\n\t\t'valueOf',\n\t\t'hasOwnProperty',\n\t\t'isPrototypeOf',\n\t\t'propertyIsEnumerable',\n\t\t'constructor'\n\t];\n\tvar equalsConstructorPrototype = function (o) {\n\t\tvar ctor = o.constructor;\n\t\treturn ctor && ctor.prototype === o;\n\t};\n\tvar excludedKeys = {\n\t\t$applicationCache: true,\n\t\t$console: true,\n\t\t$external: true,\n\t\t$frame: true,\n\t\t$frameElement: true,\n\t\t$frames: true,\n\t\t$innerHeight: true,\n\t\t$innerWidth: true,\n\t\t$onmozfullscreenchange: true,\n\t\t$onmozfullscreenerror: true,\n\t\t$outerHeight: true,\n\t\t$outerWidth: true,\n\t\t$pageXOffset: true,\n\t\t$pageYOffset: true,\n\t\t$parent: true,\n\t\t$scrollLeft: true,\n\t\t$scrollTop: true,\n\t\t$scrollX: true,\n\t\t$scrollY: true,\n\t\t$self: true,\n\t\t$webkitIndexedDB: true,\n\t\t$webkitStorageInfo: true,\n\t\t$window: true\n\t};\n\tvar hasAutomationEqualityBug = (function () {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined') { return false; }\n\t\tfor (var k in window) {\n\t\t\ttry {\n\t\t\t\tif (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tequalsConstructorPrototype(window[k]);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}());\n\tvar equalsConstructorPrototypeIfNotBuggy = function (o) {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined' || !hasAutomationEqualityBug) {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t}\n\t\ttry {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tkeysShim = function keys(object) {\n\t\tvar isObject = object !== null && typeof object === 'object';\n\t\tvar isFunction = toStr.call(object) === '[object Function]';\n\t\tvar isArguments = isArgs(object);\n\t\tvar isString = isObject && toStr.call(object) === '[object String]';\n\t\tvar theKeys = [];\n\n\t\tif (!isObject && !isFunction && !isArguments) {\n\t\t\tthrow new TypeError('Object.keys called on a non-object');\n\t\t}\n\n\t\tvar skipProto = hasProtoEnumBug && isFunction;\n\t\tif (isString && object.length > 0 && !has.call(object, 0)) {\n\t\t\tfor (var i = 0; i < object.length; ++i) {\n\t\t\t\ttheKeys.push(String(i));\n\t\t\t}\n\t\t}\n\n\t\tif (isArguments && object.length > 0) {\n\t\t\tfor (var j = 0; j < object.length; ++j) {\n\t\t\t\ttheKeys.push(String(j));\n\t\t\t}\n\t\t} else {\n\t\t\tfor (var name in object) {\n\t\t\t\tif (!(skipProto && name === 'prototype') && has.call(object, name)) {\n\t\t\t\t\ttheKeys.push(String(name));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (hasDontEnumBug) {\n\t\t\tvar skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);\n\n\t\t\tfor (var k = 0; k < dontEnums.length; ++k) {\n\t\t\t\tif (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {\n\t\t\t\t\ttheKeys.push(dontEnums[k]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn theKeys;\n\t};\n}\nmodule.exports = keysShim;\n","'use strict';\n\nvar slice = Array.prototype.slice;\nvar isArgs = require('./isArguments');\n\nvar origKeys = Object.keys;\nvar keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');\n\nvar originalKeys = Object.keys;\n\nkeysShim.shim = function shimObjectKeys() {\n\tif (Object.keys) {\n\t\tvar keysWorksWithArguments = (function () {\n\t\t\t// Safari 5.0 bug\n\t\t\tvar args = Object.keys(arguments);\n\t\t\treturn args && args.length === arguments.length;\n\t\t}(1, 2));\n\t\tif (!keysWorksWithArguments) {\n\t\t\tObject.keys = function keys(object) { // eslint-disable-line func-name-matching\n\t\t\t\tif (isArgs(object)) {\n\t\t\t\t\treturn originalKeys(slice.call(object));\n\t\t\t\t}\n\t\t\t\treturn originalKeys(object);\n\t\t\t};\n\t\t}\n\t} else {\n\t\tObject.keys = keysShim;\n\t}\n\treturn Object.keys || keysShim;\n};\n\nmodule.exports = keysShim;\n","'use strict';\n\nvar toStr = Object.prototype.toString;\n\nmodule.exports = function isArguments(value) {\n\tvar str = toStr.call(value);\n\tvar isArgs = str === '[object Arguments]';\n\tif (!isArgs) {\n\t\tisArgs = str !== '[object Array]' &&\n\t\t\tvalue !== null &&\n\t\t\ttypeof value === 'object' &&\n\t\t\ttypeof value.length === 'number' &&\n\t\t\tvalue.length >= 0 &&\n\t\t\ttoStr.call(value.callee) === '[object Function]';\n\t}\n\treturn isArgs;\n};\n","'use strict';\n\nvar setFunctionName = require('set-function-name');\n\nvar $Object = Object;\nvar $TypeError = TypeError;\n\nmodule.exports = setFunctionName(function flags() {\n\tif (this != null && this !== $Object(this)) {\n\t\tthrow new $TypeError('RegExp.prototype.flags getter called on non-object');\n\t}\n\tvar result = '';\n\tif (this.hasIndices) {\n\t\tresult += 'd';\n\t}\n\tif (this.global) {\n\t\tresult += 'g';\n\t}\n\tif (this.ignoreCase) {\n\t\tresult += 'i';\n\t}\n\tif (this.multiline) {\n\t\tresult += 'm';\n\t}\n\tif (this.dotAll) {\n\t\tresult += 's';\n\t}\n\tif (this.unicode) {\n\t\tresult += 'u';\n\t}\n\tif (this.unicodeSets) {\n\t\tresult += 'v';\n\t}\n\tif (this.sticky) {\n\t\tresult += 'y';\n\t}\n\treturn result;\n}, 'get flags', true);\n\n","'use strict';\n\nvar define = require('define-properties');\nvar callBind = require('call-bind');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar flagsBound = callBind(getPolyfill());\n\ndefine(flagsBound, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = flagsBound;\n","'use strict';\n\nvar implementation = require('./implementation');\n\nvar supportsDescriptors = require('define-properties').supportsDescriptors;\nvar $gOPD = Object.getOwnPropertyDescriptor;\n\nmodule.exports = function getPolyfill() {\n\tif (supportsDescriptors && (/a/mig).flags === 'gim') {\n\t\tvar descriptor = $gOPD(RegExp.prototype, 'flags');\n\t\tif (\n\t\t\tdescriptor\n\t\t\t&& typeof descriptor.get === 'function'\n\t\t\t&& typeof RegExp.prototype.dotAll === 'boolean'\n\t\t\t&& typeof RegExp.prototype.hasIndices === 'boolean'\n\t\t) {\n\t\t\t/* eslint getter-return: 0 */\n\t\t\tvar calls = '';\n\t\t\tvar o = {};\n\t\t\tObject.defineProperty(o, 'hasIndices', {\n\t\t\t\tget: function () {\n\t\t\t\t\tcalls += 'd';\n\t\t\t\t}\n\t\t\t});\n\t\t\tObject.defineProperty(o, 'sticky', {\n\t\t\t\tget: function () {\n\t\t\t\t\tcalls += 'y';\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (calls === 'dy') {\n\t\t\t\treturn descriptor.get;\n\t\t\t}\n\t\t}\n\t}\n\treturn implementation;\n};\n","'use strict';\n\nvar supportsDescriptors = require('define-properties').supportsDescriptors;\nvar getPolyfill = require('./polyfill');\nvar gOPD = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar TypeErr = TypeError;\nvar getProto = Object.getPrototypeOf;\nvar regex = /a/;\n\nmodule.exports = function shimFlags() {\n\tif (!supportsDescriptors || !getProto) {\n\t\tthrow new TypeErr('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');\n\t}\n\tvar polyfill = getPolyfill();\n\tvar proto = getProto(regex);\n\tvar descriptor = gOPD(proto, 'flags');\n\tif (!descriptor || descriptor.get !== polyfill) {\n\t\tdefineProperty(proto, 'flags', {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tget: polyfill\n\t\t});\n\t}\n\treturn polyfill;\n};\n","'use strict';\n\nvar callBound = require('call-bind/callBound');\nvar GetIntrinsic = require('get-intrinsic');\nvar isRegex = require('is-regex');\n\nvar $exec = callBound('RegExp.prototype.exec');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nmodule.exports = function regexTester(regex) {\n\tif (!isRegex(regex)) {\n\t\tthrow new $TypeError('`regex` must be a RegExp');\n\t}\n\treturn function test(s) {\n\t\treturn $exec(regex, s) !== null;\n\t};\n};\n","'use strict';\n\nvar define = require('define-data-property');\nvar hasDescriptors = require('has-property-descriptors')();\nvar functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames();\n\nvar $TypeError = TypeError;\n\nmodule.exports = function setFunctionName(fn, name) {\n\tif (typeof fn !== 'function') {\n\t\tthrow new $TypeError('`fn` is not a function');\n\t}\n\tvar loose = arguments.length > 2 && !!arguments[2];\n\tif (!loose || functionsHaveConfigurableNames) {\n\t\tif (hasDescriptors) {\n\t\t\tdefine(fn, 'name', name, true, true);\n\t\t} else {\n\t\t\tdefine(fn, 'name', name);\n\t\t}\n\t}\n\treturn fn;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bind/callBound');\nvar inspect = require('object-inspect');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $WeakMap = GetIntrinsic('%WeakMap%', true);\nvar $Map = GetIntrinsic('%Map%', true);\n\nvar $weakMapGet = callBound('WeakMap.prototype.get', true);\nvar $weakMapSet = callBound('WeakMap.prototype.set', true);\nvar $weakMapHas = callBound('WeakMap.prototype.has', true);\nvar $mapGet = callBound('Map.prototype.get', true);\nvar $mapSet = callBound('Map.prototype.set', true);\nvar $mapHas = callBound('Map.prototype.has', true);\n\n/*\n * This function traverses the list returning the node corresponding to the\n * given key.\n *\n * That node is also moved to the head of the list, so that if it's accessed\n * again we don't need to traverse the whole list. By doing so, all the recently\n * used nodes can be accessed relatively quickly.\n */\nvar listGetNode = function (list, key) { // eslint-disable-line consistent-return\n\tfor (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {\n\t\tif (curr.key === key) {\n\t\t\tprev.next = curr.next;\n\t\t\tcurr.next = list.next;\n\t\t\tlist.next = curr; // eslint-disable-line no-param-reassign\n\t\t\treturn curr;\n\t\t}\n\t}\n};\n\nvar listGet = function (objects, key) {\n\tvar node = listGetNode(objects, key);\n\treturn node && node.value;\n};\nvar listSet = function (objects, key, value) {\n\tvar node = listGetNode(objects, key);\n\tif (node) {\n\t\tnode.value = value;\n\t} else {\n\t\t// Prepend the new node to the beginning of the list\n\t\tobjects.next = { // eslint-disable-line no-param-reassign\n\t\t\tkey: key,\n\t\t\tnext: objects.next,\n\t\t\tvalue: value\n\t\t};\n\t}\n};\nvar listHas = function (objects, key) {\n\treturn !!listGetNode(objects, key);\n};\n\nmodule.exports = function getSideChannel() {\n\tvar $wm;\n\tvar $m;\n\tvar $o;\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\tget: function (key) { // eslint-disable-line consistent-return\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapGet($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapGet($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listGet($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\thas: function (key) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapHas($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapHas($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listHas($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif (!$wm) {\n\t\t\t\t\t$wm = new $WeakMap();\n\t\t\t\t}\n\t\t\t\t$weakMapSet($wm, key, value);\n\t\t\t} else if ($Map) {\n\t\t\t\tif (!$m) {\n\t\t\t\t\t$m = new $Map();\n\t\t\t\t}\n\t\t\t\t$mapSet($m, key, value);\n\t\t\t} else {\n\t\t\t\tif (!$o) {\n\t\t\t\t\t/*\n\t\t\t\t\t * Initialize the linked list as an empty node, so that we don't have\n\t\t\t\t\t * to special-case handling of the first node: we can always refer to\n\t\t\t\t\t * it as (previous node).next, instead of something like (list).head\n\t\t\t\t\t */\n\t\t\t\t\t$o = { key: {}, next: null };\n\t\t\t\t}\n\t\t\t\tlistSet($o, key, value);\n\t\t\t}\n\t\t}\n\t};\n\treturn channel;\n};\n","'use strict';\n\nvar Call = require('es-abstract/2023/Call');\nvar Get = require('es-abstract/2023/Get');\nvar GetMethod = require('es-abstract/2023/GetMethod');\nvar IsRegExp = require('es-abstract/2023/IsRegExp');\nvar ToString = require('es-abstract/2023/ToString');\nvar RequireObjectCoercible = require('es-abstract/2023/RequireObjectCoercible');\nvar callBound = require('call-bind/callBound');\nvar hasSymbols = require('has-symbols')();\nvar flagsGetter = require('regexp.prototype.flags');\n\nvar $indexOf = callBound('String.prototype.indexOf');\n\nvar regexpMatchAllPolyfill = require('./polyfill-regexp-matchall');\n\nvar getMatcher = function getMatcher(regexp) { // eslint-disable-line consistent-return\n\tvar matcherPolyfill = regexpMatchAllPolyfill();\n\tif (hasSymbols && typeof Symbol.matchAll === 'symbol') {\n\t\tvar matcher = GetMethod(regexp, Symbol.matchAll);\n\t\tif (matcher === RegExp.prototype[Symbol.matchAll] && matcher !== matcherPolyfill) {\n\t\t\treturn matcherPolyfill;\n\t\t}\n\t\treturn matcher;\n\t}\n\t// fallback for pre-Symbol.matchAll environments\n\tif (IsRegExp(regexp)) {\n\t\treturn matcherPolyfill;\n\t}\n};\n\nmodule.exports = function matchAll(regexp) {\n\tvar O = RequireObjectCoercible(this);\n\n\tif (typeof regexp !== 'undefined' && regexp !== null) {\n\t\tvar isRegExp = IsRegExp(regexp);\n\t\tif (isRegExp) {\n\t\t\t// workaround for older engines that lack RegExp.prototype.flags\n\t\t\tvar flags = 'flags' in regexp ? Get(regexp, 'flags') : flagsGetter(regexp);\n\t\t\tRequireObjectCoercible(flags);\n\t\t\tif ($indexOf(ToString(flags), 'g') < 0) {\n\t\t\t\tthrow new TypeError('matchAll requires a global regular expression');\n\t\t\t}\n\t\t}\n\n\t\tvar matcher = getMatcher(regexp);\n\t\tif (typeof matcher !== 'undefined') {\n\t\t\treturn Call(matcher, regexp, [O]);\n\t\t}\n\t}\n\n\tvar S = ToString(O);\n\t// var rx = RegExpCreate(regexp, 'g');\n\tvar rx = new RegExp(regexp, 'g');\n\treturn Call(getMatcher(rx), rx, [S]);\n};\n","'use strict';\n\nvar callBind = require('call-bind');\nvar define = require('define-properties');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar boundMatchAll = callBind(implementation);\n\ndefine(boundMatchAll, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = boundMatchAll;\n","'use strict';\n\nvar hasSymbols = require('has-symbols')();\nvar regexpMatchAll = require('./regexp-matchall');\n\nmodule.exports = function getRegExpMatchAllPolyfill() {\n\tif (!hasSymbols || typeof Symbol.matchAll !== 'symbol' || typeof RegExp.prototype[Symbol.matchAll] !== 'function') {\n\t\treturn regexpMatchAll;\n\t}\n\treturn RegExp.prototype[Symbol.matchAll];\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = function getPolyfill() {\n\tif (String.prototype.matchAll) {\n\t\ttry {\n\t\t\t''.matchAll(RegExp.prototype);\n\t\t} catch (e) {\n\t\t\treturn String.prototype.matchAll;\n\t\t}\n\t}\n\treturn implementation;\n};\n","'use strict';\n\n// var Construct = require('es-abstract/2023/Construct');\nvar CreateRegExpStringIterator = require('es-abstract/2023/CreateRegExpStringIterator');\nvar Get = require('es-abstract/2023/Get');\nvar Set = require('es-abstract/2023/Set');\nvar SpeciesConstructor = require('es-abstract/2023/SpeciesConstructor');\nvar ToLength = require('es-abstract/2023/ToLength');\nvar ToString = require('es-abstract/2023/ToString');\nvar Type = require('es-abstract/2023/Type');\nvar flagsGetter = require('regexp.prototype.flags');\nvar setFunctionName = require('set-function-name');\nvar callBound = require('call-bind/callBound');\n\nvar $indexOf = callBound('String.prototype.indexOf');\n\nvar OrigRegExp = RegExp;\n\nvar supportsConstructingWithFlags = 'flags' in RegExp.prototype;\n\nvar constructRegexWithFlags = function constructRegex(C, R) {\n\tvar matcher;\n\t// workaround for older engines that lack RegExp.prototype.flags\n\tvar flags = 'flags' in R ? Get(R, 'flags') : ToString(flagsGetter(R));\n\tif (supportsConstructingWithFlags && typeof flags === 'string') {\n\t\tmatcher = new C(R, flags);\n\t} else if (C === OrigRegExp) {\n\t\t// workaround for older engines that can not construct a RegExp with flags\n\t\tmatcher = new C(R.source, flags);\n\t} else {\n\t\tmatcher = new C(R, flags);\n\t}\n\treturn { flags: flags, matcher: matcher };\n};\n\nvar regexMatchAll = setFunctionName(function SymbolMatchAll(string) {\n\tvar R = this;\n\tif (Type(R) !== 'Object') {\n\t\tthrow new TypeError('\"this\" value must be an Object');\n\t}\n\tvar S = ToString(string);\n\tvar C = SpeciesConstructor(R, OrigRegExp);\n\n\tvar tmp = constructRegexWithFlags(C, R);\n\t// var flags = ToString(Get(R, 'flags'));\n\tvar flags = tmp.flags;\n\t// var matcher = Construct(C, [R, flags]);\n\tvar matcher = tmp.matcher;\n\n\tvar lastIndex = ToLength(Get(R, 'lastIndex'));\n\tSet(matcher, 'lastIndex', lastIndex, true);\n\tvar global = $indexOf(flags, 'g') > -1;\n\tvar fullUnicode = $indexOf(flags, 'u') > -1;\n\treturn CreateRegExpStringIterator(matcher, S, global, fullUnicode);\n}, '[Symbol.matchAll]', true);\n\nmodule.exports = regexMatchAll;\n","'use strict';\n\nvar define = require('define-properties');\nvar hasSymbols = require('has-symbols')();\nvar getPolyfill = require('./polyfill');\nvar regexpMatchAllPolyfill = require('./polyfill-regexp-matchall');\n\nvar defineP = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nmodule.exports = function shimMatchAll() {\n\tvar polyfill = getPolyfill();\n\tdefine(\n\t\tString.prototype,\n\t\t{ matchAll: polyfill },\n\t\t{ matchAll: function () { return String.prototype.matchAll !== polyfill; } }\n\t);\n\tif (hasSymbols) {\n\t\t// eslint-disable-next-line no-restricted-properties\n\t\tvar symbol = Symbol.matchAll || (Symbol['for'] ? Symbol['for']('Symbol.matchAll') : Symbol('Symbol.matchAll'));\n\t\tdefine(\n\t\t\tSymbol,\n\t\t\t{ matchAll: symbol },\n\t\t\t{ matchAll: function () { return Symbol.matchAll !== symbol; } }\n\t\t);\n\n\t\tif (defineP && gOPD) {\n\t\t\tvar desc = gOPD(Symbol, symbol);\n\t\t\tif (!desc || desc.configurable) {\n\t\t\t\tdefineP(Symbol, symbol, {\n\t\t\t\t\tconfigurable: false,\n\t\t\t\t\tenumerable: false,\n\t\t\t\t\tvalue: symbol,\n\t\t\t\t\twritable: false\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tvar regexpMatchAll = regexpMatchAllPolyfill();\n\t\tvar func = {};\n\t\tfunc[symbol] = regexpMatchAll;\n\t\tvar predicate = {};\n\t\tpredicate[symbol] = function () {\n\t\t\treturn RegExp.prototype[symbol] !== regexpMatchAll;\n\t\t};\n\t\tdefine(RegExp.prototype, func, predicate);\n\t}\n\treturn polyfill;\n};\n","'use strict';\n\nvar RequireObjectCoercible = require('es-abstract/2023/RequireObjectCoercible');\nvar ToString = require('es-abstract/2023/ToString');\nvar callBound = require('call-bind/callBound');\nvar $replace = callBound('String.prototype.replace');\n\nvar mvsIsWS = (/^\\s$/).test('\\u180E');\n/* eslint-disable no-control-regex */\nvar leftWhitespace = mvsIsWS\n\t? /^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+/\n\t: /^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+/;\nvar rightWhitespace = mvsIsWS\n\t? /[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+$/\n\t: /[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+$/;\n/* eslint-enable no-control-regex */\n\nmodule.exports = function trim() {\n\tvar S = ToString(RequireObjectCoercible(this));\n\treturn $replace($replace(S, leftWhitespace, ''), rightWhitespace, '');\n};\n","'use strict';\n\nvar callBind = require('call-bind');\nvar define = require('define-properties');\nvar RequireObjectCoercible = require('es-abstract/2023/RequireObjectCoercible');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar bound = callBind(getPolyfill());\nvar boundMethod = function trim(receiver) {\n\tRequireObjectCoercible(receiver);\n\treturn bound(receiver);\n};\n\ndefine(boundMethod, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = boundMethod;\n","'use strict';\n\nvar implementation = require('./implementation');\n\nvar zeroWidthSpace = '\\u200b';\nvar mongolianVowelSeparator = '\\u180E';\n\nmodule.exports = function getPolyfill() {\n\tif (\n\t\tString.prototype.trim\n\t\t&& zeroWidthSpace.trim() === zeroWidthSpace\n\t\t&& mongolianVowelSeparator.trim() === mongolianVowelSeparator\n\t\t&& ('_' + mongolianVowelSeparator).trim() === ('_' + mongolianVowelSeparator)\n\t\t&& (mongolianVowelSeparator + '_').trim() === (mongolianVowelSeparator + '_')\n\t) {\n\t\treturn String.prototype.trim;\n\t}\n\treturn implementation;\n};\n","'use strict';\n\nvar define = require('define-properties');\nvar getPolyfill = require('./polyfill');\n\nmodule.exports = function shimStringTrim() {\n\tvar polyfill = getPolyfill();\n\tdefine(String.prototype, { trim: polyfill }, {\n\t\ttrim: function testTrim() {\n\t\t\treturn String.prototype.trim !== polyfill;\n\t\t}\n\t});\n\treturn polyfill;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar CodePointAt = require('./CodePointAt');\nvar Type = require('./Type');\n\nvar isInteger = require('../helpers/isInteger');\nvar MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// https://262.ecma-international.org/12.0/#sec-advancestringindex\n\nmodule.exports = function AdvanceStringIndex(S, index, unicode) {\n\tif (Type(S) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `S` must be a String');\n\t}\n\tif (!isInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) {\n\t\tthrow new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53');\n\t}\n\tif (Type(unicode) !== 'Boolean') {\n\t\tthrow new $TypeError('Assertion failed: `unicode` must be a Boolean');\n\t}\n\tif (!unicode) {\n\t\treturn index + 1;\n\t}\n\tvar length = S.length;\n\tif ((index + 1) >= length) {\n\t\treturn index + 1;\n\t}\n\tvar cp = CodePointAt(S, index);\n\treturn index + cp['[[CodeUnitCount]]'];\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bind/callBound');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar IsArray = require('./IsArray');\n\nvar $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('Function.prototype.apply');\n\n// https://262.ecma-international.org/6.0/#sec-call\n\nmodule.exports = function Call(F, V) {\n\tvar argumentsList = arguments.length > 2 ? arguments[2] : [];\n\tif (!IsArray(argumentsList)) {\n\t\tthrow new $TypeError('Assertion failed: optional `argumentsList`, if provided, must be a List');\n\t}\n\treturn $apply(F, V, argumentsList);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar callBound = require('call-bind/callBound');\nvar isLeadingSurrogate = require('../helpers/isLeadingSurrogate');\nvar isTrailingSurrogate = require('../helpers/isTrailingSurrogate');\n\nvar Type = require('./Type');\nvar UTF16SurrogatePairToCodePoint = require('./UTF16SurrogatePairToCodePoint');\n\nvar $charAt = callBound('String.prototype.charAt');\nvar $charCodeAt = callBound('String.prototype.charCodeAt');\n\n// https://262.ecma-international.org/12.0/#sec-codepointat\n\nmodule.exports = function CodePointAt(string, position) {\n\tif (Type(string) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `string` must be a String');\n\t}\n\tvar size = string.length;\n\tif (position < 0 || position >= size) {\n\t\tthrow new $TypeError('Assertion failed: `position` must be >= 0, and < the length of `string`');\n\t}\n\tvar first = $charCodeAt(string, position);\n\tvar cp = $charAt(string, position);\n\tvar firstIsLeading = isLeadingSurrogate(first);\n\tvar firstIsTrailing = isTrailingSurrogate(first);\n\tif (!firstIsLeading && !firstIsTrailing) {\n\t\treturn {\n\t\t\t'[[CodePoint]]': cp,\n\t\t\t'[[CodeUnitCount]]': 1,\n\t\t\t'[[IsUnpairedSurrogate]]': false\n\t\t};\n\t}\n\tif (firstIsTrailing || (position + 1 === size)) {\n\t\treturn {\n\t\t\t'[[CodePoint]]': cp,\n\t\t\t'[[CodeUnitCount]]': 1,\n\t\t\t'[[IsUnpairedSurrogate]]': true\n\t\t};\n\t}\n\tvar second = $charCodeAt(string, position + 1);\n\tif (!isTrailingSurrogate(second)) {\n\t\treturn {\n\t\t\t'[[CodePoint]]': cp,\n\t\t\t'[[CodeUnitCount]]': 1,\n\t\t\t'[[IsUnpairedSurrogate]]': true\n\t\t};\n\t}\n\n\treturn {\n\t\t'[[CodePoint]]': UTF16SurrogatePairToCodePoint(first, second),\n\t\t'[[CodeUnitCount]]': 2,\n\t\t'[[IsUnpairedSurrogate]]': false\n\t};\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-createiterresultobject\n\nmodule.exports = function CreateIterResultObject(value, done) {\n\tif (Type(done) !== 'Boolean') {\n\t\tthrow new $TypeError('Assertion failed: Type(done) is not Boolean');\n\t}\n\treturn {\n\t\tvalue: value,\n\t\tdone: done\n\t};\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar DefineOwnProperty = require('../helpers/DefineOwnProperty');\n\nvar FromPropertyDescriptor = require('./FromPropertyDescriptor');\nvar IsDataDescriptor = require('./IsDataDescriptor');\nvar IsPropertyKey = require('./IsPropertyKey');\nvar SameValue = require('./SameValue');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-createmethodproperty\n\nmodule.exports = function CreateMethodProperty(O, P, V) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true');\n\t}\n\n\tvar newDesc = {\n\t\t'[[Configurable]]': true,\n\t\t'[[Enumerable]]': false,\n\t\t'[[Value]]': V,\n\t\t'[[Writable]]': true\n\t};\n\treturn DefineOwnProperty(\n\t\tIsDataDescriptor,\n\t\tSameValue,\n\t\tFromPropertyDescriptor,\n\t\tO,\n\t\tP,\n\t\tnewDesc\n\t);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar hasSymbols = require('has-symbols')();\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar IteratorPrototype = GetIntrinsic('%IteratorPrototype%', true);\n\nvar AdvanceStringIndex = require('./AdvanceStringIndex');\nvar CreateIterResultObject = require('./CreateIterResultObject');\nvar CreateMethodProperty = require('./CreateMethodProperty');\nvar Get = require('./Get');\nvar OrdinaryObjectCreate = require('./OrdinaryObjectCreate');\nvar RegExpExec = require('./RegExpExec');\nvar Set = require('./Set');\nvar ToLength = require('./ToLength');\nvar ToString = require('./ToString');\nvar Type = require('./Type');\n\nvar SLOT = require('internal-slot');\nvar setToStringTag = require('es-set-tostringtag');\n\nvar RegExpStringIterator = function RegExpStringIterator(R, S, global, fullUnicode) {\n\tif (Type(S) !== 'String') {\n\t\tthrow new $TypeError('`S` must be a string');\n\t}\n\tif (Type(global) !== 'Boolean') {\n\t\tthrow new $TypeError('`global` must be a boolean');\n\t}\n\tif (Type(fullUnicode) !== 'Boolean') {\n\t\tthrow new $TypeError('`fullUnicode` must be a boolean');\n\t}\n\tSLOT.set(this, '[[IteratingRegExp]]', R);\n\tSLOT.set(this, '[[IteratedString]]', S);\n\tSLOT.set(this, '[[Global]]', global);\n\tSLOT.set(this, '[[Unicode]]', fullUnicode);\n\tSLOT.set(this, '[[Done]]', false);\n};\n\nif (IteratorPrototype) {\n\tRegExpStringIterator.prototype = OrdinaryObjectCreate(IteratorPrototype);\n}\n\nvar RegExpStringIteratorNext = function next() {\n\tvar O = this; // eslint-disable-line no-invalid-this\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('receiver must be an object');\n\t}\n\tif (\n\t\t!(O instanceof RegExpStringIterator)\n\t\t|| !SLOT.has(O, '[[IteratingRegExp]]')\n\t\t|| !SLOT.has(O, '[[IteratedString]]')\n\t\t|| !SLOT.has(O, '[[Global]]')\n\t\t|| !SLOT.has(O, '[[Unicode]]')\n\t\t|| !SLOT.has(O, '[[Done]]')\n\t) {\n\t\tthrow new $TypeError('\"this\" value must be a RegExpStringIterator instance');\n\t}\n\tif (SLOT.get(O, '[[Done]]')) {\n\t\treturn CreateIterResultObject(undefined, true);\n\t}\n\tvar R = SLOT.get(O, '[[IteratingRegExp]]');\n\tvar S = SLOT.get(O, '[[IteratedString]]');\n\tvar global = SLOT.get(O, '[[Global]]');\n\tvar fullUnicode = SLOT.get(O, '[[Unicode]]');\n\tvar match = RegExpExec(R, S);\n\tif (match === null) {\n\t\tSLOT.set(O, '[[Done]]', true);\n\t\treturn CreateIterResultObject(undefined, true);\n\t}\n\tif (global) {\n\t\tvar matchStr = ToString(Get(match, '0'));\n\t\tif (matchStr === '') {\n\t\t\tvar thisIndex = ToLength(Get(R, 'lastIndex'));\n\t\t\tvar nextIndex = AdvanceStringIndex(S, thisIndex, fullUnicode);\n\t\t\tSet(R, 'lastIndex', nextIndex, true);\n\t\t}\n\t\treturn CreateIterResultObject(match, false);\n\t}\n\tSLOT.set(O, '[[Done]]', true);\n\treturn CreateIterResultObject(match, false);\n};\nCreateMethodProperty(RegExpStringIterator.prototype, 'next', RegExpStringIteratorNext);\n\nif (hasSymbols) {\n\tsetToStringTag(RegExpStringIterator.prototype, 'RegExp String Iterator');\n\n\tif (Symbol.iterator && typeof RegExpStringIterator.prototype[Symbol.iterator] !== 'function') {\n\t\tvar iteratorFn = function SymbolIterator() {\n\t\t\treturn this;\n\t\t};\n\t\tCreateMethodProperty(RegExpStringIterator.prototype, Symbol.iterator, iteratorFn);\n\t}\n}\n\n// https://262.ecma-international.org/11.0/#sec-createregexpstringiterator\nmodule.exports = function CreateRegExpStringIterator(R, S, global, fullUnicode) {\n\t// assert R.global === global && R.unicode === fullUnicode?\n\treturn new RegExpStringIterator(R, S, global, fullUnicode);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar isPropertyDescriptor = require('../helpers/isPropertyDescriptor');\nvar DefineOwnProperty = require('../helpers/DefineOwnProperty');\n\nvar FromPropertyDescriptor = require('./FromPropertyDescriptor');\nvar IsAccessorDescriptor = require('./IsAccessorDescriptor');\nvar IsDataDescriptor = require('./IsDataDescriptor');\nvar IsPropertyKey = require('./IsPropertyKey');\nvar SameValue = require('./SameValue');\nvar ToPropertyDescriptor = require('./ToPropertyDescriptor');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-definepropertyorthrow\n\nmodule.exports = function DefinePropertyOrThrow(O, P, desc) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true');\n\t}\n\n\tvar Desc = isPropertyDescriptor({\n\t\tType: Type,\n\t\tIsDataDescriptor: IsDataDescriptor,\n\t\tIsAccessorDescriptor: IsAccessorDescriptor\n\t}, desc) ? desc : ToPropertyDescriptor(desc);\n\tif (!isPropertyDescriptor({\n\t\tType: Type,\n\t\tIsDataDescriptor: IsDataDescriptor,\n\t\tIsAccessorDescriptor: IsAccessorDescriptor\n\t}, Desc)) {\n\t\tthrow new $TypeError('Assertion failed: Desc is not a valid Property Descriptor');\n\t}\n\n\treturn DefineOwnProperty(\n\t\tIsDataDescriptor,\n\t\tSameValue,\n\t\tFromPropertyDescriptor,\n\t\tO,\n\t\tP,\n\t\tDesc\n\t);\n};\n","'use strict';\n\nvar assertRecord = require('../helpers/assertRecord');\nvar fromPropertyDescriptor = require('../helpers/fromPropertyDescriptor');\n\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-frompropertydescriptor\n\nmodule.exports = function FromPropertyDescriptor(Desc) {\n\tif (typeof Desc !== 'undefined') {\n\t\tassertRecord(Type, 'Property Descriptor', 'Desc', Desc);\n\t}\n\n\treturn fromPropertyDescriptor(Desc);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar inspect = require('object-inspect');\n\nvar IsPropertyKey = require('./IsPropertyKey');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-get-o-p\n\nmodule.exports = function Get(O, P) {\n\t// 7.3.1.1\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\t// 7.3.1.2\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P));\n\t}\n\t// 7.3.1.3\n\treturn O[P];\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar GetV = require('./GetV');\nvar IsCallable = require('./IsCallable');\nvar IsPropertyKey = require('./IsPropertyKey');\n\nvar inspect = require('object-inspect');\n\n// https://262.ecma-international.org/6.0/#sec-getmethod\n\nmodule.exports = function GetMethod(O, P) {\n\t// 7.3.9.1\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true');\n\t}\n\n\t// 7.3.9.2\n\tvar func = GetV(O, P);\n\n\t// 7.3.9.4\n\tif (func == null) {\n\t\treturn void 0;\n\t}\n\n\t// 7.3.9.5\n\tif (!IsCallable(func)) {\n\t\tthrow new $TypeError(inspect(P) + ' is not a function: ' + inspect(func));\n\t}\n\n\t// 7.3.9.6\n\treturn func;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar inspect = require('object-inspect');\n\nvar IsPropertyKey = require('./IsPropertyKey');\n// var ToObject = require('./ToObject');\n\n// https://262.ecma-international.org/6.0/#sec-getv\n\nmodule.exports = function GetV(V, P) {\n\t// 7.3.2.1\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P));\n\t}\n\n\t// 7.3.2.2-3\n\t// var O = ToObject(V);\n\n\t// 7.3.2.4\n\treturn V[P];\n};\n","'use strict';\n\nvar has = require('has');\n\nvar Type = require('./Type');\n\nvar assertRecord = require('../helpers/assertRecord');\n\n// https://262.ecma-international.org/5.1/#sec-8.10.1\n\nmodule.exports = function IsAccessorDescriptor(Desc) {\n\tif (typeof Desc === 'undefined') {\n\t\treturn false;\n\t}\n\n\tassertRecord(Type, 'Property Descriptor', 'Desc', Desc);\n\n\tif (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n","'use strict';\n\n// https://262.ecma-international.org/6.0/#sec-isarray\nmodule.exports = require('../helpers/IsArray');\n","'use strict';\n\n// http://262.ecma-international.org/5.1/#sec-9.11\n\nmodule.exports = require('is-callable');\n","'use strict';\n\nvar GetIntrinsic = require('../GetIntrinsic.js');\n\nvar $construct = GetIntrinsic('%Reflect.construct%', true);\n\nvar DefinePropertyOrThrow = require('./DefinePropertyOrThrow');\ntry {\n\tDefinePropertyOrThrow({}, '', { '[[Get]]': function () {} });\n} catch (e) {\n\t// Accessor properties aren't supported\n\tDefinePropertyOrThrow = null;\n}\n\n// https://262.ecma-international.org/6.0/#sec-isconstructor\n\nif (DefinePropertyOrThrow && $construct) {\n\tvar isConstructorMarker = {};\n\tvar badArrayLike = {};\n\tDefinePropertyOrThrow(badArrayLike, 'length', {\n\t\t'[[Get]]': function () {\n\t\t\tthrow isConstructorMarker;\n\t\t},\n\t\t'[[Enumerable]]': true\n\t});\n\n\tmodule.exports = function IsConstructor(argument) {\n\t\ttry {\n\t\t\t// `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`:\n\t\t\t$construct(argument, badArrayLike);\n\t\t} catch (err) {\n\t\t\treturn err === isConstructorMarker;\n\t\t}\n\t};\n} else {\n\tmodule.exports = function IsConstructor(argument) {\n\t\t// unfortunately there's no way to truly check this without try/catch `new argument` in old environments\n\t\treturn typeof argument === 'function' && !!argument.prototype;\n\t};\n}\n","'use strict';\n\nvar has = require('has');\n\nvar Type = require('./Type');\n\nvar assertRecord = require('../helpers/assertRecord');\n\n// https://262.ecma-international.org/5.1/#sec-8.10.2\n\nmodule.exports = function IsDataDescriptor(Desc) {\n\tif (typeof Desc === 'undefined') {\n\t\treturn false;\n\t}\n\n\tassertRecord(Type, 'Property Descriptor', 'Desc', Desc);\n\n\tif (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n","'use strict';\n\n// https://262.ecma-international.org/6.0/#sec-ispropertykey\n\nmodule.exports = function IsPropertyKey(argument) {\n\treturn typeof argument === 'string' || typeof argument === 'symbol';\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $match = GetIntrinsic('%Symbol.match%', true);\n\nvar hasRegExpMatcher = require('is-regex');\n\nvar ToBoolean = require('./ToBoolean');\n\n// https://262.ecma-international.org/6.0/#sec-isregexp\n\nmodule.exports = function IsRegExp(argument) {\n\tif (!argument || typeof argument !== 'object') {\n\t\treturn false;\n\t}\n\tif ($match) {\n\t\tvar isRegExp = argument[$match];\n\t\tif (typeof isRegExp !== 'undefined') {\n\t\t\treturn ToBoolean(isRegExp);\n\t\t}\n\t}\n\treturn hasRegExpMatcher(argument);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $ObjectCreate = GetIntrinsic('%Object.create%', true);\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\n\nvar IsArray = require('./IsArray');\nvar Type = require('./Type');\n\nvar forEach = require('../helpers/forEach');\n\nvar SLOT = require('internal-slot');\n\nvar hasProto = require('has-proto')();\n\n// https://262.ecma-international.org/11.0/#sec-objectcreate\n\nmodule.exports = function OrdinaryObjectCreate(proto) {\n\tif (proto !== null && Type(proto) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: `proto` must be null or an object');\n\t}\n\tvar additionalInternalSlotsList = arguments.length < 2 ? [] : arguments[1];\n\tif (!IsArray(additionalInternalSlotsList)) {\n\t\tthrow new $TypeError('Assertion failed: `additionalInternalSlotsList` must be an Array');\n\t}\n\n\t// var internalSlotsList = ['[[Prototype]]', '[[Extensible]]']; // step 1\n\t// internalSlotsList.push(...additionalInternalSlotsList); // step 2\n\t// var O = MakeBasicObject(internalSlotsList); // step 3\n\t// setProto(O, proto); // step 4\n\t// return O; // step 5\n\n\tvar O;\n\tif ($ObjectCreate) {\n\t\tO = $ObjectCreate(proto);\n\t} else if (hasProto) {\n\t\tO = { __proto__: proto };\n\t} else {\n\t\tif (proto === null) {\n\t\t\tthrow new $SyntaxError('native Object.create support is required to create null objects');\n\t\t}\n\t\tvar T = function T() {};\n\t\tT.prototype = proto;\n\t\tO = new T();\n\t}\n\n\tif (additionalInternalSlotsList.length > 0) {\n\t\tforEach(additionalInternalSlotsList, function (slot) {\n\t\t\tSLOT.set(O, slot, void undefined);\n\t\t});\n\t}\n\n\treturn O;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar regexExec = require('call-bind/callBound')('RegExp.prototype.exec');\n\nvar Call = require('./Call');\nvar Get = require('./Get');\nvar IsCallable = require('./IsCallable');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-regexpexec\n\nmodule.exports = function RegExpExec(R, S) {\n\tif (Type(R) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: `R` must be an Object');\n\t}\n\tif (Type(S) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `S` must be a String');\n\t}\n\tvar exec = Get(R, 'exec');\n\tif (IsCallable(exec)) {\n\t\tvar result = Call(exec, R, [S]);\n\t\tif (result === null || Type(result) === 'Object') {\n\t\t\treturn result;\n\t\t}\n\t\tthrow new $TypeError('\"exec\" method must return `null` or an Object');\n\t}\n\treturn regexExec(R, S);\n};\n","'use strict';\n\nmodule.exports = require('../5/CheckObjectCoercible');\n","'use strict';\n\nvar $isNaN = require('../helpers/isNaN');\n\n// http://262.ecma-international.org/5.1/#sec-9.12\n\nmodule.exports = function SameValue(x, y) {\n\tif (x === y) { // 0 === -0, but they are not identical.\n\t\tif (x === 0) { return 1 / x === 1 / y; }\n\t\treturn true;\n\t}\n\treturn $isNaN(x) && $isNaN(y);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar IsPropertyKey = require('./IsPropertyKey');\nvar SameValue = require('./SameValue');\nvar Type = require('./Type');\n\n// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated\nvar noThrowOnStrictViolation = (function () {\n\ttry {\n\t\tdelete [].length;\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n}());\n\n// https://262.ecma-international.org/6.0/#sec-set-o-p-v-throw\n\nmodule.exports = function Set(O, P, V, Throw) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: `O` must be an Object');\n\t}\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: `P` must be a Property Key');\n\t}\n\tif (Type(Throw) !== 'Boolean') {\n\t\tthrow new $TypeError('Assertion failed: `Throw` must be a Boolean');\n\t}\n\tif (Throw) {\n\t\tO[P] = V; // eslint-disable-line no-param-reassign\n\t\tif (noThrowOnStrictViolation && !SameValue(O[P], V)) {\n\t\t\tthrow new $TypeError('Attempted to assign to readonly property.');\n\t\t}\n\t\treturn true;\n\t}\n\ttry {\n\t\tO[P] = V; // eslint-disable-line no-param-reassign\n\t\treturn noThrowOnStrictViolation ? SameValue(O[P], V) : true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $species = GetIntrinsic('%Symbol.species%', true);\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar IsConstructor = require('./IsConstructor');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-speciesconstructor\n\nmodule.exports = function SpeciesConstructor(O, defaultConstructor) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\tvar C = O.constructor;\n\tif (typeof C === 'undefined') {\n\t\treturn defaultConstructor;\n\t}\n\tif (Type(C) !== 'Object') {\n\t\tthrow new $TypeError('O.constructor is not an Object');\n\t}\n\tvar S = $species ? C[$species] : void 0;\n\tif (S == null) {\n\t\treturn defaultConstructor;\n\t}\n\tif (IsConstructor(S)) {\n\t\treturn S;\n\t}\n\tthrow new $TypeError('no constructor found');\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $Number = GetIntrinsic('%Number%');\nvar $RegExp = GetIntrinsic('%RegExp%');\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $parseInteger = GetIntrinsic('%parseInt%');\n\nvar callBound = require('call-bind/callBound');\nvar regexTester = require('safe-regex-test');\n\nvar $strSlice = callBound('String.prototype.slice');\nvar isBinary = regexTester(/^0b[01]+$/i);\nvar isOctal = regexTester(/^0o[0-7]+$/i);\nvar isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i);\nvar nonWS = ['\\u0085', '\\u200b', '\\ufffe'].join('');\nvar nonWSregex = new $RegExp('[' + nonWS + ']', 'g');\nvar hasNonWS = regexTester(nonWSregex);\n\nvar $trim = require('string.prototype.trim');\n\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/13.0/#sec-stringtonumber\n\nmodule.exports = function StringToNumber(argument) {\n\tif (Type(argument) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `argument` is not a String');\n\t}\n\tif (isBinary(argument)) {\n\t\treturn $Number($parseInteger($strSlice(argument, 2), 2));\n\t}\n\tif (isOctal(argument)) {\n\t\treturn $Number($parseInteger($strSlice(argument, 2), 8));\n\t}\n\tif (hasNonWS(argument) || isInvalidHexLiteral(argument)) {\n\t\treturn NaN;\n\t}\n\tvar trimmed = $trim(argument);\n\tif (trimmed !== argument) {\n\t\treturn StringToNumber(trimmed);\n\t}\n\treturn $Number(argument);\n};\n","'use strict';\n\n// http://262.ecma-international.org/5.1/#sec-9.2\n\nmodule.exports = function ToBoolean(value) { return !!value; };\n","'use strict';\n\nvar ToNumber = require('./ToNumber');\nvar truncate = require('./truncate');\n\nvar $isNaN = require('../helpers/isNaN');\nvar $isFinite = require('../helpers/isFinite');\n\n// https://262.ecma-international.org/14.0/#sec-tointegerorinfinity\n\nmodule.exports = function ToIntegerOrInfinity(value) {\n\tvar number = ToNumber(value);\n\tif ($isNaN(number) || number === 0) { return 0; }\n\tif (!$isFinite(number)) { return number; }\n\treturn truncate(number);\n};\n","'use strict';\n\nvar MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');\n\nvar ToIntegerOrInfinity = require('./ToIntegerOrInfinity');\n\nmodule.exports = function ToLength(argument) {\n\tvar len = ToIntegerOrInfinity(argument);\n\tif (len <= 0) { return 0; } // includes converting -0 to +0\n\tif (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; }\n\treturn len;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $Number = GetIntrinsic('%Number%');\nvar isPrimitive = require('../helpers/isPrimitive');\n\nvar ToPrimitive = require('./ToPrimitive');\nvar StringToNumber = require('./StringToNumber');\n\n// https://262.ecma-international.org/13.0/#sec-tonumber\n\nmodule.exports = function ToNumber(argument) {\n\tvar value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number);\n\tif (typeof value === 'symbol') {\n\t\tthrow new $TypeError('Cannot convert a Symbol value to a number');\n\t}\n\tif (typeof value === 'bigint') {\n\t\tthrow new $TypeError('Conversion from \\'BigInt\\' to \\'number\\' is not allowed.');\n\t}\n\tif (typeof value === 'string') {\n\t\treturn StringToNumber(value);\n\t}\n\treturn $Number(value);\n};\n","'use strict';\n\nvar toPrimitive = require('es-to-primitive/es2015');\n\n// https://262.ecma-international.org/6.0/#sec-toprimitive\n\nmodule.exports = function ToPrimitive(input) {\n\tif (arguments.length > 1) {\n\t\treturn toPrimitive(input, arguments[1]);\n\t}\n\treturn toPrimitive(input);\n};\n","'use strict';\n\nvar has = require('has');\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar Type = require('./Type');\nvar ToBoolean = require('./ToBoolean');\nvar IsCallable = require('./IsCallable');\n\n// https://262.ecma-international.org/5.1/#sec-8.10.5\n\nmodule.exports = function ToPropertyDescriptor(Obj) {\n\tif (Type(Obj) !== 'Object') {\n\t\tthrow new $TypeError('ToPropertyDescriptor requires an object');\n\t}\n\n\tvar desc = {};\n\tif (has(Obj, 'enumerable')) {\n\t\tdesc['[[Enumerable]]'] = ToBoolean(Obj.enumerable);\n\t}\n\tif (has(Obj, 'configurable')) {\n\t\tdesc['[[Configurable]]'] = ToBoolean(Obj.configurable);\n\t}\n\tif (has(Obj, 'value')) {\n\t\tdesc['[[Value]]'] = Obj.value;\n\t}\n\tif (has(Obj, 'writable')) {\n\t\tdesc['[[Writable]]'] = ToBoolean(Obj.writable);\n\t}\n\tif (has(Obj, 'get')) {\n\t\tvar getter = Obj.get;\n\t\tif (typeof getter !== 'undefined' && !IsCallable(getter)) {\n\t\t\tthrow new $TypeError('getter must be a function');\n\t\t}\n\t\tdesc['[[Get]]'] = getter;\n\t}\n\tif (has(Obj, 'set')) {\n\t\tvar setter = Obj.set;\n\t\tif (typeof setter !== 'undefined' && !IsCallable(setter)) {\n\t\t\tthrow new $TypeError('setter must be a function');\n\t\t}\n\t\tdesc['[[Set]]'] = setter;\n\t}\n\n\tif ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) {\n\t\tthrow new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');\n\t}\n\treturn desc;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $String = GetIntrinsic('%String%');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// https://262.ecma-international.org/6.0/#sec-tostring\n\nmodule.exports = function ToString(argument) {\n\tif (typeof argument === 'symbol') {\n\t\tthrow new $TypeError('Cannot convert a Symbol value to a string');\n\t}\n\treturn $String(argument);\n};\n","'use strict';\n\nvar ES5Type = require('../5/Type');\n\n// https://262.ecma-international.org/11.0/#sec-ecmascript-data-types-and-values\n\nmodule.exports = function Type(x) {\n\tif (typeof x === 'symbol') {\n\t\treturn 'Symbol';\n\t}\n\tif (typeof x === 'bigint') {\n\t\treturn 'BigInt';\n\t}\n\treturn ES5Type(x);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $fromCharCode = GetIntrinsic('%String.fromCharCode%');\n\nvar isLeadingSurrogate = require('../helpers/isLeadingSurrogate');\nvar isTrailingSurrogate = require('../helpers/isTrailingSurrogate');\n\n// https://tc39.es/ecma262/2020/#sec-utf16decodesurrogatepair\n\nmodule.exports = function UTF16SurrogatePairToCodePoint(lead, trail) {\n\tif (!isLeadingSurrogate(lead) || !isTrailingSurrogate(trail)) {\n\t\tthrow new $TypeError('Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code');\n\t}\n\t// var cp = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;\n\treturn $fromCharCode(lead) + $fromCharCode(trail);\n};\n","'use strict';\n\nvar Type = require('./Type');\n\n// var modulo = require('./modulo');\nvar $floor = Math.floor;\n\n// http://262.ecma-international.org/11.0/#eqn-floor\n\nmodule.exports = function floor(x) {\n\t// return x - modulo(x, 1);\n\tif (Type(x) === 'BigInt') {\n\t\treturn x;\n\t}\n\treturn $floor(x);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar floor = require('./floor');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// https://262.ecma-international.org/14.0/#eqn-truncate\n\nmodule.exports = function truncate(x) {\n\tif (typeof x !== 'number' && typeof x !== 'bigint') {\n\t\tthrow new $TypeError('argument must be a Number or a BigInt');\n\t}\n\tvar result = x < 0 ? -floor(-x) : floor(x);\n\treturn result === 0 ? 0 : result; // in the spec, these are math values, so we filter out -0 here\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// http://262.ecma-international.org/5.1/#sec-9.10\n\nmodule.exports = function CheckObjectCoercible(value, optMessage) {\n\tif (value == null) {\n\t\tthrow new $TypeError(optMessage || ('Cannot call method on ' + value));\n\t}\n\treturn value;\n};\n","'use strict';\n\n// https://262.ecma-international.org/5.1/#sec-8\n\nmodule.exports = function Type(x) {\n\tif (x === null) {\n\t\treturn 'Null';\n\t}\n\tif (typeof x === 'undefined') {\n\t\treturn 'Undefined';\n\t}\n\tif (typeof x === 'function' || typeof x === 'object') {\n\t\treturn 'Object';\n\t}\n\tif (typeof x === 'number') {\n\t\treturn 'Number';\n\t}\n\tif (typeof x === 'boolean') {\n\t\treturn 'Boolean';\n\t}\n\tif (typeof x === 'string') {\n\t\treturn 'String';\n\t}\n};\n","'use strict';\n\n// TODO: remove, semver-major\n\nmodule.exports = require('get-intrinsic');\n","'use strict';\n\nvar hasPropertyDescriptors = require('has-property-descriptors');\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = hasPropertyDescriptors() && GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasArrayLengthDefineBug = hasPropertyDescriptors.hasArrayLengthDefineBug();\n\n// eslint-disable-next-line global-require\nvar isArray = hasArrayLengthDefineBug && require('../helpers/IsArray');\n\nvar callBound = require('call-bind/callBound');\n\nvar $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');\n\n// eslint-disable-next-line max-params\nmodule.exports = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) {\n\tif (!$defineProperty) {\n\t\tif (!IsDataDescriptor(desc)) {\n\t\t\t// ES3 does not support getters/setters\n\t\t\treturn false;\n\t\t}\n\t\tif (!desc['[[Configurable]]'] || !desc['[[Writable]]']) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// fallback for ES3\n\t\tif (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) {\n\t\t\t// a non-enumerable existing property\n\t\t\treturn false;\n\t\t}\n\n\t\t// property does not exist at all, or exists but is enumerable\n\t\tvar V = desc['[[Value]]'];\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tO[P] = V; // will use [[Define]]\n\t\treturn SameValue(O[P], V);\n\t}\n\tif (\n\t\thasArrayLengthDefineBug\n\t\t&& P === 'length'\n\t\t&& '[[Value]]' in desc\n\t\t&& isArray(O)\n\t\t&& O.length !== desc['[[Value]]']\n\t) {\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tO.length = desc['[[Value]]'];\n\t\treturn O.length === desc['[[Value]]'];\n\t}\n\n\t$defineProperty(O, P, FromPropertyDescriptor(desc));\n\treturn true;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $Array = GetIntrinsic('%Array%');\n\n// eslint-disable-next-line global-require\nvar toStr = !$Array.isArray && require('call-bind/callBound')('Object.prototype.toString');\n\nmodule.exports = $Array.isArray || function IsArray(argument) {\n\treturn toStr(argument) === '[object Array]';\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\n\nvar has = require('has');\nvar isInteger = require('./isInteger');\n\nvar isMatchRecord = require('./isMatchRecord');\n\nvar predicates = {\n\t// https://262.ecma-international.org/6.0/#sec-property-descriptor-specification-type\n\t'Property Descriptor': function isPropertyDescriptor(Desc) {\n\t\tvar allowed = {\n\t\t\t'[[Configurable]]': true,\n\t\t\t'[[Enumerable]]': true,\n\t\t\t'[[Get]]': true,\n\t\t\t'[[Set]]': true,\n\t\t\t'[[Value]]': true,\n\t\t\t'[[Writable]]': true\n\t\t};\n\n\t\tif (!Desc) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (var key in Desc) { // eslint-disable-line\n\t\t\tif (has(Desc, key) && !allowed[key]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tvar isData = has(Desc, '[[Value]]');\n\t\tvar IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]');\n\t\tif (isData && IsAccessor) {\n\t\t\tthrow new $TypeError('Property Descriptors may not be both accessor and data descriptors');\n\t\t}\n\t\treturn true;\n\t},\n\t// https://262.ecma-international.org/13.0/#sec-match-records\n\t'Match Record': isMatchRecord,\n\t'Iterator Record': function isIteratorRecord(value) {\n\t\treturn has(value, '[[Iterator]]') && has(value, '[[NextMethod]]') && has(value, '[[Done]]');\n\t},\n\t'PromiseCapability Record': function isPromiseCapabilityRecord(value) {\n\t\treturn !!value\n\t\t\t&& has(value, '[[Resolve]]')\n\t\t\t&& typeof value['[[Resolve]]'] === 'function'\n\t\t\t&& has(value, '[[Reject]]')\n\t\t\t&& typeof value['[[Reject]]'] === 'function'\n\t\t\t&& has(value, '[[Promise]]')\n\t\t\t&& value['[[Promise]]']\n\t\t\t&& typeof value['[[Promise]]'].then === 'function';\n\t},\n\t'AsyncGeneratorRequest Record': function isAsyncGeneratorRequestRecord(value) {\n\t\treturn !!value\n\t\t\t&& has(value, '[[Completion]]') // TODO: confirm is a completion record\n\t\t\t&& has(value, '[[Capability]]')\n\t\t\t&& predicates['PromiseCapability Record'](value['[[Capability]]']);\n\t},\n\t'RegExp Record': function isRegExpRecord(value) {\n\t\treturn value\n\t\t\t&& has(value, '[[IgnoreCase]]')\n\t\t\t&& typeof value['[[IgnoreCase]]'] === 'boolean'\n\t\t\t&& has(value, '[[Multiline]]')\n\t\t\t&& typeof value['[[Multiline]]'] === 'boolean'\n\t\t\t&& has(value, '[[DotAll]]')\n\t\t\t&& typeof value['[[DotAll]]'] === 'boolean'\n\t\t\t&& has(value, '[[Unicode]]')\n\t\t\t&& typeof value['[[Unicode]]'] === 'boolean'\n\t\t\t&& has(value, '[[CapturingGroupsCount]]')\n\t\t\t&& typeof value['[[CapturingGroupsCount]]'] === 'number'\n\t\t\t&& isInteger(value['[[CapturingGroupsCount]]'])\n\t\t\t&& value['[[CapturingGroupsCount]]'] >= 0;\n\t}\n};\n\nmodule.exports = function assertRecord(Type, recordType, argumentName, value) {\n\tvar predicate = predicates[recordType];\n\tif (typeof predicate !== 'function') {\n\t\tthrow new $SyntaxError('unknown record type: ' + recordType);\n\t}\n\tif (Type(value) !== 'Object' || !predicate(value)) {\n\t\tthrow new $TypeError(argumentName + ' must be a ' + recordType);\n\t}\n};\n","'use strict';\n\nmodule.exports = function forEach(array, callback) {\n\tfor (var i = 0; i < array.length; i += 1) {\n\t\tcallback(array[i], i, array); // eslint-disable-line callback-return\n\t}\n};\n","'use strict';\n\nmodule.exports = function fromPropertyDescriptor(Desc) {\n\tif (typeof Desc === 'undefined') {\n\t\treturn Desc;\n\t}\n\tvar obj = {};\n\tif ('[[Value]]' in Desc) {\n\t\tobj.value = Desc['[[Value]]'];\n\t}\n\tif ('[[Writable]]' in Desc) {\n\t\tobj.writable = !!Desc['[[Writable]]'];\n\t}\n\tif ('[[Get]]' in Desc) {\n\t\tobj.get = Desc['[[Get]]'];\n\t}\n\tif ('[[Set]]' in Desc) {\n\t\tobj.set = Desc['[[Set]]'];\n\t}\n\tif ('[[Enumerable]]' in Desc) {\n\t\tobj.enumerable = !!Desc['[[Enumerable]]'];\n\t}\n\tif ('[[Configurable]]' in Desc) {\n\t\tobj.configurable = !!Desc['[[Configurable]]'];\n\t}\n\treturn obj;\n};\n","'use strict';\n\nvar $isNaN = require('./isNaN');\n\nmodule.exports = function (x) { return (typeof x === 'number' || typeof x === 'bigint') && !$isNaN(x) && x !== Infinity && x !== -Infinity; };\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $abs = GetIntrinsic('%Math.abs%');\nvar $floor = GetIntrinsic('%Math.floor%');\n\nvar $isNaN = require('./isNaN');\nvar $isFinite = require('./isFinite');\n\nmodule.exports = function isInteger(argument) {\n\tif (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {\n\t\treturn false;\n\t}\n\tvar absValue = $abs(argument);\n\treturn $floor(absValue) === absValue;\n};\n\n","'use strict';\n\nmodule.exports = function isLeadingSurrogate(charCode) {\n\treturn typeof charCode === 'number' && charCode >= 0xD800 && charCode <= 0xDBFF;\n};\n","'use strict';\n\nvar has = require('has');\n\n// https://262.ecma-international.org/13.0/#sec-match-records\n\nmodule.exports = function isMatchRecord(record) {\n\treturn (\n\t\thas(record, '[[StartIndex]]')\n && has(record, '[[EndIndex]]')\n && record['[[StartIndex]]'] >= 0\n && record['[[EndIndex]]'] >= record['[[StartIndex]]']\n && String(parseInt(record['[[StartIndex]]'], 10)) === String(record['[[StartIndex]]'])\n && String(parseInt(record['[[EndIndex]]'], 10)) === String(record['[[EndIndex]]'])\n\t);\n};\n","'use strict';\n\nmodule.exports = Number.isNaN || function isNaN(a) {\n\treturn a !== a;\n};\n","'use strict';\n\nmodule.exports = function isPrimitive(value) {\n\treturn value === null || (typeof value !== 'function' && typeof value !== 'object');\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar has = require('has');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nmodule.exports = function IsPropertyDescriptor(ES, Desc) {\n\tif (ES.Type(Desc) !== 'Object') {\n\t\treturn false;\n\t}\n\tvar allowed = {\n\t\t'[[Configurable]]': true,\n\t\t'[[Enumerable]]': true,\n\t\t'[[Get]]': true,\n\t\t'[[Set]]': true,\n\t\t'[[Value]]': true,\n\t\t'[[Writable]]': true\n\t};\n\n\tfor (var key in Desc) { // eslint-disable-line no-restricted-syntax\n\t\tif (has(Desc, key) && !allowed[key]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tif (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) {\n\t\tthrow new $TypeError('Property Descriptors may not be both accessor and data descriptors');\n\t}\n\treturn true;\n};\n","'use strict';\n\nmodule.exports = function isTrailingSurrogate(charCode) {\n\treturn typeof charCode === 'number' && charCode >= 0xDC00 && charCode <= 0xDFFF;\n};\n","'use strict';\n\nmodule.exports = Number.MAX_SAFE_INTEGER || 9007199254740991; // Math.pow(2, 53) - 1;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","const debug = false;\nexport function log(...args) {\n if (debug) {\n console.log(...args);\n }\n}\n","//\n// Copyright 2021 Readium Foundation. All rights reserved.\n// Use of this source code is governed by the BSD-style license\n// available in the top-level LICENSE file of the project.\n//\nimport { log } from \"./log\";\n/**\n * Transforms a DOMRect into the zoomed coordinate system.\n *\n * See https://issues.chromium.org/issues/40391865#comment9\n */\nexport function dezoomDomRect(rect, zoomLevel) {\n return new DOMRect(rect.x / zoomLevel, rect.y / zoomLevel, rect.width / zoomLevel, rect.height / zoomLevel);\n}\n/**\n * Transforms a rect into the zoomed coordinate system.\n *\n * See https://issues.chromium.org/issues/40391865#comment9\n */\nexport function dezoomRect(rect, zoomLevel) {\n return {\n bottom: rect.bottom / zoomLevel,\n height: rect.height / zoomLevel,\n left: rect.left / zoomLevel,\n right: rect.right / zoomLevel,\n top: rect.top / zoomLevel,\n width: rect.width / zoomLevel,\n };\n}\nexport function domRectToRect(rect) {\n return {\n width: rect.width,\n height: rect.height,\n left: rect.left,\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n };\n}\nexport function getClientRectsNoOverlap(range, doNotMergeHorizontallyAlignedRects) {\n const clientRects = range.getClientRects();\n const tolerance = 1;\n const originalRects = [];\n for (const rangeClientRect of clientRects) {\n originalRects.push({\n bottom: rangeClientRect.bottom,\n height: rangeClientRect.height,\n left: rangeClientRect.left,\n right: rangeClientRect.right,\n top: rangeClientRect.top,\n width: rangeClientRect.width,\n });\n }\n const mergedRects = mergeTouchingRects(originalRects, tolerance, doNotMergeHorizontallyAlignedRects);\n const noContainedRects = removeContainedRects(mergedRects, tolerance);\n const newRects = replaceOverlapingRects(noContainedRects);\n const minArea = 2 * 2;\n for (let j = newRects.length - 1; j >= 0; j--) {\n const rect = newRects[j];\n const bigEnough = rect.width * rect.height > minArea;\n if (!bigEnough) {\n if (newRects.length > 1) {\n log(\"CLIENT RECT: remove small\");\n newRects.splice(j, 1);\n }\n else {\n log(\"CLIENT RECT: remove small, but keep otherwise empty!\");\n break;\n }\n }\n }\n log(`CLIENT RECT: reduced ${originalRects.length} --> ${newRects.length}`);\n return newRects;\n}\nfunction mergeTouchingRects(rects, tolerance, doNotMergeHorizontallyAlignedRects) {\n for (let i = 0; i < rects.length; i++) {\n for (let j = i + 1; j < rects.length; j++) {\n const rect1 = rects[i];\n const rect2 = rects[j];\n if (rect1 === rect2) {\n log(\"mergeTouchingRects rect1 === rect2 ??!\");\n continue;\n }\n const rectsLineUpVertically = almostEqual(rect1.top, rect2.top, tolerance) &&\n almostEqual(rect1.bottom, rect2.bottom, tolerance);\n const rectsLineUpHorizontally = almostEqual(rect1.left, rect2.left, tolerance) &&\n almostEqual(rect1.right, rect2.right, tolerance);\n const horizontalAllowed = !doNotMergeHorizontallyAlignedRects;\n const aligned = (rectsLineUpHorizontally && horizontalAllowed) ||\n (rectsLineUpVertically && !rectsLineUpHorizontally);\n const canMerge = aligned && rectsTouchOrOverlap(rect1, rect2, tolerance);\n if (canMerge) {\n log(`CLIENT RECT: merging two into one, VERTICAL: ${rectsLineUpVertically} HORIZONTAL: ${rectsLineUpHorizontally} (${doNotMergeHorizontallyAlignedRects})`);\n const newRects = rects.filter((rect) => {\n return rect !== rect1 && rect !== rect2;\n });\n const replacementClientRect = getBoundingRect(rect1, rect2);\n newRects.push(replacementClientRect);\n return mergeTouchingRects(newRects, tolerance, doNotMergeHorizontallyAlignedRects);\n }\n }\n }\n return rects;\n}\nfunction getBoundingRect(rect1, rect2) {\n const left = Math.min(rect1.left, rect2.left);\n const right = Math.max(rect1.right, rect2.right);\n const top = Math.min(rect1.top, rect2.top);\n const bottom = Math.max(rect1.bottom, rect2.bottom);\n return {\n bottom,\n height: bottom - top,\n left,\n right,\n top,\n width: right - left,\n };\n}\nfunction removeContainedRects(rects, tolerance) {\n const rectsToKeep = new Set(rects);\n for (const rect of rects) {\n const bigEnough = rect.width > 1 && rect.height > 1;\n if (!bigEnough) {\n log(\"CLIENT RECT: remove tiny\");\n rectsToKeep.delete(rect);\n continue;\n }\n for (const possiblyContainingRect of rects) {\n if (rect === possiblyContainingRect) {\n continue;\n }\n if (!rectsToKeep.has(possiblyContainingRect)) {\n continue;\n }\n if (rectContains(possiblyContainingRect, rect, tolerance)) {\n log(\"CLIENT RECT: remove contained\");\n rectsToKeep.delete(rect);\n break;\n }\n }\n }\n return Array.from(rectsToKeep);\n}\nfunction rectContains(rect1, rect2, tolerance) {\n return (rectContainsPoint(rect1, rect2.left, rect2.top, tolerance) &&\n rectContainsPoint(rect1, rect2.right, rect2.top, tolerance) &&\n rectContainsPoint(rect1, rect2.left, rect2.bottom, tolerance) &&\n rectContainsPoint(rect1, rect2.right, rect2.bottom, tolerance));\n}\nexport function rectContainsPoint(rect, x, y, tolerance) {\n return ((rect.left < x || almostEqual(rect.left, x, tolerance)) &&\n (rect.right > x || almostEqual(rect.right, x, tolerance)) &&\n (rect.top < y || almostEqual(rect.top, y, tolerance)) &&\n (rect.bottom > y || almostEqual(rect.bottom, y, tolerance)));\n}\nfunction replaceOverlapingRects(rects) {\n for (let i = 0; i < rects.length; i++) {\n for (let j = i + 1; j < rects.length; j++) {\n const rect1 = rects[i];\n const rect2 = rects[j];\n if (rect1 === rect2) {\n log(\"replaceOverlapingRects rect1 === rect2 ??!\");\n continue;\n }\n if (rectsTouchOrOverlap(rect1, rect2, -1)) {\n let toAdd = [];\n let toRemove;\n const subtractRects1 = rectSubtract(rect1, rect2);\n if (subtractRects1.length === 1) {\n toAdd = subtractRects1;\n toRemove = rect1;\n }\n else {\n const subtractRects2 = rectSubtract(rect2, rect1);\n if (subtractRects1.length < subtractRects2.length) {\n toAdd = subtractRects1;\n toRemove = rect1;\n }\n else {\n toAdd = subtractRects2;\n toRemove = rect2;\n }\n }\n log(`CLIENT RECT: overlap, cut one rect into ${toAdd.length}`);\n const newRects = rects.filter((rect) => {\n return rect !== toRemove;\n });\n Array.prototype.push.apply(newRects, toAdd);\n return replaceOverlapingRects(newRects);\n }\n }\n }\n return rects;\n}\nfunction rectSubtract(rect1, rect2) {\n const rectIntersected = rectIntersect(rect2, rect1);\n if (rectIntersected.height === 0 || rectIntersected.width === 0) {\n return [rect1];\n }\n const rects = [];\n {\n const rectA = {\n bottom: rect1.bottom,\n height: 0,\n left: rect1.left,\n right: rectIntersected.left,\n top: rect1.top,\n width: 0,\n };\n rectA.width = rectA.right - rectA.left;\n rectA.height = rectA.bottom - rectA.top;\n if (rectA.height !== 0 && rectA.width !== 0) {\n rects.push(rectA);\n }\n }\n {\n const rectB = {\n bottom: rectIntersected.top,\n height: 0,\n left: rectIntersected.left,\n right: rectIntersected.right,\n top: rect1.top,\n width: 0,\n };\n rectB.width = rectB.right - rectB.left;\n rectB.height = rectB.bottom - rectB.top;\n if (rectB.height !== 0 && rectB.width !== 0) {\n rects.push(rectB);\n }\n }\n {\n const rectC = {\n bottom: rect1.bottom,\n height: 0,\n left: rectIntersected.left,\n right: rectIntersected.right,\n top: rectIntersected.bottom,\n width: 0,\n };\n rectC.width = rectC.right - rectC.left;\n rectC.height = rectC.bottom - rectC.top;\n if (rectC.height !== 0 && rectC.width !== 0) {\n rects.push(rectC);\n }\n }\n {\n const rectD = {\n bottom: rect1.bottom,\n height: 0,\n left: rectIntersected.right,\n right: rect1.right,\n top: rect1.top,\n width: 0,\n };\n rectD.width = rectD.right - rectD.left;\n rectD.height = rectD.bottom - rectD.top;\n if (rectD.height !== 0 && rectD.width !== 0) {\n rects.push(rectD);\n }\n }\n return rects;\n}\nfunction rectIntersect(rect1, rect2) {\n const maxLeft = Math.max(rect1.left, rect2.left);\n const minRight = Math.min(rect1.right, rect2.right);\n const maxTop = Math.max(rect1.top, rect2.top);\n const minBottom = Math.min(rect1.bottom, rect2.bottom);\n return {\n bottom: minBottom,\n height: Math.max(0, minBottom - maxTop),\n left: maxLeft,\n right: minRight,\n top: maxTop,\n width: Math.max(0, minRight - maxLeft),\n };\n}\nfunction rectsTouchOrOverlap(rect1, rect2, tolerance) {\n return ((rect1.left < rect2.right ||\n (tolerance >= 0 && almostEqual(rect1.left, rect2.right, tolerance))) &&\n (rect2.left < rect1.right ||\n (tolerance >= 0 && almostEqual(rect2.left, rect1.right, tolerance))) &&\n (rect1.top < rect2.bottom ||\n (tolerance >= 0 && almostEqual(rect1.top, rect2.bottom, tolerance))) &&\n (rect2.top < rect1.bottom ||\n (tolerance >= 0 && almostEqual(rect2.top, rect1.bottom, tolerance))));\n}\nfunction almostEqual(a, b, tolerance) {\n return Math.abs(a - b) <= tolerance;\n}\n","/**\n * From which direction to evaluate strings or nodes: from the start of a string\n * or range seeking Forwards, or from the end seeking Backwards.\n */\nvar TrimDirection;\n(function (TrimDirection) {\n TrimDirection[TrimDirection[\"Forwards\"] = 1] = \"Forwards\";\n TrimDirection[TrimDirection[\"Backwards\"] = 2] = \"Backwards\";\n})(TrimDirection || (TrimDirection = {}));\n/**\n * Return the offset of the nearest non-whitespace character to `baseOffset`\n * within the string `text`, looking in the `direction` indicated. Return -1 if\n * no non-whitespace character exists between `baseOffset` (inclusive) and the\n * terminus of the string (start or end depending on `direction`).\n */\nfunction closestNonSpaceInString(text, baseOffset, direction) {\n const nextChar = direction === TrimDirection.Forwards ? baseOffset : baseOffset - 1;\n if (text.charAt(nextChar).trim() !== \"\") {\n // baseOffset is already valid: it points at a non-whitespace character\n return baseOffset;\n }\n let availableChars;\n let availableNonWhitespaceChars;\n if (direction === TrimDirection.Backwards) {\n availableChars = text.substring(0, baseOffset);\n availableNonWhitespaceChars = availableChars.trimEnd();\n }\n else {\n availableChars = text.substring(baseOffset);\n availableNonWhitespaceChars = availableChars.trimStart();\n }\n if (!availableNonWhitespaceChars.length) {\n return -1;\n }\n const offsetDelta = availableChars.length - availableNonWhitespaceChars.length;\n return direction === TrimDirection.Backwards\n ? baseOffset - offsetDelta\n : baseOffset + offsetDelta;\n}\n/**\n * Calculate a new Range start position (TrimDirection.Forwards) or end position\n * (Backwards) for `range` that represents the nearest non-whitespace character,\n * moving into the `range` away from the relevant initial boundary node towards\n * the terminating boundary node.\n *\n * @throws {RangeError} If no text node with non-whitespace characters found\n */\nfunction closestNonSpaceInRange(range, direction) {\n const nodeIter = range.commonAncestorContainer.ownerDocument.createNodeIterator(range.commonAncestorContainer, NodeFilter.SHOW_TEXT);\n const initialBoundaryNode = direction === TrimDirection.Forwards\n ? range.startContainer\n : range.endContainer;\n const terminalBoundaryNode = direction === TrimDirection.Forwards\n ? range.endContainer\n : range.startContainer;\n let currentNode = nodeIter.nextNode();\n // Advance the NodeIterator to the `initialBoundaryNode`\n while (currentNode && currentNode !== initialBoundaryNode) {\n currentNode = nodeIter.nextNode();\n }\n if (direction === TrimDirection.Backwards) {\n // Reverse the NodeIterator direction. This will return the same node\n // as the previous `nextNode()` call (initial boundary node).\n currentNode = nodeIter.previousNode();\n }\n let trimmedOffset = -1;\n const advance = () => {\n currentNode =\n direction === TrimDirection.Forwards\n ? nodeIter.nextNode()\n : nodeIter.previousNode();\n if (currentNode) {\n const nodeText = currentNode.textContent;\n const baseOffset = direction === TrimDirection.Forwards ? 0 : nodeText.length;\n trimmedOffset = closestNonSpaceInString(nodeText, baseOffset, direction);\n }\n };\n while (currentNode &&\n trimmedOffset === -1 &&\n currentNode !== terminalBoundaryNode) {\n advance();\n }\n if (currentNode && trimmedOffset >= 0) {\n return { node: currentNode, offset: trimmedOffset };\n }\n /* istanbul ignore next */\n throw new RangeError(\"No text nodes with non-whitespace text found in range\");\n}\n/**\n * Return a new DOM Range that adjusts the start and end positions of `range` as\n * needed such that:\n *\n * - `startContainer` and `endContainer` text nodes both contain at least one\n * non-whitespace character within the Range's text content\n * - `startOffset` and `endOffset` both reference non-whitespace characters,\n * with `startOffset` immediately before the first non-whitespace character\n * and `endOffset` immediately after the last\n *\n * Whitespace characters are those that are removed by `String.prototype.trim()`\n *\n * @param range - A DOM Range that whose `startContainer` and `endContainer` are\n * both text nodes, and which contains at least one non-whitespace character.\n * @throws {RangeError}\n */\nexport function trimRange(range) {\n if (!range.toString().trim().length) {\n throw new RangeError(\"Range contains no non-whitespace text\");\n }\n if (range.startContainer.nodeType !== Node.TEXT_NODE) {\n throw new RangeError(\"Range startContainer is not a text node\");\n }\n if (range.endContainer.nodeType !== Node.TEXT_NODE) {\n throw new RangeError(\"Range endContainer is not a text node\");\n }\n const trimmedRange = range.cloneRange();\n let startTrimmed = false;\n let endTrimmed = false;\n const trimmedOffsets = {\n start: closestNonSpaceInString(range.startContainer.textContent, range.startOffset, TrimDirection.Forwards),\n end: closestNonSpaceInString(range.endContainer.textContent, range.endOffset, TrimDirection.Backwards),\n };\n if (trimmedOffsets.start >= 0) {\n trimmedRange.setStart(range.startContainer, trimmedOffsets.start);\n startTrimmed = true;\n }\n // Note: An offset of 0 is invalid for an end offset, as no text in the\n // node would be included in the range.\n if (trimmedOffsets.end > 0) {\n trimmedRange.setEnd(range.endContainer, trimmedOffsets.end);\n endTrimmed = true;\n }\n if (startTrimmed && endTrimmed) {\n return trimmedRange;\n }\n if (!startTrimmed) {\n // There are no (non-whitespace) characters between `startOffset` and the\n // end of the `startContainer` node.\n const { node, offset } = closestNonSpaceInRange(trimmedRange, TrimDirection.Forwards);\n if (node && offset >= 0) {\n trimmedRange.setStart(node, offset);\n }\n }\n if (!endTrimmed) {\n // There are no (non-whitespace) characters between the start of the Range's\n // `endContainer` text content and the `endOffset`.\n const { node, offset } = closestNonSpaceInRange(trimmedRange, TrimDirection.Backwards);\n if (node && offset > 0) {\n trimmedRange.setEnd(node, offset);\n }\n }\n return trimmedRange;\n}\n","import { trimRange } from \"./trim-range\";\n/**\n * Return the combined length of text nodes contained in `node`.\n */\nfunction nodeTextLength(node) {\n var _a, _b;\n switch (node.nodeType) {\n case Node.ELEMENT_NODE:\n case Node.TEXT_NODE:\n // nb. `textContent` excludes text in comments and processing instructions\n // when called on a parent element, so we don't need to subtract that here.\n return (_b = (_a = node.textContent) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;\n default:\n return 0;\n }\n}\n/**\n * Return the total length of the text of all previous siblings of `node`.\n */\nfunction previousSiblingsTextLength(node) {\n let sibling = node.previousSibling;\n let length = 0;\n while (sibling) {\n length += nodeTextLength(sibling);\n sibling = sibling.previousSibling;\n }\n return length;\n}\n/**\n * Resolve one or more character offsets within an element to (text node,\n * position) pairs.\n *\n * @param element\n * @param offsets - Offsets, which must be sorted in ascending order\n * @throws {RangeError}\n */\nfunction resolveOffsets(element, ...offsets) {\n let nextOffset = offsets.shift();\n const nodeIter = element.ownerDocument.createNodeIterator(element, NodeFilter.SHOW_TEXT);\n const results = [];\n let currentNode = nodeIter.nextNode();\n let textNode;\n let length = 0;\n // Find the text node containing the `nextOffset`th character from the start\n // of `element`.\n while (nextOffset !== undefined && currentNode) {\n textNode = currentNode;\n if (length + textNode.data.length > nextOffset) {\n results.push({ node: textNode, offset: nextOffset - length });\n nextOffset = offsets.shift();\n }\n else {\n currentNode = nodeIter.nextNode();\n length += textNode.data.length;\n }\n }\n // Boundary case.\n while (nextOffset !== undefined && textNode && length === nextOffset) {\n results.push({ node: textNode, offset: textNode.data.length });\n nextOffset = offsets.shift();\n }\n if (nextOffset !== undefined) {\n throw new RangeError(\"Offset exceeds text length\");\n }\n return results;\n}\n/**\n * When resolving a TextPosition, specifies the direction to search for the\n * nearest text node if `offset` is `0` and the element has no text.\n */\nexport var ResolveDirection;\n(function (ResolveDirection) {\n ResolveDirection[ResolveDirection[\"FORWARDS\"] = 1] = \"FORWARDS\";\n ResolveDirection[ResolveDirection[\"BACKWARDS\"] = 2] = \"BACKWARDS\";\n})(ResolveDirection || (ResolveDirection = {}));\n/**\n * Represents an offset within the text content of an element.\n *\n * This position can be resolved to a specific descendant node in the current\n * DOM subtree of the element using the `resolve` method.\n */\nexport class TextPosition {\n constructor(element, offset) {\n if (offset < 0) {\n throw new Error(\"Offset is invalid\");\n }\n /** Element that `offset` is relative to. */\n this.element = element;\n /** Character offset from the start of the element's `textContent`. */\n this.offset = offset;\n }\n /**\n * Return a copy of this position with offset relative to a given ancestor\n * element.\n *\n * @param parent - Ancestor of `this.element`\n */\n relativeTo(parent) {\n if (!parent.contains(this.element)) {\n throw new Error(\"Parent is not an ancestor of current element\");\n }\n let el = this.element;\n let offset = this.offset;\n while (el !== parent) {\n offset += previousSiblingsTextLength(el);\n el = el.parentElement;\n }\n return new TextPosition(el, offset);\n }\n /**\n * Resolve the position to a specific text node and offset within that node.\n *\n * Throws if `this.offset` exceeds the length of the element's text. In the\n * case where the element has no text and `this.offset` is 0, the `direction`\n * option determines what happens.\n *\n * Offsets at the boundary between two nodes are resolved to the start of the\n * node that begins at the boundary.\n *\n * @param options.direction - Specifies in which direction to search for the\n * nearest text node if `this.offset` is `0` and\n * `this.element` has no text. If not specified an\n * error is thrown.\n *\n * @throws {RangeError}\n */\n resolve(options = {}) {\n try {\n return resolveOffsets(this.element, this.offset)[0];\n }\n catch (err) {\n if (this.offset === 0 && options.direction !== undefined) {\n const tw = document.createTreeWalker(this.element.getRootNode(), NodeFilter.SHOW_TEXT);\n tw.currentNode = this.element;\n const forwards = options.direction === ResolveDirection.FORWARDS;\n const text = forwards\n ? tw.nextNode()\n : tw.previousNode();\n if (!text) {\n throw err;\n }\n return { node: text, offset: forwards ? 0 : text.data.length };\n }\n else {\n throw err;\n }\n }\n }\n /**\n * Construct a `TextPosition` that refers to the `offset`th character within\n * `node`.\n */\n static fromCharOffset(node, offset) {\n switch (node.nodeType) {\n case Node.TEXT_NODE:\n return TextPosition.fromPoint(node, offset);\n case Node.ELEMENT_NODE:\n return new TextPosition(node, offset);\n default:\n throw new Error(\"Node is not an element or text node\");\n }\n }\n /**\n * Construct a `TextPosition` representing the range start or end point (node, offset).\n *\n * @param node\n * @param offset - Offset within the node\n */\n static fromPoint(node, offset) {\n switch (node.nodeType) {\n case Node.TEXT_NODE: {\n if (offset < 0 || offset > node.data.length) {\n throw new Error(\"Text node offset is out of range\");\n }\n if (!node.parentElement) {\n throw new Error(\"Text node has no parent\");\n }\n // Get the offset from the start of the parent element.\n const textOffset = previousSiblingsTextLength(node) + offset;\n return new TextPosition(node.parentElement, textOffset);\n }\n case Node.ELEMENT_NODE: {\n if (offset < 0 || offset > node.childNodes.length) {\n throw new Error(\"Child node offset is out of range\");\n }\n // Get the text length before the `offset`th child of element.\n let textOffset = 0;\n for (let i = 0; i < offset; i++) {\n textOffset += nodeTextLength(node.childNodes[i]);\n }\n return new TextPosition(node, textOffset);\n }\n default:\n throw new Error(\"Point is not in an element or text node\");\n }\n }\n}\n/**\n * Represents a region of a document as a (start, end) pair of `TextPosition` points.\n *\n * Representing a range in this way allows for changes in the DOM content of the\n * range which don't affect its text content, without affecting the text content\n * of the range itself.\n */\nexport class TextRange {\n constructor(start, end) {\n this.start = start;\n this.end = end;\n }\n /**\n * Create a new TextRange whose `start` and `end` are computed relative to\n * `element`. `element` must be an ancestor of both `start.element` and\n * `end.element`.\n */\n relativeTo(element) {\n return new TextRange(this.start.relativeTo(element), this.end.relativeTo(element));\n }\n /**\n * Resolve this TextRange to a (DOM) Range.\n *\n * The resulting DOM Range will always start and end in a `Text` node.\n * Hence `TextRange.fromRange(range).toRange()` can be used to \"shrink\" a\n * range to the text it contains.\n *\n * May throw if the `start` or `end` positions cannot be resolved to a range.\n */\n toRange() {\n let start;\n let end;\n if (this.start.element === this.end.element &&\n this.start.offset <= this.end.offset) {\n // Fast path for start and end points in same element.\n [start, end] = resolveOffsets(this.start.element, this.start.offset, this.end.offset);\n }\n else {\n start = this.start.resolve({\n direction: ResolveDirection.FORWARDS,\n });\n end = this.end.resolve({ direction: ResolveDirection.BACKWARDS });\n }\n const range = new Range();\n range.setStart(start.node, start.offset);\n range.setEnd(end.node, end.offset);\n return range;\n }\n /**\n * Create a TextRange from a (DOM) Range\n */\n static fromRange(range) {\n const start = TextPosition.fromPoint(range.startContainer, range.startOffset);\n const end = TextPosition.fromPoint(range.endContainer, range.endOffset);\n return new TextRange(start, end);\n }\n /**\n * Create a TextRange representing the `start`th to `end`th characters in\n * `root`\n */\n static fromOffsets(root, start, end) {\n return new TextRange(new TextPosition(root, start), new TextPosition(root, end));\n }\n /**\n * Return a new Range representing `range` trimmed of any leading or trailing\n * whitespace\n */\n static trimmedRange(range) {\n return trimRange(TextRange.fromRange(range).toRange());\n }\n}\n","import approxSearch from \"approx-string-match\";\n/**\n * Find the best approximate matches for `str` in `text` allowing up to\n * `maxErrors` errors.\n */\nfunction search(text, str, maxErrors) {\n // Do a fast search for exact matches. The `approx-string-match` library\n // doesn't currently incorporate this optimization itself.\n let matchPos = 0;\n const exactMatches = [];\n while (matchPos !== -1) {\n matchPos = text.indexOf(str, matchPos);\n if (matchPos !== -1) {\n exactMatches.push({\n start: matchPos,\n end: matchPos + str.length,\n errors: 0,\n });\n matchPos += 1;\n }\n }\n if (exactMatches.length > 0) {\n return exactMatches;\n }\n // If there are no exact matches, do a more expensive search for matches\n // with errors.\n return approxSearch(text, str, maxErrors);\n}\n/**\n * Compute a score between 0 and 1.0 for the similarity between `text` and `str`.\n */\nfunction textMatchScore(text, str) {\n // `search` will return no matches if either the text or pattern is empty,\n // otherwise it will return at least one match if the max allowed error count\n // is at least `str.length`.\n if (str.length === 0 || text.length === 0) {\n return 0.0;\n }\n const matches = search(text, str, str.length);\n // prettier-ignore\n return 1 - (matches[0].errors / str.length);\n}\n/**\n * Find the best approximate match for `quote` in `text`.\n *\n * @param text - Document text to search\n * @param quote - String to find within `text`\n * @param context - Context in which the quote originally appeared. This is\n * used to choose the best match.\n * @return `null` if no match exceeding the minimum quality threshold was found.\n */\nexport function matchQuote(text, quote, context = {}) {\n if (quote.length === 0) {\n return null;\n }\n // Choose the maximum number of errors to allow for the initial search.\n // This choice involves a tradeoff between:\n //\n // - Recall (proportion of \"good\" matches found)\n // - Precision (proportion of matches found which are \"good\")\n // - Cost of the initial search and of processing the candidate matches [1]\n //\n // [1] Specifically, the expected-time complexity of the initial search is\n // `O((maxErrors / 32) * text.length)`. See `approx-string-match` docs.\n const maxErrors = Math.min(256, quote.length / 2);\n // Find the closest matches for `quote` in `text` based on edit distance.\n const matches = search(text, quote, maxErrors);\n if (matches.length === 0) {\n return null;\n }\n /**\n * Compute a score between 0 and 1.0 for a match candidate.\n */\n const scoreMatch = (match) => {\n const quoteWeight = 50; // Similarity of matched text to quote.\n const prefixWeight = 20; // Similarity of text before matched text to `context.prefix`.\n const suffixWeight = 20; // Similarity of text after matched text to `context.suffix`.\n const posWeight = 2; // Proximity to expected location. Used as a tie-breaker.\n const quoteScore = 1 - match.errors / quote.length;\n const prefixScore = context.prefix\n ? textMatchScore(text.slice(Math.max(0, match.start - context.prefix.length), match.start), context.prefix)\n : 1.0;\n const suffixScore = context.suffix\n ? textMatchScore(text.slice(match.end, match.end + context.suffix.length), context.suffix)\n : 1.0;\n let posScore = 1.0;\n if (typeof context.hint === \"number\") {\n const offset = Math.abs(match.start - context.hint);\n posScore = 1.0 - offset / text.length;\n }\n const rawScore = quoteWeight * quoteScore +\n prefixWeight * prefixScore +\n suffixWeight * suffixScore +\n posWeight * posScore;\n const maxScore = quoteWeight + prefixWeight + suffixWeight + posWeight;\n const normalizedScore = rawScore / maxScore;\n return normalizedScore;\n };\n // Rank matches based on similarity of actual and expected surrounding text\n // and actual/expected offset in the document text.\n const scoredMatches = matches.map((m) => ({\n start: m.start,\n end: m.end,\n score: scoreMatch(m),\n }));\n // Choose match with the highest score.\n scoredMatches.sort((a, b) => b.score - a.score);\n return scoredMatches[0];\n}\n","import { matchQuote } from \"./match-quote\";\nimport { TextRange, TextPosition } from \"./text-range\";\nimport { nodeFromXPath, xpathFromNode } from \"./xpath\";\n/**\n * Converts between `RangeSelector` selectors and `Range` objects.\n */\nexport class RangeAnchor {\n /**\n * @param root - A root element from which to anchor.\n * @param range - A range describing the anchor.\n */\n constructor(root, range) {\n this.root = root;\n this.range = range;\n }\n /**\n * @param root - A root element from which to anchor.\n * @param range - A range describing the anchor.\n */\n static fromRange(root, range) {\n return new RangeAnchor(root, range);\n }\n /**\n * Create an anchor from a serialized `RangeSelector` selector.\n *\n * @param root - A root element from which to anchor.\n */\n static fromSelector(root, selector) {\n const startContainer = nodeFromXPath(selector.startContainer, root);\n if (!startContainer) {\n throw new Error(\"Failed to resolve startContainer XPath\");\n }\n const endContainer = nodeFromXPath(selector.endContainer, root);\n if (!endContainer) {\n throw new Error(\"Failed to resolve endContainer XPath\");\n }\n const startPos = TextPosition.fromCharOffset(startContainer, selector.startOffset);\n const endPos = TextPosition.fromCharOffset(endContainer, selector.endOffset);\n const range = new TextRange(startPos, endPos).toRange();\n return new RangeAnchor(root, range);\n }\n toRange() {\n return this.range;\n }\n toSelector() {\n // \"Shrink\" the range so that it tightly wraps its text. This ensures more\n // predictable output for a given text selection.\n const normalizedRange = TextRange.fromRange(this.range).toRange();\n const textRange = TextRange.fromRange(normalizedRange);\n const startContainer = xpathFromNode(textRange.start.element, this.root);\n const endContainer = xpathFromNode(textRange.end.element, this.root);\n return {\n type: \"RangeSelector\",\n startContainer,\n startOffset: textRange.start.offset,\n endContainer,\n endOffset: textRange.end.offset,\n };\n }\n}\n/**\n * Converts between `TextPositionSelector` selectors and `Range` objects.\n */\nexport class TextPositionAnchor {\n constructor(root, start, end) {\n this.root = root;\n this.start = start;\n this.end = end;\n }\n static fromRange(root, range) {\n const textRange = TextRange.fromRange(range).relativeTo(root);\n return new TextPositionAnchor(root, textRange.start.offset, textRange.end.offset);\n }\n static fromSelector(root, selector) {\n return new TextPositionAnchor(root, selector.start, selector.end);\n }\n toSelector() {\n return {\n type: \"TextPositionSelector\",\n start: this.start,\n end: this.end,\n };\n }\n toRange() {\n return TextRange.fromOffsets(this.root, this.start, this.end).toRange();\n }\n}\n/**\n * Converts between `TextQuoteSelector` selectors and `Range` objects.\n */\nexport class TextQuoteAnchor {\n /**\n * @param root - A root element from which to anchor.\n */\n constructor(root, exact, context = {}) {\n this.root = root;\n this.exact = exact;\n this.context = context;\n }\n /**\n * Create a `TextQuoteAnchor` from a range.\n *\n * Will throw if `range` does not contain any text nodes.\n */\n static fromRange(root, range) {\n const text = root.textContent;\n const textRange = TextRange.fromRange(range).relativeTo(root);\n const start = textRange.start.offset;\n const end = textRange.end.offset;\n // Number of characters around the quote to capture as context. We currently\n // always use a fixed amount, but it would be better if this code was aware\n // of logical boundaries in the document (paragraph, article etc.) to avoid\n // capturing text unrelated to the quote.\n //\n // In regular prose the ideal content would often be the surrounding sentence.\n // This is a natural unit of meaning which enables displaying quotes in\n // context even when the document is not available. We could use `Intl.Segmenter`\n // for this when available.\n const contextLen = 32;\n return new TextQuoteAnchor(root, text.slice(start, end), {\n prefix: text.slice(Math.max(0, start - contextLen), start),\n suffix: text.slice(end, Math.min(text.length, end + contextLen)),\n });\n }\n static fromSelector(root, selector) {\n const { prefix, suffix } = selector;\n return new TextQuoteAnchor(root, selector.exact, { prefix, suffix });\n }\n toSelector() {\n return {\n type: \"TextQuoteSelector\",\n exact: this.exact,\n prefix: this.context.prefix,\n suffix: this.context.suffix,\n };\n }\n toRange(options = {}) {\n return this.toPositionAnchor(options).toRange();\n }\n toPositionAnchor(options = {}) {\n const text = this.root.textContent;\n const match = matchQuote(text, this.exact, Object.assign(Object.assign({}, this.context), { hint: options.hint }));\n if (!match) {\n throw new Error(\"Quote not found\");\n }\n return new TextPositionAnchor(this.root, match.start, match.end);\n }\n}\n/**\n * Parse a string containing a time offset in seconds, since the start of some\n * media, into a float.\n */\nfunction parseMediaTime(timeStr) {\n const val = parseFloat(timeStr);\n if (!Number.isFinite(val) || val < 0) {\n return null;\n }\n return val;\n}\n/** Implementation of {@link Array.prototype.findLastIndex} */\nfunction findLastIndex(ary, pred) {\n for (let i = ary.length - 1; i >= 0; i--) {\n if (pred(ary[i])) {\n return i;\n }\n }\n return -1;\n}\nfunction closestElement(node) {\n return node instanceof Element ? node : node.parentElement;\n}\n/**\n * Get the media time range associated with an element or pair of elements,\n * from `data-time-{start, end}` attributes on them.\n */\nfunction getMediaTimeRange(start, end = start) {\n var _a, _b;\n const startTime = parseMediaTime((_a = start === null || start === void 0 ? void 0 : start.getAttribute(\"data-time-start\")) !== null && _a !== void 0 ? _a : \"\");\n const endTime = parseMediaTime((_b = end === null || end === void 0 ? void 0 : end.getAttribute(\"data-time-end\")) !== null && _b !== void 0 ? _b : \"\");\n if (typeof startTime !== \"number\" ||\n typeof endTime !== \"number\" ||\n endTime < startTime) {\n return null;\n }\n return [startTime, endTime];\n}\nexport class MediaTimeAnchor {\n constructor(root, start, end) {\n this.root = root;\n this.start = start;\n this.end = end;\n }\n /**\n * Return a {@link MediaTimeAnchor} that represents a range, or `null` if\n * no time range information is present on elements in the range.\n */\n static fromRange(root, range) {\n var _a, _b;\n const start = (_a = closestElement(range.startContainer)) === null || _a === void 0 ? void 0 : _a.closest(\"[data-time-start]\");\n const end = (_b = closestElement(range.endContainer)) === null || _b === void 0 ? void 0 : _b.closest(\"[data-time-end]\");\n const timeRange = getMediaTimeRange(start, end);\n if (!timeRange) {\n return null;\n }\n const [startTime, endTime] = timeRange;\n return new MediaTimeAnchor(root, startTime, endTime);\n }\n /**\n * Convert this anchor to a DOM range.\n *\n * This returned range will start from the beginning of the element whose\n * associated time range includes `start` and continue to the end of the\n * element whose associated time range includes `end`.\n */\n toRange() {\n const segments = [...this.root.querySelectorAll(\"[data-time-start]\")]\n .map((element) => {\n const timeRange = getMediaTimeRange(element);\n if (!timeRange) {\n return null;\n }\n const [start, end] = timeRange;\n return { element, start, end };\n })\n .filter((s) => s !== null);\n segments.sort((a, b) => a.start - b.start);\n const startIdx = findLastIndex(segments, (s) => s.start <= this.start && s.end >= this.start);\n if (startIdx === -1) {\n throw new Error(\"Start segment not found\");\n }\n const endIdx = startIdx +\n segments\n .slice(startIdx)\n .findIndex((s) => s.start <= this.end && s.end >= this.end);\n if (endIdx === -1) {\n throw new Error(\"End segment not found\");\n }\n const range = new Range();\n range.setStart(segments[startIdx].element, 0);\n const endEl = segments[endIdx].element;\n range.setEnd(endEl, endEl.childNodes.length);\n return range;\n }\n static fromSelector(root, selector) {\n const { start, end } = selector;\n return new MediaTimeAnchor(root, start, end);\n }\n toSelector() {\n return {\n type: \"MediaTimeSelector\",\n start: this.start,\n end: this.end,\n };\n }\n}\n","import { log } from \"../util/log\";\nimport { getClientRectsNoOverlap, dezoomDomRect, dezoomRect, rectContainsPoint, domRectToRect, } from \"../util/rect\";\nimport { TextQuoteAnchor } from \"../vendor/hypothesis/annotator/anchoring/types\";\nexport class DecorationManager {\n constructor(window) {\n this.styles = new Map();\n this.groups = new Map();\n this.lastGroupId = 0;\n this.window = window;\n // Relayout all the decorations when the document body is resized.\n window.addEventListener(\"load\", () => {\n const body = window.document.body;\n let lastSize = { width: 0, height: 0 };\n const observer = new ResizeObserver(() => {\n requestAnimationFrame(() => {\n if (lastSize.width === body.clientWidth &&\n lastSize.height === body.clientHeight) {\n return;\n }\n lastSize = {\n width: body.clientWidth,\n height: body.clientHeight,\n };\n this.relayoutDecorations();\n });\n });\n observer.observe(body);\n }, false);\n }\n registerTemplates(templates) {\n let stylesheet = \"\";\n for (const [id, template] of templates) {\n this.styles.set(id, template);\n if (template.stylesheet) {\n stylesheet += template.stylesheet + \"\\n\";\n }\n }\n if (stylesheet) {\n const styleElement = document.createElement(\"style\");\n styleElement.innerHTML = stylesheet;\n document.getElementsByTagName(\"head\")[0].appendChild(styleElement);\n }\n }\n addDecoration(decoration, groupName) {\n console.log(`addDecoration ${decoration.id} ${groupName}`);\n const group = this.getGroup(groupName);\n group.add(decoration);\n }\n removeDecoration(id, groupName) {\n console.log(`removeDecoration ${id} ${groupName}`);\n const group = this.getGroup(groupName);\n group.remove(id);\n }\n relayoutDecorations() {\n console.log(\"relayoutDecorations\");\n for (const group of this.groups.values()) {\n group.relayout();\n }\n }\n getGroup(name) {\n let group = this.groups.get(name);\n if (!group) {\n const id = \"readium-decoration-\" + this.lastGroupId++;\n group = new DecorationGroup(id, name, this.styles);\n this.groups.set(name, group);\n }\n return group;\n }\n /**\n * Handles click events on a Decoration.\n * Returns whether a decoration matched this event.\n */\n handleDecorationClickEvent(event) {\n if (this.groups.size === 0) {\n return null;\n }\n const findTarget = () => {\n for (const [group, groupContent] of this.groups) {\n for (const item of groupContent.items.reverse()) {\n if (!item.clickableElements) {\n continue;\n }\n for (const element of item.clickableElements) {\n const rect = domRectToRect(element.getBoundingClientRect());\n if (rectContainsPoint(rect, event.clientX, event.clientY, 1)) {\n return { group, item, element };\n }\n }\n }\n }\n };\n const target = findTarget();\n if (!target) {\n return null;\n }\n return {\n id: target.item.decoration.id,\n group: target.group,\n rect: domRectToRect(target.item.range.getBoundingClientRect()),\n event: event,\n };\n }\n}\nclass DecorationGroup {\n constructor(id, name, styles) {\n this.items = [];\n this.lastItemId = 0;\n this.container = null;\n this.groupId = id;\n this.groupName = name;\n this.styles = styles;\n }\n add(decoration) {\n const id = this.groupId + \"-\" + this.lastItemId++;\n const range = rangeFromDecorationTarget(decoration.cssSelector, decoration.textQuote);\n if (!range) {\n log(\"Can't locate DOM range for decoration\", decoration);\n return;\n }\n const item = {\n id,\n decoration,\n range,\n container: null,\n clickableElements: null,\n };\n this.items.push(item);\n this.layout(item);\n }\n remove(id) {\n const index = this.items.findIndex((it) => it.decoration.id === id);\n if (index === -1) {\n return;\n }\n const item = this.items[index];\n this.items.splice(index, 1);\n item.clickableElements = null;\n if (item.container) {\n item.container.remove();\n item.container = null;\n }\n }\n relayout() {\n this.clearContainer();\n for (const item of this.items) {\n this.layout(item);\n }\n }\n /**\n * Returns the group container element, after making sure it exists.\n */\n requireContainer() {\n if (!this.container) {\n this.container = document.createElement(\"div\");\n this.container.id = this.groupId;\n this.container.dataset.group = this.groupName;\n this.container.style.pointerEvents = \"none\";\n document.body.append(this.container);\n }\n return this.container;\n }\n /**\n * Removes the group container.\n */\n clearContainer() {\n if (this.container) {\n this.container.remove();\n this.container = null;\n }\n }\n /**\n * Layouts a single Decoration item.\n */\n layout(item) {\n const groupContainer = this.requireContainer();\n const unsafeStyle = this.styles.get(item.decoration.style);\n if (!unsafeStyle) {\n console.log(`Unknown decoration style: ${item.decoration.style}`);\n return;\n }\n const style = unsafeStyle;\n const itemContainer = document.createElement(\"div\");\n itemContainer.id = item.id;\n itemContainer.dataset.style = item.decoration.style;\n itemContainer.style.pointerEvents = \"none\";\n const documentWritingMode = getDocumentWritingMode();\n const isVertical = documentWritingMode === \"vertical-rl\" ||\n documentWritingMode === \"vertical-lr\";\n const zoom = groupContainer.currentCSSZoom;\n const scrollingElement = document.scrollingElement;\n const xOffset = scrollingElement.scrollLeft / zoom;\n const yOffset = scrollingElement.scrollTop / zoom;\n const viewportWidth = isVertical ? window.innerHeight : window.innerWidth;\n const viewportHeight = isVertical ? window.innerWidth : window.innerHeight;\n const columnCount = parseInt(getComputedStyle(document.documentElement).getPropertyValue(\"column-count\")) || 1;\n const pageSize = (isVertical ? viewportHeight : viewportWidth) / columnCount;\n function positionElement(element, rect, boundingRect, writingMode) {\n element.style.position = \"absolute\";\n const isVerticalRL = writingMode === \"vertical-rl\";\n const isVerticalLR = writingMode === \"vertical-lr\";\n if (isVerticalRL || isVerticalLR) {\n if (style.width === \"wrap\") {\n element.style.width = `${rect.width}px`;\n element.style.height = `${rect.height}px`;\n if (isVerticalRL) {\n element.style.right = `${-rect.right - xOffset + scrollingElement.clientWidth}px`;\n }\n else {\n // vertical-lr\n element.style.left = `${rect.left + xOffset}px`;\n }\n element.style.top = `${rect.top + yOffset}px`;\n }\n else if (style.width === \"viewport\") {\n element.style.width = `${rect.height}px`;\n element.style.height = `${viewportWidth}px`;\n const top = Math.floor(rect.top / viewportWidth) * viewportWidth;\n if (isVerticalRL) {\n element.style.right = `${-rect.right - xOffset}px`;\n }\n else {\n // vertical-lr\n element.style.left = `${rect.left + xOffset}px`;\n }\n element.style.top = `${top + yOffset}px`;\n }\n else if (style.width === \"bounds\") {\n element.style.width = `${boundingRect.height}px`;\n element.style.height = `${viewportWidth}px`;\n if (isVerticalRL) {\n element.style.right = `${-boundingRect.right - xOffset + scrollingElement.clientWidth}px`;\n }\n else {\n // vertical-lr\n element.style.left = `${boundingRect.left + xOffset}px`;\n }\n element.style.top = `${boundingRect.top + yOffset}px`;\n }\n else if (style.width === \"page\") {\n element.style.width = `${rect.height}px`;\n element.style.height = `${pageSize}px`;\n const top = Math.floor(rect.top / pageSize) * pageSize;\n if (isVerticalRL) {\n element.style.right = `${-rect.right - xOffset + scrollingElement.clientWidth}px`;\n }\n else {\n // vertical-lr\n element.style.left = `${rect.left + xOffset}px`;\n }\n element.style.top = `${top + yOffset}px`;\n }\n }\n else {\n if (style.width === \"wrap\") {\n element.style.width = `${rect.width}px`;\n element.style.height = `${rect.height}px`;\n element.style.left = `${rect.left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n }\n else if (style.width === \"viewport\") {\n element.style.width = `${viewportWidth}px`;\n element.style.height = `${rect.height}px`;\n const left = Math.floor(rect.left / viewportWidth) * viewportWidth;\n element.style.left = `${left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n }\n else if (style.width === \"bounds\") {\n element.style.width = `${boundingRect.width}px`;\n element.style.height = `${rect.height}px`;\n element.style.left = `${boundingRect.left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n }\n else if (style.width === \"page\") {\n element.style.width = `${pageSize}px`;\n element.style.height = `${rect.height}px`;\n const left = Math.floor(rect.left / pageSize) * pageSize;\n element.style.left = `${left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n }\n }\n }\n const rawBoundingRect = item.range.getBoundingClientRect();\n const boundingRect = dezoomDomRect(rawBoundingRect, zoom);\n let elementTemplate;\n try {\n const template = document.createElement(\"template\");\n template.innerHTML = item.decoration.element.trim();\n elementTemplate = template.content.firstElementChild;\n }\n catch (error) {\n let message;\n if (\"message\" in error) {\n message = error.message;\n }\n else {\n message = null;\n }\n console.log(`Invalid decoration element \"${item.decoration.element}\": ${message}`);\n return;\n }\n if (style.layout === \"boxes\") {\n const doNotMergeHorizontallyAlignedRects = !documentWritingMode.startsWith(\"vertical\");\n const startElement = getContainingElement(item.range.startContainer);\n // Decorated text may have a different writingMode from document body\n const decoratorWritingMode = getComputedStyle(startElement).writingMode;\n const clientRects = getClientRectsNoOverlap(item.range, doNotMergeHorizontallyAlignedRects)\n .map((rect) => {\n return dezoomRect(rect, zoom);\n })\n .sort((r1, r2) => {\n if (r1.top !== r2.top)\n return r1.top - r2.top;\n if (decoratorWritingMode === \"vertical-rl\") {\n return r2.left - r1.left;\n }\n else if (decoratorWritingMode === \"vertical-lr\") {\n return r1.left - r2.left;\n }\n else {\n return r1.left - r2.left;\n }\n });\n for (const clientRect of clientRects) {\n const line = elementTemplate.cloneNode(true);\n line.style.pointerEvents = \"none\";\n line.dataset.writingMode = decoratorWritingMode;\n positionElement(line, clientRect, boundingRect, documentWritingMode);\n itemContainer.append(line);\n }\n }\n else if (style.layout === \"bounds\") {\n const bounds = elementTemplate.cloneNode(true);\n bounds.style.pointerEvents = \"none\";\n bounds.dataset.writingMode = documentWritingMode;\n positionElement(bounds, boundingRect, boundingRect, documentWritingMode);\n itemContainer.append(bounds);\n }\n groupContainer.append(itemContainer);\n item.container = itemContainer;\n item.clickableElements = Array.from(itemContainer.querySelectorAll(\"[data-activable='1']\"));\n if (item.clickableElements.length === 0) {\n item.clickableElements = Array.from(itemContainer.children);\n }\n }\n}\n/**\n * Returns the document body's writing mode.\n */\nfunction getDocumentWritingMode() {\n return getComputedStyle(document.body).writingMode;\n}\n/**\n * Returns the closest element ancestor of the given node.\n */\nfunction getContainingElement(node) {\n return node.nodeType === Node.ELEMENT_NODE ? node : node.parentElement;\n}\n/*\n * Compute DOM range from decoration target.\n */\nexport function rangeFromDecorationTarget(cssSelector, textQuote) {\n let root;\n if (cssSelector) {\n try {\n root = document.querySelector(cssSelector);\n }\n catch (e) {\n log(e);\n }\n }\n if (!root && !textQuote) {\n return null;\n }\n else if (!root) {\n root = document.body;\n }\n if (textQuote) {\n const anchor = new TextQuoteAnchor(root, textQuote.quotedText, {\n prefix: textQuote.textBefore,\n suffix: textQuote.textAfter,\n });\n return anchor.toRange();\n }\n else {\n const range = document.createRange();\n range.setStartBefore(root);\n range.setEndAfter(root);\n return range;\n }\n}\n","//\n// Copyright 2021 Readium Foundation. All rights reserved.\n// Use of this source code is governed by the BSD-style license\n// available in the top-level LICENSE file of the project.\n//\nimport { dezoomRect, domRectToRect } from \"../util/rect\";\nimport { log } from \"../util/log\";\nimport { TextRange } from \"../vendor/hypothesis/annotator/anchoring/text-range\";\n// Polyfill for Android API 26\nimport matchAll from \"string.prototype.matchall\";\nimport { rectToParentCoordinates } from \"./geometry\";\nmatchAll.shim();\nexport function selectionToParentCoordinates(selection, iframe) {\n const boundingRect = iframe.getBoundingClientRect();\n const shiftedRect = rectToParentCoordinates(selection.selectionRect, boundingRect);\n return {\n selectedText: selection === null || selection === void 0 ? void 0 : selection.selectedText,\n selectionRect: shiftedRect,\n textBefore: selection.textBefore,\n textAfter: selection.textAfter,\n };\n}\nexport class SelectionManager {\n constructor(window) {\n this.isSelecting = false;\n //, listener: SelectionListener) {\n this.window = window;\n /*this.listener = listener\n document.addEventListener(\n \"selectionchange\",\n () => {\n const selection = window.getSelection()!\n const collapsed = selection.isCollapsed\n \n if (collapsed && this.isSelecting) {\n this.isSelecting = false\n this.listener.onSelectionEnd()\n } else if (!collapsed && !this.isSelecting) {\n this.isSelecting = true\n this.listener.onSelectionStart()\n }\n },\n false\n )*/\n }\n clearSelection() {\n var _a;\n (_a = this.window.getSelection()) === null || _a === void 0 ? void 0 : _a.removeAllRanges();\n }\n getCurrentSelection() {\n const text = this.getCurrentSelectionText();\n if (!text) {\n return null;\n }\n const rect = this.getSelectionRect();\n return {\n selectedText: text.highlight,\n textBefore: text.before,\n textAfter: text.after,\n selectionRect: rect,\n };\n }\n getSelectionRect() {\n try {\n const selection = this.window.getSelection();\n const range = selection.getRangeAt(0);\n const zoom = this.window.document.body.currentCSSZoom;\n return dezoomRect(domRectToRect(range.getBoundingClientRect()), zoom);\n }\n catch (e) {\n log(e);\n throw e;\n //return null\n }\n }\n getCurrentSelectionText() {\n const selection = this.window.getSelection();\n if (selection.isCollapsed) {\n return undefined;\n }\n const highlight = selection.toString();\n const cleanHighlight = highlight\n .trim()\n .replace(/\\n/g, \" \")\n .replace(/\\s\\s+/g, \" \");\n if (cleanHighlight.length === 0) {\n return undefined;\n }\n if (!selection.anchorNode || !selection.focusNode) {\n return undefined;\n }\n const range = selection.rangeCount === 1\n ? selection.getRangeAt(0)\n : createOrderedRange(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);\n if (!range || range.collapsed) {\n log(\"$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!\");\n return undefined;\n }\n const text = document.body.textContent;\n const textRange = TextRange.fromRange(range).relativeTo(document.body);\n const start = textRange.start.offset;\n const end = textRange.end.offset;\n const snippetLength = 200;\n // Compute the text before the highlight, ignoring the first \"word\", which might be cut.\n let before = text.slice(Math.max(0, start - snippetLength), start);\n const firstWordStart = before.search(/\\P{L}\\p{L}/gu);\n if (firstWordStart !== -1) {\n before = before.slice(firstWordStart + 1);\n }\n // Compute the text after the highlight, ignoring the last \"word\", which might be cut.\n let after = text.slice(end, Math.min(text.length, end + snippetLength));\n const lastWordEnd = Array.from(after.matchAll(/\\p{L}\\P{L}/gu)).pop();\n if (lastWordEnd !== undefined && lastWordEnd.index > 1) {\n after = after.slice(0, lastWordEnd.index + 1);\n }\n return { highlight, before, after };\n }\n}\nfunction createOrderedRange(startNode, startOffset, endNode, endOffset) {\n const range = new Range();\n range.setStart(startNode, startOffset);\n range.setEnd(endNode, endOffset);\n if (!range.collapsed) {\n return range;\n }\n log(\">>> createOrderedRange COLLAPSED ... RANGE REVERSE?\");\n const rangeReverse = new Range();\n rangeReverse.setStart(endNode, endOffset);\n rangeReverse.setEnd(startNode, startOffset);\n if (!rangeReverse.collapsed) {\n log(\">>> createOrderedRange RANGE REVERSE OK.\");\n return range;\n }\n log(\">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!\");\n return undefined;\n}\n/*\nexport function convertRangeInfo(document: Document, rangeInfo) {\n const startElement = document.querySelector(\n rangeInfo.startContainerElementCssSelector\n );\n if (!startElement) {\n log(\"^^^ convertRangeInfo NO START ELEMENT CSS SELECTOR?!\");\n return undefined;\n }\n let startContainer = startElement;\n if (rangeInfo.startContainerChildTextNodeIndex >= 0) {\n if (\n rangeInfo.startContainerChildTextNodeIndex >=\n startElement.childNodes.length\n ) {\n log(\n \"^^^ convertRangeInfo rangeInfo.startContainerChildTextNodeIndex >= startElement.childNodes.length?!\"\n );\n return undefined;\n }\n startContainer =\n startElement.childNodes[rangeInfo.startContainerChildTextNodeIndex];\n if (startContainer.nodeType !== Node.TEXT_NODE) {\n log(\"^^^ convertRangeInfo startContainer.nodeType !== Node.TEXT_NODE?!\");\n return undefined;\n }\n }\n const endElement = document.querySelector(\n rangeInfo.endContainerElementCssSelector\n );\n if (!endElement) {\n log(\"^^^ convertRangeInfo NO END ELEMENT CSS SELECTOR?!\");\n return undefined;\n }\n let endContainer = endElement;\n if (rangeInfo.endContainerChildTextNodeIndex >= 0) {\n if (\n rangeInfo.endContainerChildTextNodeIndex >= endElement.childNodes.length\n ) {\n log(\n \"^^^ convertRangeInfo rangeInfo.endContainerChildTextNodeIndex >= endElement.childNodes.length?!\"\n );\n return undefined;\n }\n endContainer =\n endElement.childNodes[rangeInfo.endContainerChildTextNodeIndex];\n if (endContainer.nodeType !== Node.TEXT_NODE) {\n log(\"^^^ convertRangeInfo endContainer.nodeType !== Node.TEXT_NODE?!\");\n return undefined;\n }\n }\n return createOrderedRange(\n startContainer,\n rangeInfo.startOffset,\n endContainer,\n rangeInfo.endOffset\n );\n}\n\nexport function location2RangeInfo(location) {\n const locations = location.locations;\n const domRange = locations.domRange;\n const start = domRange.start;\n const end = domRange.end;\n\n return {\n endContainerChildTextNodeIndex: end.textNodeIndex,\n endContainerElementCssSelector: end.cssSelector,\n endOffset: end.offset,\n startContainerChildTextNodeIndex: start.textNodeIndex,\n startContainerElementCssSelector: start.cssSelector,\n startOffset: start.offset,\n };\n}\n*/\n","export class DecorationWrapperParentSide {\n setMessagePort(messagePort) {\n this.messagePort = messagePort;\n }\n registerTemplates(templates) {\n this.send({ kind: \"registerTemplates\", templates });\n }\n addDecoration(decoration, group) {\n this.send({ kind: \"addDecoration\", decoration, group });\n }\n removeDecoration(id, group) {\n this.send({ kind: \"removeDecoration\", id, group });\n }\n send(message) {\n var _a;\n (_a = this.messagePort) === null || _a === void 0 ? void 0 : _a.postMessage(message);\n }\n}\nexport class DecorationWrapperIframeSide {\n constructor(messagePort, decorationManager) {\n this.decorationManager = decorationManager;\n messagePort.onmessage = (message) => {\n this.onCommand(message.data);\n };\n }\n onCommand(command) {\n switch (command.kind) {\n case \"registerTemplates\":\n return this.registerTemplates(command.templates);\n case \"addDecoration\":\n return this.addDecoration(command.decoration, command.group);\n case \"removeDecoration\":\n return this.removeDecoration(command.id, command.group);\n }\n }\n registerTemplates(templates) {\n this.decorationManager.registerTemplates(templates);\n }\n addDecoration(decoration, group) {\n this.decorationManager.addDecoration(decoration, group);\n }\n removeDecoration(id, group) {\n this.decorationManager.removeDecoration(id, group);\n }\n}\n","export class IframeMessageSender {\n constructor(messagePort) {\n this.messagePort = messagePort;\n }\n send(message) {\n this.messagePort.postMessage(message);\n }\n}\n","export class SelectionWrapperParentSide {\n constructor(listener) {\n this.selectionListener = listener;\n }\n setMessagePort(messagePort) {\n this.messagePort = messagePort;\n messagePort.onmessage = (message) => {\n this.onFeedback(message.data);\n };\n }\n requestSelection(requestId) {\n this.send({ kind: \"requestSelection\", requestId: requestId });\n }\n clearSelection() {\n this.send({ kind: \"clearSelection\" });\n }\n onFeedback(feedback) {\n switch (feedback.kind) {\n case \"selectionAvailable\":\n return this.onSelectionAvailable(feedback.requestId, feedback.selection);\n }\n }\n onSelectionAvailable(requestId, selection) {\n this.selectionListener.onSelectionAvailable(requestId, selection);\n }\n send(message) {\n var _a;\n (_a = this.messagePort) === null || _a === void 0 ? void 0 : _a.postMessage(message);\n }\n}\nexport class SelectionWrapperIframeSide {\n constructor(messagePort, manager) {\n this.selectionManager = manager;\n this.messagePort = messagePort;\n messagePort.onmessage = (message) => {\n this.onCommand(message.data);\n };\n }\n onCommand(command) {\n switch (command.kind) {\n case \"requestSelection\":\n return this.onRequestSelection(command.requestId);\n case \"clearSelection\":\n return this.onClearSelection();\n }\n }\n onRequestSelection(requestId) {\n const selection = this.selectionManager.getCurrentSelection();\n const feedback = {\n kind: \"selectionAvailable\",\n requestId: requestId,\n selection: selection,\n };\n this.sendFeedback(feedback);\n }\n onClearSelection() {\n this.selectionManager.clearSelection();\n }\n sendFeedback(message) {\n this.messagePort.postMessage(message);\n }\n}\n","//\n// Copyright 2024 Readium Foundation. All rights reserved.\n// Use of this source code is governed by the BSD-style license\n// available in the top-level LICENSE file of the project.\n//\n/**\n * Script loaded by fixed layout resources.\n */\nimport { DecorationManager, } from \"./common/decoration\";\nimport { GesturesDetector } from \"./common/gestures\";\nimport { SelectionManager } from \"./common/selection\";\nimport { parseViewportString } from \"./util/viewport\";\nimport { FixedInitializerIframeSide } from \"./bridge/all-initialization-bridge\";\nconst initializer = new FixedInitializerIframeSide(window);\nconst messageSender = initializer.initAreaManager();\nconst selectionManager = new SelectionManager(window);\ninitializer.initSelection(selectionManager);\nconst decorationManager = new DecorationManager(window);\ninitializer.initDecorations(decorationManager);\nconst viewportSize = parseContentSize(window.document);\nmessageSender.send({ kind: \"contentSize\", size: viewportSize });\nclass MessagingGesturesListener {\n constructor(messageSender) {\n this.messageSender = messageSender;\n }\n onTap(gestureEvent) {\n const event = {\n offset: { x: gestureEvent.clientX, y: gestureEvent.clientY },\n };\n this.messageSender.send({ kind: \"tap\", event: event });\n }\n onLinkActivated(href, outerHtml) {\n this.messageSender.send({\n kind: \"linkActivated\",\n href: href,\n outerHtml: outerHtml,\n });\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onDecorationActivated(gestureEvent) {\n const event = {\n id: gestureEvent.id,\n group: gestureEvent.group,\n rect: gestureEvent.rect,\n offset: { x: gestureEvent.event.clientX, y: gestureEvent.event.clientY },\n };\n this.messageSender.send({\n kind: \"decorationActivated\",\n event: event,\n });\n }\n}\nconst messagingListener = new MessagingGesturesListener(messageSender);\nnew GesturesDetector(window, messagingListener, decorationManager);\nfunction parseContentSize(document) {\n const viewport = document.querySelector(\"meta[name=viewport]\");\n if (!viewport || !(viewport instanceof HTMLMetaElement)) {\n return undefined;\n }\n return parseViewportString(viewport.content);\n}\n","import { DecorationWrapperIframeSide } from \"../fixed/decoration-wrapper\";\nimport { IframeMessageSender } from \"../fixed/iframe-message\";\nimport { SelectionWrapperIframeSide } from \"../fixed/selection-wrapper\";\nexport class FixedSingleInitializationBridge {\n constructor(window, listener, iframe, areaBridge, selectionBridge, decorationsBridge) {\n this.window = window;\n this.listener = listener;\n this.iframe = iframe;\n this.areaBridge = areaBridge;\n this.selectionBridge = selectionBridge;\n this.decorationsBridge = decorationsBridge;\n }\n loadResource(url) {\n this.iframe.src = url;\n this.window.addEventListener(\"message\", (event) => {\n console.log(\"message\");\n if (!event.ports[0]) {\n return;\n }\n if (event.source === this.iframe.contentWindow) {\n this.onInitMessage(event);\n }\n });\n }\n onInitMessage(event) {\n console.log(`receiving init message ${event}`);\n const initMessage = event.data;\n const messagePort = event.ports[0];\n switch (initMessage) {\n case \"InitAreaManager\":\n return this.initAreaManager(messagePort);\n case \"InitSelection\":\n return this.initSelection(messagePort);\n case \"InitDecorations\":\n return this.initDecorations(messagePort);\n }\n }\n initAreaManager(messagePort) {\n this.areaBridge.setMessagePort(messagePort);\n this.listener.onAreaApiAvailable();\n }\n initSelection(messagePort) {\n this.selectionBridge.setMessagePort(messagePort);\n this.listener.onSelectionApiAvailable();\n }\n initDecorations(messagePort) {\n this.decorationsBridge.setMessagePort(messagePort);\n this.listener.onDecorationApiAvailable();\n }\n}\nexport class FixedDoubleInitializationBridge {\n constructor(window, listener, leftIframe, rightIframe, areaBridge, selectionBridge, decorationsBridge) {\n this.areaReadySemaphore = 2;\n this.selectionReadySemaphore = 2;\n this.decorationReadySemaphore = 2;\n this.listener = listener;\n this.areaBridge = areaBridge;\n this.selectionBridge = selectionBridge;\n this.decorationsBridge = decorationsBridge;\n window.addEventListener(\"message\", (event) => {\n if (!event.ports[0]) {\n return;\n }\n if (event.source === leftIframe.contentWindow) {\n this.onInitMessageLeft(event);\n }\n else if (event.source == rightIframe.contentWindow) {\n this.onInitMessageRight(event);\n }\n });\n }\n loadSpread(spread) {\n const pageNb = (spread.left ? 1 : 0) + (spread.right ? 1 : 0);\n this.areaReadySemaphore = pageNb;\n this.selectionReadySemaphore = pageNb;\n this.decorationReadySemaphore = pageNb;\n this.areaBridge.loadSpread(spread);\n }\n onInitMessageLeft(event) {\n const initMessage = event.data;\n const messagePort = event.ports[0];\n switch (initMessage) {\n case \"InitAreaManager\":\n this.areaBridge.setLeftMessagePort(messagePort);\n this.onInitAreaMessage();\n break;\n case \"InitSelection\":\n this.selectionBridge.setLeftMessagePort(messagePort);\n this.onInitSelectionMessage();\n break;\n case \"InitDecorations\":\n this.decorationsBridge.setLeftMessagePort(messagePort);\n this.onInitDecorationMessage();\n break;\n }\n }\n onInitMessageRight(event) {\n const initMessage = event.data;\n const messagePort = event.ports[0];\n switch (initMessage) {\n case \"InitAreaManager\":\n this.areaBridge.setRightMessagePort(messagePort);\n this.onInitAreaMessage();\n break;\n case \"InitSelection\":\n this.selectionBridge.setRightMessagePort(messagePort);\n this.onInitSelectionMessage();\n break;\n case \"InitDecorations\":\n this.decorationsBridge.setRightMessagePort(messagePort);\n this.onInitDecorationMessage();\n break;\n }\n }\n onInitAreaMessage() {\n this.areaReadySemaphore -= 1;\n if (this.areaReadySemaphore == 0) {\n this.listener.onAreaApiAvailable();\n }\n }\n onInitSelectionMessage() {\n this.selectionReadySemaphore -= 1;\n if (this.selectionReadySemaphore == 0) {\n this.listener.onSelectionApiAvailable();\n }\n }\n onInitDecorationMessage() {\n this.decorationReadySemaphore -= 1;\n if (this.decorationReadySemaphore == 0) {\n this.listener.onDecorationApiAvailable();\n }\n }\n}\nexport class FixedInitializerIframeSide {\n constructor(window) {\n this.window = window;\n }\n initAreaManager() {\n const messagePort = this.initChannel(\"InitAreaManager\");\n return new IframeMessageSender(messagePort);\n }\n initSelection(selectionManager) {\n const messagePort = this.initChannel(\"InitSelection\");\n new SelectionWrapperIframeSide(messagePort, selectionManager);\n }\n initDecorations(decorationManager) {\n const messagePort = this.initChannel(\"InitDecorations\");\n new DecorationWrapperIframeSide(messagePort, decorationManager);\n }\n initChannel(initMessage) {\n const messageChannel = new MessageChannel();\n this.window.parent.postMessage(initMessage, \"*\", [messageChannel.port2]);\n return messageChannel.port1;\n }\n}\n","export class ViewportStringBuilder {\n setInitialScale(scale) {\n this.initialScale = scale;\n return this;\n }\n setMinimumScale(scale) {\n this.minimumScale = scale;\n return this;\n }\n setWidth(width) {\n this.width = width;\n return this;\n }\n setHeight(height) {\n this.height = height;\n return this;\n }\n build() {\n const components = [];\n if (this.initialScale) {\n components.push(\"initial-scale=\" + this.initialScale);\n }\n if (this.minimumScale) {\n components.push(\"minimum-scale=\" + this.minimumScale);\n }\n if (this.width) {\n components.push(\"width=\" + this.width);\n }\n if (this.height) {\n components.push(\"height=\" + this.height);\n }\n return components.join(\", \");\n }\n}\nexport function parseViewportString(viewportString) {\n const regex = /(\\w+) *= *([^\\s,]+)/g;\n const properties = new Map();\n let match;\n while ((match = regex.exec(viewportString))) {\n if (match != null) {\n properties.set(match[1], match[2]);\n }\n }\n const width = parseFloat(properties.get(\"width\"));\n const height = parseFloat(properties.get(\"height\"));\n if (width && height) {\n return { width, height };\n }\n else {\n return undefined;\n }\n}\n","export class GesturesDetector {\n constructor(window, listener, decorationManager) {\n this.window = window;\n this.listener = listener;\n this.decorationManager = decorationManager;\n document.addEventListener(\"click\", (event) => {\n this.onClick(event);\n }, false);\n }\n onClick(event) {\n if (event.defaultPrevented) {\n return;\n }\n const selection = this.window.getSelection();\n if (selection && selection.type == \"Range\") {\n // There's an on-going selection, the tap will dismiss it so we don't forward it.\n // selection.type might be None (collapsed) or Caret with a collapsed range\n // when there is not true selection.\n return;\n }\n let nearestElement;\n if (event.target instanceof HTMLElement) {\n nearestElement = this.nearestInteractiveElement(event.target);\n }\n else {\n nearestElement = null;\n }\n if (nearestElement) {\n if (nearestElement instanceof HTMLAnchorElement) {\n this.listener.onLinkActivated(nearestElement.href, nearestElement.outerHTML);\n event.stopPropagation();\n event.preventDefault();\n }\n else {\n return;\n }\n }\n let decorationActivatedEvent;\n if (this.decorationManager) {\n decorationActivatedEvent =\n this.decorationManager.handleDecorationClickEvent(event);\n }\n else {\n decorationActivatedEvent = null;\n }\n if (decorationActivatedEvent) {\n this.listener.onDecorationActivated(decorationActivatedEvent);\n }\n else {\n this.listener.onTap(event);\n }\n // event.stopPropagation()\n // event.preventDefault()\n }\n // See. https://github.com/JayPanoz/architecture/tree/touch-handling/misc/touch-handling\n nearestInteractiveElement(element) {\n if (element == null) {\n return null;\n }\n const interactiveTags = [\n \"a\",\n \"audio\",\n \"button\",\n \"canvas\",\n \"details\",\n \"input\",\n \"label\",\n \"option\",\n \"select\",\n \"submit\",\n \"textarea\",\n \"video\",\n ];\n if (interactiveTags.indexOf(element.nodeName.toLowerCase()) != -1) {\n return element;\n }\n // Checks whether the element is editable by the user.\n if (element.hasAttribute(\"contenteditable\") &&\n element.getAttribute(\"contenteditable\").toLowerCase() != \"false\") {\n return element;\n }\n // Checks parents recursively because the touch might be for example on an inside a .\n if (element.parentElement) {\n return this.nearestInteractiveElement(element.parentElement);\n }\n return null;\n }\n}\n"],"names":["reverse","s","split","join","oneIfNotZero","n","advanceBlock","ctx","peq","b","hIn","pV","P","mV","M","hInIsNegative","eq","xV","xH","pH","mH","hOut","lastRowMask","findMatchEnds","text","pattern","maxErrors","length","Math","min","matches","w","bMax","ceil","Uint32Array","fill","emptyPeq","Map","asciiPeq","i","push","c","val","charCodeAt","has","charPeq","set","r","idx","y","max","score","j","charCode","get","carry","maxBlockScore","splice","start","end","errors","exports","patRev","map","m","minStart","slice","reduce","rm","findMatchStarts","GetIntrinsic","callBind","$indexOf","module","name","allowMissing","intrinsic","bind","$apply","$call","$reflectApply","call","$gOPD","$defineProperty","$max","value","e","originalFunction","func","arguments","configurable","applyBind","apply","hasPropertyDescriptors","$SyntaxError","$TypeError","gopd","obj","property","nonEnumerable","nonWritable","nonConfigurable","loose","desc","enumerable","writable","keys","hasSymbols","Symbol","toStr","Object","prototype","toString","concat","Array","defineDataProperty","supportsDescriptors","defineProperty","object","predicate","fn","defineProperties","predicates","props","getOwnPropertySymbols","hasToStringTag","toStringTag","overrideIfSet","force","iterator","isPrimitive","isCallable","isDate","isSymbol","input","exoticToPrim","hint","String","Number","toPrimitive","O","TypeError","GetMethod","valueOf","result","method","methodNames","ordinaryToPrimitive","that","target","this","bound","args","boundLength","boundArgs","Function","Empty","implementation","functionsHaveNames","gOPD","getOwnPropertyDescriptor","functionsHaveConfigurableNames","$bind","boundFunctionsHaveNames","undefined","SyntaxError","$Function","getEvalledConstructor","expressionSyntax","throwTypeError","ThrowTypeError","calleeThrows","gOPDthrows","hasProto","getProto","getPrototypeOf","x","__proto__","needsEval","TypedArray","Uint8Array","INTRINSICS","AggregateError","ArrayBuffer","Atomics","BigInt","BigInt64Array","BigUint64Array","Boolean","DataView","Date","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","Error","eval","EvalError","Float32Array","Float64Array","FinalizationRegistry","Int8Array","Int16Array","Int32Array","isFinite","isNaN","JSON","parseFloat","parseInt","Promise","Proxy","RangeError","ReferenceError","Reflect","RegExp","Set","SharedArrayBuffer","Uint8ClampedArray","Uint16Array","URIError","WeakMap","WeakRef","WeakSet","error","errorProto","doEval","gen","LEGACY_ALIASES","hasOwn","$concat","$spliceApply","$replace","replace","$strSlice","$exec","exec","rePropName","reEscapeChar","getBaseIntrinsic","alias","intrinsicName","parts","string","first","last","match","number","quote","subString","stringToPath","intrinsicBaseName","intrinsicRealName","skipFurtherCaching","isOwn","part","hasArrayLengthDefineBug","test","foo","$Object","origSymbol","hasSymbolSham","sym","symObj","getOwnPropertyNames","syms","propertyIsEnumerable","descriptor","hasOwnProperty","channel","SLOT","assert","slot","slots","V","freeze","badArrayLike","isCallableMarker","fnToStr","reflectApply","_","constructorRegex","isES6ClassFn","fnStr","tryFunctionObject","isIE68","isDDA","document","all","str","strClass","getDay","tryDateObject","isRegexMarker","badStringifier","callBound","throwRegexMarker","$toString","symToStr","symStringRegex","isSymbolObject","hasMap","mapSizeDescriptor","mapSize","mapForEach","forEach","hasSet","setSizeDescriptor","setSize","setForEach","weakMapHas","weakSetHas","weakRefDeref","deref","booleanValueOf","objectToString","functionToString","$match","$slice","$toUpperCase","toUpperCase","$toLowerCase","toLowerCase","$test","$join","$arrSlice","$floor","floor","bigIntValueOf","gOPS","symToString","hasShammedSymbols","isEnumerable","gPO","addNumericSeparator","num","Infinity","sepRegex","int","intStr","dec","utilInspect","inspectCustom","custom","inspectSymbol","wrapQuotes","defaultStyle","opts","quoteChar","quoteStyle","isArray","isRegExp","inspect_","options","depth","seen","maxStringLength","customInspect","indent","numericSeparator","inspectString","bigIntStr","maxDepth","baseIndent","base","prev","getIndent","indexOf","inspect","from","noIndent","newOpts","f","nameOf","arrObjKeys","symString","markBoxed","HTMLElement","nodeName","getAttribute","attrs","attributes","childNodes","xs","singleLineValues","indentedJoin","isError","cause","isMap","mapParts","key","collectionOf","isSet","setParts","isWeakMap","weakCollectionOf","isWeakSet","isWeakRef","isNumber","isBigInt","isBoolean","isString","ys","isPlainObject","constructor","protoTag","stringTag","tag","l","remaining","trailer","lowbyte","type","size","entries","lineJoiner","isArr","symMap","k","keysShim","isArgs","hasDontEnumBug","hasProtoEnumBug","dontEnums","equalsConstructorPrototype","o","ctor","excludedKeys","$applicationCache","$console","$external","$frame","$frameElement","$frames","$innerHeight","$innerWidth","$onmozfullscreenchange","$onmozfullscreenerror","$outerHeight","$outerWidth","$pageXOffset","$pageYOffset","$parent","$scrollLeft","$scrollTop","$scrollX","$scrollY","$self","$webkitIndexedDB","$webkitStorageInfo","$window","hasAutomationEqualityBug","window","isObject","isFunction","isArguments","theKeys","skipProto","skipConstructor","equalsConstructorPrototypeIfNotBuggy","origKeys","originalKeys","shim","keysWorksWithArguments","callee","setFunctionName","hasIndices","global","ignoreCase","multiline","dotAll","unicode","unicodeSets","sticky","define","getPolyfill","flagsBound","flags","calls","TypeErr","regex","polyfill","proto","isRegex","hasDescriptors","$WeakMap","$Map","$weakMapGet","$weakMapSet","$weakMapHas","$mapGet","$mapSet","$mapHas","listGetNode","list","curr","next","$wm","$m","$o","objects","node","listGet","listHas","listSet","Call","Get","IsRegExp","ToString","RequireObjectCoercible","flagsGetter","regexpMatchAllPolyfill","getMatcher","regexp","matcherPolyfill","matchAll","matcher","S","rx","boundMatchAll","regexpMatchAll","CreateRegExpStringIterator","SpeciesConstructor","ToLength","Type","OrigRegExp","supportsConstructingWithFlags","regexMatchAll","R","tmp","C","source","constructRegexWithFlags","lastIndex","fullUnicode","defineP","symbol","mvsIsWS","leftWhitespace","rightWhitespace","boundMethod","receiver","trim","CodePointAt","isInteger","MAX_SAFE_INTEGER","index","IsArray","F","argumentsList","isLeadingSurrogate","isTrailingSurrogate","UTF16SurrogatePairToCodePoint","$charAt","$charCodeAt","position","cp","firstIsLeading","firstIsTrailing","second","done","DefineOwnProperty","FromPropertyDescriptor","IsDataDescriptor","IsPropertyKey","SameValue","IteratorPrototype","AdvanceStringIndex","CreateIterResultObject","CreateMethodProperty","OrdinaryObjectCreate","RegExpExec","setToStringTag","RegExpStringIterator","thisIndex","nextIndex","isPropertyDescriptor","IsAccessorDescriptor","ToPropertyDescriptor","Desc","assertRecord","fromPropertyDescriptor","GetV","IsCallable","$construct","DefinePropertyOrThrow","isConstructorMarker","argument","err","hasRegExpMatcher","ToBoolean","$ObjectCreate","additionalInternalSlotsList","T","regexExec","$isNaN","noThrowOnStrictViolation","Throw","$species","IsConstructor","defaultConstructor","$Number","$RegExp","$parseInteger","regexTester","isBinary","isOctal","isInvalidHexLiteral","hasNonWS","$trim","StringToNumber","NaN","trimmed","ToNumber","truncate","$isFinite","ToIntegerOrInfinity","len","ToPrimitive","Obj","getter","setter","$String","ES5Type","$fromCharCode","lead","trail","optMessage","$isEnumerable","$Array","allowed","isData","IsAccessor","then","recordType","argumentName","array","callback","$abs","absValue","record","a","ES","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","__esModule","d","definition","prop","debug","log","console","dezoomRect","rect","zoomLevel","bottom","height","left","right","top","width","domRectToRect","getClientRectsNoOverlap","range","doNotMergeHorizontallyAlignedRects","clientRects","getClientRects","originalRects","rangeClientRect","newRects","replaceOverlapingRects","rects","tolerance","rectsToKeep","possiblyContainingRect","rectContains","delete","removeContainedRects","mergeTouchingRects","rect1","rect2","rectsLineUpVertically","almostEqual","rectsLineUpHorizontally","rectsTouchOrOverlap","filter","replacementClientRect","getBoundingRect","rectContainsPoint","toRemove","toAdd","subtractRects1","rectSubtract","subtractRects2","rectIntersected","maxLeft","minRight","maxTop","minBottom","rectIntersect","rectA","rectB","rectC","rectD","abs","TrimDirection","ResolveDirection","search","matchPos","exactMatches","textMatchScore","closestNonSpaceInString","baseOffset","direction","nextChar","Forwards","charAt","availableChars","availableNonWhitespaceChars","Backwards","substring","trimEnd","trimStart","offsetDelta","closestNonSpaceInRange","nodeIter","commonAncestorContainer","ownerDocument","createNodeIterator","NodeFilter","SHOW_TEXT","initialBoundaryNode","startContainer","endContainer","terminalBoundaryNode","currentNode","nextNode","previousNode","trimmedOffset","advance","nodeText","textContent","offset","nodeTextLength","_a","_b","nodeType","Node","ELEMENT_NODE","TEXT_NODE","previousSiblingsTextLength","sibling","previousSibling","resolveOffsets","element","offsets","nextOffset","shift","results","textNode","data","relativeTo","parent","contains","el","parentElement","resolve","tw","createTreeWalker","getRootNode","forwards","FORWARDS","fromCharOffset","fromPoint","textOffset","toRange","BACKWARDS","Range","setStart","setEnd","fromRange","startOffset","endOffset","fromOffsets","root","trimmedRange","cloneRange","startTrimmed","endTrimmed","trimmedOffsets","trimRange","TextPositionAnchor","textRange","fromSelector","selector","toSelector","TextQuoteAnchor","exact","context","prefix","suffix","toPositionAnchor","scoreMatch","quoteScore","prefixScore","suffixScore","posScore","quoteWeight","scoredMatches","sort","matchQuote","assign","DecorationGroup","id","styles","items","lastItemId","container","groupId","groupName","add","decoration","cssSelector","textQuote","querySelector","body","quotedText","textBefore","textAfter","createRange","setStartBefore","setEndAfter","rangeFromDecorationTarget","item","clickableElements","layout","remove","findIndex","it","relayout","clearContainer","requireContainer","createElement","dataset","group","style","pointerEvents","append","groupContainer","unsafeStyle","itemContainer","documentWritingMode","getComputedStyle","writingMode","isVertical","zoom","currentCSSZoom","scrollingElement","xOffset","scrollLeft","yOffset","scrollTop","viewportWidth","innerHeight","innerWidth","viewportHeight","columnCount","documentElement","getPropertyValue","pageSize","positionElement","boundingRect","isVerticalRL","clientWidth","getBoundingClientRect","DOMRect","elementTemplate","template","innerHTML","content","firstElementChild","message","startsWith","startElement","decoratorWritingMode","r1","r2","clientRect","line","cloneNode","bounds","querySelectorAll","children","DecorationWrapperIframeSide","messagePort","decorationManager","onmessage","onCommand","command","kind","registerTemplates","templates","addDecoration","removeDecoration","IframeMessageSender","send","postMessage","SelectionWrapperIframeSide","manager","selectionManager","onRequestSelection","requestId","onClearSelection","feedback","selection","getCurrentSelection","sendFeedback","clearSelection","initializer","initAreaManager","initChannel","initSelection","initDecorations","initMessage","messageChannel","MessageChannel","port2","port1","messageSender","isSelecting","getSelection","removeAllRanges","getCurrentSelectionText","getSelectionRect","selectedText","highlight","before","after","selectionRect","getRangeAt","isCollapsed","anchorNode","focusNode","rangeCount","startNode","endNode","collapsed","rangeReverse","createOrderedRange","anchorOffset","focusOffset","firstWordStart","lastWordEnd","pop","groups","lastGroupId","addEventListener","lastSize","ResizeObserver","requestAnimationFrame","clientHeight","relayoutDecorations","observe","stylesheet","styleElement","getElementsByTagName","appendChild","getGroup","values","handleDecorationClickEvent","event","groupContent","clientX","clientY","findTarget","viewportSize","viewport","HTMLMetaElement","viewportString","properties","parseViewportString","parseContentSize","messagingListener","onTap","gestureEvent","onLinkActivated","href","outerHtml","onDecorationActivated","listener","onClick","defaultPrevented","nearestElement","decorationActivatedEvent","nearestInteractiveElement","HTMLAnchorElement","outerHTML","stopPropagation","preventDefault","hasAttribute"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"fixed-injectable-script.js","mappings":"mDAmCA,SAASA,EAAQC,GACb,OAAOA,EACFC,MAAM,IACNF,UACAG,KAAK,GACd,CAwCA,SAASC,EAAaC,GAClB,OAASA,GAAKA,IAAM,GAAM,CAC9B,CAaA,SAASC,EAAaC,EAAKC,EAAKC,EAAGC,GAC/B,IAAIC,EAAKJ,EAAIK,EAAEH,GACXI,EAAKN,EAAIO,EAAEL,GACXM,EAAgBL,IAAQ,GACxBM,EAAKR,EAAIC,GAAKM,EAEdE,EAAKD,EAAKH,EACVK,GAAQF,EAAKL,GAA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,EAAMxzB,kBAAkBmO,YACPlO,KAAK+0B,0BAA0BxB,EAAMxzB,QAGrC,KAEjB80B,EACIA,aAA0BG,oBAC1Bh1B,KAAK00B,SAASJ,gBAAgBO,EAAeN,KAAMM,EAAeI,WAClE1B,EAAM2B,kBACN3B,EAAM4B,mBAMVL,EADA90B,KAAK4uB,kBAED5uB,KAAK4uB,kBAAkB0E,2BAA2BC,GAG3B,KAE3BuB,EACA90B,KAAK00B,SAASD,sBAAsBK,GAGpC90B,KAAK00B,SAASN,MAAMb,GAI5B,CAEA,yBAAAwB,CAA0BjP,GACtB,OAAe,MAAXA,EACO,MAgBqD,GAdxC,CACpB,IACA,QACA,SACA,SACA,UACA,QACA,QACA,SACA,SACA,SACA,WACA,SAEgBtY,QAAQsY,EAAQ3X,SAASxD,gBAIzCmb,EAAQsP,aAAa,oBACoC,SAAzDtP,EAAQ1X,aAAa,mBAAmBzD,cAJjCmb,EAQPA,EAAQW,cACDzmB,KAAK+0B,0BAA0BjP,EAAQW,eAE3C,IACX,GHxBiB5T,OAAQshB,EAAmBvF,E","sources":["webpack://readium-js/./node_modules/.pnpm/approx-string-match@1.1.0/node_modules/approx-string-match/dist/index.js","webpack://readium-js/./node_modules/.pnpm/call-bind@1.0.2/node_modules/call-bind/callBound.js","webpack://readium-js/./node_modules/.pnpm/call-bind@1.0.2/node_modules/call-bind/index.js","webpack://readium-js/./node_modules/.pnpm/define-data-property@1.1.0/node_modules/define-data-property/index.js","webpack://readium-js/./node_modules/.pnpm/define-properties@1.2.1/node_modules/define-properties/index.js","webpack://readium-js/./node_modules/.pnpm/es-set-tostringtag@2.0.1/node_modules/es-set-tostringtag/index.js","webpack://readium-js/./node_modules/.pnpm/es-to-primitive@1.2.1/node_modules/es-to-primitive/es2015.js","webpack://readium-js/./node_modules/.pnpm/es-to-primitive@1.2.1/node_modules/es-to-primitive/helpers/isPrimitive.js","webpack://readium-js/./node_modules/.pnpm/function-bind@1.1.1/node_modules/function-bind/implementation.js","webpack://readium-js/./node_modules/.pnpm/function-bind@1.1.1/node_modules/function-bind/index.js","webpack://readium-js/./node_modules/.pnpm/functions-have-names@1.2.3/node_modules/functions-have-names/index.js","webpack://readium-js/./node_modules/.pnpm/get-intrinsic@1.2.1/node_modules/get-intrinsic/index.js","webpack://readium-js/./node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.js","webpack://readium-js/./node_modules/.pnpm/has-property-descriptors@1.0.0/node_modules/has-property-descriptors/index.js","webpack://readium-js/./node_modules/.pnpm/has-proto@1.0.1/node_modules/has-proto/index.js","webpack://readium-js/./node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/index.js","webpack://readium-js/./node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/shams.js","webpack://readium-js/./node_modules/.pnpm/has-tostringtag@1.0.0/node_modules/has-tostringtag/shams.js","webpack://readium-js/./node_modules/.pnpm/has@1.0.4/node_modules/has/src/index.js","webpack://readium-js/./node_modules/.pnpm/internal-slot@1.0.5/node_modules/internal-slot/index.js","webpack://readium-js/./node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/index.js","webpack://readium-js/./node_modules/.pnpm/is-date-object@1.0.5/node_modules/is-date-object/index.js","webpack://readium-js/./node_modules/.pnpm/is-regex@1.1.4/node_modules/is-regex/index.js","webpack://readium-js/./node_modules/.pnpm/is-symbol@1.0.4/node_modules/is-symbol/index.js","webpack://readium-js/./node_modules/.pnpm/object-inspect@1.12.3/node_modules/object-inspect/index.js","webpack://readium-js/./node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/implementation.js","webpack://readium-js/./node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/index.js","webpack://readium-js/./node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/isArguments.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/implementation.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/index.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/polyfill.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/shim.js","webpack://readium-js/./node_modules/.pnpm/safe-regex-test@1.0.0/node_modules/safe-regex-test/index.js","webpack://readium-js/./node_modules/.pnpm/set-function-name@2.0.1/node_modules/set-function-name/index.js","webpack://readium-js/./node_modules/.pnpm/side-channel@1.0.4/node_modules/side-channel/index.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/implementation.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/index.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/polyfill-regexp-matchall.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/polyfill.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/regexp-matchall.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/shim.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/implementation.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/index.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/polyfill.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/shim.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/AdvanceStringIndex.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Call.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CodePointAt.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CreateIterResultObject.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CreateMethodProperty.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CreateRegExpStringIterator.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/DefinePropertyOrThrow.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/FromPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Get.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/GetMethod.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/GetV.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsAccessorDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsArray.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsCallable.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsConstructor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsDataDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsPropertyKey.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsRegExp.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/OrdinaryObjectCreate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/RegExpExec.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/RequireObjectCoercible.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/SameValue.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Set.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/SpeciesConstructor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/StringToNumber.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToBoolean.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToIntegerOrInfinity.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToLength.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToNumber.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToPrimitive.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToString.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Type.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/UTF16SurrogatePairToCodePoint.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/floor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/truncate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/5/CheckObjectCoercible.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/5/Type.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/GetIntrinsic.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/DefineOwnProperty.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/IsArray.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/assertRecord.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/forEach.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/fromPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isFinite.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isInteger.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isLeadingSurrogate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isMatchRecord.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isNaN.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isPrimitive.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isTrailingSurrogate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/maxSafeInteger.js","webpack://readium-js/webpack/bootstrap","webpack://readium-js/webpack/runtime/compat get default export","webpack://readium-js/webpack/runtime/define property getters","webpack://readium-js/webpack/runtime/hasOwnProperty shorthand","webpack://readium-js/./src/util/log.ts","webpack://readium-js/./src/util/rect.ts","webpack://readium-js/./src/vendor/hypothesis/annotator/anchoring/trim-range.ts","webpack://readium-js/./src/vendor/hypothesis/annotator/anchoring/text-range.ts","webpack://readium-js/./src/vendor/hypothesis/annotator/anchoring/match-quote.ts","webpack://readium-js/./src/vendor/hypothesis/annotator/anchoring/types.ts","webpack://readium-js/./src/common/decoration.ts","webpack://readium-js/./src/common/selection.ts","webpack://readium-js/./src/fixed/decoration-wrapper.ts","webpack://readium-js/./src/fixed/iframe-message.ts","webpack://readium-js/./src/fixed/selection-wrapper.ts","webpack://readium-js/./src/index-fixed-injectable.ts","webpack://readium-js/./src/bridge/all-initialization-bridge.ts","webpack://readium-js/./src/util/viewport.ts","webpack://readium-js/./src/common/gestures.ts"],"sourcesContent":["\"use strict\";\n/**\n * Implementation of Myers' online approximate string matching algorithm [1],\n * with additional optimizations suggested by [2].\n *\n * This has O((k/w) * n) complexity where `n` is the length of the text, `k` is\n * the maximum number of errors allowed (always <= the pattern length) and `w`\n * is the word size. Because JS only supports bitwise operations on 32 bit\n * integers, `w` is 32.\n *\n * As far as I am aware, there aren't any online algorithms which are\n * significantly better for a wide range of input parameters. The problem can be\n * solved faster using \"filter then verify\" approaches which first filter out\n * regions of the text that cannot match using a \"cheap\" check and then verify\n * the remaining potential matches. The verify step requires an algorithm such\n * as this one however.\n *\n * The algorithm's approach is essentially to optimize the classic dynamic\n * programming solution to the problem by computing columns of the matrix in\n * word-sized chunks (ie. dealing with 32 chars of the pattern at a time) and\n * avoiding calculating regions of the matrix where the minimum error count is\n * guaranteed to exceed the input threshold.\n *\n * The paper consists of two parts, the first describes the core algorithm for\n * matching patterns <= the size of a word (implemented by `advanceBlock` here).\n * The second uses the core algorithm as part of a larger block-based algorithm\n * to handle longer patterns.\n *\n * [1] G. Myers, “A Fast Bit-Vector Algorithm for Approximate String Matching\n * Based on Dynamic Programming,” vol. 46, no. 3, pp. 395–415, 1999.\n *\n * [2] Šošić, M. (2014). An simd dynamic programming c/c++ library (Doctoral\n * dissertation, Fakultet Elektrotehnike i računarstva, Sveučilište u Zagrebu).\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction reverse(s) {\n return s\n .split(\"\")\n .reverse()\n .join(\"\");\n}\n/**\n * Given the ends of approximate matches for `pattern` in `text`, find\n * the start of the matches.\n *\n * @param findEndFn - Function for finding the end of matches in\n * text.\n * @return Matches with the `start` property set.\n */\nfunction findMatchStarts(text, pattern, matches) {\n var patRev = reverse(pattern);\n return matches.map(function (m) {\n // Find start of each match by reversing the pattern and matching segment\n // of text and searching for an approx match with the same number of\n // errors.\n var minStart = Math.max(0, m.end - pattern.length - m.errors);\n var textRev = reverse(text.slice(minStart, m.end));\n // If there are multiple possible start points, choose the one that\n // maximizes the length of the match.\n var start = findMatchEnds(textRev, patRev, m.errors).reduce(function (min, rm) {\n if (m.end - rm.end < min) {\n return m.end - rm.end;\n }\n return min;\n }, m.end);\n return {\n start: start,\n end: m.end,\n errors: m.errors\n };\n });\n}\n/**\n * Return 1 if a number is non-zero or zero otherwise, without using\n * conditional operators.\n *\n * This should get inlined into `advanceBlock` below by the JIT.\n *\n * Adapted from https://stackoverflow.com/a/3912218/434243\n */\nfunction oneIfNotZero(n) {\n return ((n | -n) >> 31) & 1;\n}\n/**\n * Block calculation step of the algorithm.\n *\n * From Fig 8. on p. 408 of [1], additionally optimized to replace conditional\n * checks with bitwise operations as per Section 4.2.3 of [2].\n *\n * @param ctx - The pattern context object\n * @param peq - The `peq` array for the current character (`ctx.peq.get(ch)`)\n * @param b - The block level\n * @param hIn - Horizontal input delta ∈ {1,0,-1}\n * @return Horizontal output delta ∈ {1,0,-1}\n */\nfunction advanceBlock(ctx, peq, b, hIn) {\n var pV = ctx.P[b];\n var mV = ctx.M[b];\n var hInIsNegative = hIn >>> 31; // 1 if hIn < 0 or 0 otherwise.\n var eq = peq[b] | hInIsNegative;\n // Step 1: Compute horizontal deltas.\n var xV = eq | mV;\n var xH = (((eq & pV) + pV) ^ pV) | eq;\n var pH = mV | ~(xH | pV);\n var mH = pV & xH;\n // Step 2: Update score (value of last row of this block).\n var hOut = oneIfNotZero(pH & ctx.lastRowMask[b]) -\n oneIfNotZero(mH & ctx.lastRowMask[b]);\n // Step 3: Update vertical deltas for use when processing next char.\n pH <<= 1;\n mH <<= 1;\n mH |= hInIsNegative;\n pH |= oneIfNotZero(hIn) - hInIsNegative; // set pH[0] if hIn > 0\n pV = mH | ~(xV | pH);\n mV = pH & xV;\n ctx.P[b] = pV;\n ctx.M[b] = mV;\n return hOut;\n}\n/**\n * Find the ends and error counts for matches of `pattern` in `text`.\n *\n * Only the matches with the lowest error count are reported. Other matches\n * with error counts <= maxErrors are discarded.\n *\n * This is the block-based search algorithm from Fig. 9 on p.410 of [1].\n */\nfunction findMatchEnds(text, pattern, maxErrors) {\n if (pattern.length === 0) {\n return [];\n }\n // Clamp error count so we can rely on the `maxErrors` and `pattern.length`\n // rows being in the same block below.\n maxErrors = Math.min(maxErrors, pattern.length);\n var matches = [];\n // Word size.\n var w = 32;\n // Index of maximum block level.\n var bMax = Math.ceil(pattern.length / w) - 1;\n // Context used across block calculations.\n var ctx = {\n P: new Uint32Array(bMax + 1),\n M: new Uint32Array(bMax + 1),\n lastRowMask: new Uint32Array(bMax + 1)\n };\n ctx.lastRowMask.fill(1 << 31);\n ctx.lastRowMask[bMax] = 1 << (pattern.length - 1) % w;\n // Dummy \"peq\" array for chars in the text which do not occur in the pattern.\n var emptyPeq = new Uint32Array(bMax + 1);\n // Map of UTF-16 character code to bit vector indicating positions in the\n // pattern that equal that character.\n var peq = new Map();\n // Version of `peq` that only stores mappings for small characters. This\n // allows faster lookups when iterating through the text because a simple\n // array lookup can be done instead of a hash table lookup.\n var asciiPeq = [];\n for (var i = 0; i < 256; i++) {\n asciiPeq.push(emptyPeq);\n }\n // Calculate `ctx.peq` - a map of character values to bitmasks indicating\n // positions of that character within the pattern, where each bit represents\n // a position in the pattern.\n for (var c = 0; c < pattern.length; c += 1) {\n var val = pattern.charCodeAt(c);\n if (peq.has(val)) {\n // Duplicate char in pattern.\n continue;\n }\n var charPeq = new Uint32Array(bMax + 1);\n peq.set(val, charPeq);\n if (val < asciiPeq.length) {\n asciiPeq[val] = charPeq;\n }\n for (var b = 0; b <= bMax; b += 1) {\n charPeq[b] = 0;\n // Set all the bits where the pattern matches the current char (ch).\n // For indexes beyond the end of the pattern, always set the bit as if the\n // pattern contained a wildcard char in that position.\n for (var r = 0; r < w; r += 1) {\n var idx = b * w + r;\n if (idx >= pattern.length) {\n continue;\n }\n var match = pattern.charCodeAt(idx) === val;\n if (match) {\n charPeq[b] |= 1 << r;\n }\n }\n }\n }\n // Index of last-active block level in the column.\n var y = Math.max(0, Math.ceil(maxErrors / w) - 1);\n // Initialize maximum error count at bottom of each block.\n var score = new Uint32Array(bMax + 1);\n for (var b = 0; b <= y; b += 1) {\n score[b] = (b + 1) * w;\n }\n score[bMax] = pattern.length;\n // Initialize vertical deltas for each block.\n for (var b = 0; b <= y; b += 1) {\n ctx.P[b] = ~0;\n ctx.M[b] = 0;\n }\n // Process each char of the text, computing the error count for `w` chars of\n // the pattern at a time.\n for (var j = 0; j < text.length; j += 1) {\n // Lookup the bitmask representing the positions of the current char from\n // the text within the pattern.\n var charCode = text.charCodeAt(j);\n var charPeq = void 0;\n if (charCode < asciiPeq.length) {\n // Fast array lookup.\n charPeq = asciiPeq[charCode];\n }\n else {\n // Slower hash table lookup.\n charPeq = peq.get(charCode);\n if (typeof charPeq === \"undefined\") {\n charPeq = emptyPeq;\n }\n }\n // Calculate error count for blocks that we definitely have to process for\n // this column.\n var carry = 0;\n for (var b = 0; b <= y; b += 1) {\n carry = advanceBlock(ctx, charPeq, b, carry);\n score[b] += carry;\n }\n // Check if we also need to compute an additional block, or if we can reduce\n // the number of blocks processed for the next column.\n if (score[y] - carry <= maxErrors &&\n y < bMax &&\n (charPeq[y + 1] & 1 || carry < 0)) {\n // Error count for bottom block is under threshold, increase the number of\n // blocks processed for this column & next by 1.\n y += 1;\n ctx.P[y] = ~0;\n ctx.M[y] = 0;\n var maxBlockScore = y === bMax ? pattern.length % w : w;\n score[y] =\n score[y - 1] +\n maxBlockScore -\n carry +\n advanceBlock(ctx, charPeq, y, carry);\n }\n else {\n // Error count for bottom block exceeds threshold, reduce the number of\n // blocks processed for the next column.\n while (y > 0 && score[y] >= maxErrors + w) {\n y -= 1;\n }\n }\n // If error count is under threshold, report a match.\n if (y === bMax && score[y] <= maxErrors) {\n if (score[y] < maxErrors) {\n // Discard any earlier, worse matches.\n matches.splice(0, matches.length);\n }\n matches.push({\n start: -1,\n end: j + 1,\n errors: score[y]\n });\n // Because `search` only reports the matches with the lowest error count,\n // we can \"ratchet down\" the max error threshold whenever a match is\n // encountered and thereby save a small amount of work for the remainder\n // of the text.\n maxErrors = score[y];\n }\n }\n return matches;\n}\n/**\n * Search for matches for `pattern` in `text` allowing up to `maxErrors` errors.\n *\n * Returns the start, and end positions and error counts for each lowest-cost\n * match. Only the \"best\" matches are returned.\n */\nfunction search(text, pattern, maxErrors) {\n var matches = findMatchEnds(text, pattern, maxErrors);\n return findMatchStarts(text, pattern, matches);\n}\nexports.default = search;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBind = require('./');\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = null;\n\t}\n}\n\nmodule.exports = function callBind(originalFunction) {\n\tvar func = $reflectApply(bind, $call, arguments);\n\tif ($gOPD && $defineProperty) {\n\t\tvar desc = $gOPD(func, 'length');\n\t\tif (desc.configurable) {\n\t\t\t// original length, plus the receiver, minus any additional arguments (after the receiver)\n\t\t\t$defineProperty(\n\t\t\t\tfunc,\n\t\t\t\t'length',\n\t\t\t\t{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }\n\t\t\t);\n\t\t}\n\t}\n\treturn func;\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","'use strict';\n\nvar hasPropertyDescriptors = require('has-property-descriptors')();\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = hasPropertyDescriptors && GetIntrinsic('%Object.defineProperty%', true);\n\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar gopd = require('gopd');\n\n/** @type {(obj: Record, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */\nmodule.exports = function defineDataProperty(\n\tobj,\n\tproperty,\n\tvalue\n) {\n\tif (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n\t\tthrow new $TypeError('`obj` must be an object or a function`');\n\t}\n\tif (typeof property !== 'string' && typeof property !== 'symbol') {\n\t\tthrow new $TypeError('`property` must be a string or a symbol`');\n\t}\n\tif (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {\n\t\tthrow new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {\n\t\tthrow new $TypeError('`nonWritable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {\n\t\tthrow new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 6 && typeof arguments[6] !== 'boolean') {\n\t\tthrow new $TypeError('`loose`, if provided, must be a boolean');\n\t}\n\n\tvar nonEnumerable = arguments.length > 3 ? arguments[3] : null;\n\tvar nonWritable = arguments.length > 4 ? arguments[4] : null;\n\tvar nonConfigurable = arguments.length > 5 ? arguments[5] : null;\n\tvar loose = arguments.length > 6 ? arguments[6] : false;\n\n\t/* @type {false | TypedPropertyDescriptor} */\n\tvar desc = !!gopd && gopd(obj, property);\n\n\tif ($defineProperty) {\n\t\t$defineProperty(obj, property, {\n\t\t\tconfigurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,\n\t\t\tenumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,\n\t\t\tvalue: value,\n\t\t\twritable: nonWritable === null && desc ? desc.writable : !nonWritable\n\t\t});\n\t} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {\n\t\t// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable\n\t\tobj[property] = value; // eslint-disable-line no-param-reassign\n\t} else {\n\t\tthrow new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');\n\t}\n};\n","'use strict';\n\nvar keys = require('object-keys');\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';\n\nvar toStr = Object.prototype.toString;\nvar concat = Array.prototype.concat;\nvar defineDataProperty = require('define-data-property');\n\nvar isFunction = function (fn) {\n\treturn typeof fn === 'function' && toStr.call(fn) === '[object Function]';\n};\n\nvar supportsDescriptors = require('has-property-descriptors')();\n\nvar defineProperty = function (object, name, value, predicate) {\n\tif (name in object) {\n\t\tif (predicate === true) {\n\t\t\tif (object[name] === value) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (!isFunction(predicate) || !predicate()) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (supportsDescriptors) {\n\t\tdefineDataProperty(object, name, value, true);\n\t} else {\n\t\tdefineDataProperty(object, name, value);\n\t}\n};\n\nvar defineProperties = function (object, map) {\n\tvar predicates = arguments.length > 2 ? arguments[2] : {};\n\tvar props = keys(map);\n\tif (hasSymbols) {\n\t\tprops = concat.call(props, Object.getOwnPropertySymbols(map));\n\t}\n\tfor (var i = 0; i < props.length; i += 1) {\n\t\tdefineProperty(object, props[i], map[props[i]], predicates[props[i]]);\n\t}\n};\n\ndefineProperties.supportsDescriptors = !!supportsDescriptors;\n\nmodule.exports = defineProperties;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar has = require('has');\n\nvar toStringTag = hasToStringTag ? Symbol.toStringTag : null;\n\nmodule.exports = function setToStringTag(object, value) {\n\tvar overrideIfSet = arguments.length > 2 && arguments[2] && arguments[2].force;\n\tif (toStringTag && (overrideIfSet || !has(object, toStringTag))) {\n\t\tif ($defineProperty) {\n\t\t\t$defineProperty(object, toStringTag, {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: false,\n\t\t\t\tvalue: value,\n\t\t\t\twritable: false\n\t\t\t});\n\t\t} else {\n\t\t\tobject[toStringTag] = value; // eslint-disable-line no-param-reassign\n\t\t}\n\t}\n};\n","'use strict';\n\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';\n\nvar isPrimitive = require('./helpers/isPrimitive');\nvar isCallable = require('is-callable');\nvar isDate = require('is-date-object');\nvar isSymbol = require('is-symbol');\n\nvar ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) {\n\tif (typeof O === 'undefined' || O === null) {\n\t\tthrow new TypeError('Cannot call method on ' + O);\n\t}\n\tif (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) {\n\t\tthrow new TypeError('hint must be \"string\" or \"number\"');\n\t}\n\tvar methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString'];\n\tvar method, result, i;\n\tfor (i = 0; i < methodNames.length; ++i) {\n\t\tmethod = O[methodNames[i]];\n\t\tif (isCallable(method)) {\n\t\t\tresult = method.call(O);\n\t\t\tif (isPrimitive(result)) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t}\n\tthrow new TypeError('No default value');\n};\n\nvar GetMethod = function GetMethod(O, P) {\n\tvar func = O[P];\n\tif (func !== null && typeof func !== 'undefined') {\n\t\tif (!isCallable(func)) {\n\t\t\tthrow new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function');\n\t\t}\n\t\treturn func;\n\t}\n\treturn void 0;\n};\n\n// http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive\nmodule.exports = function ToPrimitive(input) {\n\tif (isPrimitive(input)) {\n\t\treturn input;\n\t}\n\tvar hint = 'default';\n\tif (arguments.length > 1) {\n\t\tif (arguments[1] === String) {\n\t\t\thint = 'string';\n\t\t} else if (arguments[1] === Number) {\n\t\t\thint = 'number';\n\t\t}\n\t}\n\n\tvar exoticToPrim;\n\tif (hasSymbols) {\n\t\tif (Symbol.toPrimitive) {\n\t\t\texoticToPrim = GetMethod(input, Symbol.toPrimitive);\n\t\t} else if (isSymbol(input)) {\n\t\t\texoticToPrim = Symbol.prototype.valueOf;\n\t\t}\n\t}\n\tif (typeof exoticToPrim !== 'undefined') {\n\t\tvar result = exoticToPrim.call(input, hint);\n\t\tif (isPrimitive(result)) {\n\t\t\treturn result;\n\t\t}\n\t\tthrow new TypeError('unable to convert exotic object to primitive');\n\t}\n\tif (hint === 'default' && (isDate(input) || isSymbol(input))) {\n\t\thint = 'string';\n\t}\n\treturn ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint);\n};\n","'use strict';\n\nmodule.exports = function isPrimitive(value) {\n\treturn value === null || (typeof value !== 'function' && typeof value !== 'object');\n};\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slice.call(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n args.concat(slice.call(arguments))\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n } else {\n return target.apply(\n that,\n args.concat(slice.call(arguments))\n );\n }\n };\n\n var boundLength = Math.max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs.push('$' + i);\n }\n\n bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\nvar functionsHaveNames = function functionsHaveNames() {\n\treturn typeof function f() {}.name === 'string';\n};\n\nvar gOPD = Object.getOwnPropertyDescriptor;\nif (gOPD) {\n\ttry {\n\t\tgOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\tgOPD = null;\n\t}\n}\n\nfunctionsHaveNames.functionsHaveConfigurableNames = function functionsHaveConfigurableNames() {\n\tif (!functionsHaveNames() || !gOPD) {\n\t\treturn false;\n\t}\n\tvar desc = gOPD(function () {}, 'name');\n\treturn !!desc && !!desc.configurable;\n};\n\nvar $bind = Function.prototype.bind;\n\nfunctionsHaveNames.boundFunctionsHaveNames = function boundFunctionsHaveNames() {\n\treturn functionsHaveNames() && typeof $bind === 'function' && function f() {}.bind().name !== '';\n};\n\nmodule.exports = functionsHaveNames;\n","'use strict';\n\nvar undefined;\n\nvar $SyntaxError = SyntaxError;\nvar $Function = Function;\nvar $TypeError = TypeError;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\nif ($gOPD) {\n\ttry {\n\t\t$gOPD({}, '');\n\t} catch (e) {\n\t\t$gOPD = null; // this is IE 8, which has a broken gOPD\n\t}\n}\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\nvar hasProto = require('has-proto')();\n\nvar getProto = Object.getPrototypeOf || (\n\thasProto\n\t\t? function (x) { return x.__proto__; } // eslint-disable-line no-proto\n\t\t: null\n);\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,\n\t'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': EvalError,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': Object,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': RangeError,\n\t'%ReferenceError%': ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nif (getProto) {\n\ttry {\n\t\tnull.error; // eslint-disable-line no-unused-expressions\n\t} catch (e) {\n\t\t// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n\t\tvar errorProto = getProto(getProto(e));\n\t\tINTRINSICS['%Error.prototype%'] = errorProto;\n\t}\n}\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen && getProto) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('has');\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\nvar $exec = bind.call(Function.call, RegExp.prototype.exec);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tif ($exec(/^%?[^%]*%?$/, name) === null) {\n\t\tthrow new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');\n\t}\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\n\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasPropertyDescriptors = function hasPropertyDescriptors() {\n\tif ($defineProperty) {\n\t\ttry {\n\t\t\t$defineProperty({}, 'a', { value: 1 });\n\t\t\treturn true;\n\t\t} catch (e) {\n\t\t\t// IE 8 has a broken defineProperty\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn false;\n};\n\nhasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {\n\t// node v0.6 has a bug where array lengths can be Set but not Defined\n\tif (!hasPropertyDescriptors()) {\n\t\treturn null;\n\t}\n\ttry {\n\t\treturn $defineProperty([], 'length', { value: 1 }).length !== 1;\n\t} catch (e) {\n\t\t// In Firefox 4-22, defining length on an array throws an exception.\n\t\treturn true;\n\t}\n};\n\nmodule.exports = hasPropertyDescriptors;\n","'use strict';\n\nvar test = {\n\tfoo: {}\n};\n\nvar $Object = Object;\n\nmodule.exports = function hasProto() {\n\treturn { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar hasSymbols = require('has-symbols/shams');\n\nmodule.exports = function hasToStringTagShams() {\n\treturn hasSymbols() && !!Symbol.toStringTag;\n};\n","'use strict';\n\nvar hasOwnProperty = {}.hasOwnProperty;\nvar call = Function.prototype.call;\n\nmodule.exports = call.bind ? call.bind(hasOwnProperty) : function (O, P) {\n return call.call(hasOwnProperty, O, P);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar has = require('has');\nvar channel = require('side-channel')();\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar SLOT = {\n\tassert: function (O, slot) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tchannel.assert(O);\n\t\tif (!SLOT.has(O, slot)) {\n\t\t\tthrow new $TypeError('`' + slot + '` is not present on `O`');\n\t\t}\n\t},\n\tget: function (O, slot) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tvar slots = channel.get(O);\n\t\treturn slots && slots['$' + slot];\n\t},\n\thas: function (O, slot) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tvar slots = channel.get(O);\n\t\treturn !!slots && has(slots, '$' + slot);\n\t},\n\tset: function (O, slot, V) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tvar slots = channel.get(O);\n\t\tif (!slots) {\n\t\t\tslots = {};\n\t\t\tchannel.set(O, slots);\n\t\t}\n\t\tslots['$' + slot] = V;\n\t}\n};\n\nif (Object.freeze) {\n\tObject.freeze(SLOT);\n}\n\nmodule.exports = SLOT;\n","'use strict';\n\nvar fnToStr = Function.prototype.toString;\nvar reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;\nvar badArrayLike;\nvar isCallableMarker;\nif (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {\n\ttry {\n\t\tbadArrayLike = Object.defineProperty({}, 'length', {\n\t\t\tget: function () {\n\t\t\t\tthrow isCallableMarker;\n\t\t\t}\n\t\t});\n\t\tisCallableMarker = {};\n\t\t// eslint-disable-next-line no-throw-literal\n\t\treflectApply(function () { throw 42; }, null, badArrayLike);\n\t} catch (_) {\n\t\tif (_ !== isCallableMarker) {\n\t\t\treflectApply = null;\n\t\t}\n\t}\n} else {\n\treflectApply = null;\n}\n\nvar constructorRegex = /^\\s*class\\b/;\nvar isES6ClassFn = function isES6ClassFunction(value) {\n\ttry {\n\t\tvar fnStr = fnToStr.call(value);\n\t\treturn constructorRegex.test(fnStr);\n\t} catch (e) {\n\t\treturn false; // not a function\n\t}\n};\n\nvar tryFunctionObject = function tryFunctionToStr(value) {\n\ttry {\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tfnToStr.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\nvar toStr = Object.prototype.toString;\nvar objectClass = '[object Object]';\nvar fnClass = '[object Function]';\nvar genClass = '[object GeneratorFunction]';\nvar ddaClass = '[object HTMLAllCollection]'; // IE 11\nvar ddaClass2 = '[object HTML document.all class]';\nvar ddaClass3 = '[object HTMLCollection]'; // IE 9-10\nvar hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag`\n\nvar isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing\n\nvar isDDA = function isDocumentDotAll() { return false; };\nif (typeof document === 'object') {\n\t// Firefox 3 canonicalizes DDA to undefined when it's not accessed directly\n\tvar all = document.all;\n\tif (toStr.call(all) === toStr.call(document.all)) {\n\t\tisDDA = function isDocumentDotAll(value) {\n\t\t\t/* globals document: false */\n\t\t\t// in IE 6-8, typeof document.all is \"object\" and it's truthy\n\t\t\tif ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) {\n\t\t\t\ttry {\n\t\t\t\t\tvar str = toStr.call(value);\n\t\t\t\t\treturn (\n\t\t\t\t\t\tstr === ddaClass\n\t\t\t\t\t\t|| str === ddaClass2\n\t\t\t\t\t\t|| str === ddaClass3 // opera 12.16\n\t\t\t\t\t\t|| str === objectClass // IE 6-8\n\t\t\t\t\t) && value('') == null; // eslint-disable-line eqeqeq\n\t\t\t\t} catch (e) { /**/ }\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\t}\n}\n\nmodule.exports = reflectApply\n\t? function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\ttry {\n\t\t\treflectApply(value, null, badArrayLike);\n\t\t} catch (e) {\n\t\t\tif (e !== isCallableMarker) { return false; }\n\t\t}\n\t\treturn !isES6ClassFn(value) && tryFunctionObject(value);\n\t}\n\t: function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\tif (hasToStringTag) { return tryFunctionObject(value); }\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tvar strClass = toStr.call(value);\n\t\tif (strClass !== fnClass && strClass !== genClass && !(/^\\[object HTML/).test(strClass)) { return false; }\n\t\treturn tryFunctionObject(value);\n\t};\n","'use strict';\n\nvar getDay = Date.prototype.getDay;\nvar tryDateObject = function tryDateGetDayCall(value) {\n\ttry {\n\t\tgetDay.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\n\nvar toStr = Object.prototype.toString;\nvar dateClass = '[object Date]';\nvar hasToStringTag = require('has-tostringtag/shams')();\n\nmodule.exports = function isDateObject(value) {\n\tif (typeof value !== 'object' || value === null) {\n\t\treturn false;\n\t}\n\treturn hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass;\n};\n","'use strict';\n\nvar callBound = require('call-bind/callBound');\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar has;\nvar $exec;\nvar isRegexMarker;\nvar badStringifier;\n\nif (hasToStringTag) {\n\thas = callBound('Object.prototype.hasOwnProperty');\n\t$exec = callBound('RegExp.prototype.exec');\n\tisRegexMarker = {};\n\n\tvar throwRegexMarker = function () {\n\t\tthrow isRegexMarker;\n\t};\n\tbadStringifier = {\n\t\ttoString: throwRegexMarker,\n\t\tvalueOf: throwRegexMarker\n\t};\n\n\tif (typeof Symbol.toPrimitive === 'symbol') {\n\t\tbadStringifier[Symbol.toPrimitive] = throwRegexMarker;\n\t}\n}\n\nvar $toString = callBound('Object.prototype.toString');\nvar gOPD = Object.getOwnPropertyDescriptor;\nvar regexClass = '[object RegExp]';\n\nmodule.exports = hasToStringTag\n\t// eslint-disable-next-line consistent-return\n\t? function isRegex(value) {\n\t\tif (!value || typeof value !== 'object') {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar descriptor = gOPD(value, 'lastIndex');\n\t\tvar hasLastIndexDataProperty = descriptor && has(descriptor, 'value');\n\t\tif (!hasLastIndexDataProperty) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\t$exec(value, badStringifier);\n\t\t} catch (e) {\n\t\t\treturn e === isRegexMarker;\n\t\t}\n\t}\n\t: function isRegex(value) {\n\t\t// In older browsers, typeof regex incorrectly returns 'function'\n\t\tif (!value || (typeof value !== 'object' && typeof value !== 'function')) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $toString(value) === regexClass;\n\t};\n","'use strict';\n\nvar toStr = Object.prototype.toString;\nvar hasSymbols = require('has-symbols')();\n\nif (hasSymbols) {\n\tvar symToStr = Symbol.prototype.toString;\n\tvar symStringRegex = /^Symbol\\(.*\\)$/;\n\tvar isSymbolObject = function isRealSymbolObject(value) {\n\t\tif (typeof value.valueOf() !== 'symbol') {\n\t\t\treturn false;\n\t\t}\n\t\treturn symStringRegex.test(symToStr.call(value));\n\t};\n\n\tmodule.exports = function isSymbol(value) {\n\t\tif (typeof value === 'symbol') {\n\t\t\treturn true;\n\t\t}\n\t\tif (toStr.call(value) !== '[object Symbol]') {\n\t\t\treturn false;\n\t\t}\n\t\ttry {\n\t\t\treturn isSymbolObject(value);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n} else {\n\n\tmodule.exports = function isSymbol(value) {\n\t\t// this environment does not support Symbols.\n\t\treturn false && value;\n\t};\n}\n","var hasMap = typeof Map === 'function' && Map.prototype;\nvar mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;\nvar mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;\nvar mapForEach = hasMap && Map.prototype.forEach;\nvar hasSet = typeof Set === 'function' && Set.prototype;\nvar setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;\nvar setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;\nvar setForEach = hasSet && Set.prototype.forEach;\nvar hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;\nvar weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;\nvar hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;\nvar weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;\nvar hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;\nvar weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;\nvar booleanValueOf = Boolean.prototype.valueOf;\nvar objectToString = Object.prototype.toString;\nvar functionToString = Function.prototype.toString;\nvar $match = String.prototype.match;\nvar $slice = String.prototype.slice;\nvar $replace = String.prototype.replace;\nvar $toUpperCase = String.prototype.toUpperCase;\nvar $toLowerCase = String.prototype.toLowerCase;\nvar $test = RegExp.prototype.test;\nvar $concat = Array.prototype.concat;\nvar $join = Array.prototype.join;\nvar $arrSlice = Array.prototype.slice;\nvar $floor = Math.floor;\nvar bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;\nvar gOPS = Object.getOwnPropertySymbols;\nvar symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;\nvar hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';\n// ie, `has-tostringtag/shams\nvar toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')\n ? Symbol.toStringTag\n : null;\nvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\nvar gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (\n [].__proto__ === Array.prototype // eslint-disable-line no-proto\n ? function (O) {\n return O.__proto__; // eslint-disable-line no-proto\n }\n : null\n);\n\nfunction addNumericSeparator(num, str) {\n if (\n num === Infinity\n || num === -Infinity\n || num !== num\n || (num && num > -1000 && num < 1000)\n || $test.call(/e/, str)\n ) {\n return str;\n }\n var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;\n if (typeof num === 'number') {\n var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)\n if (int !== num) {\n var intStr = String(int);\n var dec = $slice.call(str, intStr.length + 1);\n return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');\n }\n }\n return $replace.call(str, sepRegex, '$&_');\n}\n\nvar utilInspect = require('./util.inspect');\nvar inspectCustom = utilInspect.custom;\nvar inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;\n\nmodule.exports = function inspect_(obj, options, depth, seen) {\n var opts = options || {};\n\n if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {\n throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');\n }\n if (\n has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'\n ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity\n : opts.maxStringLength !== null\n )\n ) {\n throw new TypeError('option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`');\n }\n var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;\n if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {\n throw new TypeError('option \"customInspect\", if provided, must be `true`, `false`, or `\\'symbol\\'`');\n }\n\n if (\n has(opts, 'indent')\n && opts.indent !== null\n && opts.indent !== '\\t'\n && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)\n ) {\n throw new TypeError('option \"indent\" must be \"\\\\t\", an integer > 0, or `null`');\n }\n if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {\n throw new TypeError('option \"numericSeparator\", if provided, must be `true` or `false`');\n }\n var numericSeparator = opts.numericSeparator;\n\n if (typeof obj === 'undefined') {\n return 'undefined';\n }\n if (obj === null) {\n return 'null';\n }\n if (typeof obj === 'boolean') {\n return obj ? 'true' : 'false';\n }\n\n if (typeof obj === 'string') {\n return inspectString(obj, opts);\n }\n if (typeof obj === 'number') {\n if (obj === 0) {\n return Infinity / obj > 0 ? '0' : '-0';\n }\n var str = String(obj);\n return numericSeparator ? addNumericSeparator(obj, str) : str;\n }\n if (typeof obj === 'bigint') {\n var bigIntStr = String(obj) + 'n';\n return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;\n }\n\n var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;\n if (typeof depth === 'undefined') { depth = 0; }\n if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {\n return isArray(obj) ? '[Array]' : '[Object]';\n }\n\n var indent = getIndent(opts, depth);\n\n if (typeof seen === 'undefined') {\n seen = [];\n } else if (indexOf(seen, obj) >= 0) {\n return '[Circular]';\n }\n\n function inspect(value, from, noIndent) {\n if (from) {\n seen = $arrSlice.call(seen);\n seen.push(from);\n }\n if (noIndent) {\n var newOpts = {\n depth: opts.depth\n };\n if (has(opts, 'quoteStyle')) {\n newOpts.quoteStyle = opts.quoteStyle;\n }\n return inspect_(value, newOpts, depth + 1, seen);\n }\n return inspect_(value, opts, depth + 1, seen);\n }\n\n if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable\n var name = nameOf(obj);\n var keys = arrObjKeys(obj, inspect);\n return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');\n }\n if (isSymbol(obj)) {\n var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\\(.*\\))_[^)]*$/, '$1') : symToString.call(obj);\n return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;\n }\n if (isElement(obj)) {\n var s = '<' + $toLowerCase.call(String(obj.nodeName));\n var attrs = obj.attributes || [];\n for (var i = 0; i < attrs.length; i++) {\n s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);\n }\n s += '>';\n if (obj.childNodes && obj.childNodes.length) { s += '...'; }\n s += '';\n return s;\n }\n if (isArray(obj)) {\n if (obj.length === 0) { return '[]'; }\n var xs = arrObjKeys(obj, inspect);\n if (indent && !singleLineValues(xs)) {\n return '[' + indentedJoin(xs, indent) + ']';\n }\n return '[ ' + $join.call(xs, ', ') + ' ]';\n }\n if (isError(obj)) {\n var parts = arrObjKeys(obj, inspect);\n if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {\n return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';\n }\n if (parts.length === 0) { return '[' + String(obj) + ']'; }\n return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';\n }\n if (typeof obj === 'object' && customInspect) {\n if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {\n return utilInspect(obj, { depth: maxDepth - depth });\n } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {\n return obj.inspect();\n }\n }\n if (isMap(obj)) {\n var mapParts = [];\n if (mapForEach) {\n mapForEach.call(obj, function (value, key) {\n mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));\n });\n }\n return collectionOf('Map', mapSize.call(obj), mapParts, indent);\n }\n if (isSet(obj)) {\n var setParts = [];\n if (setForEach) {\n setForEach.call(obj, function (value) {\n setParts.push(inspect(value, obj));\n });\n }\n return collectionOf('Set', setSize.call(obj), setParts, indent);\n }\n if (isWeakMap(obj)) {\n return weakCollectionOf('WeakMap');\n }\n if (isWeakSet(obj)) {\n return weakCollectionOf('WeakSet');\n }\n if (isWeakRef(obj)) {\n return weakCollectionOf('WeakRef');\n }\n if (isNumber(obj)) {\n return markBoxed(inspect(Number(obj)));\n }\n if (isBigInt(obj)) {\n return markBoxed(inspect(bigIntValueOf.call(obj)));\n }\n if (isBoolean(obj)) {\n return markBoxed(booleanValueOf.call(obj));\n }\n if (isString(obj)) {\n return markBoxed(inspect(String(obj)));\n }\n if (!isDate(obj) && !isRegExp(obj)) {\n var ys = arrObjKeys(obj, inspect);\n var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;\n var protoTag = obj instanceof Object ? '' : 'null prototype';\n var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';\n var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';\n var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');\n if (ys.length === 0) { return tag + '{}'; }\n if (indent) {\n return tag + '{' + indentedJoin(ys, indent) + '}';\n }\n return tag + '{ ' + $join.call(ys, ', ') + ' }';\n }\n return String(obj);\n};\n\nfunction wrapQuotes(s, defaultStyle, opts) {\n var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '\"' : \"'\";\n return quoteChar + s + quoteChar;\n}\n\nfunction quote(s) {\n return $replace.call(String(s), /\"/g, '"');\n}\n\nfunction isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\n\n// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives\nfunction isSymbol(obj) {\n if (hasShammedSymbols) {\n return obj && typeof obj === 'object' && obj instanceof Symbol;\n }\n if (typeof obj === 'symbol') {\n return true;\n }\n if (!obj || typeof obj !== 'object' || !symToString) {\n return false;\n }\n try {\n symToString.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isBigInt(obj) {\n if (!obj || typeof obj !== 'object' || !bigIntValueOf) {\n return false;\n }\n try {\n bigIntValueOf.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };\nfunction has(obj, key) {\n return hasOwn.call(obj, key);\n}\n\nfunction toStr(obj) {\n return objectToString.call(obj);\n}\n\nfunction nameOf(f) {\n if (f.name) { return f.name; }\n var m = $match.call(functionToString.call(f), /^function\\s*([\\w$]+)/);\n if (m) { return m[1]; }\n return null;\n}\n\nfunction indexOf(xs, x) {\n if (xs.indexOf) { return xs.indexOf(x); }\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) { return i; }\n }\n return -1;\n}\n\nfunction isMap(x) {\n if (!mapSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n mapSize.call(x);\n try {\n setSize.call(x);\n } catch (s) {\n return true;\n }\n return x instanceof Map; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakMap(x) {\n if (!weakMapHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakMapHas.call(x, weakMapHas);\n try {\n weakSetHas.call(x, weakSetHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakMap; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakRef(x) {\n if (!weakRefDeref || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakRefDeref.call(x);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isSet(x) {\n if (!setSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n setSize.call(x);\n try {\n mapSize.call(x);\n } catch (m) {\n return true;\n }\n return x instanceof Set; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakSet(x) {\n if (!weakSetHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakSetHas.call(x, weakSetHas);\n try {\n weakMapHas.call(x, weakMapHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakSet; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isElement(x) {\n if (!x || typeof x !== 'object') { return false; }\n if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {\n return true;\n }\n return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';\n}\n\nfunction inspectString(str, opts) {\n if (str.length > opts.maxStringLength) {\n var remaining = str.length - opts.maxStringLength;\n var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');\n return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;\n }\n // eslint-disable-next-line no-control-regex\n var s = $replace.call($replace.call(str, /(['\\\\])/g, '\\\\$1'), /[\\x00-\\x1f]/g, lowbyte);\n return wrapQuotes(s, 'single', opts);\n}\n\nfunction lowbyte(c) {\n var n = c.charCodeAt(0);\n var x = {\n 8: 'b',\n 9: 't',\n 10: 'n',\n 12: 'f',\n 13: 'r'\n }[n];\n if (x) { return '\\\\' + x; }\n return '\\\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));\n}\n\nfunction markBoxed(str) {\n return 'Object(' + str + ')';\n}\n\nfunction weakCollectionOf(type) {\n return type + ' { ? }';\n}\n\nfunction collectionOf(type, size, entries, indent) {\n var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');\n return type + ' (' + size + ') {' + joinedEntries + '}';\n}\n\nfunction singleLineValues(xs) {\n for (var i = 0; i < xs.length; i++) {\n if (indexOf(xs[i], '\\n') >= 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction getIndent(opts, depth) {\n var baseIndent;\n if (opts.indent === '\\t') {\n baseIndent = '\\t';\n } else if (typeof opts.indent === 'number' && opts.indent > 0) {\n baseIndent = $join.call(Array(opts.indent + 1), ' ');\n } else {\n return null;\n }\n return {\n base: baseIndent,\n prev: $join.call(Array(depth + 1), baseIndent)\n };\n}\n\nfunction indentedJoin(xs, indent) {\n if (xs.length === 0) { return ''; }\n var lineJoiner = '\\n' + indent.prev + indent.base;\n return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\\n' + indent.prev;\n}\n\nfunction arrObjKeys(obj, inspect) {\n var isArr = isArray(obj);\n var xs = [];\n if (isArr) {\n xs.length = obj.length;\n for (var i = 0; i < obj.length; i++) {\n xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';\n }\n }\n var syms = typeof gOPS === 'function' ? gOPS(obj) : [];\n var symMap;\n if (hasShammedSymbols) {\n symMap = {};\n for (var k = 0; k < syms.length; k++) {\n symMap['$' + syms[k]] = syms[k];\n }\n }\n\n for (var key in obj) { // eslint-disable-line no-restricted-syntax\n if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {\n // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section\n continue; // eslint-disable-line no-restricted-syntax, no-continue\n } else if ($test.call(/[^\\w$]/, key)) {\n xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));\n } else {\n xs.push(key + ': ' + inspect(obj[key], obj));\n }\n }\n if (typeof gOPS === 'function') {\n for (var j = 0; j < syms.length; j++) {\n if (isEnumerable.call(obj, syms[j])) {\n xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));\n }\n }\n }\n return xs;\n}\n","'use strict';\n\nvar keysShim;\nif (!Object.keys) {\n\t// modified from https://github.com/es-shims/es5-shim\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar toStr = Object.prototype.toString;\n\tvar isArgs = require('./isArguments'); // eslint-disable-line global-require\n\tvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\tvar hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');\n\tvar hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');\n\tvar dontEnums = [\n\t\t'toString',\n\t\t'toLocaleString',\n\t\t'valueOf',\n\t\t'hasOwnProperty',\n\t\t'isPrototypeOf',\n\t\t'propertyIsEnumerable',\n\t\t'constructor'\n\t];\n\tvar equalsConstructorPrototype = function (o) {\n\t\tvar ctor = o.constructor;\n\t\treturn ctor && ctor.prototype === o;\n\t};\n\tvar excludedKeys = {\n\t\t$applicationCache: true,\n\t\t$console: true,\n\t\t$external: true,\n\t\t$frame: true,\n\t\t$frameElement: true,\n\t\t$frames: true,\n\t\t$innerHeight: true,\n\t\t$innerWidth: true,\n\t\t$onmozfullscreenchange: true,\n\t\t$onmozfullscreenerror: true,\n\t\t$outerHeight: true,\n\t\t$outerWidth: true,\n\t\t$pageXOffset: true,\n\t\t$pageYOffset: true,\n\t\t$parent: true,\n\t\t$scrollLeft: true,\n\t\t$scrollTop: true,\n\t\t$scrollX: true,\n\t\t$scrollY: true,\n\t\t$self: true,\n\t\t$webkitIndexedDB: true,\n\t\t$webkitStorageInfo: true,\n\t\t$window: true\n\t};\n\tvar hasAutomationEqualityBug = (function () {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined') { return false; }\n\t\tfor (var k in window) {\n\t\t\ttry {\n\t\t\t\tif (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tequalsConstructorPrototype(window[k]);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}());\n\tvar equalsConstructorPrototypeIfNotBuggy = function (o) {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined' || !hasAutomationEqualityBug) {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t}\n\t\ttry {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tkeysShim = function keys(object) {\n\t\tvar isObject = object !== null && typeof object === 'object';\n\t\tvar isFunction = toStr.call(object) === '[object Function]';\n\t\tvar isArguments = isArgs(object);\n\t\tvar isString = isObject && toStr.call(object) === '[object String]';\n\t\tvar theKeys = [];\n\n\t\tif (!isObject && !isFunction && !isArguments) {\n\t\t\tthrow new TypeError('Object.keys called on a non-object');\n\t\t}\n\n\t\tvar skipProto = hasProtoEnumBug && isFunction;\n\t\tif (isString && object.length > 0 && !has.call(object, 0)) {\n\t\t\tfor (var i = 0; i < object.length; ++i) {\n\t\t\t\ttheKeys.push(String(i));\n\t\t\t}\n\t\t}\n\n\t\tif (isArguments && object.length > 0) {\n\t\t\tfor (var j = 0; j < object.length; ++j) {\n\t\t\t\ttheKeys.push(String(j));\n\t\t\t}\n\t\t} else {\n\t\t\tfor (var name in object) {\n\t\t\t\tif (!(skipProto && name === 'prototype') && has.call(object, name)) {\n\t\t\t\t\ttheKeys.push(String(name));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (hasDontEnumBug) {\n\t\t\tvar skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);\n\n\t\t\tfor (var k = 0; k < dontEnums.length; ++k) {\n\t\t\t\tif (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {\n\t\t\t\t\ttheKeys.push(dontEnums[k]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn theKeys;\n\t};\n}\nmodule.exports = keysShim;\n","'use strict';\n\nvar slice = Array.prototype.slice;\nvar isArgs = require('./isArguments');\n\nvar origKeys = Object.keys;\nvar keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');\n\nvar originalKeys = Object.keys;\n\nkeysShim.shim = function shimObjectKeys() {\n\tif (Object.keys) {\n\t\tvar keysWorksWithArguments = (function () {\n\t\t\t// Safari 5.0 bug\n\t\t\tvar args = Object.keys(arguments);\n\t\t\treturn args && args.length === arguments.length;\n\t\t}(1, 2));\n\t\tif (!keysWorksWithArguments) {\n\t\t\tObject.keys = function keys(object) { // eslint-disable-line func-name-matching\n\t\t\t\tif (isArgs(object)) {\n\t\t\t\t\treturn originalKeys(slice.call(object));\n\t\t\t\t}\n\t\t\t\treturn originalKeys(object);\n\t\t\t};\n\t\t}\n\t} else {\n\t\tObject.keys = keysShim;\n\t}\n\treturn Object.keys || keysShim;\n};\n\nmodule.exports = keysShim;\n","'use strict';\n\nvar toStr = Object.prototype.toString;\n\nmodule.exports = function isArguments(value) {\n\tvar str = toStr.call(value);\n\tvar isArgs = str === '[object Arguments]';\n\tif (!isArgs) {\n\t\tisArgs = str !== '[object Array]' &&\n\t\t\tvalue !== null &&\n\t\t\ttypeof value === 'object' &&\n\t\t\ttypeof value.length === 'number' &&\n\t\t\tvalue.length >= 0 &&\n\t\t\ttoStr.call(value.callee) === '[object Function]';\n\t}\n\treturn isArgs;\n};\n","'use strict';\n\nvar setFunctionName = require('set-function-name');\n\nvar $Object = Object;\nvar $TypeError = TypeError;\n\nmodule.exports = setFunctionName(function flags() {\n\tif (this != null && this !== $Object(this)) {\n\t\tthrow new $TypeError('RegExp.prototype.flags getter called on non-object');\n\t}\n\tvar result = '';\n\tif (this.hasIndices) {\n\t\tresult += 'd';\n\t}\n\tif (this.global) {\n\t\tresult += 'g';\n\t}\n\tif (this.ignoreCase) {\n\t\tresult += 'i';\n\t}\n\tif (this.multiline) {\n\t\tresult += 'm';\n\t}\n\tif (this.dotAll) {\n\t\tresult += 's';\n\t}\n\tif (this.unicode) {\n\t\tresult += 'u';\n\t}\n\tif (this.unicodeSets) {\n\t\tresult += 'v';\n\t}\n\tif (this.sticky) {\n\t\tresult += 'y';\n\t}\n\treturn result;\n}, 'get flags', true);\n\n","'use strict';\n\nvar define = require('define-properties');\nvar callBind = require('call-bind');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar flagsBound = callBind(getPolyfill());\n\ndefine(flagsBound, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = flagsBound;\n","'use strict';\n\nvar implementation = require('./implementation');\n\nvar supportsDescriptors = require('define-properties').supportsDescriptors;\nvar $gOPD = Object.getOwnPropertyDescriptor;\n\nmodule.exports = function getPolyfill() {\n\tif (supportsDescriptors && (/a/mig).flags === 'gim') {\n\t\tvar descriptor = $gOPD(RegExp.prototype, 'flags');\n\t\tif (\n\t\t\tdescriptor\n\t\t\t&& typeof descriptor.get === 'function'\n\t\t\t&& typeof RegExp.prototype.dotAll === 'boolean'\n\t\t\t&& typeof RegExp.prototype.hasIndices === 'boolean'\n\t\t) {\n\t\t\t/* eslint getter-return: 0 */\n\t\t\tvar calls = '';\n\t\t\tvar o = {};\n\t\t\tObject.defineProperty(o, 'hasIndices', {\n\t\t\t\tget: function () {\n\t\t\t\t\tcalls += 'd';\n\t\t\t\t}\n\t\t\t});\n\t\t\tObject.defineProperty(o, 'sticky', {\n\t\t\t\tget: function () {\n\t\t\t\t\tcalls += 'y';\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (calls === 'dy') {\n\t\t\t\treturn descriptor.get;\n\t\t\t}\n\t\t}\n\t}\n\treturn implementation;\n};\n","'use strict';\n\nvar supportsDescriptors = require('define-properties').supportsDescriptors;\nvar getPolyfill = require('./polyfill');\nvar gOPD = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar TypeErr = TypeError;\nvar getProto = Object.getPrototypeOf;\nvar regex = /a/;\n\nmodule.exports = function shimFlags() {\n\tif (!supportsDescriptors || !getProto) {\n\t\tthrow new TypeErr('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');\n\t}\n\tvar polyfill = getPolyfill();\n\tvar proto = getProto(regex);\n\tvar descriptor = gOPD(proto, 'flags');\n\tif (!descriptor || descriptor.get !== polyfill) {\n\t\tdefineProperty(proto, 'flags', {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tget: polyfill\n\t\t});\n\t}\n\treturn polyfill;\n};\n","'use strict';\n\nvar callBound = require('call-bind/callBound');\nvar GetIntrinsic = require('get-intrinsic');\nvar isRegex = require('is-regex');\n\nvar $exec = callBound('RegExp.prototype.exec');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nmodule.exports = function regexTester(regex) {\n\tif (!isRegex(regex)) {\n\t\tthrow new $TypeError('`regex` must be a RegExp');\n\t}\n\treturn function test(s) {\n\t\treturn $exec(regex, s) !== null;\n\t};\n};\n","'use strict';\n\nvar define = require('define-data-property');\nvar hasDescriptors = require('has-property-descriptors')();\nvar functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames();\n\nvar $TypeError = TypeError;\n\nmodule.exports = function setFunctionName(fn, name) {\n\tif (typeof fn !== 'function') {\n\t\tthrow new $TypeError('`fn` is not a function');\n\t}\n\tvar loose = arguments.length > 2 && !!arguments[2];\n\tif (!loose || functionsHaveConfigurableNames) {\n\t\tif (hasDescriptors) {\n\t\t\tdefine(fn, 'name', name, true, true);\n\t\t} else {\n\t\t\tdefine(fn, 'name', name);\n\t\t}\n\t}\n\treturn fn;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bind/callBound');\nvar inspect = require('object-inspect');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $WeakMap = GetIntrinsic('%WeakMap%', true);\nvar $Map = GetIntrinsic('%Map%', true);\n\nvar $weakMapGet = callBound('WeakMap.prototype.get', true);\nvar $weakMapSet = callBound('WeakMap.prototype.set', true);\nvar $weakMapHas = callBound('WeakMap.prototype.has', true);\nvar $mapGet = callBound('Map.prototype.get', true);\nvar $mapSet = callBound('Map.prototype.set', true);\nvar $mapHas = callBound('Map.prototype.has', true);\n\n/*\n * This function traverses the list returning the node corresponding to the\n * given key.\n *\n * That node is also moved to the head of the list, so that if it's accessed\n * again we don't need to traverse the whole list. By doing so, all the recently\n * used nodes can be accessed relatively quickly.\n */\nvar listGetNode = function (list, key) { // eslint-disable-line consistent-return\n\tfor (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {\n\t\tif (curr.key === key) {\n\t\t\tprev.next = curr.next;\n\t\t\tcurr.next = list.next;\n\t\t\tlist.next = curr; // eslint-disable-line no-param-reassign\n\t\t\treturn curr;\n\t\t}\n\t}\n};\n\nvar listGet = function (objects, key) {\n\tvar node = listGetNode(objects, key);\n\treturn node && node.value;\n};\nvar listSet = function (objects, key, value) {\n\tvar node = listGetNode(objects, key);\n\tif (node) {\n\t\tnode.value = value;\n\t} else {\n\t\t// Prepend the new node to the beginning of the list\n\t\tobjects.next = { // eslint-disable-line no-param-reassign\n\t\t\tkey: key,\n\t\t\tnext: objects.next,\n\t\t\tvalue: value\n\t\t};\n\t}\n};\nvar listHas = function (objects, key) {\n\treturn !!listGetNode(objects, key);\n};\n\nmodule.exports = function getSideChannel() {\n\tvar $wm;\n\tvar $m;\n\tvar $o;\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\tget: function (key) { // eslint-disable-line consistent-return\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapGet($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapGet($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listGet($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\thas: function (key) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapHas($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapHas($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listHas($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif (!$wm) {\n\t\t\t\t\t$wm = new $WeakMap();\n\t\t\t\t}\n\t\t\t\t$weakMapSet($wm, key, value);\n\t\t\t} else if ($Map) {\n\t\t\t\tif (!$m) {\n\t\t\t\t\t$m = new $Map();\n\t\t\t\t}\n\t\t\t\t$mapSet($m, key, value);\n\t\t\t} else {\n\t\t\t\tif (!$o) {\n\t\t\t\t\t/*\n\t\t\t\t\t * Initialize the linked list as an empty node, so that we don't have\n\t\t\t\t\t * to special-case handling of the first node: we can always refer to\n\t\t\t\t\t * it as (previous node).next, instead of something like (list).head\n\t\t\t\t\t */\n\t\t\t\t\t$o = { key: {}, next: null };\n\t\t\t\t}\n\t\t\t\tlistSet($o, key, value);\n\t\t\t}\n\t\t}\n\t};\n\treturn channel;\n};\n","'use strict';\n\nvar Call = require('es-abstract/2023/Call');\nvar Get = require('es-abstract/2023/Get');\nvar GetMethod = require('es-abstract/2023/GetMethod');\nvar IsRegExp = require('es-abstract/2023/IsRegExp');\nvar ToString = require('es-abstract/2023/ToString');\nvar RequireObjectCoercible = require('es-abstract/2023/RequireObjectCoercible');\nvar callBound = require('call-bind/callBound');\nvar hasSymbols = require('has-symbols')();\nvar flagsGetter = require('regexp.prototype.flags');\n\nvar $indexOf = callBound('String.prototype.indexOf');\n\nvar regexpMatchAllPolyfill = require('./polyfill-regexp-matchall');\n\nvar getMatcher = function getMatcher(regexp) { // eslint-disable-line consistent-return\n\tvar matcherPolyfill = regexpMatchAllPolyfill();\n\tif (hasSymbols && typeof Symbol.matchAll === 'symbol') {\n\t\tvar matcher = GetMethod(regexp, Symbol.matchAll);\n\t\tif (matcher === RegExp.prototype[Symbol.matchAll] && matcher !== matcherPolyfill) {\n\t\t\treturn matcherPolyfill;\n\t\t}\n\t\treturn matcher;\n\t}\n\t// fallback for pre-Symbol.matchAll environments\n\tif (IsRegExp(regexp)) {\n\t\treturn matcherPolyfill;\n\t}\n};\n\nmodule.exports = function matchAll(regexp) {\n\tvar O = RequireObjectCoercible(this);\n\n\tif (typeof regexp !== 'undefined' && regexp !== null) {\n\t\tvar isRegExp = IsRegExp(regexp);\n\t\tif (isRegExp) {\n\t\t\t// workaround for older engines that lack RegExp.prototype.flags\n\t\t\tvar flags = 'flags' in regexp ? Get(regexp, 'flags') : flagsGetter(regexp);\n\t\t\tRequireObjectCoercible(flags);\n\t\t\tif ($indexOf(ToString(flags), 'g') < 0) {\n\t\t\t\tthrow new TypeError('matchAll requires a global regular expression');\n\t\t\t}\n\t\t}\n\n\t\tvar matcher = getMatcher(regexp);\n\t\tif (typeof matcher !== 'undefined') {\n\t\t\treturn Call(matcher, regexp, [O]);\n\t\t}\n\t}\n\n\tvar S = ToString(O);\n\t// var rx = RegExpCreate(regexp, 'g');\n\tvar rx = new RegExp(regexp, 'g');\n\treturn Call(getMatcher(rx), rx, [S]);\n};\n","'use strict';\n\nvar callBind = require('call-bind');\nvar define = require('define-properties');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar boundMatchAll = callBind(implementation);\n\ndefine(boundMatchAll, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = boundMatchAll;\n","'use strict';\n\nvar hasSymbols = require('has-symbols')();\nvar regexpMatchAll = require('./regexp-matchall');\n\nmodule.exports = function getRegExpMatchAllPolyfill() {\n\tif (!hasSymbols || typeof Symbol.matchAll !== 'symbol' || typeof RegExp.prototype[Symbol.matchAll] !== 'function') {\n\t\treturn regexpMatchAll;\n\t}\n\treturn RegExp.prototype[Symbol.matchAll];\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = function getPolyfill() {\n\tif (String.prototype.matchAll) {\n\t\ttry {\n\t\t\t''.matchAll(RegExp.prototype);\n\t\t} catch (e) {\n\t\t\treturn String.prototype.matchAll;\n\t\t}\n\t}\n\treturn implementation;\n};\n","'use strict';\n\n// var Construct = require('es-abstract/2023/Construct');\nvar CreateRegExpStringIterator = require('es-abstract/2023/CreateRegExpStringIterator');\nvar Get = require('es-abstract/2023/Get');\nvar Set = require('es-abstract/2023/Set');\nvar SpeciesConstructor = require('es-abstract/2023/SpeciesConstructor');\nvar ToLength = require('es-abstract/2023/ToLength');\nvar ToString = require('es-abstract/2023/ToString');\nvar Type = require('es-abstract/2023/Type');\nvar flagsGetter = require('regexp.prototype.flags');\nvar setFunctionName = require('set-function-name');\nvar callBound = require('call-bind/callBound');\n\nvar $indexOf = callBound('String.prototype.indexOf');\n\nvar OrigRegExp = RegExp;\n\nvar supportsConstructingWithFlags = 'flags' in RegExp.prototype;\n\nvar constructRegexWithFlags = function constructRegex(C, R) {\n\tvar matcher;\n\t// workaround for older engines that lack RegExp.prototype.flags\n\tvar flags = 'flags' in R ? Get(R, 'flags') : ToString(flagsGetter(R));\n\tif (supportsConstructingWithFlags && typeof flags === 'string') {\n\t\tmatcher = new C(R, flags);\n\t} else if (C === OrigRegExp) {\n\t\t// workaround for older engines that can not construct a RegExp with flags\n\t\tmatcher = new C(R.source, flags);\n\t} else {\n\t\tmatcher = new C(R, flags);\n\t}\n\treturn { flags: flags, matcher: matcher };\n};\n\nvar regexMatchAll = setFunctionName(function SymbolMatchAll(string) {\n\tvar R = this;\n\tif (Type(R) !== 'Object') {\n\t\tthrow new TypeError('\"this\" value must be an Object');\n\t}\n\tvar S = ToString(string);\n\tvar C = SpeciesConstructor(R, OrigRegExp);\n\n\tvar tmp = constructRegexWithFlags(C, R);\n\t// var flags = ToString(Get(R, 'flags'));\n\tvar flags = tmp.flags;\n\t// var matcher = Construct(C, [R, flags]);\n\tvar matcher = tmp.matcher;\n\n\tvar lastIndex = ToLength(Get(R, 'lastIndex'));\n\tSet(matcher, 'lastIndex', lastIndex, true);\n\tvar global = $indexOf(flags, 'g') > -1;\n\tvar fullUnicode = $indexOf(flags, 'u') > -1;\n\treturn CreateRegExpStringIterator(matcher, S, global, fullUnicode);\n}, '[Symbol.matchAll]', true);\n\nmodule.exports = regexMatchAll;\n","'use strict';\n\nvar define = require('define-properties');\nvar hasSymbols = require('has-symbols')();\nvar getPolyfill = require('./polyfill');\nvar regexpMatchAllPolyfill = require('./polyfill-regexp-matchall');\n\nvar defineP = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nmodule.exports = function shimMatchAll() {\n\tvar polyfill = getPolyfill();\n\tdefine(\n\t\tString.prototype,\n\t\t{ matchAll: polyfill },\n\t\t{ matchAll: function () { return String.prototype.matchAll !== polyfill; } }\n\t);\n\tif (hasSymbols) {\n\t\t// eslint-disable-next-line no-restricted-properties\n\t\tvar symbol = Symbol.matchAll || (Symbol['for'] ? Symbol['for']('Symbol.matchAll') : Symbol('Symbol.matchAll'));\n\t\tdefine(\n\t\t\tSymbol,\n\t\t\t{ matchAll: symbol },\n\t\t\t{ matchAll: function () { return Symbol.matchAll !== symbol; } }\n\t\t);\n\n\t\tif (defineP && gOPD) {\n\t\t\tvar desc = gOPD(Symbol, symbol);\n\t\t\tif (!desc || desc.configurable) {\n\t\t\t\tdefineP(Symbol, symbol, {\n\t\t\t\t\tconfigurable: false,\n\t\t\t\t\tenumerable: false,\n\t\t\t\t\tvalue: symbol,\n\t\t\t\t\twritable: false\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tvar regexpMatchAll = regexpMatchAllPolyfill();\n\t\tvar func = {};\n\t\tfunc[symbol] = regexpMatchAll;\n\t\tvar predicate = {};\n\t\tpredicate[symbol] = function () {\n\t\t\treturn RegExp.prototype[symbol] !== regexpMatchAll;\n\t\t};\n\t\tdefine(RegExp.prototype, func, predicate);\n\t}\n\treturn polyfill;\n};\n","'use strict';\n\nvar RequireObjectCoercible = require('es-abstract/2023/RequireObjectCoercible');\nvar ToString = require('es-abstract/2023/ToString');\nvar callBound = require('call-bind/callBound');\nvar $replace = callBound('String.prototype.replace');\n\nvar mvsIsWS = (/^\\s$/).test('\\u180E');\n/* eslint-disable no-control-regex */\nvar leftWhitespace = mvsIsWS\n\t? /^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+/\n\t: /^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+/;\nvar rightWhitespace = mvsIsWS\n\t? /[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+$/\n\t: /[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+$/;\n/* eslint-enable no-control-regex */\n\nmodule.exports = function trim() {\n\tvar S = ToString(RequireObjectCoercible(this));\n\treturn $replace($replace(S, leftWhitespace, ''), rightWhitespace, '');\n};\n","'use strict';\n\nvar callBind = require('call-bind');\nvar define = require('define-properties');\nvar RequireObjectCoercible = require('es-abstract/2023/RequireObjectCoercible');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar bound = callBind(getPolyfill());\nvar boundMethod = function trim(receiver) {\n\tRequireObjectCoercible(receiver);\n\treturn bound(receiver);\n};\n\ndefine(boundMethod, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = boundMethod;\n","'use strict';\n\nvar implementation = require('./implementation');\n\nvar zeroWidthSpace = '\\u200b';\nvar mongolianVowelSeparator = '\\u180E';\n\nmodule.exports = function getPolyfill() {\n\tif (\n\t\tString.prototype.trim\n\t\t&& zeroWidthSpace.trim() === zeroWidthSpace\n\t\t&& mongolianVowelSeparator.trim() === mongolianVowelSeparator\n\t\t&& ('_' + mongolianVowelSeparator).trim() === ('_' + mongolianVowelSeparator)\n\t\t&& (mongolianVowelSeparator + '_').trim() === (mongolianVowelSeparator + '_')\n\t) {\n\t\treturn String.prototype.trim;\n\t}\n\treturn implementation;\n};\n","'use strict';\n\nvar define = require('define-properties');\nvar getPolyfill = require('./polyfill');\n\nmodule.exports = function shimStringTrim() {\n\tvar polyfill = getPolyfill();\n\tdefine(String.prototype, { trim: polyfill }, {\n\t\ttrim: function testTrim() {\n\t\t\treturn String.prototype.trim !== polyfill;\n\t\t}\n\t});\n\treturn polyfill;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar CodePointAt = require('./CodePointAt');\nvar Type = require('./Type');\n\nvar isInteger = require('../helpers/isInteger');\nvar MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// https://262.ecma-international.org/12.0/#sec-advancestringindex\n\nmodule.exports = function AdvanceStringIndex(S, index, unicode) {\n\tif (Type(S) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `S` must be a String');\n\t}\n\tif (!isInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) {\n\t\tthrow new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53');\n\t}\n\tif (Type(unicode) !== 'Boolean') {\n\t\tthrow new $TypeError('Assertion failed: `unicode` must be a Boolean');\n\t}\n\tif (!unicode) {\n\t\treturn index + 1;\n\t}\n\tvar length = S.length;\n\tif ((index + 1) >= length) {\n\t\treturn index + 1;\n\t}\n\tvar cp = CodePointAt(S, index);\n\treturn index + cp['[[CodeUnitCount]]'];\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bind/callBound');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar IsArray = require('./IsArray');\n\nvar $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('Function.prototype.apply');\n\n// https://262.ecma-international.org/6.0/#sec-call\n\nmodule.exports = function Call(F, V) {\n\tvar argumentsList = arguments.length > 2 ? arguments[2] : [];\n\tif (!IsArray(argumentsList)) {\n\t\tthrow new $TypeError('Assertion failed: optional `argumentsList`, if provided, must be a List');\n\t}\n\treturn $apply(F, V, argumentsList);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar callBound = require('call-bind/callBound');\nvar isLeadingSurrogate = require('../helpers/isLeadingSurrogate');\nvar isTrailingSurrogate = require('../helpers/isTrailingSurrogate');\n\nvar Type = require('./Type');\nvar UTF16SurrogatePairToCodePoint = require('./UTF16SurrogatePairToCodePoint');\n\nvar $charAt = callBound('String.prototype.charAt');\nvar $charCodeAt = callBound('String.prototype.charCodeAt');\n\n// https://262.ecma-international.org/12.0/#sec-codepointat\n\nmodule.exports = function CodePointAt(string, position) {\n\tif (Type(string) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `string` must be a String');\n\t}\n\tvar size = string.length;\n\tif (position < 0 || position >= size) {\n\t\tthrow new $TypeError('Assertion failed: `position` must be >= 0, and < the length of `string`');\n\t}\n\tvar first = $charCodeAt(string, position);\n\tvar cp = $charAt(string, position);\n\tvar firstIsLeading = isLeadingSurrogate(first);\n\tvar firstIsTrailing = isTrailingSurrogate(first);\n\tif (!firstIsLeading && !firstIsTrailing) {\n\t\treturn {\n\t\t\t'[[CodePoint]]': cp,\n\t\t\t'[[CodeUnitCount]]': 1,\n\t\t\t'[[IsUnpairedSurrogate]]': false\n\t\t};\n\t}\n\tif (firstIsTrailing || (position + 1 === size)) {\n\t\treturn {\n\t\t\t'[[CodePoint]]': cp,\n\t\t\t'[[CodeUnitCount]]': 1,\n\t\t\t'[[IsUnpairedSurrogate]]': true\n\t\t};\n\t}\n\tvar second = $charCodeAt(string, position + 1);\n\tif (!isTrailingSurrogate(second)) {\n\t\treturn {\n\t\t\t'[[CodePoint]]': cp,\n\t\t\t'[[CodeUnitCount]]': 1,\n\t\t\t'[[IsUnpairedSurrogate]]': true\n\t\t};\n\t}\n\n\treturn {\n\t\t'[[CodePoint]]': UTF16SurrogatePairToCodePoint(first, second),\n\t\t'[[CodeUnitCount]]': 2,\n\t\t'[[IsUnpairedSurrogate]]': false\n\t};\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-createiterresultobject\n\nmodule.exports = function CreateIterResultObject(value, done) {\n\tif (Type(done) !== 'Boolean') {\n\t\tthrow new $TypeError('Assertion failed: Type(done) is not Boolean');\n\t}\n\treturn {\n\t\tvalue: value,\n\t\tdone: done\n\t};\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar DefineOwnProperty = require('../helpers/DefineOwnProperty');\n\nvar FromPropertyDescriptor = require('./FromPropertyDescriptor');\nvar IsDataDescriptor = require('./IsDataDescriptor');\nvar IsPropertyKey = require('./IsPropertyKey');\nvar SameValue = require('./SameValue');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-createmethodproperty\n\nmodule.exports = function CreateMethodProperty(O, P, V) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true');\n\t}\n\n\tvar newDesc = {\n\t\t'[[Configurable]]': true,\n\t\t'[[Enumerable]]': false,\n\t\t'[[Value]]': V,\n\t\t'[[Writable]]': true\n\t};\n\treturn DefineOwnProperty(\n\t\tIsDataDescriptor,\n\t\tSameValue,\n\t\tFromPropertyDescriptor,\n\t\tO,\n\t\tP,\n\t\tnewDesc\n\t);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar hasSymbols = require('has-symbols')();\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar IteratorPrototype = GetIntrinsic('%IteratorPrototype%', true);\n\nvar AdvanceStringIndex = require('./AdvanceStringIndex');\nvar CreateIterResultObject = require('./CreateIterResultObject');\nvar CreateMethodProperty = require('./CreateMethodProperty');\nvar Get = require('./Get');\nvar OrdinaryObjectCreate = require('./OrdinaryObjectCreate');\nvar RegExpExec = require('./RegExpExec');\nvar Set = require('./Set');\nvar ToLength = require('./ToLength');\nvar ToString = require('./ToString');\nvar Type = require('./Type');\n\nvar SLOT = require('internal-slot');\nvar setToStringTag = require('es-set-tostringtag');\n\nvar RegExpStringIterator = function RegExpStringIterator(R, S, global, fullUnicode) {\n\tif (Type(S) !== 'String') {\n\t\tthrow new $TypeError('`S` must be a string');\n\t}\n\tif (Type(global) !== 'Boolean') {\n\t\tthrow new $TypeError('`global` must be a boolean');\n\t}\n\tif (Type(fullUnicode) !== 'Boolean') {\n\t\tthrow new $TypeError('`fullUnicode` must be a boolean');\n\t}\n\tSLOT.set(this, '[[IteratingRegExp]]', R);\n\tSLOT.set(this, '[[IteratedString]]', S);\n\tSLOT.set(this, '[[Global]]', global);\n\tSLOT.set(this, '[[Unicode]]', fullUnicode);\n\tSLOT.set(this, '[[Done]]', false);\n};\n\nif (IteratorPrototype) {\n\tRegExpStringIterator.prototype = OrdinaryObjectCreate(IteratorPrototype);\n}\n\nvar RegExpStringIteratorNext = function next() {\n\tvar O = this; // eslint-disable-line no-invalid-this\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('receiver must be an object');\n\t}\n\tif (\n\t\t!(O instanceof RegExpStringIterator)\n\t\t|| !SLOT.has(O, '[[IteratingRegExp]]')\n\t\t|| !SLOT.has(O, '[[IteratedString]]')\n\t\t|| !SLOT.has(O, '[[Global]]')\n\t\t|| !SLOT.has(O, '[[Unicode]]')\n\t\t|| !SLOT.has(O, '[[Done]]')\n\t) {\n\t\tthrow new $TypeError('\"this\" value must be a RegExpStringIterator instance');\n\t}\n\tif (SLOT.get(O, '[[Done]]')) {\n\t\treturn CreateIterResultObject(undefined, true);\n\t}\n\tvar R = SLOT.get(O, '[[IteratingRegExp]]');\n\tvar S = SLOT.get(O, '[[IteratedString]]');\n\tvar global = SLOT.get(O, '[[Global]]');\n\tvar fullUnicode = SLOT.get(O, '[[Unicode]]');\n\tvar match = RegExpExec(R, S);\n\tif (match === null) {\n\t\tSLOT.set(O, '[[Done]]', true);\n\t\treturn CreateIterResultObject(undefined, true);\n\t}\n\tif (global) {\n\t\tvar matchStr = ToString(Get(match, '0'));\n\t\tif (matchStr === '') {\n\t\t\tvar thisIndex = ToLength(Get(R, 'lastIndex'));\n\t\t\tvar nextIndex = AdvanceStringIndex(S, thisIndex, fullUnicode);\n\t\t\tSet(R, 'lastIndex', nextIndex, true);\n\t\t}\n\t\treturn CreateIterResultObject(match, false);\n\t}\n\tSLOT.set(O, '[[Done]]', true);\n\treturn CreateIterResultObject(match, false);\n};\nCreateMethodProperty(RegExpStringIterator.prototype, 'next', RegExpStringIteratorNext);\n\nif (hasSymbols) {\n\tsetToStringTag(RegExpStringIterator.prototype, 'RegExp String Iterator');\n\n\tif (Symbol.iterator && typeof RegExpStringIterator.prototype[Symbol.iterator] !== 'function') {\n\t\tvar iteratorFn = function SymbolIterator() {\n\t\t\treturn this;\n\t\t};\n\t\tCreateMethodProperty(RegExpStringIterator.prototype, Symbol.iterator, iteratorFn);\n\t}\n}\n\n// https://262.ecma-international.org/11.0/#sec-createregexpstringiterator\nmodule.exports = function CreateRegExpStringIterator(R, S, global, fullUnicode) {\n\t// assert R.global === global && R.unicode === fullUnicode?\n\treturn new RegExpStringIterator(R, S, global, fullUnicode);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar isPropertyDescriptor = require('../helpers/isPropertyDescriptor');\nvar DefineOwnProperty = require('../helpers/DefineOwnProperty');\n\nvar FromPropertyDescriptor = require('./FromPropertyDescriptor');\nvar IsAccessorDescriptor = require('./IsAccessorDescriptor');\nvar IsDataDescriptor = require('./IsDataDescriptor');\nvar IsPropertyKey = require('./IsPropertyKey');\nvar SameValue = require('./SameValue');\nvar ToPropertyDescriptor = require('./ToPropertyDescriptor');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-definepropertyorthrow\n\nmodule.exports = function DefinePropertyOrThrow(O, P, desc) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true');\n\t}\n\n\tvar Desc = isPropertyDescriptor({\n\t\tType: Type,\n\t\tIsDataDescriptor: IsDataDescriptor,\n\t\tIsAccessorDescriptor: IsAccessorDescriptor\n\t}, desc) ? desc : ToPropertyDescriptor(desc);\n\tif (!isPropertyDescriptor({\n\t\tType: Type,\n\t\tIsDataDescriptor: IsDataDescriptor,\n\t\tIsAccessorDescriptor: IsAccessorDescriptor\n\t}, Desc)) {\n\t\tthrow new $TypeError('Assertion failed: Desc is not a valid Property Descriptor');\n\t}\n\n\treturn DefineOwnProperty(\n\t\tIsDataDescriptor,\n\t\tSameValue,\n\t\tFromPropertyDescriptor,\n\t\tO,\n\t\tP,\n\t\tDesc\n\t);\n};\n","'use strict';\n\nvar assertRecord = require('../helpers/assertRecord');\nvar fromPropertyDescriptor = require('../helpers/fromPropertyDescriptor');\n\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-frompropertydescriptor\n\nmodule.exports = function FromPropertyDescriptor(Desc) {\n\tif (typeof Desc !== 'undefined') {\n\t\tassertRecord(Type, 'Property Descriptor', 'Desc', Desc);\n\t}\n\n\treturn fromPropertyDescriptor(Desc);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar inspect = require('object-inspect');\n\nvar IsPropertyKey = require('./IsPropertyKey');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-get-o-p\n\nmodule.exports = function Get(O, P) {\n\t// 7.3.1.1\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\t// 7.3.1.2\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P));\n\t}\n\t// 7.3.1.3\n\treturn O[P];\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar GetV = require('./GetV');\nvar IsCallable = require('./IsCallable');\nvar IsPropertyKey = require('./IsPropertyKey');\n\nvar inspect = require('object-inspect');\n\n// https://262.ecma-international.org/6.0/#sec-getmethod\n\nmodule.exports = function GetMethod(O, P) {\n\t// 7.3.9.1\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true');\n\t}\n\n\t// 7.3.9.2\n\tvar func = GetV(O, P);\n\n\t// 7.3.9.4\n\tif (func == null) {\n\t\treturn void 0;\n\t}\n\n\t// 7.3.9.5\n\tif (!IsCallable(func)) {\n\t\tthrow new $TypeError(inspect(P) + ' is not a function: ' + inspect(func));\n\t}\n\n\t// 7.3.9.6\n\treturn func;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar inspect = require('object-inspect');\n\nvar IsPropertyKey = require('./IsPropertyKey');\n// var ToObject = require('./ToObject');\n\n// https://262.ecma-international.org/6.0/#sec-getv\n\nmodule.exports = function GetV(V, P) {\n\t// 7.3.2.1\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P));\n\t}\n\n\t// 7.3.2.2-3\n\t// var O = ToObject(V);\n\n\t// 7.3.2.4\n\treturn V[P];\n};\n","'use strict';\n\nvar has = require('has');\n\nvar Type = require('./Type');\n\nvar assertRecord = require('../helpers/assertRecord');\n\n// https://262.ecma-international.org/5.1/#sec-8.10.1\n\nmodule.exports = function IsAccessorDescriptor(Desc) {\n\tif (typeof Desc === 'undefined') {\n\t\treturn false;\n\t}\n\n\tassertRecord(Type, 'Property Descriptor', 'Desc', Desc);\n\n\tif (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n","'use strict';\n\n// https://262.ecma-international.org/6.0/#sec-isarray\nmodule.exports = require('../helpers/IsArray');\n","'use strict';\n\n// http://262.ecma-international.org/5.1/#sec-9.11\n\nmodule.exports = require('is-callable');\n","'use strict';\n\nvar GetIntrinsic = require('../GetIntrinsic.js');\n\nvar $construct = GetIntrinsic('%Reflect.construct%', true);\n\nvar DefinePropertyOrThrow = require('./DefinePropertyOrThrow');\ntry {\n\tDefinePropertyOrThrow({}, '', { '[[Get]]': function () {} });\n} catch (e) {\n\t// Accessor properties aren't supported\n\tDefinePropertyOrThrow = null;\n}\n\n// https://262.ecma-international.org/6.0/#sec-isconstructor\n\nif (DefinePropertyOrThrow && $construct) {\n\tvar isConstructorMarker = {};\n\tvar badArrayLike = {};\n\tDefinePropertyOrThrow(badArrayLike, 'length', {\n\t\t'[[Get]]': function () {\n\t\t\tthrow isConstructorMarker;\n\t\t},\n\t\t'[[Enumerable]]': true\n\t});\n\n\tmodule.exports = function IsConstructor(argument) {\n\t\ttry {\n\t\t\t// `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`:\n\t\t\t$construct(argument, badArrayLike);\n\t\t} catch (err) {\n\t\t\treturn err === isConstructorMarker;\n\t\t}\n\t};\n} else {\n\tmodule.exports = function IsConstructor(argument) {\n\t\t// unfortunately there's no way to truly check this without try/catch `new argument` in old environments\n\t\treturn typeof argument === 'function' && !!argument.prototype;\n\t};\n}\n","'use strict';\n\nvar has = require('has');\n\nvar Type = require('./Type');\n\nvar assertRecord = require('../helpers/assertRecord');\n\n// https://262.ecma-international.org/5.1/#sec-8.10.2\n\nmodule.exports = function IsDataDescriptor(Desc) {\n\tif (typeof Desc === 'undefined') {\n\t\treturn false;\n\t}\n\n\tassertRecord(Type, 'Property Descriptor', 'Desc', Desc);\n\n\tif (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n","'use strict';\n\n// https://262.ecma-international.org/6.0/#sec-ispropertykey\n\nmodule.exports = function IsPropertyKey(argument) {\n\treturn typeof argument === 'string' || typeof argument === 'symbol';\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $match = GetIntrinsic('%Symbol.match%', true);\n\nvar hasRegExpMatcher = require('is-regex');\n\nvar ToBoolean = require('./ToBoolean');\n\n// https://262.ecma-international.org/6.0/#sec-isregexp\n\nmodule.exports = function IsRegExp(argument) {\n\tif (!argument || typeof argument !== 'object') {\n\t\treturn false;\n\t}\n\tif ($match) {\n\t\tvar isRegExp = argument[$match];\n\t\tif (typeof isRegExp !== 'undefined') {\n\t\t\treturn ToBoolean(isRegExp);\n\t\t}\n\t}\n\treturn hasRegExpMatcher(argument);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $ObjectCreate = GetIntrinsic('%Object.create%', true);\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\n\nvar IsArray = require('./IsArray');\nvar Type = require('./Type');\n\nvar forEach = require('../helpers/forEach');\n\nvar SLOT = require('internal-slot');\n\nvar hasProto = require('has-proto')();\n\n// https://262.ecma-international.org/11.0/#sec-objectcreate\n\nmodule.exports = function OrdinaryObjectCreate(proto) {\n\tif (proto !== null && Type(proto) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: `proto` must be null or an object');\n\t}\n\tvar additionalInternalSlotsList = arguments.length < 2 ? [] : arguments[1];\n\tif (!IsArray(additionalInternalSlotsList)) {\n\t\tthrow new $TypeError('Assertion failed: `additionalInternalSlotsList` must be an Array');\n\t}\n\n\t// var internalSlotsList = ['[[Prototype]]', '[[Extensible]]']; // step 1\n\t// internalSlotsList.push(...additionalInternalSlotsList); // step 2\n\t// var O = MakeBasicObject(internalSlotsList); // step 3\n\t// setProto(O, proto); // step 4\n\t// return O; // step 5\n\n\tvar O;\n\tif ($ObjectCreate) {\n\t\tO = $ObjectCreate(proto);\n\t} else if (hasProto) {\n\t\tO = { __proto__: proto };\n\t} else {\n\t\tif (proto === null) {\n\t\t\tthrow new $SyntaxError('native Object.create support is required to create null objects');\n\t\t}\n\t\tvar T = function T() {};\n\t\tT.prototype = proto;\n\t\tO = new T();\n\t}\n\n\tif (additionalInternalSlotsList.length > 0) {\n\t\tforEach(additionalInternalSlotsList, function (slot) {\n\t\t\tSLOT.set(O, slot, void undefined);\n\t\t});\n\t}\n\n\treturn O;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar regexExec = require('call-bind/callBound')('RegExp.prototype.exec');\n\nvar Call = require('./Call');\nvar Get = require('./Get');\nvar IsCallable = require('./IsCallable');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-regexpexec\n\nmodule.exports = function RegExpExec(R, S) {\n\tif (Type(R) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: `R` must be an Object');\n\t}\n\tif (Type(S) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `S` must be a String');\n\t}\n\tvar exec = Get(R, 'exec');\n\tif (IsCallable(exec)) {\n\t\tvar result = Call(exec, R, [S]);\n\t\tif (result === null || Type(result) === 'Object') {\n\t\t\treturn result;\n\t\t}\n\t\tthrow new $TypeError('\"exec\" method must return `null` or an Object');\n\t}\n\treturn regexExec(R, S);\n};\n","'use strict';\n\nmodule.exports = require('../5/CheckObjectCoercible');\n","'use strict';\n\nvar $isNaN = require('../helpers/isNaN');\n\n// http://262.ecma-international.org/5.1/#sec-9.12\n\nmodule.exports = function SameValue(x, y) {\n\tif (x === y) { // 0 === -0, but they are not identical.\n\t\tif (x === 0) { return 1 / x === 1 / y; }\n\t\treturn true;\n\t}\n\treturn $isNaN(x) && $isNaN(y);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar IsPropertyKey = require('./IsPropertyKey');\nvar SameValue = require('./SameValue');\nvar Type = require('./Type');\n\n// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated\nvar noThrowOnStrictViolation = (function () {\n\ttry {\n\t\tdelete [].length;\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n}());\n\n// https://262.ecma-international.org/6.0/#sec-set-o-p-v-throw\n\nmodule.exports = function Set(O, P, V, Throw) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: `O` must be an Object');\n\t}\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: `P` must be a Property Key');\n\t}\n\tif (Type(Throw) !== 'Boolean') {\n\t\tthrow new $TypeError('Assertion failed: `Throw` must be a Boolean');\n\t}\n\tif (Throw) {\n\t\tO[P] = V; // eslint-disable-line no-param-reassign\n\t\tif (noThrowOnStrictViolation && !SameValue(O[P], V)) {\n\t\t\tthrow new $TypeError('Attempted to assign to readonly property.');\n\t\t}\n\t\treturn true;\n\t}\n\ttry {\n\t\tO[P] = V; // eslint-disable-line no-param-reassign\n\t\treturn noThrowOnStrictViolation ? SameValue(O[P], V) : true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $species = GetIntrinsic('%Symbol.species%', true);\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar IsConstructor = require('./IsConstructor');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-speciesconstructor\n\nmodule.exports = function SpeciesConstructor(O, defaultConstructor) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\tvar C = O.constructor;\n\tif (typeof C === 'undefined') {\n\t\treturn defaultConstructor;\n\t}\n\tif (Type(C) !== 'Object') {\n\t\tthrow new $TypeError('O.constructor is not an Object');\n\t}\n\tvar S = $species ? C[$species] : void 0;\n\tif (S == null) {\n\t\treturn defaultConstructor;\n\t}\n\tif (IsConstructor(S)) {\n\t\treturn S;\n\t}\n\tthrow new $TypeError('no constructor found');\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $Number = GetIntrinsic('%Number%');\nvar $RegExp = GetIntrinsic('%RegExp%');\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $parseInteger = GetIntrinsic('%parseInt%');\n\nvar callBound = require('call-bind/callBound');\nvar regexTester = require('safe-regex-test');\n\nvar $strSlice = callBound('String.prototype.slice');\nvar isBinary = regexTester(/^0b[01]+$/i);\nvar isOctal = regexTester(/^0o[0-7]+$/i);\nvar isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i);\nvar nonWS = ['\\u0085', '\\u200b', '\\ufffe'].join('');\nvar nonWSregex = new $RegExp('[' + nonWS + ']', 'g');\nvar hasNonWS = regexTester(nonWSregex);\n\nvar $trim = require('string.prototype.trim');\n\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/13.0/#sec-stringtonumber\n\nmodule.exports = function StringToNumber(argument) {\n\tif (Type(argument) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `argument` is not a String');\n\t}\n\tif (isBinary(argument)) {\n\t\treturn $Number($parseInteger($strSlice(argument, 2), 2));\n\t}\n\tif (isOctal(argument)) {\n\t\treturn $Number($parseInteger($strSlice(argument, 2), 8));\n\t}\n\tif (hasNonWS(argument) || isInvalidHexLiteral(argument)) {\n\t\treturn NaN;\n\t}\n\tvar trimmed = $trim(argument);\n\tif (trimmed !== argument) {\n\t\treturn StringToNumber(trimmed);\n\t}\n\treturn $Number(argument);\n};\n","'use strict';\n\n// http://262.ecma-international.org/5.1/#sec-9.2\n\nmodule.exports = function ToBoolean(value) { return !!value; };\n","'use strict';\n\nvar ToNumber = require('./ToNumber');\nvar truncate = require('./truncate');\n\nvar $isNaN = require('../helpers/isNaN');\nvar $isFinite = require('../helpers/isFinite');\n\n// https://262.ecma-international.org/14.0/#sec-tointegerorinfinity\n\nmodule.exports = function ToIntegerOrInfinity(value) {\n\tvar number = ToNumber(value);\n\tif ($isNaN(number) || number === 0) { return 0; }\n\tif (!$isFinite(number)) { return number; }\n\treturn truncate(number);\n};\n","'use strict';\n\nvar MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');\n\nvar ToIntegerOrInfinity = require('./ToIntegerOrInfinity');\n\nmodule.exports = function ToLength(argument) {\n\tvar len = ToIntegerOrInfinity(argument);\n\tif (len <= 0) { return 0; } // includes converting -0 to +0\n\tif (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; }\n\treturn len;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $Number = GetIntrinsic('%Number%');\nvar isPrimitive = require('../helpers/isPrimitive');\n\nvar ToPrimitive = require('./ToPrimitive');\nvar StringToNumber = require('./StringToNumber');\n\n// https://262.ecma-international.org/13.0/#sec-tonumber\n\nmodule.exports = function ToNumber(argument) {\n\tvar value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number);\n\tif (typeof value === 'symbol') {\n\t\tthrow new $TypeError('Cannot convert a Symbol value to a number');\n\t}\n\tif (typeof value === 'bigint') {\n\t\tthrow new $TypeError('Conversion from \\'BigInt\\' to \\'number\\' is not allowed.');\n\t}\n\tif (typeof value === 'string') {\n\t\treturn StringToNumber(value);\n\t}\n\treturn $Number(value);\n};\n","'use strict';\n\nvar toPrimitive = require('es-to-primitive/es2015');\n\n// https://262.ecma-international.org/6.0/#sec-toprimitive\n\nmodule.exports = function ToPrimitive(input) {\n\tif (arguments.length > 1) {\n\t\treturn toPrimitive(input, arguments[1]);\n\t}\n\treturn toPrimitive(input);\n};\n","'use strict';\n\nvar has = require('has');\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar Type = require('./Type');\nvar ToBoolean = require('./ToBoolean');\nvar IsCallable = require('./IsCallable');\n\n// https://262.ecma-international.org/5.1/#sec-8.10.5\n\nmodule.exports = function ToPropertyDescriptor(Obj) {\n\tif (Type(Obj) !== 'Object') {\n\t\tthrow new $TypeError('ToPropertyDescriptor requires an object');\n\t}\n\n\tvar desc = {};\n\tif (has(Obj, 'enumerable')) {\n\t\tdesc['[[Enumerable]]'] = ToBoolean(Obj.enumerable);\n\t}\n\tif (has(Obj, 'configurable')) {\n\t\tdesc['[[Configurable]]'] = ToBoolean(Obj.configurable);\n\t}\n\tif (has(Obj, 'value')) {\n\t\tdesc['[[Value]]'] = Obj.value;\n\t}\n\tif (has(Obj, 'writable')) {\n\t\tdesc['[[Writable]]'] = ToBoolean(Obj.writable);\n\t}\n\tif (has(Obj, 'get')) {\n\t\tvar getter = Obj.get;\n\t\tif (typeof getter !== 'undefined' && !IsCallable(getter)) {\n\t\t\tthrow new $TypeError('getter must be a function');\n\t\t}\n\t\tdesc['[[Get]]'] = getter;\n\t}\n\tif (has(Obj, 'set')) {\n\t\tvar setter = Obj.set;\n\t\tif (typeof setter !== 'undefined' && !IsCallable(setter)) {\n\t\t\tthrow new $TypeError('setter must be a function');\n\t\t}\n\t\tdesc['[[Set]]'] = setter;\n\t}\n\n\tif ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) {\n\t\tthrow new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');\n\t}\n\treturn desc;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $String = GetIntrinsic('%String%');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// https://262.ecma-international.org/6.0/#sec-tostring\n\nmodule.exports = function ToString(argument) {\n\tif (typeof argument === 'symbol') {\n\t\tthrow new $TypeError('Cannot convert a Symbol value to a string');\n\t}\n\treturn $String(argument);\n};\n","'use strict';\n\nvar ES5Type = require('../5/Type');\n\n// https://262.ecma-international.org/11.0/#sec-ecmascript-data-types-and-values\n\nmodule.exports = function Type(x) {\n\tif (typeof x === 'symbol') {\n\t\treturn 'Symbol';\n\t}\n\tif (typeof x === 'bigint') {\n\t\treturn 'BigInt';\n\t}\n\treturn ES5Type(x);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $fromCharCode = GetIntrinsic('%String.fromCharCode%');\n\nvar isLeadingSurrogate = require('../helpers/isLeadingSurrogate');\nvar isTrailingSurrogate = require('../helpers/isTrailingSurrogate');\n\n// https://tc39.es/ecma262/2020/#sec-utf16decodesurrogatepair\n\nmodule.exports = function UTF16SurrogatePairToCodePoint(lead, trail) {\n\tif (!isLeadingSurrogate(lead) || !isTrailingSurrogate(trail)) {\n\t\tthrow new $TypeError('Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code');\n\t}\n\t// var cp = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;\n\treturn $fromCharCode(lead) + $fromCharCode(trail);\n};\n","'use strict';\n\nvar Type = require('./Type');\n\n// var modulo = require('./modulo');\nvar $floor = Math.floor;\n\n// http://262.ecma-international.org/11.0/#eqn-floor\n\nmodule.exports = function floor(x) {\n\t// return x - modulo(x, 1);\n\tif (Type(x) === 'BigInt') {\n\t\treturn x;\n\t}\n\treturn $floor(x);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar floor = require('./floor');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// https://262.ecma-international.org/14.0/#eqn-truncate\n\nmodule.exports = function truncate(x) {\n\tif (typeof x !== 'number' && typeof x !== 'bigint') {\n\t\tthrow new $TypeError('argument must be a Number or a BigInt');\n\t}\n\tvar result = x < 0 ? -floor(-x) : floor(x);\n\treturn result === 0 ? 0 : result; // in the spec, these are math values, so we filter out -0 here\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// http://262.ecma-international.org/5.1/#sec-9.10\n\nmodule.exports = function CheckObjectCoercible(value, optMessage) {\n\tif (value == null) {\n\t\tthrow new $TypeError(optMessage || ('Cannot call method on ' + value));\n\t}\n\treturn value;\n};\n","'use strict';\n\n// https://262.ecma-international.org/5.1/#sec-8\n\nmodule.exports = function Type(x) {\n\tif (x === null) {\n\t\treturn 'Null';\n\t}\n\tif (typeof x === 'undefined') {\n\t\treturn 'Undefined';\n\t}\n\tif (typeof x === 'function' || typeof x === 'object') {\n\t\treturn 'Object';\n\t}\n\tif (typeof x === 'number') {\n\t\treturn 'Number';\n\t}\n\tif (typeof x === 'boolean') {\n\t\treturn 'Boolean';\n\t}\n\tif (typeof x === 'string') {\n\t\treturn 'String';\n\t}\n};\n","'use strict';\n\n// TODO: remove, semver-major\n\nmodule.exports = require('get-intrinsic');\n","'use strict';\n\nvar hasPropertyDescriptors = require('has-property-descriptors');\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = hasPropertyDescriptors() && GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasArrayLengthDefineBug = hasPropertyDescriptors.hasArrayLengthDefineBug();\n\n// eslint-disable-next-line global-require\nvar isArray = hasArrayLengthDefineBug && require('../helpers/IsArray');\n\nvar callBound = require('call-bind/callBound');\n\nvar $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');\n\n// eslint-disable-next-line max-params\nmodule.exports = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) {\n\tif (!$defineProperty) {\n\t\tif (!IsDataDescriptor(desc)) {\n\t\t\t// ES3 does not support getters/setters\n\t\t\treturn false;\n\t\t}\n\t\tif (!desc['[[Configurable]]'] || !desc['[[Writable]]']) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// fallback for ES3\n\t\tif (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) {\n\t\t\t// a non-enumerable existing property\n\t\t\treturn false;\n\t\t}\n\n\t\t// property does not exist at all, or exists but is enumerable\n\t\tvar V = desc['[[Value]]'];\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tO[P] = V; // will use [[Define]]\n\t\treturn SameValue(O[P], V);\n\t}\n\tif (\n\t\thasArrayLengthDefineBug\n\t\t&& P === 'length'\n\t\t&& '[[Value]]' in desc\n\t\t&& isArray(O)\n\t\t&& O.length !== desc['[[Value]]']\n\t) {\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tO.length = desc['[[Value]]'];\n\t\treturn O.length === desc['[[Value]]'];\n\t}\n\n\t$defineProperty(O, P, FromPropertyDescriptor(desc));\n\treturn true;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $Array = GetIntrinsic('%Array%');\n\n// eslint-disable-next-line global-require\nvar toStr = !$Array.isArray && require('call-bind/callBound')('Object.prototype.toString');\n\nmodule.exports = $Array.isArray || function IsArray(argument) {\n\treturn toStr(argument) === '[object Array]';\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\n\nvar has = require('has');\nvar isInteger = require('./isInteger');\n\nvar isMatchRecord = require('./isMatchRecord');\n\nvar predicates = {\n\t// https://262.ecma-international.org/6.0/#sec-property-descriptor-specification-type\n\t'Property Descriptor': function isPropertyDescriptor(Desc) {\n\t\tvar allowed = {\n\t\t\t'[[Configurable]]': true,\n\t\t\t'[[Enumerable]]': true,\n\t\t\t'[[Get]]': true,\n\t\t\t'[[Set]]': true,\n\t\t\t'[[Value]]': true,\n\t\t\t'[[Writable]]': true\n\t\t};\n\n\t\tif (!Desc) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (var key in Desc) { // eslint-disable-line\n\t\t\tif (has(Desc, key) && !allowed[key]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tvar isData = has(Desc, '[[Value]]');\n\t\tvar IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]');\n\t\tif (isData && IsAccessor) {\n\t\t\tthrow new $TypeError('Property Descriptors may not be both accessor and data descriptors');\n\t\t}\n\t\treturn true;\n\t},\n\t// https://262.ecma-international.org/13.0/#sec-match-records\n\t'Match Record': isMatchRecord,\n\t'Iterator Record': function isIteratorRecord(value) {\n\t\treturn has(value, '[[Iterator]]') && has(value, '[[NextMethod]]') && has(value, '[[Done]]');\n\t},\n\t'PromiseCapability Record': function isPromiseCapabilityRecord(value) {\n\t\treturn !!value\n\t\t\t&& has(value, '[[Resolve]]')\n\t\t\t&& typeof value['[[Resolve]]'] === 'function'\n\t\t\t&& has(value, '[[Reject]]')\n\t\t\t&& typeof value['[[Reject]]'] === 'function'\n\t\t\t&& has(value, '[[Promise]]')\n\t\t\t&& value['[[Promise]]']\n\t\t\t&& typeof value['[[Promise]]'].then === 'function';\n\t},\n\t'AsyncGeneratorRequest Record': function isAsyncGeneratorRequestRecord(value) {\n\t\treturn !!value\n\t\t\t&& has(value, '[[Completion]]') // TODO: confirm is a completion record\n\t\t\t&& has(value, '[[Capability]]')\n\t\t\t&& predicates['PromiseCapability Record'](value['[[Capability]]']);\n\t},\n\t'RegExp Record': function isRegExpRecord(value) {\n\t\treturn value\n\t\t\t&& has(value, '[[IgnoreCase]]')\n\t\t\t&& typeof value['[[IgnoreCase]]'] === 'boolean'\n\t\t\t&& has(value, '[[Multiline]]')\n\t\t\t&& typeof value['[[Multiline]]'] === 'boolean'\n\t\t\t&& has(value, '[[DotAll]]')\n\t\t\t&& typeof value['[[DotAll]]'] === 'boolean'\n\t\t\t&& has(value, '[[Unicode]]')\n\t\t\t&& typeof value['[[Unicode]]'] === 'boolean'\n\t\t\t&& has(value, '[[CapturingGroupsCount]]')\n\t\t\t&& typeof value['[[CapturingGroupsCount]]'] === 'number'\n\t\t\t&& isInteger(value['[[CapturingGroupsCount]]'])\n\t\t\t&& value['[[CapturingGroupsCount]]'] >= 0;\n\t}\n};\n\nmodule.exports = function assertRecord(Type, recordType, argumentName, value) {\n\tvar predicate = predicates[recordType];\n\tif (typeof predicate !== 'function') {\n\t\tthrow new $SyntaxError('unknown record type: ' + recordType);\n\t}\n\tif (Type(value) !== 'Object' || !predicate(value)) {\n\t\tthrow new $TypeError(argumentName + ' must be a ' + recordType);\n\t}\n};\n","'use strict';\n\nmodule.exports = function forEach(array, callback) {\n\tfor (var i = 0; i < array.length; i += 1) {\n\t\tcallback(array[i], i, array); // eslint-disable-line callback-return\n\t}\n};\n","'use strict';\n\nmodule.exports = function fromPropertyDescriptor(Desc) {\n\tif (typeof Desc === 'undefined') {\n\t\treturn Desc;\n\t}\n\tvar obj = {};\n\tif ('[[Value]]' in Desc) {\n\t\tobj.value = Desc['[[Value]]'];\n\t}\n\tif ('[[Writable]]' in Desc) {\n\t\tobj.writable = !!Desc['[[Writable]]'];\n\t}\n\tif ('[[Get]]' in Desc) {\n\t\tobj.get = Desc['[[Get]]'];\n\t}\n\tif ('[[Set]]' in Desc) {\n\t\tobj.set = Desc['[[Set]]'];\n\t}\n\tif ('[[Enumerable]]' in Desc) {\n\t\tobj.enumerable = !!Desc['[[Enumerable]]'];\n\t}\n\tif ('[[Configurable]]' in Desc) {\n\t\tobj.configurable = !!Desc['[[Configurable]]'];\n\t}\n\treturn obj;\n};\n","'use strict';\n\nvar $isNaN = require('./isNaN');\n\nmodule.exports = function (x) { return (typeof x === 'number' || typeof x === 'bigint') && !$isNaN(x) && x !== Infinity && x !== -Infinity; };\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $abs = GetIntrinsic('%Math.abs%');\nvar $floor = GetIntrinsic('%Math.floor%');\n\nvar $isNaN = require('./isNaN');\nvar $isFinite = require('./isFinite');\n\nmodule.exports = function isInteger(argument) {\n\tif (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {\n\t\treturn false;\n\t}\n\tvar absValue = $abs(argument);\n\treturn $floor(absValue) === absValue;\n};\n\n","'use strict';\n\nmodule.exports = function isLeadingSurrogate(charCode) {\n\treturn typeof charCode === 'number' && charCode >= 0xD800 && charCode <= 0xDBFF;\n};\n","'use strict';\n\nvar has = require('has');\n\n// https://262.ecma-international.org/13.0/#sec-match-records\n\nmodule.exports = function isMatchRecord(record) {\n\treturn (\n\t\thas(record, '[[StartIndex]]')\n && has(record, '[[EndIndex]]')\n && record['[[StartIndex]]'] >= 0\n && record['[[EndIndex]]'] >= record['[[StartIndex]]']\n && String(parseInt(record['[[StartIndex]]'], 10)) === String(record['[[StartIndex]]'])\n && String(parseInt(record['[[EndIndex]]'], 10)) === String(record['[[EndIndex]]'])\n\t);\n};\n","'use strict';\n\nmodule.exports = Number.isNaN || function isNaN(a) {\n\treturn a !== a;\n};\n","'use strict';\n\nmodule.exports = function isPrimitive(value) {\n\treturn value === null || (typeof value !== 'function' && typeof value !== 'object');\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar has = require('has');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nmodule.exports = function IsPropertyDescriptor(ES, Desc) {\n\tif (ES.Type(Desc) !== 'Object') {\n\t\treturn false;\n\t}\n\tvar allowed = {\n\t\t'[[Configurable]]': true,\n\t\t'[[Enumerable]]': true,\n\t\t'[[Get]]': true,\n\t\t'[[Set]]': true,\n\t\t'[[Value]]': true,\n\t\t'[[Writable]]': true\n\t};\n\n\tfor (var key in Desc) { // eslint-disable-line no-restricted-syntax\n\t\tif (has(Desc, key) && !allowed[key]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tif (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) {\n\t\tthrow new $TypeError('Property Descriptors may not be both accessor and data descriptors');\n\t}\n\treturn true;\n};\n","'use strict';\n\nmodule.exports = function isTrailingSurrogate(charCode) {\n\treturn typeof charCode === 'number' && charCode >= 0xDC00 && charCode <= 0xDFFF;\n};\n","'use strict';\n\nmodule.exports = Number.MAX_SAFE_INTEGER || 9007199254740991; // Math.pow(2, 53) - 1;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","const debug = false;\nexport function log(...args) {\n if (debug) {\n console.log(...args);\n }\n}\n","//\n// Copyright 2021 Readium Foundation. All rights reserved.\n// Use of this source code is governed by the BSD-style license\n// available in the top-level LICENSE file of the project.\n//\nimport { log } from \"./log\";\n/**\n * Transforms a DOMRect into the zoomed coordinate system.\n *\n * See https://issues.chromium.org/issues/40391865#comment9\n */\nexport function dezoomDomRect(rect, zoomLevel) {\n return new DOMRect(rect.x / zoomLevel, rect.y / zoomLevel, rect.width / zoomLevel, rect.height / zoomLevel);\n}\n/**\n * Transforms a rect into the zoomed coordinate system.\n *\n * See https://issues.chromium.org/issues/40391865#comment9\n */\nexport function dezoomRect(rect, zoomLevel) {\n return {\n bottom: rect.bottom / zoomLevel,\n height: rect.height / zoomLevel,\n left: rect.left / zoomLevel,\n right: rect.right / zoomLevel,\n top: rect.top / zoomLevel,\n width: rect.width / zoomLevel,\n };\n}\nexport function domRectToRect(rect) {\n return {\n width: rect.width,\n height: rect.height,\n left: rect.left,\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n };\n}\nexport function getClientRectsNoOverlap(range, doNotMergeHorizontallyAlignedRects) {\n const clientRects = range.getClientRects();\n const tolerance = 1;\n const originalRects = [];\n for (const rangeClientRect of clientRects) {\n originalRects.push({\n bottom: rangeClientRect.bottom,\n height: rangeClientRect.height,\n left: rangeClientRect.left,\n right: rangeClientRect.right,\n top: rangeClientRect.top,\n width: rangeClientRect.width,\n });\n }\n const mergedRects = mergeTouchingRects(originalRects, tolerance, doNotMergeHorizontallyAlignedRects);\n const noContainedRects = removeContainedRects(mergedRects, tolerance);\n const newRects = replaceOverlapingRects(noContainedRects);\n const minArea = 2 * 2;\n for (let j = newRects.length - 1; j >= 0; j--) {\n const rect = newRects[j];\n const bigEnough = rect.width * rect.height > minArea;\n if (!bigEnough) {\n if (newRects.length > 1) {\n log(\"CLIENT RECT: remove small\");\n newRects.splice(j, 1);\n }\n else {\n log(\"CLIENT RECT: remove small, but keep otherwise empty!\");\n break;\n }\n }\n }\n log(`CLIENT RECT: reduced ${originalRects.length} --> ${newRects.length}`);\n return newRects;\n}\nfunction mergeTouchingRects(rects, tolerance, doNotMergeHorizontallyAlignedRects) {\n for (let i = 0; i < rects.length; i++) {\n for (let j = i + 1; j < rects.length; j++) {\n const rect1 = rects[i];\n const rect2 = rects[j];\n if (rect1 === rect2) {\n log(\"mergeTouchingRects rect1 === rect2 ??!\");\n continue;\n }\n const rectsLineUpVertically = almostEqual(rect1.top, rect2.top, tolerance) &&\n almostEqual(rect1.bottom, rect2.bottom, tolerance);\n const rectsLineUpHorizontally = almostEqual(rect1.left, rect2.left, tolerance) &&\n almostEqual(rect1.right, rect2.right, tolerance);\n const horizontalAllowed = !doNotMergeHorizontallyAlignedRects;\n const aligned = (rectsLineUpHorizontally && horizontalAllowed) ||\n (rectsLineUpVertically && !rectsLineUpHorizontally);\n const canMerge = aligned && rectsTouchOrOverlap(rect1, rect2, tolerance);\n if (canMerge) {\n log(`CLIENT RECT: merging two into one, VERTICAL: ${rectsLineUpVertically} HORIZONTAL: ${rectsLineUpHorizontally} (${doNotMergeHorizontallyAlignedRects})`);\n const newRects = rects.filter((rect) => {\n return rect !== rect1 && rect !== rect2;\n });\n const replacementClientRect = getBoundingRect(rect1, rect2);\n newRects.push(replacementClientRect);\n return mergeTouchingRects(newRects, tolerance, doNotMergeHorizontallyAlignedRects);\n }\n }\n }\n return rects;\n}\nfunction getBoundingRect(rect1, rect2) {\n const left = Math.min(rect1.left, rect2.left);\n const right = Math.max(rect1.right, rect2.right);\n const top = Math.min(rect1.top, rect2.top);\n const bottom = Math.max(rect1.bottom, rect2.bottom);\n return {\n bottom,\n height: bottom - top,\n left,\n right,\n top,\n width: right - left,\n };\n}\nfunction removeContainedRects(rects, tolerance) {\n const rectsToKeep = new Set(rects);\n for (const rect of rects) {\n const bigEnough = rect.width > 1 && rect.height > 1;\n if (!bigEnough) {\n log(\"CLIENT RECT: remove tiny\");\n rectsToKeep.delete(rect);\n continue;\n }\n for (const possiblyContainingRect of rects) {\n if (rect === possiblyContainingRect) {\n continue;\n }\n if (!rectsToKeep.has(possiblyContainingRect)) {\n continue;\n }\n if (rectContains(possiblyContainingRect, rect, tolerance)) {\n log(\"CLIENT RECT: remove contained\");\n rectsToKeep.delete(rect);\n break;\n }\n }\n }\n return Array.from(rectsToKeep);\n}\nfunction rectContains(rect1, rect2, tolerance) {\n return (rectContainsPoint(rect1, rect2.left, rect2.top, tolerance) &&\n rectContainsPoint(rect1, rect2.right, rect2.top, tolerance) &&\n rectContainsPoint(rect1, rect2.left, rect2.bottom, tolerance) &&\n rectContainsPoint(rect1, rect2.right, rect2.bottom, tolerance));\n}\nexport function rectContainsPoint(rect, x, y, tolerance) {\n return ((rect.left < x || almostEqual(rect.left, x, tolerance)) &&\n (rect.right > x || almostEqual(rect.right, x, tolerance)) &&\n (rect.top < y || almostEqual(rect.top, y, tolerance)) &&\n (rect.bottom > y || almostEqual(rect.bottom, y, tolerance)));\n}\nfunction replaceOverlapingRects(rects) {\n for (let i = 0; i < rects.length; i++) {\n for (let j = i + 1; j < rects.length; j++) {\n const rect1 = rects[i];\n const rect2 = rects[j];\n if (rect1 === rect2) {\n log(\"replaceOverlapingRects rect1 === rect2 ??!\");\n continue;\n }\n if (rectsTouchOrOverlap(rect1, rect2, -1)) {\n let toAdd = [];\n let toRemove;\n const subtractRects1 = rectSubtract(rect1, rect2);\n if (subtractRects1.length === 1) {\n toAdd = subtractRects1;\n toRemove = rect1;\n }\n else {\n const subtractRects2 = rectSubtract(rect2, rect1);\n if (subtractRects1.length < subtractRects2.length) {\n toAdd = subtractRects1;\n toRemove = rect1;\n }\n else {\n toAdd = subtractRects2;\n toRemove = rect2;\n }\n }\n log(`CLIENT RECT: overlap, cut one rect into ${toAdd.length}`);\n const newRects = rects.filter((rect) => {\n return rect !== toRemove;\n });\n Array.prototype.push.apply(newRects, toAdd);\n return replaceOverlapingRects(newRects);\n }\n }\n }\n return rects;\n}\nfunction rectSubtract(rect1, rect2) {\n const rectIntersected = rectIntersect(rect2, rect1);\n if (rectIntersected.height === 0 || rectIntersected.width === 0) {\n return [rect1];\n }\n const rects = [];\n {\n const rectA = {\n bottom: rect1.bottom,\n height: 0,\n left: rect1.left,\n right: rectIntersected.left,\n top: rect1.top,\n width: 0,\n };\n rectA.width = rectA.right - rectA.left;\n rectA.height = rectA.bottom - rectA.top;\n if (rectA.height !== 0 && rectA.width !== 0) {\n rects.push(rectA);\n }\n }\n {\n const rectB = {\n bottom: rectIntersected.top,\n height: 0,\n left: rectIntersected.left,\n right: rectIntersected.right,\n top: rect1.top,\n width: 0,\n };\n rectB.width = rectB.right - rectB.left;\n rectB.height = rectB.bottom - rectB.top;\n if (rectB.height !== 0 && rectB.width !== 0) {\n rects.push(rectB);\n }\n }\n {\n const rectC = {\n bottom: rect1.bottom,\n height: 0,\n left: rectIntersected.left,\n right: rectIntersected.right,\n top: rectIntersected.bottom,\n width: 0,\n };\n rectC.width = rectC.right - rectC.left;\n rectC.height = rectC.bottom - rectC.top;\n if (rectC.height !== 0 && rectC.width !== 0) {\n rects.push(rectC);\n }\n }\n {\n const rectD = {\n bottom: rect1.bottom,\n height: 0,\n left: rectIntersected.right,\n right: rect1.right,\n top: rect1.top,\n width: 0,\n };\n rectD.width = rectD.right - rectD.left;\n rectD.height = rectD.bottom - rectD.top;\n if (rectD.height !== 0 && rectD.width !== 0) {\n rects.push(rectD);\n }\n }\n return rects;\n}\nfunction rectIntersect(rect1, rect2) {\n const maxLeft = Math.max(rect1.left, rect2.left);\n const minRight = Math.min(rect1.right, rect2.right);\n const maxTop = Math.max(rect1.top, rect2.top);\n const minBottom = Math.min(rect1.bottom, rect2.bottom);\n return {\n bottom: minBottom,\n height: Math.max(0, minBottom - maxTop),\n left: maxLeft,\n right: minRight,\n top: maxTop,\n width: Math.max(0, minRight - maxLeft),\n };\n}\nfunction rectsTouchOrOverlap(rect1, rect2, tolerance) {\n return ((rect1.left < rect2.right ||\n (tolerance >= 0 && almostEqual(rect1.left, rect2.right, tolerance))) &&\n (rect2.left < rect1.right ||\n (tolerance >= 0 && almostEqual(rect2.left, rect1.right, tolerance))) &&\n (rect1.top < rect2.bottom ||\n (tolerance >= 0 && almostEqual(rect1.top, rect2.bottom, tolerance))) &&\n (rect2.top < rect1.bottom ||\n (tolerance >= 0 && almostEqual(rect2.top, rect1.bottom, tolerance))));\n}\nfunction almostEqual(a, b, tolerance) {\n return Math.abs(a - b) <= tolerance;\n}\n","/**\n * From which direction to evaluate strings or nodes: from the start of a string\n * or range seeking Forwards, or from the end seeking Backwards.\n */\nvar TrimDirection;\n(function (TrimDirection) {\n TrimDirection[TrimDirection[\"Forwards\"] = 1] = \"Forwards\";\n TrimDirection[TrimDirection[\"Backwards\"] = 2] = \"Backwards\";\n})(TrimDirection || (TrimDirection = {}));\n/**\n * Return the offset of the nearest non-whitespace character to `baseOffset`\n * within the string `text`, looking in the `direction` indicated. Return -1 if\n * no non-whitespace character exists between `baseOffset` (inclusive) and the\n * terminus of the string (start or end depending on `direction`).\n */\nfunction closestNonSpaceInString(text, baseOffset, direction) {\n const nextChar = direction === TrimDirection.Forwards ? baseOffset : baseOffset - 1;\n if (text.charAt(nextChar).trim() !== \"\") {\n // baseOffset is already valid: it points at a non-whitespace character\n return baseOffset;\n }\n let availableChars;\n let availableNonWhitespaceChars;\n if (direction === TrimDirection.Backwards) {\n availableChars = text.substring(0, baseOffset);\n availableNonWhitespaceChars = availableChars.trimEnd();\n }\n else {\n availableChars = text.substring(baseOffset);\n availableNonWhitespaceChars = availableChars.trimStart();\n }\n if (!availableNonWhitespaceChars.length) {\n return -1;\n }\n const offsetDelta = availableChars.length - availableNonWhitespaceChars.length;\n return direction === TrimDirection.Backwards\n ? baseOffset - offsetDelta\n : baseOffset + offsetDelta;\n}\n/**\n * Calculate a new Range start position (TrimDirection.Forwards) or end position\n * (Backwards) for `range` that represents the nearest non-whitespace character,\n * moving into the `range` away from the relevant initial boundary node towards\n * the terminating boundary node.\n *\n * @throws {RangeError} If no text node with non-whitespace characters found\n */\nfunction closestNonSpaceInRange(range, direction) {\n const nodeIter = range.commonAncestorContainer.ownerDocument.createNodeIterator(range.commonAncestorContainer, NodeFilter.SHOW_TEXT);\n const initialBoundaryNode = direction === TrimDirection.Forwards\n ? range.startContainer\n : range.endContainer;\n const terminalBoundaryNode = direction === TrimDirection.Forwards\n ? range.endContainer\n : range.startContainer;\n let currentNode = nodeIter.nextNode();\n // Advance the NodeIterator to the `initialBoundaryNode`\n while (currentNode && currentNode !== initialBoundaryNode) {\n currentNode = nodeIter.nextNode();\n }\n if (direction === TrimDirection.Backwards) {\n // Reverse the NodeIterator direction. This will return the same node\n // as the previous `nextNode()` call (initial boundary node).\n currentNode = nodeIter.previousNode();\n }\n let trimmedOffset = -1;\n const advance = () => {\n currentNode =\n direction === TrimDirection.Forwards\n ? nodeIter.nextNode()\n : nodeIter.previousNode();\n if (currentNode) {\n const nodeText = currentNode.textContent;\n const baseOffset = direction === TrimDirection.Forwards ? 0 : nodeText.length;\n trimmedOffset = closestNonSpaceInString(nodeText, baseOffset, direction);\n }\n };\n while (currentNode &&\n trimmedOffset === -1 &&\n currentNode !== terminalBoundaryNode) {\n advance();\n }\n if (currentNode && trimmedOffset >= 0) {\n return { node: currentNode, offset: trimmedOffset };\n }\n /* istanbul ignore next */\n throw new RangeError(\"No text nodes with non-whitespace text found in range\");\n}\n/**\n * Return a new DOM Range that adjusts the start and end positions of `range` as\n * needed such that:\n *\n * - `startContainer` and `endContainer` text nodes both contain at least one\n * non-whitespace character within the Range's text content\n * - `startOffset` and `endOffset` both reference non-whitespace characters,\n * with `startOffset` immediately before the first non-whitespace character\n * and `endOffset` immediately after the last\n *\n * Whitespace characters are those that are removed by `String.prototype.trim()`\n *\n * @param range - A DOM Range that whose `startContainer` and `endContainer` are\n * both text nodes, and which contains at least one non-whitespace character.\n * @throws {RangeError}\n */\nexport function trimRange(range) {\n if (!range.toString().trim().length) {\n throw new RangeError(\"Range contains no non-whitespace text\");\n }\n if (range.startContainer.nodeType !== Node.TEXT_NODE) {\n throw new RangeError(\"Range startContainer is not a text node\");\n }\n if (range.endContainer.nodeType !== Node.TEXT_NODE) {\n throw new RangeError(\"Range endContainer is not a text node\");\n }\n const trimmedRange = range.cloneRange();\n let startTrimmed = false;\n let endTrimmed = false;\n const trimmedOffsets = {\n start: closestNonSpaceInString(range.startContainer.textContent, range.startOffset, TrimDirection.Forwards),\n end: closestNonSpaceInString(range.endContainer.textContent, range.endOffset, TrimDirection.Backwards),\n };\n if (trimmedOffsets.start >= 0) {\n trimmedRange.setStart(range.startContainer, trimmedOffsets.start);\n startTrimmed = true;\n }\n // Note: An offset of 0 is invalid for an end offset, as no text in the\n // node would be included in the range.\n if (trimmedOffsets.end > 0) {\n trimmedRange.setEnd(range.endContainer, trimmedOffsets.end);\n endTrimmed = true;\n }\n if (startTrimmed && endTrimmed) {\n return trimmedRange;\n }\n if (!startTrimmed) {\n // There are no (non-whitespace) characters between `startOffset` and the\n // end of the `startContainer` node.\n const { node, offset } = closestNonSpaceInRange(trimmedRange, TrimDirection.Forwards);\n if (node && offset >= 0) {\n trimmedRange.setStart(node, offset);\n }\n }\n if (!endTrimmed) {\n // There are no (non-whitespace) characters between the start of the Range's\n // `endContainer` text content and the `endOffset`.\n const { node, offset } = closestNonSpaceInRange(trimmedRange, TrimDirection.Backwards);\n if (node && offset > 0) {\n trimmedRange.setEnd(node, offset);\n }\n }\n return trimmedRange;\n}\n","import { trimRange } from \"./trim-range\";\n/**\n * Return the combined length of text nodes contained in `node`.\n */\nfunction nodeTextLength(node) {\n var _a, _b;\n switch (node.nodeType) {\n case Node.ELEMENT_NODE:\n case Node.TEXT_NODE:\n // nb. `textContent` excludes text in comments and processing instructions\n // when called on a parent element, so we don't need to subtract that here.\n return (_b = (_a = node.textContent) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;\n default:\n return 0;\n }\n}\n/**\n * Return the total length of the text of all previous siblings of `node`.\n */\nfunction previousSiblingsTextLength(node) {\n let sibling = node.previousSibling;\n let length = 0;\n while (sibling) {\n length += nodeTextLength(sibling);\n sibling = sibling.previousSibling;\n }\n return length;\n}\n/**\n * Resolve one or more character offsets within an element to (text node,\n * position) pairs.\n *\n * @param element\n * @param offsets - Offsets, which must be sorted in ascending order\n * @throws {RangeError}\n */\nfunction resolveOffsets(element, ...offsets) {\n let nextOffset = offsets.shift();\n const nodeIter = element.ownerDocument.createNodeIterator(element, NodeFilter.SHOW_TEXT);\n const results = [];\n let currentNode = nodeIter.nextNode();\n let textNode;\n let length = 0;\n // Find the text node containing the `nextOffset`th character from the start\n // of `element`.\n while (nextOffset !== undefined && currentNode) {\n textNode = currentNode;\n if (length + textNode.data.length > nextOffset) {\n results.push({ node: textNode, offset: nextOffset - length });\n nextOffset = offsets.shift();\n }\n else {\n currentNode = nodeIter.nextNode();\n length += textNode.data.length;\n }\n }\n // Boundary case.\n while (nextOffset !== undefined && textNode && length === nextOffset) {\n results.push({ node: textNode, offset: textNode.data.length });\n nextOffset = offsets.shift();\n }\n if (nextOffset !== undefined) {\n throw new RangeError(\"Offset exceeds text length\");\n }\n return results;\n}\n/**\n * When resolving a TextPosition, specifies the direction to search for the\n * nearest text node if `offset` is `0` and the element has no text.\n */\nexport var ResolveDirection;\n(function (ResolveDirection) {\n ResolveDirection[ResolveDirection[\"FORWARDS\"] = 1] = \"FORWARDS\";\n ResolveDirection[ResolveDirection[\"BACKWARDS\"] = 2] = \"BACKWARDS\";\n})(ResolveDirection || (ResolveDirection = {}));\n/**\n * Represents an offset within the text content of an element.\n *\n * This position can be resolved to a specific descendant node in the current\n * DOM subtree of the element using the `resolve` method.\n */\nexport class TextPosition {\n constructor(element, offset) {\n if (offset < 0) {\n throw new Error(\"Offset is invalid\");\n }\n /** Element that `offset` is relative to. */\n this.element = element;\n /** Character offset from the start of the element's `textContent`. */\n this.offset = offset;\n }\n /**\n * Return a copy of this position with offset relative to a given ancestor\n * element.\n *\n * @param parent - Ancestor of `this.element`\n */\n relativeTo(parent) {\n if (!parent.contains(this.element)) {\n throw new Error(\"Parent is not an ancestor of current element\");\n }\n let el = this.element;\n let offset = this.offset;\n while (el !== parent) {\n offset += previousSiblingsTextLength(el);\n el = el.parentElement;\n }\n return new TextPosition(el, offset);\n }\n /**\n * Resolve the position to a specific text node and offset within that node.\n *\n * Throws if `this.offset` exceeds the length of the element's text. In the\n * case where the element has no text and `this.offset` is 0, the `direction`\n * option determines what happens.\n *\n * Offsets at the boundary between two nodes are resolved to the start of the\n * node that begins at the boundary.\n *\n * @param options.direction - Specifies in which direction to search for the\n * nearest text node if `this.offset` is `0` and\n * `this.element` has no text. If not specified an\n * error is thrown.\n *\n * @throws {RangeError}\n */\n resolve(options = {}) {\n try {\n return resolveOffsets(this.element, this.offset)[0];\n }\n catch (err) {\n if (this.offset === 0 && options.direction !== undefined) {\n const tw = document.createTreeWalker(this.element.getRootNode(), NodeFilter.SHOW_TEXT);\n tw.currentNode = this.element;\n const forwards = options.direction === ResolveDirection.FORWARDS;\n const text = forwards\n ? tw.nextNode()\n : tw.previousNode();\n if (!text) {\n throw err;\n }\n return { node: text, offset: forwards ? 0 : text.data.length };\n }\n else {\n throw err;\n }\n }\n }\n /**\n * Construct a `TextPosition` that refers to the `offset`th character within\n * `node`.\n */\n static fromCharOffset(node, offset) {\n switch (node.nodeType) {\n case Node.TEXT_NODE:\n return TextPosition.fromPoint(node, offset);\n case Node.ELEMENT_NODE:\n return new TextPosition(node, offset);\n default:\n throw new Error(\"Node is not an element or text node\");\n }\n }\n /**\n * Construct a `TextPosition` representing the range start or end point (node, offset).\n *\n * @param node\n * @param offset - Offset within the node\n */\n static fromPoint(node, offset) {\n switch (node.nodeType) {\n case Node.TEXT_NODE: {\n if (offset < 0 || offset > node.data.length) {\n throw new Error(\"Text node offset is out of range\");\n }\n if (!node.parentElement) {\n throw new Error(\"Text node has no parent\");\n }\n // Get the offset from the start of the parent element.\n const textOffset = previousSiblingsTextLength(node) + offset;\n return new TextPosition(node.parentElement, textOffset);\n }\n case Node.ELEMENT_NODE: {\n if (offset < 0 || offset > node.childNodes.length) {\n throw new Error(\"Child node offset is out of range\");\n }\n // Get the text length before the `offset`th child of element.\n let textOffset = 0;\n for (let i = 0; i < offset; i++) {\n textOffset += nodeTextLength(node.childNodes[i]);\n }\n return new TextPosition(node, textOffset);\n }\n default:\n throw new Error(\"Point is not in an element or text node\");\n }\n }\n}\n/**\n * Represents a region of a document as a (start, end) pair of `TextPosition` points.\n *\n * Representing a range in this way allows for changes in the DOM content of the\n * range which don't affect its text content, without affecting the text content\n * of the range itself.\n */\nexport class TextRange {\n constructor(start, end) {\n this.start = start;\n this.end = end;\n }\n /**\n * Create a new TextRange whose `start` and `end` are computed relative to\n * `element`. `element` must be an ancestor of both `start.element` and\n * `end.element`.\n */\n relativeTo(element) {\n return new TextRange(this.start.relativeTo(element), this.end.relativeTo(element));\n }\n /**\n * Resolve this TextRange to a (DOM) Range.\n *\n * The resulting DOM Range will always start and end in a `Text` node.\n * Hence `TextRange.fromRange(range).toRange()` can be used to \"shrink\" a\n * range to the text it contains.\n *\n * May throw if the `start` or `end` positions cannot be resolved to a range.\n */\n toRange() {\n let start;\n let end;\n if (this.start.element === this.end.element &&\n this.start.offset <= this.end.offset) {\n // Fast path for start and end points in same element.\n [start, end] = resolveOffsets(this.start.element, this.start.offset, this.end.offset);\n }\n else {\n start = this.start.resolve({\n direction: ResolveDirection.FORWARDS,\n });\n end = this.end.resolve({ direction: ResolveDirection.BACKWARDS });\n }\n const range = new Range();\n range.setStart(start.node, start.offset);\n range.setEnd(end.node, end.offset);\n return range;\n }\n /**\n * Create a TextRange from a (DOM) Range\n */\n static fromRange(range) {\n const start = TextPosition.fromPoint(range.startContainer, range.startOffset);\n const end = TextPosition.fromPoint(range.endContainer, range.endOffset);\n return new TextRange(start, end);\n }\n /**\n * Create a TextRange representing the `start`th to `end`th characters in\n * `root`\n */\n static fromOffsets(root, start, end) {\n return new TextRange(new TextPosition(root, start), new TextPosition(root, end));\n }\n /**\n * Return a new Range representing `range` trimmed of any leading or trailing\n * whitespace\n */\n static trimmedRange(range) {\n return trimRange(TextRange.fromRange(range).toRange());\n }\n}\n","import approxSearch from \"approx-string-match\";\n/**\n * Find the best approximate matches for `str` in `text` allowing up to\n * `maxErrors` errors.\n */\nfunction search(text, str, maxErrors) {\n // Do a fast search for exact matches. The `approx-string-match` library\n // doesn't currently incorporate this optimization itself.\n let matchPos = 0;\n const exactMatches = [];\n while (matchPos !== -1) {\n matchPos = text.indexOf(str, matchPos);\n if (matchPos !== -1) {\n exactMatches.push({\n start: matchPos,\n end: matchPos + str.length,\n errors: 0,\n });\n matchPos += 1;\n }\n }\n if (exactMatches.length > 0) {\n return exactMatches;\n }\n // If there are no exact matches, do a more expensive search for matches\n // with errors.\n return approxSearch(text, str, maxErrors);\n}\n/**\n * Compute a score between 0 and 1.0 for the similarity between `text` and `str`.\n */\nfunction textMatchScore(text, str) {\n // `search` will return no matches if either the text or pattern is empty,\n // otherwise it will return at least one match if the max allowed error count\n // is at least `str.length`.\n if (str.length === 0 || text.length === 0) {\n return 0.0;\n }\n const matches = search(text, str, str.length);\n // prettier-ignore\n return 1 - (matches[0].errors / str.length);\n}\n/**\n * Find the best approximate match for `quote` in `text`.\n *\n * @param text - Document text to search\n * @param quote - String to find within `text`\n * @param context - Context in which the quote originally appeared. This is\n * used to choose the best match.\n * @return `null` if no match exceeding the minimum quality threshold was found.\n */\nexport function matchQuote(text, quote, context = {}) {\n if (quote.length === 0) {\n return null;\n }\n // Choose the maximum number of errors to allow for the initial search.\n // This choice involves a tradeoff between:\n //\n // - Recall (proportion of \"good\" matches found)\n // - Precision (proportion of matches found which are \"good\")\n // - Cost of the initial search and of processing the candidate matches [1]\n //\n // [1] Specifically, the expected-time complexity of the initial search is\n // `O((maxErrors / 32) * text.length)`. See `approx-string-match` docs.\n const maxErrors = Math.min(256, quote.length / 2);\n // Find the closest matches for `quote` in `text` based on edit distance.\n const matches = search(text, quote, maxErrors);\n if (matches.length === 0) {\n return null;\n }\n /**\n * Compute a score between 0 and 1.0 for a match candidate.\n */\n const scoreMatch = (match) => {\n const quoteWeight = 50; // Similarity of matched text to quote.\n const prefixWeight = 20; // Similarity of text before matched text to `context.prefix`.\n const suffixWeight = 20; // Similarity of text after matched text to `context.suffix`.\n const posWeight = 2; // Proximity to expected location. Used as a tie-breaker.\n const quoteScore = 1 - match.errors / quote.length;\n const prefixScore = context.prefix\n ? textMatchScore(text.slice(Math.max(0, match.start - context.prefix.length), match.start), context.prefix)\n : 1.0;\n const suffixScore = context.suffix\n ? textMatchScore(text.slice(match.end, match.end + context.suffix.length), context.suffix)\n : 1.0;\n let posScore = 1.0;\n if (typeof context.hint === \"number\") {\n const offset = Math.abs(match.start - context.hint);\n posScore = 1.0 - offset / text.length;\n }\n const rawScore = quoteWeight * quoteScore +\n prefixWeight * prefixScore +\n suffixWeight * suffixScore +\n posWeight * posScore;\n const maxScore = quoteWeight + prefixWeight + suffixWeight + posWeight;\n const normalizedScore = rawScore / maxScore;\n return normalizedScore;\n };\n // Rank matches based on similarity of actual and expected surrounding text\n // and actual/expected offset in the document text.\n const scoredMatches = matches.map((m) => ({\n start: m.start,\n end: m.end,\n score: scoreMatch(m),\n }));\n // Choose match with the highest score.\n scoredMatches.sort((a, b) => b.score - a.score);\n return scoredMatches[0];\n}\n","import { matchQuote } from \"./match-quote\";\nimport { TextRange, TextPosition } from \"./text-range\";\nimport { nodeFromXPath, xpathFromNode } from \"./xpath\";\n/**\n * Converts between `RangeSelector` selectors and `Range` objects.\n */\nexport class RangeAnchor {\n /**\n * @param root - A root element from which to anchor.\n * @param range - A range describing the anchor.\n */\n constructor(root, range) {\n this.root = root;\n this.range = range;\n }\n /**\n * @param root - A root element from which to anchor.\n * @param range - A range describing the anchor.\n */\n static fromRange(root, range) {\n return new RangeAnchor(root, range);\n }\n /**\n * Create an anchor from a serialized `RangeSelector` selector.\n *\n * @param root - A root element from which to anchor.\n */\n static fromSelector(root, selector) {\n const startContainer = nodeFromXPath(selector.startContainer, root);\n if (!startContainer) {\n throw new Error(\"Failed to resolve startContainer XPath\");\n }\n const endContainer = nodeFromXPath(selector.endContainer, root);\n if (!endContainer) {\n throw new Error(\"Failed to resolve endContainer XPath\");\n }\n const startPos = TextPosition.fromCharOffset(startContainer, selector.startOffset);\n const endPos = TextPosition.fromCharOffset(endContainer, selector.endOffset);\n const range = new TextRange(startPos, endPos).toRange();\n return new RangeAnchor(root, range);\n }\n toRange() {\n return this.range;\n }\n toSelector() {\n // \"Shrink\" the range so that it tightly wraps its text. This ensures more\n // predictable output for a given text selection.\n const normalizedRange = TextRange.fromRange(this.range).toRange();\n const textRange = TextRange.fromRange(normalizedRange);\n const startContainer = xpathFromNode(textRange.start.element, this.root);\n const endContainer = xpathFromNode(textRange.end.element, this.root);\n return {\n type: \"RangeSelector\",\n startContainer,\n startOffset: textRange.start.offset,\n endContainer,\n endOffset: textRange.end.offset,\n };\n }\n}\n/**\n * Converts between `TextPositionSelector` selectors and `Range` objects.\n */\nexport class TextPositionAnchor {\n constructor(root, start, end) {\n this.root = root;\n this.start = start;\n this.end = end;\n }\n static fromRange(root, range) {\n const textRange = TextRange.fromRange(range).relativeTo(root);\n return new TextPositionAnchor(root, textRange.start.offset, textRange.end.offset);\n }\n static fromSelector(root, selector) {\n return new TextPositionAnchor(root, selector.start, selector.end);\n }\n toSelector() {\n return {\n type: \"TextPositionSelector\",\n start: this.start,\n end: this.end,\n };\n }\n toRange() {\n return TextRange.fromOffsets(this.root, this.start, this.end).toRange();\n }\n}\n/**\n * Converts between `TextQuoteSelector` selectors and `Range` objects.\n */\nexport class TextQuoteAnchor {\n /**\n * @param root - A root element from which to anchor.\n */\n constructor(root, exact, context = {}) {\n this.root = root;\n this.exact = exact;\n this.context = context;\n }\n /**\n * Create a `TextQuoteAnchor` from a range.\n *\n * Will throw if `range` does not contain any text nodes.\n */\n static fromRange(root, range) {\n const text = root.textContent;\n const textRange = TextRange.fromRange(range).relativeTo(root);\n const start = textRange.start.offset;\n const end = textRange.end.offset;\n // Number of characters around the quote to capture as context. We currently\n // always use a fixed amount, but it would be better if this code was aware\n // of logical boundaries in the document (paragraph, article etc.) to avoid\n // capturing text unrelated to the quote.\n //\n // In regular prose the ideal content would often be the surrounding sentence.\n // This is a natural unit of meaning which enables displaying quotes in\n // context even when the document is not available. We could use `Intl.Segmenter`\n // for this when available.\n const contextLen = 32;\n return new TextQuoteAnchor(root, text.slice(start, end), {\n prefix: text.slice(Math.max(0, start - contextLen), start),\n suffix: text.slice(end, Math.min(text.length, end + contextLen)),\n });\n }\n static fromSelector(root, selector) {\n const { prefix, suffix } = selector;\n return new TextQuoteAnchor(root, selector.exact, { prefix, suffix });\n }\n toSelector() {\n return {\n type: \"TextQuoteSelector\",\n exact: this.exact,\n prefix: this.context.prefix,\n suffix: this.context.suffix,\n };\n }\n toRange(options = {}) {\n return this.toPositionAnchor(options).toRange();\n }\n toPositionAnchor(options = {}) {\n const text = this.root.textContent;\n const match = matchQuote(text, this.exact, Object.assign(Object.assign({}, this.context), { hint: options.hint }));\n if (!match) {\n throw new Error(\"Quote not found\");\n }\n return new TextPositionAnchor(this.root, match.start, match.end);\n }\n}\n/**\n * Parse a string containing a time offset in seconds, since the start of some\n * media, into a float.\n */\nfunction parseMediaTime(timeStr) {\n const val = parseFloat(timeStr);\n if (!Number.isFinite(val) || val < 0) {\n return null;\n }\n return val;\n}\n/** Implementation of {@link Array.prototype.findLastIndex} */\nfunction findLastIndex(ary, pred) {\n for (let i = ary.length - 1; i >= 0; i--) {\n if (pred(ary[i])) {\n return i;\n }\n }\n return -1;\n}\nfunction closestElement(node) {\n return node instanceof Element ? node : node.parentElement;\n}\n/**\n * Get the media time range associated with an element or pair of elements,\n * from `data-time-{start, end}` attributes on them.\n */\nfunction getMediaTimeRange(start, end = start) {\n var _a, _b;\n const startTime = parseMediaTime((_a = start === null || start === void 0 ? void 0 : start.getAttribute(\"data-time-start\")) !== null && _a !== void 0 ? _a : \"\");\n const endTime = parseMediaTime((_b = end === null || end === void 0 ? void 0 : end.getAttribute(\"data-time-end\")) !== null && _b !== void 0 ? _b : \"\");\n if (typeof startTime !== \"number\" ||\n typeof endTime !== \"number\" ||\n endTime < startTime) {\n return null;\n }\n return [startTime, endTime];\n}\nexport class MediaTimeAnchor {\n constructor(root, start, end) {\n this.root = root;\n this.start = start;\n this.end = end;\n }\n /**\n * Return a {@link MediaTimeAnchor} that represents a range, or `null` if\n * no time range information is present on elements in the range.\n */\n static fromRange(root, range) {\n var _a, _b;\n const start = (_a = closestElement(range.startContainer)) === null || _a === void 0 ? void 0 : _a.closest(\"[data-time-start]\");\n const end = (_b = closestElement(range.endContainer)) === null || _b === void 0 ? void 0 : _b.closest(\"[data-time-end]\");\n const timeRange = getMediaTimeRange(start, end);\n if (!timeRange) {\n return null;\n }\n const [startTime, endTime] = timeRange;\n return new MediaTimeAnchor(root, startTime, endTime);\n }\n /**\n * Convert this anchor to a DOM range.\n *\n * This returned range will start from the beginning of the element whose\n * associated time range includes `start` and continue to the end of the\n * element whose associated time range includes `end`.\n */\n toRange() {\n const segments = [...this.root.querySelectorAll(\"[data-time-start]\")]\n .map((element) => {\n const timeRange = getMediaTimeRange(element);\n if (!timeRange) {\n return null;\n }\n const [start, end] = timeRange;\n return { element, start, end };\n })\n .filter((s) => s !== null);\n segments.sort((a, b) => a.start - b.start);\n const startIdx = findLastIndex(segments, (s) => s.start <= this.start && s.end >= this.start);\n if (startIdx === -1) {\n throw new Error(\"Start segment not found\");\n }\n const endIdx = startIdx +\n segments\n .slice(startIdx)\n .findIndex((s) => s.start <= this.end && s.end >= this.end);\n if (endIdx === -1) {\n throw new Error(\"End segment not found\");\n }\n const range = new Range();\n range.setStart(segments[startIdx].element, 0);\n const endEl = segments[endIdx].element;\n range.setEnd(endEl, endEl.childNodes.length);\n return range;\n }\n static fromSelector(root, selector) {\n const { start, end } = selector;\n return new MediaTimeAnchor(root, start, end);\n }\n toSelector() {\n return {\n type: \"MediaTimeSelector\",\n start: this.start,\n end: this.end,\n };\n }\n}\n","import { log } from \"../util/log\";\nimport { getClientRectsNoOverlap, dezoomDomRect, dezoomRect, rectContainsPoint, domRectToRect, } from \"../util/rect\";\nimport { TextQuoteAnchor } from \"../vendor/hypothesis/annotator/anchoring/types\";\nexport class DecorationManager {\n constructor(window) {\n this.styles = new Map();\n this.groups = new Map();\n this.lastGroupId = 0;\n this.window = window;\n // Relayout all the decorations when the document body is resized.\n window.addEventListener(\"load\", () => {\n const body = window.document.body;\n let lastSize = { width: 0, height: 0 };\n const observer = new ResizeObserver(() => {\n requestAnimationFrame(() => {\n if (lastSize.width === body.clientWidth &&\n lastSize.height === body.clientHeight) {\n return;\n }\n lastSize = {\n width: body.clientWidth,\n height: body.clientHeight,\n };\n this.relayoutDecorations();\n });\n });\n observer.observe(body);\n }, false);\n }\n registerTemplates(templates) {\n let stylesheet = \"\";\n for (const [id, template] of templates) {\n this.styles.set(id, template);\n if (template.stylesheet) {\n stylesheet += template.stylesheet + \"\\n\";\n }\n }\n if (stylesheet) {\n const styleElement = document.createElement(\"style\");\n styleElement.innerHTML = stylesheet;\n document.getElementsByTagName(\"head\")[0].appendChild(styleElement);\n }\n }\n addDecoration(decoration, groupName) {\n console.log(`addDecoration ${decoration.id} ${groupName}`);\n const group = this.getGroup(groupName);\n group.add(decoration);\n }\n removeDecoration(id, groupName) {\n console.log(`removeDecoration ${id} ${groupName}`);\n const group = this.getGroup(groupName);\n group.remove(id);\n }\n relayoutDecorations() {\n console.log(\"relayoutDecorations\");\n for (const group of this.groups.values()) {\n group.relayout();\n }\n }\n getGroup(name) {\n let group = this.groups.get(name);\n if (!group) {\n const id = \"readium-decoration-\" + this.lastGroupId++;\n group = new DecorationGroup(id, name, this.styles);\n this.groups.set(name, group);\n }\n return group;\n }\n /**\n * Handles click events on a Decoration.\n * Returns whether a decoration matched this event.\n */\n handleDecorationClickEvent(event) {\n if (this.groups.size === 0) {\n return null;\n }\n const findTarget = () => {\n for (const [group, groupContent] of this.groups) {\n for (const item of groupContent.items.reverse()) {\n if (!item.clickableElements) {\n continue;\n }\n for (const element of item.clickableElements) {\n const rect = domRectToRect(element.getBoundingClientRect());\n if (rectContainsPoint(rect, event.clientX, event.clientY, 1)) {\n return { group, item, element };\n }\n }\n }\n }\n };\n const target = findTarget();\n if (!target) {\n return null;\n }\n return {\n id: target.item.decoration.id,\n group: target.group,\n rect: domRectToRect(target.item.range.getBoundingClientRect()),\n event: event,\n };\n }\n}\nclass DecorationGroup {\n constructor(id, name, styles) {\n this.items = [];\n this.lastItemId = 0;\n this.container = null;\n this.groupId = id;\n this.groupName = name;\n this.styles = styles;\n }\n add(decoration) {\n const id = this.groupId + \"-\" + this.lastItemId++;\n const range = rangeFromDecorationTarget(decoration.cssSelector, decoration.textQuote);\n log(`range ${range}`);\n if (!range) {\n log(\"Can't locate DOM range for decoration\", decoration);\n return;\n }\n const item = {\n id,\n decoration,\n range,\n container: null,\n clickableElements: null,\n };\n this.items.push(item);\n this.layout(item);\n }\n remove(id) {\n const index = this.items.findIndex((it) => it.decoration.id === id);\n if (index === -1) {\n return;\n }\n const item = this.items[index];\n this.items.splice(index, 1);\n item.clickableElements = null;\n if (item.container) {\n item.container.remove();\n item.container = null;\n }\n }\n relayout() {\n this.clearContainer();\n for (const item of this.items) {\n this.layout(item);\n }\n }\n /**\n * Returns the group container element, after making sure it exists.\n */\n requireContainer() {\n if (!this.container) {\n this.container = document.createElement(\"div\");\n this.container.id = this.groupId;\n this.container.dataset.group = this.groupName;\n this.container.style.pointerEvents = \"none\";\n document.body.append(this.container);\n }\n return this.container;\n }\n /**\n * Removes the group container.\n */\n clearContainer() {\n if (this.container) {\n this.container.remove();\n this.container = null;\n }\n }\n /**\n * Layouts a single Decoration item.\n */\n layout(item) {\n log(`layout ${item}`);\n const groupContainer = this.requireContainer();\n const unsafeStyle = this.styles.get(item.decoration.style);\n if (!unsafeStyle) {\n console.log(`Unknown decoration style: ${item.decoration.style}`);\n return;\n }\n const style = unsafeStyle;\n const itemContainer = document.createElement(\"div\");\n itemContainer.id = item.id;\n itemContainer.dataset.style = item.decoration.style;\n itemContainer.style.pointerEvents = \"none\";\n const documentWritingMode = getDocumentWritingMode();\n const isVertical = documentWritingMode === \"vertical-rl\" ||\n documentWritingMode === \"vertical-lr\";\n const zoom = groupContainer.currentCSSZoom;\n const scrollingElement = document.scrollingElement;\n const xOffset = scrollingElement.scrollLeft / zoom;\n const yOffset = scrollingElement.scrollTop / zoom;\n const viewportWidth = isVertical ? window.innerHeight : window.innerWidth;\n const viewportHeight = isVertical ? window.innerWidth : window.innerHeight;\n const columnCount = parseInt(getComputedStyle(document.documentElement).getPropertyValue(\"column-count\")) || 1;\n const pageSize = (isVertical ? viewportHeight : viewportWidth) / columnCount;\n function positionElement(element, rect, boundingRect, writingMode) {\n element.style.position = \"absolute\";\n const isVerticalRL = writingMode === \"vertical-rl\";\n const isVerticalLR = writingMode === \"vertical-lr\";\n if (isVerticalRL || isVerticalLR) {\n if (style.width === \"wrap\") {\n element.style.width = `${rect.width}px`;\n element.style.height = `${rect.height}px`;\n if (isVerticalRL) {\n element.style.right = `${-rect.right - xOffset + scrollingElement.clientWidth}px`;\n }\n else {\n // vertical-lr\n element.style.left = `${rect.left + xOffset}px`;\n }\n element.style.top = `${rect.top + yOffset}px`;\n }\n else if (style.width === \"viewport\") {\n element.style.width = `${rect.height}px`;\n element.style.height = `${viewportWidth}px`;\n const top = Math.floor(rect.top / viewportWidth) * viewportWidth;\n if (isVerticalRL) {\n element.style.right = `${-rect.right - xOffset}px`;\n }\n else {\n // vertical-lr\n element.style.left = `${rect.left + xOffset}px`;\n }\n element.style.top = `${top + yOffset}px`;\n }\n else if (style.width === \"bounds\") {\n element.style.width = `${boundingRect.height}px`;\n element.style.height = `${viewportWidth}px`;\n if (isVerticalRL) {\n element.style.right = `${-boundingRect.right - xOffset + scrollingElement.clientWidth}px`;\n }\n else {\n // vertical-lr\n element.style.left = `${boundingRect.left + xOffset}px`;\n }\n element.style.top = `${boundingRect.top + yOffset}px`;\n }\n else if (style.width === \"page\") {\n element.style.width = `${rect.height}px`;\n element.style.height = `${pageSize}px`;\n const top = Math.floor(rect.top / pageSize) * pageSize;\n if (isVerticalRL) {\n element.style.right = `${-rect.right - xOffset + scrollingElement.clientWidth}px`;\n }\n else {\n // vertical-lr\n element.style.left = `${rect.left + xOffset}px`;\n }\n element.style.top = `${top + yOffset}px`;\n }\n }\n else {\n if (style.width === \"wrap\") {\n element.style.width = `${rect.width}px`;\n element.style.height = `${rect.height}px`;\n element.style.left = `${rect.left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n }\n else if (style.width === \"viewport\") {\n element.style.width = `${viewportWidth}px`;\n element.style.height = `${rect.height}px`;\n const left = Math.floor(rect.left / viewportWidth) * viewportWidth;\n element.style.left = `${left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n }\n else if (style.width === \"bounds\") {\n element.style.width = `${boundingRect.width}px`;\n element.style.height = `${rect.height}px`;\n element.style.left = `${boundingRect.left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n }\n else if (style.width === \"page\") {\n element.style.width = `${pageSize}px`;\n element.style.height = `${rect.height}px`;\n const left = Math.floor(rect.left / pageSize) * pageSize;\n element.style.left = `${left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n }\n }\n }\n const rawBoundingRect = item.range.getBoundingClientRect();\n const boundingRect = dezoomDomRect(rawBoundingRect, zoom);\n let elementTemplate;\n try {\n const template = document.createElement(\"template\");\n template.innerHTML = item.decoration.element.trim();\n elementTemplate = template.content.firstElementChild;\n }\n catch (error) {\n let message;\n if (\"message\" in error) {\n message = error.message;\n }\n else {\n message = null;\n }\n console.log(`Invalid decoration element \"${item.decoration.element}\": ${message}`);\n return;\n }\n if (style.layout === \"boxes\") {\n const doNotMergeHorizontallyAlignedRects = !documentWritingMode.startsWith(\"vertical\");\n const startElement = getContainingElement(item.range.startContainer);\n // Decorated text may have a different writingMode from document body\n const decoratorWritingMode = getComputedStyle(startElement).writingMode;\n const clientRects = getClientRectsNoOverlap(item.range, doNotMergeHorizontallyAlignedRects)\n .map((rect) => {\n return dezoomRect(rect, zoom);\n })\n .sort((r1, r2) => {\n if (r1.top !== r2.top)\n return r1.top - r2.top;\n if (decoratorWritingMode === \"vertical-rl\") {\n return r2.left - r1.left;\n }\n else if (decoratorWritingMode === \"vertical-lr\") {\n return r1.left - r2.left;\n }\n else {\n return r1.left - r2.left;\n }\n });\n for (const clientRect of clientRects) {\n const line = elementTemplate.cloneNode(true);\n line.style.pointerEvents = \"none\";\n line.dataset.writingMode = decoratorWritingMode;\n positionElement(line, clientRect, boundingRect, documentWritingMode);\n itemContainer.append(line);\n }\n }\n else if (style.layout === \"bounds\") {\n const bounds = elementTemplate.cloneNode(true);\n bounds.style.pointerEvents = \"none\";\n bounds.dataset.writingMode = documentWritingMode;\n positionElement(bounds, boundingRect, boundingRect, documentWritingMode);\n itemContainer.append(bounds);\n }\n groupContainer.append(itemContainer);\n item.container = itemContainer;\n item.clickableElements = Array.from(itemContainer.querySelectorAll(\"[data-activable='1']\"));\n if (item.clickableElements.length === 0) {\n item.clickableElements = Array.from(itemContainer.children);\n }\n }\n}\n/**\n * Returns the document body's writing mode.\n */\nfunction getDocumentWritingMode() {\n return getComputedStyle(document.body).writingMode;\n}\n/**\n * Returns the closest element ancestor of the given node.\n */\nfunction getContainingElement(node) {\n return node.nodeType === Node.ELEMENT_NODE ? node : node.parentElement;\n}\n/*\n * Compute DOM range from decoration target.\n */\nexport function rangeFromDecorationTarget(cssSelector, textQuote) {\n let root;\n if (cssSelector) {\n try {\n root = document.querySelector(cssSelector);\n }\n catch (e) {\n log(e);\n }\n }\n if (!root && !textQuote) {\n return null;\n }\n else if (!root) {\n root = document.body;\n }\n if (textQuote) {\n const anchor = new TextQuoteAnchor(root, textQuote.quotedText, {\n prefix: textQuote.textBefore,\n suffix: textQuote.textAfter,\n });\n try {\n return anchor.toRange();\n }\n catch (e) {\n log(e);\n return null;\n }\n }\n else {\n const range = document.createRange();\n range.setStartBefore(root);\n range.setEndAfter(root);\n return range;\n }\n}\n","//\n// Copyright 2021 Readium Foundation. All rights reserved.\n// Use of this source code is governed by the BSD-style license\n// available in the top-level LICENSE file of the project.\n//\nimport { dezoomRect, domRectToRect } from \"../util/rect\";\nimport { log } from \"../util/log\";\nimport { TextRange } from \"../vendor/hypothesis/annotator/anchoring/text-range\";\n// Polyfill for Android API 26\nimport matchAll from \"string.prototype.matchall\";\nimport { rectToParentCoordinates } from \"./geometry\";\nmatchAll.shim();\nexport class SelectionReporter {\n constructor(window, listener) {\n this.isSelecting = false;\n document.addEventListener(\"selectionchange\", \n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n (event) => {\n var _a;\n const collapsed = (_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.isCollapsed;\n if (collapsed && this.isSelecting) {\n this.isSelecting = false;\n listener.onSelectionEnd();\n }\n else if (!collapsed && !this.isSelecting) {\n this.isSelecting = true;\n listener.onSelectionStart();\n }\n }, false);\n }\n}\nexport function selectionToParentCoordinates(selection, iframe) {\n const boundingRect = iframe.getBoundingClientRect();\n const shiftedRect = rectToParentCoordinates(selection.selectionRect, boundingRect);\n return {\n selectedText: selection === null || selection === void 0 ? void 0 : selection.selectedText,\n selectionRect: shiftedRect,\n textBefore: selection.textBefore,\n textAfter: selection.textAfter,\n };\n}\nexport class SelectionManager {\n constructor(window) {\n this.isSelecting = false;\n //, listener: SelectionListener) {\n this.window = window;\n /*this.listener = listener\n document.addEventListener(\n \"selectionchange\",\n () => {\n const selection = window.getSelection()!\n const collapsed = selection.isCollapsed\n \n if (collapsed && this.isSelecting) {\n this.isSelecting = false\n this.listener.onSelectionEnd()\n } else if (!collapsed && !this.isSelecting) {\n this.isSelecting = true\n this.listener.onSelectionStart()\n }\n },\n false\n )*/\n }\n clearSelection() {\n var _a;\n (_a = this.window.getSelection()) === null || _a === void 0 ? void 0 : _a.removeAllRanges();\n }\n getCurrentSelection() {\n const text = this.getCurrentSelectionText();\n if (!text) {\n return null;\n }\n const rect = this.getSelectionRect();\n return {\n selectedText: text.highlight,\n textBefore: text.before,\n textAfter: text.after,\n selectionRect: rect,\n };\n }\n getSelectionRect() {\n try {\n const selection = this.window.getSelection();\n const range = selection.getRangeAt(0);\n const zoom = this.window.document.body.currentCSSZoom;\n return dezoomRect(domRectToRect(range.getBoundingClientRect()), zoom);\n }\n catch (e) {\n log(e);\n throw e;\n //return null\n }\n }\n getCurrentSelectionText() {\n const selection = this.window.getSelection();\n if (selection.isCollapsed) {\n return undefined;\n }\n const highlight = selection.toString();\n const cleanHighlight = highlight\n .trim()\n .replace(/\\n/g, \" \")\n .replace(/\\s\\s+/g, \" \");\n if (cleanHighlight.length === 0) {\n return undefined;\n }\n if (!selection.anchorNode || !selection.focusNode) {\n return undefined;\n }\n const range = selection.rangeCount === 1\n ? selection.getRangeAt(0)\n : createOrderedRange(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);\n if (!range || range.collapsed) {\n log(\"$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!\");\n return undefined;\n }\n const text = document.body.textContent;\n const textRange = TextRange.fromRange(range).relativeTo(document.body);\n const start = textRange.start.offset;\n const end = textRange.end.offset;\n const snippetLength = 200;\n // Compute the text before the highlight, ignoring the first \"word\", which might be cut.\n let before = text.slice(Math.max(0, start - snippetLength), start);\n const firstWordStart = before.search(/\\P{L}\\p{L}/gu);\n if (firstWordStart !== -1) {\n before = before.slice(firstWordStart + 1);\n }\n // Compute the text after the highlight, ignoring the last \"word\", which might be cut.\n let after = text.slice(end, Math.min(text.length, end + snippetLength));\n const lastWordEnd = Array.from(after.matchAll(/\\p{L}\\P{L}/gu)).pop();\n if (lastWordEnd !== undefined && lastWordEnd.index > 1) {\n after = after.slice(0, lastWordEnd.index + 1);\n }\n return { highlight, before, after };\n }\n}\nfunction createOrderedRange(startNode, startOffset, endNode, endOffset) {\n const range = new Range();\n range.setStart(startNode, startOffset);\n range.setEnd(endNode, endOffset);\n if (!range.collapsed) {\n return range;\n }\n log(\">>> createOrderedRange COLLAPSED ... RANGE REVERSE?\");\n const rangeReverse = new Range();\n rangeReverse.setStart(endNode, endOffset);\n rangeReverse.setEnd(startNode, startOffset);\n if (!rangeReverse.collapsed) {\n log(\">>> createOrderedRange RANGE REVERSE OK.\");\n return range;\n }\n log(\">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!\");\n return undefined;\n}\n/*\nexport function convertRangeInfo(document: Document, rangeInfo) {\n const startElement = document.querySelector(\n rangeInfo.startContainerElementCssSelector\n );\n if (!startElement) {\n log(\"^^^ convertRangeInfo NO START ELEMENT CSS SELECTOR?!\");\n return undefined;\n }\n let startContainer = startElement;\n if (rangeInfo.startContainerChildTextNodeIndex >= 0) {\n if (\n rangeInfo.startContainerChildTextNodeIndex >=\n startElement.childNodes.length\n ) {\n log(\n \"^^^ convertRangeInfo rangeInfo.startContainerChildTextNodeIndex >= startElement.childNodes.length?!\"\n );\n return undefined;\n }\n startContainer =\n startElement.childNodes[rangeInfo.startContainerChildTextNodeIndex];\n if (startContainer.nodeType !== Node.TEXT_NODE) {\n log(\"^^^ convertRangeInfo startContainer.nodeType !== Node.TEXT_NODE?!\");\n return undefined;\n }\n }\n const endElement = document.querySelector(\n rangeInfo.endContainerElementCssSelector\n );\n if (!endElement) {\n log(\"^^^ convertRangeInfo NO END ELEMENT CSS SELECTOR?!\");\n return undefined;\n }\n let endContainer = endElement;\n if (rangeInfo.endContainerChildTextNodeIndex >= 0) {\n if (\n rangeInfo.endContainerChildTextNodeIndex >= endElement.childNodes.length\n ) {\n log(\n \"^^^ convertRangeInfo rangeInfo.endContainerChildTextNodeIndex >= endElement.childNodes.length?!\"\n );\n return undefined;\n }\n endContainer =\n endElement.childNodes[rangeInfo.endContainerChildTextNodeIndex];\n if (endContainer.nodeType !== Node.TEXT_NODE) {\n log(\"^^^ convertRangeInfo endContainer.nodeType !== Node.TEXT_NODE?!\");\n return undefined;\n }\n }\n return createOrderedRange(\n startContainer,\n rangeInfo.startOffset,\n endContainer,\n rangeInfo.endOffset\n );\n}\n\nexport function location2RangeInfo(location) {\n const locations = location.locations;\n const domRange = locations.domRange;\n const start = domRange.start;\n const end = domRange.end;\n\n return {\n endContainerChildTextNodeIndex: end.textNodeIndex,\n endContainerElementCssSelector: end.cssSelector,\n endOffset: end.offset,\n startContainerChildTextNodeIndex: start.textNodeIndex,\n startContainerElementCssSelector: start.cssSelector,\n startOffset: start.offset,\n };\n}\n*/\n","export class DecorationWrapperParentSide {\n setMessagePort(messagePort) {\n this.messagePort = messagePort;\n }\n registerTemplates(templates) {\n this.send({ kind: \"registerTemplates\", templates });\n }\n addDecoration(decoration, group) {\n this.send({ kind: \"addDecoration\", decoration, group });\n }\n removeDecoration(id, group) {\n this.send({ kind: \"removeDecoration\", id, group });\n }\n send(message) {\n var _a;\n (_a = this.messagePort) === null || _a === void 0 ? void 0 : _a.postMessage(message);\n }\n}\nexport class DecorationWrapperIframeSide {\n constructor(messagePort, decorationManager) {\n this.decorationManager = decorationManager;\n messagePort.onmessage = (message) => {\n this.onCommand(message.data);\n };\n }\n onCommand(command) {\n switch (command.kind) {\n case \"registerTemplates\":\n return this.registerTemplates(command.templates);\n case \"addDecoration\":\n return this.addDecoration(command.decoration, command.group);\n case \"removeDecoration\":\n return this.removeDecoration(command.id, command.group);\n }\n }\n registerTemplates(templates) {\n this.decorationManager.registerTemplates(templates);\n }\n addDecoration(decoration, group) {\n this.decorationManager.addDecoration(decoration, group);\n }\n removeDecoration(id, group) {\n this.decorationManager.removeDecoration(id, group);\n }\n}\n","export class IframeMessageSender {\n constructor(messagePort) {\n this.messagePort = messagePort;\n }\n send(message) {\n this.messagePort.postMessage(message);\n }\n}\n","export class SelectionWrapperParentSide {\n constructor(listener) {\n this.selectionListener = listener;\n }\n setMessagePort(messagePort) {\n this.messagePort = messagePort;\n messagePort.onmessage = (message) => {\n this.onFeedback(message.data);\n };\n }\n requestSelection(requestId) {\n this.send({ kind: \"requestSelection\", requestId: requestId });\n }\n clearSelection() {\n this.send({ kind: \"clearSelection\" });\n }\n onFeedback(feedback) {\n switch (feedback.kind) {\n case \"selectionAvailable\":\n return this.onSelectionAvailable(feedback.requestId, feedback.selection);\n }\n }\n onSelectionAvailable(requestId, selection) {\n this.selectionListener.onSelectionAvailable(requestId, selection);\n }\n send(message) {\n var _a;\n (_a = this.messagePort) === null || _a === void 0 ? void 0 : _a.postMessage(message);\n }\n}\nexport class SelectionWrapperIframeSide {\n constructor(messagePort, manager) {\n this.selectionManager = manager;\n this.messagePort = messagePort;\n messagePort.onmessage = (message) => {\n this.onCommand(message.data);\n };\n }\n onCommand(command) {\n switch (command.kind) {\n case \"requestSelection\":\n return this.onRequestSelection(command.requestId);\n case \"clearSelection\":\n return this.onClearSelection();\n }\n }\n onRequestSelection(requestId) {\n const selection = this.selectionManager.getCurrentSelection();\n const feedback = {\n kind: \"selectionAvailable\",\n requestId: requestId,\n selection: selection,\n };\n this.sendFeedback(feedback);\n }\n onClearSelection() {\n this.selectionManager.clearSelection();\n }\n sendFeedback(message) {\n this.messagePort.postMessage(message);\n }\n}\n","//\n// Copyright 2024 Readium Foundation. All rights reserved.\n// Use of this source code is governed by the BSD-style license\n// available in the top-level LICENSE file of the project.\n//\n/**\n * Script loaded by fixed layout resources.\n */\nimport { DecorationManager, } from \"./common/decoration\";\nimport { GesturesDetector } from \"./common/gestures\";\nimport { SelectionManager } from \"./common/selection\";\nimport { parseViewportString } from \"./util/viewport\";\nimport { FixedInitializerIframeSide } from \"./bridge/all-initialization-bridge\";\nconst initializer = new FixedInitializerIframeSide(window);\nconst messageSender = initializer.initAreaManager();\nconst selectionManager = new SelectionManager(window);\ninitializer.initSelection(selectionManager);\nconst decorationManager = new DecorationManager(window);\ninitializer.initDecorations(decorationManager);\nconst viewportSize = parseContentSize(window.document);\nmessageSender.send({ kind: \"contentSize\", size: viewportSize });\nclass MessagingGesturesListener {\n constructor(messageSender) {\n this.messageSender = messageSender;\n }\n onTap(gestureEvent) {\n const event = {\n offset: { x: gestureEvent.clientX, y: gestureEvent.clientY },\n };\n this.messageSender.send({ kind: \"tap\", event: event });\n }\n onLinkActivated(href, outerHtml) {\n this.messageSender.send({\n kind: \"linkActivated\",\n href: href,\n outerHtml: outerHtml,\n });\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onDecorationActivated(gestureEvent) {\n const event = {\n id: gestureEvent.id,\n group: gestureEvent.group,\n rect: gestureEvent.rect,\n offset: { x: gestureEvent.event.clientX, y: gestureEvent.event.clientY },\n };\n this.messageSender.send({\n kind: \"decorationActivated\",\n event: event,\n });\n }\n}\nconst messagingListener = new MessagingGesturesListener(messageSender);\nnew GesturesDetector(window, messagingListener, decorationManager);\nfunction parseContentSize(document) {\n const viewport = document.querySelector(\"meta[name=viewport]\");\n if (!viewport || !(viewport instanceof HTMLMetaElement)) {\n return undefined;\n }\n return parseViewportString(viewport.content);\n}\n","import { DecorationWrapperIframeSide } from \"../fixed/decoration-wrapper\";\nimport { IframeMessageSender } from \"../fixed/iframe-message\";\nimport { SelectionWrapperIframeSide } from \"../fixed/selection-wrapper\";\nexport class FixedSingleInitializationBridge {\n constructor(window, listener, iframe, areaBridge, selectionBridge, decorationsBridge) {\n this.window = window;\n this.listener = listener;\n this.iframe = iframe;\n this.areaBridge = areaBridge;\n this.selectionBridge = selectionBridge;\n this.decorationsBridge = decorationsBridge;\n }\n loadResource(url) {\n this.iframe.src = url;\n this.window.addEventListener(\"message\", (event) => {\n console.log(\"message\");\n if (!event.ports[0]) {\n return;\n }\n if (event.source === this.iframe.contentWindow) {\n this.onInitMessage(event);\n }\n });\n }\n onInitMessage(event) {\n console.log(`receiving init message ${event}`);\n const initMessage = event.data;\n const messagePort = event.ports[0];\n switch (initMessage) {\n case \"InitAreaManager\":\n return this.initAreaManager(messagePort);\n case \"InitSelection\":\n return this.initSelection(messagePort);\n case \"InitDecorations\":\n return this.initDecorations(messagePort);\n }\n }\n initAreaManager(messagePort) {\n this.areaBridge.setMessagePort(messagePort);\n this.listener.onAreaApiAvailable();\n }\n initSelection(messagePort) {\n this.selectionBridge.setMessagePort(messagePort);\n this.listener.onSelectionApiAvailable();\n }\n initDecorations(messagePort) {\n this.decorationsBridge.setMessagePort(messagePort);\n this.listener.onDecorationApiAvailable();\n }\n}\nexport class FixedDoubleInitializationBridge {\n constructor(window, listener, leftIframe, rightIframe, areaBridge, selectionBridge, decorationsBridge) {\n this.areaReadySemaphore = 2;\n this.selectionReadySemaphore = 2;\n this.decorationReadySemaphore = 2;\n this.listener = listener;\n this.areaBridge = areaBridge;\n this.selectionBridge = selectionBridge;\n this.decorationsBridge = decorationsBridge;\n window.addEventListener(\"message\", (event) => {\n if (!event.ports[0]) {\n return;\n }\n if (event.source === leftIframe.contentWindow) {\n this.onInitMessageLeft(event);\n }\n else if (event.source == rightIframe.contentWindow) {\n this.onInitMessageRight(event);\n }\n });\n }\n loadSpread(spread) {\n const pageNb = (spread.left ? 1 : 0) + (spread.right ? 1 : 0);\n this.areaReadySemaphore = pageNb;\n this.selectionReadySemaphore = pageNb;\n this.decorationReadySemaphore = pageNb;\n this.areaBridge.loadSpread(spread);\n }\n onInitMessageLeft(event) {\n const initMessage = event.data;\n const messagePort = event.ports[0];\n switch (initMessage) {\n case \"InitAreaManager\":\n this.areaBridge.setLeftMessagePort(messagePort);\n this.onInitAreaMessage();\n break;\n case \"InitSelection\":\n this.selectionBridge.setLeftMessagePort(messagePort);\n this.onInitSelectionMessage();\n break;\n case \"InitDecorations\":\n this.decorationsBridge.setLeftMessagePort(messagePort);\n this.onInitDecorationMessage();\n break;\n }\n }\n onInitMessageRight(event) {\n const initMessage = event.data;\n const messagePort = event.ports[0];\n switch (initMessage) {\n case \"InitAreaManager\":\n this.areaBridge.setRightMessagePort(messagePort);\n this.onInitAreaMessage();\n break;\n case \"InitSelection\":\n this.selectionBridge.setRightMessagePort(messagePort);\n this.onInitSelectionMessage();\n break;\n case \"InitDecorations\":\n this.decorationsBridge.setRightMessagePort(messagePort);\n this.onInitDecorationMessage();\n break;\n }\n }\n onInitAreaMessage() {\n this.areaReadySemaphore -= 1;\n if (this.areaReadySemaphore == 0) {\n this.listener.onAreaApiAvailable();\n }\n }\n onInitSelectionMessage() {\n this.selectionReadySemaphore -= 1;\n if (this.selectionReadySemaphore == 0) {\n this.listener.onSelectionApiAvailable();\n }\n }\n onInitDecorationMessage() {\n this.decorationReadySemaphore -= 1;\n if (this.decorationReadySemaphore == 0) {\n this.listener.onDecorationApiAvailable();\n }\n }\n}\nexport class FixedInitializerIframeSide {\n constructor(window) {\n this.window = window;\n }\n initAreaManager() {\n const messagePort = this.initChannel(\"InitAreaManager\");\n return new IframeMessageSender(messagePort);\n }\n initSelection(selectionManager) {\n const messagePort = this.initChannel(\"InitSelection\");\n new SelectionWrapperIframeSide(messagePort, selectionManager);\n }\n initDecorations(decorationManager) {\n const messagePort = this.initChannel(\"InitDecorations\");\n new DecorationWrapperIframeSide(messagePort, decorationManager);\n }\n initChannel(initMessage) {\n const messageChannel = new MessageChannel();\n this.window.parent.postMessage(initMessage, \"*\", [messageChannel.port2]);\n return messageChannel.port1;\n }\n}\n","export class ViewportStringBuilder {\n setInitialScale(scale) {\n this.initialScale = scale;\n return this;\n }\n setMinimumScale(scale) {\n this.minimumScale = scale;\n return this;\n }\n setWidth(width) {\n this.width = width;\n return this;\n }\n setHeight(height) {\n this.height = height;\n return this;\n }\n build() {\n const components = [];\n if (this.initialScale) {\n components.push(\"initial-scale=\" + this.initialScale);\n }\n if (this.minimumScale) {\n components.push(\"minimum-scale=\" + this.minimumScale);\n }\n if (this.width) {\n components.push(\"width=\" + this.width);\n }\n if (this.height) {\n components.push(\"height=\" + this.height);\n }\n return components.join(\", \");\n }\n}\nexport function parseViewportString(viewportString) {\n const regex = /(\\w+) *= *([^\\s,]+)/g;\n const properties = new Map();\n let match;\n while ((match = regex.exec(viewportString))) {\n if (match != null) {\n properties.set(match[1], match[2]);\n }\n }\n const width = parseFloat(properties.get(\"width\"));\n const height = parseFloat(properties.get(\"height\"));\n if (width && height) {\n return { width, height };\n }\n else {\n return undefined;\n }\n}\n","export class GesturesDetector {\n constructor(window, listener, decorationManager) {\n this.window = window;\n this.listener = listener;\n this.decorationManager = decorationManager;\n document.addEventListener(\"click\", (event) => {\n this.onClick(event);\n }, false);\n }\n onClick(event) {\n if (event.defaultPrevented) {\n return;\n }\n let nearestElement;\n if (event.target instanceof HTMLElement) {\n nearestElement = this.nearestInteractiveElement(event.target);\n }\n else {\n nearestElement = null;\n }\n if (nearestElement) {\n if (nearestElement instanceof HTMLAnchorElement) {\n this.listener.onLinkActivated(nearestElement.href, nearestElement.outerHTML);\n event.stopPropagation();\n event.preventDefault();\n }\n return;\n }\n let decorationActivatedEvent;\n if (this.decorationManager) {\n decorationActivatedEvent =\n this.decorationManager.handleDecorationClickEvent(event);\n }\n else {\n decorationActivatedEvent = null;\n }\n if (decorationActivatedEvent) {\n this.listener.onDecorationActivated(decorationActivatedEvent);\n }\n else {\n this.listener.onTap(event);\n }\n // event.stopPropagation()\n // event.preventDefault()\n }\n // See. https://github.com/JayPanoz/architecture/tree/touch-handling/misc/touch-handling\n nearestInteractiveElement(element) {\n if (element == null) {\n return null;\n }\n const interactiveTags = [\n \"a\",\n \"audio\",\n \"button\",\n \"canvas\",\n \"details\",\n \"input\",\n \"label\",\n \"option\",\n \"select\",\n \"submit\",\n \"textarea\",\n \"video\",\n ];\n if (interactiveTags.indexOf(element.nodeName.toLowerCase()) != -1) {\n return element;\n }\n // Checks whether the element is editable by the user.\n if (element.hasAttribute(\"contenteditable\") &&\n element.getAttribute(\"contenteditable\").toLowerCase() != \"false\") {\n return element;\n }\n // Checks parents recursively because the touch might be for example on an inside a .\n if (element.parentElement) {\n return this.nearestInteractiveElement(element.parentElement);\n }\n return null;\n }\n}\n"],"names":["reverse","s","split","join","oneIfNotZero","n","advanceBlock","ctx","peq","b","hIn","pV","P","mV","M","hInIsNegative","eq","xV","xH","pH","mH","hOut","lastRowMask","findMatchEnds","text","pattern","maxErrors","length","Math","min","matches","w","bMax","ceil","Uint32Array","fill","emptyPeq","Map","asciiPeq","i","push","c","val","charCodeAt","has","charPeq","set","r","idx","y","max","score","j","charCode","get","carry","maxBlockScore","splice","start","end","errors","exports","patRev","map","m","minStart","slice","reduce","rm","findMatchStarts","GetIntrinsic","callBind","$indexOf","module","name","allowMissing","intrinsic","bind","$apply","$call","$reflectApply","call","$gOPD","$defineProperty","$max","value","e","originalFunction","func","arguments","configurable","applyBind","apply","hasPropertyDescriptors","$SyntaxError","$TypeError","gopd","obj","property","nonEnumerable","nonWritable","nonConfigurable","loose","desc","enumerable","writable","keys","hasSymbols","Symbol","toStr","Object","prototype","toString","concat","Array","defineDataProperty","supportsDescriptors","defineProperty","object","predicate","fn","defineProperties","predicates","props","getOwnPropertySymbols","hasToStringTag","toStringTag","overrideIfSet","force","iterator","isPrimitive","isCallable","isDate","isSymbol","input","exoticToPrim","hint","String","Number","toPrimitive","O","TypeError","GetMethod","valueOf","result","method","methodNames","ordinaryToPrimitive","that","target","this","bound","args","boundLength","boundArgs","Function","Empty","implementation","functionsHaveNames","gOPD","getOwnPropertyDescriptor","functionsHaveConfigurableNames","$bind","boundFunctionsHaveNames","undefined","SyntaxError","$Function","getEvalledConstructor","expressionSyntax","throwTypeError","ThrowTypeError","calleeThrows","gOPDthrows","hasProto","getProto","getPrototypeOf","x","__proto__","needsEval","TypedArray","Uint8Array","INTRINSICS","AggregateError","ArrayBuffer","Atomics","BigInt","BigInt64Array","BigUint64Array","Boolean","DataView","Date","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","Error","eval","EvalError","Float32Array","Float64Array","FinalizationRegistry","Int8Array","Int16Array","Int32Array","isFinite","isNaN","JSON","parseFloat","parseInt","Promise","Proxy","RangeError","ReferenceError","Reflect","RegExp","Set","SharedArrayBuffer","Uint8ClampedArray","Uint16Array","URIError","WeakMap","WeakRef","WeakSet","error","errorProto","doEval","gen","LEGACY_ALIASES","hasOwn","$concat","$spliceApply","$replace","replace","$strSlice","$exec","exec","rePropName","reEscapeChar","getBaseIntrinsic","alias","intrinsicName","parts","string","first","last","match","number","quote","subString","stringToPath","intrinsicBaseName","intrinsicRealName","skipFurtherCaching","isOwn","part","hasArrayLengthDefineBug","test","foo","$Object","origSymbol","hasSymbolSham","sym","symObj","getOwnPropertyNames","syms","propertyIsEnumerable","descriptor","hasOwnProperty","channel","SLOT","assert","slot","slots","V","freeze","badArrayLike","isCallableMarker","fnToStr","reflectApply","_","constructorRegex","isES6ClassFn","fnStr","tryFunctionObject","isIE68","isDDA","document","all","str","strClass","getDay","tryDateObject","isRegexMarker","badStringifier","callBound","throwRegexMarker","$toString","symToStr","symStringRegex","isSymbolObject","hasMap","mapSizeDescriptor","mapSize","mapForEach","forEach","hasSet","setSizeDescriptor","setSize","setForEach","weakMapHas","weakSetHas","weakRefDeref","deref","booleanValueOf","objectToString","functionToString","$match","$slice","$toUpperCase","toUpperCase","$toLowerCase","toLowerCase","$test","$join","$arrSlice","$floor","floor","bigIntValueOf","gOPS","symToString","hasShammedSymbols","isEnumerable","gPO","addNumericSeparator","num","Infinity","sepRegex","int","intStr","dec","utilInspect","inspectCustom","custom","inspectSymbol","wrapQuotes","defaultStyle","opts","quoteChar","quoteStyle","isArray","isRegExp","inspect_","options","depth","seen","maxStringLength","customInspect","indent","numericSeparator","inspectString","bigIntStr","maxDepth","baseIndent","base","prev","getIndent","indexOf","inspect","from","noIndent","newOpts","f","nameOf","arrObjKeys","symString","markBoxed","HTMLElement","nodeName","getAttribute","attrs","attributes","childNodes","xs","singleLineValues","indentedJoin","isError","cause","isMap","mapParts","key","collectionOf","isSet","setParts","isWeakMap","weakCollectionOf","isWeakSet","isWeakRef","isNumber","isBigInt","isBoolean","isString","ys","isPlainObject","constructor","protoTag","stringTag","tag","l","remaining","trailer","lowbyte","type","size","entries","lineJoiner","isArr","symMap","k","keysShim","isArgs","hasDontEnumBug","hasProtoEnumBug","dontEnums","equalsConstructorPrototype","o","ctor","excludedKeys","$applicationCache","$console","$external","$frame","$frameElement","$frames","$innerHeight","$innerWidth","$onmozfullscreenchange","$onmozfullscreenerror","$outerHeight","$outerWidth","$pageXOffset","$pageYOffset","$parent","$scrollLeft","$scrollTop","$scrollX","$scrollY","$self","$webkitIndexedDB","$webkitStorageInfo","$window","hasAutomationEqualityBug","window","isObject","isFunction","isArguments","theKeys","skipProto","skipConstructor","equalsConstructorPrototypeIfNotBuggy","origKeys","originalKeys","shim","keysWorksWithArguments","callee","setFunctionName","hasIndices","global","ignoreCase","multiline","dotAll","unicode","unicodeSets","sticky","define","getPolyfill","flagsBound","flags","calls","TypeErr","regex","polyfill","proto","isRegex","hasDescriptors","$WeakMap","$Map","$weakMapGet","$weakMapSet","$weakMapHas","$mapGet","$mapSet","$mapHas","listGetNode","list","curr","next","$wm","$m","$o","objects","node","listGet","listHas","listSet","Call","Get","IsRegExp","ToString","RequireObjectCoercible","flagsGetter","regexpMatchAllPolyfill","getMatcher","regexp","matcherPolyfill","matchAll","matcher","S","rx","boundMatchAll","regexpMatchAll","CreateRegExpStringIterator","SpeciesConstructor","ToLength","Type","OrigRegExp","supportsConstructingWithFlags","regexMatchAll","R","tmp","C","source","constructRegexWithFlags","lastIndex","fullUnicode","defineP","symbol","mvsIsWS","leftWhitespace","rightWhitespace","boundMethod","receiver","trim","CodePointAt","isInteger","MAX_SAFE_INTEGER","index","IsArray","F","argumentsList","isLeadingSurrogate","isTrailingSurrogate","UTF16SurrogatePairToCodePoint","$charAt","$charCodeAt","position","cp","firstIsLeading","firstIsTrailing","second","done","DefineOwnProperty","FromPropertyDescriptor","IsDataDescriptor","IsPropertyKey","SameValue","IteratorPrototype","AdvanceStringIndex","CreateIterResultObject","CreateMethodProperty","OrdinaryObjectCreate","RegExpExec","setToStringTag","RegExpStringIterator","thisIndex","nextIndex","isPropertyDescriptor","IsAccessorDescriptor","ToPropertyDescriptor","Desc","assertRecord","fromPropertyDescriptor","GetV","IsCallable","$construct","DefinePropertyOrThrow","isConstructorMarker","argument","err","hasRegExpMatcher","ToBoolean","$ObjectCreate","additionalInternalSlotsList","T","regexExec","$isNaN","noThrowOnStrictViolation","Throw","$species","IsConstructor","defaultConstructor","$Number","$RegExp","$parseInteger","regexTester","isBinary","isOctal","isInvalidHexLiteral","hasNonWS","$trim","StringToNumber","NaN","trimmed","ToNumber","truncate","$isFinite","ToIntegerOrInfinity","len","ToPrimitive","Obj","getter","setter","$String","ES5Type","$fromCharCode","lead","trail","optMessage","$isEnumerable","$Array","allowed","isData","IsAccessor","then","recordType","argumentName","array","callback","$abs","absValue","record","a","ES","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","__esModule","d","definition","prop","debug","log","console","dezoomRect","rect","zoomLevel","bottom","height","left","right","top","width","domRectToRect","getClientRectsNoOverlap","range","doNotMergeHorizontallyAlignedRects","clientRects","getClientRects","originalRects","rangeClientRect","newRects","replaceOverlapingRects","rects","tolerance","rectsToKeep","possiblyContainingRect","rectContains","delete","removeContainedRects","mergeTouchingRects","rect1","rect2","rectsLineUpVertically","almostEqual","rectsLineUpHorizontally","rectsTouchOrOverlap","filter","replacementClientRect","getBoundingRect","rectContainsPoint","toRemove","toAdd","subtractRects1","rectSubtract","subtractRects2","rectIntersected","maxLeft","minRight","maxTop","minBottom","rectIntersect","rectA","rectB","rectC","rectD","abs","TrimDirection","ResolveDirection","search","matchPos","exactMatches","textMatchScore","closestNonSpaceInString","baseOffset","direction","nextChar","Forwards","charAt","availableChars","availableNonWhitespaceChars","Backwards","substring","trimEnd","trimStart","offsetDelta","closestNonSpaceInRange","nodeIter","commonAncestorContainer","ownerDocument","createNodeIterator","NodeFilter","SHOW_TEXT","initialBoundaryNode","startContainer","endContainer","terminalBoundaryNode","currentNode","nextNode","previousNode","trimmedOffset","advance","nodeText","textContent","offset","nodeTextLength","_a","_b","nodeType","Node","ELEMENT_NODE","TEXT_NODE","previousSiblingsTextLength","sibling","previousSibling","resolveOffsets","element","offsets","nextOffset","shift","results","textNode","data","relativeTo","parent","contains","el","parentElement","resolve","tw","createTreeWalker","getRootNode","forwards","FORWARDS","fromCharOffset","fromPoint","textOffset","toRange","BACKWARDS","Range","setStart","setEnd","fromRange","startOffset","endOffset","fromOffsets","root","trimmedRange","cloneRange","startTrimmed","endTrimmed","trimmedOffsets","trimRange","TextPositionAnchor","textRange","fromSelector","selector","toSelector","TextQuoteAnchor","exact","context","prefix","suffix","toPositionAnchor","scoreMatch","quoteScore","prefixScore","suffixScore","posScore","quoteWeight","scoredMatches","sort","matchQuote","assign","DecorationGroup","id","styles","items","lastItemId","container","groupId","groupName","add","decoration","cssSelector","textQuote","querySelector","body","createRange","setStartBefore","setEndAfter","anchor","quotedText","textBefore","textAfter","rangeFromDecorationTarget","item","clickableElements","layout","remove","findIndex","it","relayout","clearContainer","requireContainer","createElement","dataset","group","style","pointerEvents","append","groupContainer","unsafeStyle","itemContainer","documentWritingMode","getComputedStyle","writingMode","isVertical","zoom","currentCSSZoom","scrollingElement","xOffset","scrollLeft","yOffset","scrollTop","viewportWidth","innerHeight","innerWidth","viewportHeight","columnCount","documentElement","getPropertyValue","pageSize","positionElement","boundingRect","isVerticalRL","clientWidth","getBoundingClientRect","DOMRect","elementTemplate","template","innerHTML","content","firstElementChild","message","startsWith","startElement","decoratorWritingMode","r1","r2","clientRect","line","cloneNode","bounds","querySelectorAll","children","DecorationWrapperIframeSide","messagePort","decorationManager","onmessage","onCommand","command","kind","registerTemplates","templates","addDecoration","removeDecoration","IframeMessageSender","send","postMessage","SelectionWrapperIframeSide","manager","selectionManager","onRequestSelection","requestId","onClearSelection","feedback","selection","getCurrentSelection","sendFeedback","clearSelection","initializer","initAreaManager","initChannel","initSelection","initDecorations","initMessage","messageChannel","MessageChannel","port2","port1","messageSender","isSelecting","getSelection","removeAllRanges","getCurrentSelectionText","getSelectionRect","selectedText","highlight","before","after","selectionRect","getRangeAt","isCollapsed","anchorNode","focusNode","rangeCount","startNode","endNode","collapsed","rangeReverse","createOrderedRange","anchorOffset","focusOffset","firstWordStart","lastWordEnd","pop","groups","lastGroupId","addEventListener","lastSize","ResizeObserver","requestAnimationFrame","clientHeight","relayoutDecorations","observe","stylesheet","styleElement","getElementsByTagName","appendChild","getGroup","values","handleDecorationClickEvent","event","groupContent","clientX","clientY","findTarget","viewportSize","viewport","HTMLMetaElement","viewportString","properties","parseViewportString","parseContentSize","messagingListener","onTap","gestureEvent","onLinkActivated","href","outerHtml","onDecorationActivated","listener","onClick","defaultPrevented","nearestElement","decorationActivatedEvent","nearestInteractiveElement","HTMLAnchorElement","outerHTML","stopPropagation","preventDefault","hasAttribute"],"sourceRoot":""} \ No newline at end of file diff --git a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/fixed-single-script.js b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/fixed-single-script.js index 7f3f0c2487..9ca4355979 100644 --- a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/fixed-single-script.js +++ b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/fixed-single-script.js @@ -1,2 +1,2 @@ -!function(){var t={3099:function(t,e,r){"use strict";var n=r(2870),o=r(2755),i=o(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o(r):r}},2755:function(t,e,r){"use strict";var n=r(3569),o=r(2870),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||n.call(a,i),u=o("%Object.getOwnPropertyDescriptor%",!0),c=o("%Object.defineProperty%",!0),l=o("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var e=s(n,a,arguments);return u&&c&&u(e,"length").configurable&&c(e,"length",{value:1+l(0,t.length-(arguments.length-1))}),e};var f=function(){return s(n,i,arguments)};c?c(t.exports,"apply",{value:f}):t.exports.apply=f},6663:function(t,e,r){"use strict";var n=r(229)(),o=r(2870),i=n&&o("%Object.defineProperty%",!0),a=o("%SyntaxError%"),s=o("%TypeError%"),u=r(658);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new s("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new s("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new s("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!u&&u(t,e);if(i)i(t,e,{configurable:null===c&&f?f.configurable:!c,enumerable:null===n&&f?f.enumerable:!n,value:r,writable:null===o&&f?f.writable:!o});else{if(!l&&(n||o||c))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},9722:function(t,e,r){"use strict";var n=r(2051),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,s=r(6663),u=r(229)(),c=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;u?s(t,e,r,!0):s(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var s=0;s2&&arguments[2]&&arguments[2].force;!a||!r&&i(t,a)||(n?n(t,a,{configurable:!0,enumerable:!1,value:e,writable:!1}):t[a]=e)}},7358:function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(7959),i=r(3655),a=r(455),s=r(8760);t.exports=function(t){if(o(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!i(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):s(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var u=e.call(t,r);if(o(u))return u;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(a(t)||s(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,a,s="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a1&&"boolean"!=typeof e)throw new a('"allowMissing" argument must be a boolean');if(null===P(/^%?[^%]*%?$/,t))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=O(t,0,1),r=O(t,-1);if("%"===e&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return j(t,E,(function(t,e,r,o){n[n.length]=r?j(o,I,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=R("%"+n+"%",e),s=i.name,c=i.value,l=!1,f=i.alias;f&&(n=f[0],A(r,x([0,1],f)));for(var p=1,y=!0;p=r.length){var m=u(c,h);c=(y=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:c[h]}else y=S(c,h),c=c[h];y&&!l&&(b[s]=c)}}return c}},658:function(t,e,r){"use strict";var n=r(2870)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},229:function(t,e,r){"use strict";var n=r(2870)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},3413:function(t){"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},1143:function(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(9985);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},9985:function(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},3060:function(t,e,r){"use strict";var n=r(9985);t.exports=function(){return n()&&!!Symbol.toStringTag}},9545:function(t){"use strict";var e={}.hasOwnProperty,r=Function.prototype.call;t.exports=r.bind?r.bind(e):function(t,n){return r.call(e,t,n)}},7284:function(t,e,r){"use strict";var n=r(2870),o=r(9545),i=r(5714)(),a=n("%TypeError%"),s={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");if(i.assert(t),!s.has(t,e))throw new a("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");var r=i.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");var r=i.get(t);return!!r&&o(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");var n=i.get(t);n||(n={},i.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(s),t.exports=s},3655:function(t){"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},s=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},u=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;u.call(p)===u.call(document.all)&&(f=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=u.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&s(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(c)return s(t);if(a(t))return!1;var e=u.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&s(t)}},455:function(t,e,r){"use strict";var n=Date.prototype.getDay,o=Object.prototype.toString,i=r(3060)();t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},5494:function(t,e,r){"use strict";var n,o,i,a,s=r(3099),u=r(3060)();if(u){n=s("Object.prototype.hasOwnProperty"),o=s("RegExp.prototype.exec"),i={};var c=function(){throw i};a={toString:c,valueOf:c},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=c)}var l=s("Object.prototype.toString"),f=Object.getOwnPropertyDescriptor;t.exports=u?function(t){if(!t||"object"!=typeof t)return!1;var e=f(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{o(t,a)}catch(t){return t===i}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},8760:function(t,e,r){"use strict";var n=Object.prototype.toString;if(r(1143)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},4538:function(t,e,r){var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,u=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=s&&u&&"function"==typeof u.get?u.get:null,l=s&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,g=Object.prototype.toString,b=Function.prototype.toString,d=String.prototype.match,m=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,S=String.prototype.toLowerCase,x=RegExp.prototype.test,A=Array.prototype.concat,j=Array.prototype.join,O=Array.prototype.slice,P=Math.floor,E="function"==typeof BigInt?BigInt.prototype.valueOf:null,I=Object.getOwnPropertySymbols,R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,D="function"==typeof Symbol&&"object"==typeof Symbol.iterator,T="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,F=Object.prototype.propertyIsEnumerable,M=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function C(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||x.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-P(-t):P(t);if(n!==t){var o=String(n),i=m.call(e,o.length+1);return v.call(o,r,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var k=r(7002),B=k.custom,L=_(B)?B:null;function U(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function N(t){return v.call(String(t),/"/g,""")}function W(t){return!("[object Array]"!==z(t)||T&&"object"==typeof t&&T in t)}function $(t){return!("[object RegExp]"!==z(t)||T&&"object"==typeof t&&T in t)}function _(t){if(D)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!R)return!1;try{return R.call(t),!0}catch(t){}return!1}t.exports=function t(e,r,n,o){var s=r||{};if(V(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(V(s,"maxStringLength")&&("number"==typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!V(s,"customInspect")||s.customInspect;if("boolean"!=typeof u&&"symbol"!==u)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(V(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(V(s,"numericSeparator")&&"boolean"!=typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var g=s.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return H(e,s);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var w=String(e);return g?C(e,w):w}if("bigint"==typeof e){var x=String(e)+"n";return g?C(e,x):x}var P=void 0===s.depth?5:s.depth;if(void 0===n&&(n=0),n>=P&&P>0&&"object"==typeof e)return W(e)?"[Array]":"[Object]";var I,B=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=j.call(Array(t.indent+1)," ")}return{base:r,prev:j.call(Array(e+1),r)}}(s,n);if(void 0===o)o=[];else if(q(o,e)>=0)return"[Circular]";function G(e,r,i){if(r&&(o=O.call(o)).push(r),i){var a={depth:s.depth};return V(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),t(e,a,n+1,o)}return t(e,s,n+1,o)}if("function"==typeof e&&!$(e)){var J=function(t){if(t.name)return t.name;var e=d.call(b.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),tt=Z(e,G);return"[Function"+(J?": "+J:" (anonymous)")+"]"+(tt.length>0?" { "+j.call(tt,", ")+" }":"")}if(_(e)){var et=D?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):R.call(e);return"object"!=typeof e||D?et:K(et)}if((I=e)&&"object"==typeof I&&("undefined"!=typeof HTMLElement&&I instanceof HTMLElement||"string"==typeof I.nodeName&&"function"==typeof I.getAttribute)){for(var rt="<"+S.call(String(e.nodeName)),nt=e.attributes||[],ot=0;ot"}if(W(e)){if(0===e.length)return"[]";var it=Z(e,G);return B&&!function(t){for(var e=0;e=0)return!1;return!0}(it)?"["+Q(it,B)+"]":"[ "+j.call(it,", ")+" ]"}if(function(t){return!("[object Error]"!==z(t)||T&&"object"==typeof t&&T in t)}(e)){var at=Z(e,G);return"cause"in Error.prototype||!("cause"in e)||F.call(e,"cause")?0===at.length?"["+String(e)+"]":"{ ["+String(e)+"] "+j.call(at,", ")+" }":"{ ["+String(e)+"] "+j.call(A.call("[cause]: "+G(e.cause),at),", ")+" }"}if("object"==typeof e&&u){if(L&&"function"==typeof e[L]&&k)return k(e,{depth:P-n});if("symbol"!==u&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{c.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var st=[];return a&&a.call(e,(function(t,r){st.push(G(r,e,!0)+" => "+G(t,e))})),Y("Map",i.call(e),st,B)}if(function(t){if(!c||!t||"object"!=typeof t)return!1;try{c.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ut=[];return l&&l.call(e,(function(t){ut.push(G(t,e))})),Y("Set",c.call(e),ut,B)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return X("WeakMap");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return X("WeakSet");if(function(t){if(!y||!t||"object"!=typeof t)return!1;try{return y.call(t),!0}catch(t){}return!1}(e))return X("WeakRef");if(function(t){return!("[object Number]"!==z(t)||T&&"object"==typeof t&&T in t)}(e))return K(G(Number(e)));if(function(t){if(!t||"object"!=typeof t||!E)return!1;try{return E.call(t),!0}catch(t){}return!1}(e))return K(G(E.call(e)));if(function(t){return!("[object Boolean]"!==z(t)||T&&"object"==typeof t&&T in t)}(e))return K(h.call(e));if(function(t){return!("[object String]"!==z(t)||T&&"object"==typeof t&&T in t)}(e))return K(G(String(e)));if(!function(t){return!("[object Date]"!==z(t)||T&&"object"==typeof t&&T in t)}(e)&&!$(e)){var ct=Z(e,G),lt=M?M(e)===Object.prototype:e instanceof Object||e.constructor===Object,ft=e instanceof Object?"":"null prototype",pt=!lt&&T&&Object(e)===e&&T in e?m.call(z(e),8,-1):ft?"Object":"",yt=(lt||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(pt||ft?"["+j.call(A.call([],pt||[],ft||[]),": ")+"] ":"");return 0===ct.length?yt+"{}":B?yt+"{"+Q(ct,B)+"}":yt+"{ "+j.call(ct,", ")+" }"}return String(e)};var G=Object.prototype.hasOwnProperty||function(t){return t in this};function V(t,e){return G.call(t,e)}function z(t){return g.call(t)}function q(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return H(m.call(t,0,e.maxStringLength),e)+n}return U(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,J),"single",e)}function J(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function K(t){return"Object("+t+")"}function X(t){return t+" { ? }"}function Y(t,e,r,n){return t+" ("+e+") {"+(n?Q(r,n):j.call(r,", "))+"}"}function Q(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+j.call(t,","+r)+"\n"+e.prev}function Z(t,e){var r=W(t),n=[];if(r){n.length=t.length;for(var o=0;o0&&!o.call(t,0))for(var g=0;g0)for(var b=0;b=0&&"[object Function]"===e.call(t.callee)),n}},9766:function(t,e,r){"use strict";var n=r(8921),o=Object,i=TypeError;t.exports=n((function(){if(null!=this&&this!==o(this))throw new i("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t}),"get flags",!0)},483:function(t,e,r){"use strict";var n=r(9722),o=r(2755),i=r(9766),a=r(5113),s=r(7299),u=o(a());n(u,{getPolyfill:a,implementation:i,shim:s}),t.exports=u},5113:function(t,e,r){"use strict";var n=r(9766),o=r(9722).supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(o&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}},7299:function(t,e,r){"use strict";var n=r(9722).supportsDescriptors,o=r(5113),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,s=TypeError,u=Object.getPrototypeOf,c=/a/;t.exports=function(){if(!n||!u)throw new s("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=u(c),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},7582:function(t,e,r){"use strict";var n=r(3099),o=r(2870),i=r(5494),a=n("RegExp.prototype.exec"),s=o("%TypeError%");t.exports=function(t){if(!i(t))throw new s("`regex` must be a RegExp");return function(e){return null!==a(t,e)}}},8921:function(t,e,r){"use strict";var n=r(6663),o=r(229)(),i=r(5610).functionsHaveConfigurableNames(),a=TypeError;t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!i||(o?n(t,"name",e,!0,!0):n(t,"name",e)),t}},5714:function(t,e,r){"use strict";var n=r(2870),o=r(3099),i=r(4538),a=n("%TypeError%"),s=n("%WeakMap%",!0),u=n("%Map%",!0),c=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),y=o("Map.prototype.set",!0),h=o("Map.prototype.has",!0),g=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new a("Side channel does not contain "+i(t))},get:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(t)return c(t,n)}else if(u){if(e)return p(e,n)}else if(r)return function(t,e){var r=g(t,e);return r&&r.value}(r,n)},has:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(t)return f(t,n)}else if(u){if(e)return h(e,n)}else if(r)return function(t,e){return!!g(t,e)}(r,n);return!1},set:function(n,o){s&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new s),l(t,n,o)):u?(e||(e=new u),y(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=g(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n}},3073:function(t,e,r){"use strict";var n=r(7113),o=r(151),i=r(1959),a=r(9497),s=r(5128),u=r(6751),c=r(3099),l=r(1143)(),f=r(483),p=c("String.prototype.indexOf"),y=r(2009),h=function(t){var e=y();if(l&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===RegExp.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=u(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(u(r),p(s(r),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var i=h(t);if(void 0!==i)return n(i,t,[e])}var c=s(e),l=new RegExp(t,"g");return n(h(l),l,[c])}},5155:function(t,e,r){"use strict";var n=r(2755),o=r(9722),i=r(3073),a=r(1794),s=r(3911),u=n(i);o(u,{getPolyfill:a,implementation:i,shim:s}),t.exports=u},2009:function(t,e,r){"use strict";var n=r(1143)(),o=r(8012);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},1794:function(t,e,r){"use strict";var n=r(3073);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},8012:function(t,e,r){"use strict";var n=r(1398),o=r(151),i=r(8322),a=r(2449),s=r(3995),u=r(5128),c=r(1874),l=r(483),f=r(8921),p=r(3099)("String.prototype.indexOf"),y=RegExp,h="flags"in RegExp.prototype,g=f((function(t){var e=this;if("Object"!==c(e))throw new TypeError('"this" value must be an Object');var r=u(t),f=function(t,e){var r="flags"in e?o(e,"flags"):u(l(e));return{flags:r,matcher:new t(h&&"string"==typeof r?e:t===y?e.source:e,r)}}(a(e,y),e),g=f.flags,b=f.matcher,d=s(o(e,"lastIndex"));i(b,"lastIndex",d,!0);var m=p(g,"g")>-1,v=p(g,"u")>-1;return n(b,r,m,v)}),"[Symbol.matchAll]",!0);t.exports=g},3911:function(t,e,r){"use strict";var n=r(9722),o=r(1143)(),i=r(1794),a=r(2009),s=Object.defineProperty,u=Object.getOwnPropertyDescriptor;t.exports=function(){var t=i();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),o){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),s&&u){var r=u(Symbol,e);r&&!r.configurable||s(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var c=a(),l={};l[e]=c;var f={};f[e]=function(){return RegExp.prototype[e]!==c},n(RegExp.prototype,l,f)}return t}},8125:function(t,e,r){"use strict";var n=r(6751),o=r(5128),i=r(3099)("String.prototype.replace"),a=/^\s$/.test("᠎"),s=a?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,u=a?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=o(n(this));return i(i(t,s,""),u,"")}},9434:function(t,e,r){"use strict";var n=r(2755),o=r(9722),i=r(6751),a=r(8125),s=r(3228),u=r(818),c=n(s()),l=function(t){return i(t),c(t)};o(l,{getPolyfill:s,implementation:a,shim:u}),t.exports=l},3228:function(t,e,r){"use strict";var n=r(8125);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},818:function(t,e,r){"use strict";var n=r(9722),o=r(3228);t.exports=function(){var t=o();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},7002:function(){},1510:function(t,e,r){"use strict";var n=r(2870),o=r(6318),i=r(1874),a=r(2990),s=r(5674),u=n("%TypeError%");t.exports=function(t,e,r){if("String"!==i(t))throw new u("Assertion failed: `S` must be a String");if(!a(e)||e<0||e>s)throw new u("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==i(r))throw new u("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+o(t,e)["[[CodeUnitCount]]"]:e+1}},7113:function(t,e,r){"use strict";var n=r(2870),o=r(3099),i=n("%TypeError%"),a=r(6287),s=n("%Reflect.apply%",!0)||o("Function.prototype.apply");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!a(r))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return s(t,e,r)}},6318:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(3099),i=r(5541),a=r(959),s=r(1874),u=r(1751),c=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("String"!==s(t))throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var o=l(t,e),f=c(t,e),p=i(o),y=a(o);if(!p&&!y)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(y||e+1===r)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var h=l(t,e+1);return a(h)?{"[[CodePoint]]":u(o,h),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},5702:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(1874);t.exports=function(t,e){if("Boolean"!==o(e))throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},6782:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(2860),i=r(8357),a=r(3301),s=r(6284),u=r(8277),c=r(1874);t.exports=function(t,e,r){if("Object"!==c(t))throw new n("Assertion failed: Type(O) is not Object");if(!s(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return o(a,u,i,t,e,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0})}},1398:function(t,e,r){"use strict";var n=r(2870),o=r(1143)(),i=n("%TypeError%"),a=n("%IteratorPrototype%",!0),s=r(1510),u=r(5702),c=r(6782),l=r(151),f=r(5716),p=r(3500),y=r(8322),h=r(3995),g=r(5128),b=r(1874),d=r(7284),m=r(2263),v=function(t,e,r,n){if("String"!==b(e))throw new i("`S` must be a string");if("Boolean"!==b(r))throw new i("`global` must be a boolean");if("Boolean"!==b(n))throw new i("`fullUnicode` must be a boolean");d.set(this,"[[IteratingRegExp]]",t),d.set(this,"[[IteratedString]]",e),d.set(this,"[[Global]]",r),d.set(this,"[[Unicode]]",n),d.set(this,"[[Done]]",!1)};a&&(v.prototype=f(a)),c(v.prototype,"next",(function(){var t=this;if("Object"!==b(t))throw new i("receiver must be an object");if(!(t instanceof v&&d.has(t,"[[IteratingRegExp]]")&&d.has(t,"[[IteratedString]]")&&d.has(t,"[[Global]]")&&d.has(t,"[[Unicode]]")&&d.has(t,"[[Done]]")))throw new i('"this" value must be a RegExpStringIterator instance');if(d.get(t,"[[Done]]"))return u(void 0,!0);var e=d.get(t,"[[IteratingRegExp]]"),r=d.get(t,"[[IteratedString]]"),n=d.get(t,"[[Global]]"),o=d.get(t,"[[Unicode]]"),a=p(e,r);if(null===a)return d.set(t,"[[Done]]",!0),u(void 0,!0);if(n){if(""===g(l(a,"0"))){var c=h(l(e,"lastIndex")),f=s(r,c,o);y(e,"lastIndex",f,!0)}return u(a,!1)}return d.set(t,"[[Done]]",!0),u(a,!1)})),o&&(m(v.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof v.prototype[Symbol.iterator])&&c(v.prototype,Symbol.iterator,(function(){return this})),t.exports=function(t,e,r,n){return new v(t,e,r,n)}},3645:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(7999),i=r(2860),a=r(8357),s=r(8355),u=r(3301),c=r(6284),l=r(8277),f=r(7628),p=r(1874);t.exports=function(t,e,r){if("Object"!==p(t))throw new n("Assertion failed: Type(O) is not Object");if(!c(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var y=o({Type:p,IsDataDescriptor:u,IsAccessorDescriptor:s},r)?r:f(r);if(!o({Type:p,IsDataDescriptor:u,IsAccessorDescriptor:s},y))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return i(u,l,a,t,e,y)}},8357:function(t,e,r){"use strict";var n=r(1489),o=r(1598),i=r(1874);t.exports=function(t){return void 0!==t&&n(i,"Property Descriptor","Desc",t),o(t)}},151:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(4538),i=r(6284),a=r(1874);t.exports=function(t,e){if("Object"!==a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},1959:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(9374),i=r(7304),a=r(6284),s=r(4538);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var r=o(t,e);if(null!=r){if(!i(r))throw new n(s(e)+" is not a function: "+s(r));return r}}},9374:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(4538),i=r(6284);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},8355:function(t,e,r){"use strict";var n=r(9545),o=r(1874),i=r(1489);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Get]]")&&!n(t,"[[Set]]")))}},6287:function(t,e,r){"use strict";t.exports=r(2403)},7304:function(t,e,r){"use strict";t.exports=r(3655)},4791:function(t,e,r){"use strict";var n=r(6740)("%Reflect.construct%",!0),o=r(3645);try{o({},"",{"[[Get]]":function(){}})}catch(t){o=null}if(o&&n){var i={},a={};o(a,"length",{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,a)}catch(t){return t===i}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},3301:function(t,e,r){"use strict";var n=r(9545),o=r(1874),i=r(1489);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Value]]")&&!n(t,"[[Writable]]")))}},6284:function(t){"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},9497:function(t,e,r){"use strict";var n=r(2870)("%Symbol.match%",!0),o=r(5494),i=r(5695);t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(n){var e=t[n];if(void 0!==e)return i(e)}return o(t)}},5716:function(t,e,r){"use strict";var n=r(2870),o=n("%Object.create%",!0),i=n("%TypeError%"),a=n("%SyntaxError%"),s=r(6287),u=r(1874),c=r(7735),l=r(7284),f=r(3413)();t.exports=function(t){if(null!==t&&"Object"!==u(t))throw new i("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!s(r))throw new i("Assertion failed: `additionalInternalSlotsList` must be an Array");if(o)e=o(t);else if(f)e={__proto__:t};else{if(null===t)throw new a("native Object.create support is required to create null objects");var n=function(){};n.prototype=t,e=new n}return r.length>0&&c(r,(function(t){l.set(e,t,void 0)})),e}},3500:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(3099)("RegExp.prototype.exec"),i=r(7113),a=r(151),s=r(7304),u=r(1874);t.exports=function(t,e){if("Object"!==u(t))throw new n("Assertion failed: `R` must be an Object");if("String"!==u(e))throw new n("Assertion failed: `S` must be a String");var r=a(t,"exec");if(s(r)){var c=i(r,t,[e]);if(null===c||"Object"===u(c))return c;throw new n('"exec" method must return `null` or an Object')}return o(t,e)}},6751:function(t,e,r){"use strict";t.exports=r(9572)},8277:function(t,e,r){"use strict";var n=r(159);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},8322:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(6284),i=r(8277),a=r(1874),s=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,u){if("Object"!==a(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");if("Boolean"!==a(u))throw new n("Assertion failed: `Throw` must be a Boolean");if(u){if(t[e]=r,s&&!i(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!s||i(t[e],r)}catch(t){return!1}}},2449:function(t,e,r){"use strict";var n=r(2870),o=n("%Symbol.species%",!0),i=n("%TypeError%"),a=r(4791),s=r(1874);t.exports=function(t,e){if("Object"!==s(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==s(r))throw new i("O.constructor is not an Object");var n=o?r[o]:void 0;if(null==n)return e;if(a(n))return n;throw new i("no constructor found")}},6207:function(t,e,r){"use strict";var n=r(2870),o=n("%Number%"),i=n("%RegExp%"),a=n("%TypeError%"),s=n("%parseInt%"),u=r(3099),c=r(7582),l=u("String.prototype.slice"),f=c(/^0b[01]+$/i),p=c(/^0o[0-7]+$/i),y=c(/^[-+]0x[0-9a-f]+$/i),h=c(new i("["+["…","​","￾"].join("")+"]","g")),g=r(9434),b=r(1874);t.exports=function t(e){if("String"!==b(e))throw new a("Assertion failed: `argument` is not a String");if(f(e))return o(s(l(e,2),2));if(p(e))return o(s(l(e,2),8));if(h(e)||y(e))return NaN;var r=g(e);return r!==e?t(r):o(e)}},5695:function(t){"use strict";t.exports=function(t){return!!t}},1200:function(t,e,r){"use strict";var n=r(6542),o=r(5693),i=r(159),a=r(1117);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},3995:function(t,e,r){"use strict";var n=r(5674),o=r(1200);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},6542:function(t,e,r){"use strict";var n=r(2870),o=n("%TypeError%"),i=n("%Number%"),a=r(8606),s=r(703),u=r(6207);t.exports=function(t){var e=a(t)?t:s(t,i);if("symbol"==typeof e)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?u(e):i(e)}},703:function(t,e,r){"use strict";var n=r(7358);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},7628:function(t,e,r){"use strict";var n=r(9545),o=r(2870)("%TypeError%"),i=r(1874),a=r(5695),s=r(7304);t.exports=function(t){if("Object"!==i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=a(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=a(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=a(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!s(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var u=t.set;if(void 0!==u&&!s(u))throw new o("setter must be a function");e["[[Set]]"]=u}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},5128:function(t,e,r){"use strict";var n=r(2870),o=n("%String%"),i=n("%TypeError%");t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return o(t)}},1874:function(t,e,r){"use strict";var n=r(6101);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},1751:function(t,e,r){"use strict";var n=r(2870),o=n("%TypeError%"),i=n("%String.fromCharCode%"),a=r(5541),s=r(959);t.exports=function(t,e){if(!a(t)||!s(e))throw new o("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(t)+i(e)}},3567:function(t,e,r){"use strict";var n=r(1874),o=Math.floor;t.exports=function(t){return"BigInt"===n(t)?t:o(t)}},5693:function(t,e,r){"use strict";var n=r(2870),o=r(3567),i=n("%TypeError%");t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-o(-t):o(t);return 0===e?0:e}},9572:function(t,e,r){"use strict";var n=r(2870)("%TypeError%");t.exports=function(t,e){if(null==t)throw new n(e||"Cannot call method on "+t);return t}},6101:function(t){"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},6740:function(t,e,r){"use strict";t.exports=r(2870)},2860:function(t,e,r){"use strict";var n=r(229),o=r(2870),i=n()&&o("%Object.defineProperty%",!0),a=n.hasArrayLengthDefineBug(),s=a&&r(2403),u=r(3099)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,o,c){if(!i){if(!t(c))return!1;if(!c["[[Configurable]]"]||!c["[[Writable]]"])return!1;if(o in n&&u(n,o)!==!!c["[[Enumerable]]"])return!1;var l=c["[[Value]]"];return n[o]=l,e(n[o],l)}return a&&"length"===o&&"[[Value]]"in c&&s(n)&&n.length!==c["[[Value]]"]?(n.length=c["[[Value]]"],n.length===c["[[Value]]"]):(i(n,o,r(c)),!0)}},2403:function(t,e,r){"use strict";var n=r(2870)("%Array%"),o=!n.isArray&&r(3099)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},1489:function(t,e,r){"use strict";var n=r(2870),o=n("%TypeError%"),i=n("%SyntaxError%"),a=r(9545),s=r(2990),u={"Property Descriptor":function(t){var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!t)return!1;for(var r in t)if(a(t,r)&&!e[r])return!1;var n=a(t,"[[Value]]"),i=a(t,"[[Get]]")||a(t,"[[Set]]");if(n&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":r(900),"Iterator Record":function(t){return a(t,"[[Iterator]]")&&a(t,"[[NextMethod]]")&&a(t,"[[Done]]")},"PromiseCapability Record":function(t){return!!t&&a(t,"[[Resolve]]")&&"function"==typeof t["[[Resolve]]"]&&a(t,"[[Reject]]")&&"function"==typeof t["[[Reject]]"]&&a(t,"[[Promise]]")&&t["[[Promise]]"]&&"function"==typeof t["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(t){return!!t&&a(t,"[[Completion]]")&&a(t,"[[Capability]]")&&u["PromiseCapability Record"](t["[[Capability]]"])},"RegExp Record":function(t){return t&&a(t,"[[IgnoreCase]]")&&"boolean"==typeof t["[[IgnoreCase]]"]&&a(t,"[[Multiline]]")&&"boolean"==typeof t["[[Multiline]]"]&&a(t,"[[DotAll]]")&&"boolean"==typeof t["[[DotAll]]"]&&a(t,"[[Unicode]]")&&"boolean"==typeof t["[[Unicode]]"]&&a(t,"[[CapturingGroupsCount]]")&&"number"==typeof t["[[CapturingGroupsCount]]"]&&s(t["[[CapturingGroupsCount]]"])&&t["[[CapturingGroupsCount]]"]>=0}};t.exports=function(t,e,r,n){var a=u[e];if("function"!=typeof a)throw new i("unknown record type: "+e);if("Object"!==t(n)||!a(n))throw new o(r+" must be a "+e)}},7735:function(t){"use strict";t.exports=function(t,e){for(var r=0;r=55296&&t<=56319}},900:function(t,e,r){"use strict";var n=r(9545);t.exports=function(t){return n(t,"[[StartIndex]]")&&n(t,"[[EndIndex]]")&&t["[[StartIndex]]"]>=0&&t["[[EndIndex]]"]>=t["[[StartIndex]]"]&&String(parseInt(t["[[StartIndex]]"],10))===String(t["[[StartIndex]]"])&&String(parseInt(t["[[EndIndex]]"],10))===String(t["[[EndIndex]]"])}},159:function(t){"use strict";t.exports=Number.isNaN||function(t){return t!=t}},8606:function(t){"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},7999:function(t,e,r){"use strict";var n=r(2870),o=r(9545),i=n("%TypeError%");t.exports=function(t,e){if("Object"!==t.Type(e))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(o(e,n)&&!r[n])return!1;if(t.IsDataDescriptor(e)&&t.IsAccessorDescriptor(e))throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}},959:function(t){"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},5674:function(t){"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";class t{constructor(t,e,r){this.window=t,this.gesturesApi=e,this.documentApi=r,this.resizeObserverAdded=!1,this.documentLoadedFired=!1}onTap(t){this.gesturesApi.onTap(JSON.stringify(t.offset))}onLinkActivated(t,e){this.gesturesApi.onLinkActivated(t,e)}onDecorationActivated(t){const e=JSON.stringify(t.offset),r=JSON.stringify(t.rect);this.gesturesApi.onDecorationActivated(t.id,t.group,r,e)}onLayout(){this.resizeObserverAdded||new ResizeObserver((()=>{requestAnimationFrame((()=>{const t=this.window.document.scrollingElement;!this.documentLoadedFired&&(null==t||t.scrollHeight>0||t.scrollWidth>0)?(this.documentApi.onDocumentLoadedAndSized(),this.documentLoadedFired=!0):this.documentApi.onDocumentResized()}))})).observe(this.window.document.body),this.resizeObserverAdded=!0}}class e{constructor(t,e,r){if(this.margins={top:0,right:0,bottom:0,left:0},!e.contentWindow)throw Error("Iframe argument must have been attached to DOM.");this.listener=r,this.iframe=e}setMessagePort(t){t.onmessage=t=>{this.onMessageFromIframe(t)}}show(){this.iframe.style.display="unset"}hide(){this.iframe.style.display="none"}setMargins(t){this.margins!=t&&(this.iframe.style.marginTop=this.margins.top+"px",this.iframe.style.marginLeft=this.margins.left+"px",this.iframe.style.marginBottom=this.margins.bottom+"px",this.iframe.style.marginRight=this.margins.right+"px")}loadPage(t){this.iframe.src=t}setPlaceholder(t){this.iframe.style.visibility="hidden",this.iframe.style.width=t.width+"px",this.iframe.style.height=t.height+"px",this.size=t}onMessageFromIframe(t){const e=t.data;switch(e.kind){case"contentSize":return this.onContentSizeAvailable(e.size);case"tap":return this.listener.onTap(e.event);case"linkActivated":return this.onLinkActivated(e);case"decorationActivated":return this.listener.onDecorationActivated(e.event)}}onLinkActivated(t){try{const e=new URL(t.href,this.iframe.src);this.listener.onLinkActivated(e.toString(),t.outerHtml)}catch(t){}}onContentSizeAvailable(t){t&&(this.iframe.style.width=t.width+"px",this.iframe.style.height=t.height+"px",this.size=t,this.listener.onIframeLoaded())}}class n{setInitialScale(t){return this.initialScale=t,this}setMinimumScale(t){return this.minimumScale=t,this}setWidth(t){return this.width=t,this}setHeight(t){return this.height=t,this}build(){const t=[];return this.initialScale&&t.push("initial-scale="+this.initialScale),this.minimumScale&&t.push("minimum-scale="+this.minimumScale),this.width&&t.push("width="+this.width),this.height&&t.push("height="+this.height),t.join(", ")}}function o(t,e){return{x:(t.x+e.left-visualViewport.offsetLeft)*visualViewport.scale,y:(t.y+e.top-visualViewport.offsetTop)*visualViewport.scale}}class i{constructor(t,e,r){this.window=t,this.listener=e,this.decorationManager=r,document.addEventListener("click",(t=>{this.onClick(t)}),!1)}onClick(t){if(t.defaultPrevented)return;const e=this.window.getSelection();if(e&&"Range"==e.type)return;let r,n;if(r=t.target instanceof HTMLElement?this.nearestInteractiveElement(t.target):null,r){if(!(r instanceof HTMLAnchorElement))return;this.listener.onLinkActivated(r.href,r.outerHTML),t.stopPropagation(),t.preventDefault()}n=this.decorationManager?this.decorationManager.handleDecorationClickEvent(t):null,n?this.listener.onDecorationActivated(n):this.listener.onTap(t)}nearestInteractiveElement(t){return null==t?null:-1!=["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(t.nodeName.toLowerCase())||t.hasAttribute("contenteditable")&&"false"!=t.getAttribute("contenteditable").toLowerCase()?t:t.parentElement?this.nearestInteractiveElement(t.parentElement):null}}class a{constructor(t,r,n,a){this.fit="contain",this.insets={top:0,right:0,bottom:0,left:0},this.scale=1,this.listener=a,new i(t,{onTap:t=>{const e={x:(t.clientX-visualViewport.offsetLeft)*visualViewport.scale,y:(t.clientY-visualViewport.offsetTop)*visualViewport.scale};a.onTap({offset:e})},onLinkActivated:t=>{throw Error("No interactive element in the root document.")},onDecorationActivated:t=>{throw Error("No decoration in the root document.")}}),this.metaViewport=n;const s={onIframeLoaded:()=>{this.onIframeLoaded()},onTap:t=>{const e=r.getBoundingClientRect(),n=o(t.offset,e);a.onTap({offset:n})},onLinkActivated:(t,e)=>{a.onLinkActivated(t,e)},onDecorationActivated:t=>{const e=r.getBoundingClientRect(),n=o(t.offset,e),i=function(t,e){const r={x:t.left,y:t.top},n={x:t.right,y:t.bottom},i=o(r,e),a=o(n,e);return{left:i.x,top:i.y,right:a.x,bottom:a.y,width:a.x-i.x,height:a.y-i.y}}(t.rect,e),s={id:t.id,group:t.group,rect:i,offset:n};a.onDecorationActivated(s)}};this.page=new e(t,r,s)}setMessagePort(t){this.page.setMessagePort(t)}setViewport(t,e){this.viewport==t&&this.insets==e||(this.viewport=t,this.insets=e,this.layout())}setFit(t){this.fit!=t&&(this.fit=t,this.layout())}loadResource(t){this.page.hide(),this.page.loadPage(t)}onIframeLoaded(){this.page.size&&this.layout()}layout(){if(!this.page.size||!this.viewport)return;const t={top:this.insets.top,right:this.insets.right,bottom:this.insets.bottom,left:this.insets.left};this.page.setMargins(t);const e={width:this.viewport.width-this.insets.left-this.insets.right,height:this.viewport.height-this.insets.top-this.insets.bottom},r=function(t,e,r){switch(t){case"contain":return function(t,e){const r=e.width/t.width,n=e.height/t.height;return Math.min(r,n)}(e,r);case"width":return function(t,e){return e.width/t.width}(e,r);case"height":return function(t,e){return e.height/t.height}(e,r)}}(this.fit,this.page.size,e);this.metaViewport.content=(new n).setInitialScale(r).setMinimumScale(r).setWidth(this.page.size.width).setHeight(this.page.size.height).build(),this.scale=r,this.page.show(),this.listener.onLayout()}}class s{setMessagePort(t){this.messagePort=t}registerTemplates(t){this.send({kind:"registerTemplates",templates:t})}addDecoration(t,e){this.send({kind:"addDecoration",decoration:t,group:e})}removeDecoration(t,e){this.send({kind:"removeDecoration",id:t,group:e})}send(t){var e;null===(e=this.messagePort)||void 0===e||e.postMessage(t)}}var u,c;!function(t){t[t.Forwards=1]="Forwards",t[t.Backwards=2]="Backwards"}(u||(u={})),function(t){t[t.FORWARDS=1]="FORWARDS",t[t.BACKWARDS=2]="BACKWARDS"}(c||(c={}));var l=r(5155);r.n(l)().shim();class f{constructor(t){this.selectionListener=t}setMessagePort(t){this.messagePort=t,t.onmessage=t=>{this.onFeedback(t.data)}}requestSelection(t){this.send({kind:"requestSelection",requestId:t})}clearSelection(){this.send({kind:"clearSelection"})}onFeedback(t){if("selectionAvailable"===t.kind)return this.onSelectionAvailable(t.requestId,t.selection)}onSelectionAvailable(t,e){this.selectionListener.onSelectionAvailable(t,e)}send(t){var e;null===(e=this.messagePort)||void 0===e||e.postMessage(t)}}const p=document.getElementById("page"),y=document.querySelector("meta[name=viewport]");window.singleArea=new class{constructor(e,r,n,o,i){const s=new t(e,o,i);this.manager=new a(e,r,n,s)}setMessagePort(t){this.manager.setMessagePort(t)}loadResource(t){this.manager.loadResource(t)}setViewport(t,e,r,n,o,i){const a={width:t,height:e},s={top:r,left:i,bottom:o,right:n};this.manager.setViewport(a,s)}setFit(t){if("contain"!=t&&"width"!=t&&"height"!=t)throw Error(`Invalid fit value: ${t}`);this.manager.setFit(t)}}(window,p,y,window.gestures,window.documentState),window.singleSelection=new class{constructor(t){this.listener=t;const e={onSelectionAvailable:(t,e)=>{const r=JSON.stringify(e);this.listener.onSelectionAvailable(t,r)}};this.wrapper=new f(e)}setMessagePort(t){this.wrapper.setMessagePort(t)}requestSelection(t){this.wrapper.requestSelection(t)}clearSelection(){this.wrapper.clearSelection()}}(window.singleSelectionListener),window.singleDecorations=new class{constructor(){this.wrapper=new s}setMessagePort(t){this.wrapper.setMessagePort(t)}registerTemplates(t){const e=function(t){return new Map(Object.entries(JSON.parse(t)))}(t);this.wrapper.registerTemplates(e)}addDecoration(t,e){const r=function(t){return JSON.parse(t)}(t);this.wrapper.addDecoration(r,e)}removeDecoration(t,e){this.wrapper.removeDecoration(t,e)}},window.singleInitialization=new class{constructor(t,e,r,n,o,i){this.window=t,this.listener=e,this.iframe=r,this.areaBridge=n,this.selectionBridge=o,this.decorationsBridge=i}loadResource(t){this.iframe.src=t,this.window.addEventListener("message",(t=>{console.log("message"),t.ports[0]&&t.source===this.iframe.contentWindow&&this.onInitMessage(t)}))}onInitMessage(t){console.log(`receiving init message ${t}`);const e=t.data,r=t.ports[0];switch(e){case"InitAreaManager":return this.initAreaManager(r);case"InitSelection":return this.initSelection(r);case"InitDecorations":return this.initDecorations(r)}}initAreaManager(t){this.areaBridge.setMessagePort(t),this.listener.onAreaApiAvailable()}initSelection(t){this.selectionBridge.setMessagePort(t),this.listener.onSelectionApiAvailable()}initDecorations(t){this.decorationsBridge.setMessagePort(t),this.listener.onDecorationApiAvailable()}}(window,window.fixedApiState,p,window.singleArea,window.singleSelection,window.singleDecorations),window.fixedApiState.onInitializationApiAvailable()}()}(); +!function(){var t={3099:function(t,e,r){"use strict";var n=r(2870),o=r(2755),i=o(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o(r):r}},2755:function(t,e,r){"use strict";var n=r(3569),o=r(2870),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||n.call(a,i),u=o("%Object.getOwnPropertyDescriptor%",!0),c=o("%Object.defineProperty%",!0),l=o("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var e=s(n,a,arguments);return u&&c&&u(e,"length").configurable&&c(e,"length",{value:1+l(0,t.length-(arguments.length-1))}),e};var f=function(){return s(n,i,arguments)};c?c(t.exports,"apply",{value:f}):t.exports.apply=f},6663:function(t,e,r){"use strict";var n=r(229)(),o=r(2870),i=n&&o("%Object.defineProperty%",!0),a=o("%SyntaxError%"),s=o("%TypeError%"),u=r(658);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new s("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new s("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new s("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!u&&u(t,e);if(i)i(t,e,{configurable:null===c&&f?f.configurable:!c,enumerable:null===n&&f?f.enumerable:!n,value:r,writable:null===o&&f?f.writable:!o});else{if(!l&&(n||o||c))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},9722:function(t,e,r){"use strict";var n=r(2051),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,s=r(6663),u=r(229)(),c=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;u?s(t,e,r,!0):s(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var s=0;s2&&arguments[2]&&arguments[2].force;!a||!r&&i(t,a)||(n?n(t,a,{configurable:!0,enumerable:!1,value:e,writable:!1}):t[a]=e)}},7358:function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(7959),i=r(3655),a=r(455),s=r(8760);t.exports=function(t){if(o(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!i(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):s(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var u=e.call(t,r);if(o(u))return u;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(a(t)||s(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,a,s="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a1&&"boolean"!=typeof e)throw new a('"allowMissing" argument must be a boolean');if(null===P(/^%?[^%]*%?$/,t))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=O(t,0,1),r=O(t,-1);if("%"===e&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return j(t,E,(function(t,e,r,o){n[n.length]=r?j(o,I,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=R("%"+n+"%",e),s=i.name,c=i.value,l=!1,f=i.alias;f&&(n=f[0],A(r,x([0,1],f)));for(var p=1,y=!0;p=r.length){var m=u(c,h);c=(y=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:c[h]}else y=S(c,h),c=c[h];y&&!l&&(b[s]=c)}}return c}},658:function(t,e,r){"use strict";var n=r(2870)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},229:function(t,e,r){"use strict";var n=r(2870)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},3413:function(t){"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},1143:function(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(9985);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},9985:function(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},3060:function(t,e,r){"use strict";var n=r(9985);t.exports=function(){return n()&&!!Symbol.toStringTag}},9545:function(t){"use strict";var e={}.hasOwnProperty,r=Function.prototype.call;t.exports=r.bind?r.bind(e):function(t,n){return r.call(e,t,n)}},7284:function(t,e,r){"use strict";var n=r(2870),o=r(9545),i=r(5714)(),a=n("%TypeError%"),s={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");if(i.assert(t),!s.has(t,e))throw new a("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");var r=i.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");var r=i.get(t);return!!r&&o(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");var n=i.get(t);n||(n={},i.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(s),t.exports=s},3655:function(t){"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},s=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},u=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;u.call(p)===u.call(document.all)&&(f=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=u.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&s(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(c)return s(t);if(a(t))return!1;var e=u.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&s(t)}},455:function(t,e,r){"use strict";var n=Date.prototype.getDay,o=Object.prototype.toString,i=r(3060)();t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},5494:function(t,e,r){"use strict";var n,o,i,a,s=r(3099),u=r(3060)();if(u){n=s("Object.prototype.hasOwnProperty"),o=s("RegExp.prototype.exec"),i={};var c=function(){throw i};a={toString:c,valueOf:c},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=c)}var l=s("Object.prototype.toString"),f=Object.getOwnPropertyDescriptor;t.exports=u?function(t){if(!t||"object"!=typeof t)return!1;var e=f(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{o(t,a)}catch(t){return t===i}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},8760:function(t,e,r){"use strict";var n=Object.prototype.toString;if(r(1143)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},4538:function(t,e,r){var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,u=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=s&&u&&"function"==typeof u.get?u.get:null,l=s&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,g=Object.prototype.toString,b=Function.prototype.toString,d=String.prototype.match,m=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,S=String.prototype.toLowerCase,x=RegExp.prototype.test,A=Array.prototype.concat,j=Array.prototype.join,O=Array.prototype.slice,P=Math.floor,E="function"==typeof BigInt?BigInt.prototype.valueOf:null,I=Object.getOwnPropertySymbols,R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,T="function"==typeof Symbol&&"object"==typeof Symbol.iterator,D="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,F=Object.prototype.propertyIsEnumerable,M=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function C(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||x.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-P(-t):P(t);if(n!==t){var o=String(n),i=m.call(e,o.length+1);return v.call(o,r,"$&_")+"."+v.call(v.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var k=r(7002),B=k.custom,L=_(B)?B:null;function U(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function N(t){return v.call(String(t),/"/g,""")}function W(t){return!("[object Array]"!==z(t)||D&&"object"==typeof t&&D in t)}function $(t){return!("[object RegExp]"!==z(t)||D&&"object"==typeof t&&D in t)}function _(t){if(T)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!R)return!1;try{return R.call(t),!0}catch(t){}return!1}t.exports=function t(e,r,n,o){var s=r||{};if(V(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(V(s,"maxStringLength")&&("number"==typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var u=!V(s,"customInspect")||s.customInspect;if("boolean"!=typeof u&&"symbol"!==u)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(V(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(V(s,"numericSeparator")&&"boolean"!=typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var g=s.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return H(e,s);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var w=String(e);return g?C(e,w):w}if("bigint"==typeof e){var x=String(e)+"n";return g?C(e,x):x}var P=void 0===s.depth?5:s.depth;if(void 0===n&&(n=0),n>=P&&P>0&&"object"==typeof e)return W(e)?"[Array]":"[Object]";var I,B=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=j.call(Array(t.indent+1)," ")}return{base:r,prev:j.call(Array(e+1),r)}}(s,n);if(void 0===o)o=[];else if(q(o,e)>=0)return"[Circular]";function G(e,r,i){if(r&&(o=O.call(o)).push(r),i){var a={depth:s.depth};return V(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),t(e,a,n+1,o)}return t(e,s,n+1,o)}if("function"==typeof e&&!$(e)){var J=function(t){if(t.name)return t.name;var e=d.call(b.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),tt=Z(e,G);return"[Function"+(J?": "+J:" (anonymous)")+"]"+(tt.length>0?" { "+j.call(tt,", ")+" }":"")}if(_(e)){var et=T?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):R.call(e);return"object"!=typeof e||T?et:K(et)}if((I=e)&&"object"==typeof I&&("undefined"!=typeof HTMLElement&&I instanceof HTMLElement||"string"==typeof I.nodeName&&"function"==typeof I.getAttribute)){for(var rt="<"+S.call(String(e.nodeName)),nt=e.attributes||[],ot=0;ot"}if(W(e)){if(0===e.length)return"[]";var it=Z(e,G);return B&&!function(t){for(var e=0;e=0)return!1;return!0}(it)?"["+Q(it,B)+"]":"[ "+j.call(it,", ")+" ]"}if(function(t){return!("[object Error]"!==z(t)||D&&"object"==typeof t&&D in t)}(e)){var at=Z(e,G);return"cause"in Error.prototype||!("cause"in e)||F.call(e,"cause")?0===at.length?"["+String(e)+"]":"{ ["+String(e)+"] "+j.call(at,", ")+" }":"{ ["+String(e)+"] "+j.call(A.call("[cause]: "+G(e.cause),at),", ")+" }"}if("object"==typeof e&&u){if(L&&"function"==typeof e[L]&&k)return k(e,{depth:P-n});if("symbol"!==u&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{c.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var st=[];return a&&a.call(e,(function(t,r){st.push(G(r,e,!0)+" => "+G(t,e))})),Y("Map",i.call(e),st,B)}if(function(t){if(!c||!t||"object"!=typeof t)return!1;try{c.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ut=[];return l&&l.call(e,(function(t){ut.push(G(t,e))})),Y("Set",c.call(e),ut,B)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return X("WeakMap");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return X("WeakSet");if(function(t){if(!y||!t||"object"!=typeof t)return!1;try{return y.call(t),!0}catch(t){}return!1}(e))return X("WeakRef");if(function(t){return!("[object Number]"!==z(t)||D&&"object"==typeof t&&D in t)}(e))return K(G(Number(e)));if(function(t){if(!t||"object"!=typeof t||!E)return!1;try{return E.call(t),!0}catch(t){}return!1}(e))return K(G(E.call(e)));if(function(t){return!("[object Boolean]"!==z(t)||D&&"object"==typeof t&&D in t)}(e))return K(h.call(e));if(function(t){return!("[object String]"!==z(t)||D&&"object"==typeof t&&D in t)}(e))return K(G(String(e)));if(!function(t){return!("[object Date]"!==z(t)||D&&"object"==typeof t&&D in t)}(e)&&!$(e)){var ct=Z(e,G),lt=M?M(e)===Object.prototype:e instanceof Object||e.constructor===Object,ft=e instanceof Object?"":"null prototype",pt=!lt&&D&&Object(e)===e&&D in e?m.call(z(e),8,-1):ft?"Object":"",yt=(lt||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(pt||ft?"["+j.call(A.call([],pt||[],ft||[]),": ")+"] ":"");return 0===ct.length?yt+"{}":B?yt+"{"+Q(ct,B)+"}":yt+"{ "+j.call(ct,", ")+" }"}return String(e)};var G=Object.prototype.hasOwnProperty||function(t){return t in this};function V(t,e){return G.call(t,e)}function z(t){return g.call(t)}function q(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return H(m.call(t,0,e.maxStringLength),e)+n}return U(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,J),"single",e)}function J(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function K(t){return"Object("+t+")"}function X(t){return t+" { ? }"}function Y(t,e,r,n){return t+" ("+e+") {"+(n?Q(r,n):j.call(r,", "))+"}"}function Q(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+j.call(t,","+r)+"\n"+e.prev}function Z(t,e){var r=W(t),n=[];if(r){n.length=t.length;for(var o=0;o0&&!o.call(t,0))for(var g=0;g0)for(var b=0;b=0&&"[object Function]"===e.call(t.callee)),n}},9766:function(t,e,r){"use strict";var n=r(8921),o=Object,i=TypeError;t.exports=n((function(){if(null!=this&&this!==o(this))throw new i("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t}),"get flags",!0)},483:function(t,e,r){"use strict";var n=r(9722),o=r(2755),i=r(9766),a=r(5113),s=r(7299),u=o(a());n(u,{getPolyfill:a,implementation:i,shim:s}),t.exports=u},5113:function(t,e,r){"use strict";var n=r(9766),o=r(9722).supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(o&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}},7299:function(t,e,r){"use strict";var n=r(9722).supportsDescriptors,o=r(5113),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,s=TypeError,u=Object.getPrototypeOf,c=/a/;t.exports=function(){if(!n||!u)throw new s("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=u(c),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},7582:function(t,e,r){"use strict";var n=r(3099),o=r(2870),i=r(5494),a=n("RegExp.prototype.exec"),s=o("%TypeError%");t.exports=function(t){if(!i(t))throw new s("`regex` must be a RegExp");return function(e){return null!==a(t,e)}}},8921:function(t,e,r){"use strict";var n=r(6663),o=r(229)(),i=r(5610).functionsHaveConfigurableNames(),a=TypeError;t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!i||(o?n(t,"name",e,!0,!0):n(t,"name",e)),t}},5714:function(t,e,r){"use strict";var n=r(2870),o=r(3099),i=r(4538),a=n("%TypeError%"),s=n("%WeakMap%",!0),u=n("%Map%",!0),c=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),y=o("Map.prototype.set",!0),h=o("Map.prototype.has",!0),g=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new a("Side channel does not contain "+i(t))},get:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(t)return c(t,n)}else if(u){if(e)return p(e,n)}else if(r)return function(t,e){var r=g(t,e);return r&&r.value}(r,n)},has:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(t)return f(t,n)}else if(u){if(e)return h(e,n)}else if(r)return function(t,e){return!!g(t,e)}(r,n);return!1},set:function(n,o){s&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new s),l(t,n,o)):u?(e||(e=new u),y(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=g(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n}},3073:function(t,e,r){"use strict";var n=r(7113),o=r(151),i=r(1959),a=r(9497),s=r(5128),u=r(6751),c=r(3099),l=r(1143)(),f=r(483),p=c("String.prototype.indexOf"),y=r(2009),h=function(t){var e=y();if(l&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===RegExp.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=u(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(u(r),p(s(r),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var i=h(t);if(void 0!==i)return n(i,t,[e])}var c=s(e),l=new RegExp(t,"g");return n(h(l),l,[c])}},5155:function(t,e,r){"use strict";var n=r(2755),o=r(9722),i=r(3073),a=r(1794),s=r(3911),u=n(i);o(u,{getPolyfill:a,implementation:i,shim:s}),t.exports=u},2009:function(t,e,r){"use strict";var n=r(1143)(),o=r(8012);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},1794:function(t,e,r){"use strict";var n=r(3073);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},8012:function(t,e,r){"use strict";var n=r(1398),o=r(151),i=r(8322),a=r(2449),s=r(3995),u=r(5128),c=r(1874),l=r(483),f=r(8921),p=r(3099)("String.prototype.indexOf"),y=RegExp,h="flags"in RegExp.prototype,g=f((function(t){var e=this;if("Object"!==c(e))throw new TypeError('"this" value must be an Object');var r=u(t),f=function(t,e){var r="flags"in e?o(e,"flags"):u(l(e));return{flags:r,matcher:new t(h&&"string"==typeof r?e:t===y?e.source:e,r)}}(a(e,y),e),g=f.flags,b=f.matcher,d=s(o(e,"lastIndex"));i(b,"lastIndex",d,!0);var m=p(g,"g")>-1,v=p(g,"u")>-1;return n(b,r,m,v)}),"[Symbol.matchAll]",!0);t.exports=g},3911:function(t,e,r){"use strict";var n=r(9722),o=r(1143)(),i=r(1794),a=r(2009),s=Object.defineProperty,u=Object.getOwnPropertyDescriptor;t.exports=function(){var t=i();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),o){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),s&&u){var r=u(Symbol,e);r&&!r.configurable||s(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var c=a(),l={};l[e]=c;var f={};f[e]=function(){return RegExp.prototype[e]!==c},n(RegExp.prototype,l,f)}return t}},8125:function(t,e,r){"use strict";var n=r(6751),o=r(5128),i=r(3099)("String.prototype.replace"),a=/^\s$/.test("᠎"),s=a?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,u=a?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=o(n(this));return i(i(t,s,""),u,"")}},9434:function(t,e,r){"use strict";var n=r(2755),o=r(9722),i=r(6751),a=r(8125),s=r(3228),u=r(818),c=n(s()),l=function(t){return i(t),c(t)};o(l,{getPolyfill:s,implementation:a,shim:u}),t.exports=l},3228:function(t,e,r){"use strict";var n=r(8125);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},818:function(t,e,r){"use strict";var n=r(9722),o=r(3228);t.exports=function(){var t=o();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},7002:function(){},1510:function(t,e,r){"use strict";var n=r(2870),o=r(6318),i=r(1874),a=r(2990),s=r(5674),u=n("%TypeError%");t.exports=function(t,e,r){if("String"!==i(t))throw new u("Assertion failed: `S` must be a String");if(!a(e)||e<0||e>s)throw new u("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==i(r))throw new u("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+o(t,e)["[[CodeUnitCount]]"]:e+1}},7113:function(t,e,r){"use strict";var n=r(2870),o=r(3099),i=n("%TypeError%"),a=r(6287),s=n("%Reflect.apply%",!0)||o("Function.prototype.apply");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!a(r))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return s(t,e,r)}},6318:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(3099),i=r(5541),a=r(959),s=r(1874),u=r(1751),c=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("String"!==s(t))throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var o=l(t,e),f=c(t,e),p=i(o),y=a(o);if(!p&&!y)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(y||e+1===r)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var h=l(t,e+1);return a(h)?{"[[CodePoint]]":u(o,h),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},5702:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(1874);t.exports=function(t,e){if("Boolean"!==o(e))throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},6782:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(2860),i=r(8357),a=r(3301),s=r(6284),u=r(8277),c=r(1874);t.exports=function(t,e,r){if("Object"!==c(t))throw new n("Assertion failed: Type(O) is not Object");if(!s(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return o(a,u,i,t,e,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0})}},1398:function(t,e,r){"use strict";var n=r(2870),o=r(1143)(),i=n("%TypeError%"),a=n("%IteratorPrototype%",!0),s=r(1510),u=r(5702),c=r(6782),l=r(151),f=r(5716),p=r(3500),y=r(8322),h=r(3995),g=r(5128),b=r(1874),d=r(7284),m=r(2263),v=function(t,e,r,n){if("String"!==b(e))throw new i("`S` must be a string");if("Boolean"!==b(r))throw new i("`global` must be a boolean");if("Boolean"!==b(n))throw new i("`fullUnicode` must be a boolean");d.set(this,"[[IteratingRegExp]]",t),d.set(this,"[[IteratedString]]",e),d.set(this,"[[Global]]",r),d.set(this,"[[Unicode]]",n),d.set(this,"[[Done]]",!1)};a&&(v.prototype=f(a)),c(v.prototype,"next",(function(){var t=this;if("Object"!==b(t))throw new i("receiver must be an object");if(!(t instanceof v&&d.has(t,"[[IteratingRegExp]]")&&d.has(t,"[[IteratedString]]")&&d.has(t,"[[Global]]")&&d.has(t,"[[Unicode]]")&&d.has(t,"[[Done]]")))throw new i('"this" value must be a RegExpStringIterator instance');if(d.get(t,"[[Done]]"))return u(void 0,!0);var e=d.get(t,"[[IteratingRegExp]]"),r=d.get(t,"[[IteratedString]]"),n=d.get(t,"[[Global]]"),o=d.get(t,"[[Unicode]]"),a=p(e,r);if(null===a)return d.set(t,"[[Done]]",!0),u(void 0,!0);if(n){if(""===g(l(a,"0"))){var c=h(l(e,"lastIndex")),f=s(r,c,o);y(e,"lastIndex",f,!0)}return u(a,!1)}return d.set(t,"[[Done]]",!0),u(a,!1)})),o&&(m(v.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof v.prototype[Symbol.iterator])&&c(v.prototype,Symbol.iterator,(function(){return this})),t.exports=function(t,e,r,n){return new v(t,e,r,n)}},3645:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(7999),i=r(2860),a=r(8357),s=r(8355),u=r(3301),c=r(6284),l=r(8277),f=r(7628),p=r(1874);t.exports=function(t,e,r){if("Object"!==p(t))throw new n("Assertion failed: Type(O) is not Object");if(!c(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var y=o({Type:p,IsDataDescriptor:u,IsAccessorDescriptor:s},r)?r:f(r);if(!o({Type:p,IsDataDescriptor:u,IsAccessorDescriptor:s},y))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return i(u,l,a,t,e,y)}},8357:function(t,e,r){"use strict";var n=r(1489),o=r(1598),i=r(1874);t.exports=function(t){return void 0!==t&&n(i,"Property Descriptor","Desc",t),o(t)}},151:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(4538),i=r(6284),a=r(1874);t.exports=function(t,e){if("Object"!==a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},1959:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(9374),i=r(7304),a=r(6284),s=r(4538);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var r=o(t,e);if(null!=r){if(!i(r))throw new n(s(e)+" is not a function: "+s(r));return r}}},9374:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(4538),i=r(6284);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},8355:function(t,e,r){"use strict";var n=r(9545),o=r(1874),i=r(1489);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Get]]")&&!n(t,"[[Set]]")))}},6287:function(t,e,r){"use strict";t.exports=r(2403)},7304:function(t,e,r){"use strict";t.exports=r(3655)},4791:function(t,e,r){"use strict";var n=r(6740)("%Reflect.construct%",!0),o=r(3645);try{o({},"",{"[[Get]]":function(){}})}catch(t){o=null}if(o&&n){var i={},a={};o(a,"length",{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,a)}catch(t){return t===i}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},3301:function(t,e,r){"use strict";var n=r(9545),o=r(1874),i=r(1489);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Value]]")&&!n(t,"[[Writable]]")))}},6284:function(t){"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},9497:function(t,e,r){"use strict";var n=r(2870)("%Symbol.match%",!0),o=r(5494),i=r(5695);t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(n){var e=t[n];if(void 0!==e)return i(e)}return o(t)}},5716:function(t,e,r){"use strict";var n=r(2870),o=n("%Object.create%",!0),i=n("%TypeError%"),a=n("%SyntaxError%"),s=r(6287),u=r(1874),c=r(7735),l=r(7284),f=r(3413)();t.exports=function(t){if(null!==t&&"Object"!==u(t))throw new i("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!s(r))throw new i("Assertion failed: `additionalInternalSlotsList` must be an Array");if(o)e=o(t);else if(f)e={__proto__:t};else{if(null===t)throw new a("native Object.create support is required to create null objects");var n=function(){};n.prototype=t,e=new n}return r.length>0&&c(r,(function(t){l.set(e,t,void 0)})),e}},3500:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(3099)("RegExp.prototype.exec"),i=r(7113),a=r(151),s=r(7304),u=r(1874);t.exports=function(t,e){if("Object"!==u(t))throw new n("Assertion failed: `R` must be an Object");if("String"!==u(e))throw new n("Assertion failed: `S` must be a String");var r=a(t,"exec");if(s(r)){var c=i(r,t,[e]);if(null===c||"Object"===u(c))return c;throw new n('"exec" method must return `null` or an Object')}return o(t,e)}},6751:function(t,e,r){"use strict";t.exports=r(9572)},8277:function(t,e,r){"use strict";var n=r(159);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},8322:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(6284),i=r(8277),a=r(1874),s=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,u){if("Object"!==a(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");if("Boolean"!==a(u))throw new n("Assertion failed: `Throw` must be a Boolean");if(u){if(t[e]=r,s&&!i(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!s||i(t[e],r)}catch(t){return!1}}},2449:function(t,e,r){"use strict";var n=r(2870),o=n("%Symbol.species%",!0),i=n("%TypeError%"),a=r(4791),s=r(1874);t.exports=function(t,e){if("Object"!==s(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==s(r))throw new i("O.constructor is not an Object");var n=o?r[o]:void 0;if(null==n)return e;if(a(n))return n;throw new i("no constructor found")}},6207:function(t,e,r){"use strict";var n=r(2870),o=n("%Number%"),i=n("%RegExp%"),a=n("%TypeError%"),s=n("%parseInt%"),u=r(3099),c=r(7582),l=u("String.prototype.slice"),f=c(/^0b[01]+$/i),p=c(/^0o[0-7]+$/i),y=c(/^[-+]0x[0-9a-f]+$/i),h=c(new i("["+["…","​","￾"].join("")+"]","g")),g=r(9434),b=r(1874);t.exports=function t(e){if("String"!==b(e))throw new a("Assertion failed: `argument` is not a String");if(f(e))return o(s(l(e,2),2));if(p(e))return o(s(l(e,2),8));if(h(e)||y(e))return NaN;var r=g(e);return r!==e?t(r):o(e)}},5695:function(t){"use strict";t.exports=function(t){return!!t}},1200:function(t,e,r){"use strict";var n=r(6542),o=r(5693),i=r(159),a=r(1117);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},3995:function(t,e,r){"use strict";var n=r(5674),o=r(1200);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},6542:function(t,e,r){"use strict";var n=r(2870),o=n("%TypeError%"),i=n("%Number%"),a=r(8606),s=r(703),u=r(6207);t.exports=function(t){var e=a(t)?t:s(t,i);if("symbol"==typeof e)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?u(e):i(e)}},703:function(t,e,r){"use strict";var n=r(7358);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},7628:function(t,e,r){"use strict";var n=r(9545),o=r(2870)("%TypeError%"),i=r(1874),a=r(5695),s=r(7304);t.exports=function(t){if("Object"!==i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=a(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=a(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=a(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!s(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var u=t.set;if(void 0!==u&&!s(u))throw new o("setter must be a function");e["[[Set]]"]=u}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},5128:function(t,e,r){"use strict";var n=r(2870),o=n("%String%"),i=n("%TypeError%");t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return o(t)}},1874:function(t,e,r){"use strict";var n=r(6101);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},1751:function(t,e,r){"use strict";var n=r(2870),o=n("%TypeError%"),i=n("%String.fromCharCode%"),a=r(5541),s=r(959);t.exports=function(t,e){if(!a(t)||!s(e))throw new o("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(t)+i(e)}},3567:function(t,e,r){"use strict";var n=r(1874),o=Math.floor;t.exports=function(t){return"BigInt"===n(t)?t:o(t)}},5693:function(t,e,r){"use strict";var n=r(2870),o=r(3567),i=n("%TypeError%");t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-o(-t):o(t);return 0===e?0:e}},9572:function(t,e,r){"use strict";var n=r(2870)("%TypeError%");t.exports=function(t,e){if(null==t)throw new n(e||"Cannot call method on "+t);return t}},6101:function(t){"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},6740:function(t,e,r){"use strict";t.exports=r(2870)},2860:function(t,e,r){"use strict";var n=r(229),o=r(2870),i=n()&&o("%Object.defineProperty%",!0),a=n.hasArrayLengthDefineBug(),s=a&&r(2403),u=r(3099)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,o,c){if(!i){if(!t(c))return!1;if(!c["[[Configurable]]"]||!c["[[Writable]]"])return!1;if(o in n&&u(n,o)!==!!c["[[Enumerable]]"])return!1;var l=c["[[Value]]"];return n[o]=l,e(n[o],l)}return a&&"length"===o&&"[[Value]]"in c&&s(n)&&n.length!==c["[[Value]]"]?(n.length=c["[[Value]]"],n.length===c["[[Value]]"]):(i(n,o,r(c)),!0)}},2403:function(t,e,r){"use strict";var n=r(2870)("%Array%"),o=!n.isArray&&r(3099)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},1489:function(t,e,r){"use strict";var n=r(2870),o=n("%TypeError%"),i=n("%SyntaxError%"),a=r(9545),s=r(2990),u={"Property Descriptor":function(t){var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!t)return!1;for(var r in t)if(a(t,r)&&!e[r])return!1;var n=a(t,"[[Value]]"),i=a(t,"[[Get]]")||a(t,"[[Set]]");if(n&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":r(900),"Iterator Record":function(t){return a(t,"[[Iterator]]")&&a(t,"[[NextMethod]]")&&a(t,"[[Done]]")},"PromiseCapability Record":function(t){return!!t&&a(t,"[[Resolve]]")&&"function"==typeof t["[[Resolve]]"]&&a(t,"[[Reject]]")&&"function"==typeof t["[[Reject]]"]&&a(t,"[[Promise]]")&&t["[[Promise]]"]&&"function"==typeof t["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(t){return!!t&&a(t,"[[Completion]]")&&a(t,"[[Capability]]")&&u["PromiseCapability Record"](t["[[Capability]]"])},"RegExp Record":function(t){return t&&a(t,"[[IgnoreCase]]")&&"boolean"==typeof t["[[IgnoreCase]]"]&&a(t,"[[Multiline]]")&&"boolean"==typeof t["[[Multiline]]"]&&a(t,"[[DotAll]]")&&"boolean"==typeof t["[[DotAll]]"]&&a(t,"[[Unicode]]")&&"boolean"==typeof t["[[Unicode]]"]&&a(t,"[[CapturingGroupsCount]]")&&"number"==typeof t["[[CapturingGroupsCount]]"]&&s(t["[[CapturingGroupsCount]]"])&&t["[[CapturingGroupsCount]]"]>=0}};t.exports=function(t,e,r,n){var a=u[e];if("function"!=typeof a)throw new i("unknown record type: "+e);if("Object"!==t(n)||!a(n))throw new o(r+" must be a "+e)}},7735:function(t){"use strict";t.exports=function(t,e){for(var r=0;r=55296&&t<=56319}},900:function(t,e,r){"use strict";var n=r(9545);t.exports=function(t){return n(t,"[[StartIndex]]")&&n(t,"[[EndIndex]]")&&t["[[StartIndex]]"]>=0&&t["[[EndIndex]]"]>=t["[[StartIndex]]"]&&String(parseInt(t["[[StartIndex]]"],10))===String(t["[[StartIndex]]"])&&String(parseInt(t["[[EndIndex]]"],10))===String(t["[[EndIndex]]"])}},159:function(t){"use strict";t.exports=Number.isNaN||function(t){return t!=t}},8606:function(t){"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},7999:function(t,e,r){"use strict";var n=r(2870),o=r(9545),i=n("%TypeError%");t.exports=function(t,e){if("Object"!==t.Type(e))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(o(e,n)&&!r[n])return!1;if(t.IsDataDescriptor(e)&&t.IsAccessorDescriptor(e))throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}},959:function(t){"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},5674:function(t){"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";class t{constructor(t,e,r){this.window=t,this.gesturesApi=e,this.documentApi=r,this.resizeObserverAdded=!1,this.documentLoadedFired=!1}onTap(t){this.gesturesApi.onTap(JSON.stringify(t.offset))}onLinkActivated(t,e){this.gesturesApi.onLinkActivated(t,e)}onDecorationActivated(t){const e=JSON.stringify(t.offset),r=JSON.stringify(t.rect);this.gesturesApi.onDecorationActivated(t.id,t.group,r,e)}onLayout(){this.resizeObserverAdded||new ResizeObserver((()=>{requestAnimationFrame((()=>{const t=this.window.document.scrollingElement;!this.documentLoadedFired&&(null==t||t.scrollHeight>0||t.scrollWidth>0)?(this.documentApi.onDocumentLoadedAndSized(),this.documentLoadedFired=!0):this.documentApi.onDocumentResized()}))})).observe(this.window.document.body),this.resizeObserverAdded=!0}}class e{constructor(t,e,r){if(this.margins={top:0,right:0,bottom:0,left:0},!e.contentWindow)throw Error("Iframe argument must have been attached to DOM.");this.listener=r,this.iframe=e}setMessagePort(t){t.onmessage=t=>{this.onMessageFromIframe(t)}}show(){this.iframe.style.display="unset"}hide(){this.iframe.style.display="none"}setMargins(t){this.margins!=t&&(this.iframe.style.marginTop=this.margins.top+"px",this.iframe.style.marginLeft=this.margins.left+"px",this.iframe.style.marginBottom=this.margins.bottom+"px",this.iframe.style.marginRight=this.margins.right+"px")}loadPage(t){this.iframe.src=t}setPlaceholder(t){this.iframe.style.visibility="hidden",this.iframe.style.width=t.width+"px",this.iframe.style.height=t.height+"px",this.size=t}onMessageFromIframe(t){const e=t.data;switch(e.kind){case"contentSize":return this.onContentSizeAvailable(e.size);case"tap":return this.listener.onTap(e.event);case"linkActivated":return this.onLinkActivated(e);case"decorationActivated":return this.listener.onDecorationActivated(e.event)}}onLinkActivated(t){try{const e=new URL(t.href,this.iframe.src);this.listener.onLinkActivated(e.toString(),t.outerHtml)}catch(t){}}onContentSizeAvailable(t){t&&(this.iframe.style.width=t.width+"px",this.iframe.style.height=t.height+"px",this.size=t,this.listener.onIframeLoaded())}}class n{setInitialScale(t){return this.initialScale=t,this}setMinimumScale(t){return this.minimumScale=t,this}setWidth(t){return this.width=t,this}setHeight(t){return this.height=t,this}build(){const t=[];return this.initialScale&&t.push("initial-scale="+this.initialScale),this.minimumScale&&t.push("minimum-scale="+this.minimumScale),this.width&&t.push("width="+this.width),this.height&&t.push("height="+this.height),t.join(", ")}}function o(t,e){return{x:(t.x+e.left-visualViewport.offsetLeft)*visualViewport.scale,y:(t.y+e.top-visualViewport.offsetTop)*visualViewport.scale}}function i(t,e){const r={x:t.left,y:t.top},n={x:t.right,y:t.bottom},i=o(r,e),a=o(n,e);return{left:i.x,top:i.y,right:a.x,bottom:a.y,width:a.x-i.x,height:a.y-i.y}}class a{constructor(t,e,r){this.window=t,this.listener=e,this.decorationManager=r,document.addEventListener("click",(t=>{this.onClick(t)}),!1)}onClick(t){if(t.defaultPrevented)return;let e,r;e=t.target instanceof HTMLElement?this.nearestInteractiveElement(t.target):null,e?e instanceof HTMLAnchorElement&&(this.listener.onLinkActivated(e.href,e.outerHTML),t.stopPropagation(),t.preventDefault()):(r=this.decorationManager?this.decorationManager.handleDecorationClickEvent(t):null,r?this.listener.onDecorationActivated(r):this.listener.onTap(t))}nearestInteractiveElement(t){return null==t?null:-1!=["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(t.nodeName.toLowerCase())||t.hasAttribute("contenteditable")&&"false"!=t.getAttribute("contenteditable").toLowerCase()?t:t.parentElement?this.nearestInteractiveElement(t.parentElement):null}}class s{constructor(t,r,n,s){this.fit="contain",this.insets={top:0,right:0,bottom:0,left:0},this.scale=1,this.listener=s,new a(t,{onTap:t=>{const e={x:(t.clientX-visualViewport.offsetLeft)*visualViewport.scale,y:(t.clientY-visualViewport.offsetTop)*visualViewport.scale};s.onTap({offset:e})},onLinkActivated:t=>{throw Error("No interactive element in the root document.")},onDecorationActivated:t=>{throw Error("No decoration in the root document.")}}),this.metaViewport=n;const u={onIframeLoaded:()=>{this.onIframeLoaded()},onTap:t=>{const e=r.getBoundingClientRect(),n=o(t.offset,e);s.onTap({offset:n})},onLinkActivated:(t,e)=>{s.onLinkActivated(t,e)},onDecorationActivated:t=>{const e=r.getBoundingClientRect(),n=o(t.offset,e),a=i(t.rect,e),u={id:t.id,group:t.group,rect:a,offset:n};s.onDecorationActivated(u)}};this.page=new e(t,r,u)}setMessagePort(t){this.page.setMessagePort(t)}setViewport(t,e){this.viewport==t&&this.insets==e||(this.viewport=t,this.insets=e,this.layout())}setFit(t){this.fit!=t&&(this.fit=t,this.layout())}loadResource(t){this.page.hide(),this.page.loadPage(t)}onIframeLoaded(){this.page.size&&this.layout()}layout(){if(!this.page.size||!this.viewport)return;const t={top:this.insets.top,right:this.insets.right,bottom:this.insets.bottom,left:this.insets.left};this.page.setMargins(t);const e={width:this.viewport.width-this.insets.left-this.insets.right,height:this.viewport.height-this.insets.top-this.insets.bottom},r=function(t,e,r){switch(t){case"contain":return function(t,e){const r=e.width/t.width,n=e.height/t.height;return Math.min(r,n)}(e,r);case"width":return function(t,e){return e.width/t.width}(e,r);case"height":return function(t,e){return e.height/t.height}(e,r)}}(this.fit,this.page.size,e);this.metaViewport.content=(new n).setInitialScale(r).setMinimumScale(r).setWidth(this.page.size.width).setHeight(this.page.size.height).build(),this.scale=r,this.page.show(),this.listener.onLayout()}}class u{setMessagePort(t){this.messagePort=t}registerTemplates(t){this.send({kind:"registerTemplates",templates:t})}addDecoration(t,e){this.send({kind:"addDecoration",decoration:t,group:e})}removeDecoration(t,e){this.send({kind:"removeDecoration",id:t,group:e})}send(t){var e;null===(e=this.messagePort)||void 0===e||e.postMessage(t)}}var c,l;!function(t){t[t.Forwards=1]="Forwards",t[t.Backwards=2]="Backwards"}(c||(c={})),function(t){t[t.FORWARDS=1]="FORWARDS",t[t.BACKWARDS=2]="BACKWARDS"}(l||(l={}));var f=r(5155);r.n(f)().shim();class p{constructor(t){this.selectionListener=t}setMessagePort(t){this.messagePort=t,t.onmessage=t=>{this.onFeedback(t.data)}}requestSelection(t){this.send({kind:"requestSelection",requestId:t})}clearSelection(){this.send({kind:"clearSelection"})}onFeedback(t){if("selectionAvailable"===t.kind)return this.onSelectionAvailable(t.requestId,t.selection)}onSelectionAvailable(t,e){this.selectionListener.onSelectionAvailable(t,e)}send(t){var e;null===(e=this.messagePort)||void 0===e||e.postMessage(t)}}const y=document.getElementById("page"),h=document.querySelector("meta[name=viewport]");window.singleArea=new class{constructor(e,r,n,o,i){const a=new t(e,o,i);this.manager=new s(e,r,n,a)}setMessagePort(t){this.manager.setMessagePort(t)}loadResource(t){this.manager.loadResource(t)}setViewport(t,e,r,n,o,i){const a={width:t,height:e},s={top:r,left:i,bottom:o,right:n};this.manager.setViewport(a,s)}setFit(t){if("contain"!=t&&"width"!=t&&"height"!=t)throw Error(`Invalid fit value: ${t}`);this.manager.setFit(t)}}(window,y,h,window.gestures,window.documentState),window.singleSelection=new class{constructor(t,e){this.iframe=t,this.listener=e;const r={onSelectionAvailable:(t,e)=>{let r;r=e?function(t,e){const r=e.getBoundingClientRect(),n=i(t.selectionRect,r);return{selectedText:null==t?void 0:t.selectedText,selectionRect:n,textBefore:t.textBefore,textAfter:t.textAfter}}(e,this.iframe):e;const n=JSON.stringify(r);this.listener.onSelectionAvailable(t,n)}};this.wrapper=new p(r)}setMessagePort(t){this.wrapper.setMessagePort(t)}requestSelection(t){this.wrapper.requestSelection(t)}clearSelection(){this.wrapper.clearSelection()}}(y,window.singleSelectionListener),window.singleDecorations=new class{constructor(){this.wrapper=new u}setMessagePort(t){this.wrapper.setMessagePort(t)}registerTemplates(t){const e=function(t){return new Map(Object.entries(JSON.parse(t)))}(t);this.wrapper.registerTemplates(e)}addDecoration(t,e){const r=function(t){return JSON.parse(t)}(t);this.wrapper.addDecoration(r,e)}removeDecoration(t,e){this.wrapper.removeDecoration(t,e)}},window.singleInitialization=new class{constructor(t,e,r,n,o,i){this.window=t,this.listener=e,this.iframe=r,this.areaBridge=n,this.selectionBridge=o,this.decorationsBridge=i}loadResource(t){this.iframe.src=t,this.window.addEventListener("message",(t=>{console.log("message"),t.ports[0]&&t.source===this.iframe.contentWindow&&this.onInitMessage(t)}))}onInitMessage(t){console.log(`receiving init message ${t}`);const e=t.data,r=t.ports[0];switch(e){case"InitAreaManager":return this.initAreaManager(r);case"InitSelection":return this.initSelection(r);case"InitDecorations":return this.initDecorations(r)}}initAreaManager(t){this.areaBridge.setMessagePort(t),this.listener.onAreaApiAvailable()}initSelection(t){this.selectionBridge.setMessagePort(t),this.listener.onSelectionApiAvailable()}initDecorations(t){this.decorationsBridge.setMessagePort(t),this.listener.onDecorationApiAvailable()}}(window,window.fixedApiState,y,window.singleArea,window.singleSelection,window.singleDecorations),window.fixedApiState.onInitializationApiAvailable()}()}(); //# sourceMappingURL=fixed-single-script.js.map \ No newline at end of file diff --git a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/fixed-single-script.js.map b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/fixed-single-script.js.map index 8c52ab532f..ec003bac34 100644 --- a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/fixed-single-script.js.map +++ b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/fixed-single-script.js.map @@ -1 +1 @@ -{"version":3,"file":"fixed-single-script.js","mappings":"qDAEA,IAAIA,EAAe,EAAQ,MAEvBC,EAAW,EAAQ,MAEnBC,EAAWD,EAASD,EAAa,6BAErCG,EAAOC,QAAU,SAA4BC,EAAMC,GAClD,IAAIC,EAAYP,EAAaK,IAAQC,GACrC,MAAyB,mBAAdC,GAA4BL,EAASG,EAAM,gBAAkB,EAChEJ,EAASM,GAEVA,CACR,C,oCCZA,IAAIC,EAAO,EAAQ,MACfR,EAAe,EAAQ,MAEvBS,EAAST,E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AiB,WAAY3E,IACrCwK,QAAQC,IAAI,WACPzK,EAAM0K,MAAM,IAGb1K,EAAMhI,SAAW3Y,KAAKkiB,OAAOO,eAC7BziB,KAAKsrB,cAAc3K,EACvB,GAER,CACA,aAAA2K,CAAc3K,GACVwK,QAAQC,IAAI,0BAA0BzK,KACtC,MAAM4K,EAAc5K,EAAMoD,KACpBpB,EAAchC,EAAM0K,MAAM,GAChC,OAAQE,GACJ,IAAK,kBACD,OAAOvrB,KAAKwrB,gBAAgB7I,GAChC,IAAK,gBACD,OAAO3iB,KAAKyrB,cAAc9I,GAC9B,IAAK,kBACD,OAAO3iB,KAAK0rB,gBAAgB/I,GAExC,CACA,eAAA6I,CAAgB7I,GACZ3iB,KAAKgrB,WAAWtI,eAAeC,GAC/B3iB,KAAKmiB,SAASwJ,oBAClB,CACA,aAAAF,CAAc9I,GACV3iB,KAAKirB,gBAAgBvI,eAAeC,GACpC3iB,KAAKmiB,SAASyJ,yBAClB,CACA,eAAAF,CAAgB/I,GACZ3iB,KAAKkrB,kBAAkBxI,eAAeC,GACtC3iB,KAAKmiB,SAAS0J,0BAClB,GJlC8DjY,OAAQA,OAAOkY,cAAe5J,EAAQtO,OAAO4V,WAAY5V,OAAOwW,gBAAiBxW,OAAO6W,mBAC1J7W,OAAOkY,cAAcC,8B","sources":["webpack://readium-js/./node_modules/.pnpm/call-bind@1.0.2/node_modules/call-bind/callBound.js","webpack://readium-js/./node_modules/.pnpm/call-bind@1.0.2/node_modules/call-bind/index.js","webpack://readium-js/./node_modules/.pnpm/define-data-property@1.1.0/node_modules/define-data-property/index.js","webpack://readium-js/./node_modules/.pnpm/define-properties@1.2.1/node_modules/define-properties/index.js","webpack://readium-js/./node_modules/.pnpm/es-set-tostringtag@2.0.1/node_modules/es-set-tostringtag/index.js","webpack://readium-js/./node_modules/.pnpm/es-to-primitive@1.2.1/node_modules/es-to-primitive/es2015.js","webpack://readium-js/./node_modules/.pnpm/es-to-primitive@1.2.1/node_modules/es-to-primitive/helpers/isPrimitive.js","webpack://readium-js/./node_modules/.pnpm/function-bind@1.1.1/node_modules/function-bind/implementation.js","webpack://readium-js/./node_modules/.pnpm/function-bind@1.1.1/node_modules/function-bind/index.js","webpack://readium-js/./node_modules/.pnpm/functions-have-names@1.2.3/node_modules/functions-have-names/index.js","webpack://readium-js/./node_modules/.pnpm/get-intrinsic@1.2.1/node_modules/get-intrinsic/index.js","webpack://readium-js/./node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.js","webpack://readium-js/./node_modules/.pnpm/has-property-descriptors@1.0.0/node_modules/has-property-descriptors/index.js","webpack://readium-js/./node_modules/.pnpm/has-proto@1.0.1/node_modules/has-proto/index.js","webpack://readium-js/./node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/index.js","webpack://readium-js/./node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/shams.js","webpack://readium-js/./node_modules/.pnpm/has-tostringtag@1.0.0/node_modules/has-tostringtag/shams.js","webpack://readium-js/./node_modules/.pnpm/has@1.0.4/node_modules/has/src/index.js","webpack://readium-js/./node_modules/.pnpm/internal-slot@1.0.5/node_modules/internal-slot/index.js","webpack://readium-js/./node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/index.js","webpack://readium-js/./node_modules/.pnpm/is-date-object@1.0.5/node_modules/is-date-object/index.js","webpack://readium-js/./node_modules/.pnpm/is-regex@1.1.4/node_modules/is-regex/index.js","webpack://readium-js/./node_modules/.pnpm/is-symbol@1.0.4/node_modules/is-symbol/index.js","webpack://readium-js/./node_modules/.pnpm/object-inspect@1.12.3/node_modules/object-inspect/index.js","webpack://readium-js/./node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/implementation.js","webpack://readium-js/./node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/index.js","webpack://readium-js/./node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/isArguments.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/implementation.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/index.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/polyfill.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/shim.js","webpack://readium-js/./node_modules/.pnpm/safe-regex-test@1.0.0/node_modules/safe-regex-test/index.js","webpack://readium-js/./node_modules/.pnpm/set-function-name@2.0.1/node_modules/set-function-name/index.js","webpack://readium-js/./node_modules/.pnpm/side-channel@1.0.4/node_modules/side-channel/index.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/implementation.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/index.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/polyfill-regexp-matchall.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/polyfill.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/regexp-matchall.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/shim.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/implementation.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/index.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/polyfill.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/shim.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/AdvanceStringIndex.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Call.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CodePointAt.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CreateIterResultObject.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CreateMethodProperty.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CreateRegExpStringIterator.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/DefinePropertyOrThrow.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/FromPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Get.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/GetMethod.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/GetV.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsAccessorDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsArray.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsCallable.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsConstructor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsDataDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsPropertyKey.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsRegExp.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/OrdinaryObjectCreate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/RegExpExec.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/RequireObjectCoercible.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/SameValue.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Set.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/SpeciesConstructor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/StringToNumber.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToBoolean.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToIntegerOrInfinity.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToLength.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToNumber.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToPrimitive.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToString.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Type.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/UTF16SurrogatePairToCodePoint.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/floor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/truncate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/5/CheckObjectCoercible.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/5/Type.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/GetIntrinsic.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/DefineOwnProperty.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/IsArray.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/assertRecord.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/forEach.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/fromPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isFinite.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isInteger.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isLeadingSurrogate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isMatchRecord.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isNaN.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isPrimitive.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isTrailingSurrogate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/maxSafeInteger.js","webpack://readium-js/webpack/bootstrap","webpack://readium-js/webpack/runtime/compat get default export","webpack://readium-js/webpack/runtime/define property getters","webpack://readium-js/webpack/runtime/hasOwnProperty shorthand","webpack://readium-js/./src/bridge/all-listener-bridge.ts","webpack://readium-js/./src/fixed/page-manager.ts","webpack://readium-js/./src/util/viewport.ts","webpack://readium-js/./src/common/geometry.ts","webpack://readium-js/./src/common/gestures.ts","webpack://readium-js/./src/fixed/single-area-manager.ts","webpack://readium-js/./src/fixed/fit.ts","webpack://readium-js/./src/fixed/decoration-wrapper.ts","webpack://readium-js/./src/vendor/hypothesis/annotator/anchoring/trim-range.ts","webpack://readium-js/./src/vendor/hypothesis/annotator/anchoring/text-range.ts","webpack://readium-js/./src/common/selection.ts","webpack://readium-js/./src/fixed/selection-wrapper.ts","webpack://readium-js/./src/index-fixed-single.ts","webpack://readium-js/./src/bridge/fixed-area-bridge.ts","webpack://readium-js/./src/bridge/all-selection-bridge.ts","webpack://readium-js/./src/bridge/all-decoration-bridge.ts","webpack://readium-js/./src/bridge/all-initialization-bridge.ts"],"sourcesContent":["'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBind = require('./');\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = null;\n\t}\n}\n\nmodule.exports = function callBind(originalFunction) {\n\tvar func = $reflectApply(bind, $call, arguments);\n\tif ($gOPD && $defineProperty) {\n\t\tvar desc = $gOPD(func, 'length');\n\t\tif (desc.configurable) {\n\t\t\t// original length, plus the receiver, minus any additional arguments (after the receiver)\n\t\t\t$defineProperty(\n\t\t\t\tfunc,\n\t\t\t\t'length',\n\t\t\t\t{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }\n\t\t\t);\n\t\t}\n\t}\n\treturn func;\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","'use strict';\n\nvar hasPropertyDescriptors = require('has-property-descriptors')();\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = hasPropertyDescriptors && GetIntrinsic('%Object.defineProperty%', true);\n\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar gopd = require('gopd');\n\n/** @type {(obj: Record, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */\nmodule.exports = function defineDataProperty(\n\tobj,\n\tproperty,\n\tvalue\n) {\n\tif (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n\t\tthrow new $TypeError('`obj` must be an object or a function`');\n\t}\n\tif (typeof property !== 'string' && typeof property !== 'symbol') {\n\t\tthrow new $TypeError('`property` must be a string or a symbol`');\n\t}\n\tif (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {\n\t\tthrow new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {\n\t\tthrow new $TypeError('`nonWritable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {\n\t\tthrow new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 6 && typeof arguments[6] !== 'boolean') {\n\t\tthrow new $TypeError('`loose`, if provided, must be a boolean');\n\t}\n\n\tvar nonEnumerable = arguments.length > 3 ? arguments[3] : null;\n\tvar nonWritable = arguments.length > 4 ? arguments[4] : null;\n\tvar nonConfigurable = arguments.length > 5 ? arguments[5] : null;\n\tvar loose = arguments.length > 6 ? arguments[6] : false;\n\n\t/* @type {false | TypedPropertyDescriptor} */\n\tvar desc = !!gopd && gopd(obj, property);\n\n\tif ($defineProperty) {\n\t\t$defineProperty(obj, property, {\n\t\t\tconfigurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,\n\t\t\tenumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,\n\t\t\tvalue: value,\n\t\t\twritable: nonWritable === null && desc ? desc.writable : !nonWritable\n\t\t});\n\t} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {\n\t\t// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable\n\t\tobj[property] = value; // eslint-disable-line no-param-reassign\n\t} else {\n\t\tthrow new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');\n\t}\n};\n","'use strict';\n\nvar keys = require('object-keys');\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';\n\nvar toStr = Object.prototype.toString;\nvar concat = Array.prototype.concat;\nvar defineDataProperty = require('define-data-property');\n\nvar isFunction = function (fn) {\n\treturn typeof fn === 'function' && toStr.call(fn) === '[object Function]';\n};\n\nvar supportsDescriptors = require('has-property-descriptors')();\n\nvar defineProperty = function (object, name, value, predicate) {\n\tif (name in object) {\n\t\tif (predicate === true) {\n\t\t\tif (object[name] === value) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (!isFunction(predicate) || !predicate()) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (supportsDescriptors) {\n\t\tdefineDataProperty(object, name, value, true);\n\t} else {\n\t\tdefineDataProperty(object, name, value);\n\t}\n};\n\nvar defineProperties = function (object, map) {\n\tvar predicates = arguments.length > 2 ? arguments[2] : {};\n\tvar props = keys(map);\n\tif (hasSymbols) {\n\t\tprops = concat.call(props, Object.getOwnPropertySymbols(map));\n\t}\n\tfor (var i = 0; i < props.length; i += 1) {\n\t\tdefineProperty(object, props[i], map[props[i]], predicates[props[i]]);\n\t}\n};\n\ndefineProperties.supportsDescriptors = !!supportsDescriptors;\n\nmodule.exports = defineProperties;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar has = require('has');\n\nvar toStringTag = hasToStringTag ? Symbol.toStringTag : null;\n\nmodule.exports = function setToStringTag(object, value) {\n\tvar overrideIfSet = arguments.length > 2 && arguments[2] && arguments[2].force;\n\tif (toStringTag && (overrideIfSet || !has(object, toStringTag))) {\n\t\tif ($defineProperty) {\n\t\t\t$defineProperty(object, toStringTag, {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: false,\n\t\t\t\tvalue: value,\n\t\t\t\twritable: false\n\t\t\t});\n\t\t} else {\n\t\t\tobject[toStringTag] = value; // eslint-disable-line no-param-reassign\n\t\t}\n\t}\n};\n","'use strict';\n\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';\n\nvar isPrimitive = require('./helpers/isPrimitive');\nvar isCallable = require('is-callable');\nvar isDate = require('is-date-object');\nvar isSymbol = require('is-symbol');\n\nvar ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) {\n\tif (typeof O === 'undefined' || O === null) {\n\t\tthrow new TypeError('Cannot call method on ' + O);\n\t}\n\tif (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) {\n\t\tthrow new TypeError('hint must be \"string\" or \"number\"');\n\t}\n\tvar methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString'];\n\tvar method, result, i;\n\tfor (i = 0; i < methodNames.length; ++i) {\n\t\tmethod = O[methodNames[i]];\n\t\tif (isCallable(method)) {\n\t\t\tresult = method.call(O);\n\t\t\tif (isPrimitive(result)) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t}\n\tthrow new TypeError('No default value');\n};\n\nvar GetMethod = function GetMethod(O, P) {\n\tvar func = O[P];\n\tif (func !== null && typeof func !== 'undefined') {\n\t\tif (!isCallable(func)) {\n\t\t\tthrow new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function');\n\t\t}\n\t\treturn func;\n\t}\n\treturn void 0;\n};\n\n// http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive\nmodule.exports = function ToPrimitive(input) {\n\tif (isPrimitive(input)) {\n\t\treturn input;\n\t}\n\tvar hint = 'default';\n\tif (arguments.length > 1) {\n\t\tif (arguments[1] === String) {\n\t\t\thint = 'string';\n\t\t} else if (arguments[1] === Number) {\n\t\t\thint = 'number';\n\t\t}\n\t}\n\n\tvar exoticToPrim;\n\tif (hasSymbols) {\n\t\tif (Symbol.toPrimitive) {\n\t\t\texoticToPrim = GetMethod(input, Symbol.toPrimitive);\n\t\t} else if (isSymbol(input)) {\n\t\t\texoticToPrim = Symbol.prototype.valueOf;\n\t\t}\n\t}\n\tif (typeof exoticToPrim !== 'undefined') {\n\t\tvar result = exoticToPrim.call(input, hint);\n\t\tif (isPrimitive(result)) {\n\t\t\treturn result;\n\t\t}\n\t\tthrow new TypeError('unable to convert exotic object to primitive');\n\t}\n\tif (hint === 'default' && (isDate(input) || isSymbol(input))) {\n\t\thint = 'string';\n\t}\n\treturn ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint);\n};\n","'use strict';\n\nmodule.exports = function isPrimitive(value) {\n\treturn value === null || (typeof value !== 'function' && typeof value !== 'object');\n};\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slice.call(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n args.concat(slice.call(arguments))\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n } else {\n return target.apply(\n that,\n args.concat(slice.call(arguments))\n );\n }\n };\n\n var boundLength = Math.max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs.push('$' + i);\n }\n\n bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\nvar functionsHaveNames = function functionsHaveNames() {\n\treturn typeof function f() {}.name === 'string';\n};\n\nvar gOPD = Object.getOwnPropertyDescriptor;\nif (gOPD) {\n\ttry {\n\t\tgOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\tgOPD = null;\n\t}\n}\n\nfunctionsHaveNames.functionsHaveConfigurableNames = function functionsHaveConfigurableNames() {\n\tif (!functionsHaveNames() || !gOPD) {\n\t\treturn false;\n\t}\n\tvar desc = gOPD(function () {}, 'name');\n\treturn !!desc && !!desc.configurable;\n};\n\nvar $bind = Function.prototype.bind;\n\nfunctionsHaveNames.boundFunctionsHaveNames = function boundFunctionsHaveNames() {\n\treturn functionsHaveNames() && typeof $bind === 'function' && function f() {}.bind().name !== '';\n};\n\nmodule.exports = functionsHaveNames;\n","'use strict';\n\nvar undefined;\n\nvar $SyntaxError = SyntaxError;\nvar $Function = Function;\nvar $TypeError = TypeError;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\nif ($gOPD) {\n\ttry {\n\t\t$gOPD({}, '');\n\t} catch (e) {\n\t\t$gOPD = null; // this is IE 8, which has a broken gOPD\n\t}\n}\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\nvar hasProto = require('has-proto')();\n\nvar getProto = Object.getPrototypeOf || (\n\thasProto\n\t\t? function (x) { return x.__proto__; } // eslint-disable-line no-proto\n\t\t: null\n);\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,\n\t'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': EvalError,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': Object,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': RangeError,\n\t'%ReferenceError%': ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nif (getProto) {\n\ttry {\n\t\tnull.error; // eslint-disable-line no-unused-expressions\n\t} catch (e) {\n\t\t// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n\t\tvar errorProto = getProto(getProto(e));\n\t\tINTRINSICS['%Error.prototype%'] = errorProto;\n\t}\n}\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen && getProto) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('has');\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\nvar $exec = bind.call(Function.call, RegExp.prototype.exec);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tif ($exec(/^%?[^%]*%?$/, name) === null) {\n\t\tthrow new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');\n\t}\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\n\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasPropertyDescriptors = function hasPropertyDescriptors() {\n\tif ($defineProperty) {\n\t\ttry {\n\t\t\t$defineProperty({}, 'a', { value: 1 });\n\t\t\treturn true;\n\t\t} catch (e) {\n\t\t\t// IE 8 has a broken defineProperty\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn false;\n};\n\nhasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {\n\t// node v0.6 has a bug where array lengths can be Set but not Defined\n\tif (!hasPropertyDescriptors()) {\n\t\treturn null;\n\t}\n\ttry {\n\t\treturn $defineProperty([], 'length', { value: 1 }).length !== 1;\n\t} catch (e) {\n\t\t// In Firefox 4-22, defining length on an array throws an exception.\n\t\treturn true;\n\t}\n};\n\nmodule.exports = hasPropertyDescriptors;\n","'use strict';\n\nvar test = {\n\tfoo: {}\n};\n\nvar $Object = Object;\n\nmodule.exports = function hasProto() {\n\treturn { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar hasSymbols = require('has-symbols/shams');\n\nmodule.exports = function hasToStringTagShams() {\n\treturn hasSymbols() && !!Symbol.toStringTag;\n};\n","'use strict';\n\nvar hasOwnProperty = {}.hasOwnProperty;\nvar call = Function.prototype.call;\n\nmodule.exports = call.bind ? call.bind(hasOwnProperty) : function (O, P) {\n return call.call(hasOwnProperty, O, P);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar has = require('has');\nvar channel = require('side-channel')();\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar SLOT = {\n\tassert: function (O, slot) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tchannel.assert(O);\n\t\tif (!SLOT.has(O, slot)) {\n\t\t\tthrow new $TypeError('`' + slot + '` is not present on `O`');\n\t\t}\n\t},\n\tget: function (O, slot) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tvar slots = channel.get(O);\n\t\treturn slots && slots['$' + slot];\n\t},\n\thas: function (O, slot) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tvar slots = channel.get(O);\n\t\treturn !!slots && has(slots, '$' + slot);\n\t},\n\tset: function (O, slot, V) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tvar slots = channel.get(O);\n\t\tif (!slots) {\n\t\t\tslots = {};\n\t\t\tchannel.set(O, slots);\n\t\t}\n\t\tslots['$' + slot] = V;\n\t}\n};\n\nif (Object.freeze) {\n\tObject.freeze(SLOT);\n}\n\nmodule.exports = SLOT;\n","'use strict';\n\nvar fnToStr = Function.prototype.toString;\nvar reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;\nvar badArrayLike;\nvar isCallableMarker;\nif (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {\n\ttry {\n\t\tbadArrayLike = Object.defineProperty({}, 'length', {\n\t\t\tget: function () {\n\t\t\t\tthrow isCallableMarker;\n\t\t\t}\n\t\t});\n\t\tisCallableMarker = {};\n\t\t// eslint-disable-next-line no-throw-literal\n\t\treflectApply(function () { throw 42; }, null, badArrayLike);\n\t} catch (_) {\n\t\tif (_ !== isCallableMarker) {\n\t\t\treflectApply = null;\n\t\t}\n\t}\n} else {\n\treflectApply = null;\n}\n\nvar constructorRegex = /^\\s*class\\b/;\nvar isES6ClassFn = function isES6ClassFunction(value) {\n\ttry {\n\t\tvar fnStr = fnToStr.call(value);\n\t\treturn constructorRegex.test(fnStr);\n\t} catch (e) {\n\t\treturn false; // not a function\n\t}\n};\n\nvar tryFunctionObject = function tryFunctionToStr(value) {\n\ttry {\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tfnToStr.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\nvar toStr = Object.prototype.toString;\nvar objectClass = '[object Object]';\nvar fnClass = '[object Function]';\nvar genClass = '[object GeneratorFunction]';\nvar ddaClass = '[object HTMLAllCollection]'; // IE 11\nvar ddaClass2 = '[object HTML document.all class]';\nvar ddaClass3 = '[object HTMLCollection]'; // IE 9-10\nvar hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag`\n\nvar isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing\n\nvar isDDA = function isDocumentDotAll() { return false; };\nif (typeof document === 'object') {\n\t// Firefox 3 canonicalizes DDA to undefined when it's not accessed directly\n\tvar all = document.all;\n\tif (toStr.call(all) === toStr.call(document.all)) {\n\t\tisDDA = function isDocumentDotAll(value) {\n\t\t\t/* globals document: false */\n\t\t\t// in IE 6-8, typeof document.all is \"object\" and it's truthy\n\t\t\tif ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) {\n\t\t\t\ttry {\n\t\t\t\t\tvar str = toStr.call(value);\n\t\t\t\t\treturn (\n\t\t\t\t\t\tstr === ddaClass\n\t\t\t\t\t\t|| str === ddaClass2\n\t\t\t\t\t\t|| str === ddaClass3 // opera 12.16\n\t\t\t\t\t\t|| str === objectClass // IE 6-8\n\t\t\t\t\t) && value('') == null; // eslint-disable-line eqeqeq\n\t\t\t\t} catch (e) { /**/ }\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\t}\n}\n\nmodule.exports = reflectApply\n\t? function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\ttry {\n\t\t\treflectApply(value, null, badArrayLike);\n\t\t} catch (e) {\n\t\t\tif (e !== isCallableMarker) { return false; }\n\t\t}\n\t\treturn !isES6ClassFn(value) && tryFunctionObject(value);\n\t}\n\t: function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\tif (hasToStringTag) { return tryFunctionObject(value); }\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tvar strClass = toStr.call(value);\n\t\tif (strClass !== fnClass && strClass !== genClass && !(/^\\[object HTML/).test(strClass)) { return false; }\n\t\treturn tryFunctionObject(value);\n\t};\n","'use strict';\n\nvar getDay = Date.prototype.getDay;\nvar tryDateObject = function tryDateGetDayCall(value) {\n\ttry {\n\t\tgetDay.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\n\nvar toStr = Object.prototype.toString;\nvar dateClass = '[object Date]';\nvar hasToStringTag = require('has-tostringtag/shams')();\n\nmodule.exports = function isDateObject(value) {\n\tif (typeof value !== 'object' || value === null) {\n\t\treturn false;\n\t}\n\treturn hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass;\n};\n","'use strict';\n\nvar callBound = require('call-bind/callBound');\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar has;\nvar $exec;\nvar isRegexMarker;\nvar badStringifier;\n\nif (hasToStringTag) {\n\thas = callBound('Object.prototype.hasOwnProperty');\n\t$exec = callBound('RegExp.prototype.exec');\n\tisRegexMarker = {};\n\n\tvar throwRegexMarker = function () {\n\t\tthrow isRegexMarker;\n\t};\n\tbadStringifier = {\n\t\ttoString: throwRegexMarker,\n\t\tvalueOf: throwRegexMarker\n\t};\n\n\tif (typeof Symbol.toPrimitive === 'symbol') {\n\t\tbadStringifier[Symbol.toPrimitive] = throwRegexMarker;\n\t}\n}\n\nvar $toString = callBound('Object.prototype.toString');\nvar gOPD = Object.getOwnPropertyDescriptor;\nvar regexClass = '[object RegExp]';\n\nmodule.exports = hasToStringTag\n\t// eslint-disable-next-line consistent-return\n\t? function isRegex(value) {\n\t\tif (!value || typeof value !== 'object') {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar descriptor = gOPD(value, 'lastIndex');\n\t\tvar hasLastIndexDataProperty = descriptor && has(descriptor, 'value');\n\t\tif (!hasLastIndexDataProperty) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\t$exec(value, badStringifier);\n\t\t} catch (e) {\n\t\t\treturn e === isRegexMarker;\n\t\t}\n\t}\n\t: function isRegex(value) {\n\t\t// In older browsers, typeof regex incorrectly returns 'function'\n\t\tif (!value || (typeof value !== 'object' && typeof value !== 'function')) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $toString(value) === regexClass;\n\t};\n","'use strict';\n\nvar toStr = Object.prototype.toString;\nvar hasSymbols = require('has-symbols')();\n\nif (hasSymbols) {\n\tvar symToStr = Symbol.prototype.toString;\n\tvar symStringRegex = /^Symbol\\(.*\\)$/;\n\tvar isSymbolObject = function isRealSymbolObject(value) {\n\t\tif (typeof value.valueOf() !== 'symbol') {\n\t\t\treturn false;\n\t\t}\n\t\treturn symStringRegex.test(symToStr.call(value));\n\t};\n\n\tmodule.exports = function isSymbol(value) {\n\t\tif (typeof value === 'symbol') {\n\t\t\treturn true;\n\t\t}\n\t\tif (toStr.call(value) !== '[object Symbol]') {\n\t\t\treturn false;\n\t\t}\n\t\ttry {\n\t\t\treturn isSymbolObject(value);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n} else {\n\n\tmodule.exports = function isSymbol(value) {\n\t\t// this environment does not support Symbols.\n\t\treturn false && value;\n\t};\n}\n","var hasMap = typeof Map === 'function' && Map.prototype;\nvar mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;\nvar mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;\nvar mapForEach = hasMap && Map.prototype.forEach;\nvar hasSet = typeof Set === 'function' && Set.prototype;\nvar setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;\nvar setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;\nvar setForEach = hasSet && Set.prototype.forEach;\nvar hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;\nvar weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;\nvar hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;\nvar weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;\nvar hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;\nvar weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;\nvar booleanValueOf = Boolean.prototype.valueOf;\nvar objectToString = Object.prototype.toString;\nvar functionToString = Function.prototype.toString;\nvar $match = String.prototype.match;\nvar $slice = String.prototype.slice;\nvar $replace = String.prototype.replace;\nvar $toUpperCase = String.prototype.toUpperCase;\nvar $toLowerCase = String.prototype.toLowerCase;\nvar $test = RegExp.prototype.test;\nvar $concat = Array.prototype.concat;\nvar $join = Array.prototype.join;\nvar $arrSlice = Array.prototype.slice;\nvar $floor = Math.floor;\nvar bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;\nvar gOPS = Object.getOwnPropertySymbols;\nvar symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;\nvar hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';\n// ie, `has-tostringtag/shams\nvar toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')\n ? Symbol.toStringTag\n : null;\nvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\nvar gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (\n [].__proto__ === Array.prototype // eslint-disable-line no-proto\n ? function (O) {\n return O.__proto__; // eslint-disable-line no-proto\n }\n : null\n);\n\nfunction addNumericSeparator(num, str) {\n if (\n num === Infinity\n || num === -Infinity\n || num !== num\n || (num && num > -1000 && num < 1000)\n || $test.call(/e/, str)\n ) {\n return str;\n }\n var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;\n if (typeof num === 'number') {\n var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)\n if (int !== num) {\n var intStr = String(int);\n var dec = $slice.call(str, intStr.length + 1);\n return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');\n }\n }\n return $replace.call(str, sepRegex, '$&_');\n}\n\nvar utilInspect = require('./util.inspect');\nvar inspectCustom = utilInspect.custom;\nvar inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;\n\nmodule.exports = function inspect_(obj, options, depth, seen) {\n var opts = options || {};\n\n if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {\n throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');\n }\n if (\n has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'\n ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity\n : opts.maxStringLength !== null\n )\n ) {\n throw new TypeError('option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`');\n }\n var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;\n if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {\n throw new TypeError('option \"customInspect\", if provided, must be `true`, `false`, or `\\'symbol\\'`');\n }\n\n if (\n has(opts, 'indent')\n && opts.indent !== null\n && opts.indent !== '\\t'\n && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)\n ) {\n throw new TypeError('option \"indent\" must be \"\\\\t\", an integer > 0, or `null`');\n }\n if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {\n throw new TypeError('option \"numericSeparator\", if provided, must be `true` or `false`');\n }\n var numericSeparator = opts.numericSeparator;\n\n if (typeof obj === 'undefined') {\n return 'undefined';\n }\n if (obj === null) {\n return 'null';\n }\n if (typeof obj === 'boolean') {\n return obj ? 'true' : 'false';\n }\n\n if (typeof obj === 'string') {\n return inspectString(obj, opts);\n }\n if (typeof obj === 'number') {\n if (obj === 0) {\n return Infinity / obj > 0 ? '0' : '-0';\n }\n var str = String(obj);\n return numericSeparator ? addNumericSeparator(obj, str) : str;\n }\n if (typeof obj === 'bigint') {\n var bigIntStr = String(obj) + 'n';\n return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;\n }\n\n var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;\n if (typeof depth === 'undefined') { depth = 0; }\n if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {\n return isArray(obj) ? '[Array]' : '[Object]';\n }\n\n var indent = getIndent(opts, depth);\n\n if (typeof seen === 'undefined') {\n seen = [];\n } else if (indexOf(seen, obj) >= 0) {\n return '[Circular]';\n }\n\n function inspect(value, from, noIndent) {\n if (from) {\n seen = $arrSlice.call(seen);\n seen.push(from);\n }\n if (noIndent) {\n var newOpts = {\n depth: opts.depth\n };\n if (has(opts, 'quoteStyle')) {\n newOpts.quoteStyle = opts.quoteStyle;\n }\n return inspect_(value, newOpts, depth + 1, seen);\n }\n return inspect_(value, opts, depth + 1, seen);\n }\n\n if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable\n var name = nameOf(obj);\n var keys = arrObjKeys(obj, inspect);\n return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');\n }\n if (isSymbol(obj)) {\n var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\\(.*\\))_[^)]*$/, '$1') : symToString.call(obj);\n return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;\n }\n if (isElement(obj)) {\n var s = '<' + $toLowerCase.call(String(obj.nodeName));\n var attrs = obj.attributes || [];\n for (var i = 0; i < attrs.length; i++) {\n s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);\n }\n s += '>';\n if (obj.childNodes && obj.childNodes.length) { s += '...'; }\n s += '';\n return s;\n }\n if (isArray(obj)) {\n if (obj.length === 0) { return '[]'; }\n var xs = arrObjKeys(obj, inspect);\n if (indent && !singleLineValues(xs)) {\n return '[' + indentedJoin(xs, indent) + ']';\n }\n return '[ ' + $join.call(xs, ', ') + ' ]';\n }\n if (isError(obj)) {\n var parts = arrObjKeys(obj, inspect);\n if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {\n return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';\n }\n if (parts.length === 0) { return '[' + String(obj) + ']'; }\n return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';\n }\n if (typeof obj === 'object' && customInspect) {\n if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {\n return utilInspect(obj, { depth: maxDepth - depth });\n } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {\n return obj.inspect();\n }\n }\n if (isMap(obj)) {\n var mapParts = [];\n if (mapForEach) {\n mapForEach.call(obj, function (value, key) {\n mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));\n });\n }\n return collectionOf('Map', mapSize.call(obj), mapParts, indent);\n }\n if (isSet(obj)) {\n var setParts = [];\n if (setForEach) {\n setForEach.call(obj, function (value) {\n setParts.push(inspect(value, obj));\n });\n }\n return collectionOf('Set', setSize.call(obj), setParts, indent);\n }\n if (isWeakMap(obj)) {\n return weakCollectionOf('WeakMap');\n }\n if (isWeakSet(obj)) {\n return weakCollectionOf('WeakSet');\n }\n if (isWeakRef(obj)) {\n return weakCollectionOf('WeakRef');\n }\n if (isNumber(obj)) {\n return markBoxed(inspect(Number(obj)));\n }\n if (isBigInt(obj)) {\n return markBoxed(inspect(bigIntValueOf.call(obj)));\n }\n if (isBoolean(obj)) {\n return markBoxed(booleanValueOf.call(obj));\n }\n if (isString(obj)) {\n return markBoxed(inspect(String(obj)));\n }\n if (!isDate(obj) && !isRegExp(obj)) {\n var ys = arrObjKeys(obj, inspect);\n var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;\n var protoTag = obj instanceof Object ? '' : 'null prototype';\n var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';\n var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';\n var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');\n if (ys.length === 0) { return tag + '{}'; }\n if (indent) {\n return tag + '{' + indentedJoin(ys, indent) + '}';\n }\n return tag + '{ ' + $join.call(ys, ', ') + ' }';\n }\n return String(obj);\n};\n\nfunction wrapQuotes(s, defaultStyle, opts) {\n var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '\"' : \"'\";\n return quoteChar + s + quoteChar;\n}\n\nfunction quote(s) {\n return $replace.call(String(s), /\"/g, '"');\n}\n\nfunction isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\n\n// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives\nfunction isSymbol(obj) {\n if (hasShammedSymbols) {\n return obj && typeof obj === 'object' && obj instanceof Symbol;\n }\n if (typeof obj === 'symbol') {\n return true;\n }\n if (!obj || typeof obj !== 'object' || !symToString) {\n return false;\n }\n try {\n symToString.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isBigInt(obj) {\n if (!obj || typeof obj !== 'object' || !bigIntValueOf) {\n return false;\n }\n try {\n bigIntValueOf.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };\nfunction has(obj, key) {\n return hasOwn.call(obj, key);\n}\n\nfunction toStr(obj) {\n return objectToString.call(obj);\n}\n\nfunction nameOf(f) {\n if (f.name) { return f.name; }\n var m = $match.call(functionToString.call(f), /^function\\s*([\\w$]+)/);\n if (m) { return m[1]; }\n return null;\n}\n\nfunction indexOf(xs, x) {\n if (xs.indexOf) { return xs.indexOf(x); }\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) { return i; }\n }\n return -1;\n}\n\nfunction isMap(x) {\n if (!mapSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n mapSize.call(x);\n try {\n setSize.call(x);\n } catch (s) {\n return true;\n }\n return x instanceof Map; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakMap(x) {\n if (!weakMapHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakMapHas.call(x, weakMapHas);\n try {\n weakSetHas.call(x, weakSetHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakMap; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakRef(x) {\n if (!weakRefDeref || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakRefDeref.call(x);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isSet(x) {\n if (!setSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n setSize.call(x);\n try {\n mapSize.call(x);\n } catch (m) {\n return true;\n }\n return x instanceof Set; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakSet(x) {\n if (!weakSetHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakSetHas.call(x, weakSetHas);\n try {\n weakMapHas.call(x, weakMapHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakSet; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isElement(x) {\n if (!x || typeof x !== 'object') { return false; }\n if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {\n return true;\n }\n return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';\n}\n\nfunction inspectString(str, opts) {\n if (str.length > opts.maxStringLength) {\n var remaining = str.length - opts.maxStringLength;\n var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');\n return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;\n }\n // eslint-disable-next-line no-control-regex\n var s = $replace.call($replace.call(str, /(['\\\\])/g, '\\\\$1'), /[\\x00-\\x1f]/g, lowbyte);\n return wrapQuotes(s, 'single', opts);\n}\n\nfunction lowbyte(c) {\n var n = c.charCodeAt(0);\n var x = {\n 8: 'b',\n 9: 't',\n 10: 'n',\n 12: 'f',\n 13: 'r'\n }[n];\n if (x) { return '\\\\' + x; }\n return '\\\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));\n}\n\nfunction markBoxed(str) {\n return 'Object(' + str + ')';\n}\n\nfunction weakCollectionOf(type) {\n return type + ' { ? }';\n}\n\nfunction collectionOf(type, size, entries, indent) {\n var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');\n return type + ' (' + size + ') {' + joinedEntries + '}';\n}\n\nfunction singleLineValues(xs) {\n for (var i = 0; i < xs.length; i++) {\n if (indexOf(xs[i], '\\n') >= 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction getIndent(opts, depth) {\n var baseIndent;\n if (opts.indent === '\\t') {\n baseIndent = '\\t';\n } else if (typeof opts.indent === 'number' && opts.indent > 0) {\n baseIndent = $join.call(Array(opts.indent + 1), ' ');\n } else {\n return null;\n }\n return {\n base: baseIndent,\n prev: $join.call(Array(depth + 1), baseIndent)\n };\n}\n\nfunction indentedJoin(xs, indent) {\n if (xs.length === 0) { return ''; }\n var lineJoiner = '\\n' + indent.prev + indent.base;\n return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\\n' + indent.prev;\n}\n\nfunction arrObjKeys(obj, inspect) {\n var isArr = isArray(obj);\n var xs = [];\n if (isArr) {\n xs.length = obj.length;\n for (var i = 0; i < obj.length; i++) {\n xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';\n }\n }\n var syms = typeof gOPS === 'function' ? gOPS(obj) : [];\n var symMap;\n if (hasShammedSymbols) {\n symMap = {};\n for (var k = 0; k < syms.length; k++) {\n symMap['$' + syms[k]] = syms[k];\n }\n }\n\n for (var key in obj) { // eslint-disable-line no-restricted-syntax\n if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {\n // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section\n continue; // eslint-disable-line no-restricted-syntax, no-continue\n } else if ($test.call(/[^\\w$]/, key)) {\n xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));\n } else {\n xs.push(key + ': ' + inspect(obj[key], obj));\n }\n }\n if (typeof gOPS === 'function') {\n for (var j = 0; j < syms.length; j++) {\n if (isEnumerable.call(obj, syms[j])) {\n xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));\n }\n }\n }\n return xs;\n}\n","'use strict';\n\nvar keysShim;\nif (!Object.keys) {\n\t// modified from https://github.com/es-shims/es5-shim\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar toStr = Object.prototype.toString;\n\tvar isArgs = require('./isArguments'); // eslint-disable-line global-require\n\tvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\tvar hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');\n\tvar hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');\n\tvar dontEnums = [\n\t\t'toString',\n\t\t'toLocaleString',\n\t\t'valueOf',\n\t\t'hasOwnProperty',\n\t\t'isPrototypeOf',\n\t\t'propertyIsEnumerable',\n\t\t'constructor'\n\t];\n\tvar equalsConstructorPrototype = function (o) {\n\t\tvar ctor = o.constructor;\n\t\treturn ctor && ctor.prototype === o;\n\t};\n\tvar excludedKeys = {\n\t\t$applicationCache: true,\n\t\t$console: true,\n\t\t$external: true,\n\t\t$frame: true,\n\t\t$frameElement: true,\n\t\t$frames: true,\n\t\t$innerHeight: true,\n\t\t$innerWidth: true,\n\t\t$onmozfullscreenchange: true,\n\t\t$onmozfullscreenerror: true,\n\t\t$outerHeight: true,\n\t\t$outerWidth: true,\n\t\t$pageXOffset: true,\n\t\t$pageYOffset: true,\n\t\t$parent: true,\n\t\t$scrollLeft: true,\n\t\t$scrollTop: true,\n\t\t$scrollX: true,\n\t\t$scrollY: true,\n\t\t$self: true,\n\t\t$webkitIndexedDB: true,\n\t\t$webkitStorageInfo: true,\n\t\t$window: true\n\t};\n\tvar hasAutomationEqualityBug = (function () {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined') { return false; }\n\t\tfor (var k in window) {\n\t\t\ttry {\n\t\t\t\tif (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tequalsConstructorPrototype(window[k]);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}());\n\tvar equalsConstructorPrototypeIfNotBuggy = function (o) {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined' || !hasAutomationEqualityBug) {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t}\n\t\ttry {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tkeysShim = function keys(object) {\n\t\tvar isObject = object !== null && typeof object === 'object';\n\t\tvar isFunction = toStr.call(object) === '[object Function]';\n\t\tvar isArguments = isArgs(object);\n\t\tvar isString = isObject && toStr.call(object) === '[object String]';\n\t\tvar theKeys = [];\n\n\t\tif (!isObject && !isFunction && !isArguments) {\n\t\t\tthrow new TypeError('Object.keys called on a non-object');\n\t\t}\n\n\t\tvar skipProto = hasProtoEnumBug && isFunction;\n\t\tif (isString && object.length > 0 && !has.call(object, 0)) {\n\t\t\tfor (var i = 0; i < object.length; ++i) {\n\t\t\t\ttheKeys.push(String(i));\n\t\t\t}\n\t\t}\n\n\t\tif (isArguments && object.length > 0) {\n\t\t\tfor (var j = 0; j < object.length; ++j) {\n\t\t\t\ttheKeys.push(String(j));\n\t\t\t}\n\t\t} else {\n\t\t\tfor (var name in object) {\n\t\t\t\tif (!(skipProto && name === 'prototype') && has.call(object, name)) {\n\t\t\t\t\ttheKeys.push(String(name));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (hasDontEnumBug) {\n\t\t\tvar skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);\n\n\t\t\tfor (var k = 0; k < dontEnums.length; ++k) {\n\t\t\t\tif (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {\n\t\t\t\t\ttheKeys.push(dontEnums[k]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn theKeys;\n\t};\n}\nmodule.exports = keysShim;\n","'use strict';\n\nvar slice = Array.prototype.slice;\nvar isArgs = require('./isArguments');\n\nvar origKeys = Object.keys;\nvar keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');\n\nvar originalKeys = Object.keys;\n\nkeysShim.shim = function shimObjectKeys() {\n\tif (Object.keys) {\n\t\tvar keysWorksWithArguments = (function () {\n\t\t\t// Safari 5.0 bug\n\t\t\tvar args = Object.keys(arguments);\n\t\t\treturn args && args.length === arguments.length;\n\t\t}(1, 2));\n\t\tif (!keysWorksWithArguments) {\n\t\t\tObject.keys = function keys(object) { // eslint-disable-line func-name-matching\n\t\t\t\tif (isArgs(object)) {\n\t\t\t\t\treturn originalKeys(slice.call(object));\n\t\t\t\t}\n\t\t\t\treturn originalKeys(object);\n\t\t\t};\n\t\t}\n\t} else {\n\t\tObject.keys = keysShim;\n\t}\n\treturn Object.keys || keysShim;\n};\n\nmodule.exports = keysShim;\n","'use strict';\n\nvar toStr = Object.prototype.toString;\n\nmodule.exports = function isArguments(value) {\n\tvar str = toStr.call(value);\n\tvar isArgs = str === '[object Arguments]';\n\tif (!isArgs) {\n\t\tisArgs = str !== '[object Array]' &&\n\t\t\tvalue !== null &&\n\t\t\ttypeof value === 'object' &&\n\t\t\ttypeof value.length === 'number' &&\n\t\t\tvalue.length >= 0 &&\n\t\t\ttoStr.call(value.callee) === '[object Function]';\n\t}\n\treturn isArgs;\n};\n","'use strict';\n\nvar setFunctionName = require('set-function-name');\n\nvar $Object = Object;\nvar $TypeError = TypeError;\n\nmodule.exports = setFunctionName(function flags() {\n\tif (this != null && this !== $Object(this)) {\n\t\tthrow new $TypeError('RegExp.prototype.flags getter called on non-object');\n\t}\n\tvar result = '';\n\tif (this.hasIndices) {\n\t\tresult += 'd';\n\t}\n\tif (this.global) {\n\t\tresult += 'g';\n\t}\n\tif (this.ignoreCase) {\n\t\tresult += 'i';\n\t}\n\tif (this.multiline) {\n\t\tresult += 'm';\n\t}\n\tif (this.dotAll) {\n\t\tresult += 's';\n\t}\n\tif (this.unicode) {\n\t\tresult += 'u';\n\t}\n\tif (this.unicodeSets) {\n\t\tresult += 'v';\n\t}\n\tif (this.sticky) {\n\t\tresult += 'y';\n\t}\n\treturn result;\n}, 'get flags', true);\n\n","'use strict';\n\nvar define = require('define-properties');\nvar callBind = require('call-bind');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar flagsBound = callBind(getPolyfill());\n\ndefine(flagsBound, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = flagsBound;\n","'use strict';\n\nvar implementation = require('./implementation');\n\nvar supportsDescriptors = require('define-properties').supportsDescriptors;\nvar $gOPD = Object.getOwnPropertyDescriptor;\n\nmodule.exports = function getPolyfill() {\n\tif (supportsDescriptors && (/a/mig).flags === 'gim') {\n\t\tvar descriptor = $gOPD(RegExp.prototype, 'flags');\n\t\tif (\n\t\t\tdescriptor\n\t\t\t&& typeof descriptor.get === 'function'\n\t\t\t&& typeof RegExp.prototype.dotAll === 'boolean'\n\t\t\t&& typeof RegExp.prototype.hasIndices === 'boolean'\n\t\t) {\n\t\t\t/* eslint getter-return: 0 */\n\t\t\tvar calls = '';\n\t\t\tvar o = {};\n\t\t\tObject.defineProperty(o, 'hasIndices', {\n\t\t\t\tget: function () {\n\t\t\t\t\tcalls += 'd';\n\t\t\t\t}\n\t\t\t});\n\t\t\tObject.defineProperty(o, 'sticky', {\n\t\t\t\tget: function () {\n\t\t\t\t\tcalls += 'y';\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (calls === 'dy') {\n\t\t\t\treturn descriptor.get;\n\t\t\t}\n\t\t}\n\t}\n\treturn implementation;\n};\n","'use strict';\n\nvar supportsDescriptors = require('define-properties').supportsDescriptors;\nvar getPolyfill = require('./polyfill');\nvar gOPD = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar TypeErr = TypeError;\nvar getProto = Object.getPrototypeOf;\nvar regex = /a/;\n\nmodule.exports = function shimFlags() {\n\tif (!supportsDescriptors || !getProto) {\n\t\tthrow new TypeErr('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');\n\t}\n\tvar polyfill = getPolyfill();\n\tvar proto = getProto(regex);\n\tvar descriptor = gOPD(proto, 'flags');\n\tif (!descriptor || descriptor.get !== polyfill) {\n\t\tdefineProperty(proto, 'flags', {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tget: polyfill\n\t\t});\n\t}\n\treturn polyfill;\n};\n","'use strict';\n\nvar callBound = require('call-bind/callBound');\nvar GetIntrinsic = require('get-intrinsic');\nvar isRegex = require('is-regex');\n\nvar $exec = callBound('RegExp.prototype.exec');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nmodule.exports = function regexTester(regex) {\n\tif (!isRegex(regex)) {\n\t\tthrow new $TypeError('`regex` must be a RegExp');\n\t}\n\treturn function test(s) {\n\t\treturn $exec(regex, s) !== null;\n\t};\n};\n","'use strict';\n\nvar define = require('define-data-property');\nvar hasDescriptors = require('has-property-descriptors')();\nvar functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames();\n\nvar $TypeError = TypeError;\n\nmodule.exports = function setFunctionName(fn, name) {\n\tif (typeof fn !== 'function') {\n\t\tthrow new $TypeError('`fn` is not a function');\n\t}\n\tvar loose = arguments.length > 2 && !!arguments[2];\n\tif (!loose || functionsHaveConfigurableNames) {\n\t\tif (hasDescriptors) {\n\t\t\tdefine(fn, 'name', name, true, true);\n\t\t} else {\n\t\t\tdefine(fn, 'name', name);\n\t\t}\n\t}\n\treturn fn;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bind/callBound');\nvar inspect = require('object-inspect');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $WeakMap = GetIntrinsic('%WeakMap%', true);\nvar $Map = GetIntrinsic('%Map%', true);\n\nvar $weakMapGet = callBound('WeakMap.prototype.get', true);\nvar $weakMapSet = callBound('WeakMap.prototype.set', true);\nvar $weakMapHas = callBound('WeakMap.prototype.has', true);\nvar $mapGet = callBound('Map.prototype.get', true);\nvar $mapSet = callBound('Map.prototype.set', true);\nvar $mapHas = callBound('Map.prototype.has', true);\n\n/*\n * This function traverses the list returning the node corresponding to the\n * given key.\n *\n * That node is also moved to the head of the list, so that if it's accessed\n * again we don't need to traverse the whole list. By doing so, all the recently\n * used nodes can be accessed relatively quickly.\n */\nvar listGetNode = function (list, key) { // eslint-disable-line consistent-return\n\tfor (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {\n\t\tif (curr.key === key) {\n\t\t\tprev.next = curr.next;\n\t\t\tcurr.next = list.next;\n\t\t\tlist.next = curr; // eslint-disable-line no-param-reassign\n\t\t\treturn curr;\n\t\t}\n\t}\n};\n\nvar listGet = function (objects, key) {\n\tvar node = listGetNode(objects, key);\n\treturn node && node.value;\n};\nvar listSet = function (objects, key, value) {\n\tvar node = listGetNode(objects, key);\n\tif (node) {\n\t\tnode.value = value;\n\t} else {\n\t\t// Prepend the new node to the beginning of the list\n\t\tobjects.next = { // eslint-disable-line no-param-reassign\n\t\t\tkey: key,\n\t\t\tnext: objects.next,\n\t\t\tvalue: value\n\t\t};\n\t}\n};\nvar listHas = function (objects, key) {\n\treturn !!listGetNode(objects, key);\n};\n\nmodule.exports = function getSideChannel() {\n\tvar $wm;\n\tvar $m;\n\tvar $o;\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\tget: function (key) { // eslint-disable-line consistent-return\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapGet($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapGet($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listGet($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\thas: function (key) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapHas($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapHas($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listHas($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif (!$wm) {\n\t\t\t\t\t$wm = new $WeakMap();\n\t\t\t\t}\n\t\t\t\t$weakMapSet($wm, key, value);\n\t\t\t} else if ($Map) {\n\t\t\t\tif (!$m) {\n\t\t\t\t\t$m = new $Map();\n\t\t\t\t}\n\t\t\t\t$mapSet($m, key, value);\n\t\t\t} else {\n\t\t\t\tif (!$o) {\n\t\t\t\t\t/*\n\t\t\t\t\t * Initialize the linked list as an empty node, so that we don't have\n\t\t\t\t\t * to special-case handling of the first node: we can always refer to\n\t\t\t\t\t * it as (previous node).next, instead of something like (list).head\n\t\t\t\t\t */\n\t\t\t\t\t$o = { key: {}, next: null };\n\t\t\t\t}\n\t\t\t\tlistSet($o, key, value);\n\t\t\t}\n\t\t}\n\t};\n\treturn channel;\n};\n","'use strict';\n\nvar Call = require('es-abstract/2023/Call');\nvar Get = require('es-abstract/2023/Get');\nvar GetMethod = require('es-abstract/2023/GetMethod');\nvar IsRegExp = require('es-abstract/2023/IsRegExp');\nvar ToString = require('es-abstract/2023/ToString');\nvar RequireObjectCoercible = require('es-abstract/2023/RequireObjectCoercible');\nvar callBound = require('call-bind/callBound');\nvar hasSymbols = require('has-symbols')();\nvar flagsGetter = require('regexp.prototype.flags');\n\nvar $indexOf = callBound('String.prototype.indexOf');\n\nvar regexpMatchAllPolyfill = require('./polyfill-regexp-matchall');\n\nvar getMatcher = function getMatcher(regexp) { // eslint-disable-line consistent-return\n\tvar matcherPolyfill = regexpMatchAllPolyfill();\n\tif (hasSymbols && typeof Symbol.matchAll === 'symbol') {\n\t\tvar matcher = GetMethod(regexp, Symbol.matchAll);\n\t\tif (matcher === RegExp.prototype[Symbol.matchAll] && matcher !== matcherPolyfill) {\n\t\t\treturn matcherPolyfill;\n\t\t}\n\t\treturn matcher;\n\t}\n\t// fallback for pre-Symbol.matchAll environments\n\tif (IsRegExp(regexp)) {\n\t\treturn matcherPolyfill;\n\t}\n};\n\nmodule.exports = function matchAll(regexp) {\n\tvar O = RequireObjectCoercible(this);\n\n\tif (typeof regexp !== 'undefined' && regexp !== null) {\n\t\tvar isRegExp = IsRegExp(regexp);\n\t\tif (isRegExp) {\n\t\t\t// workaround for older engines that lack RegExp.prototype.flags\n\t\t\tvar flags = 'flags' in regexp ? Get(regexp, 'flags') : flagsGetter(regexp);\n\t\t\tRequireObjectCoercible(flags);\n\t\t\tif ($indexOf(ToString(flags), 'g') < 0) {\n\t\t\t\tthrow new TypeError('matchAll requires a global regular expression');\n\t\t\t}\n\t\t}\n\n\t\tvar matcher = getMatcher(regexp);\n\t\tif (typeof matcher !== 'undefined') {\n\t\t\treturn Call(matcher, regexp, [O]);\n\t\t}\n\t}\n\n\tvar S = ToString(O);\n\t// var rx = RegExpCreate(regexp, 'g');\n\tvar rx = new RegExp(regexp, 'g');\n\treturn Call(getMatcher(rx), rx, [S]);\n};\n","'use strict';\n\nvar callBind = require('call-bind');\nvar define = require('define-properties');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar boundMatchAll = callBind(implementation);\n\ndefine(boundMatchAll, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = boundMatchAll;\n","'use strict';\n\nvar hasSymbols = require('has-symbols')();\nvar regexpMatchAll = require('./regexp-matchall');\n\nmodule.exports = function getRegExpMatchAllPolyfill() {\n\tif (!hasSymbols || typeof Symbol.matchAll !== 'symbol' || typeof RegExp.prototype[Symbol.matchAll] !== 'function') {\n\t\treturn regexpMatchAll;\n\t}\n\treturn RegExp.prototype[Symbol.matchAll];\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = function getPolyfill() {\n\tif (String.prototype.matchAll) {\n\t\ttry {\n\t\t\t''.matchAll(RegExp.prototype);\n\t\t} catch (e) {\n\t\t\treturn String.prototype.matchAll;\n\t\t}\n\t}\n\treturn implementation;\n};\n","'use strict';\n\n// var Construct = require('es-abstract/2023/Construct');\nvar CreateRegExpStringIterator = require('es-abstract/2023/CreateRegExpStringIterator');\nvar Get = require('es-abstract/2023/Get');\nvar Set = require('es-abstract/2023/Set');\nvar SpeciesConstructor = require('es-abstract/2023/SpeciesConstructor');\nvar ToLength = require('es-abstract/2023/ToLength');\nvar ToString = require('es-abstract/2023/ToString');\nvar Type = require('es-abstract/2023/Type');\nvar flagsGetter = require('regexp.prototype.flags');\nvar setFunctionName = require('set-function-name');\nvar callBound = require('call-bind/callBound');\n\nvar $indexOf = callBound('String.prototype.indexOf');\n\nvar OrigRegExp = RegExp;\n\nvar supportsConstructingWithFlags = 'flags' in RegExp.prototype;\n\nvar constructRegexWithFlags = function constructRegex(C, R) {\n\tvar matcher;\n\t// workaround for older engines that lack RegExp.prototype.flags\n\tvar flags = 'flags' in R ? Get(R, 'flags') : ToString(flagsGetter(R));\n\tif (supportsConstructingWithFlags && typeof flags === 'string') {\n\t\tmatcher = new C(R, flags);\n\t} else if (C === OrigRegExp) {\n\t\t// workaround for older engines that can not construct a RegExp with flags\n\t\tmatcher = new C(R.source, flags);\n\t} else {\n\t\tmatcher = new C(R, flags);\n\t}\n\treturn { flags: flags, matcher: matcher };\n};\n\nvar regexMatchAll = setFunctionName(function SymbolMatchAll(string) {\n\tvar R = this;\n\tif (Type(R) !== 'Object') {\n\t\tthrow new TypeError('\"this\" value must be an Object');\n\t}\n\tvar S = ToString(string);\n\tvar C = SpeciesConstructor(R, OrigRegExp);\n\n\tvar tmp = constructRegexWithFlags(C, R);\n\t// var flags = ToString(Get(R, 'flags'));\n\tvar flags = tmp.flags;\n\t// var matcher = Construct(C, [R, flags]);\n\tvar matcher = tmp.matcher;\n\n\tvar lastIndex = ToLength(Get(R, 'lastIndex'));\n\tSet(matcher, 'lastIndex', lastIndex, true);\n\tvar global = $indexOf(flags, 'g') > -1;\n\tvar fullUnicode = $indexOf(flags, 'u') > -1;\n\treturn CreateRegExpStringIterator(matcher, S, global, fullUnicode);\n}, '[Symbol.matchAll]', true);\n\nmodule.exports = regexMatchAll;\n","'use strict';\n\nvar define = require('define-properties');\nvar hasSymbols = require('has-symbols')();\nvar getPolyfill = require('./polyfill');\nvar regexpMatchAllPolyfill = require('./polyfill-regexp-matchall');\n\nvar defineP = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nmodule.exports = function shimMatchAll() {\n\tvar polyfill = getPolyfill();\n\tdefine(\n\t\tString.prototype,\n\t\t{ matchAll: polyfill },\n\t\t{ matchAll: function () { return String.prototype.matchAll !== polyfill; } }\n\t);\n\tif (hasSymbols) {\n\t\t// eslint-disable-next-line no-restricted-properties\n\t\tvar symbol = Symbol.matchAll || (Symbol['for'] ? Symbol['for']('Symbol.matchAll') : Symbol('Symbol.matchAll'));\n\t\tdefine(\n\t\t\tSymbol,\n\t\t\t{ matchAll: symbol },\n\t\t\t{ matchAll: function () { return Symbol.matchAll !== symbol; } }\n\t\t);\n\n\t\tif (defineP && gOPD) {\n\t\t\tvar desc = gOPD(Symbol, symbol);\n\t\t\tif (!desc || desc.configurable) {\n\t\t\t\tdefineP(Symbol, symbol, {\n\t\t\t\t\tconfigurable: false,\n\t\t\t\t\tenumerable: false,\n\t\t\t\t\tvalue: symbol,\n\t\t\t\t\twritable: false\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tvar regexpMatchAll = regexpMatchAllPolyfill();\n\t\tvar func = {};\n\t\tfunc[symbol] = regexpMatchAll;\n\t\tvar predicate = {};\n\t\tpredicate[symbol] = function () {\n\t\t\treturn RegExp.prototype[symbol] !== regexpMatchAll;\n\t\t};\n\t\tdefine(RegExp.prototype, func, predicate);\n\t}\n\treturn polyfill;\n};\n","'use strict';\n\nvar RequireObjectCoercible = require('es-abstract/2023/RequireObjectCoercible');\nvar ToString = require('es-abstract/2023/ToString');\nvar callBound = require('call-bind/callBound');\nvar $replace = callBound('String.prototype.replace');\n\nvar mvsIsWS = (/^\\s$/).test('\\u180E');\n/* eslint-disable no-control-regex */\nvar leftWhitespace = mvsIsWS\n\t? /^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+/\n\t: /^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+/;\nvar rightWhitespace = mvsIsWS\n\t? /[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+$/\n\t: /[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+$/;\n/* eslint-enable no-control-regex */\n\nmodule.exports = function trim() {\n\tvar S = ToString(RequireObjectCoercible(this));\n\treturn $replace($replace(S, leftWhitespace, ''), rightWhitespace, '');\n};\n","'use strict';\n\nvar callBind = require('call-bind');\nvar define = require('define-properties');\nvar RequireObjectCoercible = require('es-abstract/2023/RequireObjectCoercible');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar bound = callBind(getPolyfill());\nvar boundMethod = function trim(receiver) {\n\tRequireObjectCoercible(receiver);\n\treturn bound(receiver);\n};\n\ndefine(boundMethod, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = boundMethod;\n","'use strict';\n\nvar implementation = require('./implementation');\n\nvar zeroWidthSpace = '\\u200b';\nvar mongolianVowelSeparator = '\\u180E';\n\nmodule.exports = function getPolyfill() {\n\tif (\n\t\tString.prototype.trim\n\t\t&& zeroWidthSpace.trim() === zeroWidthSpace\n\t\t&& mongolianVowelSeparator.trim() === mongolianVowelSeparator\n\t\t&& ('_' + mongolianVowelSeparator).trim() === ('_' + mongolianVowelSeparator)\n\t\t&& (mongolianVowelSeparator + '_').trim() === (mongolianVowelSeparator + '_')\n\t) {\n\t\treturn String.prototype.trim;\n\t}\n\treturn implementation;\n};\n","'use strict';\n\nvar define = require('define-properties');\nvar getPolyfill = require('./polyfill');\n\nmodule.exports = function shimStringTrim() {\n\tvar polyfill = getPolyfill();\n\tdefine(String.prototype, { trim: polyfill }, {\n\t\ttrim: function testTrim() {\n\t\t\treturn String.prototype.trim !== polyfill;\n\t\t}\n\t});\n\treturn polyfill;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar CodePointAt = require('./CodePointAt');\nvar Type = require('./Type');\n\nvar isInteger = require('../helpers/isInteger');\nvar MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// https://262.ecma-international.org/12.0/#sec-advancestringindex\n\nmodule.exports = function AdvanceStringIndex(S, index, unicode) {\n\tif (Type(S) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `S` must be a String');\n\t}\n\tif (!isInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) {\n\t\tthrow new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53');\n\t}\n\tif (Type(unicode) !== 'Boolean') {\n\t\tthrow new $TypeError('Assertion failed: `unicode` must be a Boolean');\n\t}\n\tif (!unicode) {\n\t\treturn index + 1;\n\t}\n\tvar length = S.length;\n\tif ((index + 1) >= length) {\n\t\treturn index + 1;\n\t}\n\tvar cp = CodePointAt(S, index);\n\treturn index + cp['[[CodeUnitCount]]'];\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bind/callBound');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar IsArray = require('./IsArray');\n\nvar $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('Function.prototype.apply');\n\n// https://262.ecma-international.org/6.0/#sec-call\n\nmodule.exports = function Call(F, V) {\n\tvar argumentsList = arguments.length > 2 ? arguments[2] : [];\n\tif (!IsArray(argumentsList)) {\n\t\tthrow new $TypeError('Assertion failed: optional `argumentsList`, if provided, must be a List');\n\t}\n\treturn $apply(F, V, argumentsList);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar callBound = require('call-bind/callBound');\nvar isLeadingSurrogate = require('../helpers/isLeadingSurrogate');\nvar isTrailingSurrogate = require('../helpers/isTrailingSurrogate');\n\nvar Type = require('./Type');\nvar UTF16SurrogatePairToCodePoint = require('./UTF16SurrogatePairToCodePoint');\n\nvar $charAt = callBound('String.prototype.charAt');\nvar $charCodeAt = callBound('String.prototype.charCodeAt');\n\n// https://262.ecma-international.org/12.0/#sec-codepointat\n\nmodule.exports = function CodePointAt(string, position) {\n\tif (Type(string) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `string` must be a String');\n\t}\n\tvar size = string.length;\n\tif (position < 0 || position >= size) {\n\t\tthrow new $TypeError('Assertion failed: `position` must be >= 0, and < the length of `string`');\n\t}\n\tvar first = $charCodeAt(string, position);\n\tvar cp = $charAt(string, position);\n\tvar firstIsLeading = isLeadingSurrogate(first);\n\tvar firstIsTrailing = isTrailingSurrogate(first);\n\tif (!firstIsLeading && !firstIsTrailing) {\n\t\treturn {\n\t\t\t'[[CodePoint]]': cp,\n\t\t\t'[[CodeUnitCount]]': 1,\n\t\t\t'[[IsUnpairedSurrogate]]': false\n\t\t};\n\t}\n\tif (firstIsTrailing || (position + 1 === size)) {\n\t\treturn {\n\t\t\t'[[CodePoint]]': cp,\n\t\t\t'[[CodeUnitCount]]': 1,\n\t\t\t'[[IsUnpairedSurrogate]]': true\n\t\t};\n\t}\n\tvar second = $charCodeAt(string, position + 1);\n\tif (!isTrailingSurrogate(second)) {\n\t\treturn {\n\t\t\t'[[CodePoint]]': cp,\n\t\t\t'[[CodeUnitCount]]': 1,\n\t\t\t'[[IsUnpairedSurrogate]]': true\n\t\t};\n\t}\n\n\treturn {\n\t\t'[[CodePoint]]': UTF16SurrogatePairToCodePoint(first, second),\n\t\t'[[CodeUnitCount]]': 2,\n\t\t'[[IsUnpairedSurrogate]]': false\n\t};\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-createiterresultobject\n\nmodule.exports = function CreateIterResultObject(value, done) {\n\tif (Type(done) !== 'Boolean') {\n\t\tthrow new $TypeError('Assertion failed: Type(done) is not Boolean');\n\t}\n\treturn {\n\t\tvalue: value,\n\t\tdone: done\n\t};\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar DefineOwnProperty = require('../helpers/DefineOwnProperty');\n\nvar FromPropertyDescriptor = require('./FromPropertyDescriptor');\nvar IsDataDescriptor = require('./IsDataDescriptor');\nvar IsPropertyKey = require('./IsPropertyKey');\nvar SameValue = require('./SameValue');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-createmethodproperty\n\nmodule.exports = function CreateMethodProperty(O, P, V) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true');\n\t}\n\n\tvar newDesc = {\n\t\t'[[Configurable]]': true,\n\t\t'[[Enumerable]]': false,\n\t\t'[[Value]]': V,\n\t\t'[[Writable]]': true\n\t};\n\treturn DefineOwnProperty(\n\t\tIsDataDescriptor,\n\t\tSameValue,\n\t\tFromPropertyDescriptor,\n\t\tO,\n\t\tP,\n\t\tnewDesc\n\t);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar hasSymbols = require('has-symbols')();\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar IteratorPrototype = GetIntrinsic('%IteratorPrototype%', true);\n\nvar AdvanceStringIndex = require('./AdvanceStringIndex');\nvar CreateIterResultObject = require('./CreateIterResultObject');\nvar CreateMethodProperty = require('./CreateMethodProperty');\nvar Get = require('./Get');\nvar OrdinaryObjectCreate = require('./OrdinaryObjectCreate');\nvar RegExpExec = require('./RegExpExec');\nvar Set = require('./Set');\nvar ToLength = require('./ToLength');\nvar ToString = require('./ToString');\nvar Type = require('./Type');\n\nvar SLOT = require('internal-slot');\nvar setToStringTag = require('es-set-tostringtag');\n\nvar RegExpStringIterator = function RegExpStringIterator(R, S, global, fullUnicode) {\n\tif (Type(S) !== 'String') {\n\t\tthrow new $TypeError('`S` must be a string');\n\t}\n\tif (Type(global) !== 'Boolean') {\n\t\tthrow new $TypeError('`global` must be a boolean');\n\t}\n\tif (Type(fullUnicode) !== 'Boolean') {\n\t\tthrow new $TypeError('`fullUnicode` must be a boolean');\n\t}\n\tSLOT.set(this, '[[IteratingRegExp]]', R);\n\tSLOT.set(this, '[[IteratedString]]', S);\n\tSLOT.set(this, '[[Global]]', global);\n\tSLOT.set(this, '[[Unicode]]', fullUnicode);\n\tSLOT.set(this, '[[Done]]', false);\n};\n\nif (IteratorPrototype) {\n\tRegExpStringIterator.prototype = OrdinaryObjectCreate(IteratorPrototype);\n}\n\nvar RegExpStringIteratorNext = function next() {\n\tvar O = this; // eslint-disable-line no-invalid-this\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('receiver must be an object');\n\t}\n\tif (\n\t\t!(O instanceof RegExpStringIterator)\n\t\t|| !SLOT.has(O, '[[IteratingRegExp]]')\n\t\t|| !SLOT.has(O, '[[IteratedString]]')\n\t\t|| !SLOT.has(O, '[[Global]]')\n\t\t|| !SLOT.has(O, '[[Unicode]]')\n\t\t|| !SLOT.has(O, '[[Done]]')\n\t) {\n\t\tthrow new $TypeError('\"this\" value must be a RegExpStringIterator instance');\n\t}\n\tif (SLOT.get(O, '[[Done]]')) {\n\t\treturn CreateIterResultObject(undefined, true);\n\t}\n\tvar R = SLOT.get(O, '[[IteratingRegExp]]');\n\tvar S = SLOT.get(O, '[[IteratedString]]');\n\tvar global = SLOT.get(O, '[[Global]]');\n\tvar fullUnicode = SLOT.get(O, '[[Unicode]]');\n\tvar match = RegExpExec(R, S);\n\tif (match === null) {\n\t\tSLOT.set(O, '[[Done]]', true);\n\t\treturn CreateIterResultObject(undefined, true);\n\t}\n\tif (global) {\n\t\tvar matchStr = ToString(Get(match, '0'));\n\t\tif (matchStr === '') {\n\t\t\tvar thisIndex = ToLength(Get(R, 'lastIndex'));\n\t\t\tvar nextIndex = AdvanceStringIndex(S, thisIndex, fullUnicode);\n\t\t\tSet(R, 'lastIndex', nextIndex, true);\n\t\t}\n\t\treturn CreateIterResultObject(match, false);\n\t}\n\tSLOT.set(O, '[[Done]]', true);\n\treturn CreateIterResultObject(match, false);\n};\nCreateMethodProperty(RegExpStringIterator.prototype, 'next', RegExpStringIteratorNext);\n\nif (hasSymbols) {\n\tsetToStringTag(RegExpStringIterator.prototype, 'RegExp String Iterator');\n\n\tif (Symbol.iterator && typeof RegExpStringIterator.prototype[Symbol.iterator] !== 'function') {\n\t\tvar iteratorFn = function SymbolIterator() {\n\t\t\treturn this;\n\t\t};\n\t\tCreateMethodProperty(RegExpStringIterator.prototype, Symbol.iterator, iteratorFn);\n\t}\n}\n\n// https://262.ecma-international.org/11.0/#sec-createregexpstringiterator\nmodule.exports = function CreateRegExpStringIterator(R, S, global, fullUnicode) {\n\t// assert R.global === global && R.unicode === fullUnicode?\n\treturn new RegExpStringIterator(R, S, global, fullUnicode);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar isPropertyDescriptor = require('../helpers/isPropertyDescriptor');\nvar DefineOwnProperty = require('../helpers/DefineOwnProperty');\n\nvar FromPropertyDescriptor = require('./FromPropertyDescriptor');\nvar IsAccessorDescriptor = require('./IsAccessorDescriptor');\nvar IsDataDescriptor = require('./IsDataDescriptor');\nvar IsPropertyKey = require('./IsPropertyKey');\nvar SameValue = require('./SameValue');\nvar ToPropertyDescriptor = require('./ToPropertyDescriptor');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-definepropertyorthrow\n\nmodule.exports = function DefinePropertyOrThrow(O, P, desc) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true');\n\t}\n\n\tvar Desc = isPropertyDescriptor({\n\t\tType: Type,\n\t\tIsDataDescriptor: IsDataDescriptor,\n\t\tIsAccessorDescriptor: IsAccessorDescriptor\n\t}, desc) ? desc : ToPropertyDescriptor(desc);\n\tif (!isPropertyDescriptor({\n\t\tType: Type,\n\t\tIsDataDescriptor: IsDataDescriptor,\n\t\tIsAccessorDescriptor: IsAccessorDescriptor\n\t}, Desc)) {\n\t\tthrow new $TypeError('Assertion failed: Desc is not a valid Property Descriptor');\n\t}\n\n\treturn DefineOwnProperty(\n\t\tIsDataDescriptor,\n\t\tSameValue,\n\t\tFromPropertyDescriptor,\n\t\tO,\n\t\tP,\n\t\tDesc\n\t);\n};\n","'use strict';\n\nvar assertRecord = require('../helpers/assertRecord');\nvar fromPropertyDescriptor = require('../helpers/fromPropertyDescriptor');\n\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-frompropertydescriptor\n\nmodule.exports = function FromPropertyDescriptor(Desc) {\n\tif (typeof Desc !== 'undefined') {\n\t\tassertRecord(Type, 'Property Descriptor', 'Desc', Desc);\n\t}\n\n\treturn fromPropertyDescriptor(Desc);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar inspect = require('object-inspect');\n\nvar IsPropertyKey = require('./IsPropertyKey');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-get-o-p\n\nmodule.exports = function Get(O, P) {\n\t// 7.3.1.1\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\t// 7.3.1.2\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P));\n\t}\n\t// 7.3.1.3\n\treturn O[P];\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar GetV = require('./GetV');\nvar IsCallable = require('./IsCallable');\nvar IsPropertyKey = require('./IsPropertyKey');\n\nvar inspect = require('object-inspect');\n\n// https://262.ecma-international.org/6.0/#sec-getmethod\n\nmodule.exports = function GetMethod(O, P) {\n\t// 7.3.9.1\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true');\n\t}\n\n\t// 7.3.9.2\n\tvar func = GetV(O, P);\n\n\t// 7.3.9.4\n\tif (func == null) {\n\t\treturn void 0;\n\t}\n\n\t// 7.3.9.5\n\tif (!IsCallable(func)) {\n\t\tthrow new $TypeError(inspect(P) + ' is not a function: ' + inspect(func));\n\t}\n\n\t// 7.3.9.6\n\treturn func;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar inspect = require('object-inspect');\n\nvar IsPropertyKey = require('./IsPropertyKey');\n// var ToObject = require('./ToObject');\n\n// https://262.ecma-international.org/6.0/#sec-getv\n\nmodule.exports = function GetV(V, P) {\n\t// 7.3.2.1\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P));\n\t}\n\n\t// 7.3.2.2-3\n\t// var O = ToObject(V);\n\n\t// 7.3.2.4\n\treturn V[P];\n};\n","'use strict';\n\nvar has = require('has');\n\nvar Type = require('./Type');\n\nvar assertRecord = require('../helpers/assertRecord');\n\n// https://262.ecma-international.org/5.1/#sec-8.10.1\n\nmodule.exports = function IsAccessorDescriptor(Desc) {\n\tif (typeof Desc === 'undefined') {\n\t\treturn false;\n\t}\n\n\tassertRecord(Type, 'Property Descriptor', 'Desc', Desc);\n\n\tif (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n","'use strict';\n\n// https://262.ecma-international.org/6.0/#sec-isarray\nmodule.exports = require('../helpers/IsArray');\n","'use strict';\n\n// http://262.ecma-international.org/5.1/#sec-9.11\n\nmodule.exports = require('is-callable');\n","'use strict';\n\nvar GetIntrinsic = require('../GetIntrinsic.js');\n\nvar $construct = GetIntrinsic('%Reflect.construct%', true);\n\nvar DefinePropertyOrThrow = require('./DefinePropertyOrThrow');\ntry {\n\tDefinePropertyOrThrow({}, '', { '[[Get]]': function () {} });\n} catch (e) {\n\t// Accessor properties aren't supported\n\tDefinePropertyOrThrow = null;\n}\n\n// https://262.ecma-international.org/6.0/#sec-isconstructor\n\nif (DefinePropertyOrThrow && $construct) {\n\tvar isConstructorMarker = {};\n\tvar badArrayLike = {};\n\tDefinePropertyOrThrow(badArrayLike, 'length', {\n\t\t'[[Get]]': function () {\n\t\t\tthrow isConstructorMarker;\n\t\t},\n\t\t'[[Enumerable]]': true\n\t});\n\n\tmodule.exports = function IsConstructor(argument) {\n\t\ttry {\n\t\t\t// `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`:\n\t\t\t$construct(argument, badArrayLike);\n\t\t} catch (err) {\n\t\t\treturn err === isConstructorMarker;\n\t\t}\n\t};\n} else {\n\tmodule.exports = function IsConstructor(argument) {\n\t\t// unfortunately there's no way to truly check this without try/catch `new argument` in old environments\n\t\treturn typeof argument === 'function' && !!argument.prototype;\n\t};\n}\n","'use strict';\n\nvar has = require('has');\n\nvar Type = require('./Type');\n\nvar assertRecord = require('../helpers/assertRecord');\n\n// https://262.ecma-international.org/5.1/#sec-8.10.2\n\nmodule.exports = function IsDataDescriptor(Desc) {\n\tif (typeof Desc === 'undefined') {\n\t\treturn false;\n\t}\n\n\tassertRecord(Type, 'Property Descriptor', 'Desc', Desc);\n\n\tif (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n","'use strict';\n\n// https://262.ecma-international.org/6.0/#sec-ispropertykey\n\nmodule.exports = function IsPropertyKey(argument) {\n\treturn typeof argument === 'string' || typeof argument === 'symbol';\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $match = GetIntrinsic('%Symbol.match%', true);\n\nvar hasRegExpMatcher = require('is-regex');\n\nvar ToBoolean = require('./ToBoolean');\n\n// https://262.ecma-international.org/6.0/#sec-isregexp\n\nmodule.exports = function IsRegExp(argument) {\n\tif (!argument || typeof argument !== 'object') {\n\t\treturn false;\n\t}\n\tif ($match) {\n\t\tvar isRegExp = argument[$match];\n\t\tif (typeof isRegExp !== 'undefined') {\n\t\t\treturn ToBoolean(isRegExp);\n\t\t}\n\t}\n\treturn hasRegExpMatcher(argument);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $ObjectCreate = GetIntrinsic('%Object.create%', true);\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\n\nvar IsArray = require('./IsArray');\nvar Type = require('./Type');\n\nvar forEach = require('../helpers/forEach');\n\nvar SLOT = require('internal-slot');\n\nvar hasProto = require('has-proto')();\n\n// https://262.ecma-international.org/11.0/#sec-objectcreate\n\nmodule.exports = function OrdinaryObjectCreate(proto) {\n\tif (proto !== null && Type(proto) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: `proto` must be null or an object');\n\t}\n\tvar additionalInternalSlotsList = arguments.length < 2 ? [] : arguments[1];\n\tif (!IsArray(additionalInternalSlotsList)) {\n\t\tthrow new $TypeError('Assertion failed: `additionalInternalSlotsList` must be an Array');\n\t}\n\n\t// var internalSlotsList = ['[[Prototype]]', '[[Extensible]]']; // step 1\n\t// internalSlotsList.push(...additionalInternalSlotsList); // step 2\n\t// var O = MakeBasicObject(internalSlotsList); // step 3\n\t// setProto(O, proto); // step 4\n\t// return O; // step 5\n\n\tvar O;\n\tif ($ObjectCreate) {\n\t\tO = $ObjectCreate(proto);\n\t} else if (hasProto) {\n\t\tO = { __proto__: proto };\n\t} else {\n\t\tif (proto === null) {\n\t\t\tthrow new $SyntaxError('native Object.create support is required to create null objects');\n\t\t}\n\t\tvar T = function T() {};\n\t\tT.prototype = proto;\n\t\tO = new T();\n\t}\n\n\tif (additionalInternalSlotsList.length > 0) {\n\t\tforEach(additionalInternalSlotsList, function (slot) {\n\t\t\tSLOT.set(O, slot, void undefined);\n\t\t});\n\t}\n\n\treturn O;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar regexExec = require('call-bind/callBound')('RegExp.prototype.exec');\n\nvar Call = require('./Call');\nvar Get = require('./Get');\nvar IsCallable = require('./IsCallable');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-regexpexec\n\nmodule.exports = function RegExpExec(R, S) {\n\tif (Type(R) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: `R` must be an Object');\n\t}\n\tif (Type(S) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `S` must be a String');\n\t}\n\tvar exec = Get(R, 'exec');\n\tif (IsCallable(exec)) {\n\t\tvar result = Call(exec, R, [S]);\n\t\tif (result === null || Type(result) === 'Object') {\n\t\t\treturn result;\n\t\t}\n\t\tthrow new $TypeError('\"exec\" method must return `null` or an Object');\n\t}\n\treturn regexExec(R, S);\n};\n","'use strict';\n\nmodule.exports = require('../5/CheckObjectCoercible');\n","'use strict';\n\nvar $isNaN = require('../helpers/isNaN');\n\n// http://262.ecma-international.org/5.1/#sec-9.12\n\nmodule.exports = function SameValue(x, y) {\n\tif (x === y) { // 0 === -0, but they are not identical.\n\t\tif (x === 0) { return 1 / x === 1 / y; }\n\t\treturn true;\n\t}\n\treturn $isNaN(x) && $isNaN(y);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar IsPropertyKey = require('./IsPropertyKey');\nvar SameValue = require('./SameValue');\nvar Type = require('./Type');\n\n// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated\nvar noThrowOnStrictViolation = (function () {\n\ttry {\n\t\tdelete [].length;\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n}());\n\n// https://262.ecma-international.org/6.0/#sec-set-o-p-v-throw\n\nmodule.exports = function Set(O, P, V, Throw) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: `O` must be an Object');\n\t}\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: `P` must be a Property Key');\n\t}\n\tif (Type(Throw) !== 'Boolean') {\n\t\tthrow new $TypeError('Assertion failed: `Throw` must be a Boolean');\n\t}\n\tif (Throw) {\n\t\tO[P] = V; // eslint-disable-line no-param-reassign\n\t\tif (noThrowOnStrictViolation && !SameValue(O[P], V)) {\n\t\t\tthrow new $TypeError('Attempted to assign to readonly property.');\n\t\t}\n\t\treturn true;\n\t}\n\ttry {\n\t\tO[P] = V; // eslint-disable-line no-param-reassign\n\t\treturn noThrowOnStrictViolation ? SameValue(O[P], V) : true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $species = GetIntrinsic('%Symbol.species%', true);\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar IsConstructor = require('./IsConstructor');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-speciesconstructor\n\nmodule.exports = function SpeciesConstructor(O, defaultConstructor) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\tvar C = O.constructor;\n\tif (typeof C === 'undefined') {\n\t\treturn defaultConstructor;\n\t}\n\tif (Type(C) !== 'Object') {\n\t\tthrow new $TypeError('O.constructor is not an Object');\n\t}\n\tvar S = $species ? C[$species] : void 0;\n\tif (S == null) {\n\t\treturn defaultConstructor;\n\t}\n\tif (IsConstructor(S)) {\n\t\treturn S;\n\t}\n\tthrow new $TypeError('no constructor found');\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $Number = GetIntrinsic('%Number%');\nvar $RegExp = GetIntrinsic('%RegExp%');\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $parseInteger = GetIntrinsic('%parseInt%');\n\nvar callBound = require('call-bind/callBound');\nvar regexTester = require('safe-regex-test');\n\nvar $strSlice = callBound('String.prototype.slice');\nvar isBinary = regexTester(/^0b[01]+$/i);\nvar isOctal = regexTester(/^0o[0-7]+$/i);\nvar isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i);\nvar nonWS = ['\\u0085', '\\u200b', '\\ufffe'].join('');\nvar nonWSregex = new $RegExp('[' + nonWS + ']', 'g');\nvar hasNonWS = regexTester(nonWSregex);\n\nvar $trim = require('string.prototype.trim');\n\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/13.0/#sec-stringtonumber\n\nmodule.exports = function StringToNumber(argument) {\n\tif (Type(argument) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `argument` is not a String');\n\t}\n\tif (isBinary(argument)) {\n\t\treturn $Number($parseInteger($strSlice(argument, 2), 2));\n\t}\n\tif (isOctal(argument)) {\n\t\treturn $Number($parseInteger($strSlice(argument, 2), 8));\n\t}\n\tif (hasNonWS(argument) || isInvalidHexLiteral(argument)) {\n\t\treturn NaN;\n\t}\n\tvar trimmed = $trim(argument);\n\tif (trimmed !== argument) {\n\t\treturn StringToNumber(trimmed);\n\t}\n\treturn $Number(argument);\n};\n","'use strict';\n\n// http://262.ecma-international.org/5.1/#sec-9.2\n\nmodule.exports = function ToBoolean(value) { return !!value; };\n","'use strict';\n\nvar ToNumber = require('./ToNumber');\nvar truncate = require('./truncate');\n\nvar $isNaN = require('../helpers/isNaN');\nvar $isFinite = require('../helpers/isFinite');\n\n// https://262.ecma-international.org/14.0/#sec-tointegerorinfinity\n\nmodule.exports = function ToIntegerOrInfinity(value) {\n\tvar number = ToNumber(value);\n\tif ($isNaN(number) || number === 0) { return 0; }\n\tif (!$isFinite(number)) { return number; }\n\treturn truncate(number);\n};\n","'use strict';\n\nvar MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');\n\nvar ToIntegerOrInfinity = require('./ToIntegerOrInfinity');\n\nmodule.exports = function ToLength(argument) {\n\tvar len = ToIntegerOrInfinity(argument);\n\tif (len <= 0) { return 0; } // includes converting -0 to +0\n\tif (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; }\n\treturn len;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $Number = GetIntrinsic('%Number%');\nvar isPrimitive = require('../helpers/isPrimitive');\n\nvar ToPrimitive = require('./ToPrimitive');\nvar StringToNumber = require('./StringToNumber');\n\n// https://262.ecma-international.org/13.0/#sec-tonumber\n\nmodule.exports = function ToNumber(argument) {\n\tvar value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number);\n\tif (typeof value === 'symbol') {\n\t\tthrow new $TypeError('Cannot convert a Symbol value to a number');\n\t}\n\tif (typeof value === 'bigint') {\n\t\tthrow new $TypeError('Conversion from \\'BigInt\\' to \\'number\\' is not allowed.');\n\t}\n\tif (typeof value === 'string') {\n\t\treturn StringToNumber(value);\n\t}\n\treturn $Number(value);\n};\n","'use strict';\n\nvar toPrimitive = require('es-to-primitive/es2015');\n\n// https://262.ecma-international.org/6.0/#sec-toprimitive\n\nmodule.exports = function ToPrimitive(input) {\n\tif (arguments.length > 1) {\n\t\treturn toPrimitive(input, arguments[1]);\n\t}\n\treturn toPrimitive(input);\n};\n","'use strict';\n\nvar has = require('has');\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar Type = require('./Type');\nvar ToBoolean = require('./ToBoolean');\nvar IsCallable = require('./IsCallable');\n\n// https://262.ecma-international.org/5.1/#sec-8.10.5\n\nmodule.exports = function ToPropertyDescriptor(Obj) {\n\tif (Type(Obj) !== 'Object') {\n\t\tthrow new $TypeError('ToPropertyDescriptor requires an object');\n\t}\n\n\tvar desc = {};\n\tif (has(Obj, 'enumerable')) {\n\t\tdesc['[[Enumerable]]'] = ToBoolean(Obj.enumerable);\n\t}\n\tif (has(Obj, 'configurable')) {\n\t\tdesc['[[Configurable]]'] = ToBoolean(Obj.configurable);\n\t}\n\tif (has(Obj, 'value')) {\n\t\tdesc['[[Value]]'] = Obj.value;\n\t}\n\tif (has(Obj, 'writable')) {\n\t\tdesc['[[Writable]]'] = ToBoolean(Obj.writable);\n\t}\n\tif (has(Obj, 'get')) {\n\t\tvar getter = Obj.get;\n\t\tif (typeof getter !== 'undefined' && !IsCallable(getter)) {\n\t\t\tthrow new $TypeError('getter must be a function');\n\t\t}\n\t\tdesc['[[Get]]'] = getter;\n\t}\n\tif (has(Obj, 'set')) {\n\t\tvar setter = Obj.set;\n\t\tif (typeof setter !== 'undefined' && !IsCallable(setter)) {\n\t\t\tthrow new $TypeError('setter must be a function');\n\t\t}\n\t\tdesc['[[Set]]'] = setter;\n\t}\n\n\tif ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) {\n\t\tthrow new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');\n\t}\n\treturn desc;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $String = GetIntrinsic('%String%');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// https://262.ecma-international.org/6.0/#sec-tostring\n\nmodule.exports = function ToString(argument) {\n\tif (typeof argument === 'symbol') {\n\t\tthrow new $TypeError('Cannot convert a Symbol value to a string');\n\t}\n\treturn $String(argument);\n};\n","'use strict';\n\nvar ES5Type = require('../5/Type');\n\n// https://262.ecma-international.org/11.0/#sec-ecmascript-data-types-and-values\n\nmodule.exports = function Type(x) {\n\tif (typeof x === 'symbol') {\n\t\treturn 'Symbol';\n\t}\n\tif (typeof x === 'bigint') {\n\t\treturn 'BigInt';\n\t}\n\treturn ES5Type(x);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $fromCharCode = GetIntrinsic('%String.fromCharCode%');\n\nvar isLeadingSurrogate = require('../helpers/isLeadingSurrogate');\nvar isTrailingSurrogate = require('../helpers/isTrailingSurrogate');\n\n// https://tc39.es/ecma262/2020/#sec-utf16decodesurrogatepair\n\nmodule.exports = function UTF16SurrogatePairToCodePoint(lead, trail) {\n\tif (!isLeadingSurrogate(lead) || !isTrailingSurrogate(trail)) {\n\t\tthrow new $TypeError('Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code');\n\t}\n\t// var cp = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;\n\treturn $fromCharCode(lead) + $fromCharCode(trail);\n};\n","'use strict';\n\nvar Type = require('./Type');\n\n// var modulo = require('./modulo');\nvar $floor = Math.floor;\n\n// http://262.ecma-international.org/11.0/#eqn-floor\n\nmodule.exports = function floor(x) {\n\t// return x - modulo(x, 1);\n\tif (Type(x) === 'BigInt') {\n\t\treturn x;\n\t}\n\treturn $floor(x);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar floor = require('./floor');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// https://262.ecma-international.org/14.0/#eqn-truncate\n\nmodule.exports = function truncate(x) {\n\tif (typeof x !== 'number' && typeof x !== 'bigint') {\n\t\tthrow new $TypeError('argument must be a Number or a BigInt');\n\t}\n\tvar result = x < 0 ? -floor(-x) : floor(x);\n\treturn result === 0 ? 0 : result; // in the spec, these are math values, so we filter out -0 here\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// http://262.ecma-international.org/5.1/#sec-9.10\n\nmodule.exports = function CheckObjectCoercible(value, optMessage) {\n\tif (value == null) {\n\t\tthrow new $TypeError(optMessage || ('Cannot call method on ' + value));\n\t}\n\treturn value;\n};\n","'use strict';\n\n// https://262.ecma-international.org/5.1/#sec-8\n\nmodule.exports = function Type(x) {\n\tif (x === null) {\n\t\treturn 'Null';\n\t}\n\tif (typeof x === 'undefined') {\n\t\treturn 'Undefined';\n\t}\n\tif (typeof x === 'function' || typeof x === 'object') {\n\t\treturn 'Object';\n\t}\n\tif (typeof x === 'number') {\n\t\treturn 'Number';\n\t}\n\tif (typeof x === 'boolean') {\n\t\treturn 'Boolean';\n\t}\n\tif (typeof x === 'string') {\n\t\treturn 'String';\n\t}\n};\n","'use strict';\n\n// TODO: remove, semver-major\n\nmodule.exports = require('get-intrinsic');\n","'use strict';\n\nvar hasPropertyDescriptors = require('has-property-descriptors');\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = hasPropertyDescriptors() && GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasArrayLengthDefineBug = hasPropertyDescriptors.hasArrayLengthDefineBug();\n\n// eslint-disable-next-line global-require\nvar isArray = hasArrayLengthDefineBug && require('../helpers/IsArray');\n\nvar callBound = require('call-bind/callBound');\n\nvar $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');\n\n// eslint-disable-next-line max-params\nmodule.exports = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) {\n\tif (!$defineProperty) {\n\t\tif (!IsDataDescriptor(desc)) {\n\t\t\t// ES3 does not support getters/setters\n\t\t\treturn false;\n\t\t}\n\t\tif (!desc['[[Configurable]]'] || !desc['[[Writable]]']) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// fallback for ES3\n\t\tif (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) {\n\t\t\t// a non-enumerable existing property\n\t\t\treturn false;\n\t\t}\n\n\t\t// property does not exist at all, or exists but is enumerable\n\t\tvar V = desc['[[Value]]'];\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tO[P] = V; // will use [[Define]]\n\t\treturn SameValue(O[P], V);\n\t}\n\tif (\n\t\thasArrayLengthDefineBug\n\t\t&& P === 'length'\n\t\t&& '[[Value]]' in desc\n\t\t&& isArray(O)\n\t\t&& O.length !== desc['[[Value]]']\n\t) {\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tO.length = desc['[[Value]]'];\n\t\treturn O.length === desc['[[Value]]'];\n\t}\n\n\t$defineProperty(O, P, FromPropertyDescriptor(desc));\n\treturn true;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $Array = GetIntrinsic('%Array%');\n\n// eslint-disable-next-line global-require\nvar toStr = !$Array.isArray && require('call-bind/callBound')('Object.prototype.toString');\n\nmodule.exports = $Array.isArray || function IsArray(argument) {\n\treturn toStr(argument) === '[object Array]';\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\n\nvar has = require('has');\nvar isInteger = require('./isInteger');\n\nvar isMatchRecord = require('./isMatchRecord');\n\nvar predicates = {\n\t// https://262.ecma-international.org/6.0/#sec-property-descriptor-specification-type\n\t'Property Descriptor': function isPropertyDescriptor(Desc) {\n\t\tvar allowed = {\n\t\t\t'[[Configurable]]': true,\n\t\t\t'[[Enumerable]]': true,\n\t\t\t'[[Get]]': true,\n\t\t\t'[[Set]]': true,\n\t\t\t'[[Value]]': true,\n\t\t\t'[[Writable]]': true\n\t\t};\n\n\t\tif (!Desc) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (var key in Desc) { // eslint-disable-line\n\t\t\tif (has(Desc, key) && !allowed[key]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tvar isData = has(Desc, '[[Value]]');\n\t\tvar IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]');\n\t\tif (isData && IsAccessor) {\n\t\t\tthrow new $TypeError('Property Descriptors may not be both accessor and data descriptors');\n\t\t}\n\t\treturn true;\n\t},\n\t// https://262.ecma-international.org/13.0/#sec-match-records\n\t'Match Record': isMatchRecord,\n\t'Iterator Record': function isIteratorRecord(value) {\n\t\treturn has(value, '[[Iterator]]') && has(value, '[[NextMethod]]') && has(value, '[[Done]]');\n\t},\n\t'PromiseCapability Record': function isPromiseCapabilityRecord(value) {\n\t\treturn !!value\n\t\t\t&& has(value, '[[Resolve]]')\n\t\t\t&& typeof value['[[Resolve]]'] === 'function'\n\t\t\t&& has(value, '[[Reject]]')\n\t\t\t&& typeof value['[[Reject]]'] === 'function'\n\t\t\t&& has(value, '[[Promise]]')\n\t\t\t&& value['[[Promise]]']\n\t\t\t&& typeof value['[[Promise]]'].then === 'function';\n\t},\n\t'AsyncGeneratorRequest Record': function isAsyncGeneratorRequestRecord(value) {\n\t\treturn !!value\n\t\t\t&& has(value, '[[Completion]]') // TODO: confirm is a completion record\n\t\t\t&& has(value, '[[Capability]]')\n\t\t\t&& predicates['PromiseCapability Record'](value['[[Capability]]']);\n\t},\n\t'RegExp Record': function isRegExpRecord(value) {\n\t\treturn value\n\t\t\t&& has(value, '[[IgnoreCase]]')\n\t\t\t&& typeof value['[[IgnoreCase]]'] === 'boolean'\n\t\t\t&& has(value, '[[Multiline]]')\n\t\t\t&& typeof value['[[Multiline]]'] === 'boolean'\n\t\t\t&& has(value, '[[DotAll]]')\n\t\t\t&& typeof value['[[DotAll]]'] === 'boolean'\n\t\t\t&& has(value, '[[Unicode]]')\n\t\t\t&& typeof value['[[Unicode]]'] === 'boolean'\n\t\t\t&& has(value, '[[CapturingGroupsCount]]')\n\t\t\t&& typeof value['[[CapturingGroupsCount]]'] === 'number'\n\t\t\t&& isInteger(value['[[CapturingGroupsCount]]'])\n\t\t\t&& value['[[CapturingGroupsCount]]'] >= 0;\n\t}\n};\n\nmodule.exports = function assertRecord(Type, recordType, argumentName, value) {\n\tvar predicate = predicates[recordType];\n\tif (typeof predicate !== 'function') {\n\t\tthrow new $SyntaxError('unknown record type: ' + recordType);\n\t}\n\tif (Type(value) !== 'Object' || !predicate(value)) {\n\t\tthrow new $TypeError(argumentName + ' must be a ' + recordType);\n\t}\n};\n","'use strict';\n\nmodule.exports = function forEach(array, callback) {\n\tfor (var i = 0; i < array.length; i += 1) {\n\t\tcallback(array[i], i, array); // eslint-disable-line callback-return\n\t}\n};\n","'use strict';\n\nmodule.exports = function fromPropertyDescriptor(Desc) {\n\tif (typeof Desc === 'undefined') {\n\t\treturn Desc;\n\t}\n\tvar obj = {};\n\tif ('[[Value]]' in Desc) {\n\t\tobj.value = Desc['[[Value]]'];\n\t}\n\tif ('[[Writable]]' in Desc) {\n\t\tobj.writable = !!Desc['[[Writable]]'];\n\t}\n\tif ('[[Get]]' in Desc) {\n\t\tobj.get = Desc['[[Get]]'];\n\t}\n\tif ('[[Set]]' in Desc) {\n\t\tobj.set = Desc['[[Set]]'];\n\t}\n\tif ('[[Enumerable]]' in Desc) {\n\t\tobj.enumerable = !!Desc['[[Enumerable]]'];\n\t}\n\tif ('[[Configurable]]' in Desc) {\n\t\tobj.configurable = !!Desc['[[Configurable]]'];\n\t}\n\treturn obj;\n};\n","'use strict';\n\nvar $isNaN = require('./isNaN');\n\nmodule.exports = function (x) { return (typeof x === 'number' || typeof x === 'bigint') && !$isNaN(x) && x !== Infinity && x !== -Infinity; };\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $abs = GetIntrinsic('%Math.abs%');\nvar $floor = GetIntrinsic('%Math.floor%');\n\nvar $isNaN = require('./isNaN');\nvar $isFinite = require('./isFinite');\n\nmodule.exports = function isInteger(argument) {\n\tif (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {\n\t\treturn false;\n\t}\n\tvar absValue = $abs(argument);\n\treturn $floor(absValue) === absValue;\n};\n\n","'use strict';\n\nmodule.exports = function isLeadingSurrogate(charCode) {\n\treturn typeof charCode === 'number' && charCode >= 0xD800 && charCode <= 0xDBFF;\n};\n","'use strict';\n\nvar has = require('has');\n\n// https://262.ecma-international.org/13.0/#sec-match-records\n\nmodule.exports = function isMatchRecord(record) {\n\treturn (\n\t\thas(record, '[[StartIndex]]')\n && has(record, '[[EndIndex]]')\n && record['[[StartIndex]]'] >= 0\n && record['[[EndIndex]]'] >= record['[[StartIndex]]']\n && String(parseInt(record['[[StartIndex]]'], 10)) === String(record['[[StartIndex]]'])\n && String(parseInt(record['[[EndIndex]]'], 10)) === String(record['[[EndIndex]]'])\n\t);\n};\n","'use strict';\n\nmodule.exports = Number.isNaN || function isNaN(a) {\n\treturn a !== a;\n};\n","'use strict';\n\nmodule.exports = function isPrimitive(value) {\n\treturn value === null || (typeof value !== 'function' && typeof value !== 'object');\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar has = require('has');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nmodule.exports = function IsPropertyDescriptor(ES, Desc) {\n\tif (ES.Type(Desc) !== 'Object') {\n\t\treturn false;\n\t}\n\tvar allowed = {\n\t\t'[[Configurable]]': true,\n\t\t'[[Enumerable]]': true,\n\t\t'[[Get]]': true,\n\t\t'[[Set]]': true,\n\t\t'[[Value]]': true,\n\t\t'[[Writable]]': true\n\t};\n\n\tfor (var key in Desc) { // eslint-disable-line no-restricted-syntax\n\t\tif (has(Desc, key) && !allowed[key]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tif (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) {\n\t\tthrow new $TypeError('Property Descriptors may not be both accessor and data descriptors');\n\t}\n\treturn true;\n};\n","'use strict';\n\nmodule.exports = function isTrailingSurrogate(charCode) {\n\treturn typeof charCode === 'number' && charCode >= 0xDC00 && charCode <= 0xDFFF;\n};\n","'use strict';\n\nmodule.exports = Number.MAX_SAFE_INTEGER || 9007199254740991; // Math.pow(2, 53) - 1;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","export class ReflowableListenerAdapter {\n constructor(gesturesBridge) {\n this.gesturesBridge = gesturesBridge;\n }\n onTap(event) {\n const tapEvent = {\n x: (event.clientX - visualViewport.offsetLeft) * visualViewport.scale,\n y: (event.clientY - visualViewport.offsetTop) * visualViewport.scale,\n };\n const stringEvent = JSON.stringify(tapEvent);\n this.gesturesBridge.onTap(stringEvent);\n }\n onLinkActivated(href, outerHtml) {\n this.gesturesBridge.onLinkActivated(href, outerHtml);\n }\n onDecorationActivated(event) {\n const offset = {\n x: (event.event.clientX - visualViewport.offsetLeft) *\n visualViewport.scale,\n y: (event.event.clientY - visualViewport.offsetTop) *\n visualViewport.scale,\n };\n const stringOffset = JSON.stringify(offset);\n const stringRect = JSON.stringify(event.rect);\n this.gesturesBridge.onDecorationActivated(event.id, event.group, stringRect, stringOffset);\n }\n}\nexport class FixedListenerAdapter {\n constructor(window, gesturesApi, documentApi) {\n this.window = window;\n this.gesturesApi = gesturesApi;\n this.documentApi = documentApi;\n this.resizeObserverAdded = false;\n this.documentLoadedFired = false;\n }\n onTap(event) {\n this.gesturesApi.onTap(JSON.stringify(event.offset));\n }\n onLinkActivated(href, outerHtml) {\n this.gesturesApi.onLinkActivated(href, outerHtml);\n }\n onDecorationActivated(event) {\n const stringOffset = JSON.stringify(event.offset);\n const stringRect = JSON.stringify(event.rect);\n this.gesturesApi.onDecorationActivated(event.id, event.group, stringRect, stringOffset);\n }\n onLayout() {\n if (!this.resizeObserverAdded) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const observer = new ResizeObserver(() => {\n requestAnimationFrame(() => {\n const scrollingElement = this.window.document.scrollingElement;\n if (!this.documentLoadedFired &&\n (scrollingElement == null ||\n scrollingElement.scrollHeight > 0 ||\n scrollingElement.scrollWidth > 0)) {\n this.documentApi.onDocumentLoadedAndSized();\n this.documentLoadedFired = true;\n }\n else {\n this.documentApi.onDocumentResized();\n }\n });\n });\n observer.observe(this.window.document.body);\n }\n this.resizeObserverAdded = true;\n }\n}\n","/** Manages a fixed layout resource embedded in an iframe. */\nexport class PageManager {\n constructor(window, iframe, listener) {\n this.margins = { top: 0, right: 0, bottom: 0, left: 0 };\n if (!iframe.contentWindow) {\n throw Error(\"Iframe argument must have been attached to DOM.\");\n }\n this.listener = listener;\n this.iframe = iframe;\n }\n setMessagePort(messagePort) {\n messagePort.onmessage = (message) => {\n this.onMessageFromIframe(message);\n };\n }\n show() {\n this.iframe.style.display = \"unset\";\n }\n hide() {\n this.iframe.style.display = \"none\";\n }\n /** Sets page margins. */\n setMargins(margins) {\n if (this.margins == margins) {\n return;\n }\n this.iframe.style.marginTop = this.margins.top + \"px\";\n this.iframe.style.marginLeft = this.margins.left + \"px\";\n this.iframe.style.marginBottom = this.margins.bottom + \"px\";\n this.iframe.style.marginRight = this.margins.right + \"px\";\n }\n /** Loads page content. */\n loadPage(url) {\n this.iframe.src = url;\n }\n /** Sets the size of this page without content. */\n setPlaceholder(size) {\n this.iframe.style.visibility = \"hidden\";\n this.iframe.style.width = size.width + \"px\";\n this.iframe.style.height = size.height + \"px\";\n this.size = size;\n }\n onMessageFromIframe(event) {\n const message = event.data;\n switch (message.kind) {\n case \"contentSize\":\n return this.onContentSizeAvailable(message.size);\n case \"tap\":\n return this.listener.onTap(message.event);\n case \"linkActivated\":\n return this.onLinkActivated(message);\n case \"decorationActivated\":\n return this.listener.onDecorationActivated(message.event);\n }\n }\n onLinkActivated(message) {\n try {\n const url = new URL(message.href, this.iframe.src);\n this.listener.onLinkActivated(url.toString(), message.outerHtml);\n }\n catch (_a) {\n // Do nothing if url is not valid.\n }\n }\n onContentSizeAvailable(size) {\n if (!size) {\n //FIXME: handle edge case\n return;\n }\n this.iframe.style.width = size.width + \"px\";\n this.iframe.style.height = size.height + \"px\";\n this.size = size;\n this.listener.onIframeLoaded();\n }\n}\n","export class ViewportStringBuilder {\n setInitialScale(scale) {\n this.initialScale = scale;\n return this;\n }\n setMinimumScale(scale) {\n this.minimumScale = scale;\n return this;\n }\n setWidth(width) {\n this.width = width;\n return this;\n }\n setHeight(height) {\n this.height = height;\n return this;\n }\n build() {\n const components = [];\n if (this.initialScale) {\n components.push(\"initial-scale=\" + this.initialScale);\n }\n if (this.minimumScale) {\n components.push(\"minimum-scale=\" + this.minimumScale);\n }\n if (this.width) {\n components.push(\"width=\" + this.width);\n }\n if (this.height) {\n components.push(\"height=\" + this.height);\n }\n return components.join(\", \");\n }\n}\nexport function parseViewportString(viewportString) {\n const regex = /(\\w+) *= *([^\\s,]+)/g;\n const properties = new Map();\n let match;\n while ((match = regex.exec(viewportString))) {\n if (match != null) {\n properties.set(match[1], match[2]);\n }\n }\n const width = parseFloat(properties.get(\"width\"));\n const height = parseFloat(properties.get(\"height\"));\n if (width && height) {\n return { width, height };\n }\n else {\n return undefined;\n }\n}\n","export function offsetToParentCoordinates(offset, iframeRect) {\n return {\n x: (offset.x + iframeRect.left - visualViewport.offsetLeft) *\n visualViewport.scale,\n y: (offset.y + iframeRect.top - visualViewport.offsetTop) *\n visualViewport.scale,\n };\n}\nexport function rectToParentCoordinates(rect, iframeRect) {\n const topLeft = { x: rect.left, y: rect.top };\n const bottomRight = { x: rect.right, y: rect.bottom };\n const shiftedTopLeft = offsetToParentCoordinates(topLeft, iframeRect);\n const shiftedBottomRight = offsetToParentCoordinates(bottomRight, iframeRect);\n return {\n left: shiftedTopLeft.x,\n top: shiftedTopLeft.y,\n right: shiftedBottomRight.x,\n bottom: shiftedBottomRight.y,\n width: shiftedBottomRight.x - shiftedTopLeft.x,\n height: shiftedBottomRight.y - shiftedTopLeft.y,\n };\n}\n","export class GesturesDetector {\n constructor(window, listener, decorationManager) {\n this.window = window;\n this.listener = listener;\n this.decorationManager = decorationManager;\n document.addEventListener(\"click\", (event) => {\n this.onClick(event);\n }, false);\n }\n onClick(event) {\n if (event.defaultPrevented) {\n return;\n }\n const selection = this.window.getSelection();\n if (selection && selection.type == \"Range\") {\n // There's an on-going selection, the tap will dismiss it so we don't forward it.\n // selection.type might be None (collapsed) or Caret with a collapsed range\n // when there is not true selection.\n return;\n }\n let nearestElement;\n if (event.target instanceof HTMLElement) {\n nearestElement = this.nearestInteractiveElement(event.target);\n }\n else {\n nearestElement = null;\n }\n if (nearestElement) {\n if (nearestElement instanceof HTMLAnchorElement) {\n this.listener.onLinkActivated(nearestElement.href, nearestElement.outerHTML);\n event.stopPropagation();\n event.preventDefault();\n }\n else {\n return;\n }\n }\n let decorationActivatedEvent;\n if (this.decorationManager) {\n decorationActivatedEvent =\n this.decorationManager.handleDecorationClickEvent(event);\n }\n else {\n decorationActivatedEvent = null;\n }\n if (decorationActivatedEvent) {\n this.listener.onDecorationActivated(decorationActivatedEvent);\n }\n else {\n this.listener.onTap(event);\n }\n // event.stopPropagation()\n // event.preventDefault()\n }\n // See. https://github.com/JayPanoz/architecture/tree/touch-handling/misc/touch-handling\n nearestInteractiveElement(element) {\n if (element == null) {\n return null;\n }\n const interactiveTags = [\n \"a\",\n \"audio\",\n \"button\",\n \"canvas\",\n \"details\",\n \"input\",\n \"label\",\n \"option\",\n \"select\",\n \"submit\",\n \"textarea\",\n \"video\",\n ];\n if (interactiveTags.indexOf(element.nodeName.toLowerCase()) != -1) {\n return element;\n }\n // Checks whether the element is editable by the user.\n if (element.hasAttribute(\"contenteditable\") &&\n element.getAttribute(\"contenteditable\").toLowerCase() != \"false\") {\n return element;\n }\n // Checks parents recursively because the touch might be for example on an inside a .\n if (element.parentElement) {\n return this.nearestInteractiveElement(element.parentElement);\n }\n return null;\n }\n}\n","import { computeScale } from \"./fit\";\nimport { PageManager } from \"./page-manager\";\nimport { ViewportStringBuilder } from \"../util/viewport\";\nimport { offsetToParentCoordinates } from \"../common/geometry\";\nimport { rectToParentCoordinates } from \"../common/geometry\";\nimport { GesturesDetector } from \"../common/gestures\";\nexport class SingleAreaManager {\n constructor(window, iframe, metaViewport, listener) {\n this.fit = \"contain\";\n this.insets = { top: 0, right: 0, bottom: 0, left: 0 };\n this.scale = 1;\n this.listener = listener;\n const wrapperGesturesListener = {\n onTap: (event) => {\n const offset = {\n x: (event.clientX - visualViewport.offsetLeft) *\n visualViewport.scale,\n y: (event.clientY - visualViewport.offsetTop) * visualViewport.scale,\n };\n listener.onTap({ offset: offset });\n },\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onLinkActivated: (_) => {\n throw Error(\"No interactive element in the root document.\");\n },\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onDecorationActivated: (_) => {\n throw Error(\"No decoration in the root document.\");\n },\n };\n new GesturesDetector(window, wrapperGesturesListener);\n this.metaViewport = metaViewport;\n const pageListener = {\n onIframeLoaded: () => {\n this.onIframeLoaded();\n },\n onTap: (event) => {\n const boundingRect = iframe.getBoundingClientRect();\n const shiftedOffset = offsetToParentCoordinates(event.offset, boundingRect);\n listener.onTap({ offset: shiftedOffset });\n },\n onLinkActivated: (href, outerHtml) => {\n listener.onLinkActivated(href, outerHtml);\n },\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onDecorationActivated: (event) => {\n const boundingRect = iframe.getBoundingClientRect();\n const shiftedOffset = offsetToParentCoordinates(event.offset, boundingRect);\n const shiftedRect = rectToParentCoordinates(event.rect, boundingRect);\n const shiftedEvent = {\n id: event.id,\n group: event.group,\n rect: shiftedRect,\n offset: shiftedOffset,\n };\n listener.onDecorationActivated(shiftedEvent);\n },\n };\n this.page = new PageManager(window, iframe, pageListener);\n }\n setMessagePort(messagePort) {\n this.page.setMessagePort(messagePort);\n }\n setViewport(viewport, insets) {\n if (this.viewport == viewport && this.insets == insets) {\n return;\n }\n this.viewport = viewport;\n this.insets = insets;\n this.layout();\n }\n setFit(fit) {\n if (this.fit == fit) {\n return;\n }\n this.fit = fit;\n this.layout();\n }\n loadResource(url) {\n this.page.hide();\n this.page.loadPage(url);\n }\n onIframeLoaded() {\n if (!this.page.size) {\n // FIXME: raise error\n }\n else {\n this.layout();\n }\n }\n layout() {\n if (!this.page.size || !this.viewport) {\n return;\n }\n const margins = {\n top: this.insets.top,\n right: this.insets.right,\n bottom: this.insets.bottom,\n left: this.insets.left,\n };\n this.page.setMargins(margins);\n const safeDrawingSize = {\n width: this.viewport.width - this.insets.left - this.insets.right,\n height: this.viewport.height - this.insets.top - this.insets.bottom,\n };\n const scale = computeScale(this.fit, this.page.size, safeDrawingSize);\n this.metaViewport.content = new ViewportStringBuilder()\n .setInitialScale(scale)\n .setMinimumScale(scale)\n .setWidth(this.page.size.width)\n .setHeight(this.page.size.height)\n .build();\n this.scale = scale;\n this.page.show();\n this.listener.onLayout();\n }\n}\n","export function computeScale(fit, content, container) {\n switch (fit) {\n case \"contain\":\n return fitContain(content, container);\n case \"width\":\n return fitWidth(content, container);\n case \"height\":\n return fitHeight(content, container);\n }\n}\nfunction fitContain(content, container) {\n const widthRatio = container.width / content.width;\n const heightRatio = container.height / content.height;\n return Math.min(widthRatio, heightRatio);\n}\nfunction fitWidth(content, container) {\n return container.width / content.width;\n}\nfunction fitHeight(content, container) {\n return container.height / content.height;\n}\n","export class DecorationWrapperParentSide {\n setMessagePort(messagePort) {\n this.messagePort = messagePort;\n }\n registerTemplates(templates) {\n this.send({ kind: \"registerTemplates\", templates });\n }\n addDecoration(decoration, group) {\n this.send({ kind: \"addDecoration\", decoration, group });\n }\n removeDecoration(id, group) {\n this.send({ kind: \"removeDecoration\", id, group });\n }\n send(message) {\n var _a;\n (_a = this.messagePort) === null || _a === void 0 ? void 0 : _a.postMessage(message);\n }\n}\nexport class DecorationWrapperIframeSide {\n constructor(messagePort, decorationManager) {\n this.decorationManager = decorationManager;\n messagePort.onmessage = (message) => {\n this.onCommand(message.data);\n };\n }\n onCommand(command) {\n switch (command.kind) {\n case \"registerTemplates\":\n return this.registerTemplates(command.templates);\n case \"addDecoration\":\n return this.addDecoration(command.decoration, command.group);\n case \"removeDecoration\":\n return this.removeDecoration(command.id, command.group);\n }\n }\n registerTemplates(templates) {\n this.decorationManager.registerTemplates(templates);\n }\n addDecoration(decoration, group) {\n this.decorationManager.addDecoration(decoration, group);\n }\n removeDecoration(id, group) {\n this.decorationManager.removeDecoration(id, group);\n }\n}\n","/**\n * From which direction to evaluate strings or nodes: from the start of a string\n * or range seeking Forwards, or from the end seeking Backwards.\n */\nvar TrimDirection;\n(function (TrimDirection) {\n TrimDirection[TrimDirection[\"Forwards\"] = 1] = \"Forwards\";\n TrimDirection[TrimDirection[\"Backwards\"] = 2] = \"Backwards\";\n})(TrimDirection || (TrimDirection = {}));\n/**\n * Return the offset of the nearest non-whitespace character to `baseOffset`\n * within the string `text`, looking in the `direction` indicated. Return -1 if\n * no non-whitespace character exists between `baseOffset` (inclusive) and the\n * terminus of the string (start or end depending on `direction`).\n */\nfunction closestNonSpaceInString(text, baseOffset, direction) {\n const nextChar = direction === TrimDirection.Forwards ? baseOffset : baseOffset - 1;\n if (text.charAt(nextChar).trim() !== \"\") {\n // baseOffset is already valid: it points at a non-whitespace character\n return baseOffset;\n }\n let availableChars;\n let availableNonWhitespaceChars;\n if (direction === TrimDirection.Backwards) {\n availableChars = text.substring(0, baseOffset);\n availableNonWhitespaceChars = availableChars.trimEnd();\n }\n else {\n availableChars = text.substring(baseOffset);\n availableNonWhitespaceChars = availableChars.trimStart();\n }\n if (!availableNonWhitespaceChars.length) {\n return -1;\n }\n const offsetDelta = availableChars.length - availableNonWhitespaceChars.length;\n return direction === TrimDirection.Backwards\n ? baseOffset - offsetDelta\n : baseOffset + offsetDelta;\n}\n/**\n * Calculate a new Range start position (TrimDirection.Forwards) or end position\n * (Backwards) for `range` that represents the nearest non-whitespace character,\n * moving into the `range` away from the relevant initial boundary node towards\n * the terminating boundary node.\n *\n * @throws {RangeError} If no text node with non-whitespace characters found\n */\nfunction closestNonSpaceInRange(range, direction) {\n const nodeIter = range.commonAncestorContainer.ownerDocument.createNodeIterator(range.commonAncestorContainer, NodeFilter.SHOW_TEXT);\n const initialBoundaryNode = direction === TrimDirection.Forwards\n ? range.startContainer\n : range.endContainer;\n const terminalBoundaryNode = direction === TrimDirection.Forwards\n ? range.endContainer\n : range.startContainer;\n let currentNode = nodeIter.nextNode();\n // Advance the NodeIterator to the `initialBoundaryNode`\n while (currentNode && currentNode !== initialBoundaryNode) {\n currentNode = nodeIter.nextNode();\n }\n if (direction === TrimDirection.Backwards) {\n // Reverse the NodeIterator direction. This will return the same node\n // as the previous `nextNode()` call (initial boundary node).\n currentNode = nodeIter.previousNode();\n }\n let trimmedOffset = -1;\n const advance = () => {\n currentNode =\n direction === TrimDirection.Forwards\n ? nodeIter.nextNode()\n : nodeIter.previousNode();\n if (currentNode) {\n const nodeText = currentNode.textContent;\n const baseOffset = direction === TrimDirection.Forwards ? 0 : nodeText.length;\n trimmedOffset = closestNonSpaceInString(nodeText, baseOffset, direction);\n }\n };\n while (currentNode &&\n trimmedOffset === -1 &&\n currentNode !== terminalBoundaryNode) {\n advance();\n }\n if (currentNode && trimmedOffset >= 0) {\n return { node: currentNode, offset: trimmedOffset };\n }\n /* istanbul ignore next */\n throw new RangeError(\"No text nodes with non-whitespace text found in range\");\n}\n/**\n * Return a new DOM Range that adjusts the start and end positions of `range` as\n * needed such that:\n *\n * - `startContainer` and `endContainer` text nodes both contain at least one\n * non-whitespace character within the Range's text content\n * - `startOffset` and `endOffset` both reference non-whitespace characters,\n * with `startOffset` immediately before the first non-whitespace character\n * and `endOffset` immediately after the last\n *\n * Whitespace characters are those that are removed by `String.prototype.trim()`\n *\n * @param range - A DOM Range that whose `startContainer` and `endContainer` are\n * both text nodes, and which contains at least one non-whitespace character.\n * @throws {RangeError}\n */\nexport function trimRange(range) {\n if (!range.toString().trim().length) {\n throw new RangeError(\"Range contains no non-whitespace text\");\n }\n if (range.startContainer.nodeType !== Node.TEXT_NODE) {\n throw new RangeError(\"Range startContainer is not a text node\");\n }\n if (range.endContainer.nodeType !== Node.TEXT_NODE) {\n throw new RangeError(\"Range endContainer is not a text node\");\n }\n const trimmedRange = range.cloneRange();\n let startTrimmed = false;\n let endTrimmed = false;\n const trimmedOffsets = {\n start: closestNonSpaceInString(range.startContainer.textContent, range.startOffset, TrimDirection.Forwards),\n end: closestNonSpaceInString(range.endContainer.textContent, range.endOffset, TrimDirection.Backwards),\n };\n if (trimmedOffsets.start >= 0) {\n trimmedRange.setStart(range.startContainer, trimmedOffsets.start);\n startTrimmed = true;\n }\n // Note: An offset of 0 is invalid for an end offset, as no text in the\n // node would be included in the range.\n if (trimmedOffsets.end > 0) {\n trimmedRange.setEnd(range.endContainer, trimmedOffsets.end);\n endTrimmed = true;\n }\n if (startTrimmed && endTrimmed) {\n return trimmedRange;\n }\n if (!startTrimmed) {\n // There are no (non-whitespace) characters between `startOffset` and the\n // end of the `startContainer` node.\n const { node, offset } = closestNonSpaceInRange(trimmedRange, TrimDirection.Forwards);\n if (node && offset >= 0) {\n trimmedRange.setStart(node, offset);\n }\n }\n if (!endTrimmed) {\n // There are no (non-whitespace) characters between the start of the Range's\n // `endContainer` text content and the `endOffset`.\n const { node, offset } = closestNonSpaceInRange(trimmedRange, TrimDirection.Backwards);\n if (node && offset > 0) {\n trimmedRange.setEnd(node, offset);\n }\n }\n return trimmedRange;\n}\n","import { trimRange } from \"./trim-range\";\n/**\n * Return the combined length of text nodes contained in `node`.\n */\nfunction nodeTextLength(node) {\n var _a, _b;\n switch (node.nodeType) {\n case Node.ELEMENT_NODE:\n case Node.TEXT_NODE:\n // nb. `textContent` excludes text in comments and processing instructions\n // when called on a parent element, so we don't need to subtract that here.\n return (_b = (_a = node.textContent) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;\n default:\n return 0;\n }\n}\n/**\n * Return the total length of the text of all previous siblings of `node`.\n */\nfunction previousSiblingsTextLength(node) {\n let sibling = node.previousSibling;\n let length = 0;\n while (sibling) {\n length += nodeTextLength(sibling);\n sibling = sibling.previousSibling;\n }\n return length;\n}\n/**\n * Resolve one or more character offsets within an element to (text node,\n * position) pairs.\n *\n * @param element\n * @param offsets - Offsets, which must be sorted in ascending order\n * @throws {RangeError}\n */\nfunction resolveOffsets(element, ...offsets) {\n let nextOffset = offsets.shift();\n const nodeIter = element.ownerDocument.createNodeIterator(element, NodeFilter.SHOW_TEXT);\n const results = [];\n let currentNode = nodeIter.nextNode();\n let textNode;\n let length = 0;\n // Find the text node containing the `nextOffset`th character from the start\n // of `element`.\n while (nextOffset !== undefined && currentNode) {\n textNode = currentNode;\n if (length + textNode.data.length > nextOffset) {\n results.push({ node: textNode, offset: nextOffset - length });\n nextOffset = offsets.shift();\n }\n else {\n currentNode = nodeIter.nextNode();\n length += textNode.data.length;\n }\n }\n // Boundary case.\n while (nextOffset !== undefined && textNode && length === nextOffset) {\n results.push({ node: textNode, offset: textNode.data.length });\n nextOffset = offsets.shift();\n }\n if (nextOffset !== undefined) {\n throw new RangeError(\"Offset exceeds text length\");\n }\n return results;\n}\n/**\n * When resolving a TextPosition, specifies the direction to search for the\n * nearest text node if `offset` is `0` and the element has no text.\n */\nexport var ResolveDirection;\n(function (ResolveDirection) {\n ResolveDirection[ResolveDirection[\"FORWARDS\"] = 1] = \"FORWARDS\";\n ResolveDirection[ResolveDirection[\"BACKWARDS\"] = 2] = \"BACKWARDS\";\n})(ResolveDirection || (ResolveDirection = {}));\n/**\n * Represents an offset within the text content of an element.\n *\n * This position can be resolved to a specific descendant node in the current\n * DOM subtree of the element using the `resolve` method.\n */\nexport class TextPosition {\n constructor(element, offset) {\n if (offset < 0) {\n throw new Error(\"Offset is invalid\");\n }\n /** Element that `offset` is relative to. */\n this.element = element;\n /** Character offset from the start of the element's `textContent`. */\n this.offset = offset;\n }\n /**\n * Return a copy of this position with offset relative to a given ancestor\n * element.\n *\n * @param parent - Ancestor of `this.element`\n */\n relativeTo(parent) {\n if (!parent.contains(this.element)) {\n throw new Error(\"Parent is not an ancestor of current element\");\n }\n let el = this.element;\n let offset = this.offset;\n while (el !== parent) {\n offset += previousSiblingsTextLength(el);\n el = el.parentElement;\n }\n return new TextPosition(el, offset);\n }\n /**\n * Resolve the position to a specific text node and offset within that node.\n *\n * Throws if `this.offset` exceeds the length of the element's text. In the\n * case where the element has no text and `this.offset` is 0, the `direction`\n * option determines what happens.\n *\n * Offsets at the boundary between two nodes are resolved to the start of the\n * node that begins at the boundary.\n *\n * @param options.direction - Specifies in which direction to search for the\n * nearest text node if `this.offset` is `0` and\n * `this.element` has no text. If not specified an\n * error is thrown.\n *\n * @throws {RangeError}\n */\n resolve(options = {}) {\n try {\n return resolveOffsets(this.element, this.offset)[0];\n }\n catch (err) {\n if (this.offset === 0 && options.direction !== undefined) {\n const tw = document.createTreeWalker(this.element.getRootNode(), NodeFilter.SHOW_TEXT);\n tw.currentNode = this.element;\n const forwards = options.direction === ResolveDirection.FORWARDS;\n const text = forwards\n ? tw.nextNode()\n : tw.previousNode();\n if (!text) {\n throw err;\n }\n return { node: text, offset: forwards ? 0 : text.data.length };\n }\n else {\n throw err;\n }\n }\n }\n /**\n * Construct a `TextPosition` that refers to the `offset`th character within\n * `node`.\n */\n static fromCharOffset(node, offset) {\n switch (node.nodeType) {\n case Node.TEXT_NODE:\n return TextPosition.fromPoint(node, offset);\n case Node.ELEMENT_NODE:\n return new TextPosition(node, offset);\n default:\n throw new Error(\"Node is not an element or text node\");\n }\n }\n /**\n * Construct a `TextPosition` representing the range start or end point (node, offset).\n *\n * @param node\n * @param offset - Offset within the node\n */\n static fromPoint(node, offset) {\n switch (node.nodeType) {\n case Node.TEXT_NODE: {\n if (offset < 0 || offset > node.data.length) {\n throw new Error(\"Text node offset is out of range\");\n }\n if (!node.parentElement) {\n throw new Error(\"Text node has no parent\");\n }\n // Get the offset from the start of the parent element.\n const textOffset = previousSiblingsTextLength(node) + offset;\n return new TextPosition(node.parentElement, textOffset);\n }\n case Node.ELEMENT_NODE: {\n if (offset < 0 || offset > node.childNodes.length) {\n throw new Error(\"Child node offset is out of range\");\n }\n // Get the text length before the `offset`th child of element.\n let textOffset = 0;\n for (let i = 0; i < offset; i++) {\n textOffset += nodeTextLength(node.childNodes[i]);\n }\n return new TextPosition(node, textOffset);\n }\n default:\n throw new Error(\"Point is not in an element or text node\");\n }\n }\n}\n/**\n * Represents a region of a document as a (start, end) pair of `TextPosition` points.\n *\n * Representing a range in this way allows for changes in the DOM content of the\n * range which don't affect its text content, without affecting the text content\n * of the range itself.\n */\nexport class TextRange {\n constructor(start, end) {\n this.start = start;\n this.end = end;\n }\n /**\n * Create a new TextRange whose `start` and `end` are computed relative to\n * `element`. `element` must be an ancestor of both `start.element` and\n * `end.element`.\n */\n relativeTo(element) {\n return new TextRange(this.start.relativeTo(element), this.end.relativeTo(element));\n }\n /**\n * Resolve this TextRange to a (DOM) Range.\n *\n * The resulting DOM Range will always start and end in a `Text` node.\n * Hence `TextRange.fromRange(range).toRange()` can be used to \"shrink\" a\n * range to the text it contains.\n *\n * May throw if the `start` or `end` positions cannot be resolved to a range.\n */\n toRange() {\n let start;\n let end;\n if (this.start.element === this.end.element &&\n this.start.offset <= this.end.offset) {\n // Fast path for start and end points in same element.\n [start, end] = resolveOffsets(this.start.element, this.start.offset, this.end.offset);\n }\n else {\n start = this.start.resolve({\n direction: ResolveDirection.FORWARDS,\n });\n end = this.end.resolve({ direction: ResolveDirection.BACKWARDS });\n }\n const range = new Range();\n range.setStart(start.node, start.offset);\n range.setEnd(end.node, end.offset);\n return range;\n }\n /**\n * Create a TextRange from a (DOM) Range\n */\n static fromRange(range) {\n const start = TextPosition.fromPoint(range.startContainer, range.startOffset);\n const end = TextPosition.fromPoint(range.endContainer, range.endOffset);\n return new TextRange(start, end);\n }\n /**\n * Create a TextRange representing the `start`th to `end`th characters in\n * `root`\n */\n static fromOffsets(root, start, end) {\n return new TextRange(new TextPosition(root, start), new TextPosition(root, end));\n }\n /**\n * Return a new Range representing `range` trimmed of any leading or trailing\n * whitespace\n */\n static trimmedRange(range) {\n return trimRange(TextRange.fromRange(range).toRange());\n }\n}\n","//\n// Copyright 2021 Readium Foundation. All rights reserved.\n// Use of this source code is governed by the BSD-style license\n// available in the top-level LICENSE file of the project.\n//\nimport { dezoomRect, domRectToRect } from \"../util/rect\";\nimport { log } from \"../util/log\";\nimport { TextRange } from \"../vendor/hypothesis/annotator/anchoring/text-range\";\n// Polyfill for Android API 26\nimport matchAll from \"string.prototype.matchall\";\nimport { rectToParentCoordinates } from \"./geometry\";\nmatchAll.shim();\nexport function selectionToParentCoordinates(selection, iframe) {\n const boundingRect = iframe.getBoundingClientRect();\n const shiftedRect = rectToParentCoordinates(selection.selectionRect, boundingRect);\n return {\n selectedText: selection === null || selection === void 0 ? void 0 : selection.selectedText,\n selectionRect: shiftedRect,\n textBefore: selection.textBefore,\n textAfter: selection.textAfter,\n };\n}\nexport class SelectionManager {\n constructor(window) {\n this.isSelecting = false;\n //, listener: SelectionListener) {\n this.window = window;\n /*this.listener = listener\n document.addEventListener(\n \"selectionchange\",\n () => {\n const selection = window.getSelection()!\n const collapsed = selection.isCollapsed\n \n if (collapsed && this.isSelecting) {\n this.isSelecting = false\n this.listener.onSelectionEnd()\n } else if (!collapsed && !this.isSelecting) {\n this.isSelecting = true\n this.listener.onSelectionStart()\n }\n },\n false\n )*/\n }\n clearSelection() {\n var _a;\n (_a = this.window.getSelection()) === null || _a === void 0 ? void 0 : _a.removeAllRanges();\n }\n getCurrentSelection() {\n const text = this.getCurrentSelectionText();\n if (!text) {\n return null;\n }\n const rect = this.getSelectionRect();\n return {\n selectedText: text.highlight,\n textBefore: text.before,\n textAfter: text.after,\n selectionRect: rect,\n };\n }\n getSelectionRect() {\n try {\n const selection = this.window.getSelection();\n const range = selection.getRangeAt(0);\n const zoom = this.window.document.body.currentCSSZoom;\n return dezoomRect(domRectToRect(range.getBoundingClientRect()), zoom);\n }\n catch (e) {\n log(e);\n throw e;\n //return null\n }\n }\n getCurrentSelectionText() {\n const selection = this.window.getSelection();\n if (selection.isCollapsed) {\n return undefined;\n }\n const highlight = selection.toString();\n const cleanHighlight = highlight\n .trim()\n .replace(/\\n/g, \" \")\n .replace(/\\s\\s+/g, \" \");\n if (cleanHighlight.length === 0) {\n return undefined;\n }\n if (!selection.anchorNode || !selection.focusNode) {\n return undefined;\n }\n const range = selection.rangeCount === 1\n ? selection.getRangeAt(0)\n : createOrderedRange(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);\n if (!range || range.collapsed) {\n log(\"$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!\");\n return undefined;\n }\n const text = document.body.textContent;\n const textRange = TextRange.fromRange(range).relativeTo(document.body);\n const start = textRange.start.offset;\n const end = textRange.end.offset;\n const snippetLength = 200;\n // Compute the text before the highlight, ignoring the first \"word\", which might be cut.\n let before = text.slice(Math.max(0, start - snippetLength), start);\n const firstWordStart = before.search(/\\P{L}\\p{L}/gu);\n if (firstWordStart !== -1) {\n before = before.slice(firstWordStart + 1);\n }\n // Compute the text after the highlight, ignoring the last \"word\", which might be cut.\n let after = text.slice(end, Math.min(text.length, end + snippetLength));\n const lastWordEnd = Array.from(after.matchAll(/\\p{L}\\P{L}/gu)).pop();\n if (lastWordEnd !== undefined && lastWordEnd.index > 1) {\n after = after.slice(0, lastWordEnd.index + 1);\n }\n return { highlight, before, after };\n }\n}\nfunction createOrderedRange(startNode, startOffset, endNode, endOffset) {\n const range = new Range();\n range.setStart(startNode, startOffset);\n range.setEnd(endNode, endOffset);\n if (!range.collapsed) {\n return range;\n }\n log(\">>> createOrderedRange COLLAPSED ... RANGE REVERSE?\");\n const rangeReverse = new Range();\n rangeReverse.setStart(endNode, endOffset);\n rangeReverse.setEnd(startNode, startOffset);\n if (!rangeReverse.collapsed) {\n log(\">>> createOrderedRange RANGE REVERSE OK.\");\n return range;\n }\n log(\">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!\");\n return undefined;\n}\n/*\nexport function convertRangeInfo(document: Document, rangeInfo) {\n const startElement = document.querySelector(\n rangeInfo.startContainerElementCssSelector\n );\n if (!startElement) {\n log(\"^^^ convertRangeInfo NO START ELEMENT CSS SELECTOR?!\");\n return undefined;\n }\n let startContainer = startElement;\n if (rangeInfo.startContainerChildTextNodeIndex >= 0) {\n if (\n rangeInfo.startContainerChildTextNodeIndex >=\n startElement.childNodes.length\n ) {\n log(\n \"^^^ convertRangeInfo rangeInfo.startContainerChildTextNodeIndex >= startElement.childNodes.length?!\"\n );\n return undefined;\n }\n startContainer =\n startElement.childNodes[rangeInfo.startContainerChildTextNodeIndex];\n if (startContainer.nodeType !== Node.TEXT_NODE) {\n log(\"^^^ convertRangeInfo startContainer.nodeType !== Node.TEXT_NODE?!\");\n return undefined;\n }\n }\n const endElement = document.querySelector(\n rangeInfo.endContainerElementCssSelector\n );\n if (!endElement) {\n log(\"^^^ convertRangeInfo NO END ELEMENT CSS SELECTOR?!\");\n return undefined;\n }\n let endContainer = endElement;\n if (rangeInfo.endContainerChildTextNodeIndex >= 0) {\n if (\n rangeInfo.endContainerChildTextNodeIndex >= endElement.childNodes.length\n ) {\n log(\n \"^^^ convertRangeInfo rangeInfo.endContainerChildTextNodeIndex >= endElement.childNodes.length?!\"\n );\n return undefined;\n }\n endContainer =\n endElement.childNodes[rangeInfo.endContainerChildTextNodeIndex];\n if (endContainer.nodeType !== Node.TEXT_NODE) {\n log(\"^^^ convertRangeInfo endContainer.nodeType !== Node.TEXT_NODE?!\");\n return undefined;\n }\n }\n return createOrderedRange(\n startContainer,\n rangeInfo.startOffset,\n endContainer,\n rangeInfo.endOffset\n );\n}\n\nexport function location2RangeInfo(location) {\n const locations = location.locations;\n const domRange = locations.domRange;\n const start = domRange.start;\n const end = domRange.end;\n\n return {\n endContainerChildTextNodeIndex: end.textNodeIndex,\n endContainerElementCssSelector: end.cssSelector,\n endOffset: end.offset,\n startContainerChildTextNodeIndex: start.textNodeIndex,\n startContainerElementCssSelector: start.cssSelector,\n startOffset: start.offset,\n };\n}\n*/\n","export class SelectionWrapperParentSide {\n constructor(listener) {\n this.selectionListener = listener;\n }\n setMessagePort(messagePort) {\n this.messagePort = messagePort;\n messagePort.onmessage = (message) => {\n this.onFeedback(message.data);\n };\n }\n requestSelection(requestId) {\n this.send({ kind: \"requestSelection\", requestId: requestId });\n }\n clearSelection() {\n this.send({ kind: \"clearSelection\" });\n }\n onFeedback(feedback) {\n switch (feedback.kind) {\n case \"selectionAvailable\":\n return this.onSelectionAvailable(feedback.requestId, feedback.selection);\n }\n }\n onSelectionAvailable(requestId, selection) {\n this.selectionListener.onSelectionAvailable(requestId, selection);\n }\n send(message) {\n var _a;\n (_a = this.messagePort) === null || _a === void 0 ? void 0 : _a.postMessage(message);\n }\n}\nexport class SelectionWrapperIframeSide {\n constructor(messagePort, manager) {\n this.selectionManager = manager;\n this.messagePort = messagePort;\n messagePort.onmessage = (message) => {\n this.onCommand(message.data);\n };\n }\n onCommand(command) {\n switch (command.kind) {\n case \"requestSelection\":\n return this.onRequestSelection(command.requestId);\n case \"clearSelection\":\n return this.onClearSelection();\n }\n }\n onRequestSelection(requestId) {\n const selection = this.selectionManager.getCurrentSelection();\n const feedback = {\n kind: \"selectionAvailable\",\n requestId: requestId,\n selection: selection,\n };\n this.sendFeedback(feedback);\n }\n onClearSelection() {\n this.selectionManager.clearSelection();\n }\n sendFeedback(message) {\n this.messagePort.postMessage(message);\n }\n}\n","//\n// Copyright 2024 Readium Foundation. All rights reserved.\n// Use of this source code is governed by the BSD-style license\n// available in the top-level LICENSE file of the project.\n//\nimport { FixedSingleAreaBridge as FixedSingleAreaBridge } from \"./bridge/fixed-area-bridge\";\nimport { FixedSingleDecorationsBridge } from \"./bridge/all-decoration-bridge\";\nimport { FixedSingleSelectionBridge } from \"./bridge/all-selection-bridge\";\nimport { FixedSingleInitializationBridge, } from \"./bridge/all-initialization-bridge\";\nconst iframe = document.getElementById(\"page\");\nconst metaViewport = document.querySelector(\"meta[name=viewport]\");\nwindow.singleArea = new FixedSingleAreaBridge(window, iframe, metaViewport, window.gestures, window.documentState);\nwindow.singleSelection = new FixedSingleSelectionBridge(window.singleSelectionListener);\nwindow.singleDecorations = new FixedSingleDecorationsBridge();\nwindow.singleInitialization = new FixedSingleInitializationBridge(window, window.fixedApiState, iframe, window.singleArea, window.singleSelection, window.singleDecorations);\nwindow.fixedApiState.onInitializationApiAvailable();\n","import { DoubleAreaManager } from \"../fixed/double-area-manager\";\nimport { FixedListenerAdapter, } from \"./all-listener-bridge\";\nimport { SingleAreaManager } from \"../fixed/single-area-manager\";\nexport class FixedSingleAreaBridge {\n constructor(window, iframe, metaViewport, gesturesBridge, documentBridge) {\n const listener = new FixedListenerAdapter(window, gesturesBridge, documentBridge);\n this.manager = new SingleAreaManager(window, iframe, metaViewport, listener);\n }\n setMessagePort(messagePort) {\n this.manager.setMessagePort(messagePort);\n }\n loadResource(url) {\n this.manager.loadResource(url);\n }\n setViewport(viewporttWidth, viewportHeight, insetTop, insetRight, insetBottom, insetLeft) {\n const viewport = { width: viewporttWidth, height: viewportHeight };\n const insets = {\n top: insetTop,\n left: insetLeft,\n bottom: insetBottom,\n right: insetRight,\n };\n this.manager.setViewport(viewport, insets);\n }\n setFit(fit) {\n if (fit != \"contain\" && fit != \"width\" && fit != \"height\") {\n throw Error(`Invalid fit value: ${fit}`);\n }\n this.manager.setFit(fit);\n }\n}\nexport class FixedDoubleAreaBridge {\n constructor(window, leftIframe, rightIframe, metaViewport, gesturesBridge, documentBridge) {\n const listener = new FixedListenerAdapter(window, gesturesBridge, documentBridge);\n this.manager = new DoubleAreaManager(window, leftIframe, rightIframe, metaViewport, listener);\n }\n setLeftMessagePort(messagePort) {\n this.manager.setLeftMessagePort(messagePort);\n }\n setRightMessagePort(messagePort) {\n this.manager.setRightMessagePort(messagePort);\n }\n loadSpread(spread) {\n this.manager.loadSpread(spread);\n }\n setViewport(viewporttWidth, viewportHeight, insetTop, insetRight, insetBottom, insetLeft) {\n const viewport = { width: viewporttWidth, height: viewportHeight };\n const insets = {\n top: insetTop,\n left: insetLeft,\n bottom: insetBottom,\n right: insetRight,\n };\n this.manager.setViewport(viewport, insets);\n }\n setFit(fit) {\n if (fit != \"contain\" && fit != \"width\" && fit != \"height\") {\n throw Error(`Invalid fit value: ${fit}`);\n }\n this.manager.setFit(fit);\n }\n}\n","import { selectionToParentCoordinates, } from \"../common/selection\";\nimport { SelectionWrapperParentSide } from \"../fixed/selection-wrapper\";\nexport class ReflowableSelectionBridge {\n constructor(window, manager) {\n this.window = window;\n this.manager = manager;\n }\n getCurrentSelection() {\n return this.manager.getCurrentSelection();\n }\n clearSelection() {\n this.manager.clearSelection();\n }\n}\nexport class FixedSingleSelectionBridge {\n constructor(listener) {\n this.listener = listener;\n const wrapperListener = {\n onSelectionAvailable: (requestId, selection) => {\n const selectionAsJson = JSON.stringify(selection);\n this.listener.onSelectionAvailable(requestId, selectionAsJson);\n },\n };\n this.wrapper = new SelectionWrapperParentSide(wrapperListener);\n }\n setMessagePort(messagePort) {\n this.wrapper.setMessagePort(messagePort);\n }\n requestSelection(requestId) {\n this.wrapper.requestSelection(requestId);\n }\n clearSelection() {\n this.wrapper.clearSelection();\n }\n}\nexport class FixedDoubleSelectionBridge {\n constructor(leftIframe, rightIframe, listener) {\n this.requestStates = new Map();\n this.isLeftInitialized = false;\n this.isRightInitialized = false;\n this.leftIframe = leftIframe;\n this.rightIframe = rightIframe;\n this.listener = listener;\n const leftWrapperListener = {\n onSelectionAvailable: (requestId, selection) => {\n if (selection) {\n const resolvedSelection = selectionToParentCoordinates(selection, this.leftIframe);\n this.onSelectionAvailable(requestId, \"left\", resolvedSelection);\n }\n else {\n this.onSelectionAvailable(requestId, \"left\", selection);\n }\n },\n };\n this.leftWrapper = new SelectionWrapperParentSide(leftWrapperListener);\n const rightWrapperListener = {\n onSelectionAvailable: (requestId, selection) => {\n if (selection) {\n const resolvedSelection = selectionToParentCoordinates(selection, this.rightIframe);\n this.onSelectionAvailable(requestId, \"right\", resolvedSelection);\n }\n else {\n this.onSelectionAvailable(requestId, \"right\", selection);\n }\n },\n };\n this.rightWrapper = new SelectionWrapperParentSide(rightWrapperListener);\n }\n setLeftMessagePort(messagePort) {\n this.leftWrapper.setMessagePort(messagePort);\n this.isLeftInitialized = true;\n }\n setRightMessagePort(messagePort) {\n this.rightWrapper.setMessagePort(messagePort);\n this.isRightInitialized = true;\n }\n requestSelection(requestId) {\n if (this.isLeftInitialized && this.isRightInitialized) {\n this.requestStates.set(requestId, \"pending\");\n this.leftWrapper.requestSelection(requestId);\n this.rightWrapper.requestSelection(requestId);\n }\n else if (this.isLeftInitialized) {\n this.requestStates.set(requestId, \"firstResponseWasNull\");\n this.leftWrapper.requestSelection(requestId);\n }\n else if (this.isRightInitialized) {\n this.requestStates.set(requestId, \"firstResponseWasNull\");\n this.rightWrapper.requestSelection(requestId);\n }\n else {\n this.requestStates.set(requestId, \"firstResponseWasNull\");\n this.onSelectionAvailable(requestId, \"left\", null);\n }\n }\n clearSelection() {\n this.leftWrapper.clearSelection();\n this.rightWrapper.clearSelection();\n }\n onSelectionAvailable(requestId, iframe, selection) {\n const requestState = this.requestStates.get(requestId);\n if (!requestState) {\n return;\n }\n if (!selection && requestState === \"pending\") {\n this.requestStates.set(requestId, \"firstResponseWasNull\");\n return;\n }\n this.requestStates.delete(requestId);\n const selectionAsJson = JSON.stringify(selection);\n this.listener.onSelectionAvailable(requestId, iframe, selectionAsJson);\n }\n}\n","import { DecorationWrapperParentSide } from \"../fixed/decoration-wrapper\";\nexport class ReflowableDecorationsBridge {\n constructor(window, manager) {\n this.window = window;\n this.manager = manager;\n }\n registerTemplates(templates) {\n const templatesAsMap = parseTemplates(templates);\n this.manager.registerTemplates(templatesAsMap);\n }\n addDecoration(decoration, group) {\n const actualDecoration = parseDecoration(decoration);\n this.manager.addDecoration(actualDecoration, group);\n }\n removeDecoration(id, group) {\n this.manager.removeDecoration(id, group);\n }\n}\nexport class FixedSingleDecorationsBridge {\n constructor() {\n this.wrapper = new DecorationWrapperParentSide();\n }\n setMessagePort(messagePort) {\n this.wrapper.setMessagePort(messagePort);\n }\n registerTemplates(templates) {\n const actualTemplates = parseTemplates(templates);\n this.wrapper.registerTemplates(actualTemplates);\n }\n addDecoration(decoration, group) {\n const actualDecoration = parseDecoration(decoration);\n this.wrapper.addDecoration(actualDecoration, group);\n }\n removeDecoration(id, group) {\n this.wrapper.removeDecoration(id, group);\n }\n}\nexport class FixedDoubleDecorationsBridge {\n constructor() {\n this.leftWrapper = new DecorationWrapperParentSide();\n this.rightWrapper = new DecorationWrapperParentSide();\n }\n setLeftMessagePort(messagePort) {\n this.leftWrapper.setMessagePort(messagePort);\n }\n setRightMessagePort(messagePort) {\n this.rightWrapper.setMessagePort(messagePort);\n }\n registerTemplates(templates) {\n const actualTemplates = parseTemplates(templates);\n this.leftWrapper.registerTemplates(actualTemplates);\n this.rightWrapper.registerTemplates(actualTemplates);\n }\n addDecoration(decoration, iframe, group) {\n const actualDecoration = parseDecoration(decoration);\n switch (iframe) {\n case \"left\":\n this.leftWrapper.addDecoration(actualDecoration, group);\n break;\n case \"right\":\n this.rightWrapper.addDecoration(actualDecoration, group);\n break;\n default:\n throw Error(`Unknown iframe type: ${iframe}`);\n }\n }\n removeDecoration(id, group) {\n this.leftWrapper.removeDecoration(id, group);\n this.rightWrapper.removeDecoration(id, group);\n }\n}\nfunction parseTemplates(templates) {\n return new Map(Object.entries(JSON.parse(templates)));\n}\nfunction parseDecoration(decoration) {\n const jsonDecoration = JSON.parse(decoration);\n return jsonDecoration;\n}\n","import { DecorationWrapperIframeSide } from \"../fixed/decoration-wrapper\";\nimport { IframeMessageSender } from \"../fixed/iframe-message\";\nimport { SelectionWrapperIframeSide } from \"../fixed/selection-wrapper\";\nexport class FixedSingleInitializationBridge {\n constructor(window, listener, iframe, areaBridge, selectionBridge, decorationsBridge) {\n this.window = window;\n this.listener = listener;\n this.iframe = iframe;\n this.areaBridge = areaBridge;\n this.selectionBridge = selectionBridge;\n this.decorationsBridge = decorationsBridge;\n }\n loadResource(url) {\n this.iframe.src = url;\n this.window.addEventListener(\"message\", (event) => {\n console.log(\"message\");\n if (!event.ports[0]) {\n return;\n }\n if (event.source === this.iframe.contentWindow) {\n this.onInitMessage(event);\n }\n });\n }\n onInitMessage(event) {\n console.log(`receiving init message ${event}`);\n const initMessage = event.data;\n const messagePort = event.ports[0];\n switch (initMessage) {\n case \"InitAreaManager\":\n return this.initAreaManager(messagePort);\n case \"InitSelection\":\n return this.initSelection(messagePort);\n case \"InitDecorations\":\n return this.initDecorations(messagePort);\n }\n }\n initAreaManager(messagePort) {\n this.areaBridge.setMessagePort(messagePort);\n this.listener.onAreaApiAvailable();\n }\n initSelection(messagePort) {\n this.selectionBridge.setMessagePort(messagePort);\n this.listener.onSelectionApiAvailable();\n }\n initDecorations(messagePort) {\n this.decorationsBridge.setMessagePort(messagePort);\n this.listener.onDecorationApiAvailable();\n }\n}\nexport class FixedDoubleInitializationBridge {\n constructor(window, listener, leftIframe, rightIframe, areaBridge, selectionBridge, decorationsBridge) {\n this.areaReadySemaphore = 2;\n this.selectionReadySemaphore = 2;\n this.decorationReadySemaphore = 2;\n this.listener = listener;\n this.areaBridge = areaBridge;\n this.selectionBridge = selectionBridge;\n this.decorationsBridge = decorationsBridge;\n window.addEventListener(\"message\", (event) => {\n if (!event.ports[0]) {\n return;\n }\n if (event.source === leftIframe.contentWindow) {\n this.onInitMessageLeft(event);\n }\n else if (event.source == rightIframe.contentWindow) {\n this.onInitMessageRight(event);\n }\n });\n }\n loadSpread(spread) {\n const pageNb = (spread.left ? 1 : 0) + (spread.right ? 1 : 0);\n this.areaReadySemaphore = pageNb;\n this.selectionReadySemaphore = pageNb;\n this.decorationReadySemaphore = pageNb;\n this.areaBridge.loadSpread(spread);\n }\n onInitMessageLeft(event) {\n const initMessage = event.data;\n const messagePort = event.ports[0];\n switch (initMessage) {\n case \"InitAreaManager\":\n this.areaBridge.setLeftMessagePort(messagePort);\n this.onInitAreaMessage();\n break;\n case \"InitSelection\":\n this.selectionBridge.setLeftMessagePort(messagePort);\n this.onInitSelectionMessage();\n break;\n case \"InitDecorations\":\n this.decorationsBridge.setLeftMessagePort(messagePort);\n this.onInitDecorationMessage();\n break;\n }\n }\n onInitMessageRight(event) {\n const initMessage = event.data;\n const messagePort = event.ports[0];\n switch (initMessage) {\n case \"InitAreaManager\":\n this.areaBridge.setRightMessagePort(messagePort);\n this.onInitAreaMessage();\n break;\n case \"InitSelection\":\n this.selectionBridge.setRightMessagePort(messagePort);\n this.onInitSelectionMessage();\n break;\n case \"InitDecorations\":\n this.decorationsBridge.setRightMessagePort(messagePort);\n this.onInitDecorationMessage();\n break;\n }\n }\n onInitAreaMessage() {\n this.areaReadySemaphore -= 1;\n if (this.areaReadySemaphore == 0) {\n this.listener.onAreaApiAvailable();\n }\n }\n onInitSelectionMessage() {\n this.selectionReadySemaphore -= 1;\n if (this.selectionReadySemaphore == 0) {\n this.listener.onSelectionApiAvailable();\n }\n }\n onInitDecorationMessage() {\n this.decorationReadySemaphore -= 1;\n if (this.decorationReadySemaphore == 0) {\n this.listener.onDecorationApiAvailable();\n }\n }\n}\nexport class FixedInitializerIframeSide {\n constructor(window) {\n this.window = window;\n }\n initAreaManager() {\n const messagePort = this.initChannel(\"InitAreaManager\");\n return new IframeMessageSender(messagePort);\n }\n initSelection(selectionManager) {\n const messagePort = this.initChannel(\"InitSelection\");\n new SelectionWrapperIframeSide(messagePort, selectionManager);\n }\n initDecorations(decorationManager) {\n const messagePort = this.initChannel(\"InitDecorations\");\n new DecorationWrapperIframeSide(messagePort, decorationManager);\n }\n initChannel(initMessage) {\n const messageChannel = new MessageChannel();\n this.window.parent.postMessage(initMessage, \"*\", [messageChannel.port2]);\n return messageChannel.port1;\n }\n}\n"],"names":["GetIntrinsic","callBind","$indexOf","module","exports","name","allowMissing","intrinsic","bind","$apply","$call","$reflectApply","call","$gOPD","$defineProperty","$max","value","e","originalFunction","func","arguments","configurable","length","applyBind","apply","hasPropertyDescriptors","$SyntaxError","$TypeError","gopd","obj","property","nonEnumerable","nonWritable","nonConfigurable","loose","desc","enumerable","writable","keys","hasSymbols","Symbol","toStr","Object","prototype","toString","concat","Array","defineDataProperty","supportsDescriptors","defineProperty","object","predicate","fn","defineProperties","map","predicates","props","getOwnPropertySymbols","i","hasToStringTag","has","toStringTag","overrideIfSet","force","iterator","isPrimitive","isCallable","isDate","isSymbol","input","exoticToPrim","hint","String","Number","toPrimitive","O","P","TypeError","GetMethod","valueOf","result","method","methodNames","ordinaryToPrimitive","slice","that","target","this","bound","args","boundLength","Math","max","boundArgs","push","Function","join","Empty","implementation","functionsHaveNames","gOPD","getOwnPropertyDescriptor","functionsHaveConfigurableNames","$bind","boundFunctionsHaveNames","undefined","SyntaxError","$Function","getEvalledConstructor","expressionSyntax","throwTypeError","ThrowTypeError","calleeThrows","get","gOPDthrows","hasProto","getProto","getPrototypeOf","x","__proto__","needsEval","TypedArray","Uint8Array","INTRINSICS","AggregateError","ArrayBuffer","Atomics","BigInt","BigInt64Array","BigUint64Array","Boolean","DataView","Date","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","Error","eval","EvalError","Float32Array","Float64Array","FinalizationRegistry","Int8Array","Int16Array","Int32Array","isFinite","isNaN","JSON","Map","parseFloat","parseInt","Promise","Proxy","RangeError","ReferenceError","Reflect","RegExp","Set","SharedArrayBuffer","Uint8ClampedArray","Uint16Array","Uint32Array","URIError","WeakMap","WeakRef","WeakSet","error","errorProto","doEval","gen","LEGACY_ALIASES","hasOwn","$concat","$spliceApply","splice","$replace","replace","$strSlice","$exec","exec","rePropName","reEscapeChar","getBaseIntrinsic","alias","intrinsicName","parts","string","first","last","match","number","quote","subString","stringToPath","intrinsicBaseName","intrinsicRealName","skipFurtherCaching","isOwn","part","hasArrayLengthDefineBug","test","foo","$Object","origSymbol","hasSymbolSham","sym","symObj","getOwnPropertyNames","syms","propertyIsEnumerable","descriptor","hasOwnProperty","channel","SLOT","assert","slot","slots","set","V","freeze","badArrayLike","isCallableMarker","fnToStr","reflectApply","_","constructorRegex","isES6ClassFn","fnStr","tryFunctionObject","isIE68","isDDA","document","all","str","strClass","getDay","tryDateObject","isRegexMarker","badStringifier","callBound","throwRegexMarker","$toString","symToStr","symStringRegex","isSymbolObject","hasMap","mapSizeDescriptor","mapSize","mapForEach","forEach","hasSet","setSizeDescriptor","setSize","setForEach","weakMapHas","weakSetHas","weakRefDeref","deref","booleanValueOf","objectToString","functionToString","$match","$slice","$toUpperCase","toUpperCase","$toLowerCase","toLowerCase","$test","$join","$arrSlice","$floor","floor","bigIntValueOf","gOPS","symToString","hasShammedSymbols","isEnumerable","gPO","addNumericSeparator","num","Infinity","sepRegex","int","intStr","dec","utilInspect","inspectCustom","custom","inspectSymbol","wrapQuotes","s","defaultStyle","opts","quoteChar","quoteStyle","isArray","isRegExp","inspect_","options","depth","seen","maxStringLength","customInspect","indent","numericSeparator","inspectString","bigIntStr","maxDepth","baseIndent","base","prev","getIndent","indexOf","inspect","from","noIndent","newOpts","f","m","nameOf","arrObjKeys","symString","markBoxed","HTMLElement","nodeName","getAttribute","attrs","attributes","childNodes","xs","singleLineValues","indentedJoin","isError","cause","isMap","mapParts","key","collectionOf","isSet","setParts","isWeakMap","weakCollectionOf","isWeakSet","isWeakRef","isNumber","isBigInt","isBoolean","isString","ys","isPlainObject","constructor","protoTag","stringTag","tag","l","remaining","trailer","lowbyte","c","n","charCodeAt","type","size","entries","lineJoiner","isArr","symMap","k","j","keysShim","isArgs","hasDontEnumBug","hasProtoEnumBug","dontEnums","equalsConstructorPrototype","o","ctor","excludedKeys","$applicationCache","$console","$external","$frame","$frameElement","$frames","$innerHeight","$innerWidth","$onmozfullscreenchange","$onmozfullscreenerror","$outerHeight","$outerWidth","$pageXOffset","$pageYOffset","$parent","$scrollLeft","$scrollTop","$scrollX","$scrollY","$self","$webkitIndexedDB","$webkitStorageInfo","$window","hasAutomationEqualityBug","window","isObject","isFunction","isArguments","theKeys","skipProto","skipConstructor","equalsConstructorPrototypeIfNotBuggy","origKeys","originalKeys","shim","keysWorksWithArguments","callee","setFunctionName","hasIndices","global","ignoreCase","multiline","dotAll","unicode","unicodeSets","sticky","define","getPolyfill","flagsBound","flags","calls","TypeErr","regex","polyfill","proto","isRegex","hasDescriptors","$WeakMap","$Map","$weakMapGet","$weakMapSet","$weakMapHas","$mapGet","$mapSet","$mapHas","listGetNode","list","curr","next","$wm","$m","$o","objects","node","listGet","listHas","listSet","Call","Get","IsRegExp","ToString","RequireObjectCoercible","flagsGetter","regexpMatchAllPolyfill","getMatcher","regexp","matcherPolyfill","matchAll","matcher","S","rx","boundMatchAll","regexpMatchAll","CreateRegExpStringIterator","SpeciesConstructor","ToLength","Type","OrigRegExp","supportsConstructingWithFlags","regexMatchAll","R","tmp","C","source","constructRegexWithFlags","lastIndex","fullUnicode","defineP","symbol","mvsIsWS","leftWhitespace","rightWhitespace","boundMethod","receiver","trim","CodePointAt","isInteger","MAX_SAFE_INTEGER","index","IsArray","F","argumentsList","isLeadingSurrogate","isTrailingSurrogate","UTF16SurrogatePairToCodePoint","$charAt","$charCodeAt","position","cp","firstIsLeading","firstIsTrailing","second","done","DefineOwnProperty","FromPropertyDescriptor","IsDataDescriptor","IsPropertyKey","SameValue","IteratorPrototype","AdvanceStringIndex","CreateIterResultObject","CreateMethodProperty","OrdinaryObjectCreate","RegExpExec","setToStringTag","RegExpStringIterator","thisIndex","nextIndex","isPropertyDescriptor","IsAccessorDescriptor","ToPropertyDescriptor","Desc","assertRecord","fromPropertyDescriptor","GetV","IsCallable","$construct","DefinePropertyOrThrow","isConstructorMarker","argument","err","hasRegExpMatcher","ToBoolean","$ObjectCreate","additionalInternalSlotsList","T","regexExec","$isNaN","y","noThrowOnStrictViolation","Throw","$species","IsConstructor","defaultConstructor","$Number","$RegExp","$parseInteger","regexTester","isBinary","isOctal","isInvalidHexLiteral","hasNonWS","$trim","StringToNumber","NaN","trimmed","ToNumber","truncate","$isFinite","ToIntegerOrInfinity","len","ToPrimitive","Obj","getter","setter","$String","ES5Type","$fromCharCode","lead","trail","optMessage","$isEnumerable","$Array","allowed","isData","IsAccessor","then","recordType","argumentName","array","callback","$abs","absValue","charCode","record","a","ES","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","__esModule","d","definition","prop","gesturesApi","documentApi","resizeObserverAdded","documentLoadedFired","onTap","event","stringify","offset","onLinkActivated","href","outerHtml","onDecorationActivated","stringOffset","stringRect","rect","id","group","onLayout","ResizeObserver","requestAnimationFrame","scrollingElement","scrollHeight","scrollWidth","onDocumentLoadedAndSized","onDocumentResized","observe","body","PageManager","iframe","listener","margins","top","right","bottom","left","contentWindow","setMessagePort","messagePort","onmessage","message","onMessageFromIframe","show","style","display","hide","setMargins","marginTop","marginLeft","marginBottom","marginRight","loadPage","url","src","setPlaceholder","visibility","width","height","data","kind","onContentSizeAvailable","URL","_a","onIframeLoaded","ViewportStringBuilder","setInitialScale","scale","initialScale","setMinimumScale","minimumScale","setWidth","setHeight","build","components","offsetToParentCoordinates","iframeRect","visualViewport","offsetLeft","offsetTop","GesturesDetector","decorationManager","addEventListener","onClick","defaultPrevented","selection","getSelection","nearestElement","decorationActivatedEvent","nearestInteractiveElement","HTMLAnchorElement","outerHTML","stopPropagation","preventDefault","handleDecorationClickEvent","element","hasAttribute","parentElement","SingleAreaManager","metaViewport","fit","insets","clientX","clientY","pageListener","boundingRect","getBoundingClientRect","shiftedOffset","shiftedRect","topLeft","bottomRight","shiftedTopLeft","shiftedBottomRight","shiftedEvent","page","setViewport","viewport","layout","setFit","loadResource","safeDrawingSize","content","container","widthRatio","heightRatio","min","fitContain","fitWidth","fitHeight","computeScale","registerTemplates","templates","send","addDecoration","decoration","removeDecoration","postMessage","TrimDirection","ResolveDirection","selectionListener","onFeedback","requestSelection","requestId","clearSelection","feedback","onSelectionAvailable","getElementById","querySelector","singleArea","gesturesBridge","documentBridge","manager","viewporttWidth","viewportHeight","insetTop","insetRight","insetBottom","insetLeft","gestures","documentState","singleSelection","wrapperListener","selectionAsJson","wrapper","singleSelectionListener","singleDecorations","actualTemplates","parse","parseTemplates","actualDecoration","parseDecoration","singleInitialization","areaBridge","selectionBridge","decorationsBridge","console","log","ports","onInitMessage","initMessage","initAreaManager","initSelection","initDecorations","onAreaApiAvailable","onSelectionApiAvailable","onDecorationApiAvailable","fixedApiState","onInitializationApiAvailable"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"fixed-single-script.js","mappings":"qDAEA,IAAIA,EAAe,EAAQ,MAEvBC,EAAW,EAAQ,MAEnBC,EAAWD,EAASD,EAAa,6BAErCG,EAAOC,QAAU,SAA4BC,EAAMC,GAClD,IAAIC,EAAYP,EAAaK,IAAQC,GACrC,MAAyB,mBAAdC,GAA4BL,EAASG,EAAM,gBAAkB,EAChEJ,EAASM,GAEVA,CACR,C,oCCZA,IAAIC,EAAO,EAAQ,MACfR,EAAe,EAAQ,MAEvBS,EAAST,EAAa,8BACtBU,EAAQV,EAAa,6BACrBW,EAAgBX,EAAa,mBAAmB,IAASQ,EAAKI,KAAKF,EAAOD,GAE1EI,EAAQb,EAAa,qCAAqC,GAC1Dc,EAAkBd,EAAa,2BAA2B,GAC1De,EAAOf,EAAa,cAExB,GAAIc,EACH,IACCA,EAAgB,CAAC,EAAG,IAAK,CAAEE,MAAO,GACnC,CAAE,MAAOC,GAERH,EAAkB,IACnB,CAGDX,EAAOC,QAAU,SAAkBc,GAClC,IAAIC,EAAOR,EAAcH,EAAME,EAAOU,WAYtC,OAXIP,GAASC,GACDD,EAAMM,EAAM,UACdE,cAERP,EACCK,EACA,SACA,CAAEH,MAAO,EAAID,EAAK,EAAGG,EAAiBI,QAAUF,UAAUE,OAAS,MAI/DH,CACR,EAEA,IAAII,EAAY,WACf,OAAOZ,EAAcH,EAAMC,EAAQW,UACpC,EAEIN,EACHA,EAAgBX,EAAOC,QAAS,QAAS,CAAEY,MAAOO,IAElDpB,EAAOC,QAAQoB,MAAQD,C,oCC3CxB,IAAIE,EAAyB,EAAQ,IAAR,GAEzBzB,EAAe,EAAQ,MAEvBc,EAAkBW,GAA0BzB,EAAa,2BAA2B,GAEpF0B,EAAe1B,EAAa,iBAC5B2B,EAAa3B,EAAa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AAgB5I,eAAeC,GACpC3iB,KAAKmiB,SAAS8J,yBAClB,CACA,eAAAF,CAAgBpJ,GACZ3iB,KAAKurB,kBAAkB7I,eAAeC,GACtC3iB,KAAKmiB,SAAS+J,0BAClB,GJlC8DtY,OAAQA,OAAOuY,cAAejK,EAAQtO,OAAO4V,WAAY5V,OAAOwW,gBAAiBxW,OAAOkX,mBAC1JlX,OAAOuY,cAAcC,8B","sources":["webpack://readium-js/./node_modules/.pnpm/call-bind@1.0.2/node_modules/call-bind/callBound.js","webpack://readium-js/./node_modules/.pnpm/call-bind@1.0.2/node_modules/call-bind/index.js","webpack://readium-js/./node_modules/.pnpm/define-data-property@1.1.0/node_modules/define-data-property/index.js","webpack://readium-js/./node_modules/.pnpm/define-properties@1.2.1/node_modules/define-properties/index.js","webpack://readium-js/./node_modules/.pnpm/es-set-tostringtag@2.0.1/node_modules/es-set-tostringtag/index.js","webpack://readium-js/./node_modules/.pnpm/es-to-primitive@1.2.1/node_modules/es-to-primitive/es2015.js","webpack://readium-js/./node_modules/.pnpm/es-to-primitive@1.2.1/node_modules/es-to-primitive/helpers/isPrimitive.js","webpack://readium-js/./node_modules/.pnpm/function-bind@1.1.1/node_modules/function-bind/implementation.js","webpack://readium-js/./node_modules/.pnpm/function-bind@1.1.1/node_modules/function-bind/index.js","webpack://readium-js/./node_modules/.pnpm/functions-have-names@1.2.3/node_modules/functions-have-names/index.js","webpack://readium-js/./node_modules/.pnpm/get-intrinsic@1.2.1/node_modules/get-intrinsic/index.js","webpack://readium-js/./node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.js","webpack://readium-js/./node_modules/.pnpm/has-property-descriptors@1.0.0/node_modules/has-property-descriptors/index.js","webpack://readium-js/./node_modules/.pnpm/has-proto@1.0.1/node_modules/has-proto/index.js","webpack://readium-js/./node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/index.js","webpack://readium-js/./node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/shams.js","webpack://readium-js/./node_modules/.pnpm/has-tostringtag@1.0.0/node_modules/has-tostringtag/shams.js","webpack://readium-js/./node_modules/.pnpm/has@1.0.4/node_modules/has/src/index.js","webpack://readium-js/./node_modules/.pnpm/internal-slot@1.0.5/node_modules/internal-slot/index.js","webpack://readium-js/./node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/index.js","webpack://readium-js/./node_modules/.pnpm/is-date-object@1.0.5/node_modules/is-date-object/index.js","webpack://readium-js/./node_modules/.pnpm/is-regex@1.1.4/node_modules/is-regex/index.js","webpack://readium-js/./node_modules/.pnpm/is-symbol@1.0.4/node_modules/is-symbol/index.js","webpack://readium-js/./node_modules/.pnpm/object-inspect@1.12.3/node_modules/object-inspect/index.js","webpack://readium-js/./node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/implementation.js","webpack://readium-js/./node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/index.js","webpack://readium-js/./node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/isArguments.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/implementation.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/index.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/polyfill.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/shim.js","webpack://readium-js/./node_modules/.pnpm/safe-regex-test@1.0.0/node_modules/safe-regex-test/index.js","webpack://readium-js/./node_modules/.pnpm/set-function-name@2.0.1/node_modules/set-function-name/index.js","webpack://readium-js/./node_modules/.pnpm/side-channel@1.0.4/node_modules/side-channel/index.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/implementation.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/index.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/polyfill-regexp-matchall.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/polyfill.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/regexp-matchall.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/shim.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/implementation.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/index.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/polyfill.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/shim.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/AdvanceStringIndex.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Call.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CodePointAt.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CreateIterResultObject.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CreateMethodProperty.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CreateRegExpStringIterator.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/DefinePropertyOrThrow.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/FromPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Get.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/GetMethod.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/GetV.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsAccessorDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsArray.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsCallable.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsConstructor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsDataDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsPropertyKey.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsRegExp.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/OrdinaryObjectCreate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/RegExpExec.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/RequireObjectCoercible.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/SameValue.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Set.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/SpeciesConstructor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/StringToNumber.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToBoolean.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToIntegerOrInfinity.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToLength.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToNumber.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToPrimitive.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToString.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Type.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/UTF16SurrogatePairToCodePoint.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/floor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/truncate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/5/CheckObjectCoercible.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/5/Type.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/GetIntrinsic.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/DefineOwnProperty.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/IsArray.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/assertRecord.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/forEach.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/fromPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isFinite.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isInteger.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isLeadingSurrogate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isMatchRecord.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isNaN.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isPrimitive.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isTrailingSurrogate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/maxSafeInteger.js","webpack://readium-js/webpack/bootstrap","webpack://readium-js/webpack/runtime/compat get default export","webpack://readium-js/webpack/runtime/define property getters","webpack://readium-js/webpack/runtime/hasOwnProperty shorthand","webpack://readium-js/./src/bridge/all-listener-bridge.ts","webpack://readium-js/./src/fixed/page-manager.ts","webpack://readium-js/./src/util/viewport.ts","webpack://readium-js/./src/common/geometry.ts","webpack://readium-js/./src/common/gestures.ts","webpack://readium-js/./src/fixed/single-area-manager.ts","webpack://readium-js/./src/fixed/fit.ts","webpack://readium-js/./src/fixed/decoration-wrapper.ts","webpack://readium-js/./src/vendor/hypothesis/annotator/anchoring/trim-range.ts","webpack://readium-js/./src/vendor/hypothesis/annotator/anchoring/text-range.ts","webpack://readium-js/./src/common/selection.ts","webpack://readium-js/./src/fixed/selection-wrapper.ts","webpack://readium-js/./src/index-fixed-single.ts","webpack://readium-js/./src/bridge/fixed-area-bridge.ts","webpack://readium-js/./src/bridge/all-selection-bridge.ts","webpack://readium-js/./src/bridge/all-decoration-bridge.ts","webpack://readium-js/./src/bridge/all-initialization-bridge.ts"],"sourcesContent":["'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBind = require('./');\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = null;\n\t}\n}\n\nmodule.exports = function callBind(originalFunction) {\n\tvar func = $reflectApply(bind, $call, arguments);\n\tif ($gOPD && $defineProperty) {\n\t\tvar desc = $gOPD(func, 'length');\n\t\tif (desc.configurable) {\n\t\t\t// original length, plus the receiver, minus any additional arguments (after the receiver)\n\t\t\t$defineProperty(\n\t\t\t\tfunc,\n\t\t\t\t'length',\n\t\t\t\t{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }\n\t\t\t);\n\t\t}\n\t}\n\treturn func;\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","'use strict';\n\nvar hasPropertyDescriptors = require('has-property-descriptors')();\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = hasPropertyDescriptors && GetIntrinsic('%Object.defineProperty%', true);\n\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar gopd = require('gopd');\n\n/** @type {(obj: Record, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */\nmodule.exports = function defineDataProperty(\n\tobj,\n\tproperty,\n\tvalue\n) {\n\tif (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n\t\tthrow new $TypeError('`obj` must be an object or a function`');\n\t}\n\tif (typeof property !== 'string' && typeof property !== 'symbol') {\n\t\tthrow new $TypeError('`property` must be a string or a symbol`');\n\t}\n\tif (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {\n\t\tthrow new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {\n\t\tthrow new $TypeError('`nonWritable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {\n\t\tthrow new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 6 && typeof arguments[6] !== 'boolean') {\n\t\tthrow new $TypeError('`loose`, if provided, must be a boolean');\n\t}\n\n\tvar nonEnumerable = arguments.length > 3 ? arguments[3] : null;\n\tvar nonWritable = arguments.length > 4 ? arguments[4] : null;\n\tvar nonConfigurable = arguments.length > 5 ? arguments[5] : null;\n\tvar loose = arguments.length > 6 ? arguments[6] : false;\n\n\t/* @type {false | TypedPropertyDescriptor} */\n\tvar desc = !!gopd && gopd(obj, property);\n\n\tif ($defineProperty) {\n\t\t$defineProperty(obj, property, {\n\t\t\tconfigurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,\n\t\t\tenumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,\n\t\t\tvalue: value,\n\t\t\twritable: nonWritable === null && desc ? desc.writable : !nonWritable\n\t\t});\n\t} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {\n\t\t// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable\n\t\tobj[property] = value; // eslint-disable-line no-param-reassign\n\t} else {\n\t\tthrow new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');\n\t}\n};\n","'use strict';\n\nvar keys = require('object-keys');\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';\n\nvar toStr = Object.prototype.toString;\nvar concat = Array.prototype.concat;\nvar defineDataProperty = require('define-data-property');\n\nvar isFunction = function (fn) {\n\treturn typeof fn === 'function' && toStr.call(fn) === '[object Function]';\n};\n\nvar supportsDescriptors = require('has-property-descriptors')();\n\nvar defineProperty = function (object, name, value, predicate) {\n\tif (name in object) {\n\t\tif (predicate === true) {\n\t\t\tif (object[name] === value) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (!isFunction(predicate) || !predicate()) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (supportsDescriptors) {\n\t\tdefineDataProperty(object, name, value, true);\n\t} else {\n\t\tdefineDataProperty(object, name, value);\n\t}\n};\n\nvar defineProperties = function (object, map) {\n\tvar predicates = arguments.length > 2 ? arguments[2] : {};\n\tvar props = keys(map);\n\tif (hasSymbols) {\n\t\tprops = concat.call(props, Object.getOwnPropertySymbols(map));\n\t}\n\tfor (var i = 0; i < props.length; i += 1) {\n\t\tdefineProperty(object, props[i], map[props[i]], predicates[props[i]]);\n\t}\n};\n\ndefineProperties.supportsDescriptors = !!supportsDescriptors;\n\nmodule.exports = defineProperties;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar has = require('has');\n\nvar toStringTag = hasToStringTag ? Symbol.toStringTag : null;\n\nmodule.exports = function setToStringTag(object, value) {\n\tvar overrideIfSet = arguments.length > 2 && arguments[2] && arguments[2].force;\n\tif (toStringTag && (overrideIfSet || !has(object, toStringTag))) {\n\t\tif ($defineProperty) {\n\t\t\t$defineProperty(object, toStringTag, {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: false,\n\t\t\t\tvalue: value,\n\t\t\t\twritable: false\n\t\t\t});\n\t\t} else {\n\t\t\tobject[toStringTag] = value; // eslint-disable-line no-param-reassign\n\t\t}\n\t}\n};\n","'use strict';\n\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';\n\nvar isPrimitive = require('./helpers/isPrimitive');\nvar isCallable = require('is-callable');\nvar isDate = require('is-date-object');\nvar isSymbol = require('is-symbol');\n\nvar ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) {\n\tif (typeof O === 'undefined' || O === null) {\n\t\tthrow new TypeError('Cannot call method on ' + O);\n\t}\n\tif (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) {\n\t\tthrow new TypeError('hint must be \"string\" or \"number\"');\n\t}\n\tvar methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString'];\n\tvar method, result, i;\n\tfor (i = 0; i < methodNames.length; ++i) {\n\t\tmethod = O[methodNames[i]];\n\t\tif (isCallable(method)) {\n\t\t\tresult = method.call(O);\n\t\t\tif (isPrimitive(result)) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t}\n\tthrow new TypeError('No default value');\n};\n\nvar GetMethod = function GetMethod(O, P) {\n\tvar func = O[P];\n\tif (func !== null && typeof func !== 'undefined') {\n\t\tif (!isCallable(func)) {\n\t\t\tthrow new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function');\n\t\t}\n\t\treturn func;\n\t}\n\treturn void 0;\n};\n\n// http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive\nmodule.exports = function ToPrimitive(input) {\n\tif (isPrimitive(input)) {\n\t\treturn input;\n\t}\n\tvar hint = 'default';\n\tif (arguments.length > 1) {\n\t\tif (arguments[1] === String) {\n\t\t\thint = 'string';\n\t\t} else if (arguments[1] === Number) {\n\t\t\thint = 'number';\n\t\t}\n\t}\n\n\tvar exoticToPrim;\n\tif (hasSymbols) {\n\t\tif (Symbol.toPrimitive) {\n\t\t\texoticToPrim = GetMethod(input, Symbol.toPrimitive);\n\t\t} else if (isSymbol(input)) {\n\t\t\texoticToPrim = Symbol.prototype.valueOf;\n\t\t}\n\t}\n\tif (typeof exoticToPrim !== 'undefined') {\n\t\tvar result = exoticToPrim.call(input, hint);\n\t\tif (isPrimitive(result)) {\n\t\t\treturn result;\n\t\t}\n\t\tthrow new TypeError('unable to convert exotic object to primitive');\n\t}\n\tif (hint === 'default' && (isDate(input) || isSymbol(input))) {\n\t\thint = 'string';\n\t}\n\treturn ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint);\n};\n","'use strict';\n\nmodule.exports = function isPrimitive(value) {\n\treturn value === null || (typeof value !== 'function' && typeof value !== 'object');\n};\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slice.call(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n args.concat(slice.call(arguments))\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n } else {\n return target.apply(\n that,\n args.concat(slice.call(arguments))\n );\n }\n };\n\n var boundLength = Math.max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs.push('$' + i);\n }\n\n bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\nvar functionsHaveNames = function functionsHaveNames() {\n\treturn typeof function f() {}.name === 'string';\n};\n\nvar gOPD = Object.getOwnPropertyDescriptor;\nif (gOPD) {\n\ttry {\n\t\tgOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\tgOPD = null;\n\t}\n}\n\nfunctionsHaveNames.functionsHaveConfigurableNames = function functionsHaveConfigurableNames() {\n\tif (!functionsHaveNames() || !gOPD) {\n\t\treturn false;\n\t}\n\tvar desc = gOPD(function () {}, 'name');\n\treturn !!desc && !!desc.configurable;\n};\n\nvar $bind = Function.prototype.bind;\n\nfunctionsHaveNames.boundFunctionsHaveNames = function boundFunctionsHaveNames() {\n\treturn functionsHaveNames() && typeof $bind === 'function' && function f() {}.bind().name !== '';\n};\n\nmodule.exports = functionsHaveNames;\n","'use strict';\n\nvar undefined;\n\nvar $SyntaxError = SyntaxError;\nvar $Function = Function;\nvar $TypeError = TypeError;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\nif ($gOPD) {\n\ttry {\n\t\t$gOPD({}, '');\n\t} catch (e) {\n\t\t$gOPD = null; // this is IE 8, which has a broken gOPD\n\t}\n}\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\nvar hasProto = require('has-proto')();\n\nvar getProto = Object.getPrototypeOf || (\n\thasProto\n\t\t? function (x) { return x.__proto__; } // eslint-disable-line no-proto\n\t\t: null\n);\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,\n\t'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': EvalError,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': Object,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': RangeError,\n\t'%ReferenceError%': ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nif (getProto) {\n\ttry {\n\t\tnull.error; // eslint-disable-line no-unused-expressions\n\t} catch (e) {\n\t\t// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n\t\tvar errorProto = getProto(getProto(e));\n\t\tINTRINSICS['%Error.prototype%'] = errorProto;\n\t}\n}\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen && getProto) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('has');\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\nvar $exec = bind.call(Function.call, RegExp.prototype.exec);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tif ($exec(/^%?[^%]*%?$/, name) === null) {\n\t\tthrow new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');\n\t}\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\n\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasPropertyDescriptors = function hasPropertyDescriptors() {\n\tif ($defineProperty) {\n\t\ttry {\n\t\t\t$defineProperty({}, 'a', { value: 1 });\n\t\t\treturn true;\n\t\t} catch (e) {\n\t\t\t// IE 8 has a broken defineProperty\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn false;\n};\n\nhasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {\n\t// node v0.6 has a bug where array lengths can be Set but not Defined\n\tif (!hasPropertyDescriptors()) {\n\t\treturn null;\n\t}\n\ttry {\n\t\treturn $defineProperty([], 'length', { value: 1 }).length !== 1;\n\t} catch (e) {\n\t\t// In Firefox 4-22, defining length on an array throws an exception.\n\t\treturn true;\n\t}\n};\n\nmodule.exports = hasPropertyDescriptors;\n","'use strict';\n\nvar test = {\n\tfoo: {}\n};\n\nvar $Object = Object;\n\nmodule.exports = function hasProto() {\n\treturn { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar hasSymbols = require('has-symbols/shams');\n\nmodule.exports = function hasToStringTagShams() {\n\treturn hasSymbols() && !!Symbol.toStringTag;\n};\n","'use strict';\n\nvar hasOwnProperty = {}.hasOwnProperty;\nvar call = Function.prototype.call;\n\nmodule.exports = call.bind ? call.bind(hasOwnProperty) : function (O, P) {\n return call.call(hasOwnProperty, O, P);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar has = require('has');\nvar channel = require('side-channel')();\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar SLOT = {\n\tassert: function (O, slot) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tchannel.assert(O);\n\t\tif (!SLOT.has(O, slot)) {\n\t\t\tthrow new $TypeError('`' + slot + '` is not present on `O`');\n\t\t}\n\t},\n\tget: function (O, slot) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tvar slots = channel.get(O);\n\t\treturn slots && slots['$' + slot];\n\t},\n\thas: function (O, slot) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tvar slots = channel.get(O);\n\t\treturn !!slots && has(slots, '$' + slot);\n\t},\n\tset: function (O, slot, V) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tvar slots = channel.get(O);\n\t\tif (!slots) {\n\t\t\tslots = {};\n\t\t\tchannel.set(O, slots);\n\t\t}\n\t\tslots['$' + slot] = V;\n\t}\n};\n\nif (Object.freeze) {\n\tObject.freeze(SLOT);\n}\n\nmodule.exports = SLOT;\n","'use strict';\n\nvar fnToStr = Function.prototype.toString;\nvar reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;\nvar badArrayLike;\nvar isCallableMarker;\nif (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {\n\ttry {\n\t\tbadArrayLike = Object.defineProperty({}, 'length', {\n\t\t\tget: function () {\n\t\t\t\tthrow isCallableMarker;\n\t\t\t}\n\t\t});\n\t\tisCallableMarker = {};\n\t\t// eslint-disable-next-line no-throw-literal\n\t\treflectApply(function () { throw 42; }, null, badArrayLike);\n\t} catch (_) {\n\t\tif (_ !== isCallableMarker) {\n\t\t\treflectApply = null;\n\t\t}\n\t}\n} else {\n\treflectApply = null;\n}\n\nvar constructorRegex = /^\\s*class\\b/;\nvar isES6ClassFn = function isES6ClassFunction(value) {\n\ttry {\n\t\tvar fnStr = fnToStr.call(value);\n\t\treturn constructorRegex.test(fnStr);\n\t} catch (e) {\n\t\treturn false; // not a function\n\t}\n};\n\nvar tryFunctionObject = function tryFunctionToStr(value) {\n\ttry {\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tfnToStr.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\nvar toStr = Object.prototype.toString;\nvar objectClass = '[object Object]';\nvar fnClass = '[object Function]';\nvar genClass = '[object GeneratorFunction]';\nvar ddaClass = '[object HTMLAllCollection]'; // IE 11\nvar ddaClass2 = '[object HTML document.all class]';\nvar ddaClass3 = '[object HTMLCollection]'; // IE 9-10\nvar hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag`\n\nvar isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing\n\nvar isDDA = function isDocumentDotAll() { return false; };\nif (typeof document === 'object') {\n\t// Firefox 3 canonicalizes DDA to undefined when it's not accessed directly\n\tvar all = document.all;\n\tif (toStr.call(all) === toStr.call(document.all)) {\n\t\tisDDA = function isDocumentDotAll(value) {\n\t\t\t/* globals document: false */\n\t\t\t// in IE 6-8, typeof document.all is \"object\" and it's truthy\n\t\t\tif ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) {\n\t\t\t\ttry {\n\t\t\t\t\tvar str = toStr.call(value);\n\t\t\t\t\treturn (\n\t\t\t\t\t\tstr === ddaClass\n\t\t\t\t\t\t|| str === ddaClass2\n\t\t\t\t\t\t|| str === ddaClass3 // opera 12.16\n\t\t\t\t\t\t|| str === objectClass // IE 6-8\n\t\t\t\t\t) && value('') == null; // eslint-disable-line eqeqeq\n\t\t\t\t} catch (e) { /**/ }\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\t}\n}\n\nmodule.exports = reflectApply\n\t? function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\ttry {\n\t\t\treflectApply(value, null, badArrayLike);\n\t\t} catch (e) {\n\t\t\tif (e !== isCallableMarker) { return false; }\n\t\t}\n\t\treturn !isES6ClassFn(value) && tryFunctionObject(value);\n\t}\n\t: function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\tif (hasToStringTag) { return tryFunctionObject(value); }\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tvar strClass = toStr.call(value);\n\t\tif (strClass !== fnClass && strClass !== genClass && !(/^\\[object HTML/).test(strClass)) { return false; }\n\t\treturn tryFunctionObject(value);\n\t};\n","'use strict';\n\nvar getDay = Date.prototype.getDay;\nvar tryDateObject = function tryDateGetDayCall(value) {\n\ttry {\n\t\tgetDay.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\n\nvar toStr = Object.prototype.toString;\nvar dateClass = '[object Date]';\nvar hasToStringTag = require('has-tostringtag/shams')();\n\nmodule.exports = function isDateObject(value) {\n\tif (typeof value !== 'object' || value === null) {\n\t\treturn false;\n\t}\n\treturn hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass;\n};\n","'use strict';\n\nvar callBound = require('call-bind/callBound');\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar has;\nvar $exec;\nvar isRegexMarker;\nvar badStringifier;\n\nif (hasToStringTag) {\n\thas = callBound('Object.prototype.hasOwnProperty');\n\t$exec = callBound('RegExp.prototype.exec');\n\tisRegexMarker = {};\n\n\tvar throwRegexMarker = function () {\n\t\tthrow isRegexMarker;\n\t};\n\tbadStringifier = {\n\t\ttoString: throwRegexMarker,\n\t\tvalueOf: throwRegexMarker\n\t};\n\n\tif (typeof Symbol.toPrimitive === 'symbol') {\n\t\tbadStringifier[Symbol.toPrimitive] = throwRegexMarker;\n\t}\n}\n\nvar $toString = callBound('Object.prototype.toString');\nvar gOPD = Object.getOwnPropertyDescriptor;\nvar regexClass = '[object RegExp]';\n\nmodule.exports = hasToStringTag\n\t// eslint-disable-next-line consistent-return\n\t? function isRegex(value) {\n\t\tif (!value || typeof value !== 'object') {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar descriptor = gOPD(value, 'lastIndex');\n\t\tvar hasLastIndexDataProperty = descriptor && has(descriptor, 'value');\n\t\tif (!hasLastIndexDataProperty) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\t$exec(value, badStringifier);\n\t\t} catch (e) {\n\t\t\treturn e === isRegexMarker;\n\t\t}\n\t}\n\t: function isRegex(value) {\n\t\t// In older browsers, typeof regex incorrectly returns 'function'\n\t\tif (!value || (typeof value !== 'object' && typeof value !== 'function')) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $toString(value) === regexClass;\n\t};\n","'use strict';\n\nvar toStr = Object.prototype.toString;\nvar hasSymbols = require('has-symbols')();\n\nif (hasSymbols) {\n\tvar symToStr = Symbol.prototype.toString;\n\tvar symStringRegex = /^Symbol\\(.*\\)$/;\n\tvar isSymbolObject = function isRealSymbolObject(value) {\n\t\tif (typeof value.valueOf() !== 'symbol') {\n\t\t\treturn false;\n\t\t}\n\t\treturn symStringRegex.test(symToStr.call(value));\n\t};\n\n\tmodule.exports = function isSymbol(value) {\n\t\tif (typeof value === 'symbol') {\n\t\t\treturn true;\n\t\t}\n\t\tif (toStr.call(value) !== '[object Symbol]') {\n\t\t\treturn false;\n\t\t}\n\t\ttry {\n\t\t\treturn isSymbolObject(value);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n} else {\n\n\tmodule.exports = function isSymbol(value) {\n\t\t// this environment does not support Symbols.\n\t\treturn false && value;\n\t};\n}\n","var hasMap = typeof Map === 'function' && Map.prototype;\nvar mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;\nvar mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;\nvar mapForEach = hasMap && Map.prototype.forEach;\nvar hasSet = typeof Set === 'function' && Set.prototype;\nvar setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;\nvar setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;\nvar setForEach = hasSet && Set.prototype.forEach;\nvar hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;\nvar weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;\nvar hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;\nvar weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;\nvar hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;\nvar weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;\nvar booleanValueOf = Boolean.prototype.valueOf;\nvar objectToString = Object.prototype.toString;\nvar functionToString = Function.prototype.toString;\nvar $match = String.prototype.match;\nvar $slice = String.prototype.slice;\nvar $replace = String.prototype.replace;\nvar $toUpperCase = String.prototype.toUpperCase;\nvar $toLowerCase = String.prototype.toLowerCase;\nvar $test = RegExp.prototype.test;\nvar $concat = Array.prototype.concat;\nvar $join = Array.prototype.join;\nvar $arrSlice = Array.prototype.slice;\nvar $floor = Math.floor;\nvar bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;\nvar gOPS = Object.getOwnPropertySymbols;\nvar symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;\nvar hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';\n// ie, `has-tostringtag/shams\nvar toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')\n ? Symbol.toStringTag\n : null;\nvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\nvar gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (\n [].__proto__ === Array.prototype // eslint-disable-line no-proto\n ? function (O) {\n return O.__proto__; // eslint-disable-line no-proto\n }\n : null\n);\n\nfunction addNumericSeparator(num, str) {\n if (\n num === Infinity\n || num === -Infinity\n || num !== num\n || (num && num > -1000 && num < 1000)\n || $test.call(/e/, str)\n ) {\n return str;\n }\n var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;\n if (typeof num === 'number') {\n var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)\n if (int !== num) {\n var intStr = String(int);\n var dec = $slice.call(str, intStr.length + 1);\n return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');\n }\n }\n return $replace.call(str, sepRegex, '$&_');\n}\n\nvar utilInspect = require('./util.inspect');\nvar inspectCustom = utilInspect.custom;\nvar inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;\n\nmodule.exports = function inspect_(obj, options, depth, seen) {\n var opts = options || {};\n\n if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {\n throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');\n }\n if (\n has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'\n ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity\n : opts.maxStringLength !== null\n )\n ) {\n throw new TypeError('option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`');\n }\n var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;\n if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {\n throw new TypeError('option \"customInspect\", if provided, must be `true`, `false`, or `\\'symbol\\'`');\n }\n\n if (\n has(opts, 'indent')\n && opts.indent !== null\n && opts.indent !== '\\t'\n && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)\n ) {\n throw new TypeError('option \"indent\" must be \"\\\\t\", an integer > 0, or `null`');\n }\n if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {\n throw new TypeError('option \"numericSeparator\", if provided, must be `true` or `false`');\n }\n var numericSeparator = opts.numericSeparator;\n\n if (typeof obj === 'undefined') {\n return 'undefined';\n }\n if (obj === null) {\n return 'null';\n }\n if (typeof obj === 'boolean') {\n return obj ? 'true' : 'false';\n }\n\n if (typeof obj === 'string') {\n return inspectString(obj, opts);\n }\n if (typeof obj === 'number') {\n if (obj === 0) {\n return Infinity / obj > 0 ? '0' : '-0';\n }\n var str = String(obj);\n return numericSeparator ? addNumericSeparator(obj, str) : str;\n }\n if (typeof obj === 'bigint') {\n var bigIntStr = String(obj) + 'n';\n return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;\n }\n\n var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;\n if (typeof depth === 'undefined') { depth = 0; }\n if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {\n return isArray(obj) ? '[Array]' : '[Object]';\n }\n\n var indent = getIndent(opts, depth);\n\n if (typeof seen === 'undefined') {\n seen = [];\n } else if (indexOf(seen, obj) >= 0) {\n return '[Circular]';\n }\n\n function inspect(value, from, noIndent) {\n if (from) {\n seen = $arrSlice.call(seen);\n seen.push(from);\n }\n if (noIndent) {\n var newOpts = {\n depth: opts.depth\n };\n if (has(opts, 'quoteStyle')) {\n newOpts.quoteStyle = opts.quoteStyle;\n }\n return inspect_(value, newOpts, depth + 1, seen);\n }\n return inspect_(value, opts, depth + 1, seen);\n }\n\n if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable\n var name = nameOf(obj);\n var keys = arrObjKeys(obj, inspect);\n return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');\n }\n if (isSymbol(obj)) {\n var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\\(.*\\))_[^)]*$/, '$1') : symToString.call(obj);\n return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;\n }\n if (isElement(obj)) {\n var s = '<' + $toLowerCase.call(String(obj.nodeName));\n var attrs = obj.attributes || [];\n for (var i = 0; i < attrs.length; i++) {\n s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);\n }\n s += '>';\n if (obj.childNodes && obj.childNodes.length) { s += '...'; }\n s += '';\n return s;\n }\n if (isArray(obj)) {\n if (obj.length === 0) { return '[]'; }\n var xs = arrObjKeys(obj, inspect);\n if (indent && !singleLineValues(xs)) {\n return '[' + indentedJoin(xs, indent) + ']';\n }\n return '[ ' + $join.call(xs, ', ') + ' ]';\n }\n if (isError(obj)) {\n var parts = arrObjKeys(obj, inspect);\n if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {\n return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';\n }\n if (parts.length === 0) { return '[' + String(obj) + ']'; }\n return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';\n }\n if (typeof obj === 'object' && customInspect) {\n if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {\n return utilInspect(obj, { depth: maxDepth - depth });\n } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {\n return obj.inspect();\n }\n }\n if (isMap(obj)) {\n var mapParts = [];\n if (mapForEach) {\n mapForEach.call(obj, function (value, key) {\n mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));\n });\n }\n return collectionOf('Map', mapSize.call(obj), mapParts, indent);\n }\n if (isSet(obj)) {\n var setParts = [];\n if (setForEach) {\n setForEach.call(obj, function (value) {\n setParts.push(inspect(value, obj));\n });\n }\n return collectionOf('Set', setSize.call(obj), setParts, indent);\n }\n if (isWeakMap(obj)) {\n return weakCollectionOf('WeakMap');\n }\n if (isWeakSet(obj)) {\n return weakCollectionOf('WeakSet');\n }\n if (isWeakRef(obj)) {\n return weakCollectionOf('WeakRef');\n }\n if (isNumber(obj)) {\n return markBoxed(inspect(Number(obj)));\n }\n if (isBigInt(obj)) {\n return markBoxed(inspect(bigIntValueOf.call(obj)));\n }\n if (isBoolean(obj)) {\n return markBoxed(booleanValueOf.call(obj));\n }\n if (isString(obj)) {\n return markBoxed(inspect(String(obj)));\n }\n if (!isDate(obj) && !isRegExp(obj)) {\n var ys = arrObjKeys(obj, inspect);\n var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;\n var protoTag = obj instanceof Object ? '' : 'null prototype';\n var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';\n var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';\n var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');\n if (ys.length === 0) { return tag + '{}'; }\n if (indent) {\n return tag + '{' + indentedJoin(ys, indent) + '}';\n }\n return tag + '{ ' + $join.call(ys, ', ') + ' }';\n }\n return String(obj);\n};\n\nfunction wrapQuotes(s, defaultStyle, opts) {\n var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '\"' : \"'\";\n return quoteChar + s + quoteChar;\n}\n\nfunction quote(s) {\n return $replace.call(String(s), /\"/g, '"');\n}\n\nfunction isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\n\n// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives\nfunction isSymbol(obj) {\n if (hasShammedSymbols) {\n return obj && typeof obj === 'object' && obj instanceof Symbol;\n }\n if (typeof obj === 'symbol') {\n return true;\n }\n if (!obj || typeof obj !== 'object' || !symToString) {\n return false;\n }\n try {\n symToString.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isBigInt(obj) {\n if (!obj || typeof obj !== 'object' || !bigIntValueOf) {\n return false;\n }\n try {\n bigIntValueOf.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };\nfunction has(obj, key) {\n return hasOwn.call(obj, key);\n}\n\nfunction toStr(obj) {\n return objectToString.call(obj);\n}\n\nfunction nameOf(f) {\n if (f.name) { return f.name; }\n var m = $match.call(functionToString.call(f), /^function\\s*([\\w$]+)/);\n if (m) { return m[1]; }\n return null;\n}\n\nfunction indexOf(xs, x) {\n if (xs.indexOf) { return xs.indexOf(x); }\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) { return i; }\n }\n return -1;\n}\n\nfunction isMap(x) {\n if (!mapSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n mapSize.call(x);\n try {\n setSize.call(x);\n } catch (s) {\n return true;\n }\n return x instanceof Map; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakMap(x) {\n if (!weakMapHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakMapHas.call(x, weakMapHas);\n try {\n weakSetHas.call(x, weakSetHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakMap; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakRef(x) {\n if (!weakRefDeref || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakRefDeref.call(x);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isSet(x) {\n if (!setSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n setSize.call(x);\n try {\n mapSize.call(x);\n } catch (m) {\n return true;\n }\n return x instanceof Set; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakSet(x) {\n if (!weakSetHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakSetHas.call(x, weakSetHas);\n try {\n weakMapHas.call(x, weakMapHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakSet; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isElement(x) {\n if (!x || typeof x !== 'object') { return false; }\n if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {\n return true;\n }\n return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';\n}\n\nfunction inspectString(str, opts) {\n if (str.length > opts.maxStringLength) {\n var remaining = str.length - opts.maxStringLength;\n var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');\n return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;\n }\n // eslint-disable-next-line no-control-regex\n var s = $replace.call($replace.call(str, /(['\\\\])/g, '\\\\$1'), /[\\x00-\\x1f]/g, lowbyte);\n return wrapQuotes(s, 'single', opts);\n}\n\nfunction lowbyte(c) {\n var n = c.charCodeAt(0);\n var x = {\n 8: 'b',\n 9: 't',\n 10: 'n',\n 12: 'f',\n 13: 'r'\n }[n];\n if (x) { return '\\\\' + x; }\n return '\\\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));\n}\n\nfunction markBoxed(str) {\n return 'Object(' + str + ')';\n}\n\nfunction weakCollectionOf(type) {\n return type + ' { ? }';\n}\n\nfunction collectionOf(type, size, entries, indent) {\n var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');\n return type + ' (' + size + ') {' + joinedEntries + '}';\n}\n\nfunction singleLineValues(xs) {\n for (var i = 0; i < xs.length; i++) {\n if (indexOf(xs[i], '\\n') >= 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction getIndent(opts, depth) {\n var baseIndent;\n if (opts.indent === '\\t') {\n baseIndent = '\\t';\n } else if (typeof opts.indent === 'number' && opts.indent > 0) {\n baseIndent = $join.call(Array(opts.indent + 1), ' ');\n } else {\n return null;\n }\n return {\n base: baseIndent,\n prev: $join.call(Array(depth + 1), baseIndent)\n };\n}\n\nfunction indentedJoin(xs, indent) {\n if (xs.length === 0) { return ''; }\n var lineJoiner = '\\n' + indent.prev + indent.base;\n return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\\n' + indent.prev;\n}\n\nfunction arrObjKeys(obj, inspect) {\n var isArr = isArray(obj);\n var xs = [];\n if (isArr) {\n xs.length = obj.length;\n for (var i = 0; i < obj.length; i++) {\n xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';\n }\n }\n var syms = typeof gOPS === 'function' ? gOPS(obj) : [];\n var symMap;\n if (hasShammedSymbols) {\n symMap = {};\n for (var k = 0; k < syms.length; k++) {\n symMap['$' + syms[k]] = syms[k];\n }\n }\n\n for (var key in obj) { // eslint-disable-line no-restricted-syntax\n if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {\n // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section\n continue; // eslint-disable-line no-restricted-syntax, no-continue\n } else if ($test.call(/[^\\w$]/, key)) {\n xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));\n } else {\n xs.push(key + ': ' + inspect(obj[key], obj));\n }\n }\n if (typeof gOPS === 'function') {\n for (var j = 0; j < syms.length; j++) {\n if (isEnumerable.call(obj, syms[j])) {\n xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));\n }\n }\n }\n return xs;\n}\n","'use strict';\n\nvar keysShim;\nif (!Object.keys) {\n\t// modified from https://github.com/es-shims/es5-shim\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar toStr = Object.prototype.toString;\n\tvar isArgs = require('./isArguments'); // eslint-disable-line global-require\n\tvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\tvar hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');\n\tvar hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');\n\tvar dontEnums = [\n\t\t'toString',\n\t\t'toLocaleString',\n\t\t'valueOf',\n\t\t'hasOwnProperty',\n\t\t'isPrototypeOf',\n\t\t'propertyIsEnumerable',\n\t\t'constructor'\n\t];\n\tvar equalsConstructorPrototype = function (o) {\n\t\tvar ctor = o.constructor;\n\t\treturn ctor && ctor.prototype === o;\n\t};\n\tvar excludedKeys = {\n\t\t$applicationCache: true,\n\t\t$console: true,\n\t\t$external: true,\n\t\t$frame: true,\n\t\t$frameElement: true,\n\t\t$frames: true,\n\t\t$innerHeight: true,\n\t\t$innerWidth: true,\n\t\t$onmozfullscreenchange: true,\n\t\t$onmozfullscreenerror: true,\n\t\t$outerHeight: true,\n\t\t$outerWidth: true,\n\t\t$pageXOffset: true,\n\t\t$pageYOffset: true,\n\t\t$parent: true,\n\t\t$scrollLeft: true,\n\t\t$scrollTop: true,\n\t\t$scrollX: true,\n\t\t$scrollY: true,\n\t\t$self: true,\n\t\t$webkitIndexedDB: true,\n\t\t$webkitStorageInfo: true,\n\t\t$window: true\n\t};\n\tvar hasAutomationEqualityBug = (function () {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined') { return false; }\n\t\tfor (var k in window) {\n\t\t\ttry {\n\t\t\t\tif (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tequalsConstructorPrototype(window[k]);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}());\n\tvar equalsConstructorPrototypeIfNotBuggy = function (o) {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined' || !hasAutomationEqualityBug) {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t}\n\t\ttry {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tkeysShim = function keys(object) {\n\t\tvar isObject = object !== null && typeof object === 'object';\n\t\tvar isFunction = toStr.call(object) === '[object Function]';\n\t\tvar isArguments = isArgs(object);\n\t\tvar isString = isObject && toStr.call(object) === '[object String]';\n\t\tvar theKeys = [];\n\n\t\tif (!isObject && !isFunction && !isArguments) {\n\t\t\tthrow new TypeError('Object.keys called on a non-object');\n\t\t}\n\n\t\tvar skipProto = hasProtoEnumBug && isFunction;\n\t\tif (isString && object.length > 0 && !has.call(object, 0)) {\n\t\t\tfor (var i = 0; i < object.length; ++i) {\n\t\t\t\ttheKeys.push(String(i));\n\t\t\t}\n\t\t}\n\n\t\tif (isArguments && object.length > 0) {\n\t\t\tfor (var j = 0; j < object.length; ++j) {\n\t\t\t\ttheKeys.push(String(j));\n\t\t\t}\n\t\t} else {\n\t\t\tfor (var name in object) {\n\t\t\t\tif (!(skipProto && name === 'prototype') && has.call(object, name)) {\n\t\t\t\t\ttheKeys.push(String(name));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (hasDontEnumBug) {\n\t\t\tvar skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);\n\n\t\t\tfor (var k = 0; k < dontEnums.length; ++k) {\n\t\t\t\tif (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {\n\t\t\t\t\ttheKeys.push(dontEnums[k]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn theKeys;\n\t};\n}\nmodule.exports = keysShim;\n","'use strict';\n\nvar slice = Array.prototype.slice;\nvar isArgs = require('./isArguments');\n\nvar origKeys = Object.keys;\nvar keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');\n\nvar originalKeys = Object.keys;\n\nkeysShim.shim = function shimObjectKeys() {\n\tif (Object.keys) {\n\t\tvar keysWorksWithArguments = (function () {\n\t\t\t// Safari 5.0 bug\n\t\t\tvar args = Object.keys(arguments);\n\t\t\treturn args && args.length === arguments.length;\n\t\t}(1, 2));\n\t\tif (!keysWorksWithArguments) {\n\t\t\tObject.keys = function keys(object) { // eslint-disable-line func-name-matching\n\t\t\t\tif (isArgs(object)) {\n\t\t\t\t\treturn originalKeys(slice.call(object));\n\t\t\t\t}\n\t\t\t\treturn originalKeys(object);\n\t\t\t};\n\t\t}\n\t} else {\n\t\tObject.keys = keysShim;\n\t}\n\treturn Object.keys || keysShim;\n};\n\nmodule.exports = keysShim;\n","'use strict';\n\nvar toStr = Object.prototype.toString;\n\nmodule.exports = function isArguments(value) {\n\tvar str = toStr.call(value);\n\tvar isArgs = str === '[object Arguments]';\n\tif (!isArgs) {\n\t\tisArgs = str !== '[object Array]' &&\n\t\t\tvalue !== null &&\n\t\t\ttypeof value === 'object' &&\n\t\t\ttypeof value.length === 'number' &&\n\t\t\tvalue.length >= 0 &&\n\t\t\ttoStr.call(value.callee) === '[object Function]';\n\t}\n\treturn isArgs;\n};\n","'use strict';\n\nvar setFunctionName = require('set-function-name');\n\nvar $Object = Object;\nvar $TypeError = TypeError;\n\nmodule.exports = setFunctionName(function flags() {\n\tif (this != null && this !== $Object(this)) {\n\t\tthrow new $TypeError('RegExp.prototype.flags getter called on non-object');\n\t}\n\tvar result = '';\n\tif (this.hasIndices) {\n\t\tresult += 'd';\n\t}\n\tif (this.global) {\n\t\tresult += 'g';\n\t}\n\tif (this.ignoreCase) {\n\t\tresult += 'i';\n\t}\n\tif (this.multiline) {\n\t\tresult += 'm';\n\t}\n\tif (this.dotAll) {\n\t\tresult += 's';\n\t}\n\tif (this.unicode) {\n\t\tresult += 'u';\n\t}\n\tif (this.unicodeSets) {\n\t\tresult += 'v';\n\t}\n\tif (this.sticky) {\n\t\tresult += 'y';\n\t}\n\treturn result;\n}, 'get flags', true);\n\n","'use strict';\n\nvar define = require('define-properties');\nvar callBind = require('call-bind');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar flagsBound = callBind(getPolyfill());\n\ndefine(flagsBound, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = flagsBound;\n","'use strict';\n\nvar implementation = require('./implementation');\n\nvar supportsDescriptors = require('define-properties').supportsDescriptors;\nvar $gOPD = Object.getOwnPropertyDescriptor;\n\nmodule.exports = function getPolyfill() {\n\tif (supportsDescriptors && (/a/mig).flags === 'gim') {\n\t\tvar descriptor = $gOPD(RegExp.prototype, 'flags');\n\t\tif (\n\t\t\tdescriptor\n\t\t\t&& typeof descriptor.get === 'function'\n\t\t\t&& typeof RegExp.prototype.dotAll === 'boolean'\n\t\t\t&& typeof RegExp.prototype.hasIndices === 'boolean'\n\t\t) {\n\t\t\t/* eslint getter-return: 0 */\n\t\t\tvar calls = '';\n\t\t\tvar o = {};\n\t\t\tObject.defineProperty(o, 'hasIndices', {\n\t\t\t\tget: function () {\n\t\t\t\t\tcalls += 'd';\n\t\t\t\t}\n\t\t\t});\n\t\t\tObject.defineProperty(o, 'sticky', {\n\t\t\t\tget: function () {\n\t\t\t\t\tcalls += 'y';\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (calls === 'dy') {\n\t\t\t\treturn descriptor.get;\n\t\t\t}\n\t\t}\n\t}\n\treturn implementation;\n};\n","'use strict';\n\nvar supportsDescriptors = require('define-properties').supportsDescriptors;\nvar getPolyfill = require('./polyfill');\nvar gOPD = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar TypeErr = TypeError;\nvar getProto = Object.getPrototypeOf;\nvar regex = /a/;\n\nmodule.exports = function shimFlags() {\n\tif (!supportsDescriptors || !getProto) {\n\t\tthrow new TypeErr('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');\n\t}\n\tvar polyfill = getPolyfill();\n\tvar proto = getProto(regex);\n\tvar descriptor = gOPD(proto, 'flags');\n\tif (!descriptor || descriptor.get !== polyfill) {\n\t\tdefineProperty(proto, 'flags', {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tget: polyfill\n\t\t});\n\t}\n\treturn polyfill;\n};\n","'use strict';\n\nvar callBound = require('call-bind/callBound');\nvar GetIntrinsic = require('get-intrinsic');\nvar isRegex = require('is-regex');\n\nvar $exec = callBound('RegExp.prototype.exec');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nmodule.exports = function regexTester(regex) {\n\tif (!isRegex(regex)) {\n\t\tthrow new $TypeError('`regex` must be a RegExp');\n\t}\n\treturn function test(s) {\n\t\treturn $exec(regex, s) !== null;\n\t};\n};\n","'use strict';\n\nvar define = require('define-data-property');\nvar hasDescriptors = require('has-property-descriptors')();\nvar functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames();\n\nvar $TypeError = TypeError;\n\nmodule.exports = function setFunctionName(fn, name) {\n\tif (typeof fn !== 'function') {\n\t\tthrow new $TypeError('`fn` is not a function');\n\t}\n\tvar loose = arguments.length > 2 && !!arguments[2];\n\tif (!loose || functionsHaveConfigurableNames) {\n\t\tif (hasDescriptors) {\n\t\t\tdefine(fn, 'name', name, true, true);\n\t\t} else {\n\t\t\tdefine(fn, 'name', name);\n\t\t}\n\t}\n\treturn fn;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bind/callBound');\nvar inspect = require('object-inspect');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $WeakMap = GetIntrinsic('%WeakMap%', true);\nvar $Map = GetIntrinsic('%Map%', true);\n\nvar $weakMapGet = callBound('WeakMap.prototype.get', true);\nvar $weakMapSet = callBound('WeakMap.prototype.set', true);\nvar $weakMapHas = callBound('WeakMap.prototype.has', true);\nvar $mapGet = callBound('Map.prototype.get', true);\nvar $mapSet = callBound('Map.prototype.set', true);\nvar $mapHas = callBound('Map.prototype.has', true);\n\n/*\n * This function traverses the list returning the node corresponding to the\n * given key.\n *\n * That node is also moved to the head of the list, so that if it's accessed\n * again we don't need to traverse the whole list. By doing so, all the recently\n * used nodes can be accessed relatively quickly.\n */\nvar listGetNode = function (list, key) { // eslint-disable-line consistent-return\n\tfor (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {\n\t\tif (curr.key === key) {\n\t\t\tprev.next = curr.next;\n\t\t\tcurr.next = list.next;\n\t\t\tlist.next = curr; // eslint-disable-line no-param-reassign\n\t\t\treturn curr;\n\t\t}\n\t}\n};\n\nvar listGet = function (objects, key) {\n\tvar node = listGetNode(objects, key);\n\treturn node && node.value;\n};\nvar listSet = function (objects, key, value) {\n\tvar node = listGetNode(objects, key);\n\tif (node) {\n\t\tnode.value = value;\n\t} else {\n\t\t// Prepend the new node to the beginning of the list\n\t\tobjects.next = { // eslint-disable-line no-param-reassign\n\t\t\tkey: key,\n\t\t\tnext: objects.next,\n\t\t\tvalue: value\n\t\t};\n\t}\n};\nvar listHas = function (objects, key) {\n\treturn !!listGetNode(objects, key);\n};\n\nmodule.exports = function getSideChannel() {\n\tvar $wm;\n\tvar $m;\n\tvar $o;\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\tget: function (key) { // eslint-disable-line consistent-return\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapGet($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapGet($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listGet($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\thas: function (key) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapHas($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapHas($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listHas($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif (!$wm) {\n\t\t\t\t\t$wm = new $WeakMap();\n\t\t\t\t}\n\t\t\t\t$weakMapSet($wm, key, value);\n\t\t\t} else if ($Map) {\n\t\t\t\tif (!$m) {\n\t\t\t\t\t$m = new $Map();\n\t\t\t\t}\n\t\t\t\t$mapSet($m, key, value);\n\t\t\t} else {\n\t\t\t\tif (!$o) {\n\t\t\t\t\t/*\n\t\t\t\t\t * Initialize the linked list as an empty node, so that we don't have\n\t\t\t\t\t * to special-case handling of the first node: we can always refer to\n\t\t\t\t\t * it as (previous node).next, instead of something like (list).head\n\t\t\t\t\t */\n\t\t\t\t\t$o = { key: {}, next: null };\n\t\t\t\t}\n\t\t\t\tlistSet($o, key, value);\n\t\t\t}\n\t\t}\n\t};\n\treturn channel;\n};\n","'use strict';\n\nvar Call = require('es-abstract/2023/Call');\nvar Get = require('es-abstract/2023/Get');\nvar GetMethod = require('es-abstract/2023/GetMethod');\nvar IsRegExp = require('es-abstract/2023/IsRegExp');\nvar ToString = require('es-abstract/2023/ToString');\nvar RequireObjectCoercible = require('es-abstract/2023/RequireObjectCoercible');\nvar callBound = require('call-bind/callBound');\nvar hasSymbols = require('has-symbols')();\nvar flagsGetter = require('regexp.prototype.flags');\n\nvar $indexOf = callBound('String.prototype.indexOf');\n\nvar regexpMatchAllPolyfill = require('./polyfill-regexp-matchall');\n\nvar getMatcher = function getMatcher(regexp) { // eslint-disable-line consistent-return\n\tvar matcherPolyfill = regexpMatchAllPolyfill();\n\tif (hasSymbols && typeof Symbol.matchAll === 'symbol') {\n\t\tvar matcher = GetMethod(regexp, Symbol.matchAll);\n\t\tif (matcher === RegExp.prototype[Symbol.matchAll] && matcher !== matcherPolyfill) {\n\t\t\treturn matcherPolyfill;\n\t\t}\n\t\treturn matcher;\n\t}\n\t// fallback for pre-Symbol.matchAll environments\n\tif (IsRegExp(regexp)) {\n\t\treturn matcherPolyfill;\n\t}\n};\n\nmodule.exports = function matchAll(regexp) {\n\tvar O = RequireObjectCoercible(this);\n\n\tif (typeof regexp !== 'undefined' && regexp !== null) {\n\t\tvar isRegExp = IsRegExp(regexp);\n\t\tif (isRegExp) {\n\t\t\t// workaround for older engines that lack RegExp.prototype.flags\n\t\t\tvar flags = 'flags' in regexp ? Get(regexp, 'flags') : flagsGetter(regexp);\n\t\t\tRequireObjectCoercible(flags);\n\t\t\tif ($indexOf(ToString(flags), 'g') < 0) {\n\t\t\t\tthrow new TypeError('matchAll requires a global regular expression');\n\t\t\t}\n\t\t}\n\n\t\tvar matcher = getMatcher(regexp);\n\t\tif (typeof matcher !== 'undefined') {\n\t\t\treturn Call(matcher, regexp, [O]);\n\t\t}\n\t}\n\n\tvar S = ToString(O);\n\t// var rx = RegExpCreate(regexp, 'g');\n\tvar rx = new RegExp(regexp, 'g');\n\treturn Call(getMatcher(rx), rx, [S]);\n};\n","'use strict';\n\nvar callBind = require('call-bind');\nvar define = require('define-properties');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar boundMatchAll = callBind(implementation);\n\ndefine(boundMatchAll, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = boundMatchAll;\n","'use strict';\n\nvar hasSymbols = require('has-symbols')();\nvar regexpMatchAll = require('./regexp-matchall');\n\nmodule.exports = function getRegExpMatchAllPolyfill() {\n\tif (!hasSymbols || typeof Symbol.matchAll !== 'symbol' || typeof RegExp.prototype[Symbol.matchAll] !== 'function') {\n\t\treturn regexpMatchAll;\n\t}\n\treturn RegExp.prototype[Symbol.matchAll];\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = function getPolyfill() {\n\tif (String.prototype.matchAll) {\n\t\ttry {\n\t\t\t''.matchAll(RegExp.prototype);\n\t\t} catch (e) {\n\t\t\treturn String.prototype.matchAll;\n\t\t}\n\t}\n\treturn implementation;\n};\n","'use strict';\n\n// var Construct = require('es-abstract/2023/Construct');\nvar CreateRegExpStringIterator = require('es-abstract/2023/CreateRegExpStringIterator');\nvar Get = require('es-abstract/2023/Get');\nvar Set = require('es-abstract/2023/Set');\nvar SpeciesConstructor = require('es-abstract/2023/SpeciesConstructor');\nvar ToLength = require('es-abstract/2023/ToLength');\nvar ToString = require('es-abstract/2023/ToString');\nvar Type = require('es-abstract/2023/Type');\nvar flagsGetter = require('regexp.prototype.flags');\nvar setFunctionName = require('set-function-name');\nvar callBound = require('call-bind/callBound');\n\nvar $indexOf = callBound('String.prototype.indexOf');\n\nvar OrigRegExp = RegExp;\n\nvar supportsConstructingWithFlags = 'flags' in RegExp.prototype;\n\nvar constructRegexWithFlags = function constructRegex(C, R) {\n\tvar matcher;\n\t// workaround for older engines that lack RegExp.prototype.flags\n\tvar flags = 'flags' in R ? Get(R, 'flags') : ToString(flagsGetter(R));\n\tif (supportsConstructingWithFlags && typeof flags === 'string') {\n\t\tmatcher = new C(R, flags);\n\t} else if (C === OrigRegExp) {\n\t\t// workaround for older engines that can not construct a RegExp with flags\n\t\tmatcher = new C(R.source, flags);\n\t} else {\n\t\tmatcher = new C(R, flags);\n\t}\n\treturn { flags: flags, matcher: matcher };\n};\n\nvar regexMatchAll = setFunctionName(function SymbolMatchAll(string) {\n\tvar R = this;\n\tif (Type(R) !== 'Object') {\n\t\tthrow new TypeError('\"this\" value must be an Object');\n\t}\n\tvar S = ToString(string);\n\tvar C = SpeciesConstructor(R, OrigRegExp);\n\n\tvar tmp = constructRegexWithFlags(C, R);\n\t// var flags = ToString(Get(R, 'flags'));\n\tvar flags = tmp.flags;\n\t// var matcher = Construct(C, [R, flags]);\n\tvar matcher = tmp.matcher;\n\n\tvar lastIndex = ToLength(Get(R, 'lastIndex'));\n\tSet(matcher, 'lastIndex', lastIndex, true);\n\tvar global = $indexOf(flags, 'g') > -1;\n\tvar fullUnicode = $indexOf(flags, 'u') > -1;\n\treturn CreateRegExpStringIterator(matcher, S, global, fullUnicode);\n}, '[Symbol.matchAll]', true);\n\nmodule.exports = regexMatchAll;\n","'use strict';\n\nvar define = require('define-properties');\nvar hasSymbols = require('has-symbols')();\nvar getPolyfill = require('./polyfill');\nvar regexpMatchAllPolyfill = require('./polyfill-regexp-matchall');\n\nvar defineP = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nmodule.exports = function shimMatchAll() {\n\tvar polyfill = getPolyfill();\n\tdefine(\n\t\tString.prototype,\n\t\t{ matchAll: polyfill },\n\t\t{ matchAll: function () { return String.prototype.matchAll !== polyfill; } }\n\t);\n\tif (hasSymbols) {\n\t\t// eslint-disable-next-line no-restricted-properties\n\t\tvar symbol = Symbol.matchAll || (Symbol['for'] ? Symbol['for']('Symbol.matchAll') : Symbol('Symbol.matchAll'));\n\t\tdefine(\n\t\t\tSymbol,\n\t\t\t{ matchAll: symbol },\n\t\t\t{ matchAll: function () { return Symbol.matchAll !== symbol; } }\n\t\t);\n\n\t\tif (defineP && gOPD) {\n\t\t\tvar desc = gOPD(Symbol, symbol);\n\t\t\tif (!desc || desc.configurable) {\n\t\t\t\tdefineP(Symbol, symbol, {\n\t\t\t\t\tconfigurable: false,\n\t\t\t\t\tenumerable: false,\n\t\t\t\t\tvalue: symbol,\n\t\t\t\t\twritable: false\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tvar regexpMatchAll = regexpMatchAllPolyfill();\n\t\tvar func = {};\n\t\tfunc[symbol] = regexpMatchAll;\n\t\tvar predicate = {};\n\t\tpredicate[symbol] = function () {\n\t\t\treturn RegExp.prototype[symbol] !== regexpMatchAll;\n\t\t};\n\t\tdefine(RegExp.prototype, func, predicate);\n\t}\n\treturn polyfill;\n};\n","'use strict';\n\nvar RequireObjectCoercible = require('es-abstract/2023/RequireObjectCoercible');\nvar ToString = require('es-abstract/2023/ToString');\nvar callBound = require('call-bind/callBound');\nvar $replace = callBound('String.prototype.replace');\n\nvar mvsIsWS = (/^\\s$/).test('\\u180E');\n/* eslint-disable no-control-regex */\nvar leftWhitespace = mvsIsWS\n\t? /^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+/\n\t: /^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+/;\nvar rightWhitespace = mvsIsWS\n\t? /[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+$/\n\t: /[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+$/;\n/* eslint-enable no-control-regex */\n\nmodule.exports = function trim() {\n\tvar S = ToString(RequireObjectCoercible(this));\n\treturn $replace($replace(S, leftWhitespace, ''), rightWhitespace, '');\n};\n","'use strict';\n\nvar callBind = require('call-bind');\nvar define = require('define-properties');\nvar RequireObjectCoercible = require('es-abstract/2023/RequireObjectCoercible');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar bound = callBind(getPolyfill());\nvar boundMethod = function trim(receiver) {\n\tRequireObjectCoercible(receiver);\n\treturn bound(receiver);\n};\n\ndefine(boundMethod, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = boundMethod;\n","'use strict';\n\nvar implementation = require('./implementation');\n\nvar zeroWidthSpace = '\\u200b';\nvar mongolianVowelSeparator = '\\u180E';\n\nmodule.exports = function getPolyfill() {\n\tif (\n\t\tString.prototype.trim\n\t\t&& zeroWidthSpace.trim() === zeroWidthSpace\n\t\t&& mongolianVowelSeparator.trim() === mongolianVowelSeparator\n\t\t&& ('_' + mongolianVowelSeparator).trim() === ('_' + mongolianVowelSeparator)\n\t\t&& (mongolianVowelSeparator + '_').trim() === (mongolianVowelSeparator + '_')\n\t) {\n\t\treturn String.prototype.trim;\n\t}\n\treturn implementation;\n};\n","'use strict';\n\nvar define = require('define-properties');\nvar getPolyfill = require('./polyfill');\n\nmodule.exports = function shimStringTrim() {\n\tvar polyfill = getPolyfill();\n\tdefine(String.prototype, { trim: polyfill }, {\n\t\ttrim: function testTrim() {\n\t\t\treturn String.prototype.trim !== polyfill;\n\t\t}\n\t});\n\treturn polyfill;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar CodePointAt = require('./CodePointAt');\nvar Type = require('./Type');\n\nvar isInteger = require('../helpers/isInteger');\nvar MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// https://262.ecma-international.org/12.0/#sec-advancestringindex\n\nmodule.exports = function AdvanceStringIndex(S, index, unicode) {\n\tif (Type(S) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `S` must be a String');\n\t}\n\tif (!isInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) {\n\t\tthrow new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53');\n\t}\n\tif (Type(unicode) !== 'Boolean') {\n\t\tthrow new $TypeError('Assertion failed: `unicode` must be a Boolean');\n\t}\n\tif (!unicode) {\n\t\treturn index + 1;\n\t}\n\tvar length = S.length;\n\tif ((index + 1) >= length) {\n\t\treturn index + 1;\n\t}\n\tvar cp = CodePointAt(S, index);\n\treturn index + cp['[[CodeUnitCount]]'];\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bind/callBound');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar IsArray = require('./IsArray');\n\nvar $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('Function.prototype.apply');\n\n// https://262.ecma-international.org/6.0/#sec-call\n\nmodule.exports = function Call(F, V) {\n\tvar argumentsList = arguments.length > 2 ? arguments[2] : [];\n\tif (!IsArray(argumentsList)) {\n\t\tthrow new $TypeError('Assertion failed: optional `argumentsList`, if provided, must be a List');\n\t}\n\treturn $apply(F, V, argumentsList);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar callBound = require('call-bind/callBound');\nvar isLeadingSurrogate = require('../helpers/isLeadingSurrogate');\nvar isTrailingSurrogate = require('../helpers/isTrailingSurrogate');\n\nvar Type = require('./Type');\nvar UTF16SurrogatePairToCodePoint = require('./UTF16SurrogatePairToCodePoint');\n\nvar $charAt = callBound('String.prototype.charAt');\nvar $charCodeAt = callBound('String.prototype.charCodeAt');\n\n// https://262.ecma-international.org/12.0/#sec-codepointat\n\nmodule.exports = function CodePointAt(string, position) {\n\tif (Type(string) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `string` must be a String');\n\t}\n\tvar size = string.length;\n\tif (position < 0 || position >= size) {\n\t\tthrow new $TypeError('Assertion failed: `position` must be >= 0, and < the length of `string`');\n\t}\n\tvar first = $charCodeAt(string, position);\n\tvar cp = $charAt(string, position);\n\tvar firstIsLeading = isLeadingSurrogate(first);\n\tvar firstIsTrailing = isTrailingSurrogate(first);\n\tif (!firstIsLeading && !firstIsTrailing) {\n\t\treturn {\n\t\t\t'[[CodePoint]]': cp,\n\t\t\t'[[CodeUnitCount]]': 1,\n\t\t\t'[[IsUnpairedSurrogate]]': false\n\t\t};\n\t}\n\tif (firstIsTrailing || (position + 1 === size)) {\n\t\treturn {\n\t\t\t'[[CodePoint]]': cp,\n\t\t\t'[[CodeUnitCount]]': 1,\n\t\t\t'[[IsUnpairedSurrogate]]': true\n\t\t};\n\t}\n\tvar second = $charCodeAt(string, position + 1);\n\tif (!isTrailingSurrogate(second)) {\n\t\treturn {\n\t\t\t'[[CodePoint]]': cp,\n\t\t\t'[[CodeUnitCount]]': 1,\n\t\t\t'[[IsUnpairedSurrogate]]': true\n\t\t};\n\t}\n\n\treturn {\n\t\t'[[CodePoint]]': UTF16SurrogatePairToCodePoint(first, second),\n\t\t'[[CodeUnitCount]]': 2,\n\t\t'[[IsUnpairedSurrogate]]': false\n\t};\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-createiterresultobject\n\nmodule.exports = function CreateIterResultObject(value, done) {\n\tif (Type(done) !== 'Boolean') {\n\t\tthrow new $TypeError('Assertion failed: Type(done) is not Boolean');\n\t}\n\treturn {\n\t\tvalue: value,\n\t\tdone: done\n\t};\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar DefineOwnProperty = require('../helpers/DefineOwnProperty');\n\nvar FromPropertyDescriptor = require('./FromPropertyDescriptor');\nvar IsDataDescriptor = require('./IsDataDescriptor');\nvar IsPropertyKey = require('./IsPropertyKey');\nvar SameValue = require('./SameValue');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-createmethodproperty\n\nmodule.exports = function CreateMethodProperty(O, P, V) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true');\n\t}\n\n\tvar newDesc = {\n\t\t'[[Configurable]]': true,\n\t\t'[[Enumerable]]': false,\n\t\t'[[Value]]': V,\n\t\t'[[Writable]]': true\n\t};\n\treturn DefineOwnProperty(\n\t\tIsDataDescriptor,\n\t\tSameValue,\n\t\tFromPropertyDescriptor,\n\t\tO,\n\t\tP,\n\t\tnewDesc\n\t);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar hasSymbols = require('has-symbols')();\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar IteratorPrototype = GetIntrinsic('%IteratorPrototype%', true);\n\nvar AdvanceStringIndex = require('./AdvanceStringIndex');\nvar CreateIterResultObject = require('./CreateIterResultObject');\nvar CreateMethodProperty = require('./CreateMethodProperty');\nvar Get = require('./Get');\nvar OrdinaryObjectCreate = require('./OrdinaryObjectCreate');\nvar RegExpExec = require('./RegExpExec');\nvar Set = require('./Set');\nvar ToLength = require('./ToLength');\nvar ToString = require('./ToString');\nvar Type = require('./Type');\n\nvar SLOT = require('internal-slot');\nvar setToStringTag = require('es-set-tostringtag');\n\nvar RegExpStringIterator = function RegExpStringIterator(R, S, global, fullUnicode) {\n\tif (Type(S) !== 'String') {\n\t\tthrow new $TypeError('`S` must be a string');\n\t}\n\tif (Type(global) !== 'Boolean') {\n\t\tthrow new $TypeError('`global` must be a boolean');\n\t}\n\tif (Type(fullUnicode) !== 'Boolean') {\n\t\tthrow new $TypeError('`fullUnicode` must be a boolean');\n\t}\n\tSLOT.set(this, '[[IteratingRegExp]]', R);\n\tSLOT.set(this, '[[IteratedString]]', S);\n\tSLOT.set(this, '[[Global]]', global);\n\tSLOT.set(this, '[[Unicode]]', fullUnicode);\n\tSLOT.set(this, '[[Done]]', false);\n};\n\nif (IteratorPrototype) {\n\tRegExpStringIterator.prototype = OrdinaryObjectCreate(IteratorPrototype);\n}\n\nvar RegExpStringIteratorNext = function next() {\n\tvar O = this; // eslint-disable-line no-invalid-this\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('receiver must be an object');\n\t}\n\tif (\n\t\t!(O instanceof RegExpStringIterator)\n\t\t|| !SLOT.has(O, '[[IteratingRegExp]]')\n\t\t|| !SLOT.has(O, '[[IteratedString]]')\n\t\t|| !SLOT.has(O, '[[Global]]')\n\t\t|| !SLOT.has(O, '[[Unicode]]')\n\t\t|| !SLOT.has(O, '[[Done]]')\n\t) {\n\t\tthrow new $TypeError('\"this\" value must be a RegExpStringIterator instance');\n\t}\n\tif (SLOT.get(O, '[[Done]]')) {\n\t\treturn CreateIterResultObject(undefined, true);\n\t}\n\tvar R = SLOT.get(O, '[[IteratingRegExp]]');\n\tvar S = SLOT.get(O, '[[IteratedString]]');\n\tvar global = SLOT.get(O, '[[Global]]');\n\tvar fullUnicode = SLOT.get(O, '[[Unicode]]');\n\tvar match = RegExpExec(R, S);\n\tif (match === null) {\n\t\tSLOT.set(O, '[[Done]]', true);\n\t\treturn CreateIterResultObject(undefined, true);\n\t}\n\tif (global) {\n\t\tvar matchStr = ToString(Get(match, '0'));\n\t\tif (matchStr === '') {\n\t\t\tvar thisIndex = ToLength(Get(R, 'lastIndex'));\n\t\t\tvar nextIndex = AdvanceStringIndex(S, thisIndex, fullUnicode);\n\t\t\tSet(R, 'lastIndex', nextIndex, true);\n\t\t}\n\t\treturn CreateIterResultObject(match, false);\n\t}\n\tSLOT.set(O, '[[Done]]', true);\n\treturn CreateIterResultObject(match, false);\n};\nCreateMethodProperty(RegExpStringIterator.prototype, 'next', RegExpStringIteratorNext);\n\nif (hasSymbols) {\n\tsetToStringTag(RegExpStringIterator.prototype, 'RegExp String Iterator');\n\n\tif (Symbol.iterator && typeof RegExpStringIterator.prototype[Symbol.iterator] !== 'function') {\n\t\tvar iteratorFn = function SymbolIterator() {\n\t\t\treturn this;\n\t\t};\n\t\tCreateMethodProperty(RegExpStringIterator.prototype, Symbol.iterator, iteratorFn);\n\t}\n}\n\n// https://262.ecma-international.org/11.0/#sec-createregexpstringiterator\nmodule.exports = function CreateRegExpStringIterator(R, S, global, fullUnicode) {\n\t// assert R.global === global && R.unicode === fullUnicode?\n\treturn new RegExpStringIterator(R, S, global, fullUnicode);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar isPropertyDescriptor = require('../helpers/isPropertyDescriptor');\nvar DefineOwnProperty = require('../helpers/DefineOwnProperty');\n\nvar FromPropertyDescriptor = require('./FromPropertyDescriptor');\nvar IsAccessorDescriptor = require('./IsAccessorDescriptor');\nvar IsDataDescriptor = require('./IsDataDescriptor');\nvar IsPropertyKey = require('./IsPropertyKey');\nvar SameValue = require('./SameValue');\nvar ToPropertyDescriptor = require('./ToPropertyDescriptor');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-definepropertyorthrow\n\nmodule.exports = function DefinePropertyOrThrow(O, P, desc) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true');\n\t}\n\n\tvar Desc = isPropertyDescriptor({\n\t\tType: Type,\n\t\tIsDataDescriptor: IsDataDescriptor,\n\t\tIsAccessorDescriptor: IsAccessorDescriptor\n\t}, desc) ? desc : ToPropertyDescriptor(desc);\n\tif (!isPropertyDescriptor({\n\t\tType: Type,\n\t\tIsDataDescriptor: IsDataDescriptor,\n\t\tIsAccessorDescriptor: IsAccessorDescriptor\n\t}, Desc)) {\n\t\tthrow new $TypeError('Assertion failed: Desc is not a valid Property Descriptor');\n\t}\n\n\treturn DefineOwnProperty(\n\t\tIsDataDescriptor,\n\t\tSameValue,\n\t\tFromPropertyDescriptor,\n\t\tO,\n\t\tP,\n\t\tDesc\n\t);\n};\n","'use strict';\n\nvar assertRecord = require('../helpers/assertRecord');\nvar fromPropertyDescriptor = require('../helpers/fromPropertyDescriptor');\n\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-frompropertydescriptor\n\nmodule.exports = function FromPropertyDescriptor(Desc) {\n\tif (typeof Desc !== 'undefined') {\n\t\tassertRecord(Type, 'Property Descriptor', 'Desc', Desc);\n\t}\n\n\treturn fromPropertyDescriptor(Desc);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar inspect = require('object-inspect');\n\nvar IsPropertyKey = require('./IsPropertyKey');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-get-o-p\n\nmodule.exports = function Get(O, P) {\n\t// 7.3.1.1\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\t// 7.3.1.2\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P));\n\t}\n\t// 7.3.1.3\n\treturn O[P];\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar GetV = require('./GetV');\nvar IsCallable = require('./IsCallable');\nvar IsPropertyKey = require('./IsPropertyKey');\n\nvar inspect = require('object-inspect');\n\n// https://262.ecma-international.org/6.0/#sec-getmethod\n\nmodule.exports = function GetMethod(O, P) {\n\t// 7.3.9.1\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true');\n\t}\n\n\t// 7.3.9.2\n\tvar func = GetV(O, P);\n\n\t// 7.3.9.4\n\tif (func == null) {\n\t\treturn void 0;\n\t}\n\n\t// 7.3.9.5\n\tif (!IsCallable(func)) {\n\t\tthrow new $TypeError(inspect(P) + ' is not a function: ' + inspect(func));\n\t}\n\n\t// 7.3.9.6\n\treturn func;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar inspect = require('object-inspect');\n\nvar IsPropertyKey = require('./IsPropertyKey');\n// var ToObject = require('./ToObject');\n\n// https://262.ecma-international.org/6.0/#sec-getv\n\nmodule.exports = function GetV(V, P) {\n\t// 7.3.2.1\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P));\n\t}\n\n\t// 7.3.2.2-3\n\t// var O = ToObject(V);\n\n\t// 7.3.2.4\n\treturn V[P];\n};\n","'use strict';\n\nvar has = require('has');\n\nvar Type = require('./Type');\n\nvar assertRecord = require('../helpers/assertRecord');\n\n// https://262.ecma-international.org/5.1/#sec-8.10.1\n\nmodule.exports = function IsAccessorDescriptor(Desc) {\n\tif (typeof Desc === 'undefined') {\n\t\treturn false;\n\t}\n\n\tassertRecord(Type, 'Property Descriptor', 'Desc', Desc);\n\n\tif (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n","'use strict';\n\n// https://262.ecma-international.org/6.0/#sec-isarray\nmodule.exports = require('../helpers/IsArray');\n","'use strict';\n\n// http://262.ecma-international.org/5.1/#sec-9.11\n\nmodule.exports = require('is-callable');\n","'use strict';\n\nvar GetIntrinsic = require('../GetIntrinsic.js');\n\nvar $construct = GetIntrinsic('%Reflect.construct%', true);\n\nvar DefinePropertyOrThrow = require('./DefinePropertyOrThrow');\ntry {\n\tDefinePropertyOrThrow({}, '', { '[[Get]]': function () {} });\n} catch (e) {\n\t// Accessor properties aren't supported\n\tDefinePropertyOrThrow = null;\n}\n\n// https://262.ecma-international.org/6.0/#sec-isconstructor\n\nif (DefinePropertyOrThrow && $construct) {\n\tvar isConstructorMarker = {};\n\tvar badArrayLike = {};\n\tDefinePropertyOrThrow(badArrayLike, 'length', {\n\t\t'[[Get]]': function () {\n\t\t\tthrow isConstructorMarker;\n\t\t},\n\t\t'[[Enumerable]]': true\n\t});\n\n\tmodule.exports = function IsConstructor(argument) {\n\t\ttry {\n\t\t\t// `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`:\n\t\t\t$construct(argument, badArrayLike);\n\t\t} catch (err) {\n\t\t\treturn err === isConstructorMarker;\n\t\t}\n\t};\n} else {\n\tmodule.exports = function IsConstructor(argument) {\n\t\t// unfortunately there's no way to truly check this without try/catch `new argument` in old environments\n\t\treturn typeof argument === 'function' && !!argument.prototype;\n\t};\n}\n","'use strict';\n\nvar has = require('has');\n\nvar Type = require('./Type');\n\nvar assertRecord = require('../helpers/assertRecord');\n\n// https://262.ecma-international.org/5.1/#sec-8.10.2\n\nmodule.exports = function IsDataDescriptor(Desc) {\n\tif (typeof Desc === 'undefined') {\n\t\treturn false;\n\t}\n\n\tassertRecord(Type, 'Property Descriptor', 'Desc', Desc);\n\n\tif (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n","'use strict';\n\n// https://262.ecma-international.org/6.0/#sec-ispropertykey\n\nmodule.exports = function IsPropertyKey(argument) {\n\treturn typeof argument === 'string' || typeof argument === 'symbol';\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $match = GetIntrinsic('%Symbol.match%', true);\n\nvar hasRegExpMatcher = require('is-regex');\n\nvar ToBoolean = require('./ToBoolean');\n\n// https://262.ecma-international.org/6.0/#sec-isregexp\n\nmodule.exports = function IsRegExp(argument) {\n\tif (!argument || typeof argument !== 'object') {\n\t\treturn false;\n\t}\n\tif ($match) {\n\t\tvar isRegExp = argument[$match];\n\t\tif (typeof isRegExp !== 'undefined') {\n\t\t\treturn ToBoolean(isRegExp);\n\t\t}\n\t}\n\treturn hasRegExpMatcher(argument);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $ObjectCreate = GetIntrinsic('%Object.create%', true);\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\n\nvar IsArray = require('./IsArray');\nvar Type = require('./Type');\n\nvar forEach = require('../helpers/forEach');\n\nvar SLOT = require('internal-slot');\n\nvar hasProto = require('has-proto')();\n\n// https://262.ecma-international.org/11.0/#sec-objectcreate\n\nmodule.exports = function OrdinaryObjectCreate(proto) {\n\tif (proto !== null && Type(proto) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: `proto` must be null or an object');\n\t}\n\tvar additionalInternalSlotsList = arguments.length < 2 ? [] : arguments[1];\n\tif (!IsArray(additionalInternalSlotsList)) {\n\t\tthrow new $TypeError('Assertion failed: `additionalInternalSlotsList` must be an Array');\n\t}\n\n\t// var internalSlotsList = ['[[Prototype]]', '[[Extensible]]']; // step 1\n\t// internalSlotsList.push(...additionalInternalSlotsList); // step 2\n\t// var O = MakeBasicObject(internalSlotsList); // step 3\n\t// setProto(O, proto); // step 4\n\t// return O; // step 5\n\n\tvar O;\n\tif ($ObjectCreate) {\n\t\tO = $ObjectCreate(proto);\n\t} else if (hasProto) {\n\t\tO = { __proto__: proto };\n\t} else {\n\t\tif (proto === null) {\n\t\t\tthrow new $SyntaxError('native Object.create support is required to create null objects');\n\t\t}\n\t\tvar T = function T() {};\n\t\tT.prototype = proto;\n\t\tO = new T();\n\t}\n\n\tif (additionalInternalSlotsList.length > 0) {\n\t\tforEach(additionalInternalSlotsList, function (slot) {\n\t\t\tSLOT.set(O, slot, void undefined);\n\t\t});\n\t}\n\n\treturn O;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar regexExec = require('call-bind/callBound')('RegExp.prototype.exec');\n\nvar Call = require('./Call');\nvar Get = require('./Get');\nvar IsCallable = require('./IsCallable');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-regexpexec\n\nmodule.exports = function RegExpExec(R, S) {\n\tif (Type(R) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: `R` must be an Object');\n\t}\n\tif (Type(S) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `S` must be a String');\n\t}\n\tvar exec = Get(R, 'exec');\n\tif (IsCallable(exec)) {\n\t\tvar result = Call(exec, R, [S]);\n\t\tif (result === null || Type(result) === 'Object') {\n\t\t\treturn result;\n\t\t}\n\t\tthrow new $TypeError('\"exec\" method must return `null` or an Object');\n\t}\n\treturn regexExec(R, S);\n};\n","'use strict';\n\nmodule.exports = require('../5/CheckObjectCoercible');\n","'use strict';\n\nvar $isNaN = require('../helpers/isNaN');\n\n// http://262.ecma-international.org/5.1/#sec-9.12\n\nmodule.exports = function SameValue(x, y) {\n\tif (x === y) { // 0 === -0, but they are not identical.\n\t\tif (x === 0) { return 1 / x === 1 / y; }\n\t\treturn true;\n\t}\n\treturn $isNaN(x) && $isNaN(y);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar IsPropertyKey = require('./IsPropertyKey');\nvar SameValue = require('./SameValue');\nvar Type = require('./Type');\n\n// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated\nvar noThrowOnStrictViolation = (function () {\n\ttry {\n\t\tdelete [].length;\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n}());\n\n// https://262.ecma-international.org/6.0/#sec-set-o-p-v-throw\n\nmodule.exports = function Set(O, P, V, Throw) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: `O` must be an Object');\n\t}\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: `P` must be a Property Key');\n\t}\n\tif (Type(Throw) !== 'Boolean') {\n\t\tthrow new $TypeError('Assertion failed: `Throw` must be a Boolean');\n\t}\n\tif (Throw) {\n\t\tO[P] = V; // eslint-disable-line no-param-reassign\n\t\tif (noThrowOnStrictViolation && !SameValue(O[P], V)) {\n\t\t\tthrow new $TypeError('Attempted to assign to readonly property.');\n\t\t}\n\t\treturn true;\n\t}\n\ttry {\n\t\tO[P] = V; // eslint-disable-line no-param-reassign\n\t\treturn noThrowOnStrictViolation ? SameValue(O[P], V) : true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $species = GetIntrinsic('%Symbol.species%', true);\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar IsConstructor = require('./IsConstructor');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-speciesconstructor\n\nmodule.exports = function SpeciesConstructor(O, defaultConstructor) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\tvar C = O.constructor;\n\tif (typeof C === 'undefined') {\n\t\treturn defaultConstructor;\n\t}\n\tif (Type(C) !== 'Object') {\n\t\tthrow new $TypeError('O.constructor is not an Object');\n\t}\n\tvar S = $species ? C[$species] : void 0;\n\tif (S == null) {\n\t\treturn defaultConstructor;\n\t}\n\tif (IsConstructor(S)) {\n\t\treturn S;\n\t}\n\tthrow new $TypeError('no constructor found');\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $Number = GetIntrinsic('%Number%');\nvar $RegExp = GetIntrinsic('%RegExp%');\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $parseInteger = GetIntrinsic('%parseInt%');\n\nvar callBound = require('call-bind/callBound');\nvar regexTester = require('safe-regex-test');\n\nvar $strSlice = callBound('String.prototype.slice');\nvar isBinary = regexTester(/^0b[01]+$/i);\nvar isOctal = regexTester(/^0o[0-7]+$/i);\nvar isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i);\nvar nonWS = ['\\u0085', '\\u200b', '\\ufffe'].join('');\nvar nonWSregex = new $RegExp('[' + nonWS + ']', 'g');\nvar hasNonWS = regexTester(nonWSregex);\n\nvar $trim = require('string.prototype.trim');\n\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/13.0/#sec-stringtonumber\n\nmodule.exports = function StringToNumber(argument) {\n\tif (Type(argument) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `argument` is not a String');\n\t}\n\tif (isBinary(argument)) {\n\t\treturn $Number($parseInteger($strSlice(argument, 2), 2));\n\t}\n\tif (isOctal(argument)) {\n\t\treturn $Number($parseInteger($strSlice(argument, 2), 8));\n\t}\n\tif (hasNonWS(argument) || isInvalidHexLiteral(argument)) {\n\t\treturn NaN;\n\t}\n\tvar trimmed = $trim(argument);\n\tif (trimmed !== argument) {\n\t\treturn StringToNumber(trimmed);\n\t}\n\treturn $Number(argument);\n};\n","'use strict';\n\n// http://262.ecma-international.org/5.1/#sec-9.2\n\nmodule.exports = function ToBoolean(value) { return !!value; };\n","'use strict';\n\nvar ToNumber = require('./ToNumber');\nvar truncate = require('./truncate');\n\nvar $isNaN = require('../helpers/isNaN');\nvar $isFinite = require('../helpers/isFinite');\n\n// https://262.ecma-international.org/14.0/#sec-tointegerorinfinity\n\nmodule.exports = function ToIntegerOrInfinity(value) {\n\tvar number = ToNumber(value);\n\tif ($isNaN(number) || number === 0) { return 0; }\n\tif (!$isFinite(number)) { return number; }\n\treturn truncate(number);\n};\n","'use strict';\n\nvar MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');\n\nvar ToIntegerOrInfinity = require('./ToIntegerOrInfinity');\n\nmodule.exports = function ToLength(argument) {\n\tvar len = ToIntegerOrInfinity(argument);\n\tif (len <= 0) { return 0; } // includes converting -0 to +0\n\tif (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; }\n\treturn len;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $Number = GetIntrinsic('%Number%');\nvar isPrimitive = require('../helpers/isPrimitive');\n\nvar ToPrimitive = require('./ToPrimitive');\nvar StringToNumber = require('./StringToNumber');\n\n// https://262.ecma-international.org/13.0/#sec-tonumber\n\nmodule.exports = function ToNumber(argument) {\n\tvar value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number);\n\tif (typeof value === 'symbol') {\n\t\tthrow new $TypeError('Cannot convert a Symbol value to a number');\n\t}\n\tif (typeof value === 'bigint') {\n\t\tthrow new $TypeError('Conversion from \\'BigInt\\' to \\'number\\' is not allowed.');\n\t}\n\tif (typeof value === 'string') {\n\t\treturn StringToNumber(value);\n\t}\n\treturn $Number(value);\n};\n","'use strict';\n\nvar toPrimitive = require('es-to-primitive/es2015');\n\n// https://262.ecma-international.org/6.0/#sec-toprimitive\n\nmodule.exports = function ToPrimitive(input) {\n\tif (arguments.length > 1) {\n\t\treturn toPrimitive(input, arguments[1]);\n\t}\n\treturn toPrimitive(input);\n};\n","'use strict';\n\nvar has = require('has');\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar Type = require('./Type');\nvar ToBoolean = require('./ToBoolean');\nvar IsCallable = require('./IsCallable');\n\n// https://262.ecma-international.org/5.1/#sec-8.10.5\n\nmodule.exports = function ToPropertyDescriptor(Obj) {\n\tif (Type(Obj) !== 'Object') {\n\t\tthrow new $TypeError('ToPropertyDescriptor requires an object');\n\t}\n\n\tvar desc = {};\n\tif (has(Obj, 'enumerable')) {\n\t\tdesc['[[Enumerable]]'] = ToBoolean(Obj.enumerable);\n\t}\n\tif (has(Obj, 'configurable')) {\n\t\tdesc['[[Configurable]]'] = ToBoolean(Obj.configurable);\n\t}\n\tif (has(Obj, 'value')) {\n\t\tdesc['[[Value]]'] = Obj.value;\n\t}\n\tif (has(Obj, 'writable')) {\n\t\tdesc['[[Writable]]'] = ToBoolean(Obj.writable);\n\t}\n\tif (has(Obj, 'get')) {\n\t\tvar getter = Obj.get;\n\t\tif (typeof getter !== 'undefined' && !IsCallable(getter)) {\n\t\t\tthrow new $TypeError('getter must be a function');\n\t\t}\n\t\tdesc['[[Get]]'] = getter;\n\t}\n\tif (has(Obj, 'set')) {\n\t\tvar setter = Obj.set;\n\t\tif (typeof setter !== 'undefined' && !IsCallable(setter)) {\n\t\t\tthrow new $TypeError('setter must be a function');\n\t\t}\n\t\tdesc['[[Set]]'] = setter;\n\t}\n\n\tif ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) {\n\t\tthrow new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');\n\t}\n\treturn desc;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $String = GetIntrinsic('%String%');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// https://262.ecma-international.org/6.0/#sec-tostring\n\nmodule.exports = function ToString(argument) {\n\tif (typeof argument === 'symbol') {\n\t\tthrow new $TypeError('Cannot convert a Symbol value to a string');\n\t}\n\treturn $String(argument);\n};\n","'use strict';\n\nvar ES5Type = require('../5/Type');\n\n// https://262.ecma-international.org/11.0/#sec-ecmascript-data-types-and-values\n\nmodule.exports = function Type(x) {\n\tif (typeof x === 'symbol') {\n\t\treturn 'Symbol';\n\t}\n\tif (typeof x === 'bigint') {\n\t\treturn 'BigInt';\n\t}\n\treturn ES5Type(x);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $fromCharCode = GetIntrinsic('%String.fromCharCode%');\n\nvar isLeadingSurrogate = require('../helpers/isLeadingSurrogate');\nvar isTrailingSurrogate = require('../helpers/isTrailingSurrogate');\n\n// https://tc39.es/ecma262/2020/#sec-utf16decodesurrogatepair\n\nmodule.exports = function UTF16SurrogatePairToCodePoint(lead, trail) {\n\tif (!isLeadingSurrogate(lead) || !isTrailingSurrogate(trail)) {\n\t\tthrow new $TypeError('Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code');\n\t}\n\t// var cp = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;\n\treturn $fromCharCode(lead) + $fromCharCode(trail);\n};\n","'use strict';\n\nvar Type = require('./Type');\n\n// var modulo = require('./modulo');\nvar $floor = Math.floor;\n\n// http://262.ecma-international.org/11.0/#eqn-floor\n\nmodule.exports = function floor(x) {\n\t// return x - modulo(x, 1);\n\tif (Type(x) === 'BigInt') {\n\t\treturn x;\n\t}\n\treturn $floor(x);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar floor = require('./floor');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// https://262.ecma-international.org/14.0/#eqn-truncate\n\nmodule.exports = function truncate(x) {\n\tif (typeof x !== 'number' && typeof x !== 'bigint') {\n\t\tthrow new $TypeError('argument must be a Number or a BigInt');\n\t}\n\tvar result = x < 0 ? -floor(-x) : floor(x);\n\treturn result === 0 ? 0 : result; // in the spec, these are math values, so we filter out -0 here\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// http://262.ecma-international.org/5.1/#sec-9.10\n\nmodule.exports = function CheckObjectCoercible(value, optMessage) {\n\tif (value == null) {\n\t\tthrow new $TypeError(optMessage || ('Cannot call method on ' + value));\n\t}\n\treturn value;\n};\n","'use strict';\n\n// https://262.ecma-international.org/5.1/#sec-8\n\nmodule.exports = function Type(x) {\n\tif (x === null) {\n\t\treturn 'Null';\n\t}\n\tif (typeof x === 'undefined') {\n\t\treturn 'Undefined';\n\t}\n\tif (typeof x === 'function' || typeof x === 'object') {\n\t\treturn 'Object';\n\t}\n\tif (typeof x === 'number') {\n\t\treturn 'Number';\n\t}\n\tif (typeof x === 'boolean') {\n\t\treturn 'Boolean';\n\t}\n\tif (typeof x === 'string') {\n\t\treturn 'String';\n\t}\n};\n","'use strict';\n\n// TODO: remove, semver-major\n\nmodule.exports = require('get-intrinsic');\n","'use strict';\n\nvar hasPropertyDescriptors = require('has-property-descriptors');\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = hasPropertyDescriptors() && GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasArrayLengthDefineBug = hasPropertyDescriptors.hasArrayLengthDefineBug();\n\n// eslint-disable-next-line global-require\nvar isArray = hasArrayLengthDefineBug && require('../helpers/IsArray');\n\nvar callBound = require('call-bind/callBound');\n\nvar $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');\n\n// eslint-disable-next-line max-params\nmodule.exports = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) {\n\tif (!$defineProperty) {\n\t\tif (!IsDataDescriptor(desc)) {\n\t\t\t// ES3 does not support getters/setters\n\t\t\treturn false;\n\t\t}\n\t\tif (!desc['[[Configurable]]'] || !desc['[[Writable]]']) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// fallback for ES3\n\t\tif (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) {\n\t\t\t// a non-enumerable existing property\n\t\t\treturn false;\n\t\t}\n\n\t\t// property does not exist at all, or exists but is enumerable\n\t\tvar V = desc['[[Value]]'];\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tO[P] = V; // will use [[Define]]\n\t\treturn SameValue(O[P], V);\n\t}\n\tif (\n\t\thasArrayLengthDefineBug\n\t\t&& P === 'length'\n\t\t&& '[[Value]]' in desc\n\t\t&& isArray(O)\n\t\t&& O.length !== desc['[[Value]]']\n\t) {\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tO.length = desc['[[Value]]'];\n\t\treturn O.length === desc['[[Value]]'];\n\t}\n\n\t$defineProperty(O, P, FromPropertyDescriptor(desc));\n\treturn true;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $Array = GetIntrinsic('%Array%');\n\n// eslint-disable-next-line global-require\nvar toStr = !$Array.isArray && require('call-bind/callBound')('Object.prototype.toString');\n\nmodule.exports = $Array.isArray || function IsArray(argument) {\n\treturn toStr(argument) === '[object Array]';\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\n\nvar has = require('has');\nvar isInteger = require('./isInteger');\n\nvar isMatchRecord = require('./isMatchRecord');\n\nvar predicates = {\n\t// https://262.ecma-international.org/6.0/#sec-property-descriptor-specification-type\n\t'Property Descriptor': function isPropertyDescriptor(Desc) {\n\t\tvar allowed = {\n\t\t\t'[[Configurable]]': true,\n\t\t\t'[[Enumerable]]': true,\n\t\t\t'[[Get]]': true,\n\t\t\t'[[Set]]': true,\n\t\t\t'[[Value]]': true,\n\t\t\t'[[Writable]]': true\n\t\t};\n\n\t\tif (!Desc) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (var key in Desc) { // eslint-disable-line\n\t\t\tif (has(Desc, key) && !allowed[key]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tvar isData = has(Desc, '[[Value]]');\n\t\tvar IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]');\n\t\tif (isData && IsAccessor) {\n\t\t\tthrow new $TypeError('Property Descriptors may not be both accessor and data descriptors');\n\t\t}\n\t\treturn true;\n\t},\n\t// https://262.ecma-international.org/13.0/#sec-match-records\n\t'Match Record': isMatchRecord,\n\t'Iterator Record': function isIteratorRecord(value) {\n\t\treturn has(value, '[[Iterator]]') && has(value, '[[NextMethod]]') && has(value, '[[Done]]');\n\t},\n\t'PromiseCapability Record': function isPromiseCapabilityRecord(value) {\n\t\treturn !!value\n\t\t\t&& has(value, '[[Resolve]]')\n\t\t\t&& typeof value['[[Resolve]]'] === 'function'\n\t\t\t&& has(value, '[[Reject]]')\n\t\t\t&& typeof value['[[Reject]]'] === 'function'\n\t\t\t&& has(value, '[[Promise]]')\n\t\t\t&& value['[[Promise]]']\n\t\t\t&& typeof value['[[Promise]]'].then === 'function';\n\t},\n\t'AsyncGeneratorRequest Record': function isAsyncGeneratorRequestRecord(value) {\n\t\treturn !!value\n\t\t\t&& has(value, '[[Completion]]') // TODO: confirm is a completion record\n\t\t\t&& has(value, '[[Capability]]')\n\t\t\t&& predicates['PromiseCapability Record'](value['[[Capability]]']);\n\t},\n\t'RegExp Record': function isRegExpRecord(value) {\n\t\treturn value\n\t\t\t&& has(value, '[[IgnoreCase]]')\n\t\t\t&& typeof value['[[IgnoreCase]]'] === 'boolean'\n\t\t\t&& has(value, '[[Multiline]]')\n\t\t\t&& typeof value['[[Multiline]]'] === 'boolean'\n\t\t\t&& has(value, '[[DotAll]]')\n\t\t\t&& typeof value['[[DotAll]]'] === 'boolean'\n\t\t\t&& has(value, '[[Unicode]]')\n\t\t\t&& typeof value['[[Unicode]]'] === 'boolean'\n\t\t\t&& has(value, '[[CapturingGroupsCount]]')\n\t\t\t&& typeof value['[[CapturingGroupsCount]]'] === 'number'\n\t\t\t&& isInteger(value['[[CapturingGroupsCount]]'])\n\t\t\t&& value['[[CapturingGroupsCount]]'] >= 0;\n\t}\n};\n\nmodule.exports = function assertRecord(Type, recordType, argumentName, value) {\n\tvar predicate = predicates[recordType];\n\tif (typeof predicate !== 'function') {\n\t\tthrow new $SyntaxError('unknown record type: ' + recordType);\n\t}\n\tif (Type(value) !== 'Object' || !predicate(value)) {\n\t\tthrow new $TypeError(argumentName + ' must be a ' + recordType);\n\t}\n};\n","'use strict';\n\nmodule.exports = function forEach(array, callback) {\n\tfor (var i = 0; i < array.length; i += 1) {\n\t\tcallback(array[i], i, array); // eslint-disable-line callback-return\n\t}\n};\n","'use strict';\n\nmodule.exports = function fromPropertyDescriptor(Desc) {\n\tif (typeof Desc === 'undefined') {\n\t\treturn Desc;\n\t}\n\tvar obj = {};\n\tif ('[[Value]]' in Desc) {\n\t\tobj.value = Desc['[[Value]]'];\n\t}\n\tif ('[[Writable]]' in Desc) {\n\t\tobj.writable = !!Desc['[[Writable]]'];\n\t}\n\tif ('[[Get]]' in Desc) {\n\t\tobj.get = Desc['[[Get]]'];\n\t}\n\tif ('[[Set]]' in Desc) {\n\t\tobj.set = Desc['[[Set]]'];\n\t}\n\tif ('[[Enumerable]]' in Desc) {\n\t\tobj.enumerable = !!Desc['[[Enumerable]]'];\n\t}\n\tif ('[[Configurable]]' in Desc) {\n\t\tobj.configurable = !!Desc['[[Configurable]]'];\n\t}\n\treturn obj;\n};\n","'use strict';\n\nvar $isNaN = require('./isNaN');\n\nmodule.exports = function (x) { return (typeof x === 'number' || typeof x === 'bigint') && !$isNaN(x) && x !== Infinity && x !== -Infinity; };\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $abs = GetIntrinsic('%Math.abs%');\nvar $floor = GetIntrinsic('%Math.floor%');\n\nvar $isNaN = require('./isNaN');\nvar $isFinite = require('./isFinite');\n\nmodule.exports = function isInteger(argument) {\n\tif (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {\n\t\treturn false;\n\t}\n\tvar absValue = $abs(argument);\n\treturn $floor(absValue) === absValue;\n};\n\n","'use strict';\n\nmodule.exports = function isLeadingSurrogate(charCode) {\n\treturn typeof charCode === 'number' && charCode >= 0xD800 && charCode <= 0xDBFF;\n};\n","'use strict';\n\nvar has = require('has');\n\n// https://262.ecma-international.org/13.0/#sec-match-records\n\nmodule.exports = function isMatchRecord(record) {\n\treturn (\n\t\thas(record, '[[StartIndex]]')\n && has(record, '[[EndIndex]]')\n && record['[[StartIndex]]'] >= 0\n && record['[[EndIndex]]'] >= record['[[StartIndex]]']\n && String(parseInt(record['[[StartIndex]]'], 10)) === String(record['[[StartIndex]]'])\n && String(parseInt(record['[[EndIndex]]'], 10)) === String(record['[[EndIndex]]'])\n\t);\n};\n","'use strict';\n\nmodule.exports = Number.isNaN || function isNaN(a) {\n\treturn a !== a;\n};\n","'use strict';\n\nmodule.exports = function isPrimitive(value) {\n\treturn value === null || (typeof value !== 'function' && typeof value !== 'object');\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar has = require('has');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nmodule.exports = function IsPropertyDescriptor(ES, Desc) {\n\tif (ES.Type(Desc) !== 'Object') {\n\t\treturn false;\n\t}\n\tvar allowed = {\n\t\t'[[Configurable]]': true,\n\t\t'[[Enumerable]]': true,\n\t\t'[[Get]]': true,\n\t\t'[[Set]]': true,\n\t\t'[[Value]]': true,\n\t\t'[[Writable]]': true\n\t};\n\n\tfor (var key in Desc) { // eslint-disable-line no-restricted-syntax\n\t\tif (has(Desc, key) && !allowed[key]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tif (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) {\n\t\tthrow new $TypeError('Property Descriptors may not be both accessor and data descriptors');\n\t}\n\treturn true;\n};\n","'use strict';\n\nmodule.exports = function isTrailingSurrogate(charCode) {\n\treturn typeof charCode === 'number' && charCode >= 0xDC00 && charCode <= 0xDFFF;\n};\n","'use strict';\n\nmodule.exports = Number.MAX_SAFE_INTEGER || 9007199254740991; // Math.pow(2, 53) - 1;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","export class ReflowableListenerAdapter {\n constructor(gesturesBridge, selectionListenerBridge) {\n this.gesturesBridge = gesturesBridge;\n this.selectionListenerBridge = selectionListenerBridge;\n }\n onTap(event) {\n const tapEvent = {\n x: (event.clientX - visualViewport.offsetLeft) * visualViewport.scale,\n y: (event.clientY - visualViewport.offsetTop) * visualViewport.scale,\n };\n const stringEvent = JSON.stringify(tapEvent);\n this.gesturesBridge.onTap(stringEvent);\n }\n onLinkActivated(href, outerHtml) {\n this.gesturesBridge.onLinkActivated(href, outerHtml);\n }\n onDecorationActivated(event) {\n const offset = {\n x: (event.event.clientX - visualViewport.offsetLeft) *\n visualViewport.scale,\n y: (event.event.clientY - visualViewport.offsetTop) *\n visualViewport.scale,\n };\n const stringOffset = JSON.stringify(offset);\n const stringRect = JSON.stringify(event.rect);\n this.gesturesBridge.onDecorationActivated(event.id, event.group, stringRect, stringOffset);\n }\n onSelectionStart() {\n this.selectionListenerBridge.onSelectionStart();\n }\n onSelectionEnd() {\n this.selectionListenerBridge.onSelectionEnd();\n }\n}\nexport class FixedListenerAdapter {\n constructor(window, gesturesApi, documentApi) {\n this.window = window;\n this.gesturesApi = gesturesApi;\n this.documentApi = documentApi;\n this.resizeObserverAdded = false;\n this.documentLoadedFired = false;\n }\n onTap(event) {\n this.gesturesApi.onTap(JSON.stringify(event.offset));\n }\n onLinkActivated(href, outerHtml) {\n this.gesturesApi.onLinkActivated(href, outerHtml);\n }\n onDecorationActivated(event) {\n const stringOffset = JSON.stringify(event.offset);\n const stringRect = JSON.stringify(event.rect);\n this.gesturesApi.onDecorationActivated(event.id, event.group, stringRect, stringOffset);\n }\n onLayout() {\n if (!this.resizeObserverAdded) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const observer = new ResizeObserver(() => {\n requestAnimationFrame(() => {\n const scrollingElement = this.window.document.scrollingElement;\n if (!this.documentLoadedFired &&\n (scrollingElement == null ||\n scrollingElement.scrollHeight > 0 ||\n scrollingElement.scrollWidth > 0)) {\n this.documentApi.onDocumentLoadedAndSized();\n this.documentLoadedFired = true;\n }\n else {\n this.documentApi.onDocumentResized();\n }\n });\n });\n observer.observe(this.window.document.body);\n }\n this.resizeObserverAdded = true;\n }\n}\n","/** Manages a fixed layout resource embedded in an iframe. */\nexport class PageManager {\n constructor(window, iframe, listener) {\n this.margins = { top: 0, right: 0, bottom: 0, left: 0 };\n if (!iframe.contentWindow) {\n throw Error(\"Iframe argument must have been attached to DOM.\");\n }\n this.listener = listener;\n this.iframe = iframe;\n }\n setMessagePort(messagePort) {\n messagePort.onmessage = (message) => {\n this.onMessageFromIframe(message);\n };\n }\n show() {\n this.iframe.style.display = \"unset\";\n }\n hide() {\n this.iframe.style.display = \"none\";\n }\n /** Sets page margins. */\n setMargins(margins) {\n if (this.margins == margins) {\n return;\n }\n this.iframe.style.marginTop = this.margins.top + \"px\";\n this.iframe.style.marginLeft = this.margins.left + \"px\";\n this.iframe.style.marginBottom = this.margins.bottom + \"px\";\n this.iframe.style.marginRight = this.margins.right + \"px\";\n }\n /** Loads page content. */\n loadPage(url) {\n this.iframe.src = url;\n }\n /** Sets the size of this page without content. */\n setPlaceholder(size) {\n this.iframe.style.visibility = \"hidden\";\n this.iframe.style.width = size.width + \"px\";\n this.iframe.style.height = size.height + \"px\";\n this.size = size;\n }\n onMessageFromIframe(event) {\n const message = event.data;\n switch (message.kind) {\n case \"contentSize\":\n return this.onContentSizeAvailable(message.size);\n case \"tap\":\n return this.listener.onTap(message.event);\n case \"linkActivated\":\n return this.onLinkActivated(message);\n case \"decorationActivated\":\n return this.listener.onDecorationActivated(message.event);\n }\n }\n onLinkActivated(message) {\n try {\n const url = new URL(message.href, this.iframe.src);\n this.listener.onLinkActivated(url.toString(), message.outerHtml);\n }\n catch (_a) {\n // Do nothing if url is not valid.\n }\n }\n onContentSizeAvailable(size) {\n if (!size) {\n //FIXME: handle edge case\n return;\n }\n this.iframe.style.width = size.width + \"px\";\n this.iframe.style.height = size.height + \"px\";\n this.size = size;\n this.listener.onIframeLoaded();\n }\n}\n","export class ViewportStringBuilder {\n setInitialScale(scale) {\n this.initialScale = scale;\n return this;\n }\n setMinimumScale(scale) {\n this.minimumScale = scale;\n return this;\n }\n setWidth(width) {\n this.width = width;\n return this;\n }\n setHeight(height) {\n this.height = height;\n return this;\n }\n build() {\n const components = [];\n if (this.initialScale) {\n components.push(\"initial-scale=\" + this.initialScale);\n }\n if (this.minimumScale) {\n components.push(\"minimum-scale=\" + this.minimumScale);\n }\n if (this.width) {\n components.push(\"width=\" + this.width);\n }\n if (this.height) {\n components.push(\"height=\" + this.height);\n }\n return components.join(\", \");\n }\n}\nexport function parseViewportString(viewportString) {\n const regex = /(\\w+) *= *([^\\s,]+)/g;\n const properties = new Map();\n let match;\n while ((match = regex.exec(viewportString))) {\n if (match != null) {\n properties.set(match[1], match[2]);\n }\n }\n const width = parseFloat(properties.get(\"width\"));\n const height = parseFloat(properties.get(\"height\"));\n if (width && height) {\n return { width, height };\n }\n else {\n return undefined;\n }\n}\n","export function offsetToParentCoordinates(offset, iframeRect) {\n return {\n x: (offset.x + iframeRect.left - visualViewport.offsetLeft) *\n visualViewport.scale,\n y: (offset.y + iframeRect.top - visualViewport.offsetTop) *\n visualViewport.scale,\n };\n}\nexport function rectToParentCoordinates(rect, iframeRect) {\n const topLeft = { x: rect.left, y: rect.top };\n const bottomRight = { x: rect.right, y: rect.bottom };\n const shiftedTopLeft = offsetToParentCoordinates(topLeft, iframeRect);\n const shiftedBottomRight = offsetToParentCoordinates(bottomRight, iframeRect);\n return {\n left: shiftedTopLeft.x,\n top: shiftedTopLeft.y,\n right: shiftedBottomRight.x,\n bottom: shiftedBottomRight.y,\n width: shiftedBottomRight.x - shiftedTopLeft.x,\n height: shiftedBottomRight.y - shiftedTopLeft.y,\n };\n}\n","export class GesturesDetector {\n constructor(window, listener, decorationManager) {\n this.window = window;\n this.listener = listener;\n this.decorationManager = decorationManager;\n document.addEventListener(\"click\", (event) => {\n this.onClick(event);\n }, false);\n }\n onClick(event) {\n if (event.defaultPrevented) {\n return;\n }\n let nearestElement;\n if (event.target instanceof HTMLElement) {\n nearestElement = this.nearestInteractiveElement(event.target);\n }\n else {\n nearestElement = null;\n }\n if (nearestElement) {\n if (nearestElement instanceof HTMLAnchorElement) {\n this.listener.onLinkActivated(nearestElement.href, nearestElement.outerHTML);\n event.stopPropagation();\n event.preventDefault();\n }\n return;\n }\n let decorationActivatedEvent;\n if (this.decorationManager) {\n decorationActivatedEvent =\n this.decorationManager.handleDecorationClickEvent(event);\n }\n else {\n decorationActivatedEvent = null;\n }\n if (decorationActivatedEvent) {\n this.listener.onDecorationActivated(decorationActivatedEvent);\n }\n else {\n this.listener.onTap(event);\n }\n // event.stopPropagation()\n // event.preventDefault()\n }\n // See. https://github.com/JayPanoz/architecture/tree/touch-handling/misc/touch-handling\n nearestInteractiveElement(element) {\n if (element == null) {\n return null;\n }\n const interactiveTags = [\n \"a\",\n \"audio\",\n \"button\",\n \"canvas\",\n \"details\",\n \"input\",\n \"label\",\n \"option\",\n \"select\",\n \"submit\",\n \"textarea\",\n \"video\",\n ];\n if (interactiveTags.indexOf(element.nodeName.toLowerCase()) != -1) {\n return element;\n }\n // Checks whether the element is editable by the user.\n if (element.hasAttribute(\"contenteditable\") &&\n element.getAttribute(\"contenteditable\").toLowerCase() != \"false\") {\n return element;\n }\n // Checks parents recursively because the touch might be for example on an inside a .\n if (element.parentElement) {\n return this.nearestInteractiveElement(element.parentElement);\n }\n return null;\n }\n}\n","import { computeScale } from \"./fit\";\nimport { PageManager } from \"./page-manager\";\nimport { ViewportStringBuilder } from \"../util/viewport\";\nimport { offsetToParentCoordinates } from \"../common/geometry\";\nimport { rectToParentCoordinates } from \"../common/geometry\";\nimport { GesturesDetector } from \"../common/gestures\";\nexport class SingleAreaManager {\n constructor(window, iframe, metaViewport, listener) {\n this.fit = \"contain\";\n this.insets = { top: 0, right: 0, bottom: 0, left: 0 };\n this.scale = 1;\n this.listener = listener;\n const wrapperGesturesListener = {\n onTap: (event) => {\n const offset = {\n x: (event.clientX - visualViewport.offsetLeft) *\n visualViewport.scale,\n y: (event.clientY - visualViewport.offsetTop) * visualViewport.scale,\n };\n listener.onTap({ offset: offset });\n },\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onLinkActivated: (_) => {\n throw Error(\"No interactive element in the root document.\");\n },\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onDecorationActivated: (_) => {\n throw Error(\"No decoration in the root document.\");\n },\n };\n new GesturesDetector(window, wrapperGesturesListener);\n this.metaViewport = metaViewport;\n const pageListener = {\n onIframeLoaded: () => {\n this.onIframeLoaded();\n },\n onTap: (event) => {\n const boundingRect = iframe.getBoundingClientRect();\n const shiftedOffset = offsetToParentCoordinates(event.offset, boundingRect);\n listener.onTap({ offset: shiftedOffset });\n },\n onLinkActivated: (href, outerHtml) => {\n listener.onLinkActivated(href, outerHtml);\n },\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onDecorationActivated: (event) => {\n const boundingRect = iframe.getBoundingClientRect();\n const shiftedOffset = offsetToParentCoordinates(event.offset, boundingRect);\n const shiftedRect = rectToParentCoordinates(event.rect, boundingRect);\n const shiftedEvent = {\n id: event.id,\n group: event.group,\n rect: shiftedRect,\n offset: shiftedOffset,\n };\n listener.onDecorationActivated(shiftedEvent);\n },\n };\n this.page = new PageManager(window, iframe, pageListener);\n }\n setMessagePort(messagePort) {\n this.page.setMessagePort(messagePort);\n }\n setViewport(viewport, insets) {\n if (this.viewport == viewport && this.insets == insets) {\n return;\n }\n this.viewport = viewport;\n this.insets = insets;\n this.layout();\n }\n setFit(fit) {\n if (this.fit == fit) {\n return;\n }\n this.fit = fit;\n this.layout();\n }\n loadResource(url) {\n this.page.hide();\n this.page.loadPage(url);\n }\n onIframeLoaded() {\n if (!this.page.size) {\n // FIXME: raise error\n }\n else {\n this.layout();\n }\n }\n layout() {\n if (!this.page.size || !this.viewport) {\n return;\n }\n const margins = {\n top: this.insets.top,\n right: this.insets.right,\n bottom: this.insets.bottom,\n left: this.insets.left,\n };\n this.page.setMargins(margins);\n const safeDrawingSize = {\n width: this.viewport.width - this.insets.left - this.insets.right,\n height: this.viewport.height - this.insets.top - this.insets.bottom,\n };\n const scale = computeScale(this.fit, this.page.size, safeDrawingSize);\n this.metaViewport.content = new ViewportStringBuilder()\n .setInitialScale(scale)\n .setMinimumScale(scale)\n .setWidth(this.page.size.width)\n .setHeight(this.page.size.height)\n .build();\n this.scale = scale;\n this.page.show();\n this.listener.onLayout();\n }\n}\n","export function computeScale(fit, content, container) {\n switch (fit) {\n case \"contain\":\n return fitContain(content, container);\n case \"width\":\n return fitWidth(content, container);\n case \"height\":\n return fitHeight(content, container);\n }\n}\nfunction fitContain(content, container) {\n const widthRatio = container.width / content.width;\n const heightRatio = container.height / content.height;\n return Math.min(widthRatio, heightRatio);\n}\nfunction fitWidth(content, container) {\n return container.width / content.width;\n}\nfunction fitHeight(content, container) {\n return container.height / content.height;\n}\n","export class DecorationWrapperParentSide {\n setMessagePort(messagePort) {\n this.messagePort = messagePort;\n }\n registerTemplates(templates) {\n this.send({ kind: \"registerTemplates\", templates });\n }\n addDecoration(decoration, group) {\n this.send({ kind: \"addDecoration\", decoration, group });\n }\n removeDecoration(id, group) {\n this.send({ kind: \"removeDecoration\", id, group });\n }\n send(message) {\n var _a;\n (_a = this.messagePort) === null || _a === void 0 ? void 0 : _a.postMessage(message);\n }\n}\nexport class DecorationWrapperIframeSide {\n constructor(messagePort, decorationManager) {\n this.decorationManager = decorationManager;\n messagePort.onmessage = (message) => {\n this.onCommand(message.data);\n };\n }\n onCommand(command) {\n switch (command.kind) {\n case \"registerTemplates\":\n return this.registerTemplates(command.templates);\n case \"addDecoration\":\n return this.addDecoration(command.decoration, command.group);\n case \"removeDecoration\":\n return this.removeDecoration(command.id, command.group);\n }\n }\n registerTemplates(templates) {\n this.decorationManager.registerTemplates(templates);\n }\n addDecoration(decoration, group) {\n this.decorationManager.addDecoration(decoration, group);\n }\n removeDecoration(id, group) {\n this.decorationManager.removeDecoration(id, group);\n }\n}\n","/**\n * From which direction to evaluate strings or nodes: from the start of a string\n * or range seeking Forwards, or from the end seeking Backwards.\n */\nvar TrimDirection;\n(function (TrimDirection) {\n TrimDirection[TrimDirection[\"Forwards\"] = 1] = \"Forwards\";\n TrimDirection[TrimDirection[\"Backwards\"] = 2] = \"Backwards\";\n})(TrimDirection || (TrimDirection = {}));\n/**\n * Return the offset of the nearest non-whitespace character to `baseOffset`\n * within the string `text`, looking in the `direction` indicated. Return -1 if\n * no non-whitespace character exists between `baseOffset` (inclusive) and the\n * terminus of the string (start or end depending on `direction`).\n */\nfunction closestNonSpaceInString(text, baseOffset, direction) {\n const nextChar = direction === TrimDirection.Forwards ? baseOffset : baseOffset - 1;\n if (text.charAt(nextChar).trim() !== \"\") {\n // baseOffset is already valid: it points at a non-whitespace character\n return baseOffset;\n }\n let availableChars;\n let availableNonWhitespaceChars;\n if (direction === TrimDirection.Backwards) {\n availableChars = text.substring(0, baseOffset);\n availableNonWhitespaceChars = availableChars.trimEnd();\n }\n else {\n availableChars = text.substring(baseOffset);\n availableNonWhitespaceChars = availableChars.trimStart();\n }\n if (!availableNonWhitespaceChars.length) {\n return -1;\n }\n const offsetDelta = availableChars.length - availableNonWhitespaceChars.length;\n return direction === TrimDirection.Backwards\n ? baseOffset - offsetDelta\n : baseOffset + offsetDelta;\n}\n/**\n * Calculate a new Range start position (TrimDirection.Forwards) or end position\n * (Backwards) for `range` that represents the nearest non-whitespace character,\n * moving into the `range` away from the relevant initial boundary node towards\n * the terminating boundary node.\n *\n * @throws {RangeError} If no text node with non-whitespace characters found\n */\nfunction closestNonSpaceInRange(range, direction) {\n const nodeIter = range.commonAncestorContainer.ownerDocument.createNodeIterator(range.commonAncestorContainer, NodeFilter.SHOW_TEXT);\n const initialBoundaryNode = direction === TrimDirection.Forwards\n ? range.startContainer\n : range.endContainer;\n const terminalBoundaryNode = direction === TrimDirection.Forwards\n ? range.endContainer\n : range.startContainer;\n let currentNode = nodeIter.nextNode();\n // Advance the NodeIterator to the `initialBoundaryNode`\n while (currentNode && currentNode !== initialBoundaryNode) {\n currentNode = nodeIter.nextNode();\n }\n if (direction === TrimDirection.Backwards) {\n // Reverse the NodeIterator direction. This will return the same node\n // as the previous `nextNode()` call (initial boundary node).\n currentNode = nodeIter.previousNode();\n }\n let trimmedOffset = -1;\n const advance = () => {\n currentNode =\n direction === TrimDirection.Forwards\n ? nodeIter.nextNode()\n : nodeIter.previousNode();\n if (currentNode) {\n const nodeText = currentNode.textContent;\n const baseOffset = direction === TrimDirection.Forwards ? 0 : nodeText.length;\n trimmedOffset = closestNonSpaceInString(nodeText, baseOffset, direction);\n }\n };\n while (currentNode &&\n trimmedOffset === -1 &&\n currentNode !== terminalBoundaryNode) {\n advance();\n }\n if (currentNode && trimmedOffset >= 0) {\n return { node: currentNode, offset: trimmedOffset };\n }\n /* istanbul ignore next */\n throw new RangeError(\"No text nodes with non-whitespace text found in range\");\n}\n/**\n * Return a new DOM Range that adjusts the start and end positions of `range` as\n * needed such that:\n *\n * - `startContainer` and `endContainer` text nodes both contain at least one\n * non-whitespace character within the Range's text content\n * - `startOffset` and `endOffset` both reference non-whitespace characters,\n * with `startOffset` immediately before the first non-whitespace character\n * and `endOffset` immediately after the last\n *\n * Whitespace characters are those that are removed by `String.prototype.trim()`\n *\n * @param range - A DOM Range that whose `startContainer` and `endContainer` are\n * both text nodes, and which contains at least one non-whitespace character.\n * @throws {RangeError}\n */\nexport function trimRange(range) {\n if (!range.toString().trim().length) {\n throw new RangeError(\"Range contains no non-whitespace text\");\n }\n if (range.startContainer.nodeType !== Node.TEXT_NODE) {\n throw new RangeError(\"Range startContainer is not a text node\");\n }\n if (range.endContainer.nodeType !== Node.TEXT_NODE) {\n throw new RangeError(\"Range endContainer is not a text node\");\n }\n const trimmedRange = range.cloneRange();\n let startTrimmed = false;\n let endTrimmed = false;\n const trimmedOffsets = {\n start: closestNonSpaceInString(range.startContainer.textContent, range.startOffset, TrimDirection.Forwards),\n end: closestNonSpaceInString(range.endContainer.textContent, range.endOffset, TrimDirection.Backwards),\n };\n if (trimmedOffsets.start >= 0) {\n trimmedRange.setStart(range.startContainer, trimmedOffsets.start);\n startTrimmed = true;\n }\n // Note: An offset of 0 is invalid for an end offset, as no text in the\n // node would be included in the range.\n if (trimmedOffsets.end > 0) {\n trimmedRange.setEnd(range.endContainer, trimmedOffsets.end);\n endTrimmed = true;\n }\n if (startTrimmed && endTrimmed) {\n return trimmedRange;\n }\n if (!startTrimmed) {\n // There are no (non-whitespace) characters between `startOffset` and the\n // end of the `startContainer` node.\n const { node, offset } = closestNonSpaceInRange(trimmedRange, TrimDirection.Forwards);\n if (node && offset >= 0) {\n trimmedRange.setStart(node, offset);\n }\n }\n if (!endTrimmed) {\n // There are no (non-whitespace) characters between the start of the Range's\n // `endContainer` text content and the `endOffset`.\n const { node, offset } = closestNonSpaceInRange(trimmedRange, TrimDirection.Backwards);\n if (node && offset > 0) {\n trimmedRange.setEnd(node, offset);\n }\n }\n return trimmedRange;\n}\n","import { trimRange } from \"./trim-range\";\n/**\n * Return the combined length of text nodes contained in `node`.\n */\nfunction nodeTextLength(node) {\n var _a, _b;\n switch (node.nodeType) {\n case Node.ELEMENT_NODE:\n case Node.TEXT_NODE:\n // nb. `textContent` excludes text in comments and processing instructions\n // when called on a parent element, so we don't need to subtract that here.\n return (_b = (_a = node.textContent) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;\n default:\n return 0;\n }\n}\n/**\n * Return the total length of the text of all previous siblings of `node`.\n */\nfunction previousSiblingsTextLength(node) {\n let sibling = node.previousSibling;\n let length = 0;\n while (sibling) {\n length += nodeTextLength(sibling);\n sibling = sibling.previousSibling;\n }\n return length;\n}\n/**\n * Resolve one or more character offsets within an element to (text node,\n * position) pairs.\n *\n * @param element\n * @param offsets - Offsets, which must be sorted in ascending order\n * @throws {RangeError}\n */\nfunction resolveOffsets(element, ...offsets) {\n let nextOffset = offsets.shift();\n const nodeIter = element.ownerDocument.createNodeIterator(element, NodeFilter.SHOW_TEXT);\n const results = [];\n let currentNode = nodeIter.nextNode();\n let textNode;\n let length = 0;\n // Find the text node containing the `nextOffset`th character from the start\n // of `element`.\n while (nextOffset !== undefined && currentNode) {\n textNode = currentNode;\n if (length + textNode.data.length > nextOffset) {\n results.push({ node: textNode, offset: nextOffset - length });\n nextOffset = offsets.shift();\n }\n else {\n currentNode = nodeIter.nextNode();\n length += textNode.data.length;\n }\n }\n // Boundary case.\n while (nextOffset !== undefined && textNode && length === nextOffset) {\n results.push({ node: textNode, offset: textNode.data.length });\n nextOffset = offsets.shift();\n }\n if (nextOffset !== undefined) {\n throw new RangeError(\"Offset exceeds text length\");\n }\n return results;\n}\n/**\n * When resolving a TextPosition, specifies the direction to search for the\n * nearest text node if `offset` is `0` and the element has no text.\n */\nexport var ResolveDirection;\n(function (ResolveDirection) {\n ResolveDirection[ResolveDirection[\"FORWARDS\"] = 1] = \"FORWARDS\";\n ResolveDirection[ResolveDirection[\"BACKWARDS\"] = 2] = \"BACKWARDS\";\n})(ResolveDirection || (ResolveDirection = {}));\n/**\n * Represents an offset within the text content of an element.\n *\n * This position can be resolved to a specific descendant node in the current\n * DOM subtree of the element using the `resolve` method.\n */\nexport class TextPosition {\n constructor(element, offset) {\n if (offset < 0) {\n throw new Error(\"Offset is invalid\");\n }\n /** Element that `offset` is relative to. */\n this.element = element;\n /** Character offset from the start of the element's `textContent`. */\n this.offset = offset;\n }\n /**\n * Return a copy of this position with offset relative to a given ancestor\n * element.\n *\n * @param parent - Ancestor of `this.element`\n */\n relativeTo(parent) {\n if (!parent.contains(this.element)) {\n throw new Error(\"Parent is not an ancestor of current element\");\n }\n let el = this.element;\n let offset = this.offset;\n while (el !== parent) {\n offset += previousSiblingsTextLength(el);\n el = el.parentElement;\n }\n return new TextPosition(el, offset);\n }\n /**\n * Resolve the position to a specific text node and offset within that node.\n *\n * Throws if `this.offset` exceeds the length of the element's text. In the\n * case where the element has no text and `this.offset` is 0, the `direction`\n * option determines what happens.\n *\n * Offsets at the boundary between two nodes are resolved to the start of the\n * node that begins at the boundary.\n *\n * @param options.direction - Specifies in which direction to search for the\n * nearest text node if `this.offset` is `0` and\n * `this.element` has no text. If not specified an\n * error is thrown.\n *\n * @throws {RangeError}\n */\n resolve(options = {}) {\n try {\n return resolveOffsets(this.element, this.offset)[0];\n }\n catch (err) {\n if (this.offset === 0 && options.direction !== undefined) {\n const tw = document.createTreeWalker(this.element.getRootNode(), NodeFilter.SHOW_TEXT);\n tw.currentNode = this.element;\n const forwards = options.direction === ResolveDirection.FORWARDS;\n const text = forwards\n ? tw.nextNode()\n : tw.previousNode();\n if (!text) {\n throw err;\n }\n return { node: text, offset: forwards ? 0 : text.data.length };\n }\n else {\n throw err;\n }\n }\n }\n /**\n * Construct a `TextPosition` that refers to the `offset`th character within\n * `node`.\n */\n static fromCharOffset(node, offset) {\n switch (node.nodeType) {\n case Node.TEXT_NODE:\n return TextPosition.fromPoint(node, offset);\n case Node.ELEMENT_NODE:\n return new TextPosition(node, offset);\n default:\n throw new Error(\"Node is not an element or text node\");\n }\n }\n /**\n * Construct a `TextPosition` representing the range start or end point (node, offset).\n *\n * @param node\n * @param offset - Offset within the node\n */\n static fromPoint(node, offset) {\n switch (node.nodeType) {\n case Node.TEXT_NODE: {\n if (offset < 0 || offset > node.data.length) {\n throw new Error(\"Text node offset is out of range\");\n }\n if (!node.parentElement) {\n throw new Error(\"Text node has no parent\");\n }\n // Get the offset from the start of the parent element.\n const textOffset = previousSiblingsTextLength(node) + offset;\n return new TextPosition(node.parentElement, textOffset);\n }\n case Node.ELEMENT_NODE: {\n if (offset < 0 || offset > node.childNodes.length) {\n throw new Error(\"Child node offset is out of range\");\n }\n // Get the text length before the `offset`th child of element.\n let textOffset = 0;\n for (let i = 0; i < offset; i++) {\n textOffset += nodeTextLength(node.childNodes[i]);\n }\n return new TextPosition(node, textOffset);\n }\n default:\n throw new Error(\"Point is not in an element or text node\");\n }\n }\n}\n/**\n * Represents a region of a document as a (start, end) pair of `TextPosition` points.\n *\n * Representing a range in this way allows for changes in the DOM content of the\n * range which don't affect its text content, without affecting the text content\n * of the range itself.\n */\nexport class TextRange {\n constructor(start, end) {\n this.start = start;\n this.end = end;\n }\n /**\n * Create a new TextRange whose `start` and `end` are computed relative to\n * `element`. `element` must be an ancestor of both `start.element` and\n * `end.element`.\n */\n relativeTo(element) {\n return new TextRange(this.start.relativeTo(element), this.end.relativeTo(element));\n }\n /**\n * Resolve this TextRange to a (DOM) Range.\n *\n * The resulting DOM Range will always start and end in a `Text` node.\n * Hence `TextRange.fromRange(range).toRange()` can be used to \"shrink\" a\n * range to the text it contains.\n *\n * May throw if the `start` or `end` positions cannot be resolved to a range.\n */\n toRange() {\n let start;\n let end;\n if (this.start.element === this.end.element &&\n this.start.offset <= this.end.offset) {\n // Fast path for start and end points in same element.\n [start, end] = resolveOffsets(this.start.element, this.start.offset, this.end.offset);\n }\n else {\n start = this.start.resolve({\n direction: ResolveDirection.FORWARDS,\n });\n end = this.end.resolve({ direction: ResolveDirection.BACKWARDS });\n }\n const range = new Range();\n range.setStart(start.node, start.offset);\n range.setEnd(end.node, end.offset);\n return range;\n }\n /**\n * Create a TextRange from a (DOM) Range\n */\n static fromRange(range) {\n const start = TextPosition.fromPoint(range.startContainer, range.startOffset);\n const end = TextPosition.fromPoint(range.endContainer, range.endOffset);\n return new TextRange(start, end);\n }\n /**\n * Create a TextRange representing the `start`th to `end`th characters in\n * `root`\n */\n static fromOffsets(root, start, end) {\n return new TextRange(new TextPosition(root, start), new TextPosition(root, end));\n }\n /**\n * Return a new Range representing `range` trimmed of any leading or trailing\n * whitespace\n */\n static trimmedRange(range) {\n return trimRange(TextRange.fromRange(range).toRange());\n }\n}\n","//\n// Copyright 2021 Readium Foundation. All rights reserved.\n// Use of this source code is governed by the BSD-style license\n// available in the top-level LICENSE file of the project.\n//\nimport { dezoomRect, domRectToRect } from \"../util/rect\";\nimport { log } from \"../util/log\";\nimport { TextRange } from \"../vendor/hypothesis/annotator/anchoring/text-range\";\n// Polyfill for Android API 26\nimport matchAll from \"string.prototype.matchall\";\nimport { rectToParentCoordinates } from \"./geometry\";\nmatchAll.shim();\nexport class SelectionReporter {\n constructor(window, listener) {\n this.isSelecting = false;\n document.addEventListener(\"selectionchange\", \n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n (event) => {\n var _a;\n const collapsed = (_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.isCollapsed;\n if (collapsed && this.isSelecting) {\n this.isSelecting = false;\n listener.onSelectionEnd();\n }\n else if (!collapsed && !this.isSelecting) {\n this.isSelecting = true;\n listener.onSelectionStart();\n }\n }, false);\n }\n}\nexport function selectionToParentCoordinates(selection, iframe) {\n const boundingRect = iframe.getBoundingClientRect();\n const shiftedRect = rectToParentCoordinates(selection.selectionRect, boundingRect);\n return {\n selectedText: selection === null || selection === void 0 ? void 0 : selection.selectedText,\n selectionRect: shiftedRect,\n textBefore: selection.textBefore,\n textAfter: selection.textAfter,\n };\n}\nexport class SelectionManager {\n constructor(window) {\n this.isSelecting = false;\n //, listener: SelectionListener) {\n this.window = window;\n /*this.listener = listener\n document.addEventListener(\n \"selectionchange\",\n () => {\n const selection = window.getSelection()!\n const collapsed = selection.isCollapsed\n \n if (collapsed && this.isSelecting) {\n this.isSelecting = false\n this.listener.onSelectionEnd()\n } else if (!collapsed && !this.isSelecting) {\n this.isSelecting = true\n this.listener.onSelectionStart()\n }\n },\n false\n )*/\n }\n clearSelection() {\n var _a;\n (_a = this.window.getSelection()) === null || _a === void 0 ? void 0 : _a.removeAllRanges();\n }\n getCurrentSelection() {\n const text = this.getCurrentSelectionText();\n if (!text) {\n return null;\n }\n const rect = this.getSelectionRect();\n return {\n selectedText: text.highlight,\n textBefore: text.before,\n textAfter: text.after,\n selectionRect: rect,\n };\n }\n getSelectionRect() {\n try {\n const selection = this.window.getSelection();\n const range = selection.getRangeAt(0);\n const zoom = this.window.document.body.currentCSSZoom;\n return dezoomRect(domRectToRect(range.getBoundingClientRect()), zoom);\n }\n catch (e) {\n log(e);\n throw e;\n //return null\n }\n }\n getCurrentSelectionText() {\n const selection = this.window.getSelection();\n if (selection.isCollapsed) {\n return undefined;\n }\n const highlight = selection.toString();\n const cleanHighlight = highlight\n .trim()\n .replace(/\\n/g, \" \")\n .replace(/\\s\\s+/g, \" \");\n if (cleanHighlight.length === 0) {\n return undefined;\n }\n if (!selection.anchorNode || !selection.focusNode) {\n return undefined;\n }\n const range = selection.rangeCount === 1\n ? selection.getRangeAt(0)\n : createOrderedRange(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);\n if (!range || range.collapsed) {\n log(\"$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!\");\n return undefined;\n }\n const text = document.body.textContent;\n const textRange = TextRange.fromRange(range).relativeTo(document.body);\n const start = textRange.start.offset;\n const end = textRange.end.offset;\n const snippetLength = 200;\n // Compute the text before the highlight, ignoring the first \"word\", which might be cut.\n let before = text.slice(Math.max(0, start - snippetLength), start);\n const firstWordStart = before.search(/\\P{L}\\p{L}/gu);\n if (firstWordStart !== -1) {\n before = before.slice(firstWordStart + 1);\n }\n // Compute the text after the highlight, ignoring the last \"word\", which might be cut.\n let after = text.slice(end, Math.min(text.length, end + snippetLength));\n const lastWordEnd = Array.from(after.matchAll(/\\p{L}\\P{L}/gu)).pop();\n if (lastWordEnd !== undefined && lastWordEnd.index > 1) {\n after = after.slice(0, lastWordEnd.index + 1);\n }\n return { highlight, before, after };\n }\n}\nfunction createOrderedRange(startNode, startOffset, endNode, endOffset) {\n const range = new Range();\n range.setStart(startNode, startOffset);\n range.setEnd(endNode, endOffset);\n if (!range.collapsed) {\n return range;\n }\n log(\">>> createOrderedRange COLLAPSED ... RANGE REVERSE?\");\n const rangeReverse = new Range();\n rangeReverse.setStart(endNode, endOffset);\n rangeReverse.setEnd(startNode, startOffset);\n if (!rangeReverse.collapsed) {\n log(\">>> createOrderedRange RANGE REVERSE OK.\");\n return range;\n }\n log(\">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!\");\n return undefined;\n}\n/*\nexport function convertRangeInfo(document: Document, rangeInfo) {\n const startElement = document.querySelector(\n rangeInfo.startContainerElementCssSelector\n );\n if (!startElement) {\n log(\"^^^ convertRangeInfo NO START ELEMENT CSS SELECTOR?!\");\n return undefined;\n }\n let startContainer = startElement;\n if (rangeInfo.startContainerChildTextNodeIndex >= 0) {\n if (\n rangeInfo.startContainerChildTextNodeIndex >=\n startElement.childNodes.length\n ) {\n log(\n \"^^^ convertRangeInfo rangeInfo.startContainerChildTextNodeIndex >= startElement.childNodes.length?!\"\n );\n return undefined;\n }\n startContainer =\n startElement.childNodes[rangeInfo.startContainerChildTextNodeIndex];\n if (startContainer.nodeType !== Node.TEXT_NODE) {\n log(\"^^^ convertRangeInfo startContainer.nodeType !== Node.TEXT_NODE?!\");\n return undefined;\n }\n }\n const endElement = document.querySelector(\n rangeInfo.endContainerElementCssSelector\n );\n if (!endElement) {\n log(\"^^^ convertRangeInfo NO END ELEMENT CSS SELECTOR?!\");\n return undefined;\n }\n let endContainer = endElement;\n if (rangeInfo.endContainerChildTextNodeIndex >= 0) {\n if (\n rangeInfo.endContainerChildTextNodeIndex >= endElement.childNodes.length\n ) {\n log(\n \"^^^ convertRangeInfo rangeInfo.endContainerChildTextNodeIndex >= endElement.childNodes.length?!\"\n );\n return undefined;\n }\n endContainer =\n endElement.childNodes[rangeInfo.endContainerChildTextNodeIndex];\n if (endContainer.nodeType !== Node.TEXT_NODE) {\n log(\"^^^ convertRangeInfo endContainer.nodeType !== Node.TEXT_NODE?!\");\n return undefined;\n }\n }\n return createOrderedRange(\n startContainer,\n rangeInfo.startOffset,\n endContainer,\n rangeInfo.endOffset\n );\n}\n\nexport function location2RangeInfo(location) {\n const locations = location.locations;\n const domRange = locations.domRange;\n const start = domRange.start;\n const end = domRange.end;\n\n return {\n endContainerChildTextNodeIndex: end.textNodeIndex,\n endContainerElementCssSelector: end.cssSelector,\n endOffset: end.offset,\n startContainerChildTextNodeIndex: start.textNodeIndex,\n startContainerElementCssSelector: start.cssSelector,\n startOffset: start.offset,\n };\n}\n*/\n","export class SelectionWrapperParentSide {\n constructor(listener) {\n this.selectionListener = listener;\n }\n setMessagePort(messagePort) {\n this.messagePort = messagePort;\n messagePort.onmessage = (message) => {\n this.onFeedback(message.data);\n };\n }\n requestSelection(requestId) {\n this.send({ kind: \"requestSelection\", requestId: requestId });\n }\n clearSelection() {\n this.send({ kind: \"clearSelection\" });\n }\n onFeedback(feedback) {\n switch (feedback.kind) {\n case \"selectionAvailable\":\n return this.onSelectionAvailable(feedback.requestId, feedback.selection);\n }\n }\n onSelectionAvailable(requestId, selection) {\n this.selectionListener.onSelectionAvailable(requestId, selection);\n }\n send(message) {\n var _a;\n (_a = this.messagePort) === null || _a === void 0 ? void 0 : _a.postMessage(message);\n }\n}\nexport class SelectionWrapperIframeSide {\n constructor(messagePort, manager) {\n this.selectionManager = manager;\n this.messagePort = messagePort;\n messagePort.onmessage = (message) => {\n this.onCommand(message.data);\n };\n }\n onCommand(command) {\n switch (command.kind) {\n case \"requestSelection\":\n return this.onRequestSelection(command.requestId);\n case \"clearSelection\":\n return this.onClearSelection();\n }\n }\n onRequestSelection(requestId) {\n const selection = this.selectionManager.getCurrentSelection();\n const feedback = {\n kind: \"selectionAvailable\",\n requestId: requestId,\n selection: selection,\n };\n this.sendFeedback(feedback);\n }\n onClearSelection() {\n this.selectionManager.clearSelection();\n }\n sendFeedback(message) {\n this.messagePort.postMessage(message);\n }\n}\n","//\n// Copyright 2024 Readium Foundation. All rights reserved.\n// Use of this source code is governed by the BSD-style license\n// available in the top-level LICENSE file of the project.\n//\nimport { FixedSingleAreaBridge as FixedSingleAreaBridge } from \"./bridge/fixed-area-bridge\";\nimport { FixedSingleDecorationsBridge } from \"./bridge/all-decoration-bridge\";\nimport { FixedSingleSelectionBridge } from \"./bridge/all-selection-bridge\";\nimport { FixedSingleInitializationBridge, } from \"./bridge/all-initialization-bridge\";\nconst iframe = document.getElementById(\"page\");\nconst metaViewport = document.querySelector(\"meta[name=viewport]\");\nwindow.singleArea = new FixedSingleAreaBridge(window, iframe, metaViewport, window.gestures, window.documentState);\nwindow.singleSelection = new FixedSingleSelectionBridge(iframe, window.singleSelectionListener);\nwindow.singleDecorations = new FixedSingleDecorationsBridge();\nwindow.singleInitialization = new FixedSingleInitializationBridge(window, window.fixedApiState, iframe, window.singleArea, window.singleSelection, window.singleDecorations);\nwindow.fixedApiState.onInitializationApiAvailable();\n","import { DoubleAreaManager } from \"../fixed/double-area-manager\";\nimport { FixedListenerAdapter, } from \"./all-listener-bridge\";\nimport { SingleAreaManager } from \"../fixed/single-area-manager\";\nexport class FixedSingleAreaBridge {\n constructor(window, iframe, metaViewport, gesturesBridge, documentBridge) {\n const listener = new FixedListenerAdapter(window, gesturesBridge, documentBridge);\n this.manager = new SingleAreaManager(window, iframe, metaViewport, listener);\n }\n setMessagePort(messagePort) {\n this.manager.setMessagePort(messagePort);\n }\n loadResource(url) {\n this.manager.loadResource(url);\n }\n setViewport(viewporttWidth, viewportHeight, insetTop, insetRight, insetBottom, insetLeft) {\n const viewport = { width: viewporttWidth, height: viewportHeight };\n const insets = {\n top: insetTop,\n left: insetLeft,\n bottom: insetBottom,\n right: insetRight,\n };\n this.manager.setViewport(viewport, insets);\n }\n setFit(fit) {\n if (fit != \"contain\" && fit != \"width\" && fit != \"height\") {\n throw Error(`Invalid fit value: ${fit}`);\n }\n this.manager.setFit(fit);\n }\n}\nexport class FixedDoubleAreaBridge {\n constructor(window, leftIframe, rightIframe, metaViewport, gesturesBridge, documentBridge) {\n const listener = new FixedListenerAdapter(window, gesturesBridge, documentBridge);\n this.manager = new DoubleAreaManager(window, leftIframe, rightIframe, metaViewport, listener);\n }\n setLeftMessagePort(messagePort) {\n this.manager.setLeftMessagePort(messagePort);\n }\n setRightMessagePort(messagePort) {\n this.manager.setRightMessagePort(messagePort);\n }\n loadSpread(spread) {\n this.manager.loadSpread(spread);\n }\n setViewport(viewporttWidth, viewportHeight, insetTop, insetRight, insetBottom, insetLeft) {\n const viewport = { width: viewporttWidth, height: viewportHeight };\n const insets = {\n top: insetTop,\n left: insetLeft,\n bottom: insetBottom,\n right: insetRight,\n };\n this.manager.setViewport(viewport, insets);\n }\n setFit(fit) {\n if (fit != \"contain\" && fit != \"width\" && fit != \"height\") {\n throw Error(`Invalid fit value: ${fit}`);\n }\n this.manager.setFit(fit);\n }\n}\n","import { selectionToParentCoordinates, } from \"../common/selection\";\nimport { SelectionWrapperParentSide } from \"../fixed/selection-wrapper\";\nexport class ReflowableSelectionBridge {\n constructor(window, manager) {\n this.window = window;\n this.manager = manager;\n }\n getCurrentSelection() {\n return this.manager.getCurrentSelection();\n }\n clearSelection() {\n this.manager.clearSelection();\n }\n}\nexport class FixedSingleSelectionBridge {\n constructor(iframe, listener) {\n this.iframe = iframe;\n this.listener = listener;\n const wrapperListener = {\n onSelectionAvailable: (requestId, selection) => {\n let adjustedSelection;\n if (selection) {\n adjustedSelection = selectionToParentCoordinates(selection, this.iframe);\n }\n else {\n adjustedSelection = selection;\n }\n const selectionAsJson = JSON.stringify(adjustedSelection);\n this.listener.onSelectionAvailable(requestId, selectionAsJson);\n },\n };\n this.wrapper = new SelectionWrapperParentSide(wrapperListener);\n }\n setMessagePort(messagePort) {\n this.wrapper.setMessagePort(messagePort);\n }\n requestSelection(requestId) {\n this.wrapper.requestSelection(requestId);\n }\n clearSelection() {\n this.wrapper.clearSelection();\n }\n}\nexport class FixedDoubleSelectionBridge {\n constructor(leftIframe, rightIframe, listener) {\n this.requestStates = new Map();\n this.isLeftInitialized = false;\n this.isRightInitialized = false;\n this.leftIframe = leftIframe;\n this.rightIframe = rightIframe;\n this.listener = listener;\n const leftWrapperListener = {\n onSelectionAvailable: (requestId, selection) => {\n if (selection) {\n const resolvedSelection = selectionToParentCoordinates(selection, this.leftIframe);\n this.onSelectionAvailable(requestId, \"left\", resolvedSelection);\n }\n else {\n this.onSelectionAvailable(requestId, \"left\", selection);\n }\n },\n };\n this.leftWrapper = new SelectionWrapperParentSide(leftWrapperListener);\n const rightWrapperListener = {\n onSelectionAvailable: (requestId, selection) => {\n if (selection) {\n const resolvedSelection = selectionToParentCoordinates(selection, this.rightIframe);\n this.onSelectionAvailable(requestId, \"right\", resolvedSelection);\n }\n else {\n this.onSelectionAvailable(requestId, \"right\", selection);\n }\n },\n };\n this.rightWrapper = new SelectionWrapperParentSide(rightWrapperListener);\n }\n setLeftMessagePort(messagePort) {\n this.leftWrapper.setMessagePort(messagePort);\n this.isLeftInitialized = true;\n }\n setRightMessagePort(messagePort) {\n this.rightWrapper.setMessagePort(messagePort);\n this.isRightInitialized = true;\n }\n requestSelection(requestId) {\n if (this.isLeftInitialized && this.isRightInitialized) {\n this.requestStates.set(requestId, \"pending\");\n this.leftWrapper.requestSelection(requestId);\n this.rightWrapper.requestSelection(requestId);\n }\n else if (this.isLeftInitialized) {\n this.requestStates.set(requestId, \"firstResponseWasNull\");\n this.leftWrapper.requestSelection(requestId);\n }\n else if (this.isRightInitialized) {\n this.requestStates.set(requestId, \"firstResponseWasNull\");\n this.rightWrapper.requestSelection(requestId);\n }\n else {\n this.requestStates.set(requestId, \"firstResponseWasNull\");\n this.onSelectionAvailable(requestId, \"left\", null);\n }\n }\n clearSelection() {\n this.leftWrapper.clearSelection();\n this.rightWrapper.clearSelection();\n }\n onSelectionAvailable(requestId, iframe, selection) {\n const requestState = this.requestStates.get(requestId);\n if (!requestState) {\n return;\n }\n if (!selection && requestState === \"pending\") {\n this.requestStates.set(requestId, \"firstResponseWasNull\");\n return;\n }\n this.requestStates.delete(requestId);\n const selectionAsJson = JSON.stringify(selection);\n this.listener.onSelectionAvailable(requestId, iframe, selectionAsJson);\n }\n}\n","import { DecorationWrapperParentSide } from \"../fixed/decoration-wrapper\";\nexport class ReflowableDecorationsBridge {\n constructor(window, manager) {\n this.window = window;\n this.manager = manager;\n }\n registerTemplates(templates) {\n const templatesAsMap = parseTemplates(templates);\n this.manager.registerTemplates(templatesAsMap);\n }\n addDecoration(decoration, group) {\n const actualDecoration = parseDecoration(decoration);\n this.manager.addDecoration(actualDecoration, group);\n }\n removeDecoration(id, group) {\n this.manager.removeDecoration(id, group);\n }\n}\nexport class FixedSingleDecorationsBridge {\n constructor() {\n this.wrapper = new DecorationWrapperParentSide();\n }\n setMessagePort(messagePort) {\n this.wrapper.setMessagePort(messagePort);\n }\n registerTemplates(templates) {\n const actualTemplates = parseTemplates(templates);\n this.wrapper.registerTemplates(actualTemplates);\n }\n addDecoration(decoration, group) {\n const actualDecoration = parseDecoration(decoration);\n this.wrapper.addDecoration(actualDecoration, group);\n }\n removeDecoration(id, group) {\n this.wrapper.removeDecoration(id, group);\n }\n}\nexport class FixedDoubleDecorationsBridge {\n constructor() {\n this.leftWrapper = new DecorationWrapperParentSide();\n this.rightWrapper = new DecorationWrapperParentSide();\n }\n setLeftMessagePort(messagePort) {\n this.leftWrapper.setMessagePort(messagePort);\n }\n setRightMessagePort(messagePort) {\n this.rightWrapper.setMessagePort(messagePort);\n }\n registerTemplates(templates) {\n const actualTemplates = parseTemplates(templates);\n this.leftWrapper.registerTemplates(actualTemplates);\n this.rightWrapper.registerTemplates(actualTemplates);\n }\n addDecoration(decoration, iframe, group) {\n const actualDecoration = parseDecoration(decoration);\n switch (iframe) {\n case \"left\":\n this.leftWrapper.addDecoration(actualDecoration, group);\n break;\n case \"right\":\n this.rightWrapper.addDecoration(actualDecoration, group);\n break;\n default:\n throw Error(`Unknown iframe type: ${iframe}`);\n }\n }\n removeDecoration(id, group) {\n this.leftWrapper.removeDecoration(id, group);\n this.rightWrapper.removeDecoration(id, group);\n }\n}\nfunction parseTemplates(templates) {\n return new Map(Object.entries(JSON.parse(templates)));\n}\nfunction parseDecoration(decoration) {\n const jsonDecoration = JSON.parse(decoration);\n return jsonDecoration;\n}\n","import { DecorationWrapperIframeSide } from \"../fixed/decoration-wrapper\";\nimport { IframeMessageSender } from \"../fixed/iframe-message\";\nimport { SelectionWrapperIframeSide } from \"../fixed/selection-wrapper\";\nexport class FixedSingleInitializationBridge {\n constructor(window, listener, iframe, areaBridge, selectionBridge, decorationsBridge) {\n this.window = window;\n this.listener = listener;\n this.iframe = iframe;\n this.areaBridge = areaBridge;\n this.selectionBridge = selectionBridge;\n this.decorationsBridge = decorationsBridge;\n }\n loadResource(url) {\n this.iframe.src = url;\n this.window.addEventListener(\"message\", (event) => {\n console.log(\"message\");\n if (!event.ports[0]) {\n return;\n }\n if (event.source === this.iframe.contentWindow) {\n this.onInitMessage(event);\n }\n });\n }\n onInitMessage(event) {\n console.log(`receiving init message ${event}`);\n const initMessage = event.data;\n const messagePort = event.ports[0];\n switch (initMessage) {\n case \"InitAreaManager\":\n return this.initAreaManager(messagePort);\n case \"InitSelection\":\n return this.initSelection(messagePort);\n case \"InitDecorations\":\n return this.initDecorations(messagePort);\n }\n }\n initAreaManager(messagePort) {\n this.areaBridge.setMessagePort(messagePort);\n this.listener.onAreaApiAvailable();\n }\n initSelection(messagePort) {\n this.selectionBridge.setMessagePort(messagePort);\n this.listener.onSelectionApiAvailable();\n }\n initDecorations(messagePort) {\n this.decorationsBridge.setMessagePort(messagePort);\n this.listener.onDecorationApiAvailable();\n }\n}\nexport class FixedDoubleInitializationBridge {\n constructor(window, listener, leftIframe, rightIframe, areaBridge, selectionBridge, decorationsBridge) {\n this.areaReadySemaphore = 2;\n this.selectionReadySemaphore = 2;\n this.decorationReadySemaphore = 2;\n this.listener = listener;\n this.areaBridge = areaBridge;\n this.selectionBridge = selectionBridge;\n this.decorationsBridge = decorationsBridge;\n window.addEventListener(\"message\", (event) => {\n if (!event.ports[0]) {\n return;\n }\n if (event.source === leftIframe.contentWindow) {\n this.onInitMessageLeft(event);\n }\n else if (event.source == rightIframe.contentWindow) {\n this.onInitMessageRight(event);\n }\n });\n }\n loadSpread(spread) {\n const pageNb = (spread.left ? 1 : 0) + (spread.right ? 1 : 0);\n this.areaReadySemaphore = pageNb;\n this.selectionReadySemaphore = pageNb;\n this.decorationReadySemaphore = pageNb;\n this.areaBridge.loadSpread(spread);\n }\n onInitMessageLeft(event) {\n const initMessage = event.data;\n const messagePort = event.ports[0];\n switch (initMessage) {\n case \"InitAreaManager\":\n this.areaBridge.setLeftMessagePort(messagePort);\n this.onInitAreaMessage();\n break;\n case \"InitSelection\":\n this.selectionBridge.setLeftMessagePort(messagePort);\n this.onInitSelectionMessage();\n break;\n case \"InitDecorations\":\n this.decorationsBridge.setLeftMessagePort(messagePort);\n this.onInitDecorationMessage();\n break;\n }\n }\n onInitMessageRight(event) {\n const initMessage = event.data;\n const messagePort = event.ports[0];\n switch (initMessage) {\n case \"InitAreaManager\":\n this.areaBridge.setRightMessagePort(messagePort);\n this.onInitAreaMessage();\n break;\n case \"InitSelection\":\n this.selectionBridge.setRightMessagePort(messagePort);\n this.onInitSelectionMessage();\n break;\n case \"InitDecorations\":\n this.decorationsBridge.setRightMessagePort(messagePort);\n this.onInitDecorationMessage();\n break;\n }\n }\n onInitAreaMessage() {\n this.areaReadySemaphore -= 1;\n if (this.areaReadySemaphore == 0) {\n this.listener.onAreaApiAvailable();\n }\n }\n onInitSelectionMessage() {\n this.selectionReadySemaphore -= 1;\n if (this.selectionReadySemaphore == 0) {\n this.listener.onSelectionApiAvailable();\n }\n }\n onInitDecorationMessage() {\n this.decorationReadySemaphore -= 1;\n if (this.decorationReadySemaphore == 0) {\n this.listener.onDecorationApiAvailable();\n }\n }\n}\nexport class FixedInitializerIframeSide {\n constructor(window) {\n this.window = window;\n }\n initAreaManager() {\n const messagePort = this.initChannel(\"InitAreaManager\");\n return new IframeMessageSender(messagePort);\n }\n initSelection(selectionManager) {\n const messagePort = this.initChannel(\"InitSelection\");\n new SelectionWrapperIframeSide(messagePort, selectionManager);\n }\n initDecorations(decorationManager) {\n const messagePort = this.initChannel(\"InitDecorations\");\n new DecorationWrapperIframeSide(messagePort, decorationManager);\n }\n initChannel(initMessage) {\n const messageChannel = new MessageChannel();\n this.window.parent.postMessage(initMessage, \"*\", [messageChannel.port2]);\n return messageChannel.port1;\n }\n}\n"],"names":["GetIntrinsic","callBind","$indexOf","module","exports","name","allowMissing","intrinsic","bind","$apply","$call","$reflectApply","call","$gOPD","$defineProperty","$max","value","e","originalFunction","func","arguments","configurable","length","applyBind","apply","hasPropertyDescriptors","$SyntaxError","$TypeError","gopd","obj","property","nonEnumerable","nonWritable","nonConfigurable","loose","desc","enumerable","writable","keys","hasSymbols","Symbol","toStr","Object","prototype","toString","concat","Array","defineDataProperty","supportsDescriptors","defineProperty","object","predicate","fn","defineProperties","map","predicates","props","getOwnPropertySymbols","i","hasToStringTag","has","toStringTag","overrideIfSet","force","iterator","isPrimitive","isCallable","isDate","isSymbol","input","exoticToPrim","hint","String","Number","toPrimitive","O","P","TypeError","GetMethod","valueOf","result","method","methodNames","ordinaryToPrimitive","slice","that","target","this","bound","args","boundLength","Math","max","boundArgs","push","Function","join","Empty","implementation","functionsHaveNames","gOPD","getOwnPropertyDescriptor","functionsHaveConfigurableNames","$bind","boundFunctionsHaveNames","undefined","SyntaxError","$Function","getEvalledConstructor","expressionSyntax","throwTypeError","ThrowTypeError","calleeThrows","get","gOPDthrows","hasProto","getProto","getPrototypeOf","x","__proto__","needsEval","TypedArray","Uint8Array","INTRINSICS","AggregateError","ArrayBuffer","Atomics","BigInt","BigInt64Array","BigUint64Array","Boolean","DataView","Date","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","Error","eval","EvalError","Float32Array","Float64Array","FinalizationRegistry","Int8Array","Int16Array","Int32Array","isFinite","isNaN","JSON","Map","parseFloat","parseInt","Promise","Proxy","RangeError","ReferenceError","Reflect","RegExp","Set","SharedArrayBuffer","Uint8ClampedArray","Uint16Array","Uint32Array","URIError","WeakMap","WeakRef","WeakSet","error","errorProto","doEval","gen","LEGACY_ALIASES","hasOwn","$concat","$spliceApply","splice","$replace","replace","$strSlice","$exec","exec","rePropName","reEscapeChar","getBaseIntrinsic","alias","intrinsicName","parts","string","first","last","match","number","quote","subString","stringToPath","intrinsicBaseName","intrinsicRealName","skipFurtherCaching","isOwn","part","hasArrayLengthDefineBug","test","foo","$Object","origSymbol","hasSymbolSham","sym","symObj","getOwnPropertyNames","syms","propertyIsEnumerable","descriptor","hasOwnProperty","channel","SLOT","assert","slot","slots","set","V","freeze","badArrayLike","isCallableMarker","fnToStr","reflectApply","_","constructorRegex","isES6ClassFn","fnStr","tryFunctionObject","isIE68","isDDA","document","all","str","strClass","getDay","tryDateObject","isRegexMarker","badStringifier","callBound","throwRegexMarker","$toString","symToStr","symStringRegex","isSymbolObject","hasMap","mapSizeDescriptor","mapSize","mapForEach","forEach","hasSet","setSizeDescriptor","setSize","setForEach","weakMapHas","weakSetHas","weakRefDeref","deref","booleanValueOf","objectToString","functionToString","$match","$slice","$toUpperCase","toUpperCase","$toLowerCase","toLowerCase","$test","$join","$arrSlice","$floor","floor","bigIntValueOf","gOPS","symToString","hasShammedSymbols","isEnumerable","gPO","addNumericSeparator","num","Infinity","sepRegex","int","intStr","dec","utilInspect","inspectCustom","custom","inspectSymbol","wrapQuotes","s","defaultStyle","opts","quoteChar","quoteStyle","isArray","isRegExp","inspect_","options","depth","seen","maxStringLength","customInspect","indent","numericSeparator","inspectString","bigIntStr","maxDepth","baseIndent","base","prev","getIndent","indexOf","inspect","from","noIndent","newOpts","f","m","nameOf","arrObjKeys","symString","markBoxed","HTMLElement","nodeName","getAttribute","attrs","attributes","childNodes","xs","singleLineValues","indentedJoin","isError","cause","isMap","mapParts","key","collectionOf","isSet","setParts","isWeakMap","weakCollectionOf","isWeakSet","isWeakRef","isNumber","isBigInt","isBoolean","isString","ys","isPlainObject","constructor","protoTag","stringTag","tag","l","remaining","trailer","lowbyte","c","n","charCodeAt","type","size","entries","lineJoiner","isArr","symMap","k","j","keysShim","isArgs","hasDontEnumBug","hasProtoEnumBug","dontEnums","equalsConstructorPrototype","o","ctor","excludedKeys","$applicationCache","$console","$external","$frame","$frameElement","$frames","$innerHeight","$innerWidth","$onmozfullscreenchange","$onmozfullscreenerror","$outerHeight","$outerWidth","$pageXOffset","$pageYOffset","$parent","$scrollLeft","$scrollTop","$scrollX","$scrollY","$self","$webkitIndexedDB","$webkitStorageInfo","$window","hasAutomationEqualityBug","window","isObject","isFunction","isArguments","theKeys","skipProto","skipConstructor","equalsConstructorPrototypeIfNotBuggy","origKeys","originalKeys","shim","keysWorksWithArguments","callee","setFunctionName","hasIndices","global","ignoreCase","multiline","dotAll","unicode","unicodeSets","sticky","define","getPolyfill","flagsBound","flags","calls","TypeErr","regex","polyfill","proto","isRegex","hasDescriptors","$WeakMap","$Map","$weakMapGet","$weakMapSet","$weakMapHas","$mapGet","$mapSet","$mapHas","listGetNode","list","curr","next","$wm","$m","$o","objects","node","listGet","listHas","listSet","Call","Get","IsRegExp","ToString","RequireObjectCoercible","flagsGetter","regexpMatchAllPolyfill","getMatcher","regexp","matcherPolyfill","matchAll","matcher","S","rx","boundMatchAll","regexpMatchAll","CreateRegExpStringIterator","SpeciesConstructor","ToLength","Type","OrigRegExp","supportsConstructingWithFlags","regexMatchAll","R","tmp","C","source","constructRegexWithFlags","lastIndex","fullUnicode","defineP","symbol","mvsIsWS","leftWhitespace","rightWhitespace","boundMethod","receiver","trim","CodePointAt","isInteger","MAX_SAFE_INTEGER","index","IsArray","F","argumentsList","isLeadingSurrogate","isTrailingSurrogate","UTF16SurrogatePairToCodePoint","$charAt","$charCodeAt","position","cp","firstIsLeading","firstIsTrailing","second","done","DefineOwnProperty","FromPropertyDescriptor","IsDataDescriptor","IsPropertyKey","SameValue","IteratorPrototype","AdvanceStringIndex","CreateIterResultObject","CreateMethodProperty","OrdinaryObjectCreate","RegExpExec","setToStringTag","RegExpStringIterator","thisIndex","nextIndex","isPropertyDescriptor","IsAccessorDescriptor","ToPropertyDescriptor","Desc","assertRecord","fromPropertyDescriptor","GetV","IsCallable","$construct","DefinePropertyOrThrow","isConstructorMarker","argument","err","hasRegExpMatcher","ToBoolean","$ObjectCreate","additionalInternalSlotsList","T","regexExec","$isNaN","y","noThrowOnStrictViolation","Throw","$species","IsConstructor","defaultConstructor","$Number","$RegExp","$parseInteger","regexTester","isBinary","isOctal","isInvalidHexLiteral","hasNonWS","$trim","StringToNumber","NaN","trimmed","ToNumber","truncate","$isFinite","ToIntegerOrInfinity","len","ToPrimitive","Obj","getter","setter","$String","ES5Type","$fromCharCode","lead","trail","optMessage","$isEnumerable","$Array","allowed","isData","IsAccessor","then","recordType","argumentName","array","callback","$abs","absValue","charCode","record","a","ES","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","__esModule","d","definition","prop","gesturesApi","documentApi","resizeObserverAdded","documentLoadedFired","onTap","event","stringify","offset","onLinkActivated","href","outerHtml","onDecorationActivated","stringOffset","stringRect","rect","id","group","onLayout","ResizeObserver","requestAnimationFrame","scrollingElement","scrollHeight","scrollWidth","onDocumentLoadedAndSized","onDocumentResized","observe","body","PageManager","iframe","listener","margins","top","right","bottom","left","contentWindow","setMessagePort","messagePort","onmessage","message","onMessageFromIframe","show","style","display","hide","setMargins","marginTop","marginLeft","marginBottom","marginRight","loadPage","url","src","setPlaceholder","visibility","width","height","data","kind","onContentSizeAvailable","URL","_a","onIframeLoaded","ViewportStringBuilder","setInitialScale","scale","initialScale","setMinimumScale","minimumScale","setWidth","setHeight","build","components","offsetToParentCoordinates","iframeRect","visualViewport","offsetLeft","offsetTop","rectToParentCoordinates","topLeft","bottomRight","shiftedTopLeft","shiftedBottomRight","GesturesDetector","decorationManager","addEventListener","onClick","defaultPrevented","nearestElement","decorationActivatedEvent","nearestInteractiveElement","HTMLAnchorElement","outerHTML","stopPropagation","preventDefault","handleDecorationClickEvent","element","hasAttribute","parentElement","SingleAreaManager","metaViewport","fit","insets","clientX","clientY","pageListener","boundingRect","getBoundingClientRect","shiftedOffset","shiftedRect","shiftedEvent","page","setViewport","viewport","layout","setFit","loadResource","safeDrawingSize","content","container","widthRatio","heightRatio","min","fitContain","fitWidth","fitHeight","computeScale","registerTemplates","templates","send","addDecoration","decoration","removeDecoration","postMessage","TrimDirection","ResolveDirection","selectionListener","onFeedback","requestSelection","requestId","clearSelection","feedback","onSelectionAvailable","selection","getElementById","querySelector","singleArea","gesturesBridge","documentBridge","manager","viewporttWidth","viewportHeight","insetTop","insetRight","insetBottom","insetLeft","gestures","documentState","singleSelection","wrapperListener","adjustedSelection","selectionRect","selectedText","textBefore","textAfter","selectionAsJson","wrapper","singleSelectionListener","singleDecorations","actualTemplates","parse","parseTemplates","actualDecoration","parseDecoration","singleInitialization","areaBridge","selectionBridge","decorationsBridge","console","log","ports","onInitMessage","initMessage","initAreaManager","initSelection","initDecorations","onAreaApiAvailable","onSelectionApiAvailable","onDecorationApiAvailable","fixedApiState","onInitializationApiAvailable"],"sourceRoot":""} \ No newline at end of file diff --git a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/ReadMe.md b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/ReadMe.md index 518fe6289e..a5588f5585 100644 --- a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/ReadMe.md +++ b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/ReadMe.md @@ -27,10 +27,6 @@ Disabled user settings: - `hyphens`; - `letter-spacing`. -Added user settings: - -- `font-variant-ligatures` (mapped to `--USER__ligatures` CSS variable). - ## CJK Chinese, Japanese, Korean, and Mongolian can be either written `horizontal-tb` or `vertical-*`. Consequently, there are stylesheets for horizontal and vertical writing modes. @@ -52,6 +48,7 @@ Disabled user settings: - `text-align`; - `hyphens`; +- `ligatures`; - paragraphs’ indent; - `word-spacing`. @@ -88,6 +85,7 @@ Disabled user settings: - `column-count` (number of columns); - `text-align`; - `hyphens`; +- `ligatures`; - paragraphs’ indent; - `word-spacing`. diff --git a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/ReadiumCSS-after.css b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/ReadiumCSS-after.css index 9feb56ecef..2138d20c69 100644 --- a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/ReadiumCSS-after.css +++ b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/ReadiumCSS-after.css @@ -1,10 +1,17 @@ -/* - * Readium CSS (v. 2.0.0-beta.13) - * Developers: Jiminy Panoz - * Copyright (c) 2017. Readium Foundation. All rights reserved. +/*! + * Readium CSS v.2.0.0-beta.24 + * Copyright (c) 2017–2025. Readium Foundation. All rights reserved. * Use of this source code is governed by a BSD-style license which is detailed in the * LICENSE file present in the project repository where this source code is maintained. -*/ + * Core maintainer: Jiminy Panoz + * Contributors: + * Daniel Weck + * Hadrien Gardeur + * Innovimax + * L. Le Meur + * Mickaël Menu + * k_taka + */ @namespace url("http://www.w3.org/1999/xhtml"); @@ -66,17 +73,20 @@ body{ max-width:var(--RS__defaultLineLength) !important; padding:0 var(--RS__pageGutter) !important; margin:0 auto !important; - overflow:hidden; box-sizing:border-box; } +:root:not([style*="readium-noOverflow-on"]) body{ + overflow:hidden; +} + @supports (overflow: clip){ - :root{ + :root:not([style*="readium-noOverflow-on"]){ overflow:clip; } - body{ + :root:not([style*="readium-noOverflow-on"]) body{ overflow:clip; overflow-clip-margin:content-box; } @@ -96,157 +106,38 @@ body{ :root[style*="readium-scroll-on"] body{ max-width:var(--RS__defaultLineLength) !important; + box-sizing:border-box !important; +} + +:root[style*="readium-scroll-on"]:not([style*="readium-noOverflow-on"]) body{ overflow:auto; } @supports (overflow: clip){ - :root[style*="readium-scroll-on"]{ + :root[style*="readium-scroll-on"]:not([style*="readium-noOverflow-on"]){ overflow:auto; } - :root[style*="readium-scroll-on"] body{ + :root[style*="readium-scroll-on"]:not([style*="readium-noOverflow-on"]) body{ overflow:clip; } } -:root[style*="readium-night-on"]{ - - --RS__selectionTextColor:inherit; - - --RS__selectionBackgroundColor:#b4d8fe; - - --RS__visitedColor:#0099E5; - - --RS__linkColor:#63caff; - - --RS__textColor:#FEFEFE; - - --RS__backgroundColor:#000000; -} - -:root[style*="readium-night-on"] *:not(a){ - color:inherit !important; - background-color:transparent !important; - border-color:currentcolor !important; -} - -:root[style*="readium-night-on"] svg text{ - fill:currentcolor !important; - stroke:none !important; -} - -:root[style*="readium-night-on"] a:link, -:root[style*="readium-night-on"] a:link *{ - color:var(--RS__linkColor) !important; -} - -:root[style*="readium-night-on"] a:visited, -:root[style*="readium-night-on"] a:visited *{ - color:var(--RS__visitedColor) !important; -} - -:root[style*="readium-night-on"] img[class*="gaiji"], -:root[style*="readium-night-on"] *[epub\:type~="titlepage"] img:only-child, -:root[style*="readium-night-on"] *[epub|type~="titlepage"] img:only-child{ - -webkit-filter:invert(100%); - filter:invert(100%); -} - -:root[style*="readium-sepia-on"]{ - - --RS__selectionTextColor:inherit; - - --RS__selectionBackgroundColor:#b4d8fe; - - --RS__visitedColor:#551A8B; - - --RS__linkColor:#0000EE; - - --RS__textColor:#121212; - - --RS__backgroundColor:#faf4e8; +:root[style*="readium-scroll-on"][style*="--RS__scrollPaddingTop"] body{ + padding-top:var(--RS__scrollPaddingTop) !important; } -:root[style*="readium-sepia-on"] *:not(a){ - color:inherit !important; - background-color:transparent !important; +:root[style*="readium-scroll-on"][style*="--RS__scrollPaddingBottom"] body{ + padding-bottom:var(--RS__scrollPaddingBottom) !important; } -:root[style*="readium-sepia-on"] a:link, -:root[style*="readium-sepia-on"] a:link *{ - color:var(--RS__linkColor); +:root[style*="readium-scroll-on"][style*="--RS__scrollPaddingLeft"] body{ + padding-left:var(--RS__scrollPaddingLeft) !important; } -:root[style*="readium-sepia-on"] a:visited, -:root[style*="readium-sepia-on"] a:visited *{ - color:var(--RS__visitedColor); -} - -@media screen and (-ms-high-contrast: active){ - - :root{ - color:windowText !important; - background-color:window !important; - } - - :root :not(#\#):not(#\#):not(#\#), - :root :not(#\#):not(#\#):not(#\#) :not(#\#):not(#\#):not(#\#) - :root :not(#\#):not(#\#):not(#\#) :not(#\#):not(#\#):not(#\#) :not(#\#):not(#\#):not(#\#){ - color:inherit !important; - background-color:inherit !important; - } - - .readiumCSS-mo-active-default{ - color:highlightText !important; - background-color:highlight !important; - } -} - -@media screen and (-ms-high-contrast: white-on-black){ - - :root[style*="readium-night-on"] img[class*="gaiji"], - :root[style*="readium-night-on"] *[epub\:type~="titlepage"] img:only-child, - :root[style*="readium-night-on"] *[epub|type~="titlepage"] img:only-child{ - -webkit-filter:none !important; - filter:none !important; - } - - :root[style*="readium-night-on"][style*="readium-invert-on"] img{ - -webkit-filter:none !important; - filter:none !important; - } - - :root[style*="readium-night-on"][style*="readium-darken-on"][style*="readium-invert-on"] img{ - -webkit-filter:brightness(80%); - filter:brightness(80%); - } -} - -@media screen and (inverted-colors){ - - :root[style*="readium-night-on"] img[class*="gaiji"], - :root[style*="readium-night-on"] *[epub\:type~="titlepage"] img:only-child, - :root[style*="readium-night-on"] *[epub|type~="titlepage"] img:only-child{ - -webkit-filter:none !important; - filter:none !important; - } - - :root[style*="readium-night-on"][style*="readium-invert-on"] img{ - -webkit-filter:none !important; - filter:none !important; - } - - :root[style*="readium-night-on"][style*="readium-darken-on"][style*="readium-invert-on"] img{ - -webkit-filter:brightness(80%); - filter:brightness(80%); - } -} - -@media screen and (monochrome){ -} - -@media screen and (prefers-reduced-motion){ +:root[style*="readium-scroll-on"][style*="--RS__scrollPaddingRight"] body{ + padding-right:var(--RS__scrollPaddingRight) !important; } :root[style*="--USER__backgroundColor"]{ @@ -323,7 +214,15 @@ body{ } :root[style*="--USER__textAlign"] body, -:root[style*="--USER__textAlign"] p:not(blockquote p):not(figcaption p):not(hgroup p), +:root[style*="--USER__textAlign"] p:not( + blockquote p, + figcaption p, + header p, + hgroup p, + :root[style*="readium-experimentalHeaderFiltering-on"] p[class*="title"], + :root[style*="readium-experimentalHeaderFiltering-on"] div:has(+ *) > h1 + p, + :root[style*="readium-experimentalHeaderFiltering-on"] div:has(+ *) > p:has(+ h1) +), :root[style*="--USER__textAlign"] li, :root[style*="--USER__textAlign"] dd{ text-align:var(--USER__textAlign) !important; @@ -352,56 +251,90 @@ body{ hyphens:inherit; } -:root[style*="readium-font-on"][style*="--USER__fontFamily"]{ +:root[style*="--USER__fontFamily"]{ font-family:var(--USER__fontFamily) !important; } -:root[style*="readium-font-on"][style*="--USER__fontFamily"] *{ +:root[style*="--USER__fontFamily"] *{ font-family:revert !important; } -:root[style*="readium-font-on"][style*="AccessibleDfA"]{ +:root[style*="AccessibleDfA"]{ font-family:AccessibleDfA, Verdana, Tahoma, "Trebuchet MS", sans-serif !important; } -:root[style*="readium-font-on"][style*="IA Writer Duospace"]{ +:root[style*="IA Writer Duospace"]{ font-family:"IA Writer Duospace", Menlo, "DejaVu Sans Mono", "Bitstream Vera Sans Mono", Courier, monospace !important; } -:root[style*="readium-font-on"][style*="AccessibleDfA"],:root[style*="readium-font-on"][style*="IA Writer Duospace"], +:root[style*="AccessibleDfA"],:root[style*="IA Writer Duospace"], :root[style*="readium-a11y-on"]{ font-style:normal !important; font-weight:normal !important; } -:root[style*="readium-font-on"][style*="AccessibleDfA"] *:not(code):not(var):not(kbd):not(samp),:root[style*="readium-font-on"][style*="IA Writer Duospace"] *:not(code):not(var):not(kbd):not(samp), -:root[style*="readium-a11y-on"] *:not(code):not(var):not(kbd):not(samp){ +:root[style*="AccessibleDfA"] body *:not(code):not(var):not(kbd):not(samp),:root[style*="IA Writer Duospace"] body *:not(code):not(var):not(kbd):not(samp), +:root[style*="readium-a11y-on"] body *:not(code):not(var):not(kbd):not(samp){ font-family:inherit !important; font-style:inherit !important; font-weight:inherit !important; } -:root[style*="readium-font-on"][style*="AccessibleDfA"] *,:root[style*="readium-font-on"][style*="IA Writer Duospace"] *, -:root[style*="readium-a11y-on"] *{ +:root[style*="AccessibleDfA"] body *:not(a),:root[style*="IA Writer Duospace"] body *:not(a), +:root[style*="readium-a11y-on"] body *:not(a){ text-decoration:none !important; +} + +:root[style*="AccessibleDfA"] body *,:root[style*="IA Writer Duospace"] body *, +:root[style*="readium-a11y-on"] body *{ font-variant-caps:normal !important; font-variant-numeric:normal !important; font-variant-position:normal !important; } -:root[style*="readium-font-on"][style*="AccessibleDfA"] sup,:root[style*="readium-font-on"][style*="IA Writer Duospace"] sup, +:root[style*="AccessibleDfA"] sup,:root[style*="IA Writer Duospace"] sup, :root[style*="readium-a11y-on"] sup, -:root[style*="readium-font-on"][style*="AccessibleDfA"] sub, -:root[style*="readium-font-on"][style*="IA Writer Duospace"] sub, +:root[style*="AccessibleDfA"] sub, +:root[style*="IA Writer Duospace"] sub, :root[style*="readium-a11y-on"] sub{ font-size:1rem !important; vertical-align:baseline !important; } -:root:not([style*="readium-deprecatedFontSize-on"])[style*="--USER__fontSize"] body{ +:root:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] body{ zoom:var(--USER__fontSize) !important; } +:root:not([style*="readium-deprecatedFontSize-on"])[style*="readium-iOSPatch-on"][style*="--USER__fontSize"] body{ + -webkit-text-size-adjust:var(--USER__fontSize) !important; +} + +@supports selector(figure:has(> img)){ + + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figure:has(> img), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figure:has(> video), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figure:has(> svg), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figure:has(> canvas), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figure:has(> iframe), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figure:has(> audio), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] div:has(> img:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] div:has(> video:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] div:has(> svg:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] div:has(> canvas:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] div:has(> iframe:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] div:has(> audio:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] table{ + zoom:calc(100% / var(--USER__fontSize)) !important; + } + + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figcaption, + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] caption, + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] td, + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] th{ + zoom:var(--USER__fontSize) !important; + } +} + @supports not (zoom: 1){ :root[style*="--USER__fontSize"]{ @@ -429,7 +362,15 @@ body{ margin-bottom:var(--USER__paraSpacing) !important; } -:root[style*="--USER__paraIndent"] p{ +:root[style*="--USER__paraIndent"] p:not( + blockquote p, + figcaption p, + header p, + hgroup p, + :root[style*="readium-experimentalHeaderFiltering-on"] p[class*="title"], + :root[style*="readium-experimentalHeaderFiltering-on"] div:has(+ *) > h1 + p, + :root[style*="readium-experimentalHeaderFiltering-on"] div:has(+ *) > p:has(+ h1) +){ text-indent:var(--USER__paraIndent) !important; } @@ -467,20 +408,28 @@ body{ font-variant:none; } -:root[style*="readium-font-on"][style*="--USER__fontWeight"] body{ +:root[style*="--USER__ligatures"]{ + font-variant-ligatures:var(--USER__ligatures) !important; +} + +:root[style*="--USER__ligatures"] *{ + font-variant-ligatures:inherit !important; +} + +:root[style*="--USER__fontWeight"] body{ font-weight:var(--USER__fontWeight) !important; } -:root[style*="readium-font-on"][style*="--USER__fontWeight"] b, -:root[style*="readium-font-on"][style*="--USER__fontWeight"] strong{ +:root[style*="--USER__fontWeight"] b, +:root[style*="--USER__fontWeight"] strong{ font-weight:bolder; } -:root[style*="readium-font-on"][style*="--USER__fontWidth"] body{ +:root[style*="--USER__fontWidth"] body{ font-stretch:var(--USER__fontWidth) !important; } -:root[style*="readium-font-on"][style*="--USER__fontOpticalSizing"] body{ +:root[style*="--USER__fontOpticalSizing"] body{ font-optical-sizing:var(--USER__fontOpticalSizing) !important; } diff --git a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/ReadiumCSS-before.css b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/ReadiumCSS-before.css index 0cc5938f7b..1c3b0ff066 100644 --- a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/ReadiumCSS-before.css +++ b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/ReadiumCSS-before.css @@ -1,10 +1,17 @@ -/* - * Readium CSS (v. 2.0.0-beta.13) - * Developers: Jiminy Panoz - * Copyright (c) 2017. Readium Foundation. All rights reserved. +/*! + * Readium CSS v.2.0.0-beta.24 + * Copyright (c) 2017–2025. Readium Foundation. All rights reserved. * Use of this source code is governed by a BSD-style license which is detailed in the * LICENSE file present in the project repository where this source code is maintained. -*/ + * Core maintainer: Jiminy Panoz + * Contributors: + * Daniel Weck + * Hadrien Gardeur + * Innovimax + * L. Le Meur + * Mickaël Menu + * k_taka + */ @namespace url("http://www.w3.org/1999/xhtml"); @@ -38,6 +45,31 @@ --RS__lineHeightCompensation:1; --RS__baseLineHeight:calc(1.5 * var(--RS__lineHeightCompensation)); + + --RS__selectionTextColor:inherit; + + --RS__selectionBackgroundColor:#b4d8fe; + + --RS__visitedColor:#551A8B; + + --RS__linkColor:#0000EE; + + --RS__textColor:#121212; + + --RS__backgroundColor:#FFFFFF; + color:var(--RS__textColor) !important; + + background-color:var(--RS__backgroundColor) !important; +} + +::-moz-selection{ + color:var(--RS__selectionTextColor); + background-color:var(--RS__selectionBackgroundColor); +} + +::selection{ + color:var(--RS__selectionTextColor); + background-color:var(--RS__selectionBackgroundColor); } html{ @@ -193,36 +225,6 @@ math{ --RS__lineHeightCompensation:1.167; } -:root{ - - --RS__selectionTextColor:inherit; - - --RS__selectionBackgroundColor:#b4d8fe; - - --RS__visitedColor:#551A8B; - - --RS__linkColor:#0000EE; - - --RS__textColor:#121212; - - --RS__backgroundColor:#FFFFFF; -} - -:root{ - color:var(--RS__textColor) !important; - background-color:var(--RS__backgroundColor) !important; -} - -::-moz-selection{ - color:var(--RS__selectionTextColor); - background-color:var(--RS__selectionBackgroundColor); -} - -::selection{ - color:var(--RS__selectionTextColor); - background-color:var(--RS__selectionBackgroundColor); -} - @font-face{ font-family:AccessibleDfA; font-style:normal; diff --git a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/ReadiumCSS-default.css b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/ReadiumCSS-default.css index c05d1d8ec8..fdd4363c80 100644 --- a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/ReadiumCSS-default.css +++ b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/ReadiumCSS-default.css @@ -1,10 +1,17 @@ -/* - * Readium CSS (v. 2.0.0-beta.13) - * Developers: Jiminy Panoz - * Copyright (c) 2017. Readium Foundation. All rights reserved. +/*! + * Readium CSS v.2.0.0-beta.24 + * Copyright (c) 2017–2025. Readium Foundation. All rights reserved. * Use of this source code is governed by a BSD-style license which is detailed in the * LICENSE file present in the project repository where this source code is maintained. -*/ + * Core maintainer: Jiminy Panoz + * Contributors: + * Daniel Weck + * Hadrien Gardeur + * Innovimax + * L. Le Meur + * Mickaël Menu + * k_taka + */ @namespace url("http://www.w3.org/1999/xhtml"); diff --git a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/ReadiumCSS-ebpaj_fonts_patch.css b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/ReadiumCSS-ebpaj_fonts_patch.css index ee7623c415..16da6be425 100644 --- a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/ReadiumCSS-ebpaj_fonts_patch.css +++ b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/ReadiumCSS-ebpaj_fonts_patch.css @@ -3,7 +3,7 @@ A stylesheet improving EBPAJ @font-face declarations to cover all platforms - Repo: https://github.com/readium/readium-css */ + Repo: https://github.com/readium/css */ /* EBPAJ template only references fonts from MS Windows… so we must reference fonts from other platforms diff --git a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/android-fonts-patch/ReadMe.md b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/android-fonts-patch/ReadMe.md index 7c3c6474d0..6b286e2de0 100644 --- a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/android-fonts-patch/ReadMe.md +++ b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/android-fonts-patch/ReadMe.md @@ -2,7 +2,7 @@ This patch is intended to fix a Fixed-Layout issue on Android, and only on this platform. **It doesn’t apply to reflowable EPUBs or any other platform.** -See https://github.com/readium/readium-css/issues/149 +See https://github.com/readium/css/issues/149 ## What it does diff --git a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/android-fonts-patch/android-fonts-patch.css b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/android-fonts-patch/android-fonts-patch.css index 37e71aa959..87acc80ea4 100644 --- a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/android-fonts-patch/android-fonts-patch.css +++ b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/android-fonts-patch/android-fonts-patch.css @@ -3,13 +3,13 @@ A stylesheet aligning Android generic serif and sans-serif fonts on other platforms - Repo: https://github.com/readium/readium-css */ + Repo: https://github.com/readium/css */ /* Android resolves sans-serif to Roboto, and serif to Droid Serif This created issues for FXL EPUBs relying on Times (New Roman), Helvetica or Arial while not embedding the font files in the package. - See https://github.com/readium/readium-css/issues/149 + See https://github.com/readium/css/issues/149 Unfortunately it is no possible to target generic family using @font-face, we have to target specific font-family names e.g. Times, Arial, etc. diff --git a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/cjk-horizontal/ReadiumCSS-after.css b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/cjk-horizontal/ReadiumCSS-after.css index a43234fc65..468152166a 100644 --- a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/cjk-horizontal/ReadiumCSS-after.css +++ b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/cjk-horizontal/ReadiumCSS-after.css @@ -1,10 +1,17 @@ -/* - * Readium CSS (v. 2.0.0-beta.13) - * Developers: Jiminy Panoz - * Copyright (c) 2017. Readium Foundation. All rights reserved. +/*! + * Readium CSS v.2.0.0-beta.24 + * Copyright (c) 2017–2025. Readium Foundation. All rights reserved. * Use of this source code is governed by a BSD-style license which is detailed in the * LICENSE file present in the project repository where this source code is maintained. -*/ + * Core maintainer: Jiminy Panoz + * Contributors: + * Daniel Weck + * Hadrien Gardeur + * Innovimax + * L. Le Meur + * Mickaël Menu + * k_taka + */ @namespace url("http://www.w3.org/1999/xhtml"); @@ -66,17 +73,20 @@ body{ max-width:var(--RS__defaultLineLength) !important; padding:0 var(--RS__pageGutter) !important; margin:0 auto !important; - overflow:hidden; box-sizing:border-box; } +:root:not([style*="readium-noOverflow-on"]) body{ + overflow:hidden; +} + @supports (overflow: clip){ - :root{ + :root:not([style*="readium-noOverflow-on"]){ overflow:clip; } - body{ + :root:not([style*="readium-noOverflow-on"]) body{ overflow:clip; overflow-clip-margin:content-box; } @@ -96,157 +106,38 @@ body{ :root[style*="readium-scroll-on"] body{ max-width:var(--RS__defaultLineLength) !important; + box-sizing:border-box !important; +} + +:root[style*="readium-scroll-on"]:not([style*="readium-noOverflow-on"]) body{ overflow:auto; } @supports (overflow: clip){ - :root[style*="readium-scroll-on"]{ + :root[style*="readium-scroll-on"]:not([style*="readium-noOverflow-on"]){ overflow:auto; } - :root[style*="readium-scroll-on"] body{ + :root[style*="readium-scroll-on"]:not([style*="readium-noOverflow-on"]) body{ overflow:clip; } } -:root[style*="readium-night-on"]{ - - --RS__selectionTextColor:inherit; - - --RS__selectionBackgroundColor:#b4d8fe; - - --RS__visitedColor:#0099E5; - - --RS__linkColor:#63caff; - - --RS__textColor:#FEFEFE; - - --RS__backgroundColor:#000000; +:root[style*="readium-scroll-on"][style*="--RS__scrollPaddingTop"] body{ + padding-top:var(--RS__scrollPaddingTop) !important; } -:root[style*="readium-night-on"] *:not(a){ - color:inherit !important; - background-color:transparent !important; - border-color:currentcolor !important; -} - -:root[style*="readium-night-on"] svg text{ - fill:currentcolor !important; - stroke:none !important; -} - -:root[style*="readium-night-on"] a:link, -:root[style*="readium-night-on"] a:link *{ - color:var(--RS__linkColor) !important; -} - -:root[style*="readium-night-on"] a:visited, -:root[style*="readium-night-on"] a:visited *{ - color:var(--RS__visitedColor) !important; -} - -:root[style*="readium-night-on"] img[class*="gaiji"], -:root[style*="readium-night-on"] *[epub\:type~="titlepage"] img:only-child, -:root[style*="readium-night-on"] *[epub|type~="titlepage"] img:only-child{ - -webkit-filter:invert(100%); - filter:invert(100%); -} - -:root[style*="readium-sepia-on"]{ - - --RS__selectionTextColor:inherit; - - --RS__selectionBackgroundColor:#b4d8fe; - - --RS__visitedColor:#551A8B; - - --RS__linkColor:#0000EE; - - --RS__textColor:#121212; - - --RS__backgroundColor:#faf4e8; -} - -:root[style*="readium-sepia-on"] *:not(a){ - color:inherit !important; - background-color:transparent !important; +:root[style*="readium-scroll-on"][style*="--RS__scrollPaddingBottom"] body{ + padding-bottom:var(--RS__scrollPaddingBottom) !important; } -:root[style*="readium-sepia-on"] a:link, -:root[style*="readium-sepia-on"] a:link *{ - color:var(--RS__linkColor); +:root[style*="readium-scroll-on"][style*="--RS__scrollPaddingLeft"] body{ + padding-left:var(--RS__scrollPaddingLeft) !important; } -:root[style*="readium-sepia-on"] a:visited, -:root[style*="readium-sepia-on"] a:visited *{ - color:var(--RS__visitedColor); -} - -@media screen and (-ms-high-contrast: active){ - - :root{ - color:windowText !important; - background-color:window !important; - } - - :root :not(#\#):not(#\#):not(#\#), - :root :not(#\#):not(#\#):not(#\#) :not(#\#):not(#\#):not(#\#) - :root :not(#\#):not(#\#):not(#\#) :not(#\#):not(#\#):not(#\#) :not(#\#):not(#\#):not(#\#){ - color:inherit !important; - background-color:inherit !important; - } - - .readiumCSS-mo-active-default{ - color:highlightText !important; - background-color:highlight !important; - } -} - -@media screen and (-ms-high-contrast: white-on-black){ - - :root[style*="readium-night-on"] img[class*="gaiji"], - :root[style*="readium-night-on"] *[epub\:type~="titlepage"] img:only-child, - :root[style*="readium-night-on"] *[epub|type~="titlepage"] img:only-child{ - -webkit-filter:none !important; - filter:none !important; - } - - :root[style*="readium-night-on"][style*="readium-invert-on"] img{ - -webkit-filter:none !important; - filter:none !important; - } - - :root[style*="readium-night-on"][style*="readium-darken-on"][style*="readium-invert-on"] img{ - -webkit-filter:brightness(80%); - filter:brightness(80%); - } -} - -@media screen and (inverted-colors){ - - :root[style*="readium-night-on"] img[class*="gaiji"], - :root[style*="readium-night-on"] *[epub\:type~="titlepage"] img:only-child, - :root[style*="readium-night-on"] *[epub|type~="titlepage"] img:only-child{ - -webkit-filter:none !important; - filter:none !important; - } - - :root[style*="readium-night-on"][style*="readium-invert-on"] img{ - -webkit-filter:none !important; - filter:none !important; - } - - :root[style*="readium-night-on"][style*="readium-darken-on"][style*="readium-invert-on"] img{ - -webkit-filter:brightness(80%); - filter:brightness(80%); - } -} - -@media screen and (monochrome){ -} - -@media screen and (prefers-reduced-motion){ +:root[style*="readium-scroll-on"][style*="--RS__scrollPaddingRight"] body{ + padding-right:var(--RS__scrollPaddingRight) !important; } :root[style*="--USER__backgroundColor"]{ @@ -318,18 +209,48 @@ body{ max-width:var(--USER__lineLength) !important; } -:root[style*="readium-font-on"][style*="--USER__fontFamily"]{ +:root[style*="--USER__fontFamily"]{ font-family:var(--USER__fontFamily) !important; } -:root[style*="readium-font-on"][style*="--USER__fontFamily"] *{ +:root[style*="--USER__fontFamily"] *{ font-family:revert !important; } -:root:not([style*="readium-deprecatedFontSize-on"])[style*="--USER__fontSize"] body{ +:root:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] body{ zoom:var(--USER__fontSize) !important; } +:root:not([style*="readium-deprecatedFontSize-on"])[style*="readium-iOSPatch-on"][style*="--USER__fontSize"] body{ + -webkit-text-size-adjust:var(--USER__fontSize) !important; +} + +@supports selector(figure:has(> img)){ + + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figure:has(> img), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figure:has(> video), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figure:has(> svg), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figure:has(> canvas), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figure:has(> iframe), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figure:has(> audio), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] div:has(> img:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] div:has(> video:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] div:has(> svg:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] div:has(> canvas:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] div:has(> iframe:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] div:has(> audio:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] table{ + zoom:calc(100% / var(--USER__fontSize)) !important; + } + + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figcaption, + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] caption, + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] td, + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] th{ + zoom:var(--USER__fontSize) !important; + } +} + @supports not (zoom: 1){ :root[style*="--USER__fontSize"]{ @@ -357,20 +278,20 @@ body{ margin-bottom:var(--USER__paraSpacing) !important; } -:root[style*="readium-font-on"][style*="--USER__fontWeight"] body{ +:root[style*="--USER__fontWeight"] body{ font-weight:var(--USER__fontWeight) !important; } -:root[style*="readium-font-on"][style*="--USER__fontWeight"] b, -:root[style*="readium-font-on"][style*="--USER__fontWeight"] strong{ +:root[style*="--USER__fontWeight"] b, +:root[style*="--USER__fontWeight"] strong{ font-weight:bolder; } -:root[style*="readium-font-on"][style*="--USER__fontWidth"] body{ +:root[style*="--USER__fontWidth"] body{ font-stretch:var(--USER__fontWidth) !important; } -:root[style*="readium-font-on"][style*="--USER__fontOpticalSizing"] body{ +:root[style*="--USER__fontOpticalSizing"] body{ font-optical-sizing:var(--USER__fontOpticalSizing) !important; } diff --git a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/cjk-horizontal/ReadiumCSS-before.css b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/cjk-horizontal/ReadiumCSS-before.css index 9358959302..01fa1eb6bf 100644 --- a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/cjk-horizontal/ReadiumCSS-before.css +++ b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/cjk-horizontal/ReadiumCSS-before.css @@ -1,10 +1,17 @@ -/* - * Readium CSS (v. 2.0.0-beta.13) - * Developers: Jiminy Panoz - * Copyright (c) 2017. Readium Foundation. All rights reserved. +/*! + * Readium CSS v.2.0.0-beta.24 + * Copyright (c) 2017–2025. Readium Foundation. All rights reserved. * Use of this source code is governed by a BSD-style license which is detailed in the * LICENSE file present in the project repository where this source code is maintained. -*/ + * Core maintainer: Jiminy Panoz + * Contributors: + * Daniel Weck + * Hadrien Gardeur + * Innovimax + * L. Le Meur + * Mickaël Menu + * k_taka + */ @namespace url("http://www.w3.org/1999/xhtml"); @@ -38,6 +45,31 @@ --RS__lineHeightCompensation:1; --RS__baseLineHeight:calc(1.5 * var(--RS__lineHeightCompensation)); + + --RS__selectionTextColor:inherit; + + --RS__selectionBackgroundColor:#b4d8fe; + + --RS__visitedColor:#551A8B; + + --RS__linkColor:#0000EE; + + --RS__textColor:#121212; + + --RS__backgroundColor:#FFFFFF; + color:var(--RS__textColor) !important; + + background-color:var(--RS__backgroundColor) !important; +} + +::-moz-selection{ + color:var(--RS__selectionTextColor); + background-color:var(--RS__selectionBackgroundColor); +} + +::selection{ + color:var(--RS__selectionTextColor); + background-color:var(--RS__selectionBackgroundColor); } html{ @@ -193,36 +225,6 @@ math{ --RS__lineHeightCompensation:1.167; } -:root{ - - --RS__selectionTextColor:inherit; - - --RS__selectionBackgroundColor:#b4d8fe; - - --RS__visitedColor:#551A8B; - - --RS__linkColor:#0000EE; - - --RS__textColor:#121212; - - --RS__backgroundColor:#FFFFFF; -} - -:root{ - color:var(--RS__textColor) !important; - background-color:var(--RS__backgroundColor) !important; -} - -::-moz-selection{ - color:var(--RS__selectionTextColor); - background-color:var(--RS__selectionBackgroundColor); -} - -::selection{ - color:var(--RS__selectionTextColor); - background-color:var(--RS__selectionBackgroundColor); -} - body{ widows:2; orphans:2; diff --git a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/cjk-horizontal/ReadiumCSS-default.css b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/cjk-horizontal/ReadiumCSS-default.css index c1954250a3..31461a775c 100644 --- a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/cjk-horizontal/ReadiumCSS-default.css +++ b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/cjk-horizontal/ReadiumCSS-default.css @@ -1,10 +1,17 @@ -/* - * Readium CSS (v. 2.0.0-beta.13) - * Developers: Jiminy Panoz - * Copyright (c) 2017. Readium Foundation. All rights reserved. +/*! + * Readium CSS v.2.0.0-beta.24 + * Copyright (c) 2017–2025. Readium Foundation. All rights reserved. * Use of this source code is governed by a BSD-style license which is detailed in the * LICENSE file present in the project repository where this source code is maintained. -*/ + * Core maintainer: Jiminy Panoz + * Contributors: + * Daniel Weck + * Hadrien Gardeur + * Innovimax + * L. Le Meur + * Mickaël Menu + * k_taka + */ @namespace url("http://www.w3.org/1999/xhtml"); diff --git a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/cjk-vertical/ReadiumCSS-after.css b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/cjk-vertical/ReadiumCSS-after.css index 958fbca96d..de5e03fb3a 100644 --- a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/cjk-vertical/ReadiumCSS-after.css +++ b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/cjk-vertical/ReadiumCSS-after.css @@ -1,10 +1,17 @@ -/* - * Readium CSS (v. 2.0.0-beta.13) - * Developers: Jiminy Panoz - * Copyright (c) 2017. Readium Foundation. All rights reserved. +/*! + * Readium CSS v.2.0.0-beta.24 + * Copyright (c) 2017–2025. Readium Foundation. All rights reserved. * Use of this source code is governed by a BSD-style license which is detailed in the * LICENSE file present in the project repository where this source code is maintained. -*/ + * Core maintainer: Jiminy Panoz + * Contributors: + * Daniel Weck + * Hadrien Gardeur + * Innovimax + * L. Le Meur + * Mickaël Menu + * k_taka + */ @namespace url("http://www.w3.org/1999/xhtml"); @@ -77,17 +84,20 @@ body{ max-height:var(--RS__defaultLineLength) !important; padding:var(--RS__pageGutter) 0 !important; margin:auto 0 !important; - overflow:hidden; box-sizing:border-box; } +:root:not([style*="readium-noOverflow-on"]) body{ + overflow:hidden; +} + @supports (overflow: clip){ - :root{ + :root:not([style*="readium-noOverflow-on"]){ overflow:clip; } - body{ + :root:not([style*="readium-noOverflow-on"]) body{ overflow:clip; overflow-clip-margin:content-box; } @@ -107,156 +117,34 @@ body{ :root[style*="readium-scroll-on"] body, :root[style*="readium-noVerticalPagination-on"] body{ max-width:var(--RS__defaultLineLength) !important; + box-sizing:border-box !important; } @supports (overflow: clip){ - :root[style*="readium-scroll-on"]{ + :root[style*="readium-scroll-on"]:not([style*="readium-noOverflow-on"]){ overflow:auto; } - :root[style*="readium-scroll-on"] body{ + :root[style*="readium-scroll-on"]:not([style*="readium-noOverflow-on"]) body{ overflow:clip; } } -:root[style*="readium-night-on"]{ - - --RS__selectionTextColor:inherit; - - --RS__selectionBackgroundColor:#b4d8fe; - - --RS__visitedColor:#0099E5; - - --RS__linkColor:#63caff; - - --RS__textColor:#FEFEFE; - - --RS__backgroundColor:#000000; -} - -:root[style*="readium-night-on"] *:not(a){ - color:inherit !important; - background-color:transparent !important; - border-color:currentcolor !important; -} - -:root[style*="readium-night-on"] svg text{ - fill:currentcolor !important; - stroke:none !important; -} - -:root[style*="readium-night-on"] a:link, -:root[style*="readium-night-on"] a:link *{ - color:var(--RS__linkColor) !important; -} - -:root[style*="readium-night-on"] a:visited, -:root[style*="readium-night-on"] a:visited *{ - color:var(--RS__visitedColor) !important; -} - -:root[style*="readium-night-on"] img[class*="gaiji"], -:root[style*="readium-night-on"] *[epub\:type~="titlepage"] img:only-child, -:root[style*="readium-night-on"] *[epub|type~="titlepage"] img:only-child{ - -webkit-filter:invert(100%); - filter:invert(100%); -} - -:root[style*="readium-sepia-on"]{ - - --RS__selectionTextColor:inherit; - - --RS__selectionBackgroundColor:#b4d8fe; - - --RS__visitedColor:#551A8B; - - --RS__linkColor:#0000EE; - - --RS__textColor:#121212; - - --RS__backgroundColor:#faf4e8; +:root[style*="readium-scroll-on"][style*="--RS__scrollPaddingTop"] body{ + padding-top:var(--RS__scrollPaddingTop) !important; } -:root[style*="readium-sepia-on"] *:not(a){ - color:inherit !important; - background-color:transparent !important; +:root[style*="readium-scroll-on"][style*="--RS__scrollPaddingBottom"] body{ + padding-bottom:var(--RS__scrollPaddingBottom) !important; } -:root[style*="readium-sepia-on"] a:link, -:root[style*="readium-sepia-on"] a:link *{ - color:var(--RS__linkColor); +:root[style*="readium-scroll-on"][style*="--RS__scrollPaddingLeft"] body{ + padding-left:var(--RS__scrollPaddingLeft) !important; } -:root[style*="readium-sepia-on"] a:visited, -:root[style*="readium-sepia-on"] a:visited *{ - color:var(--RS__visitedColor); -} - -@media screen and (-ms-high-contrast: active){ - - :root{ - color:windowText !important; - background-color:window !important; - } - - :root :not(#\#):not(#\#):not(#\#), - :root :not(#\#):not(#\#):not(#\#) :not(#\#):not(#\#):not(#\#) - :root :not(#\#):not(#\#):not(#\#) :not(#\#):not(#\#):not(#\#) :not(#\#):not(#\#):not(#\#){ - color:inherit !important; - background-color:inherit !important; - } - - .readiumCSS-mo-active-default{ - color:highlightText !important; - background-color:highlight !important; - } -} - -@media screen and (-ms-high-contrast: white-on-black){ - - :root[style*="readium-night-on"] img[class*="gaiji"], - :root[style*="readium-night-on"] *[epub\:type~="titlepage"] img:only-child, - :root[style*="readium-night-on"] *[epub|type~="titlepage"] img:only-child{ - -webkit-filter:none !important; - filter:none !important; - } - - :root[style*="readium-night-on"][style*="readium-invert-on"] img{ - -webkit-filter:none !important; - filter:none !important; - } - - :root[style*="readium-night-on"][style*="readium-darken-on"][style*="readium-invert-on"] img{ - -webkit-filter:brightness(80%); - filter:brightness(80%); - } -} - -@media screen and (inverted-colors){ - - :root[style*="readium-night-on"] img[class*="gaiji"], - :root[style*="readium-night-on"] *[epub\:type~="titlepage"] img:only-child, - :root[style*="readium-night-on"] *[epub|type~="titlepage"] img:only-child{ - -webkit-filter:none !important; - filter:none !important; - } - - :root[style*="readium-night-on"][style*="readium-invert-on"] img{ - -webkit-filter:none !important; - filter:none !important; - } - - :root[style*="readium-night-on"][style*="readium-darken-on"][style*="readium-invert-on"] img{ - -webkit-filter:brightness(80%); - filter:brightness(80%); - } -} - -@media screen and (monochrome){ -} - -@media screen and (prefers-reduced-motion){ +:root[style*="readium-scroll-on"][style*="--RS__scrollPaddingRight"] body{ + padding-right:var(--RS__scrollPaddingRight) !important; } :root[style*="--USER__backgroundColor"]{ @@ -306,18 +194,48 @@ body{ max-height:var(--USER__lineLength) !important; } -:root[style*="readium-font-on"][style*="--USER__fontFamily"]{ +:root[style*="--USER__fontFamily"]{ font-family:var(--USER__fontFamily) !important; } -:root[style*="readium-font-on"][style*="--USER__fontFamily"] *{ +:root[style*="--USER__fontFamily"] *{ font-family:revert !important; } -:root:not([style*="readium-deprecatedFontSize-on"])[style*="--USER__fontSize"] body{ +:root:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] body{ zoom:var(--USER__fontSize) !important; } +:root:not([style*="readium-deprecatedFontSize-on"])[style*="readium-iOSPatch-on"][style*="--USER__fontSize"] body{ + -webkit-text-size-adjust:var(--USER__fontSize) !important; +} + +@supports selector(figure:has(> img)){ + + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figure:has(> img), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figure:has(> video), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figure:has(> svg), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figure:has(> canvas), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figure:has(> iframe), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figure:has(> audio), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] div:has(> img:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] div:has(> video:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] div:has(> svg:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] div:has(> canvas:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] div:has(> iframe:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] div:has(> audio:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] table{ + zoom:calc(100% / var(--USER__fontSize)) !important; + } + + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figcaption, + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] caption, + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] td, + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] th{ + zoom:var(--USER__fontSize) !important; + } +} + @supports not (zoom: 1){ :root[style*="--USER__fontSize"]{ @@ -345,20 +263,20 @@ body{ margin-left:var(--USER__paraSpacing) !important; } -:root[style*="readium-font-on"][style*="--USER__fontWeight"] body{ +:root[style*="--USER__fontWeight"] body{ font-weight:var(--USER__fontWeight) !important; } -:root[style*="readium-font-on"][style*="--USER__fontWeight"] b, -:root[style*="readium-font-on"][style*="--USER__fontWeight"] strong{ +:root[style*="--USER__fontWeight"] b, +:root[style*="--USER__fontWeight"] strong{ font-weight:bolder; } -:root[style*="readium-font-on"][style*="--USER__fontWidth"] body{ +:root[style*="--USER__fontWidth"] body{ font-stretch:var(--USER__fontWidth) !important; } -:root[style*="readium-font-on"][style*="--USER__fontOpticalSizing"] body{ +:root[style*="--USER__fontOpticalSizing"] body{ font-optical-sizing:var(--USER__fontOpticalSizing) !important; } diff --git a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/cjk-vertical/ReadiumCSS-before.css b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/cjk-vertical/ReadiumCSS-before.css index 0072752b1a..4e30c47187 100644 --- a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/cjk-vertical/ReadiumCSS-before.css +++ b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/cjk-vertical/ReadiumCSS-before.css @@ -1,10 +1,17 @@ -/* - * Readium CSS (v. 2.0.0-beta.13) - * Developers: Jiminy Panoz - * Copyright (c) 2017. Readium Foundation. All rights reserved. +/*! + * Readium CSS v.2.0.0-beta.24 + * Copyright (c) 2017–2025. Readium Foundation. All rights reserved. * Use of this source code is governed by a BSD-style license which is detailed in the * LICENSE file present in the project repository where this source code is maintained. -*/ + * Core maintainer: Jiminy Panoz + * Contributors: + * Daniel Weck + * Hadrien Gardeur + * Innovimax + * L. Le Meur + * Mickaël Menu + * k_taka + */ @namespace url("http://www.w3.org/1999/xhtml"); @@ -38,6 +45,31 @@ --RS__lineHeightCompensation:1; --RS__baseLineHeight:calc(1.5 * var(--RS__lineHeightCompensation)); + + --RS__selectionTextColor:inherit; + + --RS__selectionBackgroundColor:#b4d8fe; + + --RS__visitedColor:#551A8B; + + --RS__linkColor:#0000EE; + + --RS__textColor:#121212; + + --RS__backgroundColor:#FFFFFF; + color:var(--RS__textColor) !important; + + background-color:var(--RS__backgroundColor) !important; +} + +::-moz-selection{ + color:var(--RS__selectionTextColor); + background-color:var(--RS__selectionBackgroundColor); +} + +::selection{ + color:var(--RS__selectionTextColor); + background-color:var(--RS__selectionBackgroundColor); } html{ @@ -193,36 +225,6 @@ math{ --RS__lineHeightCompensation:1.167; } -:root{ - - --RS__selectionTextColor:inherit; - - --RS__selectionBackgroundColor:#b4d8fe; - - --RS__visitedColor:#551A8B; - - --RS__linkColor:#0000EE; - - --RS__textColor:#121212; - - --RS__backgroundColor:#FFFFFF; -} - -:root{ - color:var(--RS__textColor) !important; - background-color:var(--RS__backgroundColor) !important; -} - -::-moz-selection{ - color:var(--RS__selectionTextColor); - background-color:var(--RS__selectionBackgroundColor); -} - -::selection{ - color:var(--RS__selectionTextColor); - background-color:var(--RS__selectionBackgroundColor); -} - body{ widows:2; orphans:2; diff --git a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/cjk-vertical/ReadiumCSS-default.css b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/cjk-vertical/ReadiumCSS-default.css index 08e7b95fd6..52b3ac7733 100644 --- a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/cjk-vertical/ReadiumCSS-default.css +++ b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/cjk-vertical/ReadiumCSS-default.css @@ -1,10 +1,17 @@ -/* - * Readium CSS (v. 2.0.0-beta.13) - * Developers: Jiminy Panoz - * Copyright (c) 2017. Readium Foundation. All rights reserved. +/*! + * Readium CSS v.2.0.0-beta.24 + * Copyright (c) 2017–2025. Readium Foundation. All rights reserved. * Use of this source code is governed by a BSD-style license which is detailed in the * LICENSE file present in the project repository where this source code is maintained. -*/ + * Core maintainer: Jiminy Panoz + * Contributors: + * Daniel Weck + * Hadrien Gardeur + * Innovimax + * L. Le Meur + * Mickaël Menu + * k_taka + */ @namespace url("http://www.w3.org/1999/xhtml"); diff --git a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/rtl/ReadiumCSS-after.css b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/rtl/ReadiumCSS-after.css index 2d9b79405c..befc238400 100644 --- a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/rtl/ReadiumCSS-after.css +++ b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/rtl/ReadiumCSS-after.css @@ -1,10 +1,17 @@ -/* - * Readium CSS (v. 2.0.0-beta.13) - * Developers: Jiminy Panoz - * Copyright (c) 2017. Readium Foundation. All rights reserved. +/*! + * Readium CSS v.2.0.0-beta.24 + * Copyright (c) 2017–2025. Readium Foundation. All rights reserved. * Use of this source code is governed by a BSD-style license which is detailed in the * LICENSE file present in the project repository where this source code is maintained. -*/ + * Core maintainer: Jiminy Panoz + * Contributors: + * Daniel Weck + * Hadrien Gardeur + * Innovimax + * L. Le Meur + * Mickaël Menu + * k_taka + */ @namespace url("http://www.w3.org/1999/xhtml"); @@ -66,17 +73,20 @@ body{ max-width:var(--RS__defaultLineLength) !important; padding:0 var(--RS__pageGutter) !important; margin:0 auto !important; - overflow:hidden; box-sizing:border-box; } +:root:not([style*="readium-noOverflow-on"]) body{ + overflow:hidden; +} + @supports (overflow: clip){ - :root{ + :root:not([style*="readium-noOverflow-on"]){ overflow:clip; } - body{ + :root:not([style*="readium-noOverflow-on"]) body{ overflow:clip; overflow-clip-margin:content-box; } @@ -96,157 +106,38 @@ body{ :root[style*="readium-scroll-on"] body{ max-width:var(--RS__defaultLineLength) !important; + box-sizing:border-box !important; +} + +:root[style*="readium-scroll-on"]:not([style*="readium-noOverflow-on"]) body{ overflow:auto; } @supports (overflow: clip){ - :root[style*="readium-scroll-on"]{ + :root[style*="readium-scroll-on"]:not([style*="readium-noOverflow-on"]){ overflow:auto; } - :root[style*="readium-scroll-on"] body{ + :root[style*="readium-scroll-on"]:not([style*="readium-noOverflow-on"]) body{ overflow:clip; } } -:root[style*="readium-night-on"]{ - - --RS__selectionTextColor:inherit; - - --RS__selectionBackgroundColor:#b4d8fe; - - --RS__visitedColor:#0099E5; - - --RS__linkColor:#63caff; - - --RS__textColor:#FEFEFE; - - --RS__backgroundColor:#000000; +:root[style*="readium-scroll-on"][style*="--RS__scrollPaddingTop"] body{ + padding-top:var(--RS__scrollPaddingTop) !important; } -:root[style*="readium-night-on"] *:not(a){ - color:inherit !important; - background-color:transparent !important; - border-color:currentcolor !important; -} - -:root[style*="readium-night-on"] svg text{ - fill:currentcolor !important; - stroke:none !important; -} - -:root[style*="readium-night-on"] a:link, -:root[style*="readium-night-on"] a:link *{ - color:var(--RS__linkColor) !important; -} - -:root[style*="readium-night-on"] a:visited, -:root[style*="readium-night-on"] a:visited *{ - color:var(--RS__visitedColor) !important; -} - -:root[style*="readium-night-on"] img[class*="gaiji"], -:root[style*="readium-night-on"] *[epub\:type~="titlepage"] img:only-child, -:root[style*="readium-night-on"] *[epub|type~="titlepage"] img:only-child{ - -webkit-filter:invert(100%); - filter:invert(100%); -} - -:root[style*="readium-sepia-on"]{ - - --RS__selectionTextColor:inherit; - - --RS__selectionBackgroundColor:#b4d8fe; - - --RS__visitedColor:#551A8B; - - --RS__linkColor:#0000EE; - - --RS__textColor:#121212; - - --RS__backgroundColor:#faf4e8; -} - -:root[style*="readium-sepia-on"] *:not(a){ - color:inherit !important; - background-color:transparent !important; +:root[style*="readium-scroll-on"][style*="--RS__scrollPaddingBottom"] body{ + padding-bottom:var(--RS__scrollPaddingBottom) !important; } -:root[style*="readium-sepia-on"] a:link, -:root[style*="readium-sepia-on"] a:link *{ - color:var(--RS__linkColor); +:root[style*="readium-scroll-on"][style*="--RS__scrollPaddingLeft"] body{ + padding-left:var(--RS__scrollPaddingLeft) !important; } -:root[style*="readium-sepia-on"] a:visited, -:root[style*="readium-sepia-on"] a:visited *{ - color:var(--RS__visitedColor); -} - -@media screen and (-ms-high-contrast: active){ - - :root{ - color:windowText !important; - background-color:window !important; - } - - :root :not(#\#):not(#\#):not(#\#), - :root :not(#\#):not(#\#):not(#\#) :not(#\#):not(#\#):not(#\#) - :root :not(#\#):not(#\#):not(#\#) :not(#\#):not(#\#):not(#\#) :not(#\#):not(#\#):not(#\#){ - color:inherit !important; - background-color:inherit !important; - } - - .readiumCSS-mo-active-default{ - color:highlightText !important; - background-color:highlight !important; - } -} - -@media screen and (-ms-high-contrast: white-on-black){ - - :root[style*="readium-night-on"] img[class*="gaiji"], - :root[style*="readium-night-on"] *[epub\:type~="titlepage"] img:only-child, - :root[style*="readium-night-on"] *[epub|type~="titlepage"] img:only-child{ - -webkit-filter:none !important; - filter:none !important; - } - - :root[style*="readium-night-on"][style*="readium-invert-on"] img{ - -webkit-filter:none !important; - filter:none !important; - } - - :root[style*="readium-night-on"][style*="readium-darken-on"][style*="readium-invert-on"] img{ - -webkit-filter:brightness(80%); - filter:brightness(80%); - } -} - -@media screen and (inverted-colors){ - - :root[style*="readium-night-on"] img[class*="gaiji"], - :root[style*="readium-night-on"] *[epub\:type~="titlepage"] img:only-child, - :root[style*="readium-night-on"] *[epub|type~="titlepage"] img:only-child{ - -webkit-filter:none !important; - filter:none !important; - } - - :root[style*="readium-night-on"][style*="readium-invert-on"] img{ - -webkit-filter:none !important; - filter:none !important; - } - - :root[style*="readium-night-on"][style*="readium-darken-on"][style*="readium-invert-on"] img{ - -webkit-filter:brightness(80%); - filter:brightness(80%); - } -} - -@media screen and (monochrome){ -} - -@media screen and (prefers-reduced-motion){ +:root[style*="readium-scroll-on"][style*="--RS__scrollPaddingRight"] body{ + padding-right:var(--RS__scrollPaddingRight) !important; } :root[style*="--USER__backgroundColor"]{ @@ -323,7 +214,15 @@ body{ } :root[style*="--USER__textAlign"] body, -:root[style*="--USER__textAlign"] p:not(blockquote p):not(figcaption p):not(hgroup p), +:root[style*="--USER__textAlign"] p:not( + blockquote p, + figcaption p, + header p, + hgroup p, + :root[style*="readium-experimentalHeaderFiltering-on"] p[class*="title"], + :root[style*="readium-experimentalHeaderFiltering-on"] div:has(+ *) > h1 + p, + :root[style*="readium-experimentalHeaderFiltering-on"] div:has(+ *) > p:has(+ h1) +), :root[style*="--USER__textAlign"] li, :root[style*="--USER__textAlign"] dd{ text-align:var(--USER__textAlign) !important; @@ -332,18 +231,48 @@ body{ text-align-last:auto !important; } -:root[style*="readium-font-on"][style*="--USER__fontFamily"]{ +:root[style*="--USER__fontFamily"]{ font-family:var(--USER__fontFamily) !important; } -:root[style*="readium-font-on"][style*="--USER__fontFamily"] *{ +:root[style*="--USER__fontFamily"] *{ font-family:revert !important; } -:root:not([style*="readium-deprecatedFontSize-on"])[style*="--USER__fontSize"] body{ +:root:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] body{ zoom:var(--USER__fontSize) !important; } +:root:not([style*="readium-deprecatedFontSize-on"])[style*="readium-iOSPatch-on"][style*="--USER__fontSize"] body{ + -webkit-text-size-adjust:var(--USER__fontSize) !important; +} + +@supports selector(figure:has(> img)){ + + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figure:has(> img), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figure:has(> video), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figure:has(> svg), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figure:has(> canvas), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figure:has(> iframe), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figure:has(> audio), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] div:has(> img:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] div:has(> video:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] div:has(> svg:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] div:has(> canvas:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] div:has(> iframe:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] div:has(> audio:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] table{ + zoom:calc(100% / var(--USER__fontSize)) !important; + } + + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] figcaption, + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] caption, + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] td, + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-deprecatedFontSize-on"]):not([style*="readium-iOSPatch-on"])[style*="--USER__fontSize"] th{ + zoom:var(--USER__fontSize) !important; + } +} + @supports not (zoom: 1){ :root[style*="--USER__fontSize"]{ @@ -371,7 +300,15 @@ body{ margin-bottom:var(--USER__paraSpacing) !important; } -:root[style*="--USER__paraIndent"] p{ +:root[style*="--USER__paraIndent"] p:not( + blockquote p, + figcaption p, + header p, + hgroup p, + :root[style*="readium-experimentalHeaderFiltering-on"] p[class*="title"], + :root[style*="readium-experimentalHeaderFiltering-on"] div:has(+ *) > h1 + p, + :root[style*="readium-experimentalHeaderFiltering-on"] div:has(+ *) > p:has(+ h1) +){ text-indent:var(--USER__paraIndent) !important; } @@ -402,20 +339,20 @@ body{ font-variant-ligatures:inherit !important; } -:root[style*="readium-font-on"][style*="--USER__fontWeight"] body{ +:root[style*="--USER__fontWeight"] body{ font-weight:var(--USER__fontWeight) !important; } -:root[style*="readium-font-on"][style*="--USER__fontWeight"] b, -:root[style*="readium-font-on"][style*="--USER__fontWeight"] strong{ +:root[style*="--USER__fontWeight"] b, +:root[style*="--USER__fontWeight"] strong{ font-weight:bolder; } -:root[style*="readium-font-on"][style*="--USER__fontWidth"] body{ +:root[style*="--USER__fontWidth"] body{ font-stretch:var(--USER__fontWidth) !important; } -:root[style*="readium-font-on"][style*="--USER__fontOpticalSizing"] body{ +:root[style*="--USER__fontOpticalSizing"] body{ font-optical-sizing:var(--USER__fontOpticalSizing) !important; } diff --git a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/rtl/ReadiumCSS-before.css b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/rtl/ReadiumCSS-before.css index 9358959302..01fa1eb6bf 100644 --- a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/rtl/ReadiumCSS-before.css +++ b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/rtl/ReadiumCSS-before.css @@ -1,10 +1,17 @@ -/* - * Readium CSS (v. 2.0.0-beta.13) - * Developers: Jiminy Panoz - * Copyright (c) 2017. Readium Foundation. All rights reserved. +/*! + * Readium CSS v.2.0.0-beta.24 + * Copyright (c) 2017–2025. Readium Foundation. All rights reserved. * Use of this source code is governed by a BSD-style license which is detailed in the * LICENSE file present in the project repository where this source code is maintained. -*/ + * Core maintainer: Jiminy Panoz + * Contributors: + * Daniel Weck + * Hadrien Gardeur + * Innovimax + * L. Le Meur + * Mickaël Menu + * k_taka + */ @namespace url("http://www.w3.org/1999/xhtml"); @@ -38,6 +45,31 @@ --RS__lineHeightCompensation:1; --RS__baseLineHeight:calc(1.5 * var(--RS__lineHeightCompensation)); + + --RS__selectionTextColor:inherit; + + --RS__selectionBackgroundColor:#b4d8fe; + + --RS__visitedColor:#551A8B; + + --RS__linkColor:#0000EE; + + --RS__textColor:#121212; + + --RS__backgroundColor:#FFFFFF; + color:var(--RS__textColor) !important; + + background-color:var(--RS__backgroundColor) !important; +} + +::-moz-selection{ + color:var(--RS__selectionTextColor); + background-color:var(--RS__selectionBackgroundColor); +} + +::selection{ + color:var(--RS__selectionTextColor); + background-color:var(--RS__selectionBackgroundColor); } html{ @@ -193,36 +225,6 @@ math{ --RS__lineHeightCompensation:1.167; } -:root{ - - --RS__selectionTextColor:inherit; - - --RS__selectionBackgroundColor:#b4d8fe; - - --RS__visitedColor:#551A8B; - - --RS__linkColor:#0000EE; - - --RS__textColor:#121212; - - --RS__backgroundColor:#FFFFFF; -} - -:root{ - color:var(--RS__textColor) !important; - background-color:var(--RS__backgroundColor) !important; -} - -::-moz-selection{ - color:var(--RS__selectionTextColor); - background-color:var(--RS__selectionBackgroundColor); -} - -::selection{ - color:var(--RS__selectionTextColor); - background-color:var(--RS__selectionBackgroundColor); -} - body{ widows:2; orphans:2; diff --git a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/rtl/ReadiumCSS-default.css b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/rtl/ReadiumCSS-default.css index c54777b89b..8c43482da2 100644 --- a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/rtl/ReadiumCSS-default.css +++ b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/rtl/ReadiumCSS-default.css @@ -1,10 +1,17 @@ -/* - * Readium CSS (v. 2.0.0-beta.13) - * Developers: Jiminy Panoz - * Copyright (c) 2017. Readium Foundation. All rights reserved. +/*! + * Readium CSS v.2.0.0-beta.24 + * Copyright (c) 2017–2025. Readium Foundation. All rights reserved. * Use of this source code is governed by a BSD-style license which is detailed in the * LICENSE file present in the project repository where this source code is maintained. -*/ + * Core maintainer: Jiminy Panoz + * Contributors: + * Daniel Weck + * Hadrien Gardeur + * Innovimax + * L. Le Meur + * Mickaël Menu + * k_taka + */ @namespace url("http://www.w3.org/1999/xhtml"); diff --git a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/webPub/ReadiumCSS-webPub.css b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/webPub/ReadiumCSS-webPub.css new file mode 100644 index 0000000000..a39093baf7 --- /dev/null +++ b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/readium-css/webPub/ReadiumCSS-webPub.css @@ -0,0 +1,290 @@ +/*! + * Readium CSS v.2.0.0-beta.24 + * Copyright (c) 2017–2025. Readium Foundation. All rights reserved. + * Use of this source code is governed by a BSD-style license which is detailed in the + * LICENSE file present in the project repository where this source code is maintained. + * Core maintainer: Jiminy Panoz + * Contributors: + * Daniel Weck + * Hadrien Gardeur + * Innovimax + * L. Le Meur + * Mickaël Menu + * k_taka + */ + +:root[style*="--USER__textAlign"]{ + text-align:var(--USER__textAlign); +} + +:root[style*="--USER__textAlign"] body, +:root[style*="--USER__textAlign"] p:not( + blockquote p, + figcaption p, + header p, + hgroup p, + :root[style*="readium-experimentalHeaderFiltering-on"] p[class*="title"], + :root[style*="readium-experimentalHeaderFiltering-on"] div:has(+ *) > h1 + p, + :root[style*="readium-experimentalHeaderFiltering-on"] div:has(+ *) > p:has(+ h1) +), +:root[style*="--USER__textAlign"] li, +:root[style*="--USER__textAlign"] dd{ + text-align:var(--USER__textAlign) !important; + -moz-text-align-last:auto !important; + -epub-text-align-last:auto !important; + text-align-last:auto !important; +} + +:root[style*="--USER__bodyHyphens"]{ + -webkit-hyphens:var(--USER__bodyHyphens) !important; + -moz-hyphens:var(--USER__bodyHyphens) !important; + -ms-hyphens:var(--USER__bodyHyphens) !important; + -epub-hyphens:var(--USER__bodyHyphens) !important; + hyphens:var(--USER__bodyHyphens) !important; +} + +:root[style*="--USER__bodyHyphens"] body, +:root[style*="--USER__bodyHyphens"] p, +:root[style*="--USER__bodyHyphens"] li, +:root[style*="--USER__bodyHyphens"] div, +:root[style*="--USER__bodyHyphens"] dd{ + -webkit-hyphens:inherit; + -moz-hyphens:inherit; + -ms-hyphens:inherit; + -epub-hyphens:inherit; + hyphens:inherit; +} + +:root[style*="--USER__fontFamily"]{ + font-family:var(--USER__fontFamily) !important; +} + +:root[style*="--USER__fontFamily"] *{ + font-family:revert !important; +} + +:root[style*="AccessibleDfA"]{ + font-family:AccessibleDfA, Verdana, Tahoma, "Trebuchet MS", sans-serif !important; +} + +:root[style*="IA Writer Duospace"]{ + font-family:"IA Writer Duospace", Menlo, "DejaVu Sans Mono", "Bitstream Vera Sans Mono", Courier, monospace !important; +} + +:root[style*="AccessibleDfA"],:root[style*="IA Writer Duospace"], +:root[style*="readium-a11y-on"]{ + font-style:normal !important; + font-weight:normal !important; +} + +:root[style*="AccessibleDfA"] body *:not(code):not(var):not(kbd):not(samp),:root[style*="IA Writer Duospace"] body *:not(code):not(var):not(kbd):not(samp), +:root[style*="readium-a11y-on"] body *:not(code):not(var):not(kbd):not(samp){ + font-family:inherit !important; + font-style:inherit !important; + font-weight:inherit !important; +} + +:root[style*="AccessibleDfA"] body *:not(a),:root[style*="IA Writer Duospace"] body *:not(a), +:root[style*="readium-a11y-on"] body *:not(a){ + text-decoration:none !important; +} + +:root[style*="AccessibleDfA"] body *,:root[style*="IA Writer Duospace"] body *, +:root[style*="readium-a11y-on"] body *{ + font-variant-caps:normal !important; + font-variant-numeric:normal !important; + font-variant-position:normal !important; +} + +:root[style*="AccessibleDfA"] sup,:root[style*="IA Writer Duospace"] sup, +:root[style*="readium-a11y-on"] sup, +:root[style*="AccessibleDfA"] sub, +:root[style*="IA Writer Duospace"] sub, +:root[style*="readium-a11y-on"] sub{ + font-size:1rem !important; + vertical-align:baseline !important; +} + +:root:not([style*="readium-iOSPatch-on"])[style*="--USER__zoom"] body{ + zoom:var(--USER__zoom) !important; +} + +:root[style*="readium-iOSPatch-on"][style*="--USER__zoom"] body{ + -webkit-text-size-adjust:var(--USER__zoom) !important; +} + +@supports selector(figure:has(> img)){ + + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-iOSPatch-on"])[style*="--USER__zoom"] figure:has(> img), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-iOSPatch-on"])[style*="--USER__zoom"] figure:has(> video), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-iOSPatch-on"])[style*="--USER__zoom"] figure:has(> svg), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-iOSPatch-on"])[style*="--USER__zoom"] figure:has(> canvas), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-iOSPatch-on"])[style*="--USER__zoom"] figure:has(> iframe), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-iOSPatch-on"])[style*="--USER__zoom"] figure:has(> audio), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-iOSPatch-on"])[style*="--USER__zoom"] div:has(> img:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-iOSPatch-on"])[style*="--USER__zoom"] div:has(> video:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-iOSPatch-on"])[style*="--USER__zoom"] div:has(> svg:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-iOSPatch-on"])[style*="--USER__zoom"] div:has(> canvas:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-iOSPatch-on"])[style*="--USER__zoom"] div:has(> iframe:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-iOSPatch-on"])[style*="--USER__zoom"] div:has(> audio:only-child), + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-iOSPatch-on"])[style*="--USER__zoom"] table{ + zoom:calc(100% / var(--USER__zoom)) !important; + } + + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-iOSPatch-on"])[style*="--USER__zoom"] figcaption, + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-iOSPatch-on"])[style*="--USER__zoom"] caption, + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-iOSPatch-on"])[style*="--USER__zoom"] td, + :root[style*="readium-experimentalZoom-on"]:not([style*="readium-iOSPatch-on"])[style*="--USER__zoom"] th{ + zoom:var(--USER__zoom) !important; + } +} + +:root[style*="--USER__lineHeight"]{ + line-height:var(--USER__lineHeight) !important; +} + +:root[style*="--USER__lineHeight"] body, +:root[style*="--USER__lineHeight"] p, +:root[style*="--USER__lineHeight"] li, +:root[style*="--USER__lineHeight"] div{ + line-height:inherit; +} + +:root[style*="--USER__paraSpacing"] p{ + margin-top:var(--USER__paraSpacing) !important; + margin-bottom:var(--USER__paraSpacing) !important; +} + +:root[style*="--USER__paraIndent"] p:not( + blockquote p, + figcaption p, + header p, + hgroup p, + :root[style*="readium-experimentalHeaderFiltering-on"] p[class*="title"], + :root[style*="readium-experimentalHeaderFiltering-on"] div:has(+ *) > h1 + p, + :root[style*="readium-experimentalHeaderFiltering-on"] div:has(+ *) > p:has(+ h1) +){ + text-indent:var(--USER__paraIndent) !important; +} + +:root[style*="--USER__paraIndent"] p *, +:root[style*="--USER__paraIndent"] p:first-letter{ + text-indent:0 !important; +} + +:root[style*="--USER__wordSpacing"] h1, +:root[style*="--USER__wordSpacing"] h2, +:root[style*="--USER__wordSpacing"] h3, +:root[style*="--USER__wordSpacing"] h4, +:root[style*="--USER__wordSpacing"] h5, +:root[style*="--USER__wordSpacing"] h6, +:root[style*="--USER__wordSpacing"] p, +:root[style*="--USER__wordSpacing"] li, +:root[style*="--USER__wordSpacing"] div, +:root[style*="--USER__wordSpacing"] dt, +:root[style*="--USER__wordSpacing"] dd{ + word-spacing:var(--USER__wordSpacing); +} + +:root[style*="--USER__letterSpacing"] h1, +:root[style*="--USER__letterSpacing"] h2, +:root[style*="--USER__letterSpacing"] h3, +:root[style*="--USER__letterSpacing"] h4, +:root[style*="--USER__letterSpacing"] h5, +:root[style*="--USER__letterSpacing"] h6, +:root[style*="--USER__letterSpacing"] p, +:root[style*="--USER__letterSpacing"] li, +:root[style*="--USER__letterSpacing"] div, +:root[style*="--USER__letterSpacing"] dt, +:root[style*="--USER__letterSpacing"] dd{ + letter-spacing:var(--USER__letterSpacing); + font-variant:none; +} + +:root[style*="--USER__fontWeight"] body{ + font-weight:var(--USER__fontWeight) !important; +} + +:root[style*="--USER__fontWeight"] b, +:root[style*="--USER__fontWeight"] strong{ + font-weight:bolder; +} + +:root[style*="--USER__fontWidth"] body{ + font-stretch:var(--USER__fontWidth) !important; +} + +:root[style*="--USER__fontOpticalSizing"] body{ + font-optical-sizing:var(--USER__fontOpticalSizing) !important; +} + +:root[style*="readium-noRuby-on"] body rt, +:root[style*="readium-noRuby-on"] body rp{ + display:none; +} + +:root[style*="--USER__ligatures"]{ + font-variant-ligatures:var(--USER__ligatures) !important; +} + +:root[style*="--USER__ligatures"] *{ + font-variant-ligatures:inherit !important; +} + +:root[style*="readium-iPadOSPatch-on"] body{ + -webkit-text-size-adjust:none; +} + +:root[style*="readium-iPadOSPatch-on"] p, +:root[style*="readium-iPadOSPatch-on"] h1, +:root[style*="readium-iPadOSPatch-on"] h2, +:root[style*="readium-iPadOSPatch-on"] h3, +:root[style*="readium-iPadOSPatch-on"] h4, +:root[style*="readium-iPadOSPatch-on"] h5, +:root[style*="readium-iPadOSPatch-on"] h6, +:root[style*="readium-iPadOSPatch-on"] li, +:root[style*="readium-iPadOSPatch-on"] th, +:root[style*="readium-iPadOSPatch-on"] td, +:root[style*="readium-iPadOSPatch-on"] dt, +:root[style*="readium-iPadOSPatch-on"] dd, +:root[style*="readium-iPadOSPatch-on"] pre, +:root[style*="readium-iPadOSPatch-on"] address, +:root[style*="readium-iPadOSPatch-on"] details, +:root[style*="readium-iPadOSPatch-on"] summary, +:root[style*="readium-iPadOSPatch-on"] figcaption, +:root[style*="readium-iPadOSPatch-on"] div:not(:has(p, h1, h2, h3, h4, h5, h6, li, th, td, dt, dd, pre, address, aside, details, figcaption, summary)), +:root[style*="readium-iPadOSPatch-on"] aside:not(:has(p, h1, h2, h3, h4, h5, h6, li, th, td, dt, dd, pre, address, aside, details, figcaption, summary)){ + -webkit-text-zoom:reset; +} + +:root[style*="readium-iPadOSPatch-on"] abbr, +:root[style*="readium-iPadOSPatch-on"] b, +:root[style*="readium-iPadOSPatch-on"] bdi, +:root[style*="readium-iPadOSPatch-on"] bdo, +:root[style*="readium-iPadOSPatch-on"] cite, +:root[style*="readium-iPadOSPatch-on"] code, +:root[style*="readium-iPadOSPatch-on"] dfn, +:root[style*="readium-iPadOSPatch-on"] em, +:root[style*="readium-iPadOSPatch-on"] i, +:root[style*="readium-iPadOSPatch-on"] kbd, +:root[style*="readium-iPadOSPatch-on"] mark, +:root[style*="readium-iPadOSPatch-on"] q, +:root[style*="readium-iPadOSPatch-on"] rp, +:root[style*="readium-iPadOSPatch-on"] rt, +:root[style*="readium-iPadOSPatch-on"] ruby, +:root[style*="readium-iPadOSPatch-on"] s, +:root[style*="readium-iPadOSPatch-on"] samp, +:root[style*="readium-iPadOSPatch-on"] small, +:root[style*="readium-iPadOSPatch-on"] span, +:root[style*="readium-iPadOSPatch-on"] strong, +:root[style*="readium-iPadOSPatch-on"] sub, +:root[style*="readium-iPadOSPatch-on"] sup, +:root[style*="readium-iPadOSPatch-on"] time, +:root[style*="readium-iPadOSPatch-on"] u, +:root[style*="readium-iPadOSPatch-on"] var{ + -webkit-text-zoom:normal; +} + +:root[style*="readium-iPadOSPatch-on"] p:not(:has(b, cite, em, i, q, s, small, span, strong)):first-line{ + -webkit-text-zoom:normal; +} \ No newline at end of file diff --git a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/reflowable-injectable-script.js b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/reflowable-injectable-script.js index 7552088083..ee8e592059 100644 --- a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/reflowable-injectable-script.js +++ b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/reflowable-injectable-script.js @@ -1,2 +1,2 @@ -!function(){var t={1844:function(t,e){"use strict";function r(t){return t.split("").reverse().join("")}function n(t){return(t|-t)>>31&1}function o(t,e,r,o){var i=t.P[r],a=t.M[r],c=o>>>31,s=e[r]|c,u=s|a,l=(s&i)+i^i|s,f=a|~(l|i),p=i&l,y=n(f&t.lastRowMask[r])-n(p&t.lastRowMask[r]);return f<<=1,p<<=1,i=(p|=c)|~(u|(f|=n(o)-c)),a=f&u,t.P[r]=i,t.M[r]=a,y}function i(t,e,r){if(0===e.length)return[];r=Math.min(r,e.length);var n=[],i=32,a=Math.ceil(e.length/i)-1,c={P:new Uint32Array(a+1),M:new Uint32Array(a+1),lastRowMask:new Uint32Array(a+1)};c.lastRowMask.fill(1<<31),c.lastRowMask[a]=1<<(e.length-1)%i;for(var s=new Uint32Array(a+1),u=new Map,l=[],f=0;f<256;f++)l.push(s);for(var p=0;p=e.length||e.charCodeAt(m)===y&&(h[d]|=1<0&&w[b]>=r+i;)b-=1;b===a&&w[b]<=r&&(w[b]-1?o(r):r}},2755:function(t,e,r){"use strict";var n=r(3569),o=r(2870),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),c=o("%Reflect.apply%",!0)||n.call(a,i),s=o("%Object.getOwnPropertyDescriptor%",!0),u=o("%Object.defineProperty%",!0),l=o("%Math.max%");if(u)try{u({},"a",{value:1})}catch(t){u=null}t.exports=function(t){var e=c(n,a,arguments);return s&&u&&s(e,"length").configurable&&u(e,"length",{value:1+l(0,t.length-(arguments.length-1))}),e};var f=function(){return c(n,i,arguments)};u?u(t.exports,"apply",{value:f}):t.exports.apply=f},6663:function(t,e,r){"use strict";var n=r(229)(),o=r(2870),i=n&&o("%Object.defineProperty%",!0),a=o("%SyntaxError%"),c=o("%TypeError%"),s=r(658);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new c("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new c("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new c("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new c("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new c("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new c("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!s&&s(t,e);if(i)i(t,e,{configurable:null===u&&f?f.configurable:!u,enumerable:null===n&&f?f.enumerable:!n,value:r,writable:null===o&&f?f.writable:!o});else{if(!l&&(n||o||u))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},9722:function(t,e,r){"use strict";var n=r(2051),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,c=r(6663),s=r(229)(),u=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;s?c(t,e,r,!0):c(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var c=0;c2&&arguments[2]&&arguments[2].force;!a||!r&&i(t,a)||(n?n(t,a,{configurable:!0,enumerable:!1,value:e,writable:!1}):t[a]=e)}},7358:function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(7959),i=r(3655),a=r(455),c=r(8760);t.exports=function(t){if(o(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!i(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):c(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var s=e.call(t,r);if(o(s))return s;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(a(t)||c(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,a,c="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a1&&"boolean"!=typeof e)throw new a('"allowMissing" argument must be a boolean');if(null===j(/^%?[^%]*%?$/,t))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=O(t,0,1),r=O(t,-1);if("%"===e&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return A(t,P,(function(t,e,r,o){n[n.length]=r?A(o,R,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=C("%"+n+"%",e),c=i.name,u=i.value,l=!1,f=i.alias;f&&(n=f[0],E(r,S([0,1],f)));for(var p=1,y=!0;p=r.length){var b=s(u,h);u=(y=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:u[h]}else y=x(u,h),u=u[h];y&&!l&&(g[c]=u)}}return u}},658:function(t,e,r){"use strict";var n=r(2870)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},229:function(t,e,r){"use strict";var n=r(2870)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},3413:function(t){"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},1143:function(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(9985);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},9985:function(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},3060:function(t,e,r){"use strict";var n=r(9985);t.exports=function(){return n()&&!!Symbol.toStringTag}},9545:function(t){"use strict";var e={}.hasOwnProperty,r=Function.prototype.call;t.exports=r.bind?r.bind(e):function(t,n){return r.call(e,t,n)}},7284:function(t,e,r){"use strict";var n=r(2870),o=r(9545),i=r(5714)(),a=n("%TypeError%"),c={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");if(i.assert(t),!c.has(t,e))throw new a("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");var r=i.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");var r=i.get(t);return!!r&&o(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");var n=i.get(t);n||(n={},i.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(c),t.exports=c},3655:function(t){"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},c=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},s=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;s.call(p)===s.call(document.all)&&(f=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=s.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&c(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(u)return c(t);if(a(t))return!1;var e=s.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&c(t)}},455:function(t,e,r){"use strict";var n=Date.prototype.getDay,o=Object.prototype.toString,i=r(3060)();t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},5494:function(t,e,r){"use strict";var n,o,i,a,c=r(3099),s=r(3060)();if(s){n=c("Object.prototype.hasOwnProperty"),o=c("RegExp.prototype.exec"),i={};var u=function(){throw i};a={toString:u,valueOf:u},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=u)}var l=c("Object.prototype.toString"),f=Object.getOwnPropertyDescriptor;t.exports=s?function(t){if(!t||"object"!=typeof t)return!1;var e=f(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{o(t,a)}catch(t){return t===i}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},8760:function(t,e,r){"use strict";var n=Object.prototype.toString;if(r(1143)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},4538:function(t,e,r){var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,c="function"==typeof Set&&Set.prototype,s=Object.getOwnPropertyDescriptor&&c?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=c&&s&&"function"==typeof s.get?s.get:null,l=c&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,d=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,w=String.prototype.replace,v=String.prototype.toUpperCase,x=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,O=Array.prototype.slice,j=Math.floor,P="function"==typeof BigInt?BigInt.prototype.valueOf:null,R=Object.getOwnPropertySymbols,C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,T="function"==typeof Symbol&&"object"==typeof Symbol.iterator,I="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,M=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function $(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||S.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-j(-t):j(t);if(n!==t){var o=String(n),i=b.call(e,o.length+1);return w.call(o,r,"$&_")+"."+w.call(w.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return w.call(e,r,"$&_")}var D=r(7002),F=D.custom,k=_(F)?F:null;function B(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function L(t){return w.call(String(t),/"/g,""")}function W(t){return!("[object Array]"!==H(t)||I&&"object"==typeof t&&I in t)}function U(t){return!("[object RegExp]"!==H(t)||I&&"object"==typeof t&&I in t)}function _(t){if(T)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!C)return!1;try{return C.call(t),!0}catch(t){}return!1}t.exports=function t(e,r,n,o){var c=r||{};if(V(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(V(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=!V(c,"customInspect")||c.customInspect;if("boolean"!=typeof s&&"symbol"!==s)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(V(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(V(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var d=c.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return z(e,c);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var v=String(e);return d?$(e,v):v}if("bigint"==typeof e){var S=String(e)+"n";return d?$(e,S):S}var j=void 0===c.depth?5:c.depth;if(void 0===n&&(n=0),n>=j&&j>0&&"object"==typeof e)return W(e)?"[Array]":"[Object]";var R,F=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=A.call(Array(t.indent+1)," ")}return{base:r,prev:A.call(Array(e+1),r)}}(c,n);if(void 0===o)o=[];else if(q(o,e)>=0)return"[Circular]";function G(e,r,i){if(r&&(o=O.call(o)).push(r),i){var a={depth:c.depth};return V(c,"quoteStyle")&&(a.quoteStyle=c.quoteStyle),t(e,a,n+1,o)}return t(e,c,n+1,o)}if("function"==typeof e&&!U(e)){var X=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),tt=Q(e,G);return"[Function"+(X?": "+X:" (anonymous)")+"]"+(tt.length>0?" { "+A.call(tt,", ")+" }":"")}if(_(e)){var et=T?w.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):C.call(e);return"object"!=typeof e||T?et:J(et)}if((R=e)&&"object"==typeof R&&("undefined"!=typeof HTMLElement&&R instanceof HTMLElement||"string"==typeof R.nodeName&&"function"==typeof R.getAttribute)){for(var rt="<"+x.call(String(e.nodeName)),nt=e.attributes||[],ot=0;ot"}if(W(e)){if(0===e.length)return"[]";var it=Q(e,G);return F&&!function(t){for(var e=0;e=0)return!1;return!0}(it)?"["+Z(it,F)+"]":"[ "+A.call(it,", ")+" ]"}if(function(t){return!("[object Error]"!==H(t)||I&&"object"==typeof t&&I in t)}(e)){var at=Q(e,G);return"cause"in Error.prototype||!("cause"in e)||N.call(e,"cause")?0===at.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(at,", ")+" }":"{ ["+String(e)+"] "+A.call(E.call("[cause]: "+G(e.cause),at),", ")+" }"}if("object"==typeof e&&s){if(k&&"function"==typeof e[k]&&D)return D(e,{depth:j-n});if("symbol"!==s&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{u.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ct=[];return a&&a.call(e,(function(t,r){ct.push(G(r,e,!0)+" => "+G(t,e))})),Y("Map",i.call(e),ct,F)}if(function(t){if(!u||!t||"object"!=typeof t)return!1;try{u.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var st=[];return l&&l.call(e,(function(t){st.push(G(t,e))})),Y("Set",u.call(e),st,F)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return K("WeakMap");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return K("WeakSet");if(function(t){if(!y||!t||"object"!=typeof t)return!1;try{return y.call(t),!0}catch(t){}return!1}(e))return K("WeakRef");if(function(t){return!("[object Number]"!==H(t)||I&&"object"==typeof t&&I in t)}(e))return J(G(Number(e)));if(function(t){if(!t||"object"!=typeof t||!P)return!1;try{return P.call(t),!0}catch(t){}return!1}(e))return J(G(P.call(e)));if(function(t){return!("[object Boolean]"!==H(t)||I&&"object"==typeof t&&I in t)}(e))return J(h.call(e));if(function(t){return!("[object String]"!==H(t)||I&&"object"==typeof t&&I in t)}(e))return J(G(String(e)));if(!function(t){return!("[object Date]"!==H(t)||I&&"object"==typeof t&&I in t)}(e)&&!U(e)){var ut=Q(e,G),lt=M?M(e)===Object.prototype:e instanceof Object||e.constructor===Object,ft=e instanceof Object?"":"null prototype",pt=!lt&&I&&Object(e)===e&&I in e?b.call(H(e),8,-1):ft?"Object":"",yt=(lt||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(pt||ft?"["+A.call(E.call([],pt||[],ft||[]),": ")+"] ":"");return 0===ut.length?yt+"{}":F?yt+"{"+Z(ut,F)+"}":yt+"{ "+A.call(ut,", ")+" }"}return String(e)};var G=Object.prototype.hasOwnProperty||function(t){return t in this};function V(t,e){return G.call(t,e)}function H(t){return d.call(t)}function q(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return z(b.call(t,0,e.maxStringLength),e)+n}return B(w.call(w.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,X),"single",e)}function X(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+v.call(e.toString(16))}function J(t){return"Object("+t+")"}function K(t){return t+" { ? }"}function Y(t,e,r,n){return t+" ("+e+") {"+(n?Z(r,n):A.call(r,", "))+"}"}function Z(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+A.call(t,","+r)+"\n"+e.prev}function Q(t,e){var r=W(t),n=[];if(r){n.length=t.length;for(var o=0;o0&&!o.call(t,0))for(var d=0;d0)for(var g=0;g=0&&"[object Function]"===e.call(t.callee)),n}},9766:function(t,e,r){"use strict";var n=r(8921),o=Object,i=TypeError;t.exports=n((function(){if(null!=this&&this!==o(this))throw new i("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t}),"get flags",!0)},483:function(t,e,r){"use strict";var n=r(9722),o=r(2755),i=r(9766),a=r(5113),c=r(7299),s=o(a());n(s,{getPolyfill:a,implementation:i,shim:c}),t.exports=s},5113:function(t,e,r){"use strict";var n=r(9766),o=r(9722).supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(o&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}},7299:function(t,e,r){"use strict";var n=r(9722).supportsDescriptors,o=r(5113),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,c=TypeError,s=Object.getPrototypeOf,u=/a/;t.exports=function(){if(!n||!s)throw new c("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=s(u),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},7582:function(t,e,r){"use strict";var n=r(3099),o=r(2870),i=r(5494),a=n("RegExp.prototype.exec"),c=o("%TypeError%");t.exports=function(t){if(!i(t))throw new c("`regex` must be a RegExp");return function(e){return null!==a(t,e)}}},8921:function(t,e,r){"use strict";var n=r(6663),o=r(229)(),i=r(5610).functionsHaveConfigurableNames(),a=TypeError;t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!i||(o?n(t,"name",e,!0,!0):n(t,"name",e)),t}},5714:function(t,e,r){"use strict";var n=r(2870),o=r(3099),i=r(4538),a=n("%TypeError%"),c=n("%WeakMap%",!0),s=n("%Map%",!0),u=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),y=o("Map.prototype.set",!0),h=o("Map.prototype.has",!0),d=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new a("Side channel does not contain "+i(t))},get:function(n){if(c&&n&&("object"==typeof n||"function"==typeof n)){if(t)return u(t,n)}else if(s){if(e)return p(e,n)}else if(r)return function(t,e){var r=d(t,e);return r&&r.value}(r,n)},has:function(n){if(c&&n&&("object"==typeof n||"function"==typeof n)){if(t)return f(t,n)}else if(s){if(e)return h(e,n)}else if(r)return function(t,e){return!!d(t,e)}(r,n);return!1},set:function(n,o){c&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new c),l(t,n,o)):s?(e||(e=new s),y(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=d(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n}},3073:function(t,e,r){"use strict";var n=r(7113),o=r(151),i=r(1959),a=r(9497),c=r(5128),s=r(6751),u=r(3099),l=r(1143)(),f=r(483),p=u("String.prototype.indexOf"),y=r(2009),h=function(t){var e=y();if(l&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===RegExp.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=s(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(s(r),p(c(r),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var i=h(t);if(void 0!==i)return n(i,t,[e])}var u=c(e),l=new RegExp(t,"g");return n(h(l),l,[u])}},5155:function(t,e,r){"use strict";var n=r(2755),o=r(9722),i=r(3073),a=r(1794),c=r(3911),s=n(i);o(s,{getPolyfill:a,implementation:i,shim:c}),t.exports=s},2009:function(t,e,r){"use strict";var n=r(1143)(),o=r(8012);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},1794:function(t,e,r){"use strict";var n=r(3073);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},8012:function(t,e,r){"use strict";var n=r(1398),o=r(151),i=r(8322),a=r(2449),c=r(3995),s=r(5128),u=r(1874),l=r(483),f=r(8921),p=r(3099)("String.prototype.indexOf"),y=RegExp,h="flags"in RegExp.prototype,d=f((function(t){var e=this;if("Object"!==u(e))throw new TypeError('"this" value must be an Object');var r=s(t),f=function(t,e){var r="flags"in e?o(e,"flags"):s(l(e));return{flags:r,matcher:new t(h&&"string"==typeof r?e:t===y?e.source:e,r)}}(a(e,y),e),d=f.flags,g=f.matcher,m=c(o(e,"lastIndex"));i(g,"lastIndex",m,!0);var b=p(d,"g")>-1,w=p(d,"u")>-1;return n(g,r,b,w)}),"[Symbol.matchAll]",!0);t.exports=d},3911:function(t,e,r){"use strict";var n=r(9722),o=r(1143)(),i=r(1794),a=r(2009),c=Object.defineProperty,s=Object.getOwnPropertyDescriptor;t.exports=function(){var t=i();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),o){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),c&&s){var r=s(Symbol,e);r&&!r.configurable||c(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var u=a(),l={};l[e]=u;var f={};f[e]=function(){return RegExp.prototype[e]!==u},n(RegExp.prototype,l,f)}return t}},8125:function(t,e,r){"use strict";var n=r(6751),o=r(5128),i=r(3099)("String.prototype.replace"),a=/^\s$/.test("᠎"),c=a?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,s=a?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=o(n(this));return i(i(t,c,""),s,"")}},9434:function(t,e,r){"use strict";var n=r(2755),o=r(9722),i=r(6751),a=r(8125),c=r(3228),s=r(818),u=n(c()),l=function(t){return i(t),u(t)};o(l,{getPolyfill:c,implementation:a,shim:s}),t.exports=l},3228:function(t,e,r){"use strict";var n=r(8125);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},818:function(t,e,r){"use strict";var n=r(9722),o=r(3228);t.exports=function(){var t=o();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},7002:function(){},1510:function(t,e,r){"use strict";var n=r(2870),o=r(6318),i=r(1874),a=r(2990),c=r(5674),s=n("%TypeError%");t.exports=function(t,e,r){if("String"!==i(t))throw new s("Assertion failed: `S` must be a String");if(!a(e)||e<0||e>c)throw new s("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==i(r))throw new s("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+o(t,e)["[[CodeUnitCount]]"]:e+1}},7113:function(t,e,r){"use strict";var n=r(2870),o=r(3099),i=n("%TypeError%"),a=r(6287),c=n("%Reflect.apply%",!0)||o("Function.prototype.apply");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!a(r))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return c(t,e,r)}},6318:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(3099),i=r(5541),a=r(959),c=r(1874),s=r(1751),u=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("String"!==c(t))throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var o=l(t,e),f=u(t,e),p=i(o),y=a(o);if(!p&&!y)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(y||e+1===r)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var h=l(t,e+1);return a(h)?{"[[CodePoint]]":s(o,h),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},5702:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(1874);t.exports=function(t,e){if("Boolean"!==o(e))throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},6782:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(2860),i=r(8357),a=r(3301),c=r(6284),s=r(8277),u=r(1874);t.exports=function(t,e,r){if("Object"!==u(t))throw new n("Assertion failed: Type(O) is not Object");if(!c(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return o(a,s,i,t,e,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0})}},1398:function(t,e,r){"use strict";var n=r(2870),o=r(1143)(),i=n("%TypeError%"),a=n("%IteratorPrototype%",!0),c=r(1510),s=r(5702),u=r(6782),l=r(151),f=r(5716),p=r(3500),y=r(8322),h=r(3995),d=r(5128),g=r(1874),m=r(7284),b=r(2263),w=function(t,e,r,n){if("String"!==g(e))throw new i("`S` must be a string");if("Boolean"!==g(r))throw new i("`global` must be a boolean");if("Boolean"!==g(n))throw new i("`fullUnicode` must be a boolean");m.set(this,"[[IteratingRegExp]]",t),m.set(this,"[[IteratedString]]",e),m.set(this,"[[Global]]",r),m.set(this,"[[Unicode]]",n),m.set(this,"[[Done]]",!1)};a&&(w.prototype=f(a)),u(w.prototype,"next",(function(){var t=this;if("Object"!==g(t))throw new i("receiver must be an object");if(!(t instanceof w&&m.has(t,"[[IteratingRegExp]]")&&m.has(t,"[[IteratedString]]")&&m.has(t,"[[Global]]")&&m.has(t,"[[Unicode]]")&&m.has(t,"[[Done]]")))throw new i('"this" value must be a RegExpStringIterator instance');if(m.get(t,"[[Done]]"))return s(void 0,!0);var e=m.get(t,"[[IteratingRegExp]]"),r=m.get(t,"[[IteratedString]]"),n=m.get(t,"[[Global]]"),o=m.get(t,"[[Unicode]]"),a=p(e,r);if(null===a)return m.set(t,"[[Done]]",!0),s(void 0,!0);if(n){if(""===d(l(a,"0"))){var u=h(l(e,"lastIndex")),f=c(r,u,o);y(e,"lastIndex",f,!0)}return s(a,!1)}return m.set(t,"[[Done]]",!0),s(a,!1)})),o&&(b(w.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof w.prototype[Symbol.iterator])&&u(w.prototype,Symbol.iterator,(function(){return this})),t.exports=function(t,e,r,n){return new w(t,e,r,n)}},3645:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(7999),i=r(2860),a=r(8357),c=r(8355),s=r(3301),u=r(6284),l=r(8277),f=r(7628),p=r(1874);t.exports=function(t,e,r){if("Object"!==p(t))throw new n("Assertion failed: Type(O) is not Object");if(!u(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var y=o({Type:p,IsDataDescriptor:s,IsAccessorDescriptor:c},r)?r:f(r);if(!o({Type:p,IsDataDescriptor:s,IsAccessorDescriptor:c},y))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return i(s,l,a,t,e,y)}},8357:function(t,e,r){"use strict";var n=r(1489),o=r(1598),i=r(1874);t.exports=function(t){return void 0!==t&&n(i,"Property Descriptor","Desc",t),o(t)}},151:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(4538),i=r(6284),a=r(1874);t.exports=function(t,e){if("Object"!==a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},1959:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(9374),i=r(7304),a=r(6284),c=r(4538);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var r=o(t,e);if(null!=r){if(!i(r))throw new n(c(e)+" is not a function: "+c(r));return r}}},9374:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(4538),i=r(6284);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},8355:function(t,e,r){"use strict";var n=r(9545),o=r(1874),i=r(1489);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Get]]")&&!n(t,"[[Set]]")))}},6287:function(t,e,r){"use strict";t.exports=r(2403)},7304:function(t,e,r){"use strict";t.exports=r(3655)},4791:function(t,e,r){"use strict";var n=r(6740)("%Reflect.construct%",!0),o=r(3645);try{o({},"",{"[[Get]]":function(){}})}catch(t){o=null}if(o&&n){var i={},a={};o(a,"length",{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,a)}catch(t){return t===i}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},3301:function(t,e,r){"use strict";var n=r(9545),o=r(1874),i=r(1489);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Value]]")&&!n(t,"[[Writable]]")))}},6284:function(t){"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},9497:function(t,e,r){"use strict";var n=r(2870)("%Symbol.match%",!0),o=r(5494),i=r(5695);t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(n){var e=t[n];if(void 0!==e)return i(e)}return o(t)}},5716:function(t,e,r){"use strict";var n=r(2870),o=n("%Object.create%",!0),i=n("%TypeError%"),a=n("%SyntaxError%"),c=r(6287),s=r(1874),u=r(7735),l=r(7284),f=r(3413)();t.exports=function(t){if(null!==t&&"Object"!==s(t))throw new i("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!c(r))throw new i("Assertion failed: `additionalInternalSlotsList` must be an Array");if(o)e=o(t);else if(f)e={__proto__:t};else{if(null===t)throw new a("native Object.create support is required to create null objects");var n=function(){};n.prototype=t,e=new n}return r.length>0&&u(r,(function(t){l.set(e,t,void 0)})),e}},3500:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(3099)("RegExp.prototype.exec"),i=r(7113),a=r(151),c=r(7304),s=r(1874);t.exports=function(t,e){if("Object"!==s(t))throw new n("Assertion failed: `R` must be an Object");if("String"!==s(e))throw new n("Assertion failed: `S` must be a String");var r=a(t,"exec");if(c(r)){var u=i(r,t,[e]);if(null===u||"Object"===s(u))return u;throw new n('"exec" method must return `null` or an Object')}return o(t,e)}},6751:function(t,e,r){"use strict";t.exports=r(9572)},8277:function(t,e,r){"use strict";var n=r(159);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},8322:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(6284),i=r(8277),a=r(1874),c=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,s){if("Object"!==a(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");if("Boolean"!==a(s))throw new n("Assertion failed: `Throw` must be a Boolean");if(s){if(t[e]=r,c&&!i(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!c||i(t[e],r)}catch(t){return!1}}},2449:function(t,e,r){"use strict";var n=r(2870),o=n("%Symbol.species%",!0),i=n("%TypeError%"),a=r(4791),c=r(1874);t.exports=function(t,e){if("Object"!==c(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==c(r))throw new i("O.constructor is not an Object");var n=o?r[o]:void 0;if(null==n)return e;if(a(n))return n;throw new i("no constructor found")}},6207:function(t,e,r){"use strict";var n=r(2870),o=n("%Number%"),i=n("%RegExp%"),a=n("%TypeError%"),c=n("%parseInt%"),s=r(3099),u=r(7582),l=s("String.prototype.slice"),f=u(/^0b[01]+$/i),p=u(/^0o[0-7]+$/i),y=u(/^[-+]0x[0-9a-f]+$/i),h=u(new i("["+["…","​","￾"].join("")+"]","g")),d=r(9434),g=r(1874);t.exports=function t(e){if("String"!==g(e))throw new a("Assertion failed: `argument` is not a String");if(f(e))return o(c(l(e,2),2));if(p(e))return o(c(l(e,2),8));if(h(e)||y(e))return NaN;var r=d(e);return r!==e?t(r):o(e)}},5695:function(t){"use strict";t.exports=function(t){return!!t}},1200:function(t,e,r){"use strict";var n=r(6542),o=r(5693),i=r(159),a=r(1117);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},3995:function(t,e,r){"use strict";var n=r(5674),o=r(1200);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},6542:function(t,e,r){"use strict";var n=r(2870),o=n("%TypeError%"),i=n("%Number%"),a=r(8606),c=r(703),s=r(6207);t.exports=function(t){var e=a(t)?t:c(t,i);if("symbol"==typeof e)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?s(e):i(e)}},703:function(t,e,r){"use strict";var n=r(7358);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},7628:function(t,e,r){"use strict";var n=r(9545),o=r(2870)("%TypeError%"),i=r(1874),a=r(5695),c=r(7304);t.exports=function(t){if("Object"!==i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=a(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=a(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=a(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!c(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var s=t.set;if(void 0!==s&&!c(s))throw new o("setter must be a function");e["[[Set]]"]=s}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},5128:function(t,e,r){"use strict";var n=r(2870),o=n("%String%"),i=n("%TypeError%");t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return o(t)}},1874:function(t,e,r){"use strict";var n=r(6101);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},1751:function(t,e,r){"use strict";var n=r(2870),o=n("%TypeError%"),i=n("%String.fromCharCode%"),a=r(5541),c=r(959);t.exports=function(t,e){if(!a(t)||!c(e))throw new o("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(t)+i(e)}},3567:function(t,e,r){"use strict";var n=r(1874),o=Math.floor;t.exports=function(t){return"BigInt"===n(t)?t:o(t)}},5693:function(t,e,r){"use strict";var n=r(2870),o=r(3567),i=n("%TypeError%");t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-o(-t):o(t);return 0===e?0:e}},9572:function(t,e,r){"use strict";var n=r(2870)("%TypeError%");t.exports=function(t,e){if(null==t)throw new n(e||"Cannot call method on "+t);return t}},6101:function(t){"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},6740:function(t,e,r){"use strict";t.exports=r(2870)},2860:function(t,e,r){"use strict";var n=r(229),o=r(2870),i=n()&&o("%Object.defineProperty%",!0),a=n.hasArrayLengthDefineBug(),c=a&&r(2403),s=r(3099)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,o,u){if(!i){if(!t(u))return!1;if(!u["[[Configurable]]"]||!u["[[Writable]]"])return!1;if(o in n&&s(n,o)!==!!u["[[Enumerable]]"])return!1;var l=u["[[Value]]"];return n[o]=l,e(n[o],l)}return a&&"length"===o&&"[[Value]]"in u&&c(n)&&n.length!==u["[[Value]]"]?(n.length=u["[[Value]]"],n.length===u["[[Value]]"]):(i(n,o,r(u)),!0)}},2403:function(t,e,r){"use strict";var n=r(2870)("%Array%"),o=!n.isArray&&r(3099)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},1489:function(t,e,r){"use strict";var n=r(2870),o=n("%TypeError%"),i=n("%SyntaxError%"),a=r(9545),c=r(2990),s={"Property Descriptor":function(t){var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!t)return!1;for(var r in t)if(a(t,r)&&!e[r])return!1;var n=a(t,"[[Value]]"),i=a(t,"[[Get]]")||a(t,"[[Set]]");if(n&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":r(900),"Iterator Record":function(t){return a(t,"[[Iterator]]")&&a(t,"[[NextMethod]]")&&a(t,"[[Done]]")},"PromiseCapability Record":function(t){return!!t&&a(t,"[[Resolve]]")&&"function"==typeof t["[[Resolve]]"]&&a(t,"[[Reject]]")&&"function"==typeof t["[[Reject]]"]&&a(t,"[[Promise]]")&&t["[[Promise]]"]&&"function"==typeof t["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(t){return!!t&&a(t,"[[Completion]]")&&a(t,"[[Capability]]")&&s["PromiseCapability Record"](t["[[Capability]]"])},"RegExp Record":function(t){return t&&a(t,"[[IgnoreCase]]")&&"boolean"==typeof t["[[IgnoreCase]]"]&&a(t,"[[Multiline]]")&&"boolean"==typeof t["[[Multiline]]"]&&a(t,"[[DotAll]]")&&"boolean"==typeof t["[[DotAll]]"]&&a(t,"[[Unicode]]")&&"boolean"==typeof t["[[Unicode]]"]&&a(t,"[[CapturingGroupsCount]]")&&"number"==typeof t["[[CapturingGroupsCount]]"]&&c(t["[[CapturingGroupsCount]]"])&&t["[[CapturingGroupsCount]]"]>=0}};t.exports=function(t,e,r,n){var a=s[e];if("function"!=typeof a)throw new i("unknown record type: "+e);if("Object"!==t(n)||!a(n))throw new o(r+" must be a "+e)}},7735:function(t){"use strict";t.exports=function(t,e){for(var r=0;r=55296&&t<=56319}},900:function(t,e,r){"use strict";var n=r(9545);t.exports=function(t){return n(t,"[[StartIndex]]")&&n(t,"[[EndIndex]]")&&t["[[StartIndex]]"]>=0&&t["[[EndIndex]]"]>=t["[[StartIndex]]"]&&String(parseInt(t["[[StartIndex]]"],10))===String(t["[[StartIndex]]"])&&String(parseInt(t["[[EndIndex]]"],10))===String(t["[[EndIndex]]"])}},159:function(t){"use strict";t.exports=Number.isNaN||function(t){return t!=t}},8606:function(t){"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},7999:function(t,e,r){"use strict";var n=r(2870),o=r(9545),i=n("%TypeError%");t.exports=function(t,e){if("Object"!==t.Type(e))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(o(e,n)&&!r[n])return!1;if(t.IsDataDescriptor(e)&&t.IsAccessorDescriptor(e))throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}},959:function(t){"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},5674:function(t){"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";const t=!1;function e(...e){t&&console.log(...e)}function n(t,e){return{bottom:t.bottom/e,height:t.height/e,left:t.left/e,right:t.right/e,top:t.top/e,width:t.width/e}}function o(t){return{width:t.width,height:t.height,left:t.left,top:t.top,right:t.right,bottom:t.bottom}}function i(t,r){const n=t.getClientRects(),o=[];for(const t of n)o.push({bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width});const i=l(function(t,r){const n=new Set(t);for(const r of t)if(r.width>1&&r.height>1){for(const o of t)if(r!==o&&n.has(o)&&s(o,r,1)){e("CLIENT RECT: remove contained"),n.delete(r);break}}else e("CLIENT RECT: remove tiny"),n.delete(r);return Array.from(n)}(a(o,1,r)));for(let t=i.length-1;t>=0;t--){const r=i[t];if(!(r.width*r.height>4)){if(!(i.length>1)){e("CLIENT RECT: remove small, but keep otherwise empty!");break}e("CLIENT RECT: remove small"),i.splice(t,1)}}return e(`CLIENT RECT: reduced ${o.length} --\x3e ${i.length}`),i}function a(t,r,n){for(let o=0;ot!==s&&t!==u)),i=c(s,u);return o.push(i),a(o,r,n)}}return t}function c(t,e){const r=Math.min(t.left,e.left),n=Math.max(t.right,e.right),o=Math.min(t.top,e.top),i=Math.max(t.bottom,e.bottom);return{bottom:i,height:i-o,left:r,right:n,top:o,width:n-r}}function s(t,e,r){return u(t,e.left,e.top,r)&&u(t,e.right,e.top,r)&&u(t,e.left,e.bottom,r)&&u(t,e.right,e.bottom,r)}function u(t,e,r,n){return(t.lefte||y(t.right,e,n))&&(t.topr||y(t.bottom,r,n))}function l(t){for(let r=0;rt!==r));return Array.prototype.push.apply(c,n),l(c)}}else e("replaceOverlapingRects rect1 === rect2 ??!")}return t}function f(t,e){const r=function(t,e){const r=Math.max(t.left,e.left),n=Math.min(t.right,e.right),o=Math.max(t.top,e.top),i=Math.min(t.bottom,e.bottom);return{bottom:i,height:Math.max(0,i-o),left:r,right:n,top:o,width:Math.max(0,n-r)}}(e,t);if(0===r.height||0===r.width)return[t];const n=[];{const e={bottom:t.bottom,height:0,left:t.left,right:r.left,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:r.top,height:0,left:r.left,right:r.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.left,right:r.right,top:r.bottom,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.right,right:t.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}return n}function p(t,e,r){return(t.left=0&&y(t.left,e.right,r))&&(e.left=0&&y(e.left,t.right,r))&&(t.top=0&&y(t.top,e.bottom,r))&&(e.top=0&&y(e.top,t.bottom,r))}function y(t,e,r){return Math.abs(t-e)<=r}var h,d,g=r(1844);function m(t,e,r){let n=0;const o=[];for(;-1!==n;)n=t.indexOf(e,n),-1!==n&&(o.push({start:n,end:n+e.length,errors:0}),n+=1);return o.length>0?o:(0,g.Z)(t,e,r)}function b(t,e){return 0===e.length||0===t.length?0:1-m(t,e,e.length)[0].errors/e.length}function w(t,e,r){const n=r===h.Forwards?e:e-1;if(""!==t.charAt(n).trim())return e;let o,i;if(r===h.Backwards?(o=t.substring(0,e),i=o.trimEnd()):(o=t.substring(e),i=o.trimStart()),!i.length)return-1;const a=o.length-i.length;return r===h.Backwards?e-a:e+a}function v(t,e){const r=t.commonAncestorContainer.ownerDocument.createNodeIterator(t.commonAncestorContainer,NodeFilter.SHOW_TEXT),n=e===h.Forwards?t.startContainer:t.endContainer,o=e===h.Forwards?t.endContainer:t.startContainer;let i=r.nextNode();for(;i&&i!==n;)i=r.nextNode();e===h.Backwards&&(i=r.previousNode());let a=-1;const c=()=>{if(i=e===h.Forwards?r.nextNode():r.previousNode(),i){const t=i.textContent,r=e===h.Forwards?0:t.length;a=w(t,r,e)}};for(;i&&-1===a&&i!==o;)c();if(i&&a>=0)return{node:i,offset:a};throw new RangeError("No text nodes with non-whitespace text found in range")}function x(t){var e,r;switch(t.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return null!==(r=null===(e=t.textContent)||void 0===e?void 0:e.length)&&void 0!==r?r:0;default:return 0}}function S(t){let e=t.previousSibling,r=0;for(;e;)r+=x(e),e=e.previousSibling;return r}function E(t,...e){let r=e.shift();const n=t.ownerDocument.createNodeIterator(t,NodeFilter.SHOW_TEXT),o=[];let i,a=n.nextNode(),c=0;for(;void 0!==r&&a;)i=a,c+i.data.length>r?(o.push({node:i,offset:r-c}),r=e.shift()):(a=n.nextNode(),c+=i.data.length);for(;void 0!==r&&i&&c===r;)o.push({node:i,offset:i.data.length}),r=e.shift();if(void 0!==r)throw new RangeError("Offset exceeds text length");return o}!function(t){t[t.Forwards=1]="Forwards",t[t.Backwards=2]="Backwards"}(h||(h={})),function(t){t[t.FORWARDS=1]="FORWARDS",t[t.BACKWARDS=2]="BACKWARDS"}(d||(d={}));class A{constructor(t,e){if(e<0)throw new Error("Offset is invalid");this.element=t,this.offset=e}relativeTo(t){if(!t.contains(this.element))throw new Error("Parent is not an ancestor of current element");let e=this.element,r=this.offset;for(;e!==t;)r+=S(e),e=e.parentElement;return new A(e,r)}resolve(t={}){try{return E(this.element,this.offset)[0]}catch(e){if(0===this.offset&&void 0!==t.direction){const r=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);r.currentNode=this.element;const n=t.direction===d.FORWARDS,o=n?r.nextNode():r.previousNode();if(!o)throw e;return{node:o,offset:n?0:o.data.length}}throw e}}static fromCharOffset(t,e){switch(t.nodeType){case Node.TEXT_NODE:return A.fromPoint(t,e);case Node.ELEMENT_NODE:return new A(t,e);default:throw new Error("Node is not an element or text node")}}static fromPoint(t,e){switch(t.nodeType){case Node.TEXT_NODE:{if(e<0||e>t.data.length)throw new Error("Text node offset is out of range");if(!t.parentElement)throw new Error("Text node has no parent");const r=S(t)+e;return new A(t.parentElement,r)}case Node.ELEMENT_NODE:{if(e<0||e>t.childNodes.length)throw new Error("Child node offset is out of range");let r=0;for(let n=0;n=0&&(e.setStart(t.startContainer,o.start),r=!0),o.end>0&&(e.setEnd(t.endContainer,o.end),n=!0),r&&n)return e;if(!r){const{node:t,offset:r}=v(e,h.Forwards);t&&r>=0&&e.setStart(t,r)}if(!n){const{node:t,offset:r}=v(e,h.Backwards);t&&r>0&&e.setEnd(t,r)}return e}(O.fromRange(t).toRange())}}class j{constructor(t,e,r){this.root=t,this.start=e,this.end=r}static fromRange(t,e){const r=O.fromRange(e).relativeTo(t);return new j(t,r.start.offset,r.end.offset)}static fromSelector(t,e){return new j(t,e.start,e.end)}toSelector(){return{type:"TextPositionSelector",start:this.start,end:this.end}}toRange(){return O.fromOffsets(this.root,this.start,this.end).toRange()}}class P{constructor(t,e,r={}){this.root=t,this.exact=e,this.context=r}static fromRange(t,e){const r=t.textContent,n=O.fromRange(e).relativeTo(t),o=n.start.offset,i=n.end.offset;return new P(t,r.slice(o,i),{prefix:r.slice(Math.max(0,o-32),o),suffix:r.slice(i,Math.min(r.length,i+32))})}static fromSelector(t,e){const{prefix:r,suffix:n}=e;return new P(t,e.exact,{prefix:r,suffix:n})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(t={}){return this.toPositionAnchor(t).toRange()}toPositionAnchor(t={}){const e=function(t,e,r={}){if(0===e.length)return null;const n=Math.min(256,e.length/2),o=m(t,e,n);if(0===o.length)return null;const i=n=>{const o=1-n.errors/e.length,i=r.prefix?b(t.slice(Math.max(0,n.start-r.prefix.length),n.start),r.prefix):1,a=r.suffix?b(t.slice(n.end,n.end+r.suffix.length),r.suffix):1;let c=1;return"number"==typeof r.hint&&(c=1-Math.abs(n.start-r.hint)/t.length),(50*o+20*i+20*a+2*c)/92},a=o.map((t=>({start:t.start,end:t.end,score:i(t)})));return a.sort(((t,e)=>e.score-t.score)),a[0]}(this.root.textContent,this.exact,Object.assign(Object.assign({},this.context),{hint:t.hint}));if(!e)throw new Error("Quote not found");return new j(this.root,e.start,e.end)}}class R{constructor(t){this.styles=new Map,this.groups=new Map,this.lastGroupId=0,this.window=t,t.addEventListener("load",(()=>{const e=t.document.body;let r={width:0,height:0};new ResizeObserver((()=>{requestAnimationFrame((()=>{r.width===e.clientWidth&&r.height===e.clientHeight||(r={width:e.clientWidth,height:e.clientHeight},this.relayoutDecorations())}))})).observe(e)}),!1)}registerTemplates(t){let e="";for(const[r,n]of t)this.styles.set(r,n),n.stylesheet&&(e+=n.stylesheet+"\n");if(e){const t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}}addDecoration(t,e){console.log(`addDecoration ${t.id} ${e}`),this.getGroup(e).add(t)}removeDecoration(t,e){console.log(`removeDecoration ${t} ${e}`),this.getGroup(e).remove(t)}relayoutDecorations(){console.log("relayoutDecorations");for(const t of this.groups.values())t.relayout()}getGroup(t){let e=this.groups.get(t);if(!e){const r="readium-decoration-"+this.lastGroupId++;e=new C(r,t,this.styles),this.groups.set(t,e)}return e}handleDecorationClickEvent(t){if(0===this.groups.size)return null;const e=(()=>{for(const[e,r]of this.groups)for(const n of r.items.reverse())if(n.clickableElements)for(const r of n.clickableElements)if(u(o(r.getBoundingClientRect()),t.clientX,t.clientY,1))return{group:e,item:n,element:r}})();return e?{id:e.item.decoration.id,group:e.group,rect:o(e.item.range.getBoundingClientRect()),event:t}:null}}class C{constructor(t,e,r){this.items=[],this.lastItemId=0,this.container=null,this.groupId=t,this.groupName=e,this.styles=r}add(t){const r=this.groupId+"-"+this.lastItemId++,n=function(t,r){let n;if(t)try{n=document.querySelector(t)}catch(t){e(t)}if(!n&&!r)return null;if(n||(n=document.body),r)return new P(n,r.quotedText,{prefix:r.textBefore,suffix:r.textAfter}).toRange();{const t=document.createRange();return t.setStartBefore(n),t.setEndAfter(n),t}}(t.cssSelector,t.textQuote);if(!n)return void e("Can't locate DOM range for decoration",t);const o={id:r,decoration:t,range:n,container:null,clickableElements:null};this.items.push(o),this.layout(o)}remove(t){const e=this.items.findIndex((e=>e.decoration.id===t));if(-1===e)return;const r=this.items[e];this.items.splice(e,1),r.clickableElements=null,r.container&&(r.container.remove(),r.container=null)}relayout(){this.clearContainer();for(const t of this.items)this.layout(t)}requireContainer(){return this.container||(this.container=document.createElement("div"),this.container.id=this.groupId,this.container.dataset.group=this.groupName,this.container.style.pointerEvents="none",document.body.append(this.container)),this.container}clearContainer(){this.container&&(this.container.remove(),this.container=null)}layout(t){const e=this.requireContainer(),r=this.styles.get(t.decoration.style);if(!r)return void console.log(`Unknown decoration style: ${t.decoration.style}`);const o=r,a=document.createElement("div");a.id=t.id,a.dataset.style=t.decoration.style,a.style.pointerEvents="none";const c=getComputedStyle(document.body).writingMode,s="vertical-rl"===c||"vertical-lr"===c,u=e.currentCSSZoom,l=document.scrollingElement,f=l.scrollLeft/u,p=l.scrollTop/u,y=s?window.innerHeight:window.innerWidth,h=s?window.innerWidth:window.innerHeight,d=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count"))||1,g=(s?h:y)/d;function m(t,e,r,n){t.style.position="absolute";const i="vertical-rl"===n;if(i||"vertical-lr"===n){if("wrap"===o.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,i?t.style.right=`${-e.right-f+l.clientWidth}px`:t.style.left=`${e.left+f}px`,t.style.top=`${e.top+p}px`;else if("viewport"===o.width){t.style.width=`${e.height}px`,t.style.height=`${y}px`;const r=Math.floor(e.top/y)*y;i?t.style.right=-e.right-f+"px":t.style.left=`${e.left+f}px`,t.style.top=`${r+p}px`}else if("bounds"===o.width)t.style.width=`${r.height}px`,t.style.height=`${y}px`,i?t.style.right=`${-r.right-f+l.clientWidth}px`:t.style.left=`${r.left+f}px`,t.style.top=`${r.top+p}px`;else if("page"===o.width){t.style.width=`${e.height}px`,t.style.height=`${g}px`;const r=Math.floor(e.top/g)*g;i?t.style.right=`${-e.right-f+l.clientWidth}px`:t.style.left=`${e.left+f}px`,t.style.top=`${r+p}px`}}else if("wrap"===o.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.left=`${e.left+f}px`,t.style.top=`${e.top+p}px`;else if("viewport"===o.width){t.style.width=`${y}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/y)*y;t.style.left=`${r+f}px`,t.style.top=`${e.top+p}px`}else if("bounds"===o.width)t.style.width=`${r.width}px`,t.style.height=`${e.height}px`,t.style.left=`${r.left+f}px`,t.style.top=`${e.top+p}px`;else if("page"===o.width){t.style.width=`${g}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/g)*g;t.style.left=`${r+f}px`,t.style.top=`${e.top+p}px`}}const b=(w=t.range.getBoundingClientRect(),v=u,new DOMRect(w.x/v,w.y/v,w.width/v,w.height/v));var w,v;let x;try{const e=document.createElement("template");e.innerHTML=t.decoration.element.trim(),x=e.content.firstElementChild}catch(e){let r;return r="message"in e?e.message:null,void console.log(`Invalid decoration element "${t.decoration.element}": ${r}`)}if("boxes"===o.layout){const e=!c.startsWith("vertical"),r=(S=t.range.startContainer).nodeType===Node.ELEMENT_NODE?S:S.parentElement,o=getComputedStyle(r).writingMode,s=i(t.range,e).map((t=>n(t,u))).sort(((t,e)=>t.top!==e.top?t.top-e.top:"vertical-rl"===o?e.left-t.left:t.left-e.left));for(const t of s){const e=x.cloneNode(!0);e.style.pointerEvents="none",e.dataset.writingMode=o,m(e,t,b,c),a.append(e)}}else if("bounds"===o.layout){const t=x.cloneNode(!0);t.style.pointerEvents="none",t.dataset.writingMode=c,m(t,b,b,c),a.append(t)}var S;e.append(a),t.container=a,t.clickableElements=Array.from(a.querySelectorAll("[data-activable='1']")),0===t.clickableElements.length&&(t.clickableElements=Array.from(a.children))}}class T{constructor(t,e,r){this.window=t,this.listener=e,this.decorationManager=r,document.addEventListener("click",(t=>{this.onClick(t)}),!1)}onClick(t){if(t.defaultPrevented)return;const e=this.window.getSelection();if(e&&"Range"==e.type)return;let r,n;if(r=t.target instanceof HTMLElement?this.nearestInteractiveElement(t.target):null,r){if(!(r instanceof HTMLAnchorElement))return;this.listener.onLinkActivated(r.href,r.outerHTML),t.stopPropagation(),t.preventDefault()}n=this.decorationManager?this.decorationManager.handleDecorationClickEvent(t):null,n?this.listener.onDecorationActivated(n):this.listener.onTap(t)}nearestInteractiveElement(t){return null==t?null:-1!=["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(t.nodeName.toLowerCase())||t.hasAttribute("contenteditable")&&"false"!=t.getAttribute("contenteditable").toLowerCase()?t:t.parentElement?this.nearestInteractiveElement(t.parentElement):null}}var I=r(5155);r.n(I)().shim();class N{constructor(t){this.isSelecting=!1,this.window=t}clearSelection(){var t;null===(t=this.window.getSelection())||void 0===t||t.removeAllRanges()}getCurrentSelection(){const t=this.getCurrentSelectionText();if(!t)return null;const e=this.getSelectionRect();return{selectedText:t.highlight,textBefore:t.before,textAfter:t.after,selectionRect:e}}getSelectionRect(){try{const t=this.window.getSelection().getRangeAt(0),e=this.window.document.body.currentCSSZoom;return n(o(t.getBoundingClientRect()),e)}catch(t){throw e(t),t}}getCurrentSelectionText(){const t=this.window.getSelection();if(t.isCollapsed)return;const r=t.toString();if(0===r.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!t.anchorNode||!t.focusNode)return;const n=1===t.rangeCount?t.getRangeAt(0):function(t,r,n,o){const i=new Range;if(i.setStart(t,r),i.setEnd(n,o),!i.collapsed)return i;e(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const a=new Range;if(a.setStart(n,o),a.setEnd(t,r),!a.collapsed)return e(">>> createOrderedRange RANGE REVERSE OK."),i;e(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset);if(!n||n.collapsed)return void e("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const o=document.body.textContent,i=O.fromRange(n).relativeTo(document.body),a=i.start.offset,c=i.end.offset;let s=o.slice(Math.max(0,a-200),a);const u=s.search(/\P{L}\p{L}/gu);-1!==u&&(s=s.slice(u+1));let l=o.slice(c,Math.min(o.length,c+200));const f=Array.from(l.matchAll(/\p{L}\P{L}/gu)).pop();return void 0!==f&&f.index>1&&(l=l.slice(0,f.index+1)),{highlight:r,before:s,after:l}}}class M{constructor(t,e){this.window=t,this.manager=e}registerTemplates(t){const e=function(t){return new Map(Object.entries(JSON.parse(t)))}(t);this.manager.registerTemplates(e)}addDecoration(t,e){const r=function(t){return JSON.parse(t)}(t);this.manager.addDecoration(r,e)}removeDecoration(t,e){this.manager.removeDecoration(t,e)}}class ${constructor(t){this.gesturesBridge=t}onTap(t){const e={x:(t.clientX-visualViewport.offsetLeft)*visualViewport.scale,y:(t.clientY-visualViewport.offsetTop)*visualViewport.scale},r=JSON.stringify(e);this.gesturesBridge.onTap(r)}onLinkActivated(t,e){this.gesturesBridge.onLinkActivated(t,e)}onDecorationActivated(t){const e={x:(t.event.clientX-visualViewport.offsetLeft)*visualViewport.scale,y:(t.event.clientY-visualViewport.offsetTop)*visualViewport.scale},r=JSON.stringify(e),n=JSON.stringify(t.rect);this.gesturesBridge.onDecorationActivated(t.id,t.group,n,r)}}class D{constructor(t,e){this.window=t,this.manager=e}getCurrentSelection(){return this.manager.getCurrentSelection()}clearSelection(){this.manager.clearSelection()}}class F{constructor(t){this.document=t}setProperties(t){for(const[e,r]of t)this.setProperty(e,r)}setProperty(t,e){null===e||""===e?this.removeProperty(t):document.documentElement.style.setProperty(t,e,"important")}removeProperty(t){document.documentElement.style.removeProperty(t)}}window.addEventListener("load",(t=>{let e=!1;new ResizeObserver((()=>{let t=!1;requestAnimationFrame((()=>{const r=window.document.scrollingElement,n=null==r||0==r.scrollHeight&&0==r.scrollWidth;if(e||!n){if(!t&&!n){const e=function(t){const e=function(t){return parseInt(t.getComputedStyle(t.document.documentElement).getPropertyValue("column-count"))}(t);if(!e)return!1;const r=t.document.querySelectorAll("div[id^='readium-virtual-page']"),n=r.length;for(const t of r)t.remove();const o=t.document.scrollingElement.scrollWidth,i=t.visualViewport.width,a=Math.round(o/i*e)%e,c=1===e||0===a?0:e-a;if(c>0)for(let e=0;e{const t=document.createElement("meta");t.setAttribute("name","viewport"),t.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"),this.window.document.head.appendChild(t)}))}}(window,window.reflowableApiState)}()}(); +!function(){var t={1844:function(t,e){"use strict";function r(t){return t.split("").reverse().join("")}function n(t){return(t|-t)>>31&1}function o(t,e,r,o){var i=t.P[r],a=t.M[r],s=o>>>31,c=e[r]|s,u=c|a,l=(c&i)+i^i|c,f=a|~(l|i),p=i&l,y=n(f&t.lastRowMask[r])-n(p&t.lastRowMask[r]);return f<<=1,p<<=1,i=(p|=s)|~(u|(f|=n(o)-s)),a=f&u,t.P[r]=i,t.M[r]=a,y}function i(t,e,r){if(0===e.length)return[];r=Math.min(r,e.length);var n=[],i=32,a=Math.ceil(e.length/i)-1,s={P:new Uint32Array(a+1),M:new Uint32Array(a+1),lastRowMask:new Uint32Array(a+1)};s.lastRowMask.fill(1<<31),s.lastRowMask[a]=1<<(e.length-1)%i;for(var c=new Uint32Array(a+1),u=new Map,l=[],f=0;f<256;f++)l.push(c);for(var p=0;p=e.length||e.charCodeAt(m)===y&&(h[d]|=1<0&&w[b]>=r+i;)b-=1;b===a&&w[b]<=r&&(w[b]-1?o(r):r}},2755:function(t,e,r){"use strict";var n=r(3569),o=r(2870),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||n.call(a,i),c=o("%Object.getOwnPropertyDescriptor%",!0),u=o("%Object.defineProperty%",!0),l=o("%Math.max%");if(u)try{u({},"a",{value:1})}catch(t){u=null}t.exports=function(t){var e=s(n,a,arguments);return c&&u&&c(e,"length").configurable&&u(e,"length",{value:1+l(0,t.length-(arguments.length-1))}),e};var f=function(){return s(n,i,arguments)};u?u(t.exports,"apply",{value:f}):t.exports.apply=f},6663:function(t,e,r){"use strict";var n=r(229)(),o=r(2870),i=n&&o("%Object.defineProperty%",!0),a=o("%SyntaxError%"),s=o("%TypeError%"),c=r(658);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new s("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new s("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new s("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],f=!!c&&c(t,e);if(i)i(t,e,{configurable:null===u&&f?f.configurable:!u,enumerable:null===n&&f?f.enumerable:!n,value:r,writable:null===o&&f?f.writable:!o});else{if(!l&&(n||o||u))throw new a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},9722:function(t,e,r){"use strict";var n=r(2051),o="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,s=r(6663),c=r(229)(),u=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(o=n)||"[object Function]"!==i.call(o)||!n())return;var o;c?s(t,e,r,!0):s(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},i=n(e);o&&(i=a.call(i,Object.getOwnPropertySymbols(e)));for(var s=0;s2&&arguments[2]&&arguments[2].force;!a||!r&&i(t,a)||(n?n(t,a,{configurable:!0,enumerable:!1,value:e,writable:!1}):t[a]=e)}},7358:function(t,e,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,o=r(7959),i=r(3655),a=r(455),s=r(8760);t.exports=function(t){if(o(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!i(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):s(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(o(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(a(t)||s(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,a,s="string"===e?["toString","valueOf"]:["valueOf","toString"];for(a=0;a1&&"boolean"!=typeof e)throw new a('"allowMissing" argument must be a boolean');if(null===j(/^%?[^%]*%?$/,t))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=O(t,0,1),r=O(t,-1);if("%"===e&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return A(t,P,(function(t,e,r,o){n[n.length]=r?A(o,R,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=C("%"+n+"%",e),s=i.name,u=i.value,l=!1,f=i.alias;f&&(n=f[0],E(r,S([0,1],f)));for(var p=1,y=!0;p=r.length){var b=c(u,h);u=(y=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:u[h]}else y=x(u,h),u=u[h];y&&!l&&(g[s]=u)}}return u}},658:function(t,e,r){"use strict";var n=r(2870)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},229:function(t,e,r){"use strict";var n=r(2870)("%Object.defineProperty%",!0),o=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};o.hasArrayLengthDefineBug=function(){if(!o())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=o},3413:function(t){"use strict";var e={foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!({__proto__:null}instanceof r)}},1143:function(t,e,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(9985);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},9985:function(t){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},3060:function(t,e,r){"use strict";var n=r(9985);t.exports=function(){return n()&&!!Symbol.toStringTag}},9545:function(t){"use strict";var e={}.hasOwnProperty,r=Function.prototype.call;t.exports=r.bind?r.bind(e):function(t,n){return r.call(e,t,n)}},7284:function(t,e,r){"use strict";var n=r(2870),o=r(9545),i=r(5714)(),a=n("%TypeError%"),s={assert:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");if(i.assert(t),!s.has(t,e))throw new a("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");var r=i.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");var r=i.get(t);return!!r&&o(r,"$"+e)},set:function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new a("`O` is not an object");if("string"!=typeof e)throw new a("`slot` must be a string");var n=i.get(t);n||(n={},i.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(s),t.exports=s},3655:function(t){"use strict";var e,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,e)}catch(t){t!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(t){try{var e=n.call(t);return i.test(e)}catch(t){return!1}},s=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;c.call(p)===c.call(document.all)&&(f=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=o?function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{o(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&s(t)}:function(t){if(f(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(u)return s(t);if(a(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&s(t)}},455:function(t,e,r){"use strict";var n=Date.prototype.getDay,o=Object.prototype.toString,i=r(3060)();t.exports=function(t){return"object"==typeof t&&null!==t&&(i?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===o.call(t))}},5494:function(t,e,r){"use strict";var n,o,i,a,s=r(3099),c=r(3060)();if(c){n=s("Object.prototype.hasOwnProperty"),o=s("RegExp.prototype.exec"),i={};var u=function(){throw i};a={toString:u,valueOf:u},"symbol"==typeof Symbol.toPrimitive&&(a[Symbol.toPrimitive]=u)}var l=s("Object.prototype.toString"),f=Object.getOwnPropertyDescriptor;t.exports=c?function(t){if(!t||"object"!=typeof t)return!1;var e=f(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{o(t,a)}catch(t){return t===i}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},8760:function(t,e,r){"use strict";var n=Object.prototype.toString;if(r(1143)()){var o=Symbol.prototype.toString,i=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&i.test(o.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},4538:function(t,e,r){var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=s&&c&&"function"==typeof c.get?c.get:null,l=s&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,p="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,y="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,d=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,w=String.prototype.replace,v=String.prototype.toUpperCase,x=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,O=Array.prototype.slice,j=Math.floor,P="function"==typeof BigInt?BigInt.prototype.valueOf:null,R=Object.getOwnPropertySymbols,C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,T="function"==typeof Symbol&&"object"==typeof Symbol.iterator,I="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,$=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function M(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||S.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-j(-t):j(t);if(n!==t){var o=String(n),i=b.call(e,o.length+1);return w.call(o,r,"$&_")+"."+w.call(w.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return w.call(e,r,"$&_")}var D=r(7002),F=D.custom,k=_(F)?F:null;function B(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function L(t){return w.call(String(t),/"/g,""")}function W(t){return!("[object Array]"!==H(t)||I&&"object"==typeof t&&I in t)}function U(t){return!("[object RegExp]"!==H(t)||I&&"object"==typeof t&&I in t)}function _(t){if(T)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!C)return!1;try{return C.call(t),!0}catch(t){}return!1}t.exports=function t(e,r,n,o){var s=r||{};if(V(s,"quoteStyle")&&"single"!==s.quoteStyle&&"double"!==s.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(V(s,"maxStringLength")&&("number"==typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=!V(s,"customInspect")||s.customInspect;if("boolean"!=typeof c&&"symbol"!==c)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(V(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(V(s,"numericSeparator")&&"boolean"!=typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var d=s.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return X(e,s);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var v=String(e);return d?M(e,v):v}if("bigint"==typeof e){var S=String(e)+"n";return d?M(e,S):S}var j=void 0===s.depth?5:s.depth;if(void 0===n&&(n=0),n>=j&&j>0&&"object"==typeof e)return W(e)?"[Array]":"[Object]";var R,F=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=A.call(Array(t.indent+1)," ")}return{base:r,prev:A.call(Array(e+1),r)}}(s,n);if(void 0===o)o=[];else if(q(o,e)>=0)return"[Circular]";function G(e,r,i){if(r&&(o=O.call(o)).push(r),i){var a={depth:s.depth};return V(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),t(e,a,n+1,o)}return t(e,s,n+1,o)}if("function"==typeof e&&!U(e)){var z=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),tt=Q(e,G);return"[Function"+(z?": "+z:" (anonymous)")+"]"+(tt.length>0?" { "+A.call(tt,", ")+" }":"")}if(_(e)){var et=T?w.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):C.call(e);return"object"!=typeof e||T?et:J(et)}if((R=e)&&"object"==typeof R&&("undefined"!=typeof HTMLElement&&R instanceof HTMLElement||"string"==typeof R.nodeName&&"function"==typeof R.getAttribute)){for(var rt="<"+x.call(String(e.nodeName)),nt=e.attributes||[],ot=0;ot"}if(W(e)){if(0===e.length)return"[]";var it=Q(e,G);return F&&!function(t){for(var e=0;e=0)return!1;return!0}(it)?"["+Z(it,F)+"]":"[ "+A.call(it,", ")+" ]"}if(function(t){return!("[object Error]"!==H(t)||I&&"object"==typeof t&&I in t)}(e)){var at=Q(e,G);return"cause"in Error.prototype||!("cause"in e)||N.call(e,"cause")?0===at.length?"["+String(e)+"]":"{ ["+String(e)+"] "+A.call(at,", ")+" }":"{ ["+String(e)+"] "+A.call(E.call("[cause]: "+G(e.cause),at),", ")+" }"}if("object"==typeof e&&c){if(k&&"function"==typeof e[k]&&D)return D(e,{depth:j-n});if("symbol"!==c&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!i||!t||"object"!=typeof t)return!1;try{i.call(t);try{u.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var st=[];return a&&a.call(e,(function(t,r){st.push(G(r,e,!0)+" => "+G(t,e))})),Y("Map",i.call(e),st,F)}if(function(t){if(!u||!t||"object"!=typeof t)return!1;try{u.call(t);try{i.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ct=[];return l&&l.call(e,(function(t){ct.push(G(t,e))})),Y("Set",u.call(e),ct,F)}if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return K("WeakMap");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return K("WeakSet");if(function(t){if(!y||!t||"object"!=typeof t)return!1;try{return y.call(t),!0}catch(t){}return!1}(e))return K("WeakRef");if(function(t){return!("[object Number]"!==H(t)||I&&"object"==typeof t&&I in t)}(e))return J(G(Number(e)));if(function(t){if(!t||"object"!=typeof t||!P)return!1;try{return P.call(t),!0}catch(t){}return!1}(e))return J(G(P.call(e)));if(function(t){return!("[object Boolean]"!==H(t)||I&&"object"==typeof t&&I in t)}(e))return J(h.call(e));if(function(t){return!("[object String]"!==H(t)||I&&"object"==typeof t&&I in t)}(e))return J(G(String(e)));if(!function(t){return!("[object Date]"!==H(t)||I&&"object"==typeof t&&I in t)}(e)&&!U(e)){var ut=Q(e,G),lt=$?$(e)===Object.prototype:e instanceof Object||e.constructor===Object,ft=e instanceof Object?"":"null prototype",pt=!lt&&I&&Object(e)===e&&I in e?b.call(H(e),8,-1):ft?"Object":"",yt=(lt||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(pt||ft?"["+A.call(E.call([],pt||[],ft||[]),": ")+"] ":"");return 0===ut.length?yt+"{}":F?yt+"{"+Z(ut,F)+"}":yt+"{ "+A.call(ut,", ")+" }"}return String(e)};var G=Object.prototype.hasOwnProperty||function(t){return t in this};function V(t,e){return G.call(t,e)}function H(t){return d.call(t)}function q(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return X(b.call(t,0,e.maxStringLength),e)+n}return B(w.call(w.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,z),"single",e)}function z(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+v.call(e.toString(16))}function J(t){return"Object("+t+")"}function K(t){return t+" { ? }"}function Y(t,e,r,n){return t+" ("+e+") {"+(n?Z(r,n):A.call(r,", "))+"}"}function Z(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+A.call(t,","+r)+"\n"+e.prev}function Q(t,e){var r=W(t),n=[];if(r){n.length=t.length;for(var o=0;o0&&!o.call(t,0))for(var d=0;d0)for(var g=0;g=0&&"[object Function]"===e.call(t.callee)),n}},9766:function(t,e,r){"use strict";var n=r(8921),o=Object,i=TypeError;t.exports=n((function(){if(null!=this&&this!==o(this))throw new i("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t}),"get flags",!0)},483:function(t,e,r){"use strict";var n=r(9722),o=r(2755),i=r(9766),a=r(5113),s=r(7299),c=o(a());n(c,{getPolyfill:a,implementation:i,shim:s}),t.exports=c},5113:function(t,e,r){"use strict";var n=r(9766),o=r(9722).supportsDescriptors,i=Object.getOwnPropertyDescriptor;t.exports=function(){if(o&&"gim"===/a/gim.flags){var t=i(RegExp.prototype,"flags");if(t&&"function"==typeof t.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var e="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(r,"sticky",{get:function(){e+="y"}}),"dy"===e)return t.get}}return n}},7299:function(t,e,r){"use strict";var n=r(9722).supportsDescriptors,o=r(5113),i=Object.getOwnPropertyDescriptor,a=Object.defineProperty,s=TypeError,c=Object.getPrototypeOf,u=/a/;t.exports=function(){if(!n||!c)throw new s("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=o(),e=c(u),r=i(e,"flags");return r&&r.get===t||a(e,"flags",{configurable:!0,enumerable:!1,get:t}),t}},7582:function(t,e,r){"use strict";var n=r(3099),o=r(2870),i=r(5494),a=n("RegExp.prototype.exec"),s=o("%TypeError%");t.exports=function(t){if(!i(t))throw new s("`regex` must be a RegExp");return function(e){return null!==a(t,e)}}},8921:function(t,e,r){"use strict";var n=r(6663),o=r(229)(),i=r(5610).functionsHaveConfigurableNames(),a=TypeError;t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");return arguments.length>2&&!!arguments[2]&&!i||(o?n(t,"name",e,!0,!0):n(t,"name",e)),t}},5714:function(t,e,r){"use strict";var n=r(2870),o=r(3099),i=r(4538),a=n("%TypeError%"),s=n("%WeakMap%",!0),c=n("%Map%",!0),u=o("WeakMap.prototype.get",!0),l=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),p=o("Map.prototype.get",!0),y=o("Map.prototype.set",!0),h=o("Map.prototype.has",!0),d=function(t,e){for(var r,n=t;null!==(r=n.next);n=r)if(r.key===e)return n.next=r.next,r.next=t.next,t.next=r,r};t.exports=function(){var t,e,r,n={assert:function(t){if(!n.has(t))throw new a("Side channel does not contain "+i(t))},get:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(t)return u(t,n)}else if(c){if(e)return p(e,n)}else if(r)return function(t,e){var r=d(t,e);return r&&r.value}(r,n)},has:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(t)return f(t,n)}else if(c){if(e)return h(e,n)}else if(r)return function(t,e){return!!d(t,e)}(r,n);return!1},set:function(n,o){s&&n&&("object"==typeof n||"function"==typeof n)?(t||(t=new s),l(t,n,o)):c?(e||(e=new c),y(e,n,o)):(r||(r={key:{},next:null}),function(t,e,r){var n=d(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}}(r,n,o))}};return n}},3073:function(t,e,r){"use strict";var n=r(7113),o=r(151),i=r(1959),a=r(9497),s=r(5128),c=r(6751),u=r(3099),l=r(1143)(),f=r(483),p=u("String.prototype.indexOf"),y=r(2009),h=function(t){var e=y();if(l&&"symbol"==typeof Symbol.matchAll){var r=i(t,Symbol.matchAll);return r===RegExp.prototype[Symbol.matchAll]&&r!==e?e:r}if(a(t))return e};t.exports=function(t){var e=c(this);if(null!=t){if(a(t)){var r="flags"in t?o(t,"flags"):f(t);if(c(r),p(s(r),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var i=h(t);if(void 0!==i)return n(i,t,[e])}var u=s(e),l=new RegExp(t,"g");return n(h(l),l,[u])}},5155:function(t,e,r){"use strict";var n=r(2755),o=r(9722),i=r(3073),a=r(1794),s=r(3911),c=n(i);o(c,{getPolyfill:a,implementation:i,shim:s}),t.exports=c},2009:function(t,e,r){"use strict";var n=r(1143)(),o=r(8012);t.exports=function(){return n&&"symbol"==typeof Symbol.matchAll&&"function"==typeof RegExp.prototype[Symbol.matchAll]?RegExp.prototype[Symbol.matchAll]:o}},1794:function(t,e,r){"use strict";var n=r(3073);t.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(t){return String.prototype.matchAll}return n}},8012:function(t,e,r){"use strict";var n=r(1398),o=r(151),i=r(8322),a=r(2449),s=r(3995),c=r(5128),u=r(1874),l=r(483),f=r(8921),p=r(3099)("String.prototype.indexOf"),y=RegExp,h="flags"in RegExp.prototype,d=f((function(t){var e=this;if("Object"!==u(e))throw new TypeError('"this" value must be an Object');var r=c(t),f=function(t,e){var r="flags"in e?o(e,"flags"):c(l(e));return{flags:r,matcher:new t(h&&"string"==typeof r?e:t===y?e.source:e,r)}}(a(e,y),e),d=f.flags,g=f.matcher,m=s(o(e,"lastIndex"));i(g,"lastIndex",m,!0);var b=p(d,"g")>-1,w=p(d,"u")>-1;return n(g,r,b,w)}),"[Symbol.matchAll]",!0);t.exports=d},3911:function(t,e,r){"use strict";var n=r(9722),o=r(1143)(),i=r(1794),a=r(2009),s=Object.defineProperty,c=Object.getOwnPropertyDescriptor;t.exports=function(){var t=i();if(n(String.prototype,{matchAll:t},{matchAll:function(){return String.prototype.matchAll!==t}}),o){var e=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(n(Symbol,{matchAll:e},{matchAll:function(){return Symbol.matchAll!==e}}),s&&c){var r=c(Symbol,e);r&&!r.configurable||s(Symbol,e,{configurable:!1,enumerable:!1,value:e,writable:!1})}var u=a(),l={};l[e]=u;var f={};f[e]=function(){return RegExp.prototype[e]!==u},n(RegExp.prototype,l,f)}return t}},8125:function(t,e,r){"use strict";var n=r(6751),o=r(5128),i=r(3099)("String.prototype.replace"),a=/^\s$/.test("᠎"),s=a?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,c=a?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=o(n(this));return i(i(t,s,""),c,"")}},9434:function(t,e,r){"use strict";var n=r(2755),o=r(9722),i=r(6751),a=r(8125),s=r(3228),c=r(818),u=n(s()),l=function(t){return i(t),u(t)};o(l,{getPolyfill:s,implementation:a,shim:c}),t.exports=l},3228:function(t,e,r){"use strict";var n=r(8125);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},818:function(t,e,r){"use strict";var n=r(9722),o=r(3228);t.exports=function(){var t=o();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},7002:function(){},1510:function(t,e,r){"use strict";var n=r(2870),o=r(6318),i=r(1874),a=r(2990),s=r(5674),c=n("%TypeError%");t.exports=function(t,e,r){if("String"!==i(t))throw new c("Assertion failed: `S` must be a String");if(!a(e)||e<0||e>s)throw new c("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if("Boolean"!==i(r))throw new c("Assertion failed: `unicode` must be a Boolean");return r?e+1>=t.length?e+1:e+o(t,e)["[[CodeUnitCount]]"]:e+1}},7113:function(t,e,r){"use strict";var n=r(2870),o=r(3099),i=n("%TypeError%"),a=r(6287),s=n("%Reflect.apply%",!0)||o("Function.prototype.apply");t.exports=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!a(r))throw new i("Assertion failed: optional `argumentsList`, if provided, must be a List");return s(t,e,r)}},6318:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(3099),i=r(5541),a=r(959),s=r(1874),c=r(1751),u=o("String.prototype.charAt"),l=o("String.prototype.charCodeAt");t.exports=function(t,e){if("String"!==s(t))throw new n("Assertion failed: `string` must be a String");var r=t.length;if(e<0||e>=r)throw new n("Assertion failed: `position` must be >= 0, and < the length of `string`");var o=l(t,e),f=u(t,e),p=i(o),y=a(o);if(!p&&!y)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(y||e+1===r)return{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var h=l(t,e+1);return a(h)?{"[[CodePoint]]":c(o,h),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":f,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}},5702:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(1874);t.exports=function(t,e){if("Boolean"!==o(e))throw new n("Assertion failed: Type(done) is not Boolean");return{value:t,done:e}}},6782:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(2860),i=r(8357),a=r(3301),s=r(6284),c=r(8277),u=r(1874);t.exports=function(t,e,r){if("Object"!==u(t))throw new n("Assertion failed: Type(O) is not Object");if(!s(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");return o(a,c,i,t,e,{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0})}},1398:function(t,e,r){"use strict";var n=r(2870),o=r(1143)(),i=n("%TypeError%"),a=n("%IteratorPrototype%",!0),s=r(1510),c=r(5702),u=r(6782),l=r(151),f=r(5716),p=r(3500),y=r(8322),h=r(3995),d=r(5128),g=r(1874),m=r(7284),b=r(2263),w=function(t,e,r,n){if("String"!==g(e))throw new i("`S` must be a string");if("Boolean"!==g(r))throw new i("`global` must be a boolean");if("Boolean"!==g(n))throw new i("`fullUnicode` must be a boolean");m.set(this,"[[IteratingRegExp]]",t),m.set(this,"[[IteratedString]]",e),m.set(this,"[[Global]]",r),m.set(this,"[[Unicode]]",n),m.set(this,"[[Done]]",!1)};a&&(w.prototype=f(a)),u(w.prototype,"next",(function(){var t=this;if("Object"!==g(t))throw new i("receiver must be an object");if(!(t instanceof w&&m.has(t,"[[IteratingRegExp]]")&&m.has(t,"[[IteratedString]]")&&m.has(t,"[[Global]]")&&m.has(t,"[[Unicode]]")&&m.has(t,"[[Done]]")))throw new i('"this" value must be a RegExpStringIterator instance');if(m.get(t,"[[Done]]"))return c(void 0,!0);var e=m.get(t,"[[IteratingRegExp]]"),r=m.get(t,"[[IteratedString]]"),n=m.get(t,"[[Global]]"),o=m.get(t,"[[Unicode]]"),a=p(e,r);if(null===a)return m.set(t,"[[Done]]",!0),c(void 0,!0);if(n){if(""===d(l(a,"0"))){var u=h(l(e,"lastIndex")),f=s(r,u,o);y(e,"lastIndex",f,!0)}return c(a,!1)}return m.set(t,"[[Done]]",!0),c(a,!1)})),o&&(b(w.prototype,"RegExp String Iterator"),Symbol.iterator&&"function"!=typeof w.prototype[Symbol.iterator])&&u(w.prototype,Symbol.iterator,(function(){return this})),t.exports=function(t,e,r,n){return new w(t,e,r,n)}},3645:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(7999),i=r(2860),a=r(8357),s=r(8355),c=r(3301),u=r(6284),l=r(8277),f=r(7628),p=r(1874);t.exports=function(t,e,r){if("Object"!==p(t))throw new n("Assertion failed: Type(O) is not Object");if(!u(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var y=o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:s},r)?r:f(r);if(!o({Type:p,IsDataDescriptor:c,IsAccessorDescriptor:s},y))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return i(c,l,a,t,e,y)}},8357:function(t,e,r){"use strict";var n=r(1489),o=r(1598),i=r(1874);t.exports=function(t){return void 0!==t&&n(i,"Property Descriptor","Desc",t),o(t)}},151:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(4538),i=r(6284),a=r(1874);t.exports=function(t,e){if("Object"!==a(t))throw new n("Assertion failed: Type(O) is not Object");if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},1959:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(9374),i=r(7304),a=r(6284),s=r(4538);t.exports=function(t,e){if(!a(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var r=o(t,e);if(null!=r){if(!i(r))throw new n(s(e)+" is not a function: "+s(r));return r}}},9374:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(4538),i=r(6284);t.exports=function(t,e){if(!i(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+o(e));return t[e]}},8355:function(t,e,r){"use strict";var n=r(9545),o=r(1874),i=r(1489);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Get]]")&&!n(t,"[[Set]]")))}},6287:function(t,e,r){"use strict";t.exports=r(2403)},7304:function(t,e,r){"use strict";t.exports=r(3655)},4791:function(t,e,r){"use strict";var n=r(6740)("%Reflect.construct%",!0),o=r(3645);try{o({},"",{"[[Get]]":function(){}})}catch(t){o=null}if(o&&n){var i={},a={};o(a,"length",{"[[Get]]":function(){throw i},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,a)}catch(t){return t===i}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},3301:function(t,e,r){"use strict";var n=r(9545),o=r(1874),i=r(1489);t.exports=function(t){return void 0!==t&&(i(o,"Property Descriptor","Desc",t),!(!n(t,"[[Value]]")&&!n(t,"[[Writable]]")))}},6284:function(t){"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},9497:function(t,e,r){"use strict";var n=r(2870)("%Symbol.match%",!0),o=r(5494),i=r(5695);t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(n){var e=t[n];if(void 0!==e)return i(e)}return o(t)}},5716:function(t,e,r){"use strict";var n=r(2870),o=n("%Object.create%",!0),i=n("%TypeError%"),a=n("%SyntaxError%"),s=r(6287),c=r(1874),u=r(7735),l=r(7284),f=r(3413)();t.exports=function(t){if(null!==t&&"Object"!==c(t))throw new i("Assertion failed: `proto` must be null or an object");var e,r=arguments.length<2?[]:arguments[1];if(!s(r))throw new i("Assertion failed: `additionalInternalSlotsList` must be an Array");if(o)e=o(t);else if(f)e={__proto__:t};else{if(null===t)throw new a("native Object.create support is required to create null objects");var n=function(){};n.prototype=t,e=new n}return r.length>0&&u(r,(function(t){l.set(e,t,void 0)})),e}},3500:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(3099)("RegExp.prototype.exec"),i=r(7113),a=r(151),s=r(7304),c=r(1874);t.exports=function(t,e){if("Object"!==c(t))throw new n("Assertion failed: `R` must be an Object");if("String"!==c(e))throw new n("Assertion failed: `S` must be a String");var r=a(t,"exec");if(s(r)){var u=i(r,t,[e]);if(null===u||"Object"===c(u))return u;throw new n('"exec" method must return `null` or an Object')}return o(t,e)}},6751:function(t,e,r){"use strict";t.exports=r(9572)},8277:function(t,e,r){"use strict";var n=r(159);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},8322:function(t,e,r){"use strict";var n=r(2870)("%TypeError%"),o=r(6284),i=r(8277),a=r(1874),s=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if("Object"!==a(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");if("Boolean"!==a(c))throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,s&&!i(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!s||i(t[e],r)}catch(t){return!1}}},2449:function(t,e,r){"use strict";var n=r(2870),o=n("%Symbol.species%",!0),i=n("%TypeError%"),a=r(4791),s=r(1874);t.exports=function(t,e){if("Object"!==s(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==s(r))throw new i("O.constructor is not an Object");var n=o?r[o]:void 0;if(null==n)return e;if(a(n))return n;throw new i("no constructor found")}},6207:function(t,e,r){"use strict";var n=r(2870),o=n("%Number%"),i=n("%RegExp%"),a=n("%TypeError%"),s=n("%parseInt%"),c=r(3099),u=r(7582),l=c("String.prototype.slice"),f=u(/^0b[01]+$/i),p=u(/^0o[0-7]+$/i),y=u(/^[-+]0x[0-9a-f]+$/i),h=u(new i("["+["…","​","￾"].join("")+"]","g")),d=r(9434),g=r(1874);t.exports=function t(e){if("String"!==g(e))throw new a("Assertion failed: `argument` is not a String");if(f(e))return o(s(l(e,2),2));if(p(e))return o(s(l(e,2),8));if(h(e)||y(e))return NaN;var r=d(e);return r!==e?t(r):o(e)}},5695:function(t){"use strict";t.exports=function(t){return!!t}},1200:function(t,e,r){"use strict";var n=r(6542),o=r(5693),i=r(159),a=r(1117);t.exports=function(t){var e=n(t);return i(e)||0===e?0:a(e)?o(e):e}},3995:function(t,e,r){"use strict";var n=r(5674),o=r(1200);t.exports=function(t){var e=o(t);return e<=0?0:e>n?n:e}},6542:function(t,e,r){"use strict";var n=r(2870),o=n("%TypeError%"),i=n("%Number%"),a=r(8606),s=r(703),c=r(6207);t.exports=function(t){var e=a(t)?t:s(t,i);if("symbol"==typeof e)throw new o("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new o("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?c(e):i(e)}},703:function(t,e,r){"use strict";var n=r(7358);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},7628:function(t,e,r){"use strict";var n=r(9545),o=r(2870)("%TypeError%"),i=r(1874),a=r(5695),s=r(7304);t.exports=function(t){if("Object"!==i(t))throw new o("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=a(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=a(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=a(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!s(r))throw new o("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!s(c))throw new o("setter must be a function");e["[[Set]]"]=c}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},5128:function(t,e,r){"use strict";var n=r(2870),o=n("%String%"),i=n("%TypeError%");t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return o(t)}},1874:function(t,e,r){"use strict";var n=r(6101);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},1751:function(t,e,r){"use strict";var n=r(2870),o=n("%TypeError%"),i=n("%String.fromCharCode%"),a=r(5541),s=r(959);t.exports=function(t,e){if(!a(t)||!s(e))throw new o("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return i(t)+i(e)}},3567:function(t,e,r){"use strict";var n=r(1874),o=Math.floor;t.exports=function(t){return"BigInt"===n(t)?t:o(t)}},5693:function(t,e,r){"use strict";var n=r(2870),o=r(3567),i=n("%TypeError%");t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-o(-t):o(t);return 0===e?0:e}},9572:function(t,e,r){"use strict";var n=r(2870)("%TypeError%");t.exports=function(t,e){if(null==t)throw new n(e||"Cannot call method on "+t);return t}},6101:function(t){"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},6740:function(t,e,r){"use strict";t.exports=r(2870)},2860:function(t,e,r){"use strict";var n=r(229),o=r(2870),i=n()&&o("%Object.defineProperty%",!0),a=n.hasArrayLengthDefineBug(),s=a&&r(2403),c=r(3099)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,o,u){if(!i){if(!t(u))return!1;if(!u["[[Configurable]]"]||!u["[[Writable]]"])return!1;if(o in n&&c(n,o)!==!!u["[[Enumerable]]"])return!1;var l=u["[[Value]]"];return n[o]=l,e(n[o],l)}return a&&"length"===o&&"[[Value]]"in u&&s(n)&&n.length!==u["[[Value]]"]?(n.length=u["[[Value]]"],n.length===u["[[Value]]"]):(i(n,o,r(u)),!0)}},2403:function(t,e,r){"use strict";var n=r(2870)("%Array%"),o=!n.isArray&&r(3099)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===o(t)}},1489:function(t,e,r){"use strict";var n=r(2870),o=n("%TypeError%"),i=n("%SyntaxError%"),a=r(9545),s=r(2990),c={"Property Descriptor":function(t){var e={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};if(!t)return!1;for(var r in t)if(a(t,r)&&!e[r])return!1;var n=a(t,"[[Value]]"),i=a(t,"[[Get]]")||a(t,"[[Set]]");if(n&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":r(900),"Iterator Record":function(t){return a(t,"[[Iterator]]")&&a(t,"[[NextMethod]]")&&a(t,"[[Done]]")},"PromiseCapability Record":function(t){return!!t&&a(t,"[[Resolve]]")&&"function"==typeof t["[[Resolve]]"]&&a(t,"[[Reject]]")&&"function"==typeof t["[[Reject]]"]&&a(t,"[[Promise]]")&&t["[[Promise]]"]&&"function"==typeof t["[[Promise]]"].then},"AsyncGeneratorRequest Record":function(t){return!!t&&a(t,"[[Completion]]")&&a(t,"[[Capability]]")&&c["PromiseCapability Record"](t["[[Capability]]"])},"RegExp Record":function(t){return t&&a(t,"[[IgnoreCase]]")&&"boolean"==typeof t["[[IgnoreCase]]"]&&a(t,"[[Multiline]]")&&"boolean"==typeof t["[[Multiline]]"]&&a(t,"[[DotAll]]")&&"boolean"==typeof t["[[DotAll]]"]&&a(t,"[[Unicode]]")&&"boolean"==typeof t["[[Unicode]]"]&&a(t,"[[CapturingGroupsCount]]")&&"number"==typeof t["[[CapturingGroupsCount]]"]&&s(t["[[CapturingGroupsCount]]"])&&t["[[CapturingGroupsCount]]"]>=0}};t.exports=function(t,e,r,n){var a=c[e];if("function"!=typeof a)throw new i("unknown record type: "+e);if("Object"!==t(n)||!a(n))throw new o(r+" must be a "+e)}},7735:function(t){"use strict";t.exports=function(t,e){for(var r=0;r=55296&&t<=56319}},900:function(t,e,r){"use strict";var n=r(9545);t.exports=function(t){return n(t,"[[StartIndex]]")&&n(t,"[[EndIndex]]")&&t["[[StartIndex]]"]>=0&&t["[[EndIndex]]"]>=t["[[StartIndex]]"]&&String(parseInt(t["[[StartIndex]]"],10))===String(t["[[StartIndex]]"])&&String(parseInt(t["[[EndIndex]]"],10))===String(t["[[EndIndex]]"])}},159:function(t){"use strict";t.exports=Number.isNaN||function(t){return t!=t}},8606:function(t){"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},7999:function(t,e,r){"use strict";var n=r(2870),o=r(9545),i=n("%TypeError%");t.exports=function(t,e){if("Object"!==t.Type(e))return!1;var r={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in e)if(o(e,n)&&!r[n])return!1;if(t.IsDataDescriptor(e)&&t.IsAccessorDescriptor(e))throw new i("Property Descriptors may not be both accessor and data descriptors");return!0}},959:function(t){"use strict";t.exports=function(t){return"number"==typeof t&&t>=56320&&t<=57343}},5674:function(t){"use strict";t.exports=Number.MAX_SAFE_INTEGER||9007199254740991}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";const t=!1;function e(...e){t&&console.log(...e)}function n(t,e){return{bottom:t.bottom/e,height:t.height/e,left:t.left/e,right:t.right/e,top:t.top/e,width:t.width/e}}function o(t){return{width:t.width,height:t.height,left:t.left,top:t.top,right:t.right,bottom:t.bottom}}function i(t,r){const n=t.getClientRects(),o=[];for(const t of n)o.push({bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width});const i=l(function(t,r){const n=new Set(t);for(const r of t)if(r.width>1&&r.height>1){for(const o of t)if(r!==o&&n.has(o)&&c(o,r,1)){e("CLIENT RECT: remove contained"),n.delete(r);break}}else e("CLIENT RECT: remove tiny"),n.delete(r);return Array.from(n)}(a(o,1,r)));for(let t=i.length-1;t>=0;t--){const r=i[t];if(!(r.width*r.height>4)){if(!(i.length>1)){e("CLIENT RECT: remove small, but keep otherwise empty!");break}e("CLIENT RECT: remove small"),i.splice(t,1)}}return e(`CLIENT RECT: reduced ${o.length} --\x3e ${i.length}`),i}function a(t,r,n){for(let o=0;ot!==c&&t!==u)),i=s(c,u);return o.push(i),a(o,r,n)}}return t}function s(t,e){const r=Math.min(t.left,e.left),n=Math.max(t.right,e.right),o=Math.min(t.top,e.top),i=Math.max(t.bottom,e.bottom);return{bottom:i,height:i-o,left:r,right:n,top:o,width:n-r}}function c(t,e,r){return u(t,e.left,e.top,r)&&u(t,e.right,e.top,r)&&u(t,e.left,e.bottom,r)&&u(t,e.right,e.bottom,r)}function u(t,e,r,n){return(t.lefte||y(t.right,e,n))&&(t.topr||y(t.bottom,r,n))}function l(t){for(let r=0;rt!==r));return Array.prototype.push.apply(s,n),l(s)}}else e("replaceOverlapingRects rect1 === rect2 ??!")}return t}function f(t,e){const r=function(t,e){const r=Math.max(t.left,e.left),n=Math.min(t.right,e.right),o=Math.max(t.top,e.top),i=Math.min(t.bottom,e.bottom);return{bottom:i,height:Math.max(0,i-o),left:r,right:n,top:o,width:Math.max(0,n-r)}}(e,t);if(0===r.height||0===r.width)return[t];const n=[];{const e={bottom:t.bottom,height:0,left:t.left,right:r.left,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:r.top,height:0,left:r.left,right:r.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.left,right:r.right,top:r.bottom,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}{const e={bottom:t.bottom,height:0,left:r.right,right:t.right,top:t.top,width:0};e.width=e.right-e.left,e.height=e.bottom-e.top,0!==e.height&&0!==e.width&&n.push(e)}return n}function p(t,e,r){return(t.left=0&&y(t.left,e.right,r))&&(e.left=0&&y(e.left,t.right,r))&&(t.top=0&&y(t.top,e.bottom,r))&&(e.top=0&&y(e.top,t.bottom,r))}function y(t,e,r){return Math.abs(t-e)<=r}var h,d,g=r(1844);function m(t,e,r){let n=0;const o=[];for(;-1!==n;)n=t.indexOf(e,n),-1!==n&&(o.push({start:n,end:n+e.length,errors:0}),n+=1);return o.length>0?o:(0,g.Z)(t,e,r)}function b(t,e){return 0===e.length||0===t.length?0:1-m(t,e,e.length)[0].errors/e.length}function w(t,e,r){const n=r===h.Forwards?e:e-1;if(""!==t.charAt(n).trim())return e;let o,i;if(r===h.Backwards?(o=t.substring(0,e),i=o.trimEnd()):(o=t.substring(e),i=o.trimStart()),!i.length)return-1;const a=o.length-i.length;return r===h.Backwards?e-a:e+a}function v(t,e){const r=t.commonAncestorContainer.ownerDocument.createNodeIterator(t.commonAncestorContainer,NodeFilter.SHOW_TEXT),n=e===h.Forwards?t.startContainer:t.endContainer,o=e===h.Forwards?t.endContainer:t.startContainer;let i=r.nextNode();for(;i&&i!==n;)i=r.nextNode();e===h.Backwards&&(i=r.previousNode());let a=-1;const s=()=>{if(i=e===h.Forwards?r.nextNode():r.previousNode(),i){const t=i.textContent,r=e===h.Forwards?0:t.length;a=w(t,r,e)}};for(;i&&-1===a&&i!==o;)s();if(i&&a>=0)return{node:i,offset:a};throw new RangeError("No text nodes with non-whitespace text found in range")}function x(t){var e,r;switch(t.nodeType){case Node.ELEMENT_NODE:case Node.TEXT_NODE:return null!==(r=null===(e=t.textContent)||void 0===e?void 0:e.length)&&void 0!==r?r:0;default:return 0}}function S(t){let e=t.previousSibling,r=0;for(;e;)r+=x(e),e=e.previousSibling;return r}function E(t,...e){let r=e.shift();const n=t.ownerDocument.createNodeIterator(t,NodeFilter.SHOW_TEXT),o=[];let i,a=n.nextNode(),s=0;for(;void 0!==r&&a;)i=a,s+i.data.length>r?(o.push({node:i,offset:r-s}),r=e.shift()):(a=n.nextNode(),s+=i.data.length);for(;void 0!==r&&i&&s===r;)o.push({node:i,offset:i.data.length}),r=e.shift();if(void 0!==r)throw new RangeError("Offset exceeds text length");return o}!function(t){t[t.Forwards=1]="Forwards",t[t.Backwards=2]="Backwards"}(h||(h={})),function(t){t[t.FORWARDS=1]="FORWARDS",t[t.BACKWARDS=2]="BACKWARDS"}(d||(d={}));class A{constructor(t,e){if(e<0)throw new Error("Offset is invalid");this.element=t,this.offset=e}relativeTo(t){if(!t.contains(this.element))throw new Error("Parent is not an ancestor of current element");let e=this.element,r=this.offset;for(;e!==t;)r+=S(e),e=e.parentElement;return new A(e,r)}resolve(t={}){try{return E(this.element,this.offset)[0]}catch(e){if(0===this.offset&&void 0!==t.direction){const r=document.createTreeWalker(this.element.getRootNode(),NodeFilter.SHOW_TEXT);r.currentNode=this.element;const n=t.direction===d.FORWARDS,o=n?r.nextNode():r.previousNode();if(!o)throw e;return{node:o,offset:n?0:o.data.length}}throw e}}static fromCharOffset(t,e){switch(t.nodeType){case Node.TEXT_NODE:return A.fromPoint(t,e);case Node.ELEMENT_NODE:return new A(t,e);default:throw new Error("Node is not an element or text node")}}static fromPoint(t,e){switch(t.nodeType){case Node.TEXT_NODE:{if(e<0||e>t.data.length)throw new Error("Text node offset is out of range");if(!t.parentElement)throw new Error("Text node has no parent");const r=S(t)+e;return new A(t.parentElement,r)}case Node.ELEMENT_NODE:{if(e<0||e>t.childNodes.length)throw new Error("Child node offset is out of range");let r=0;for(let n=0;n=0&&(e.setStart(t.startContainer,o.start),r=!0),o.end>0&&(e.setEnd(t.endContainer,o.end),n=!0),r&&n)return e;if(!r){const{node:t,offset:r}=v(e,h.Forwards);t&&r>=0&&e.setStart(t,r)}if(!n){const{node:t,offset:r}=v(e,h.Backwards);t&&r>0&&e.setEnd(t,r)}return e}(O.fromRange(t).toRange())}}class j{constructor(t,e,r){this.root=t,this.start=e,this.end=r}static fromRange(t,e){const r=O.fromRange(e).relativeTo(t);return new j(t,r.start.offset,r.end.offset)}static fromSelector(t,e){return new j(t,e.start,e.end)}toSelector(){return{type:"TextPositionSelector",start:this.start,end:this.end}}toRange(){return O.fromOffsets(this.root,this.start,this.end).toRange()}}class P{constructor(t,e,r={}){this.root=t,this.exact=e,this.context=r}static fromRange(t,e){const r=t.textContent,n=O.fromRange(e).relativeTo(t),o=n.start.offset,i=n.end.offset;return new P(t,r.slice(o,i),{prefix:r.slice(Math.max(0,o-32),o),suffix:r.slice(i,Math.min(r.length,i+32))})}static fromSelector(t,e){const{prefix:r,suffix:n}=e;return new P(t,e.exact,{prefix:r,suffix:n})}toSelector(){return{type:"TextQuoteSelector",exact:this.exact,prefix:this.context.prefix,suffix:this.context.suffix}}toRange(t={}){return this.toPositionAnchor(t).toRange()}toPositionAnchor(t={}){const e=function(t,e,r={}){if(0===e.length)return null;const n=Math.min(256,e.length/2),o=m(t,e,n);if(0===o.length)return null;const i=n=>{const o=1-n.errors/e.length,i=r.prefix?b(t.slice(Math.max(0,n.start-r.prefix.length),n.start),r.prefix):1,a=r.suffix?b(t.slice(n.end,n.end+r.suffix.length),r.suffix):1;let s=1;return"number"==typeof r.hint&&(s=1-Math.abs(n.start-r.hint)/t.length),(50*o+20*i+20*a+2*s)/92},a=o.map((t=>({start:t.start,end:t.end,score:i(t)})));return a.sort(((t,e)=>e.score-t.score)),a[0]}(this.root.textContent,this.exact,Object.assign(Object.assign({},this.context),{hint:t.hint}));if(!e)throw new Error("Quote not found");return new j(this.root,e.start,e.end)}}class R{constructor(t){this.styles=new Map,this.groups=new Map,this.lastGroupId=0,this.window=t,t.addEventListener("load",(()=>{const e=t.document.body;let r={width:0,height:0};new ResizeObserver((()=>{requestAnimationFrame((()=>{r.width===e.clientWidth&&r.height===e.clientHeight||(r={width:e.clientWidth,height:e.clientHeight},this.relayoutDecorations())}))})).observe(e)}),!1)}registerTemplates(t){let e="";for(const[r,n]of t)this.styles.set(r,n),n.stylesheet&&(e+=n.stylesheet+"\n");if(e){const t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}}addDecoration(t,e){console.log(`addDecoration ${t.id} ${e}`),this.getGroup(e).add(t)}removeDecoration(t,e){console.log(`removeDecoration ${t} ${e}`),this.getGroup(e).remove(t)}relayoutDecorations(){console.log("relayoutDecorations");for(const t of this.groups.values())t.relayout()}getGroup(t){let e=this.groups.get(t);if(!e){const r="readium-decoration-"+this.lastGroupId++;e=new C(r,t,this.styles),this.groups.set(t,e)}return e}handleDecorationClickEvent(t){if(0===this.groups.size)return null;const e=(()=>{for(const[e,r]of this.groups)for(const n of r.items.reverse())if(n.clickableElements)for(const r of n.clickableElements)if(u(o(r.getBoundingClientRect()),t.clientX,t.clientY,1))return{group:e,item:n,element:r}})();return e?{id:e.item.decoration.id,group:e.group,rect:o(e.item.range.getBoundingClientRect()),event:t}:null}}class C{constructor(t,e,r){this.items=[],this.lastItemId=0,this.container=null,this.groupId=t,this.groupName=e,this.styles=r}add(t){const r=this.groupId+"-"+this.lastItemId++,n=function(t,r){let n;if(t)try{n=document.querySelector(t)}catch(t){e(t)}if(!n&&!r)return null;if(n||(n=document.body),!r){const t=document.createRange();return t.setStartBefore(n),t.setEndAfter(n),t}{const t=new P(n,r.quotedText,{prefix:r.textBefore,suffix:r.textAfter});try{return t.toRange()}catch(t){return e(t),null}}}(t.cssSelector,t.textQuote);if(e(`range ${n}`),!n)return void e("Can't locate DOM range for decoration",t);const o={id:r,decoration:t,range:n,container:null,clickableElements:null};this.items.push(o),this.layout(o)}remove(t){const e=this.items.findIndex((e=>e.decoration.id===t));if(-1===e)return;const r=this.items[e];this.items.splice(e,1),r.clickableElements=null,r.container&&(r.container.remove(),r.container=null)}relayout(){this.clearContainer();for(const t of this.items)this.layout(t)}requireContainer(){return this.container||(this.container=document.createElement("div"),this.container.id=this.groupId,this.container.dataset.group=this.groupName,this.container.style.pointerEvents="none",document.body.append(this.container)),this.container}clearContainer(){this.container&&(this.container.remove(),this.container=null)}layout(t){e(`layout ${t}`);const r=this.requireContainer(),o=this.styles.get(t.decoration.style);if(!o)return void console.log(`Unknown decoration style: ${t.decoration.style}`);const a=o,s=document.createElement("div");s.id=t.id,s.dataset.style=t.decoration.style,s.style.pointerEvents="none";const c=getComputedStyle(document.body).writingMode,u="vertical-rl"===c||"vertical-lr"===c,l=r.currentCSSZoom,f=document.scrollingElement,p=f.scrollLeft/l,y=f.scrollTop/l,h=u?window.innerHeight:window.innerWidth,d=u?window.innerWidth:window.innerHeight,g=parseInt(getComputedStyle(document.documentElement).getPropertyValue("column-count"))||1,m=(u?d:h)/g;function b(t,e,r,n){t.style.position="absolute";const o="vertical-rl"===n;if(o||"vertical-lr"===n){if("wrap"===a.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,o?t.style.right=`${-e.right-p+f.clientWidth}px`:t.style.left=`${e.left+p}px`,t.style.top=`${e.top+y}px`;else if("viewport"===a.width){t.style.width=`${e.height}px`,t.style.height=`${h}px`;const r=Math.floor(e.top/h)*h;o?t.style.right=-e.right-p+"px":t.style.left=`${e.left+p}px`,t.style.top=`${r+y}px`}else if("bounds"===a.width)t.style.width=`${r.height}px`,t.style.height=`${h}px`,o?t.style.right=`${-r.right-p+f.clientWidth}px`:t.style.left=`${r.left+p}px`,t.style.top=`${r.top+y}px`;else if("page"===a.width){t.style.width=`${e.height}px`,t.style.height=`${m}px`;const r=Math.floor(e.top/m)*m;o?t.style.right=`${-e.right-p+f.clientWidth}px`:t.style.left=`${e.left+p}px`,t.style.top=`${r+y}px`}}else if("wrap"===a.width)t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,t.style.left=`${e.left+p}px`,t.style.top=`${e.top+y}px`;else if("viewport"===a.width){t.style.width=`${h}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/h)*h;t.style.left=`${r+p}px`,t.style.top=`${e.top+y}px`}else if("bounds"===a.width)t.style.width=`${r.width}px`,t.style.height=`${e.height}px`,t.style.left=`${r.left+p}px`,t.style.top=`${e.top+y}px`;else if("page"===a.width){t.style.width=`${m}px`,t.style.height=`${e.height}px`;const r=Math.floor(e.left/m)*m;t.style.left=`${r+p}px`,t.style.top=`${e.top+y}px`}}const w=(v=t.range.getBoundingClientRect(),x=l,new DOMRect(v.x/x,v.y/x,v.width/x,v.height/x));var v,x;let S;try{const e=document.createElement("template");e.innerHTML=t.decoration.element.trim(),S=e.content.firstElementChild}catch(e){let r;return r="message"in e?e.message:null,void console.log(`Invalid decoration element "${t.decoration.element}": ${r}`)}if("boxes"===a.layout){const e=!c.startsWith("vertical"),r=(E=t.range.startContainer).nodeType===Node.ELEMENT_NODE?E:E.parentElement,o=getComputedStyle(r).writingMode,a=i(t.range,e).map((t=>n(t,l))).sort(((t,e)=>t.top!==e.top?t.top-e.top:"vertical-rl"===o?e.left-t.left:t.left-e.left));for(const t of a){const e=S.cloneNode(!0);e.style.pointerEvents="none",e.dataset.writingMode=o,b(e,t,w,c),s.append(e)}}else if("bounds"===a.layout){const t=S.cloneNode(!0);t.style.pointerEvents="none",t.dataset.writingMode=c,b(t,w,w,c),s.append(t)}var E;r.append(s),t.container=s,t.clickableElements=Array.from(s.querySelectorAll("[data-activable='1']")),0===t.clickableElements.length&&(t.clickableElements=Array.from(s.children))}}class T{constructor(t,e,r){this.window=t,this.listener=e,this.decorationManager=r,document.addEventListener("click",(t=>{this.onClick(t)}),!1)}onClick(t){if(t.defaultPrevented)return;let e,r;e=t.target instanceof HTMLElement?this.nearestInteractiveElement(t.target):null,e?e instanceof HTMLAnchorElement&&(this.listener.onLinkActivated(e.href,e.outerHTML),t.stopPropagation(),t.preventDefault()):(r=this.decorationManager?this.decorationManager.handleDecorationClickEvent(t):null,r?this.listener.onDecorationActivated(r):this.listener.onTap(t))}nearestInteractiveElement(t){return null==t?null:-1!=["a","audio","button","canvas","details","input","label","option","select","submit","textarea","video"].indexOf(t.nodeName.toLowerCase())||t.hasAttribute("contenteditable")&&"false"!=t.getAttribute("contenteditable").toLowerCase()?t:t.parentElement?this.nearestInteractiveElement(t.parentElement):null}}var I=r(5155);r.n(I)().shim();class N{constructor(t,e){this.isSelecting=!1,document.addEventListener("selectionchange",(r=>{var n;const o=null===(n=t.getSelection())||void 0===n?void 0:n.isCollapsed;o&&this.isSelecting?(this.isSelecting=!1,e.onSelectionEnd()):o||this.isSelecting||(this.isSelecting=!0,e.onSelectionStart())}),!1)}}class ${constructor(t){this.isSelecting=!1,this.window=t}clearSelection(){var t;null===(t=this.window.getSelection())||void 0===t||t.removeAllRanges()}getCurrentSelection(){const t=this.getCurrentSelectionText();if(!t)return null;const e=this.getSelectionRect();return{selectedText:t.highlight,textBefore:t.before,textAfter:t.after,selectionRect:e}}getSelectionRect(){try{const t=this.window.getSelection().getRangeAt(0),e=this.window.document.body.currentCSSZoom;return n(o(t.getBoundingClientRect()),e)}catch(t){throw e(t),t}}getCurrentSelectionText(){const t=this.window.getSelection();if(t.isCollapsed)return;const r=t.toString();if(0===r.trim().replace(/\n/g," ").replace(/\s\s+/g," ").length)return;if(!t.anchorNode||!t.focusNode)return;const n=1===t.rangeCount?t.getRangeAt(0):function(t,r,n,o){const i=new Range;if(i.setStart(t,r),i.setEnd(n,o),!i.collapsed)return i;e(">>> createOrderedRange COLLAPSED ... RANGE REVERSE?");const a=new Range;if(a.setStart(n,o),a.setEnd(t,r),!a.collapsed)return e(">>> createOrderedRange RANGE REVERSE OK."),i;e(">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!")}(t.anchorNode,t.anchorOffset,t.focusNode,t.focusOffset);if(!n||n.collapsed)return void e("$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!");const o=document.body.textContent,i=O.fromRange(n).relativeTo(document.body),a=i.start.offset,s=i.end.offset;let c=o.slice(Math.max(0,a-200),a);const u=c.search(/\P{L}\p{L}/gu);-1!==u&&(c=c.slice(u+1));let l=o.slice(s,Math.min(o.length,s+200));const f=Array.from(l.matchAll(/\p{L}\P{L}/gu)).pop();return void 0!==f&&f.index>1&&(l=l.slice(0,f.index+1)),{highlight:r,before:c,after:l}}}class M{constructor(t,e){this.window=t,this.manager=e}registerTemplates(t){const e=function(t){return new Map(Object.entries(JSON.parse(t)))}(t);this.manager.registerTemplates(e)}addDecoration(t,e){const r=function(t){return JSON.parse(t)}(t);this.manager.addDecoration(r,e)}removeDecoration(t,e){this.manager.removeDecoration(t,e)}}class D{constructor(t,e){this.gesturesBridge=t,this.selectionListenerBridge=e}onTap(t){const e={x:(t.clientX-visualViewport.offsetLeft)*visualViewport.scale,y:(t.clientY-visualViewport.offsetTop)*visualViewport.scale},r=JSON.stringify(e);this.gesturesBridge.onTap(r)}onLinkActivated(t,e){this.gesturesBridge.onLinkActivated(t,e)}onDecorationActivated(t){const e={x:(t.event.clientX-visualViewport.offsetLeft)*visualViewport.scale,y:(t.event.clientY-visualViewport.offsetTop)*visualViewport.scale},r=JSON.stringify(e),n=JSON.stringify(t.rect);this.gesturesBridge.onDecorationActivated(t.id,t.group,n,r)}onSelectionStart(){this.selectionListenerBridge.onSelectionStart()}onSelectionEnd(){this.selectionListenerBridge.onSelectionEnd()}}class F{constructor(t,e){this.window=t,this.manager=e}getCurrentSelection(){return this.manager.getCurrentSelection()}clearSelection(){this.manager.clearSelection()}}class k{constructor(t){this.document=t}setProperties(t){for(const[e,r]of t)this.setProperty(e,r)}setProperty(t,e){null===e||""===e?this.removeProperty(t):document.documentElement.style.setProperty(t,e,"important")}removeProperty(t){document.documentElement.style.removeProperty(t)}}class B{constructor(t){this.document=t}getOffsetForLocation(t,e){var r,n;const o=function(t){return JSON.parse(t)}(t);return o.textAfter||o.textBefore?this.getOffsetForTextAnchor(null!==(r=o.textBefore)&&void 0!==r?r:"",null!==(n=o.textAfter)&&void 0!==n?n:"",e):o.cssSelector?this.getOffsetForCssSelector(o.cssSelector,e):o.htmlId?this.getOffsetForHtmlId(o.htmlId,e):null}getOffsetForTextAnchor(t,r,n){const o=this.document.body,i=new P(o,"",{prefix:t,suffix:r});try{const t=i.toRange();return this.getOffsetForRect(t.getBoundingClientRect(),n)}catch(t){return e(t),null}}getOffsetForCssSelector(t,r){let n;try{n=this.document.querySelector(t)}catch(t){e(t)}return n?this.getOffsetForElement(n,r):null}getOffsetForHtmlId(t,e){const r=this.document.getElementById(t);return r?this.getOffsetForElement(r,e):null}getOffsetForElement(t,e){const r=t.getBoundingClientRect();return this.getOffsetForRect(r,e)}getOffsetForRect(t,e){return e?t.top+window.scrollY:t.left+window.scrollX}}window.addEventListener("load",(t=>{let e=!1;new ResizeObserver((()=>{let t=!1;requestAnimationFrame((()=>{const r=window.document.scrollingElement,n=null==r||0==r.scrollHeight&&0==r.scrollWidth;if(e||!n){if(!t&&!n){const e=function(t){const e=function(t){return parseInt(t.getComputedStyle(t.document.documentElement).getPropertyValue("column-count"))}(t);if(!e)return!1;const r=t.document.querySelectorAll("div[id^='readium-virtual-page']"),n=r.length;for(const t of r)t.remove();const o=t.document.scrollingElement.scrollWidth,i=t.visualViewport.width,a=Math.round(o/i*e)%e,s=1===e||0===a?0:e-a;if(s>0)for(let e=0;e{const t=document.createElement("meta");t.setAttribute("name","viewport"),t.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"),this.window.document.head.appendChild(t)}))}}(window,window.reflowableApiState)}()}(); //# sourceMappingURL=reflowable-injectable-script.js.map \ No newline at end of file diff --git a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/reflowable-injectable-script.js.map b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/reflowable-injectable-script.js.map index 26726113ad..36d82ab404 100644 --- a/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/reflowable-injectable-script.js.map +++ b/readium/navigators/web/internals/src/main/assets/readium/navigator/web/internals/generated/reflowable-injectable-script.js.map @@ -1 +1 @@ -{"version":3,"file":"reflowable-injectable-script.js","mappings":"mDAmCA,SAASA,EAAQC,GACb,OAAOA,EACFC,MAAM,IACNF,UACAG,KAAK,GACd,CAwCA,SAASC,EAAaC,GAClB,OAASA,GAAKA,IAAM,GAAM,CAC9B,CAaA,SAASC,EAAaC,EAAKC,EAAKC,EAAGC,GAC/B,IAAIC,EAAKJ,EAAIK,EAAEH,GACXI,EAAKN,EAAIO,EAAEL,GACXM,EAAgBL,IAAQ,GACxBM,EAAKR,EAAIC,GAAKM,EAEdE,E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oB,KACtD,MAAM+M,EAAOnuB,SAASmiB,cAAc,QACpCgM,EAAKhB,aAAa,OAAQ,YAC1BgB,EAAKhB,aAAa,UAAW,gGAC7B31B,KAAK6S,OAAOrK,SAASouB,KAAK9L,YAAY6L,EAAK,GAEnD,GFQsB9jB,OAAQA,OAAOgkB,mB","sources":["webpack://readium-js/./node_modules/.pnpm/approx-string-match@1.1.0/node_modules/approx-string-match/dist/index.js","webpack://readium-js/./node_modules/.pnpm/call-bind@1.0.2/node_modules/call-bind/callBound.js","webpack://readium-js/./node_modules/.pnpm/call-bind@1.0.2/node_modules/call-bind/index.js","webpack://readium-js/./node_modules/.pnpm/define-data-property@1.1.0/node_modules/define-data-property/index.js","webpack://readium-js/./node_modules/.pnpm/define-properties@1.2.1/node_modules/define-properties/index.js","webpack://readium-js/./node_modules/.pnpm/es-set-tostringtag@2.0.1/node_modules/es-set-tostringtag/index.js","webpack://readium-js/./node_modules/.pnpm/es-to-primitive@1.2.1/node_modules/es-to-primitive/es2015.js","webpack://readium-js/./node_modules/.pnpm/es-to-primitive@1.2.1/node_modules/es-to-primitive/helpers/isPrimitive.js","webpack://readium-js/./node_modules/.pnpm/function-bind@1.1.1/node_modules/function-bind/implementation.js","webpack://readium-js/./node_modules/.pnpm/function-bind@1.1.1/node_modules/function-bind/index.js","webpack://readium-js/./node_modules/.pnpm/functions-have-names@1.2.3/node_modules/functions-have-names/index.js","webpack://readium-js/./node_modules/.pnpm/get-intrinsic@1.2.1/node_modules/get-intrinsic/index.js","webpack://readium-js/./node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.js","webpack://readium-js/./node_modules/.pnpm/has-property-descriptors@1.0.0/node_modules/has-property-descriptors/index.js","webpack://readium-js/./node_modules/.pnpm/has-proto@1.0.1/node_modules/has-proto/index.js","webpack://readium-js/./node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/index.js","webpack://readium-js/./node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/shams.js","webpack://readium-js/./node_modules/.pnpm/has-tostringtag@1.0.0/node_modules/has-tostringtag/shams.js","webpack://readium-js/./node_modules/.pnpm/has@1.0.4/node_modules/has/src/index.js","webpack://readium-js/./node_modules/.pnpm/internal-slot@1.0.5/node_modules/internal-slot/index.js","webpack://readium-js/./node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/index.js","webpack://readium-js/./node_modules/.pnpm/is-date-object@1.0.5/node_modules/is-date-object/index.js","webpack://readium-js/./node_modules/.pnpm/is-regex@1.1.4/node_modules/is-regex/index.js","webpack://readium-js/./node_modules/.pnpm/is-symbol@1.0.4/node_modules/is-symbol/index.js","webpack://readium-js/./node_modules/.pnpm/object-inspect@1.12.3/node_modules/object-inspect/index.js","webpack://readium-js/./node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/implementation.js","webpack://readium-js/./node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/index.js","webpack://readium-js/./node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/isArguments.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/implementation.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/index.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/polyfill.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/shim.js","webpack://readium-js/./node_modules/.pnpm/safe-regex-test@1.0.0/node_modules/safe-regex-test/index.js","webpack://readium-js/./node_modules/.pnpm/set-function-name@2.0.1/node_modules/set-function-name/index.js","webpack://readium-js/./node_modules/.pnpm/side-channel@1.0.4/node_modules/side-channel/index.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/implementation.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/index.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/polyfill-regexp-matchall.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/polyfill.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/regexp-matchall.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/shim.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/implementation.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/index.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/polyfill.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/shim.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/AdvanceStringIndex.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Call.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CodePointAt.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CreateIterResultObject.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CreateMethodProperty.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CreateRegExpStringIterator.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/DefinePropertyOrThrow.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/FromPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Get.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/GetMethod.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/GetV.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsAccessorDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsArray.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsCallable.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsConstructor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsDataDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsPropertyKey.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsRegExp.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/OrdinaryObjectCreate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/RegExpExec.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/RequireObjectCoercible.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/SameValue.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Set.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/SpeciesConstructor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/StringToNumber.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToBoolean.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToIntegerOrInfinity.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToLength.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToNumber.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToPrimitive.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToString.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Type.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/UTF16SurrogatePairToCodePoint.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/floor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/truncate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/5/CheckObjectCoercible.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/5/Type.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/GetIntrinsic.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/DefineOwnProperty.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/IsArray.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/assertRecord.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/forEach.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/fromPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isFinite.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isInteger.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isLeadingSurrogate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isMatchRecord.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isNaN.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isPrimitive.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isTrailingSurrogate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/maxSafeInteger.js","webpack://readium-js/webpack/bootstrap","webpack://readium-js/webpack/runtime/compat get default export","webpack://readium-js/webpack/runtime/define property getters","webpack://readium-js/webpack/runtime/hasOwnProperty shorthand","webpack://readium-js/./src/util/log.ts","webpack://readium-js/./src/util/rect.ts","webpack://readium-js/./src/vendor/hypothesis/annotator/anchoring/trim-range.ts","webpack://readium-js/./src/vendor/hypothesis/annotator/anchoring/text-range.ts","webpack://readium-js/./src/vendor/hypothesis/annotator/anchoring/match-quote.ts","webpack://readium-js/./src/vendor/hypothesis/annotator/anchoring/types.ts","webpack://readium-js/./src/common/decoration.ts","webpack://readium-js/./src/common/gestures.ts","webpack://readium-js/./src/common/selection.ts","webpack://readium-js/./src/bridge/all-decoration-bridge.ts","webpack://readium-js/./src/bridge/all-listener-bridge.ts","webpack://readium-js/./src/bridge/all-selection-bridge.ts","webpack://readium-js/./src/bridge/reflowable-css-bridge.ts","webpack://readium-js/./src/index-reflowable-injectable.ts","webpack://readium-js/./src/util/columns.ts","webpack://readium-js/./src/bridge/reflowable-initialization-bridge.ts"],"sourcesContent":["\"use strict\";\n/**\n * Implementation of Myers' online approximate string matching algorithm [1],\n * with additional optimizations suggested by [2].\n *\n * This has O((k/w) * n) complexity where `n` is the length of the text, `k` is\n * the maximum number of errors allowed (always <= the pattern length) and `w`\n * is the word size. Because JS only supports bitwise operations on 32 bit\n * integers, `w` is 32.\n *\n * As far as I am aware, there aren't any online algorithms which are\n * significantly better for a wide range of input parameters. The problem can be\n * solved faster using \"filter then verify\" approaches which first filter out\n * regions of the text that cannot match using a \"cheap\" check and then verify\n * the remaining potential matches. The verify step requires an algorithm such\n * as this one however.\n *\n * The algorithm's approach is essentially to optimize the classic dynamic\n * programming solution to the problem by computing columns of the matrix in\n * word-sized chunks (ie. dealing with 32 chars of the pattern at a time) and\n * avoiding calculating regions of the matrix where the minimum error count is\n * guaranteed to exceed the input threshold.\n *\n * The paper consists of two parts, the first describes the core algorithm for\n * matching patterns <= the size of a word (implemented by `advanceBlock` here).\n * The second uses the core algorithm as part of a larger block-based algorithm\n * to handle longer patterns.\n *\n * [1] G. Myers, “A Fast Bit-Vector Algorithm for Approximate String Matching\n * Based on Dynamic Programming,” vol. 46, no. 3, pp. 395–415, 1999.\n *\n * [2] Šošić, M. (2014). An simd dynamic programming c/c++ library (Doctoral\n * dissertation, Fakultet Elektrotehnike i računarstva, Sveučilište u Zagrebu).\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction reverse(s) {\n return s\n .split(\"\")\n .reverse()\n .join(\"\");\n}\n/**\n * Given the ends of approximate matches for `pattern` in `text`, find\n * the start of the matches.\n *\n * @param findEndFn - Function for finding the end of matches in\n * text.\n * @return Matches with the `start` property set.\n */\nfunction findMatchStarts(text, pattern, matches) {\n var patRev = reverse(pattern);\n return matches.map(function (m) {\n // Find start of each match by reversing the pattern and matching segment\n // of text and searching for an approx match with the same number of\n // errors.\n var minStart = Math.max(0, m.end - pattern.length - m.errors);\n var textRev = reverse(text.slice(minStart, m.end));\n // If there are multiple possible start points, choose the one that\n // maximizes the length of the match.\n var start = findMatchEnds(textRev, patRev, m.errors).reduce(function (min, rm) {\n if (m.end - rm.end < min) {\n return m.end - rm.end;\n }\n return min;\n }, m.end);\n return {\n start: start,\n end: m.end,\n errors: m.errors\n };\n });\n}\n/**\n * Return 1 if a number is non-zero or zero otherwise, without using\n * conditional operators.\n *\n * This should get inlined into `advanceBlock` below by the JIT.\n *\n * Adapted from https://stackoverflow.com/a/3912218/434243\n */\nfunction oneIfNotZero(n) {\n return ((n | -n) >> 31) & 1;\n}\n/**\n * Block calculation step of the algorithm.\n *\n * From Fig 8. on p. 408 of [1], additionally optimized to replace conditional\n * checks with bitwise operations as per Section 4.2.3 of [2].\n *\n * @param ctx - The pattern context object\n * @param peq - The `peq` array for the current character (`ctx.peq.get(ch)`)\n * @param b - The block level\n * @param hIn - Horizontal input delta ∈ {1,0,-1}\n * @return Horizontal output delta ∈ {1,0,-1}\n */\nfunction advanceBlock(ctx, peq, b, hIn) {\n var pV = ctx.P[b];\n var mV = ctx.M[b];\n var hInIsNegative = hIn >>> 31; // 1 if hIn < 0 or 0 otherwise.\n var eq = peq[b] | hInIsNegative;\n // Step 1: Compute horizontal deltas.\n var xV = eq | mV;\n var xH = (((eq & pV) + pV) ^ pV) | eq;\n var pH = mV | ~(xH | pV);\n var mH = pV & xH;\n // Step 2: Update score (value of last row of this block).\n var hOut = oneIfNotZero(pH & ctx.lastRowMask[b]) -\n oneIfNotZero(mH & ctx.lastRowMask[b]);\n // Step 3: Update vertical deltas for use when processing next char.\n pH <<= 1;\n mH <<= 1;\n mH |= hInIsNegative;\n pH |= oneIfNotZero(hIn) - hInIsNegative; // set pH[0] if hIn > 0\n pV = mH | ~(xV | pH);\n mV = pH & xV;\n ctx.P[b] = pV;\n ctx.M[b] = mV;\n return hOut;\n}\n/**\n * Find the ends and error counts for matches of `pattern` in `text`.\n *\n * Only the matches with the lowest error count are reported. Other matches\n * with error counts <= maxErrors are discarded.\n *\n * This is the block-based search algorithm from Fig. 9 on p.410 of [1].\n */\nfunction findMatchEnds(text, pattern, maxErrors) {\n if (pattern.length === 0) {\n return [];\n }\n // Clamp error count so we can rely on the `maxErrors` and `pattern.length`\n // rows being in the same block below.\n maxErrors = Math.min(maxErrors, pattern.length);\n var matches = [];\n // Word size.\n var w = 32;\n // Index of maximum block level.\n var bMax = Math.ceil(pattern.length / w) - 1;\n // Context used across block calculations.\n var ctx = {\n P: new Uint32Array(bMax + 1),\n M: new Uint32Array(bMax + 1),\n lastRowMask: new Uint32Array(bMax + 1)\n };\n ctx.lastRowMask.fill(1 << 31);\n ctx.lastRowMask[bMax] = 1 << (pattern.length - 1) % w;\n // Dummy \"peq\" array for chars in the text which do not occur in the pattern.\n var emptyPeq = new Uint32Array(bMax + 1);\n // Map of UTF-16 character code to bit vector indicating positions in the\n // pattern that equal that character.\n var peq = new Map();\n // Version of `peq` that only stores mappings for small characters. This\n // allows faster lookups when iterating through the text because a simple\n // array lookup can be done instead of a hash table lookup.\n var asciiPeq = [];\n for (var i = 0; i < 256; i++) {\n asciiPeq.push(emptyPeq);\n }\n // Calculate `ctx.peq` - a map of character values to bitmasks indicating\n // positions of that character within the pattern, where each bit represents\n // a position in the pattern.\n for (var c = 0; c < pattern.length; c += 1) {\n var val = pattern.charCodeAt(c);\n if (peq.has(val)) {\n // Duplicate char in pattern.\n continue;\n }\n var charPeq = new Uint32Array(bMax + 1);\n peq.set(val, charPeq);\n if (val < asciiPeq.length) {\n asciiPeq[val] = charPeq;\n }\n for (var b = 0; b <= bMax; b += 1) {\n charPeq[b] = 0;\n // Set all the bits where the pattern matches the current char (ch).\n // For indexes beyond the end of the pattern, always set the bit as if the\n // pattern contained a wildcard char in that position.\n for (var r = 0; r < w; r += 1) {\n var idx = b * w + r;\n if (idx >= pattern.length) {\n continue;\n }\n var match = pattern.charCodeAt(idx) === val;\n if (match) {\n charPeq[b] |= 1 << r;\n }\n }\n }\n }\n // Index of last-active block level in the column.\n var y = Math.max(0, Math.ceil(maxErrors / w) - 1);\n // Initialize maximum error count at bottom of each block.\n var score = new Uint32Array(bMax + 1);\n for (var b = 0; b <= y; b += 1) {\n score[b] = (b + 1) * w;\n }\n score[bMax] = pattern.length;\n // Initialize vertical deltas for each block.\n for (var b = 0; b <= y; b += 1) {\n ctx.P[b] = ~0;\n ctx.M[b] = 0;\n }\n // Process each char of the text, computing the error count for `w` chars of\n // the pattern at a time.\n for (var j = 0; j < text.length; j += 1) {\n // Lookup the bitmask representing the positions of the current char from\n // the text within the pattern.\n var charCode = text.charCodeAt(j);\n var charPeq = void 0;\n if (charCode < asciiPeq.length) {\n // Fast array lookup.\n charPeq = asciiPeq[charCode];\n }\n else {\n // Slower hash table lookup.\n charPeq = peq.get(charCode);\n if (typeof charPeq === \"undefined\") {\n charPeq = emptyPeq;\n }\n }\n // Calculate error count for blocks that we definitely have to process for\n // this column.\n var carry = 0;\n for (var b = 0; b <= y; b += 1) {\n carry = advanceBlock(ctx, charPeq, b, carry);\n score[b] += carry;\n }\n // Check if we also need to compute an additional block, or if we can reduce\n // the number of blocks processed for the next column.\n if (score[y] - carry <= maxErrors &&\n y < bMax &&\n (charPeq[y + 1] & 1 || carry < 0)) {\n // Error count for bottom block is under threshold, increase the number of\n // blocks processed for this column & next by 1.\n y += 1;\n ctx.P[y] = ~0;\n ctx.M[y] = 0;\n var maxBlockScore = y === bMax ? pattern.length % w : w;\n score[y] =\n score[y - 1] +\n maxBlockScore -\n carry +\n advanceBlock(ctx, charPeq, y, carry);\n }\n else {\n // Error count for bottom block exceeds threshold, reduce the number of\n // blocks processed for the next column.\n while (y > 0 && score[y] >= maxErrors + w) {\n y -= 1;\n }\n }\n // If error count is under threshold, report a match.\n if (y === bMax && score[y] <= maxErrors) {\n if (score[y] < maxErrors) {\n // Discard any earlier, worse matches.\n matches.splice(0, matches.length);\n }\n matches.push({\n start: -1,\n end: j + 1,\n errors: score[y]\n });\n // Because `search` only reports the matches with the lowest error count,\n // we can \"ratchet down\" the max error threshold whenever a match is\n // encountered and thereby save a small amount of work for the remainder\n // of the text.\n maxErrors = score[y];\n }\n }\n return matches;\n}\n/**\n * Search for matches for `pattern` in `text` allowing up to `maxErrors` errors.\n *\n * Returns the start, and end positions and error counts for each lowest-cost\n * match. Only the \"best\" matches are returned.\n */\nfunction search(text, pattern, maxErrors) {\n var matches = findMatchEnds(text, pattern, maxErrors);\n return findMatchStarts(text, pattern, matches);\n}\nexports.default = search;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBind = require('./');\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = null;\n\t}\n}\n\nmodule.exports = function callBind(originalFunction) {\n\tvar func = $reflectApply(bind, $call, arguments);\n\tif ($gOPD && $defineProperty) {\n\t\tvar desc = $gOPD(func, 'length');\n\t\tif (desc.configurable) {\n\t\t\t// original length, plus the receiver, minus any additional arguments (after the receiver)\n\t\t\t$defineProperty(\n\t\t\t\tfunc,\n\t\t\t\t'length',\n\t\t\t\t{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }\n\t\t\t);\n\t\t}\n\t}\n\treturn func;\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","'use strict';\n\nvar hasPropertyDescriptors = require('has-property-descriptors')();\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = hasPropertyDescriptors && GetIntrinsic('%Object.defineProperty%', true);\n\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar gopd = require('gopd');\n\n/** @type {(obj: Record, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */\nmodule.exports = function defineDataProperty(\n\tobj,\n\tproperty,\n\tvalue\n) {\n\tif (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n\t\tthrow new $TypeError('`obj` must be an object or a function`');\n\t}\n\tif (typeof property !== 'string' && typeof property !== 'symbol') {\n\t\tthrow new $TypeError('`property` must be a string or a symbol`');\n\t}\n\tif (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {\n\t\tthrow new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {\n\t\tthrow new $TypeError('`nonWritable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {\n\t\tthrow new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 6 && typeof arguments[6] !== 'boolean') {\n\t\tthrow new $TypeError('`loose`, if provided, must be a boolean');\n\t}\n\n\tvar nonEnumerable = arguments.length > 3 ? arguments[3] : null;\n\tvar nonWritable = arguments.length > 4 ? arguments[4] : null;\n\tvar nonConfigurable = arguments.length > 5 ? arguments[5] : null;\n\tvar loose = arguments.length > 6 ? arguments[6] : false;\n\n\t/* @type {false | TypedPropertyDescriptor} */\n\tvar desc = !!gopd && gopd(obj, property);\n\n\tif ($defineProperty) {\n\t\t$defineProperty(obj, property, {\n\t\t\tconfigurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,\n\t\t\tenumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,\n\t\t\tvalue: value,\n\t\t\twritable: nonWritable === null && desc ? desc.writable : !nonWritable\n\t\t});\n\t} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {\n\t\t// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable\n\t\tobj[property] = value; // eslint-disable-line no-param-reassign\n\t} else {\n\t\tthrow new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');\n\t}\n};\n","'use strict';\n\nvar keys = require('object-keys');\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';\n\nvar toStr = Object.prototype.toString;\nvar concat = Array.prototype.concat;\nvar defineDataProperty = require('define-data-property');\n\nvar isFunction = function (fn) {\n\treturn typeof fn === 'function' && toStr.call(fn) === '[object Function]';\n};\n\nvar supportsDescriptors = require('has-property-descriptors')();\n\nvar defineProperty = function (object, name, value, predicate) {\n\tif (name in object) {\n\t\tif (predicate === true) {\n\t\t\tif (object[name] === value) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (!isFunction(predicate) || !predicate()) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (supportsDescriptors) {\n\t\tdefineDataProperty(object, name, value, true);\n\t} else {\n\t\tdefineDataProperty(object, name, value);\n\t}\n};\n\nvar defineProperties = function (object, map) {\n\tvar predicates = arguments.length > 2 ? arguments[2] : {};\n\tvar props = keys(map);\n\tif (hasSymbols) {\n\t\tprops = concat.call(props, Object.getOwnPropertySymbols(map));\n\t}\n\tfor (var i = 0; i < props.length; i += 1) {\n\t\tdefineProperty(object, props[i], map[props[i]], predicates[props[i]]);\n\t}\n};\n\ndefineProperties.supportsDescriptors = !!supportsDescriptors;\n\nmodule.exports = defineProperties;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar has = require('has');\n\nvar toStringTag = hasToStringTag ? Symbol.toStringTag : null;\n\nmodule.exports = function setToStringTag(object, value) {\n\tvar overrideIfSet = arguments.length > 2 && arguments[2] && arguments[2].force;\n\tif (toStringTag && (overrideIfSet || !has(object, toStringTag))) {\n\t\tif ($defineProperty) {\n\t\t\t$defineProperty(object, toStringTag, {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: false,\n\t\t\t\tvalue: value,\n\t\t\t\twritable: false\n\t\t\t});\n\t\t} else {\n\t\t\tobject[toStringTag] = value; // eslint-disable-line no-param-reassign\n\t\t}\n\t}\n};\n","'use strict';\n\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';\n\nvar isPrimitive = require('./helpers/isPrimitive');\nvar isCallable = require('is-callable');\nvar isDate = require('is-date-object');\nvar isSymbol = require('is-symbol');\n\nvar ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) {\n\tif (typeof O === 'undefined' || O === null) {\n\t\tthrow new TypeError('Cannot call method on ' + O);\n\t}\n\tif (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) {\n\t\tthrow new TypeError('hint must be \"string\" or \"number\"');\n\t}\n\tvar methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString'];\n\tvar method, result, i;\n\tfor (i = 0; i < methodNames.length; ++i) {\n\t\tmethod = O[methodNames[i]];\n\t\tif (isCallable(method)) {\n\t\t\tresult = method.call(O);\n\t\t\tif (isPrimitive(result)) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t}\n\tthrow new TypeError('No default value');\n};\n\nvar GetMethod = function GetMethod(O, P) {\n\tvar func = O[P];\n\tif (func !== null && typeof func !== 'undefined') {\n\t\tif (!isCallable(func)) {\n\t\t\tthrow new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function');\n\t\t}\n\t\treturn func;\n\t}\n\treturn void 0;\n};\n\n// http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive\nmodule.exports = function ToPrimitive(input) {\n\tif (isPrimitive(input)) {\n\t\treturn input;\n\t}\n\tvar hint = 'default';\n\tif (arguments.length > 1) {\n\t\tif (arguments[1] === String) {\n\t\t\thint = 'string';\n\t\t} else if (arguments[1] === Number) {\n\t\t\thint = 'number';\n\t\t}\n\t}\n\n\tvar exoticToPrim;\n\tif (hasSymbols) {\n\t\tif (Symbol.toPrimitive) {\n\t\t\texoticToPrim = GetMethod(input, Symbol.toPrimitive);\n\t\t} else if (isSymbol(input)) {\n\t\t\texoticToPrim = Symbol.prototype.valueOf;\n\t\t}\n\t}\n\tif (typeof exoticToPrim !== 'undefined') {\n\t\tvar result = exoticToPrim.call(input, hint);\n\t\tif (isPrimitive(result)) {\n\t\t\treturn result;\n\t\t}\n\t\tthrow new TypeError('unable to convert exotic object to primitive');\n\t}\n\tif (hint === 'default' && (isDate(input) || isSymbol(input))) {\n\t\thint = 'string';\n\t}\n\treturn ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint);\n};\n","'use strict';\n\nmodule.exports = function isPrimitive(value) {\n\treturn value === null || (typeof value !== 'function' && typeof value !== 'object');\n};\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slice.call(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n args.concat(slice.call(arguments))\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n } else {\n return target.apply(\n that,\n args.concat(slice.call(arguments))\n );\n }\n };\n\n var boundLength = Math.max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs.push('$' + i);\n }\n\n bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\nvar functionsHaveNames = function functionsHaveNames() {\n\treturn typeof function f() {}.name === 'string';\n};\n\nvar gOPD = Object.getOwnPropertyDescriptor;\nif (gOPD) {\n\ttry {\n\t\tgOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\tgOPD = null;\n\t}\n}\n\nfunctionsHaveNames.functionsHaveConfigurableNames = function functionsHaveConfigurableNames() {\n\tif (!functionsHaveNames() || !gOPD) {\n\t\treturn false;\n\t}\n\tvar desc = gOPD(function () {}, 'name');\n\treturn !!desc && !!desc.configurable;\n};\n\nvar $bind = Function.prototype.bind;\n\nfunctionsHaveNames.boundFunctionsHaveNames = function boundFunctionsHaveNames() {\n\treturn functionsHaveNames() && typeof $bind === 'function' && function f() {}.bind().name !== '';\n};\n\nmodule.exports = functionsHaveNames;\n","'use strict';\n\nvar undefined;\n\nvar $SyntaxError = SyntaxError;\nvar $Function = Function;\nvar $TypeError = TypeError;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\nif ($gOPD) {\n\ttry {\n\t\t$gOPD({}, '');\n\t} catch (e) {\n\t\t$gOPD = null; // this is IE 8, which has a broken gOPD\n\t}\n}\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\nvar hasProto = require('has-proto')();\n\nvar getProto = Object.getPrototypeOf || (\n\thasProto\n\t\t? function (x) { return x.__proto__; } // eslint-disable-line no-proto\n\t\t: null\n);\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,\n\t'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': EvalError,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': Object,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': RangeError,\n\t'%ReferenceError%': ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nif (getProto) {\n\ttry {\n\t\tnull.error; // eslint-disable-line no-unused-expressions\n\t} catch (e) {\n\t\t// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n\t\tvar errorProto = getProto(getProto(e));\n\t\tINTRINSICS['%Error.prototype%'] = errorProto;\n\t}\n}\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen && getProto) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('has');\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\nvar $exec = bind.call(Function.call, RegExp.prototype.exec);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tif ($exec(/^%?[^%]*%?$/, name) === null) {\n\t\tthrow new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');\n\t}\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\n\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasPropertyDescriptors = function hasPropertyDescriptors() {\n\tif ($defineProperty) {\n\t\ttry {\n\t\t\t$defineProperty({}, 'a', { value: 1 });\n\t\t\treturn true;\n\t\t} catch (e) {\n\t\t\t// IE 8 has a broken defineProperty\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn false;\n};\n\nhasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {\n\t// node v0.6 has a bug where array lengths can be Set but not Defined\n\tif (!hasPropertyDescriptors()) {\n\t\treturn null;\n\t}\n\ttry {\n\t\treturn $defineProperty([], 'length', { value: 1 }).length !== 1;\n\t} catch (e) {\n\t\t// In Firefox 4-22, defining length on an array throws an exception.\n\t\treturn true;\n\t}\n};\n\nmodule.exports = hasPropertyDescriptors;\n","'use strict';\n\nvar test = {\n\tfoo: {}\n};\n\nvar $Object = Object;\n\nmodule.exports = function hasProto() {\n\treturn { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar hasSymbols = require('has-symbols/shams');\n\nmodule.exports = function hasToStringTagShams() {\n\treturn hasSymbols() && !!Symbol.toStringTag;\n};\n","'use strict';\n\nvar hasOwnProperty = {}.hasOwnProperty;\nvar call = Function.prototype.call;\n\nmodule.exports = call.bind ? call.bind(hasOwnProperty) : function (O, P) {\n return call.call(hasOwnProperty, O, P);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar has = require('has');\nvar channel = require('side-channel')();\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar SLOT = {\n\tassert: function (O, slot) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tchannel.assert(O);\n\t\tif (!SLOT.has(O, slot)) {\n\t\t\tthrow new $TypeError('`' + slot + '` is not present on `O`');\n\t\t}\n\t},\n\tget: function (O, slot) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tvar slots = channel.get(O);\n\t\treturn slots && slots['$' + slot];\n\t},\n\thas: function (O, slot) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tvar slots = channel.get(O);\n\t\treturn !!slots && has(slots, '$' + slot);\n\t},\n\tset: function (O, slot, V) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tvar slots = channel.get(O);\n\t\tif (!slots) {\n\t\t\tslots = {};\n\t\t\tchannel.set(O, slots);\n\t\t}\n\t\tslots['$' + slot] = V;\n\t}\n};\n\nif (Object.freeze) {\n\tObject.freeze(SLOT);\n}\n\nmodule.exports = SLOT;\n","'use strict';\n\nvar fnToStr = Function.prototype.toString;\nvar reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;\nvar badArrayLike;\nvar isCallableMarker;\nif (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {\n\ttry {\n\t\tbadArrayLike = Object.defineProperty({}, 'length', {\n\t\t\tget: function () {\n\t\t\t\tthrow isCallableMarker;\n\t\t\t}\n\t\t});\n\t\tisCallableMarker = {};\n\t\t// eslint-disable-next-line no-throw-literal\n\t\treflectApply(function () { throw 42; }, null, badArrayLike);\n\t} catch (_) {\n\t\tif (_ !== isCallableMarker) {\n\t\t\treflectApply = null;\n\t\t}\n\t}\n} else {\n\treflectApply = null;\n}\n\nvar constructorRegex = /^\\s*class\\b/;\nvar isES6ClassFn = function isES6ClassFunction(value) {\n\ttry {\n\t\tvar fnStr = fnToStr.call(value);\n\t\treturn constructorRegex.test(fnStr);\n\t} catch (e) {\n\t\treturn false; // not a function\n\t}\n};\n\nvar tryFunctionObject = function tryFunctionToStr(value) {\n\ttry {\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tfnToStr.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\nvar toStr = Object.prototype.toString;\nvar objectClass = '[object Object]';\nvar fnClass = '[object Function]';\nvar genClass = '[object GeneratorFunction]';\nvar ddaClass = '[object HTMLAllCollection]'; // IE 11\nvar ddaClass2 = '[object HTML document.all class]';\nvar ddaClass3 = '[object HTMLCollection]'; // IE 9-10\nvar hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag`\n\nvar isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing\n\nvar isDDA = function isDocumentDotAll() { return false; };\nif (typeof document === 'object') {\n\t// Firefox 3 canonicalizes DDA to undefined when it's not accessed directly\n\tvar all = document.all;\n\tif (toStr.call(all) === toStr.call(document.all)) {\n\t\tisDDA = function isDocumentDotAll(value) {\n\t\t\t/* globals document: false */\n\t\t\t// in IE 6-8, typeof document.all is \"object\" and it's truthy\n\t\t\tif ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) {\n\t\t\t\ttry {\n\t\t\t\t\tvar str = toStr.call(value);\n\t\t\t\t\treturn (\n\t\t\t\t\t\tstr === ddaClass\n\t\t\t\t\t\t|| str === ddaClass2\n\t\t\t\t\t\t|| str === ddaClass3 // opera 12.16\n\t\t\t\t\t\t|| str === objectClass // IE 6-8\n\t\t\t\t\t) && value('') == null; // eslint-disable-line eqeqeq\n\t\t\t\t} catch (e) { /**/ }\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\t}\n}\n\nmodule.exports = reflectApply\n\t? function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\ttry {\n\t\t\treflectApply(value, null, badArrayLike);\n\t\t} catch (e) {\n\t\t\tif (e !== isCallableMarker) { return false; }\n\t\t}\n\t\treturn !isES6ClassFn(value) && tryFunctionObject(value);\n\t}\n\t: function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\tif (hasToStringTag) { return tryFunctionObject(value); }\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tvar strClass = toStr.call(value);\n\t\tif (strClass !== fnClass && strClass !== genClass && !(/^\\[object HTML/).test(strClass)) { return false; }\n\t\treturn tryFunctionObject(value);\n\t};\n","'use strict';\n\nvar getDay = Date.prototype.getDay;\nvar tryDateObject = function tryDateGetDayCall(value) {\n\ttry {\n\t\tgetDay.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\n\nvar toStr = Object.prototype.toString;\nvar dateClass = '[object Date]';\nvar hasToStringTag = require('has-tostringtag/shams')();\n\nmodule.exports = function isDateObject(value) {\n\tif (typeof value !== 'object' || value === null) {\n\t\treturn false;\n\t}\n\treturn hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass;\n};\n","'use strict';\n\nvar callBound = require('call-bind/callBound');\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar has;\nvar $exec;\nvar isRegexMarker;\nvar badStringifier;\n\nif (hasToStringTag) {\n\thas = callBound('Object.prototype.hasOwnProperty');\n\t$exec = callBound('RegExp.prototype.exec');\n\tisRegexMarker = {};\n\n\tvar throwRegexMarker = function () {\n\t\tthrow isRegexMarker;\n\t};\n\tbadStringifier = {\n\t\ttoString: throwRegexMarker,\n\t\tvalueOf: throwRegexMarker\n\t};\n\n\tif (typeof Symbol.toPrimitive === 'symbol') {\n\t\tbadStringifier[Symbol.toPrimitive] = throwRegexMarker;\n\t}\n}\n\nvar $toString = callBound('Object.prototype.toString');\nvar gOPD = Object.getOwnPropertyDescriptor;\nvar regexClass = '[object RegExp]';\n\nmodule.exports = hasToStringTag\n\t// eslint-disable-next-line consistent-return\n\t? function isRegex(value) {\n\t\tif (!value || typeof value !== 'object') {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar descriptor = gOPD(value, 'lastIndex');\n\t\tvar hasLastIndexDataProperty = descriptor && has(descriptor, 'value');\n\t\tif (!hasLastIndexDataProperty) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\t$exec(value, badStringifier);\n\t\t} catch (e) {\n\t\t\treturn e === isRegexMarker;\n\t\t}\n\t}\n\t: function isRegex(value) {\n\t\t// In older browsers, typeof regex incorrectly returns 'function'\n\t\tif (!value || (typeof value !== 'object' && typeof value !== 'function')) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $toString(value) === regexClass;\n\t};\n","'use strict';\n\nvar toStr = Object.prototype.toString;\nvar hasSymbols = require('has-symbols')();\n\nif (hasSymbols) {\n\tvar symToStr = Symbol.prototype.toString;\n\tvar symStringRegex = /^Symbol\\(.*\\)$/;\n\tvar isSymbolObject = function isRealSymbolObject(value) {\n\t\tif (typeof value.valueOf() !== 'symbol') {\n\t\t\treturn false;\n\t\t}\n\t\treturn symStringRegex.test(symToStr.call(value));\n\t};\n\n\tmodule.exports = function isSymbol(value) {\n\t\tif (typeof value === 'symbol') {\n\t\t\treturn true;\n\t\t}\n\t\tif (toStr.call(value) !== '[object Symbol]') {\n\t\t\treturn false;\n\t\t}\n\t\ttry {\n\t\t\treturn isSymbolObject(value);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n} else {\n\n\tmodule.exports = function isSymbol(value) {\n\t\t// this environment does not support Symbols.\n\t\treturn false && value;\n\t};\n}\n","var hasMap = typeof Map === 'function' && Map.prototype;\nvar mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;\nvar mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;\nvar mapForEach = hasMap && Map.prototype.forEach;\nvar hasSet = typeof Set === 'function' && Set.prototype;\nvar setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;\nvar setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;\nvar setForEach = hasSet && Set.prototype.forEach;\nvar hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;\nvar weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;\nvar hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;\nvar weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;\nvar hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;\nvar weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;\nvar booleanValueOf = Boolean.prototype.valueOf;\nvar objectToString = Object.prototype.toString;\nvar functionToString = Function.prototype.toString;\nvar $match = String.prototype.match;\nvar $slice = String.prototype.slice;\nvar $replace = String.prototype.replace;\nvar $toUpperCase = String.prototype.toUpperCase;\nvar $toLowerCase = String.prototype.toLowerCase;\nvar $test = RegExp.prototype.test;\nvar $concat = Array.prototype.concat;\nvar $join = Array.prototype.join;\nvar $arrSlice = Array.prototype.slice;\nvar $floor = Math.floor;\nvar bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;\nvar gOPS = Object.getOwnPropertySymbols;\nvar symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;\nvar hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';\n// ie, `has-tostringtag/shams\nvar toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')\n ? Symbol.toStringTag\n : null;\nvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\nvar gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (\n [].__proto__ === Array.prototype // eslint-disable-line no-proto\n ? function (O) {\n return O.__proto__; // eslint-disable-line no-proto\n }\n : null\n);\n\nfunction addNumericSeparator(num, str) {\n if (\n num === Infinity\n || num === -Infinity\n || num !== num\n || (num && num > -1000 && num < 1000)\n || $test.call(/e/, str)\n ) {\n return str;\n }\n var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;\n if (typeof num === 'number') {\n var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)\n if (int !== num) {\n var intStr = String(int);\n var dec = $slice.call(str, intStr.length + 1);\n return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');\n }\n }\n return $replace.call(str, sepRegex, '$&_');\n}\n\nvar utilInspect = require('./util.inspect');\nvar inspectCustom = utilInspect.custom;\nvar inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;\n\nmodule.exports = function inspect_(obj, options, depth, seen) {\n var opts = options || {};\n\n if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {\n throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');\n }\n if (\n has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'\n ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity\n : opts.maxStringLength !== null\n )\n ) {\n throw new TypeError('option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`');\n }\n var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;\n if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {\n throw new TypeError('option \"customInspect\", if provided, must be `true`, `false`, or `\\'symbol\\'`');\n }\n\n if (\n has(opts, 'indent')\n && opts.indent !== null\n && opts.indent !== '\\t'\n && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)\n ) {\n throw new TypeError('option \"indent\" must be \"\\\\t\", an integer > 0, or `null`');\n }\n if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {\n throw new TypeError('option \"numericSeparator\", if provided, must be `true` or `false`');\n }\n var numericSeparator = opts.numericSeparator;\n\n if (typeof obj === 'undefined') {\n return 'undefined';\n }\n if (obj === null) {\n return 'null';\n }\n if (typeof obj === 'boolean') {\n return obj ? 'true' : 'false';\n }\n\n if (typeof obj === 'string') {\n return inspectString(obj, opts);\n }\n if (typeof obj === 'number') {\n if (obj === 0) {\n return Infinity / obj > 0 ? '0' : '-0';\n }\n var str = String(obj);\n return numericSeparator ? addNumericSeparator(obj, str) : str;\n }\n if (typeof obj === 'bigint') {\n var bigIntStr = String(obj) + 'n';\n return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;\n }\n\n var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;\n if (typeof depth === 'undefined') { depth = 0; }\n if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {\n return isArray(obj) ? '[Array]' : '[Object]';\n }\n\n var indent = getIndent(opts, depth);\n\n if (typeof seen === 'undefined') {\n seen = [];\n } else if (indexOf(seen, obj) >= 0) {\n return '[Circular]';\n }\n\n function inspect(value, from, noIndent) {\n if (from) {\n seen = $arrSlice.call(seen);\n seen.push(from);\n }\n if (noIndent) {\n var newOpts = {\n depth: opts.depth\n };\n if (has(opts, 'quoteStyle')) {\n newOpts.quoteStyle = opts.quoteStyle;\n }\n return inspect_(value, newOpts, depth + 1, seen);\n }\n return inspect_(value, opts, depth + 1, seen);\n }\n\n if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable\n var name = nameOf(obj);\n var keys = arrObjKeys(obj, inspect);\n return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');\n }\n if (isSymbol(obj)) {\n var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\\(.*\\))_[^)]*$/, '$1') : symToString.call(obj);\n return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;\n }\n if (isElement(obj)) {\n var s = '<' + $toLowerCase.call(String(obj.nodeName));\n var attrs = obj.attributes || [];\n for (var i = 0; i < attrs.length; i++) {\n s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);\n }\n s += '>';\n if (obj.childNodes && obj.childNodes.length) { s += '...'; }\n s += '';\n return s;\n }\n if (isArray(obj)) {\n if (obj.length === 0) { return '[]'; }\n var xs = arrObjKeys(obj, inspect);\n if (indent && !singleLineValues(xs)) {\n return '[' + indentedJoin(xs, indent) + ']';\n }\n return '[ ' + $join.call(xs, ', ') + ' ]';\n }\n if (isError(obj)) {\n var parts = arrObjKeys(obj, inspect);\n if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {\n return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';\n }\n if (parts.length === 0) { return '[' + String(obj) + ']'; }\n return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';\n }\n if (typeof obj === 'object' && customInspect) {\n if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {\n return utilInspect(obj, { depth: maxDepth - depth });\n } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {\n return obj.inspect();\n }\n }\n if (isMap(obj)) {\n var mapParts = [];\n if (mapForEach) {\n mapForEach.call(obj, function (value, key) {\n mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));\n });\n }\n return collectionOf('Map', mapSize.call(obj), mapParts, indent);\n }\n if (isSet(obj)) {\n var setParts = [];\n if (setForEach) {\n setForEach.call(obj, function (value) {\n setParts.push(inspect(value, obj));\n });\n }\n return collectionOf('Set', setSize.call(obj), setParts, indent);\n }\n if (isWeakMap(obj)) {\n return weakCollectionOf('WeakMap');\n }\n if (isWeakSet(obj)) {\n return weakCollectionOf('WeakSet');\n }\n if (isWeakRef(obj)) {\n return weakCollectionOf('WeakRef');\n }\n if (isNumber(obj)) {\n return markBoxed(inspect(Number(obj)));\n }\n if (isBigInt(obj)) {\n return markBoxed(inspect(bigIntValueOf.call(obj)));\n }\n if (isBoolean(obj)) {\n return markBoxed(booleanValueOf.call(obj));\n }\n if (isString(obj)) {\n return markBoxed(inspect(String(obj)));\n }\n if (!isDate(obj) && !isRegExp(obj)) {\n var ys = arrObjKeys(obj, inspect);\n var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;\n var protoTag = obj instanceof Object ? '' : 'null prototype';\n var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';\n var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';\n var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');\n if (ys.length === 0) { return tag + '{}'; }\n if (indent) {\n return tag + '{' + indentedJoin(ys, indent) + '}';\n }\n return tag + '{ ' + $join.call(ys, ', ') + ' }';\n }\n return String(obj);\n};\n\nfunction wrapQuotes(s, defaultStyle, opts) {\n var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '\"' : \"'\";\n return quoteChar + s + quoteChar;\n}\n\nfunction quote(s) {\n return $replace.call(String(s), /\"/g, '"');\n}\n\nfunction isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\n\n// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives\nfunction isSymbol(obj) {\n if (hasShammedSymbols) {\n return obj && typeof obj === 'object' && obj instanceof Symbol;\n }\n if (typeof obj === 'symbol') {\n return true;\n }\n if (!obj || typeof obj !== 'object' || !symToString) {\n return false;\n }\n try {\n symToString.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isBigInt(obj) {\n if (!obj || typeof obj !== 'object' || !bigIntValueOf) {\n return false;\n }\n try {\n bigIntValueOf.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };\nfunction has(obj, key) {\n return hasOwn.call(obj, key);\n}\n\nfunction toStr(obj) {\n return objectToString.call(obj);\n}\n\nfunction nameOf(f) {\n if (f.name) { return f.name; }\n var m = $match.call(functionToString.call(f), /^function\\s*([\\w$]+)/);\n if (m) { return m[1]; }\n return null;\n}\n\nfunction indexOf(xs, x) {\n if (xs.indexOf) { return xs.indexOf(x); }\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) { return i; }\n }\n return -1;\n}\n\nfunction isMap(x) {\n if (!mapSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n mapSize.call(x);\n try {\n setSize.call(x);\n } catch (s) {\n return true;\n }\n return x instanceof Map; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakMap(x) {\n if (!weakMapHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakMapHas.call(x, weakMapHas);\n try {\n weakSetHas.call(x, weakSetHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakMap; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakRef(x) {\n if (!weakRefDeref || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakRefDeref.call(x);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isSet(x) {\n if (!setSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n setSize.call(x);\n try {\n mapSize.call(x);\n } catch (m) {\n return true;\n }\n return x instanceof Set; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakSet(x) {\n if (!weakSetHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakSetHas.call(x, weakSetHas);\n try {\n weakMapHas.call(x, weakMapHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakSet; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isElement(x) {\n if (!x || typeof x !== 'object') { return false; }\n if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {\n return true;\n }\n return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';\n}\n\nfunction inspectString(str, opts) {\n if (str.length > opts.maxStringLength) {\n var remaining = str.length - opts.maxStringLength;\n var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');\n return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;\n }\n // eslint-disable-next-line no-control-regex\n var s = $replace.call($replace.call(str, /(['\\\\])/g, '\\\\$1'), /[\\x00-\\x1f]/g, lowbyte);\n return wrapQuotes(s, 'single', opts);\n}\n\nfunction lowbyte(c) {\n var n = c.charCodeAt(0);\n var x = {\n 8: 'b',\n 9: 't',\n 10: 'n',\n 12: 'f',\n 13: 'r'\n }[n];\n if (x) { return '\\\\' + x; }\n return '\\\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));\n}\n\nfunction markBoxed(str) {\n return 'Object(' + str + ')';\n}\n\nfunction weakCollectionOf(type) {\n return type + ' { ? }';\n}\n\nfunction collectionOf(type, size, entries, indent) {\n var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');\n return type + ' (' + size + ') {' + joinedEntries + '}';\n}\n\nfunction singleLineValues(xs) {\n for (var i = 0; i < xs.length; i++) {\n if (indexOf(xs[i], '\\n') >= 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction getIndent(opts, depth) {\n var baseIndent;\n if (opts.indent === '\\t') {\n baseIndent = '\\t';\n } else if (typeof opts.indent === 'number' && opts.indent > 0) {\n baseIndent = $join.call(Array(opts.indent + 1), ' ');\n } else {\n return null;\n }\n return {\n base: baseIndent,\n prev: $join.call(Array(depth + 1), baseIndent)\n };\n}\n\nfunction indentedJoin(xs, indent) {\n if (xs.length === 0) { return ''; }\n var lineJoiner = '\\n' + indent.prev + indent.base;\n return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\\n' + indent.prev;\n}\n\nfunction arrObjKeys(obj, inspect) {\n var isArr = isArray(obj);\n var xs = [];\n if (isArr) {\n xs.length = obj.length;\n for (var i = 0; i < obj.length; i++) {\n xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';\n }\n }\n var syms = typeof gOPS === 'function' ? gOPS(obj) : [];\n var symMap;\n if (hasShammedSymbols) {\n symMap = {};\n for (var k = 0; k < syms.length; k++) {\n symMap['$' + syms[k]] = syms[k];\n }\n }\n\n for (var key in obj) { // eslint-disable-line no-restricted-syntax\n if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {\n // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section\n continue; // eslint-disable-line no-restricted-syntax, no-continue\n } else if ($test.call(/[^\\w$]/, key)) {\n xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));\n } else {\n xs.push(key + ': ' + inspect(obj[key], obj));\n }\n }\n if (typeof gOPS === 'function') {\n for (var j = 0; j < syms.length; j++) {\n if (isEnumerable.call(obj, syms[j])) {\n xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));\n }\n }\n }\n return xs;\n}\n","'use strict';\n\nvar keysShim;\nif (!Object.keys) {\n\t// modified from https://github.com/es-shims/es5-shim\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar toStr = Object.prototype.toString;\n\tvar isArgs = require('./isArguments'); // eslint-disable-line global-require\n\tvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\tvar hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');\n\tvar hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');\n\tvar dontEnums = [\n\t\t'toString',\n\t\t'toLocaleString',\n\t\t'valueOf',\n\t\t'hasOwnProperty',\n\t\t'isPrototypeOf',\n\t\t'propertyIsEnumerable',\n\t\t'constructor'\n\t];\n\tvar equalsConstructorPrototype = function (o) {\n\t\tvar ctor = o.constructor;\n\t\treturn ctor && ctor.prototype === o;\n\t};\n\tvar excludedKeys = {\n\t\t$applicationCache: true,\n\t\t$console: true,\n\t\t$external: true,\n\t\t$frame: true,\n\t\t$frameElement: true,\n\t\t$frames: true,\n\t\t$innerHeight: true,\n\t\t$innerWidth: true,\n\t\t$onmozfullscreenchange: true,\n\t\t$onmozfullscreenerror: true,\n\t\t$outerHeight: true,\n\t\t$outerWidth: true,\n\t\t$pageXOffset: true,\n\t\t$pageYOffset: true,\n\t\t$parent: true,\n\t\t$scrollLeft: true,\n\t\t$scrollTop: true,\n\t\t$scrollX: true,\n\t\t$scrollY: true,\n\t\t$self: true,\n\t\t$webkitIndexedDB: true,\n\t\t$webkitStorageInfo: true,\n\t\t$window: true\n\t};\n\tvar hasAutomationEqualityBug = (function () {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined') { return false; }\n\t\tfor (var k in window) {\n\t\t\ttry {\n\t\t\t\tif (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tequalsConstructorPrototype(window[k]);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}());\n\tvar equalsConstructorPrototypeIfNotBuggy = function (o) {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined' || !hasAutomationEqualityBug) {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t}\n\t\ttry {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tkeysShim = function keys(object) {\n\t\tvar isObject = object !== null && typeof object === 'object';\n\t\tvar isFunction = toStr.call(object) === '[object Function]';\n\t\tvar isArguments = isArgs(object);\n\t\tvar isString = isObject && toStr.call(object) === '[object String]';\n\t\tvar theKeys = [];\n\n\t\tif (!isObject && !isFunction && !isArguments) {\n\t\t\tthrow new TypeError('Object.keys called on a non-object');\n\t\t}\n\n\t\tvar skipProto = hasProtoEnumBug && isFunction;\n\t\tif (isString && object.length > 0 && !has.call(object, 0)) {\n\t\t\tfor (var i = 0; i < object.length; ++i) {\n\t\t\t\ttheKeys.push(String(i));\n\t\t\t}\n\t\t}\n\n\t\tif (isArguments && object.length > 0) {\n\t\t\tfor (var j = 0; j < object.length; ++j) {\n\t\t\t\ttheKeys.push(String(j));\n\t\t\t}\n\t\t} else {\n\t\t\tfor (var name in object) {\n\t\t\t\tif (!(skipProto && name === 'prototype') && has.call(object, name)) {\n\t\t\t\t\ttheKeys.push(String(name));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (hasDontEnumBug) {\n\t\t\tvar skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);\n\n\t\t\tfor (var k = 0; k < dontEnums.length; ++k) {\n\t\t\t\tif (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {\n\t\t\t\t\ttheKeys.push(dontEnums[k]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn theKeys;\n\t};\n}\nmodule.exports = keysShim;\n","'use strict';\n\nvar slice = Array.prototype.slice;\nvar isArgs = require('./isArguments');\n\nvar origKeys = Object.keys;\nvar keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');\n\nvar originalKeys = Object.keys;\n\nkeysShim.shim = function shimObjectKeys() {\n\tif (Object.keys) {\n\t\tvar keysWorksWithArguments = (function () {\n\t\t\t// Safari 5.0 bug\n\t\t\tvar args = Object.keys(arguments);\n\t\t\treturn args && args.length === arguments.length;\n\t\t}(1, 2));\n\t\tif (!keysWorksWithArguments) {\n\t\t\tObject.keys = function keys(object) { // eslint-disable-line func-name-matching\n\t\t\t\tif (isArgs(object)) {\n\t\t\t\t\treturn originalKeys(slice.call(object));\n\t\t\t\t}\n\t\t\t\treturn originalKeys(object);\n\t\t\t};\n\t\t}\n\t} else {\n\t\tObject.keys = keysShim;\n\t}\n\treturn Object.keys || keysShim;\n};\n\nmodule.exports = keysShim;\n","'use strict';\n\nvar toStr = Object.prototype.toString;\n\nmodule.exports = function isArguments(value) {\n\tvar str = toStr.call(value);\n\tvar isArgs = str === '[object Arguments]';\n\tif (!isArgs) {\n\t\tisArgs = str !== '[object Array]' &&\n\t\t\tvalue !== null &&\n\t\t\ttypeof value === 'object' &&\n\t\t\ttypeof value.length === 'number' &&\n\t\t\tvalue.length >= 0 &&\n\t\t\ttoStr.call(value.callee) === '[object Function]';\n\t}\n\treturn isArgs;\n};\n","'use strict';\n\nvar setFunctionName = require('set-function-name');\n\nvar $Object = Object;\nvar $TypeError = TypeError;\n\nmodule.exports = setFunctionName(function flags() {\n\tif (this != null && this !== $Object(this)) {\n\t\tthrow new $TypeError('RegExp.prototype.flags getter called on non-object');\n\t}\n\tvar result = '';\n\tif (this.hasIndices) {\n\t\tresult += 'd';\n\t}\n\tif (this.global) {\n\t\tresult += 'g';\n\t}\n\tif (this.ignoreCase) {\n\t\tresult += 'i';\n\t}\n\tif (this.multiline) {\n\t\tresult += 'm';\n\t}\n\tif (this.dotAll) {\n\t\tresult += 's';\n\t}\n\tif (this.unicode) {\n\t\tresult += 'u';\n\t}\n\tif (this.unicodeSets) {\n\t\tresult += 'v';\n\t}\n\tif (this.sticky) {\n\t\tresult += 'y';\n\t}\n\treturn result;\n}, 'get flags', true);\n\n","'use strict';\n\nvar define = require('define-properties');\nvar callBind = require('call-bind');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar flagsBound = callBind(getPolyfill());\n\ndefine(flagsBound, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = flagsBound;\n","'use strict';\n\nvar implementation = require('./implementation');\n\nvar supportsDescriptors = require('define-properties').supportsDescriptors;\nvar $gOPD = Object.getOwnPropertyDescriptor;\n\nmodule.exports = function getPolyfill() {\n\tif (supportsDescriptors && (/a/mig).flags === 'gim') {\n\t\tvar descriptor = $gOPD(RegExp.prototype, 'flags');\n\t\tif (\n\t\t\tdescriptor\n\t\t\t&& typeof descriptor.get === 'function'\n\t\t\t&& typeof RegExp.prototype.dotAll === 'boolean'\n\t\t\t&& typeof RegExp.prototype.hasIndices === 'boolean'\n\t\t) {\n\t\t\t/* eslint getter-return: 0 */\n\t\t\tvar calls = '';\n\t\t\tvar o = {};\n\t\t\tObject.defineProperty(o, 'hasIndices', {\n\t\t\t\tget: function () {\n\t\t\t\t\tcalls += 'd';\n\t\t\t\t}\n\t\t\t});\n\t\t\tObject.defineProperty(o, 'sticky', {\n\t\t\t\tget: function () {\n\t\t\t\t\tcalls += 'y';\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (calls === 'dy') {\n\t\t\t\treturn descriptor.get;\n\t\t\t}\n\t\t}\n\t}\n\treturn implementation;\n};\n","'use strict';\n\nvar supportsDescriptors = require('define-properties').supportsDescriptors;\nvar getPolyfill = require('./polyfill');\nvar gOPD = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar TypeErr = TypeError;\nvar getProto = Object.getPrototypeOf;\nvar regex = /a/;\n\nmodule.exports = function shimFlags() {\n\tif (!supportsDescriptors || !getProto) {\n\t\tthrow new TypeErr('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');\n\t}\n\tvar polyfill = getPolyfill();\n\tvar proto = getProto(regex);\n\tvar descriptor = gOPD(proto, 'flags');\n\tif (!descriptor || descriptor.get !== polyfill) {\n\t\tdefineProperty(proto, 'flags', {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tget: polyfill\n\t\t});\n\t}\n\treturn polyfill;\n};\n","'use strict';\n\nvar callBound = require('call-bind/callBound');\nvar GetIntrinsic = require('get-intrinsic');\nvar isRegex = require('is-regex');\n\nvar $exec = callBound('RegExp.prototype.exec');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nmodule.exports = function regexTester(regex) {\n\tif (!isRegex(regex)) {\n\t\tthrow new $TypeError('`regex` must be a RegExp');\n\t}\n\treturn function test(s) {\n\t\treturn $exec(regex, s) !== null;\n\t};\n};\n","'use strict';\n\nvar define = require('define-data-property');\nvar hasDescriptors = require('has-property-descriptors')();\nvar functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames();\n\nvar $TypeError = TypeError;\n\nmodule.exports = function setFunctionName(fn, name) {\n\tif (typeof fn !== 'function') {\n\t\tthrow new $TypeError('`fn` is not a function');\n\t}\n\tvar loose = arguments.length > 2 && !!arguments[2];\n\tif (!loose || functionsHaveConfigurableNames) {\n\t\tif (hasDescriptors) {\n\t\t\tdefine(fn, 'name', name, true, true);\n\t\t} else {\n\t\t\tdefine(fn, 'name', name);\n\t\t}\n\t}\n\treturn fn;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bind/callBound');\nvar inspect = require('object-inspect');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $WeakMap = GetIntrinsic('%WeakMap%', true);\nvar $Map = GetIntrinsic('%Map%', true);\n\nvar $weakMapGet = callBound('WeakMap.prototype.get', true);\nvar $weakMapSet = callBound('WeakMap.prototype.set', true);\nvar $weakMapHas = callBound('WeakMap.prototype.has', true);\nvar $mapGet = callBound('Map.prototype.get', true);\nvar $mapSet = callBound('Map.prototype.set', true);\nvar $mapHas = callBound('Map.prototype.has', true);\n\n/*\n * This function traverses the list returning the node corresponding to the\n * given key.\n *\n * That node is also moved to the head of the list, so that if it's accessed\n * again we don't need to traverse the whole list. By doing so, all the recently\n * used nodes can be accessed relatively quickly.\n */\nvar listGetNode = function (list, key) { // eslint-disable-line consistent-return\n\tfor (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {\n\t\tif (curr.key === key) {\n\t\t\tprev.next = curr.next;\n\t\t\tcurr.next = list.next;\n\t\t\tlist.next = curr; // eslint-disable-line no-param-reassign\n\t\t\treturn curr;\n\t\t}\n\t}\n};\n\nvar listGet = function (objects, key) {\n\tvar node = listGetNode(objects, key);\n\treturn node && node.value;\n};\nvar listSet = function (objects, key, value) {\n\tvar node = listGetNode(objects, key);\n\tif (node) {\n\t\tnode.value = value;\n\t} else {\n\t\t// Prepend the new node to the beginning of the list\n\t\tobjects.next = { // eslint-disable-line no-param-reassign\n\t\t\tkey: key,\n\t\t\tnext: objects.next,\n\t\t\tvalue: value\n\t\t};\n\t}\n};\nvar listHas = function (objects, key) {\n\treturn !!listGetNode(objects, key);\n};\n\nmodule.exports = function getSideChannel() {\n\tvar $wm;\n\tvar $m;\n\tvar $o;\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\tget: function (key) { // eslint-disable-line consistent-return\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapGet($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapGet($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listGet($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\thas: function (key) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapHas($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapHas($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listHas($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif (!$wm) {\n\t\t\t\t\t$wm = new $WeakMap();\n\t\t\t\t}\n\t\t\t\t$weakMapSet($wm, key, value);\n\t\t\t} else if ($Map) {\n\t\t\t\tif (!$m) {\n\t\t\t\t\t$m = new $Map();\n\t\t\t\t}\n\t\t\t\t$mapSet($m, key, value);\n\t\t\t} else {\n\t\t\t\tif (!$o) {\n\t\t\t\t\t/*\n\t\t\t\t\t * Initialize the linked list as an empty node, so that we don't have\n\t\t\t\t\t * to special-case handling of the first node: we can always refer to\n\t\t\t\t\t * it as (previous node).next, instead of something like (list).head\n\t\t\t\t\t */\n\t\t\t\t\t$o = { key: {}, next: null };\n\t\t\t\t}\n\t\t\t\tlistSet($o, key, value);\n\t\t\t}\n\t\t}\n\t};\n\treturn channel;\n};\n","'use strict';\n\nvar Call = require('es-abstract/2023/Call');\nvar Get = require('es-abstract/2023/Get');\nvar GetMethod = require('es-abstract/2023/GetMethod');\nvar IsRegExp = require('es-abstract/2023/IsRegExp');\nvar ToString = require('es-abstract/2023/ToString');\nvar RequireObjectCoercible = require('es-abstract/2023/RequireObjectCoercible');\nvar callBound = require('call-bind/callBound');\nvar hasSymbols = require('has-symbols')();\nvar flagsGetter = require('regexp.prototype.flags');\n\nvar $indexOf = callBound('String.prototype.indexOf');\n\nvar regexpMatchAllPolyfill = require('./polyfill-regexp-matchall');\n\nvar getMatcher = function getMatcher(regexp) { // eslint-disable-line consistent-return\n\tvar matcherPolyfill = regexpMatchAllPolyfill();\n\tif (hasSymbols && typeof Symbol.matchAll === 'symbol') {\n\t\tvar matcher = GetMethod(regexp, Symbol.matchAll);\n\t\tif (matcher === RegExp.prototype[Symbol.matchAll] && matcher !== matcherPolyfill) {\n\t\t\treturn matcherPolyfill;\n\t\t}\n\t\treturn matcher;\n\t}\n\t// fallback for pre-Symbol.matchAll environments\n\tif (IsRegExp(regexp)) {\n\t\treturn matcherPolyfill;\n\t}\n};\n\nmodule.exports = function matchAll(regexp) {\n\tvar O = RequireObjectCoercible(this);\n\n\tif (typeof regexp !== 'undefined' && regexp !== null) {\n\t\tvar isRegExp = IsRegExp(regexp);\n\t\tif (isRegExp) {\n\t\t\t// workaround for older engines that lack RegExp.prototype.flags\n\t\t\tvar flags = 'flags' in regexp ? Get(regexp, 'flags') : flagsGetter(regexp);\n\t\t\tRequireObjectCoercible(flags);\n\t\t\tif ($indexOf(ToString(flags), 'g') < 0) {\n\t\t\t\tthrow new TypeError('matchAll requires a global regular expression');\n\t\t\t}\n\t\t}\n\n\t\tvar matcher = getMatcher(regexp);\n\t\tif (typeof matcher !== 'undefined') {\n\t\t\treturn Call(matcher, regexp, [O]);\n\t\t}\n\t}\n\n\tvar S = ToString(O);\n\t// var rx = RegExpCreate(regexp, 'g');\n\tvar rx = new RegExp(regexp, 'g');\n\treturn Call(getMatcher(rx), rx, [S]);\n};\n","'use strict';\n\nvar callBind = require('call-bind');\nvar define = require('define-properties');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar boundMatchAll = callBind(implementation);\n\ndefine(boundMatchAll, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = boundMatchAll;\n","'use strict';\n\nvar hasSymbols = require('has-symbols')();\nvar regexpMatchAll = require('./regexp-matchall');\n\nmodule.exports = function getRegExpMatchAllPolyfill() {\n\tif (!hasSymbols || typeof Symbol.matchAll !== 'symbol' || typeof RegExp.prototype[Symbol.matchAll] !== 'function') {\n\t\treturn regexpMatchAll;\n\t}\n\treturn RegExp.prototype[Symbol.matchAll];\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = function getPolyfill() {\n\tif (String.prototype.matchAll) {\n\t\ttry {\n\t\t\t''.matchAll(RegExp.prototype);\n\t\t} catch (e) {\n\t\t\treturn String.prototype.matchAll;\n\t\t}\n\t}\n\treturn implementation;\n};\n","'use strict';\n\n// var Construct = require('es-abstract/2023/Construct');\nvar CreateRegExpStringIterator = require('es-abstract/2023/CreateRegExpStringIterator');\nvar Get = require('es-abstract/2023/Get');\nvar Set = require('es-abstract/2023/Set');\nvar SpeciesConstructor = require('es-abstract/2023/SpeciesConstructor');\nvar ToLength = require('es-abstract/2023/ToLength');\nvar ToString = require('es-abstract/2023/ToString');\nvar Type = require('es-abstract/2023/Type');\nvar flagsGetter = require('regexp.prototype.flags');\nvar setFunctionName = require('set-function-name');\nvar callBound = require('call-bind/callBound');\n\nvar $indexOf = callBound('String.prototype.indexOf');\n\nvar OrigRegExp = RegExp;\n\nvar supportsConstructingWithFlags = 'flags' in RegExp.prototype;\n\nvar constructRegexWithFlags = function constructRegex(C, R) {\n\tvar matcher;\n\t// workaround for older engines that lack RegExp.prototype.flags\n\tvar flags = 'flags' in R ? Get(R, 'flags') : ToString(flagsGetter(R));\n\tif (supportsConstructingWithFlags && typeof flags === 'string') {\n\t\tmatcher = new C(R, flags);\n\t} else if (C === OrigRegExp) {\n\t\t// workaround for older engines that can not construct a RegExp with flags\n\t\tmatcher = new C(R.source, flags);\n\t} else {\n\t\tmatcher = new C(R, flags);\n\t}\n\treturn { flags: flags, matcher: matcher };\n};\n\nvar regexMatchAll = setFunctionName(function SymbolMatchAll(string) {\n\tvar R = this;\n\tif (Type(R) !== 'Object') {\n\t\tthrow new TypeError('\"this\" value must be an Object');\n\t}\n\tvar S = ToString(string);\n\tvar C = SpeciesConstructor(R, OrigRegExp);\n\n\tvar tmp = constructRegexWithFlags(C, R);\n\t// var flags = ToString(Get(R, 'flags'));\n\tvar flags = tmp.flags;\n\t// var matcher = Construct(C, [R, flags]);\n\tvar matcher = tmp.matcher;\n\n\tvar lastIndex = ToLength(Get(R, 'lastIndex'));\n\tSet(matcher, 'lastIndex', lastIndex, true);\n\tvar global = $indexOf(flags, 'g') > -1;\n\tvar fullUnicode = $indexOf(flags, 'u') > -1;\n\treturn CreateRegExpStringIterator(matcher, S, global, fullUnicode);\n}, '[Symbol.matchAll]', true);\n\nmodule.exports = regexMatchAll;\n","'use strict';\n\nvar define = require('define-properties');\nvar hasSymbols = require('has-symbols')();\nvar getPolyfill = require('./polyfill');\nvar regexpMatchAllPolyfill = require('./polyfill-regexp-matchall');\n\nvar defineP = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nmodule.exports = function shimMatchAll() {\n\tvar polyfill = getPolyfill();\n\tdefine(\n\t\tString.prototype,\n\t\t{ matchAll: polyfill },\n\t\t{ matchAll: function () { return String.prototype.matchAll !== polyfill; } }\n\t);\n\tif (hasSymbols) {\n\t\t// eslint-disable-next-line no-restricted-properties\n\t\tvar symbol = Symbol.matchAll || (Symbol['for'] ? Symbol['for']('Symbol.matchAll') : Symbol('Symbol.matchAll'));\n\t\tdefine(\n\t\t\tSymbol,\n\t\t\t{ matchAll: symbol },\n\t\t\t{ matchAll: function () { return Symbol.matchAll !== symbol; } }\n\t\t);\n\n\t\tif (defineP && gOPD) {\n\t\t\tvar desc = gOPD(Symbol, symbol);\n\t\t\tif (!desc || desc.configurable) {\n\t\t\t\tdefineP(Symbol, symbol, {\n\t\t\t\t\tconfigurable: false,\n\t\t\t\t\tenumerable: false,\n\t\t\t\t\tvalue: symbol,\n\t\t\t\t\twritable: false\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tvar regexpMatchAll = regexpMatchAllPolyfill();\n\t\tvar func = {};\n\t\tfunc[symbol] = regexpMatchAll;\n\t\tvar predicate = {};\n\t\tpredicate[symbol] = function () {\n\t\t\treturn RegExp.prototype[symbol] !== regexpMatchAll;\n\t\t};\n\t\tdefine(RegExp.prototype, func, predicate);\n\t}\n\treturn polyfill;\n};\n","'use strict';\n\nvar RequireObjectCoercible = require('es-abstract/2023/RequireObjectCoercible');\nvar ToString = require('es-abstract/2023/ToString');\nvar callBound = require('call-bind/callBound');\nvar $replace = callBound('String.prototype.replace');\n\nvar mvsIsWS = (/^\\s$/).test('\\u180E');\n/* eslint-disable no-control-regex */\nvar leftWhitespace = mvsIsWS\n\t? /^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+/\n\t: /^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+/;\nvar rightWhitespace = mvsIsWS\n\t? /[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+$/\n\t: /[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+$/;\n/* eslint-enable no-control-regex */\n\nmodule.exports = function trim() {\n\tvar S = ToString(RequireObjectCoercible(this));\n\treturn $replace($replace(S, leftWhitespace, ''), rightWhitespace, '');\n};\n","'use strict';\n\nvar callBind = require('call-bind');\nvar define = require('define-properties');\nvar RequireObjectCoercible = require('es-abstract/2023/RequireObjectCoercible');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar bound = callBind(getPolyfill());\nvar boundMethod = function trim(receiver) {\n\tRequireObjectCoercible(receiver);\n\treturn bound(receiver);\n};\n\ndefine(boundMethod, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = boundMethod;\n","'use strict';\n\nvar implementation = require('./implementation');\n\nvar zeroWidthSpace = '\\u200b';\nvar mongolianVowelSeparator = '\\u180E';\n\nmodule.exports = function getPolyfill() {\n\tif (\n\t\tString.prototype.trim\n\t\t&& zeroWidthSpace.trim() === zeroWidthSpace\n\t\t&& mongolianVowelSeparator.trim() === mongolianVowelSeparator\n\t\t&& ('_' + mongolianVowelSeparator).trim() === ('_' + mongolianVowelSeparator)\n\t\t&& (mongolianVowelSeparator + '_').trim() === (mongolianVowelSeparator + '_')\n\t) {\n\t\treturn String.prototype.trim;\n\t}\n\treturn implementation;\n};\n","'use strict';\n\nvar define = require('define-properties');\nvar getPolyfill = require('./polyfill');\n\nmodule.exports = function shimStringTrim() {\n\tvar polyfill = getPolyfill();\n\tdefine(String.prototype, { trim: polyfill }, {\n\t\ttrim: function testTrim() {\n\t\t\treturn String.prototype.trim !== polyfill;\n\t\t}\n\t});\n\treturn polyfill;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar CodePointAt = require('./CodePointAt');\nvar Type = require('./Type');\n\nvar isInteger = require('../helpers/isInteger');\nvar MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// https://262.ecma-international.org/12.0/#sec-advancestringindex\n\nmodule.exports = function AdvanceStringIndex(S, index, unicode) {\n\tif (Type(S) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `S` must be a String');\n\t}\n\tif (!isInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) {\n\t\tthrow new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53');\n\t}\n\tif (Type(unicode) !== 'Boolean') {\n\t\tthrow new $TypeError('Assertion failed: `unicode` must be a Boolean');\n\t}\n\tif (!unicode) {\n\t\treturn index + 1;\n\t}\n\tvar length = S.length;\n\tif ((index + 1) >= length) {\n\t\treturn index + 1;\n\t}\n\tvar cp = CodePointAt(S, index);\n\treturn index + cp['[[CodeUnitCount]]'];\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bind/callBound');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar IsArray = require('./IsArray');\n\nvar $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('Function.prototype.apply');\n\n// https://262.ecma-international.org/6.0/#sec-call\n\nmodule.exports = function Call(F, V) {\n\tvar argumentsList = arguments.length > 2 ? arguments[2] : [];\n\tif (!IsArray(argumentsList)) {\n\t\tthrow new $TypeError('Assertion failed: optional `argumentsList`, if provided, must be a List');\n\t}\n\treturn $apply(F, V, argumentsList);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar callBound = require('call-bind/callBound');\nvar isLeadingSurrogate = require('../helpers/isLeadingSurrogate');\nvar isTrailingSurrogate = require('../helpers/isTrailingSurrogate');\n\nvar Type = require('./Type');\nvar UTF16SurrogatePairToCodePoint = require('./UTF16SurrogatePairToCodePoint');\n\nvar $charAt = callBound('String.prototype.charAt');\nvar $charCodeAt = callBound('String.prototype.charCodeAt');\n\n// https://262.ecma-international.org/12.0/#sec-codepointat\n\nmodule.exports = function CodePointAt(string, position) {\n\tif (Type(string) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `string` must be a String');\n\t}\n\tvar size = string.length;\n\tif (position < 0 || position >= size) {\n\t\tthrow new $TypeError('Assertion failed: `position` must be >= 0, and < the length of `string`');\n\t}\n\tvar first = $charCodeAt(string, position);\n\tvar cp = $charAt(string, position);\n\tvar firstIsLeading = isLeadingSurrogate(first);\n\tvar firstIsTrailing = isTrailingSurrogate(first);\n\tif (!firstIsLeading && !firstIsTrailing) {\n\t\treturn {\n\t\t\t'[[CodePoint]]': cp,\n\t\t\t'[[CodeUnitCount]]': 1,\n\t\t\t'[[IsUnpairedSurrogate]]': false\n\t\t};\n\t}\n\tif (firstIsTrailing || (position + 1 === size)) {\n\t\treturn {\n\t\t\t'[[CodePoint]]': cp,\n\t\t\t'[[CodeUnitCount]]': 1,\n\t\t\t'[[IsUnpairedSurrogate]]': true\n\t\t};\n\t}\n\tvar second = $charCodeAt(string, position + 1);\n\tif (!isTrailingSurrogate(second)) {\n\t\treturn {\n\t\t\t'[[CodePoint]]': cp,\n\t\t\t'[[CodeUnitCount]]': 1,\n\t\t\t'[[IsUnpairedSurrogate]]': true\n\t\t};\n\t}\n\n\treturn {\n\t\t'[[CodePoint]]': UTF16SurrogatePairToCodePoint(first, second),\n\t\t'[[CodeUnitCount]]': 2,\n\t\t'[[IsUnpairedSurrogate]]': false\n\t};\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-createiterresultobject\n\nmodule.exports = function CreateIterResultObject(value, done) {\n\tif (Type(done) !== 'Boolean') {\n\t\tthrow new $TypeError('Assertion failed: Type(done) is not Boolean');\n\t}\n\treturn {\n\t\tvalue: value,\n\t\tdone: done\n\t};\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar DefineOwnProperty = require('../helpers/DefineOwnProperty');\n\nvar FromPropertyDescriptor = require('./FromPropertyDescriptor');\nvar IsDataDescriptor = require('./IsDataDescriptor');\nvar IsPropertyKey = require('./IsPropertyKey');\nvar SameValue = require('./SameValue');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-createmethodproperty\n\nmodule.exports = function CreateMethodProperty(O, P, V) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true');\n\t}\n\n\tvar newDesc = {\n\t\t'[[Configurable]]': true,\n\t\t'[[Enumerable]]': false,\n\t\t'[[Value]]': V,\n\t\t'[[Writable]]': true\n\t};\n\treturn DefineOwnProperty(\n\t\tIsDataDescriptor,\n\t\tSameValue,\n\t\tFromPropertyDescriptor,\n\t\tO,\n\t\tP,\n\t\tnewDesc\n\t);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar hasSymbols = require('has-symbols')();\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar IteratorPrototype = GetIntrinsic('%IteratorPrototype%', true);\n\nvar AdvanceStringIndex = require('./AdvanceStringIndex');\nvar CreateIterResultObject = require('./CreateIterResultObject');\nvar CreateMethodProperty = require('./CreateMethodProperty');\nvar Get = require('./Get');\nvar OrdinaryObjectCreate = require('./OrdinaryObjectCreate');\nvar RegExpExec = require('./RegExpExec');\nvar Set = require('./Set');\nvar ToLength = require('./ToLength');\nvar ToString = require('./ToString');\nvar Type = require('./Type');\n\nvar SLOT = require('internal-slot');\nvar setToStringTag = require('es-set-tostringtag');\n\nvar RegExpStringIterator = function RegExpStringIterator(R, S, global, fullUnicode) {\n\tif (Type(S) !== 'String') {\n\t\tthrow new $TypeError('`S` must be a string');\n\t}\n\tif (Type(global) !== 'Boolean') {\n\t\tthrow new $TypeError('`global` must be a boolean');\n\t}\n\tif (Type(fullUnicode) !== 'Boolean') {\n\t\tthrow new $TypeError('`fullUnicode` must be a boolean');\n\t}\n\tSLOT.set(this, '[[IteratingRegExp]]', R);\n\tSLOT.set(this, '[[IteratedString]]', S);\n\tSLOT.set(this, '[[Global]]', global);\n\tSLOT.set(this, '[[Unicode]]', fullUnicode);\n\tSLOT.set(this, '[[Done]]', false);\n};\n\nif (IteratorPrototype) {\n\tRegExpStringIterator.prototype = OrdinaryObjectCreate(IteratorPrototype);\n}\n\nvar RegExpStringIteratorNext = function next() {\n\tvar O = this; // eslint-disable-line no-invalid-this\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('receiver must be an object');\n\t}\n\tif (\n\t\t!(O instanceof RegExpStringIterator)\n\t\t|| !SLOT.has(O, '[[IteratingRegExp]]')\n\t\t|| !SLOT.has(O, '[[IteratedString]]')\n\t\t|| !SLOT.has(O, '[[Global]]')\n\t\t|| !SLOT.has(O, '[[Unicode]]')\n\t\t|| !SLOT.has(O, '[[Done]]')\n\t) {\n\t\tthrow new $TypeError('\"this\" value must be a RegExpStringIterator instance');\n\t}\n\tif (SLOT.get(O, '[[Done]]')) {\n\t\treturn CreateIterResultObject(undefined, true);\n\t}\n\tvar R = SLOT.get(O, '[[IteratingRegExp]]');\n\tvar S = SLOT.get(O, '[[IteratedString]]');\n\tvar global = SLOT.get(O, '[[Global]]');\n\tvar fullUnicode = SLOT.get(O, '[[Unicode]]');\n\tvar match = RegExpExec(R, S);\n\tif (match === null) {\n\t\tSLOT.set(O, '[[Done]]', true);\n\t\treturn CreateIterResultObject(undefined, true);\n\t}\n\tif (global) {\n\t\tvar matchStr = ToString(Get(match, '0'));\n\t\tif (matchStr === '') {\n\t\t\tvar thisIndex = ToLength(Get(R, 'lastIndex'));\n\t\t\tvar nextIndex = AdvanceStringIndex(S, thisIndex, fullUnicode);\n\t\t\tSet(R, 'lastIndex', nextIndex, true);\n\t\t}\n\t\treturn CreateIterResultObject(match, false);\n\t}\n\tSLOT.set(O, '[[Done]]', true);\n\treturn CreateIterResultObject(match, false);\n};\nCreateMethodProperty(RegExpStringIterator.prototype, 'next', RegExpStringIteratorNext);\n\nif (hasSymbols) {\n\tsetToStringTag(RegExpStringIterator.prototype, 'RegExp String Iterator');\n\n\tif (Symbol.iterator && typeof RegExpStringIterator.prototype[Symbol.iterator] !== 'function') {\n\t\tvar iteratorFn = function SymbolIterator() {\n\t\t\treturn this;\n\t\t};\n\t\tCreateMethodProperty(RegExpStringIterator.prototype, Symbol.iterator, iteratorFn);\n\t}\n}\n\n// https://262.ecma-international.org/11.0/#sec-createregexpstringiterator\nmodule.exports = function CreateRegExpStringIterator(R, S, global, fullUnicode) {\n\t// assert R.global === global && R.unicode === fullUnicode?\n\treturn new RegExpStringIterator(R, S, global, fullUnicode);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar isPropertyDescriptor = require('../helpers/isPropertyDescriptor');\nvar DefineOwnProperty = require('../helpers/DefineOwnProperty');\n\nvar FromPropertyDescriptor = require('./FromPropertyDescriptor');\nvar IsAccessorDescriptor = require('./IsAccessorDescriptor');\nvar IsDataDescriptor = require('./IsDataDescriptor');\nvar IsPropertyKey = require('./IsPropertyKey');\nvar SameValue = require('./SameValue');\nvar ToPropertyDescriptor = require('./ToPropertyDescriptor');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-definepropertyorthrow\n\nmodule.exports = function DefinePropertyOrThrow(O, P, desc) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true');\n\t}\n\n\tvar Desc = isPropertyDescriptor({\n\t\tType: Type,\n\t\tIsDataDescriptor: IsDataDescriptor,\n\t\tIsAccessorDescriptor: IsAccessorDescriptor\n\t}, desc) ? desc : ToPropertyDescriptor(desc);\n\tif (!isPropertyDescriptor({\n\t\tType: Type,\n\t\tIsDataDescriptor: IsDataDescriptor,\n\t\tIsAccessorDescriptor: IsAccessorDescriptor\n\t}, Desc)) {\n\t\tthrow new $TypeError('Assertion failed: Desc is not a valid Property Descriptor');\n\t}\n\n\treturn DefineOwnProperty(\n\t\tIsDataDescriptor,\n\t\tSameValue,\n\t\tFromPropertyDescriptor,\n\t\tO,\n\t\tP,\n\t\tDesc\n\t);\n};\n","'use strict';\n\nvar assertRecord = require('../helpers/assertRecord');\nvar fromPropertyDescriptor = require('../helpers/fromPropertyDescriptor');\n\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-frompropertydescriptor\n\nmodule.exports = function FromPropertyDescriptor(Desc) {\n\tif (typeof Desc !== 'undefined') {\n\t\tassertRecord(Type, 'Property Descriptor', 'Desc', Desc);\n\t}\n\n\treturn fromPropertyDescriptor(Desc);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar inspect = require('object-inspect');\n\nvar IsPropertyKey = require('./IsPropertyKey');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-get-o-p\n\nmodule.exports = function Get(O, P) {\n\t// 7.3.1.1\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\t// 7.3.1.2\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P));\n\t}\n\t// 7.3.1.3\n\treturn O[P];\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar GetV = require('./GetV');\nvar IsCallable = require('./IsCallable');\nvar IsPropertyKey = require('./IsPropertyKey');\n\nvar inspect = require('object-inspect');\n\n// https://262.ecma-international.org/6.0/#sec-getmethod\n\nmodule.exports = function GetMethod(O, P) {\n\t// 7.3.9.1\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true');\n\t}\n\n\t// 7.3.9.2\n\tvar func = GetV(O, P);\n\n\t// 7.3.9.4\n\tif (func == null) {\n\t\treturn void 0;\n\t}\n\n\t// 7.3.9.5\n\tif (!IsCallable(func)) {\n\t\tthrow new $TypeError(inspect(P) + ' is not a function: ' + inspect(func));\n\t}\n\n\t// 7.3.9.6\n\treturn func;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar inspect = require('object-inspect');\n\nvar IsPropertyKey = require('./IsPropertyKey');\n// var ToObject = require('./ToObject');\n\n// https://262.ecma-international.org/6.0/#sec-getv\n\nmodule.exports = function GetV(V, P) {\n\t// 7.3.2.1\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P));\n\t}\n\n\t// 7.3.2.2-3\n\t// var O = ToObject(V);\n\n\t// 7.3.2.4\n\treturn V[P];\n};\n","'use strict';\n\nvar has = require('has');\n\nvar Type = require('./Type');\n\nvar assertRecord = require('../helpers/assertRecord');\n\n// https://262.ecma-international.org/5.1/#sec-8.10.1\n\nmodule.exports = function IsAccessorDescriptor(Desc) {\n\tif (typeof Desc === 'undefined') {\n\t\treturn false;\n\t}\n\n\tassertRecord(Type, 'Property Descriptor', 'Desc', Desc);\n\n\tif (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n","'use strict';\n\n// https://262.ecma-international.org/6.0/#sec-isarray\nmodule.exports = require('../helpers/IsArray');\n","'use strict';\n\n// http://262.ecma-international.org/5.1/#sec-9.11\n\nmodule.exports = require('is-callable');\n","'use strict';\n\nvar GetIntrinsic = require('../GetIntrinsic.js');\n\nvar $construct = GetIntrinsic('%Reflect.construct%', true);\n\nvar DefinePropertyOrThrow = require('./DefinePropertyOrThrow');\ntry {\n\tDefinePropertyOrThrow({}, '', { '[[Get]]': function () {} });\n} catch (e) {\n\t// Accessor properties aren't supported\n\tDefinePropertyOrThrow = null;\n}\n\n// https://262.ecma-international.org/6.0/#sec-isconstructor\n\nif (DefinePropertyOrThrow && $construct) {\n\tvar isConstructorMarker = {};\n\tvar badArrayLike = {};\n\tDefinePropertyOrThrow(badArrayLike, 'length', {\n\t\t'[[Get]]': function () {\n\t\t\tthrow isConstructorMarker;\n\t\t},\n\t\t'[[Enumerable]]': true\n\t});\n\n\tmodule.exports = function IsConstructor(argument) {\n\t\ttry {\n\t\t\t// `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`:\n\t\t\t$construct(argument, badArrayLike);\n\t\t} catch (err) {\n\t\t\treturn err === isConstructorMarker;\n\t\t}\n\t};\n} else {\n\tmodule.exports = function IsConstructor(argument) {\n\t\t// unfortunately there's no way to truly check this without try/catch `new argument` in old environments\n\t\treturn typeof argument === 'function' && !!argument.prototype;\n\t};\n}\n","'use strict';\n\nvar has = require('has');\n\nvar Type = require('./Type');\n\nvar assertRecord = require('../helpers/assertRecord');\n\n// https://262.ecma-international.org/5.1/#sec-8.10.2\n\nmodule.exports = function IsDataDescriptor(Desc) {\n\tif (typeof Desc === 'undefined') {\n\t\treturn false;\n\t}\n\n\tassertRecord(Type, 'Property Descriptor', 'Desc', Desc);\n\n\tif (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n","'use strict';\n\n// https://262.ecma-international.org/6.0/#sec-ispropertykey\n\nmodule.exports = function IsPropertyKey(argument) {\n\treturn typeof argument === 'string' || typeof argument === 'symbol';\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $match = GetIntrinsic('%Symbol.match%', true);\n\nvar hasRegExpMatcher = require('is-regex');\n\nvar ToBoolean = require('./ToBoolean');\n\n// https://262.ecma-international.org/6.0/#sec-isregexp\n\nmodule.exports = function IsRegExp(argument) {\n\tif (!argument || typeof argument !== 'object') {\n\t\treturn false;\n\t}\n\tif ($match) {\n\t\tvar isRegExp = argument[$match];\n\t\tif (typeof isRegExp !== 'undefined') {\n\t\t\treturn ToBoolean(isRegExp);\n\t\t}\n\t}\n\treturn hasRegExpMatcher(argument);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $ObjectCreate = GetIntrinsic('%Object.create%', true);\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\n\nvar IsArray = require('./IsArray');\nvar Type = require('./Type');\n\nvar forEach = require('../helpers/forEach');\n\nvar SLOT = require('internal-slot');\n\nvar hasProto = require('has-proto')();\n\n// https://262.ecma-international.org/11.0/#sec-objectcreate\n\nmodule.exports = function OrdinaryObjectCreate(proto) {\n\tif (proto !== null && Type(proto) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: `proto` must be null or an object');\n\t}\n\tvar additionalInternalSlotsList = arguments.length < 2 ? [] : arguments[1];\n\tif (!IsArray(additionalInternalSlotsList)) {\n\t\tthrow new $TypeError('Assertion failed: `additionalInternalSlotsList` must be an Array');\n\t}\n\n\t// var internalSlotsList = ['[[Prototype]]', '[[Extensible]]']; // step 1\n\t// internalSlotsList.push(...additionalInternalSlotsList); // step 2\n\t// var O = MakeBasicObject(internalSlotsList); // step 3\n\t// setProto(O, proto); // step 4\n\t// return O; // step 5\n\n\tvar O;\n\tif ($ObjectCreate) {\n\t\tO = $ObjectCreate(proto);\n\t} else if (hasProto) {\n\t\tO = { __proto__: proto };\n\t} else {\n\t\tif (proto === null) {\n\t\t\tthrow new $SyntaxError('native Object.create support is required to create null objects');\n\t\t}\n\t\tvar T = function T() {};\n\t\tT.prototype = proto;\n\t\tO = new T();\n\t}\n\n\tif (additionalInternalSlotsList.length > 0) {\n\t\tforEach(additionalInternalSlotsList, function (slot) {\n\t\t\tSLOT.set(O, slot, void undefined);\n\t\t});\n\t}\n\n\treturn O;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar regexExec = require('call-bind/callBound')('RegExp.prototype.exec');\n\nvar Call = require('./Call');\nvar Get = require('./Get');\nvar IsCallable = require('./IsCallable');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-regexpexec\n\nmodule.exports = function RegExpExec(R, S) {\n\tif (Type(R) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: `R` must be an Object');\n\t}\n\tif (Type(S) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `S` must be a String');\n\t}\n\tvar exec = Get(R, 'exec');\n\tif (IsCallable(exec)) {\n\t\tvar result = Call(exec, R, [S]);\n\t\tif (result === null || Type(result) === 'Object') {\n\t\t\treturn result;\n\t\t}\n\t\tthrow new $TypeError('\"exec\" method must return `null` or an Object');\n\t}\n\treturn regexExec(R, S);\n};\n","'use strict';\n\nmodule.exports = require('../5/CheckObjectCoercible');\n","'use strict';\n\nvar $isNaN = require('../helpers/isNaN');\n\n// http://262.ecma-international.org/5.1/#sec-9.12\n\nmodule.exports = function SameValue(x, y) {\n\tif (x === y) { // 0 === -0, but they are not identical.\n\t\tif (x === 0) { return 1 / x === 1 / y; }\n\t\treturn true;\n\t}\n\treturn $isNaN(x) && $isNaN(y);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar IsPropertyKey = require('./IsPropertyKey');\nvar SameValue = require('./SameValue');\nvar Type = require('./Type');\n\n// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated\nvar noThrowOnStrictViolation = (function () {\n\ttry {\n\t\tdelete [].length;\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n}());\n\n// https://262.ecma-international.org/6.0/#sec-set-o-p-v-throw\n\nmodule.exports = function Set(O, P, V, Throw) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: `O` must be an Object');\n\t}\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: `P` must be a Property Key');\n\t}\n\tif (Type(Throw) !== 'Boolean') {\n\t\tthrow new $TypeError('Assertion failed: `Throw` must be a Boolean');\n\t}\n\tif (Throw) {\n\t\tO[P] = V; // eslint-disable-line no-param-reassign\n\t\tif (noThrowOnStrictViolation && !SameValue(O[P], V)) {\n\t\t\tthrow new $TypeError('Attempted to assign to readonly property.');\n\t\t}\n\t\treturn true;\n\t}\n\ttry {\n\t\tO[P] = V; // eslint-disable-line no-param-reassign\n\t\treturn noThrowOnStrictViolation ? SameValue(O[P], V) : true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $species = GetIntrinsic('%Symbol.species%', true);\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar IsConstructor = require('./IsConstructor');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-speciesconstructor\n\nmodule.exports = function SpeciesConstructor(O, defaultConstructor) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\tvar C = O.constructor;\n\tif (typeof C === 'undefined') {\n\t\treturn defaultConstructor;\n\t}\n\tif (Type(C) !== 'Object') {\n\t\tthrow new $TypeError('O.constructor is not an Object');\n\t}\n\tvar S = $species ? C[$species] : void 0;\n\tif (S == null) {\n\t\treturn defaultConstructor;\n\t}\n\tif (IsConstructor(S)) {\n\t\treturn S;\n\t}\n\tthrow new $TypeError('no constructor found');\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $Number = GetIntrinsic('%Number%');\nvar $RegExp = GetIntrinsic('%RegExp%');\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $parseInteger = GetIntrinsic('%parseInt%');\n\nvar callBound = require('call-bind/callBound');\nvar regexTester = require('safe-regex-test');\n\nvar $strSlice = callBound('String.prototype.slice');\nvar isBinary = regexTester(/^0b[01]+$/i);\nvar isOctal = regexTester(/^0o[0-7]+$/i);\nvar isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i);\nvar nonWS = ['\\u0085', '\\u200b', '\\ufffe'].join('');\nvar nonWSregex = new $RegExp('[' + nonWS + ']', 'g');\nvar hasNonWS = regexTester(nonWSregex);\n\nvar $trim = require('string.prototype.trim');\n\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/13.0/#sec-stringtonumber\n\nmodule.exports = function StringToNumber(argument) {\n\tif (Type(argument) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `argument` is not a String');\n\t}\n\tif (isBinary(argument)) {\n\t\treturn $Number($parseInteger($strSlice(argument, 2), 2));\n\t}\n\tif (isOctal(argument)) {\n\t\treturn $Number($parseInteger($strSlice(argument, 2), 8));\n\t}\n\tif (hasNonWS(argument) || isInvalidHexLiteral(argument)) {\n\t\treturn NaN;\n\t}\n\tvar trimmed = $trim(argument);\n\tif (trimmed !== argument) {\n\t\treturn StringToNumber(trimmed);\n\t}\n\treturn $Number(argument);\n};\n","'use strict';\n\n// http://262.ecma-international.org/5.1/#sec-9.2\n\nmodule.exports = function ToBoolean(value) { return !!value; };\n","'use strict';\n\nvar ToNumber = require('./ToNumber');\nvar truncate = require('./truncate');\n\nvar $isNaN = require('../helpers/isNaN');\nvar $isFinite = require('../helpers/isFinite');\n\n// https://262.ecma-international.org/14.0/#sec-tointegerorinfinity\n\nmodule.exports = function ToIntegerOrInfinity(value) {\n\tvar number = ToNumber(value);\n\tif ($isNaN(number) || number === 0) { return 0; }\n\tif (!$isFinite(number)) { return number; }\n\treturn truncate(number);\n};\n","'use strict';\n\nvar MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');\n\nvar ToIntegerOrInfinity = require('./ToIntegerOrInfinity');\n\nmodule.exports = function ToLength(argument) {\n\tvar len = ToIntegerOrInfinity(argument);\n\tif (len <= 0) { return 0; } // includes converting -0 to +0\n\tif (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; }\n\treturn len;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $Number = GetIntrinsic('%Number%');\nvar isPrimitive = require('../helpers/isPrimitive');\n\nvar ToPrimitive = require('./ToPrimitive');\nvar StringToNumber = require('./StringToNumber');\n\n// https://262.ecma-international.org/13.0/#sec-tonumber\n\nmodule.exports = function ToNumber(argument) {\n\tvar value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number);\n\tif (typeof value === 'symbol') {\n\t\tthrow new $TypeError('Cannot convert a Symbol value to a number');\n\t}\n\tif (typeof value === 'bigint') {\n\t\tthrow new $TypeError('Conversion from \\'BigInt\\' to \\'number\\' is not allowed.');\n\t}\n\tif (typeof value === 'string') {\n\t\treturn StringToNumber(value);\n\t}\n\treturn $Number(value);\n};\n","'use strict';\n\nvar toPrimitive = require('es-to-primitive/es2015');\n\n// https://262.ecma-international.org/6.0/#sec-toprimitive\n\nmodule.exports = function ToPrimitive(input) {\n\tif (arguments.length > 1) {\n\t\treturn toPrimitive(input, arguments[1]);\n\t}\n\treturn toPrimitive(input);\n};\n","'use strict';\n\nvar has = require('has');\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar Type = require('./Type');\nvar ToBoolean = require('./ToBoolean');\nvar IsCallable = require('./IsCallable');\n\n// https://262.ecma-international.org/5.1/#sec-8.10.5\n\nmodule.exports = function ToPropertyDescriptor(Obj) {\n\tif (Type(Obj) !== 'Object') {\n\t\tthrow new $TypeError('ToPropertyDescriptor requires an object');\n\t}\n\n\tvar desc = {};\n\tif (has(Obj, 'enumerable')) {\n\t\tdesc['[[Enumerable]]'] = ToBoolean(Obj.enumerable);\n\t}\n\tif (has(Obj, 'configurable')) {\n\t\tdesc['[[Configurable]]'] = ToBoolean(Obj.configurable);\n\t}\n\tif (has(Obj, 'value')) {\n\t\tdesc['[[Value]]'] = Obj.value;\n\t}\n\tif (has(Obj, 'writable')) {\n\t\tdesc['[[Writable]]'] = ToBoolean(Obj.writable);\n\t}\n\tif (has(Obj, 'get')) {\n\t\tvar getter = Obj.get;\n\t\tif (typeof getter !== 'undefined' && !IsCallable(getter)) {\n\t\t\tthrow new $TypeError('getter must be a function');\n\t\t}\n\t\tdesc['[[Get]]'] = getter;\n\t}\n\tif (has(Obj, 'set')) {\n\t\tvar setter = Obj.set;\n\t\tif (typeof setter !== 'undefined' && !IsCallable(setter)) {\n\t\t\tthrow new $TypeError('setter must be a function');\n\t\t}\n\t\tdesc['[[Set]]'] = setter;\n\t}\n\n\tif ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) {\n\t\tthrow new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');\n\t}\n\treturn desc;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $String = GetIntrinsic('%String%');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// https://262.ecma-international.org/6.0/#sec-tostring\n\nmodule.exports = function ToString(argument) {\n\tif (typeof argument === 'symbol') {\n\t\tthrow new $TypeError('Cannot convert a Symbol value to a string');\n\t}\n\treturn $String(argument);\n};\n","'use strict';\n\nvar ES5Type = require('../5/Type');\n\n// https://262.ecma-international.org/11.0/#sec-ecmascript-data-types-and-values\n\nmodule.exports = function Type(x) {\n\tif (typeof x === 'symbol') {\n\t\treturn 'Symbol';\n\t}\n\tif (typeof x === 'bigint') {\n\t\treturn 'BigInt';\n\t}\n\treturn ES5Type(x);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $fromCharCode = GetIntrinsic('%String.fromCharCode%');\n\nvar isLeadingSurrogate = require('../helpers/isLeadingSurrogate');\nvar isTrailingSurrogate = require('../helpers/isTrailingSurrogate');\n\n// https://tc39.es/ecma262/2020/#sec-utf16decodesurrogatepair\n\nmodule.exports = function UTF16SurrogatePairToCodePoint(lead, trail) {\n\tif (!isLeadingSurrogate(lead) || !isTrailingSurrogate(trail)) {\n\t\tthrow new $TypeError('Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code');\n\t}\n\t// var cp = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;\n\treturn $fromCharCode(lead) + $fromCharCode(trail);\n};\n","'use strict';\n\nvar Type = require('./Type');\n\n// var modulo = require('./modulo');\nvar $floor = Math.floor;\n\n// http://262.ecma-international.org/11.0/#eqn-floor\n\nmodule.exports = function floor(x) {\n\t// return x - modulo(x, 1);\n\tif (Type(x) === 'BigInt') {\n\t\treturn x;\n\t}\n\treturn $floor(x);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar floor = require('./floor');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// https://262.ecma-international.org/14.0/#eqn-truncate\n\nmodule.exports = function truncate(x) {\n\tif (typeof x !== 'number' && typeof x !== 'bigint') {\n\t\tthrow new $TypeError('argument must be a Number or a BigInt');\n\t}\n\tvar result = x < 0 ? -floor(-x) : floor(x);\n\treturn result === 0 ? 0 : result; // in the spec, these are math values, so we filter out -0 here\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// http://262.ecma-international.org/5.1/#sec-9.10\n\nmodule.exports = function CheckObjectCoercible(value, optMessage) {\n\tif (value == null) {\n\t\tthrow new $TypeError(optMessage || ('Cannot call method on ' + value));\n\t}\n\treturn value;\n};\n","'use strict';\n\n// https://262.ecma-international.org/5.1/#sec-8\n\nmodule.exports = function Type(x) {\n\tif (x === null) {\n\t\treturn 'Null';\n\t}\n\tif (typeof x === 'undefined') {\n\t\treturn 'Undefined';\n\t}\n\tif (typeof x === 'function' || typeof x === 'object') {\n\t\treturn 'Object';\n\t}\n\tif (typeof x === 'number') {\n\t\treturn 'Number';\n\t}\n\tif (typeof x === 'boolean') {\n\t\treturn 'Boolean';\n\t}\n\tif (typeof x === 'string') {\n\t\treturn 'String';\n\t}\n};\n","'use strict';\n\n// TODO: remove, semver-major\n\nmodule.exports = require('get-intrinsic');\n","'use strict';\n\nvar hasPropertyDescriptors = require('has-property-descriptors');\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = hasPropertyDescriptors() && GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasArrayLengthDefineBug = hasPropertyDescriptors.hasArrayLengthDefineBug();\n\n// eslint-disable-next-line global-require\nvar isArray = hasArrayLengthDefineBug && require('../helpers/IsArray');\n\nvar callBound = require('call-bind/callBound');\n\nvar $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');\n\n// eslint-disable-next-line max-params\nmodule.exports = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) {\n\tif (!$defineProperty) {\n\t\tif (!IsDataDescriptor(desc)) {\n\t\t\t// ES3 does not support getters/setters\n\t\t\treturn false;\n\t\t}\n\t\tif (!desc['[[Configurable]]'] || !desc['[[Writable]]']) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// fallback for ES3\n\t\tif (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) {\n\t\t\t// a non-enumerable existing property\n\t\t\treturn false;\n\t\t}\n\n\t\t// property does not exist at all, or exists but is enumerable\n\t\tvar V = desc['[[Value]]'];\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tO[P] = V; // will use [[Define]]\n\t\treturn SameValue(O[P], V);\n\t}\n\tif (\n\t\thasArrayLengthDefineBug\n\t\t&& P === 'length'\n\t\t&& '[[Value]]' in desc\n\t\t&& isArray(O)\n\t\t&& O.length !== desc['[[Value]]']\n\t) {\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tO.length = desc['[[Value]]'];\n\t\treturn O.length === desc['[[Value]]'];\n\t}\n\n\t$defineProperty(O, P, FromPropertyDescriptor(desc));\n\treturn true;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $Array = GetIntrinsic('%Array%');\n\n// eslint-disable-next-line global-require\nvar toStr = !$Array.isArray && require('call-bind/callBound')('Object.prototype.toString');\n\nmodule.exports = $Array.isArray || function IsArray(argument) {\n\treturn toStr(argument) === '[object Array]';\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\n\nvar has = require('has');\nvar isInteger = require('./isInteger');\n\nvar isMatchRecord = require('./isMatchRecord');\n\nvar predicates = {\n\t// https://262.ecma-international.org/6.0/#sec-property-descriptor-specification-type\n\t'Property Descriptor': function isPropertyDescriptor(Desc) {\n\t\tvar allowed = {\n\t\t\t'[[Configurable]]': true,\n\t\t\t'[[Enumerable]]': true,\n\t\t\t'[[Get]]': true,\n\t\t\t'[[Set]]': true,\n\t\t\t'[[Value]]': true,\n\t\t\t'[[Writable]]': true\n\t\t};\n\n\t\tif (!Desc) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (var key in Desc) { // eslint-disable-line\n\t\t\tif (has(Desc, key) && !allowed[key]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tvar isData = has(Desc, '[[Value]]');\n\t\tvar IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]');\n\t\tif (isData && IsAccessor) {\n\t\t\tthrow new $TypeError('Property Descriptors may not be both accessor and data descriptors');\n\t\t}\n\t\treturn true;\n\t},\n\t// https://262.ecma-international.org/13.0/#sec-match-records\n\t'Match Record': isMatchRecord,\n\t'Iterator Record': function isIteratorRecord(value) {\n\t\treturn has(value, '[[Iterator]]') && has(value, '[[NextMethod]]') && has(value, '[[Done]]');\n\t},\n\t'PromiseCapability Record': function isPromiseCapabilityRecord(value) {\n\t\treturn !!value\n\t\t\t&& has(value, '[[Resolve]]')\n\t\t\t&& typeof value['[[Resolve]]'] === 'function'\n\t\t\t&& has(value, '[[Reject]]')\n\t\t\t&& typeof value['[[Reject]]'] === 'function'\n\t\t\t&& has(value, '[[Promise]]')\n\t\t\t&& value['[[Promise]]']\n\t\t\t&& typeof value['[[Promise]]'].then === 'function';\n\t},\n\t'AsyncGeneratorRequest Record': function isAsyncGeneratorRequestRecord(value) {\n\t\treturn !!value\n\t\t\t&& has(value, '[[Completion]]') // TODO: confirm is a completion record\n\t\t\t&& has(value, '[[Capability]]')\n\t\t\t&& predicates['PromiseCapability Record'](value['[[Capability]]']);\n\t},\n\t'RegExp Record': function isRegExpRecord(value) {\n\t\treturn value\n\t\t\t&& has(value, '[[IgnoreCase]]')\n\t\t\t&& typeof value['[[IgnoreCase]]'] === 'boolean'\n\t\t\t&& has(value, '[[Multiline]]')\n\t\t\t&& typeof value['[[Multiline]]'] === 'boolean'\n\t\t\t&& has(value, '[[DotAll]]')\n\t\t\t&& typeof value['[[DotAll]]'] === 'boolean'\n\t\t\t&& has(value, '[[Unicode]]')\n\t\t\t&& typeof value['[[Unicode]]'] === 'boolean'\n\t\t\t&& has(value, '[[CapturingGroupsCount]]')\n\t\t\t&& typeof value['[[CapturingGroupsCount]]'] === 'number'\n\t\t\t&& isInteger(value['[[CapturingGroupsCount]]'])\n\t\t\t&& value['[[CapturingGroupsCount]]'] >= 0;\n\t}\n};\n\nmodule.exports = function assertRecord(Type, recordType, argumentName, value) {\n\tvar predicate = predicates[recordType];\n\tif (typeof predicate !== 'function') {\n\t\tthrow new $SyntaxError('unknown record type: ' + recordType);\n\t}\n\tif (Type(value) !== 'Object' || !predicate(value)) {\n\t\tthrow new $TypeError(argumentName + ' must be a ' + recordType);\n\t}\n};\n","'use strict';\n\nmodule.exports = function forEach(array, callback) {\n\tfor (var i = 0; i < array.length; i += 1) {\n\t\tcallback(array[i], i, array); // eslint-disable-line callback-return\n\t}\n};\n","'use strict';\n\nmodule.exports = function fromPropertyDescriptor(Desc) {\n\tif (typeof Desc === 'undefined') {\n\t\treturn Desc;\n\t}\n\tvar obj = {};\n\tif ('[[Value]]' in Desc) {\n\t\tobj.value = Desc['[[Value]]'];\n\t}\n\tif ('[[Writable]]' in Desc) {\n\t\tobj.writable = !!Desc['[[Writable]]'];\n\t}\n\tif ('[[Get]]' in Desc) {\n\t\tobj.get = Desc['[[Get]]'];\n\t}\n\tif ('[[Set]]' in Desc) {\n\t\tobj.set = Desc['[[Set]]'];\n\t}\n\tif ('[[Enumerable]]' in Desc) {\n\t\tobj.enumerable = !!Desc['[[Enumerable]]'];\n\t}\n\tif ('[[Configurable]]' in Desc) {\n\t\tobj.configurable = !!Desc['[[Configurable]]'];\n\t}\n\treturn obj;\n};\n","'use strict';\n\nvar $isNaN = require('./isNaN');\n\nmodule.exports = function (x) { return (typeof x === 'number' || typeof x === 'bigint') && !$isNaN(x) && x !== Infinity && x !== -Infinity; };\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $abs = GetIntrinsic('%Math.abs%');\nvar $floor = GetIntrinsic('%Math.floor%');\n\nvar $isNaN = require('./isNaN');\nvar $isFinite = require('./isFinite');\n\nmodule.exports = function isInteger(argument) {\n\tif (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {\n\t\treturn false;\n\t}\n\tvar absValue = $abs(argument);\n\treturn $floor(absValue) === absValue;\n};\n\n","'use strict';\n\nmodule.exports = function isLeadingSurrogate(charCode) {\n\treturn typeof charCode === 'number' && charCode >= 0xD800 && charCode <= 0xDBFF;\n};\n","'use strict';\n\nvar has = require('has');\n\n// https://262.ecma-international.org/13.0/#sec-match-records\n\nmodule.exports = function isMatchRecord(record) {\n\treturn (\n\t\thas(record, '[[StartIndex]]')\n && has(record, '[[EndIndex]]')\n && record['[[StartIndex]]'] >= 0\n && record['[[EndIndex]]'] >= record['[[StartIndex]]']\n && String(parseInt(record['[[StartIndex]]'], 10)) === String(record['[[StartIndex]]'])\n && String(parseInt(record['[[EndIndex]]'], 10)) === String(record['[[EndIndex]]'])\n\t);\n};\n","'use strict';\n\nmodule.exports = Number.isNaN || function isNaN(a) {\n\treturn a !== a;\n};\n","'use strict';\n\nmodule.exports = function isPrimitive(value) {\n\treturn value === null || (typeof value !== 'function' && typeof value !== 'object');\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar has = require('has');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nmodule.exports = function IsPropertyDescriptor(ES, Desc) {\n\tif (ES.Type(Desc) !== 'Object') {\n\t\treturn false;\n\t}\n\tvar allowed = {\n\t\t'[[Configurable]]': true,\n\t\t'[[Enumerable]]': true,\n\t\t'[[Get]]': true,\n\t\t'[[Set]]': true,\n\t\t'[[Value]]': true,\n\t\t'[[Writable]]': true\n\t};\n\n\tfor (var key in Desc) { // eslint-disable-line no-restricted-syntax\n\t\tif (has(Desc, key) && !allowed[key]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tif (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) {\n\t\tthrow new $TypeError('Property Descriptors may not be both accessor and data descriptors');\n\t}\n\treturn true;\n};\n","'use strict';\n\nmodule.exports = function isTrailingSurrogate(charCode) {\n\treturn typeof charCode === 'number' && charCode >= 0xDC00 && charCode <= 0xDFFF;\n};\n","'use strict';\n\nmodule.exports = Number.MAX_SAFE_INTEGER || 9007199254740991; // Math.pow(2, 53) - 1;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","const debug = false;\nexport function log(...args) {\n if (debug) {\n console.log(...args);\n }\n}\n","//\n// Copyright 2021 Readium Foundation. All rights reserved.\n// Use of this source code is governed by the BSD-style license\n// available in the top-level LICENSE file of the project.\n//\nimport { log } from \"./log\";\n/**\n * Transforms a DOMRect into the zoomed coordinate system.\n *\n * See https://issues.chromium.org/issues/40391865#comment9\n */\nexport function dezoomDomRect(rect, zoomLevel) {\n return new DOMRect(rect.x / zoomLevel, rect.y / zoomLevel, rect.width / zoomLevel, rect.height / zoomLevel);\n}\n/**\n * Transforms a rect into the zoomed coordinate system.\n *\n * See https://issues.chromium.org/issues/40391865#comment9\n */\nexport function dezoomRect(rect, zoomLevel) {\n return {\n bottom: rect.bottom / zoomLevel,\n height: rect.height / zoomLevel,\n left: rect.left / zoomLevel,\n right: rect.right / zoomLevel,\n top: rect.top / zoomLevel,\n width: rect.width / zoomLevel,\n };\n}\nexport function domRectToRect(rect) {\n return {\n width: rect.width,\n height: rect.height,\n left: rect.left,\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n };\n}\nexport function getClientRectsNoOverlap(range, doNotMergeHorizontallyAlignedRects) {\n const clientRects = range.getClientRects();\n const tolerance = 1;\n const originalRects = [];\n for (const rangeClientRect of clientRects) {\n originalRects.push({\n bottom: rangeClientRect.bottom,\n height: rangeClientRect.height,\n left: rangeClientRect.left,\n right: rangeClientRect.right,\n top: rangeClientRect.top,\n width: rangeClientRect.width,\n });\n }\n const mergedRects = mergeTouchingRects(originalRects, tolerance, doNotMergeHorizontallyAlignedRects);\n const noContainedRects = removeContainedRects(mergedRects, tolerance);\n const newRects = replaceOverlapingRects(noContainedRects);\n const minArea = 2 * 2;\n for (let j = newRects.length - 1; j >= 0; j--) {\n const rect = newRects[j];\n const bigEnough = rect.width * rect.height > minArea;\n if (!bigEnough) {\n if (newRects.length > 1) {\n log(\"CLIENT RECT: remove small\");\n newRects.splice(j, 1);\n }\n else {\n log(\"CLIENT RECT: remove small, but keep otherwise empty!\");\n break;\n }\n }\n }\n log(`CLIENT RECT: reduced ${originalRects.length} --> ${newRects.length}`);\n return newRects;\n}\nfunction mergeTouchingRects(rects, tolerance, doNotMergeHorizontallyAlignedRects) {\n for (let i = 0; i < rects.length; i++) {\n for (let j = i + 1; j < rects.length; j++) {\n const rect1 = rects[i];\n const rect2 = rects[j];\n if (rect1 === rect2) {\n log(\"mergeTouchingRects rect1 === rect2 ??!\");\n continue;\n }\n const rectsLineUpVertically = almostEqual(rect1.top, rect2.top, tolerance) &&\n almostEqual(rect1.bottom, rect2.bottom, tolerance);\n const rectsLineUpHorizontally = almostEqual(rect1.left, rect2.left, tolerance) &&\n almostEqual(rect1.right, rect2.right, tolerance);\n const horizontalAllowed = !doNotMergeHorizontallyAlignedRects;\n const aligned = (rectsLineUpHorizontally && horizontalAllowed) ||\n (rectsLineUpVertically && !rectsLineUpHorizontally);\n const canMerge = aligned && rectsTouchOrOverlap(rect1, rect2, tolerance);\n if (canMerge) {\n log(`CLIENT RECT: merging two into one, VERTICAL: ${rectsLineUpVertically} HORIZONTAL: ${rectsLineUpHorizontally} (${doNotMergeHorizontallyAlignedRects})`);\n const newRects = rects.filter((rect) => {\n return rect !== rect1 && rect !== rect2;\n });\n const replacementClientRect = getBoundingRect(rect1, rect2);\n newRects.push(replacementClientRect);\n return mergeTouchingRects(newRects, tolerance, doNotMergeHorizontallyAlignedRects);\n }\n }\n }\n return rects;\n}\nfunction getBoundingRect(rect1, rect2) {\n const left = Math.min(rect1.left, rect2.left);\n const right = Math.max(rect1.right, rect2.right);\n const top = Math.min(rect1.top, rect2.top);\n const bottom = Math.max(rect1.bottom, rect2.bottom);\n return {\n bottom,\n height: bottom - top,\n left,\n right,\n top,\n width: right - left,\n };\n}\nfunction removeContainedRects(rects, tolerance) {\n const rectsToKeep = new Set(rects);\n for (const rect of rects) {\n const bigEnough = rect.width > 1 && rect.height > 1;\n if (!bigEnough) {\n log(\"CLIENT RECT: remove tiny\");\n rectsToKeep.delete(rect);\n continue;\n }\n for (const possiblyContainingRect of rects) {\n if (rect === possiblyContainingRect) {\n continue;\n }\n if (!rectsToKeep.has(possiblyContainingRect)) {\n continue;\n }\n if (rectContains(possiblyContainingRect, rect, tolerance)) {\n log(\"CLIENT RECT: remove contained\");\n rectsToKeep.delete(rect);\n break;\n }\n }\n }\n return Array.from(rectsToKeep);\n}\nfunction rectContains(rect1, rect2, tolerance) {\n return (rectContainsPoint(rect1, rect2.left, rect2.top, tolerance) &&\n rectContainsPoint(rect1, rect2.right, rect2.top, tolerance) &&\n rectContainsPoint(rect1, rect2.left, rect2.bottom, tolerance) &&\n rectContainsPoint(rect1, rect2.right, rect2.bottom, tolerance));\n}\nexport function rectContainsPoint(rect, x, y, tolerance) {\n return ((rect.left < x || almostEqual(rect.left, x, tolerance)) &&\n (rect.right > x || almostEqual(rect.right, x, tolerance)) &&\n (rect.top < y || almostEqual(rect.top, y, tolerance)) &&\n (rect.bottom > y || almostEqual(rect.bottom, y, tolerance)));\n}\nfunction replaceOverlapingRects(rects) {\n for (let i = 0; i < rects.length; i++) {\n for (let j = i + 1; j < rects.length; j++) {\n const rect1 = rects[i];\n const rect2 = rects[j];\n if (rect1 === rect2) {\n log(\"replaceOverlapingRects rect1 === rect2 ??!\");\n continue;\n }\n if (rectsTouchOrOverlap(rect1, rect2, -1)) {\n let toAdd = [];\n let toRemove;\n const subtractRects1 = rectSubtract(rect1, rect2);\n if (subtractRects1.length === 1) {\n toAdd = subtractRects1;\n toRemove = rect1;\n }\n else {\n const subtractRects2 = rectSubtract(rect2, rect1);\n if (subtractRects1.length < subtractRects2.length) {\n toAdd = subtractRects1;\n toRemove = rect1;\n }\n else {\n toAdd = subtractRects2;\n toRemove = rect2;\n }\n }\n log(`CLIENT RECT: overlap, cut one rect into ${toAdd.length}`);\n const newRects = rects.filter((rect) => {\n return rect !== toRemove;\n });\n Array.prototype.push.apply(newRects, toAdd);\n return replaceOverlapingRects(newRects);\n }\n }\n }\n return rects;\n}\nfunction rectSubtract(rect1, rect2) {\n const rectIntersected = rectIntersect(rect2, rect1);\n if (rectIntersected.height === 0 || rectIntersected.width === 0) {\n return [rect1];\n }\n const rects = [];\n {\n const rectA = {\n bottom: rect1.bottom,\n height: 0,\n left: rect1.left,\n right: rectIntersected.left,\n top: rect1.top,\n width: 0,\n };\n rectA.width = rectA.right - rectA.left;\n rectA.height = rectA.bottom - rectA.top;\n if (rectA.height !== 0 && rectA.width !== 0) {\n rects.push(rectA);\n }\n }\n {\n const rectB = {\n bottom: rectIntersected.top,\n height: 0,\n left: rectIntersected.left,\n right: rectIntersected.right,\n top: rect1.top,\n width: 0,\n };\n rectB.width = rectB.right - rectB.left;\n rectB.height = rectB.bottom - rectB.top;\n if (rectB.height !== 0 && rectB.width !== 0) {\n rects.push(rectB);\n }\n }\n {\n const rectC = {\n bottom: rect1.bottom,\n height: 0,\n left: rectIntersected.left,\n right: rectIntersected.right,\n top: rectIntersected.bottom,\n width: 0,\n };\n rectC.width = rectC.right - rectC.left;\n rectC.height = rectC.bottom - rectC.top;\n if (rectC.height !== 0 && rectC.width !== 0) {\n rects.push(rectC);\n }\n }\n {\n const rectD = {\n bottom: rect1.bottom,\n height: 0,\n left: rectIntersected.right,\n right: rect1.right,\n top: rect1.top,\n width: 0,\n };\n rectD.width = rectD.right - rectD.left;\n rectD.height = rectD.bottom - rectD.top;\n if (rectD.height !== 0 && rectD.width !== 0) {\n rects.push(rectD);\n }\n }\n return rects;\n}\nfunction rectIntersect(rect1, rect2) {\n const maxLeft = Math.max(rect1.left, rect2.left);\n const minRight = Math.min(rect1.right, rect2.right);\n const maxTop = Math.max(rect1.top, rect2.top);\n const minBottom = Math.min(rect1.bottom, rect2.bottom);\n return {\n bottom: minBottom,\n height: Math.max(0, minBottom - maxTop),\n left: maxLeft,\n right: minRight,\n top: maxTop,\n width: Math.max(0, minRight - maxLeft),\n };\n}\nfunction rectsTouchOrOverlap(rect1, rect2, tolerance) {\n return ((rect1.left < rect2.right ||\n (tolerance >= 0 && almostEqual(rect1.left, rect2.right, tolerance))) &&\n (rect2.left < rect1.right ||\n (tolerance >= 0 && almostEqual(rect2.left, rect1.right, tolerance))) &&\n (rect1.top < rect2.bottom ||\n (tolerance >= 0 && almostEqual(rect1.top, rect2.bottom, tolerance))) &&\n (rect2.top < rect1.bottom ||\n (tolerance >= 0 && almostEqual(rect2.top, rect1.bottom, tolerance))));\n}\nfunction almostEqual(a, b, tolerance) {\n return Math.abs(a - b) <= tolerance;\n}\n","/**\n * From which direction to evaluate strings or nodes: from the start of a string\n * or range seeking Forwards, or from the end seeking Backwards.\n */\nvar TrimDirection;\n(function (TrimDirection) {\n TrimDirection[TrimDirection[\"Forwards\"] = 1] = \"Forwards\";\n TrimDirection[TrimDirection[\"Backwards\"] = 2] = \"Backwards\";\n})(TrimDirection || (TrimDirection = {}));\n/**\n * Return the offset of the nearest non-whitespace character to `baseOffset`\n * within the string `text`, looking in the `direction` indicated. Return -1 if\n * no non-whitespace character exists between `baseOffset` (inclusive) and the\n * terminus of the string (start or end depending on `direction`).\n */\nfunction closestNonSpaceInString(text, baseOffset, direction) {\n const nextChar = direction === TrimDirection.Forwards ? baseOffset : baseOffset - 1;\n if (text.charAt(nextChar).trim() !== \"\") {\n // baseOffset is already valid: it points at a non-whitespace character\n return baseOffset;\n }\n let availableChars;\n let availableNonWhitespaceChars;\n if (direction === TrimDirection.Backwards) {\n availableChars = text.substring(0, baseOffset);\n availableNonWhitespaceChars = availableChars.trimEnd();\n }\n else {\n availableChars = text.substring(baseOffset);\n availableNonWhitespaceChars = availableChars.trimStart();\n }\n if (!availableNonWhitespaceChars.length) {\n return -1;\n }\n const offsetDelta = availableChars.length - availableNonWhitespaceChars.length;\n return direction === TrimDirection.Backwards\n ? baseOffset - offsetDelta\n : baseOffset + offsetDelta;\n}\n/**\n * Calculate a new Range start position (TrimDirection.Forwards) or end position\n * (Backwards) for `range` that represents the nearest non-whitespace character,\n * moving into the `range` away from the relevant initial boundary node towards\n * the terminating boundary node.\n *\n * @throws {RangeError} If no text node with non-whitespace characters found\n */\nfunction closestNonSpaceInRange(range, direction) {\n const nodeIter = range.commonAncestorContainer.ownerDocument.createNodeIterator(range.commonAncestorContainer, NodeFilter.SHOW_TEXT);\n const initialBoundaryNode = direction === TrimDirection.Forwards\n ? range.startContainer\n : range.endContainer;\n const terminalBoundaryNode = direction === TrimDirection.Forwards\n ? range.endContainer\n : range.startContainer;\n let currentNode = nodeIter.nextNode();\n // Advance the NodeIterator to the `initialBoundaryNode`\n while (currentNode && currentNode !== initialBoundaryNode) {\n currentNode = nodeIter.nextNode();\n }\n if (direction === TrimDirection.Backwards) {\n // Reverse the NodeIterator direction. This will return the same node\n // as the previous `nextNode()` call (initial boundary node).\n currentNode = nodeIter.previousNode();\n }\n let trimmedOffset = -1;\n const advance = () => {\n currentNode =\n direction === TrimDirection.Forwards\n ? nodeIter.nextNode()\n : nodeIter.previousNode();\n if (currentNode) {\n const nodeText = currentNode.textContent;\n const baseOffset = direction === TrimDirection.Forwards ? 0 : nodeText.length;\n trimmedOffset = closestNonSpaceInString(nodeText, baseOffset, direction);\n }\n };\n while (currentNode &&\n trimmedOffset === -1 &&\n currentNode !== terminalBoundaryNode) {\n advance();\n }\n if (currentNode && trimmedOffset >= 0) {\n return { node: currentNode, offset: trimmedOffset };\n }\n /* istanbul ignore next */\n throw new RangeError(\"No text nodes with non-whitespace text found in range\");\n}\n/**\n * Return a new DOM Range that adjusts the start and end positions of `range` as\n * needed such that:\n *\n * - `startContainer` and `endContainer` text nodes both contain at least one\n * non-whitespace character within the Range's text content\n * - `startOffset` and `endOffset` both reference non-whitespace characters,\n * with `startOffset` immediately before the first non-whitespace character\n * and `endOffset` immediately after the last\n *\n * Whitespace characters are those that are removed by `String.prototype.trim()`\n *\n * @param range - A DOM Range that whose `startContainer` and `endContainer` are\n * both text nodes, and which contains at least one non-whitespace character.\n * @throws {RangeError}\n */\nexport function trimRange(range) {\n if (!range.toString().trim().length) {\n throw new RangeError(\"Range contains no non-whitespace text\");\n }\n if (range.startContainer.nodeType !== Node.TEXT_NODE) {\n throw new RangeError(\"Range startContainer is not a text node\");\n }\n if (range.endContainer.nodeType !== Node.TEXT_NODE) {\n throw new RangeError(\"Range endContainer is not a text node\");\n }\n const trimmedRange = range.cloneRange();\n let startTrimmed = false;\n let endTrimmed = false;\n const trimmedOffsets = {\n start: closestNonSpaceInString(range.startContainer.textContent, range.startOffset, TrimDirection.Forwards),\n end: closestNonSpaceInString(range.endContainer.textContent, range.endOffset, TrimDirection.Backwards),\n };\n if (trimmedOffsets.start >= 0) {\n trimmedRange.setStart(range.startContainer, trimmedOffsets.start);\n startTrimmed = true;\n }\n // Note: An offset of 0 is invalid for an end offset, as no text in the\n // node would be included in the range.\n if (trimmedOffsets.end > 0) {\n trimmedRange.setEnd(range.endContainer, trimmedOffsets.end);\n endTrimmed = true;\n }\n if (startTrimmed && endTrimmed) {\n return trimmedRange;\n }\n if (!startTrimmed) {\n // There are no (non-whitespace) characters between `startOffset` and the\n // end of the `startContainer` node.\n const { node, offset } = closestNonSpaceInRange(trimmedRange, TrimDirection.Forwards);\n if (node && offset >= 0) {\n trimmedRange.setStart(node, offset);\n }\n }\n if (!endTrimmed) {\n // There are no (non-whitespace) characters between the start of the Range's\n // `endContainer` text content and the `endOffset`.\n const { node, offset } = closestNonSpaceInRange(trimmedRange, TrimDirection.Backwards);\n if (node && offset > 0) {\n trimmedRange.setEnd(node, offset);\n }\n }\n return trimmedRange;\n}\n","import { trimRange } from \"./trim-range\";\n/**\n * Return the combined length of text nodes contained in `node`.\n */\nfunction nodeTextLength(node) {\n var _a, _b;\n switch (node.nodeType) {\n case Node.ELEMENT_NODE:\n case Node.TEXT_NODE:\n // nb. `textContent` excludes text in comments and processing instructions\n // when called on a parent element, so we don't need to subtract that here.\n return (_b = (_a = node.textContent) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;\n default:\n return 0;\n }\n}\n/**\n * Return the total length of the text of all previous siblings of `node`.\n */\nfunction previousSiblingsTextLength(node) {\n let sibling = node.previousSibling;\n let length = 0;\n while (sibling) {\n length += nodeTextLength(sibling);\n sibling = sibling.previousSibling;\n }\n return length;\n}\n/**\n * Resolve one or more character offsets within an element to (text node,\n * position) pairs.\n *\n * @param element\n * @param offsets - Offsets, which must be sorted in ascending order\n * @throws {RangeError}\n */\nfunction resolveOffsets(element, ...offsets) {\n let nextOffset = offsets.shift();\n const nodeIter = element.ownerDocument.createNodeIterator(element, NodeFilter.SHOW_TEXT);\n const results = [];\n let currentNode = nodeIter.nextNode();\n let textNode;\n let length = 0;\n // Find the text node containing the `nextOffset`th character from the start\n // of `element`.\n while (nextOffset !== undefined && currentNode) {\n textNode = currentNode;\n if (length + textNode.data.length > nextOffset) {\n results.push({ node: textNode, offset: nextOffset - length });\n nextOffset = offsets.shift();\n }\n else {\n currentNode = nodeIter.nextNode();\n length += textNode.data.length;\n }\n }\n // Boundary case.\n while (nextOffset !== undefined && textNode && length === nextOffset) {\n results.push({ node: textNode, offset: textNode.data.length });\n nextOffset = offsets.shift();\n }\n if (nextOffset !== undefined) {\n throw new RangeError(\"Offset exceeds text length\");\n }\n return results;\n}\n/**\n * When resolving a TextPosition, specifies the direction to search for the\n * nearest text node if `offset` is `0` and the element has no text.\n */\nexport var ResolveDirection;\n(function (ResolveDirection) {\n ResolveDirection[ResolveDirection[\"FORWARDS\"] = 1] = \"FORWARDS\";\n ResolveDirection[ResolveDirection[\"BACKWARDS\"] = 2] = \"BACKWARDS\";\n})(ResolveDirection || (ResolveDirection = {}));\n/**\n * Represents an offset within the text content of an element.\n *\n * This position can be resolved to a specific descendant node in the current\n * DOM subtree of the element using the `resolve` method.\n */\nexport class TextPosition {\n constructor(element, offset) {\n if (offset < 0) {\n throw new Error(\"Offset is invalid\");\n }\n /** Element that `offset` is relative to. */\n this.element = element;\n /** Character offset from the start of the element's `textContent`. */\n this.offset = offset;\n }\n /**\n * Return a copy of this position with offset relative to a given ancestor\n * element.\n *\n * @param parent - Ancestor of `this.element`\n */\n relativeTo(parent) {\n if (!parent.contains(this.element)) {\n throw new Error(\"Parent is not an ancestor of current element\");\n }\n let el = this.element;\n let offset = this.offset;\n while (el !== parent) {\n offset += previousSiblingsTextLength(el);\n el = el.parentElement;\n }\n return new TextPosition(el, offset);\n }\n /**\n * Resolve the position to a specific text node and offset within that node.\n *\n * Throws if `this.offset` exceeds the length of the element's text. In the\n * case where the element has no text and `this.offset` is 0, the `direction`\n * option determines what happens.\n *\n * Offsets at the boundary between two nodes are resolved to the start of the\n * node that begins at the boundary.\n *\n * @param options.direction - Specifies in which direction to search for the\n * nearest text node if `this.offset` is `0` and\n * `this.element` has no text. If not specified an\n * error is thrown.\n *\n * @throws {RangeError}\n */\n resolve(options = {}) {\n try {\n return resolveOffsets(this.element, this.offset)[0];\n }\n catch (err) {\n if (this.offset === 0 && options.direction !== undefined) {\n const tw = document.createTreeWalker(this.element.getRootNode(), NodeFilter.SHOW_TEXT);\n tw.currentNode = this.element;\n const forwards = options.direction === ResolveDirection.FORWARDS;\n const text = forwards\n ? tw.nextNode()\n : tw.previousNode();\n if (!text) {\n throw err;\n }\n return { node: text, offset: forwards ? 0 : text.data.length };\n }\n else {\n throw err;\n }\n }\n }\n /**\n * Construct a `TextPosition` that refers to the `offset`th character within\n * `node`.\n */\n static fromCharOffset(node, offset) {\n switch (node.nodeType) {\n case Node.TEXT_NODE:\n return TextPosition.fromPoint(node, offset);\n case Node.ELEMENT_NODE:\n return new TextPosition(node, offset);\n default:\n throw new Error(\"Node is not an element or text node\");\n }\n }\n /**\n * Construct a `TextPosition` representing the range start or end point (node, offset).\n *\n * @param node\n * @param offset - Offset within the node\n */\n static fromPoint(node, offset) {\n switch (node.nodeType) {\n case Node.TEXT_NODE: {\n if (offset < 0 || offset > node.data.length) {\n throw new Error(\"Text node offset is out of range\");\n }\n if (!node.parentElement) {\n throw new Error(\"Text node has no parent\");\n }\n // Get the offset from the start of the parent element.\n const textOffset = previousSiblingsTextLength(node) + offset;\n return new TextPosition(node.parentElement, textOffset);\n }\n case Node.ELEMENT_NODE: {\n if (offset < 0 || offset > node.childNodes.length) {\n throw new Error(\"Child node offset is out of range\");\n }\n // Get the text length before the `offset`th child of element.\n let textOffset = 0;\n for (let i = 0; i < offset; i++) {\n textOffset += nodeTextLength(node.childNodes[i]);\n }\n return new TextPosition(node, textOffset);\n }\n default:\n throw new Error(\"Point is not in an element or text node\");\n }\n }\n}\n/**\n * Represents a region of a document as a (start, end) pair of `TextPosition` points.\n *\n * Representing a range in this way allows for changes in the DOM content of the\n * range which don't affect its text content, without affecting the text content\n * of the range itself.\n */\nexport class TextRange {\n constructor(start, end) {\n this.start = start;\n this.end = end;\n }\n /**\n * Create a new TextRange whose `start` and `end` are computed relative to\n * `element`. `element` must be an ancestor of both `start.element` and\n * `end.element`.\n */\n relativeTo(element) {\n return new TextRange(this.start.relativeTo(element), this.end.relativeTo(element));\n }\n /**\n * Resolve this TextRange to a (DOM) Range.\n *\n * The resulting DOM Range will always start and end in a `Text` node.\n * Hence `TextRange.fromRange(range).toRange()` can be used to \"shrink\" a\n * range to the text it contains.\n *\n * May throw if the `start` or `end` positions cannot be resolved to a range.\n */\n toRange() {\n let start;\n let end;\n if (this.start.element === this.end.element &&\n this.start.offset <= this.end.offset) {\n // Fast path for start and end points in same element.\n [start, end] = resolveOffsets(this.start.element, this.start.offset, this.end.offset);\n }\n else {\n start = this.start.resolve({\n direction: ResolveDirection.FORWARDS,\n });\n end = this.end.resolve({ direction: ResolveDirection.BACKWARDS });\n }\n const range = new Range();\n range.setStart(start.node, start.offset);\n range.setEnd(end.node, end.offset);\n return range;\n }\n /**\n * Create a TextRange from a (DOM) Range\n */\n static fromRange(range) {\n const start = TextPosition.fromPoint(range.startContainer, range.startOffset);\n const end = TextPosition.fromPoint(range.endContainer, range.endOffset);\n return new TextRange(start, end);\n }\n /**\n * Create a TextRange representing the `start`th to `end`th characters in\n * `root`\n */\n static fromOffsets(root, start, end) {\n return new TextRange(new TextPosition(root, start), new TextPosition(root, end));\n }\n /**\n * Return a new Range representing `range` trimmed of any leading or trailing\n * whitespace\n */\n static trimmedRange(range) {\n return trimRange(TextRange.fromRange(range).toRange());\n }\n}\n","import approxSearch from \"approx-string-match\";\n/**\n * Find the best approximate matches for `str` in `text` allowing up to\n * `maxErrors` errors.\n */\nfunction search(text, str, maxErrors) {\n // Do a fast search for exact matches. The `approx-string-match` library\n // doesn't currently incorporate this optimization itself.\n let matchPos = 0;\n const exactMatches = [];\n while (matchPos !== -1) {\n matchPos = text.indexOf(str, matchPos);\n if (matchPos !== -1) {\n exactMatches.push({\n start: matchPos,\n end: matchPos + str.length,\n errors: 0,\n });\n matchPos += 1;\n }\n }\n if (exactMatches.length > 0) {\n return exactMatches;\n }\n // If there are no exact matches, do a more expensive search for matches\n // with errors.\n return approxSearch(text, str, maxErrors);\n}\n/**\n * Compute a score between 0 and 1.0 for the similarity between `text` and `str`.\n */\nfunction textMatchScore(text, str) {\n // `search` will return no matches if either the text or pattern is empty,\n // otherwise it will return at least one match if the max allowed error count\n // is at least `str.length`.\n if (str.length === 0 || text.length === 0) {\n return 0.0;\n }\n const matches = search(text, str, str.length);\n // prettier-ignore\n return 1 - (matches[0].errors / str.length);\n}\n/**\n * Find the best approximate match for `quote` in `text`.\n *\n * @param text - Document text to search\n * @param quote - String to find within `text`\n * @param context - Context in which the quote originally appeared. This is\n * used to choose the best match.\n * @return `null` if no match exceeding the minimum quality threshold was found.\n */\nexport function matchQuote(text, quote, context = {}) {\n if (quote.length === 0) {\n return null;\n }\n // Choose the maximum number of errors to allow for the initial search.\n // This choice involves a tradeoff between:\n //\n // - Recall (proportion of \"good\" matches found)\n // - Precision (proportion of matches found which are \"good\")\n // - Cost of the initial search and of processing the candidate matches [1]\n //\n // [1] Specifically, the expected-time complexity of the initial search is\n // `O((maxErrors / 32) * text.length)`. See `approx-string-match` docs.\n const maxErrors = Math.min(256, quote.length / 2);\n // Find the closest matches for `quote` in `text` based on edit distance.\n const matches = search(text, quote, maxErrors);\n if (matches.length === 0) {\n return null;\n }\n /**\n * Compute a score between 0 and 1.0 for a match candidate.\n */\n const scoreMatch = (match) => {\n const quoteWeight = 50; // Similarity of matched text to quote.\n const prefixWeight = 20; // Similarity of text before matched text to `context.prefix`.\n const suffixWeight = 20; // Similarity of text after matched text to `context.suffix`.\n const posWeight = 2; // Proximity to expected location. Used as a tie-breaker.\n const quoteScore = 1 - match.errors / quote.length;\n const prefixScore = context.prefix\n ? textMatchScore(text.slice(Math.max(0, match.start - context.prefix.length), match.start), context.prefix)\n : 1.0;\n const suffixScore = context.suffix\n ? textMatchScore(text.slice(match.end, match.end + context.suffix.length), context.suffix)\n : 1.0;\n let posScore = 1.0;\n if (typeof context.hint === \"number\") {\n const offset = Math.abs(match.start - context.hint);\n posScore = 1.0 - offset / text.length;\n }\n const rawScore = quoteWeight * quoteScore +\n prefixWeight * prefixScore +\n suffixWeight * suffixScore +\n posWeight * posScore;\n const maxScore = quoteWeight + prefixWeight + suffixWeight + posWeight;\n const normalizedScore = rawScore / maxScore;\n return normalizedScore;\n };\n // Rank matches based on similarity of actual and expected surrounding text\n // and actual/expected offset in the document text.\n const scoredMatches = matches.map((m) => ({\n start: m.start,\n end: m.end,\n score: scoreMatch(m),\n }));\n // Choose match with the highest score.\n scoredMatches.sort((a, b) => b.score - a.score);\n return scoredMatches[0];\n}\n","import { matchQuote } from \"./match-quote\";\nimport { TextRange, TextPosition } from \"./text-range\";\nimport { nodeFromXPath, xpathFromNode } from \"./xpath\";\n/**\n * Converts between `RangeSelector` selectors and `Range` objects.\n */\nexport class RangeAnchor {\n /**\n * @param root - A root element from which to anchor.\n * @param range - A range describing the anchor.\n */\n constructor(root, range) {\n this.root = root;\n this.range = range;\n }\n /**\n * @param root - A root element from which to anchor.\n * @param range - A range describing the anchor.\n */\n static fromRange(root, range) {\n return new RangeAnchor(root, range);\n }\n /**\n * Create an anchor from a serialized `RangeSelector` selector.\n *\n * @param root - A root element from which to anchor.\n */\n static fromSelector(root, selector) {\n const startContainer = nodeFromXPath(selector.startContainer, root);\n if (!startContainer) {\n throw new Error(\"Failed to resolve startContainer XPath\");\n }\n const endContainer = nodeFromXPath(selector.endContainer, root);\n if (!endContainer) {\n throw new Error(\"Failed to resolve endContainer XPath\");\n }\n const startPos = TextPosition.fromCharOffset(startContainer, selector.startOffset);\n const endPos = TextPosition.fromCharOffset(endContainer, selector.endOffset);\n const range = new TextRange(startPos, endPos).toRange();\n return new RangeAnchor(root, range);\n }\n toRange() {\n return this.range;\n }\n toSelector() {\n // \"Shrink\" the range so that it tightly wraps its text. This ensures more\n // predictable output for a given text selection.\n const normalizedRange = TextRange.fromRange(this.range).toRange();\n const textRange = TextRange.fromRange(normalizedRange);\n const startContainer = xpathFromNode(textRange.start.element, this.root);\n const endContainer = xpathFromNode(textRange.end.element, this.root);\n return {\n type: \"RangeSelector\",\n startContainer,\n startOffset: textRange.start.offset,\n endContainer,\n endOffset: textRange.end.offset,\n };\n }\n}\n/**\n * Converts between `TextPositionSelector` selectors and `Range` objects.\n */\nexport class TextPositionAnchor {\n constructor(root, start, end) {\n this.root = root;\n this.start = start;\n this.end = end;\n }\n static fromRange(root, range) {\n const textRange = TextRange.fromRange(range).relativeTo(root);\n return new TextPositionAnchor(root, textRange.start.offset, textRange.end.offset);\n }\n static fromSelector(root, selector) {\n return new TextPositionAnchor(root, selector.start, selector.end);\n }\n toSelector() {\n return {\n type: \"TextPositionSelector\",\n start: this.start,\n end: this.end,\n };\n }\n toRange() {\n return TextRange.fromOffsets(this.root, this.start, this.end).toRange();\n }\n}\n/**\n * Converts between `TextQuoteSelector` selectors and `Range` objects.\n */\nexport class TextQuoteAnchor {\n /**\n * @param root - A root element from which to anchor.\n */\n constructor(root, exact, context = {}) {\n this.root = root;\n this.exact = exact;\n this.context = context;\n }\n /**\n * Create a `TextQuoteAnchor` from a range.\n *\n * Will throw if `range` does not contain any text nodes.\n */\n static fromRange(root, range) {\n const text = root.textContent;\n const textRange = TextRange.fromRange(range).relativeTo(root);\n const start = textRange.start.offset;\n const end = textRange.end.offset;\n // Number of characters around the quote to capture as context. We currently\n // always use a fixed amount, but it would be better if this code was aware\n // of logical boundaries in the document (paragraph, article etc.) to avoid\n // capturing text unrelated to the quote.\n //\n // In regular prose the ideal content would often be the surrounding sentence.\n // This is a natural unit of meaning which enables displaying quotes in\n // context even when the document is not available. We could use `Intl.Segmenter`\n // for this when available.\n const contextLen = 32;\n return new TextQuoteAnchor(root, text.slice(start, end), {\n prefix: text.slice(Math.max(0, start - contextLen), start),\n suffix: text.slice(end, Math.min(text.length, end + contextLen)),\n });\n }\n static fromSelector(root, selector) {\n const { prefix, suffix } = selector;\n return new TextQuoteAnchor(root, selector.exact, { prefix, suffix });\n }\n toSelector() {\n return {\n type: \"TextQuoteSelector\",\n exact: this.exact,\n prefix: this.context.prefix,\n suffix: this.context.suffix,\n };\n }\n toRange(options = {}) {\n return this.toPositionAnchor(options).toRange();\n }\n toPositionAnchor(options = {}) {\n const text = this.root.textContent;\n const match = matchQuote(text, this.exact, Object.assign(Object.assign({}, this.context), { hint: options.hint }));\n if (!match) {\n throw new Error(\"Quote not found\");\n }\n return new TextPositionAnchor(this.root, match.start, match.end);\n }\n}\n/**\n * Parse a string containing a time offset in seconds, since the start of some\n * media, into a float.\n */\nfunction parseMediaTime(timeStr) {\n const val = parseFloat(timeStr);\n if (!Number.isFinite(val) || val < 0) {\n return null;\n }\n return val;\n}\n/** Implementation of {@link Array.prototype.findLastIndex} */\nfunction findLastIndex(ary, pred) {\n for (let i = ary.length - 1; i >= 0; i--) {\n if (pred(ary[i])) {\n return i;\n }\n }\n return -1;\n}\nfunction closestElement(node) {\n return node instanceof Element ? node : node.parentElement;\n}\n/**\n * Get the media time range associated with an element or pair of elements,\n * from `data-time-{start, end}` attributes on them.\n */\nfunction getMediaTimeRange(start, end = start) {\n var _a, _b;\n const startTime = parseMediaTime((_a = start === null || start === void 0 ? void 0 : start.getAttribute(\"data-time-start\")) !== null && _a !== void 0 ? _a : \"\");\n const endTime = parseMediaTime((_b = end === null || end === void 0 ? void 0 : end.getAttribute(\"data-time-end\")) !== null && _b !== void 0 ? _b : \"\");\n if (typeof startTime !== \"number\" ||\n typeof endTime !== \"number\" ||\n endTime < startTime) {\n return null;\n }\n return [startTime, endTime];\n}\nexport class MediaTimeAnchor {\n constructor(root, start, end) {\n this.root = root;\n this.start = start;\n this.end = end;\n }\n /**\n * Return a {@link MediaTimeAnchor} that represents a range, or `null` if\n * no time range information is present on elements in the range.\n */\n static fromRange(root, range) {\n var _a, _b;\n const start = (_a = closestElement(range.startContainer)) === null || _a === void 0 ? void 0 : _a.closest(\"[data-time-start]\");\n const end = (_b = closestElement(range.endContainer)) === null || _b === void 0 ? void 0 : _b.closest(\"[data-time-end]\");\n const timeRange = getMediaTimeRange(start, end);\n if (!timeRange) {\n return null;\n }\n const [startTime, endTime] = timeRange;\n return new MediaTimeAnchor(root, startTime, endTime);\n }\n /**\n * Convert this anchor to a DOM range.\n *\n * This returned range will start from the beginning of the element whose\n * associated time range includes `start` and continue to the end of the\n * element whose associated time range includes `end`.\n */\n toRange() {\n const segments = [...this.root.querySelectorAll(\"[data-time-start]\")]\n .map((element) => {\n const timeRange = getMediaTimeRange(element);\n if (!timeRange) {\n return null;\n }\n const [start, end] = timeRange;\n return { element, start, end };\n })\n .filter((s) => s !== null);\n segments.sort((a, b) => a.start - b.start);\n const startIdx = findLastIndex(segments, (s) => s.start <= this.start && s.end >= this.start);\n if (startIdx === -1) {\n throw new Error(\"Start segment not found\");\n }\n const endIdx = startIdx +\n segments\n .slice(startIdx)\n .findIndex((s) => s.start <= this.end && s.end >= this.end);\n if (endIdx === -1) {\n throw new Error(\"End segment not found\");\n }\n const range = new Range();\n range.setStart(segments[startIdx].element, 0);\n const endEl = segments[endIdx].element;\n range.setEnd(endEl, endEl.childNodes.length);\n return range;\n }\n static fromSelector(root, selector) {\n const { start, end } = selector;\n return new MediaTimeAnchor(root, start, end);\n }\n toSelector() {\n return {\n type: \"MediaTimeSelector\",\n start: this.start,\n end: this.end,\n };\n }\n}\n","import { log } from \"../util/log\";\nimport { getClientRectsNoOverlap, dezoomDomRect, dezoomRect, rectContainsPoint, domRectToRect, } from \"../util/rect\";\nimport { TextQuoteAnchor } from \"../vendor/hypothesis/annotator/anchoring/types\";\nexport class DecorationManager {\n constructor(window) {\n this.styles = new Map();\n this.groups = new Map();\n this.lastGroupId = 0;\n this.window = window;\n // Relayout all the decorations when the document body is resized.\n window.addEventListener(\"load\", () => {\n const body = window.document.body;\n let lastSize = { width: 0, height: 0 };\n const observer = new ResizeObserver(() => {\n requestAnimationFrame(() => {\n if (lastSize.width === body.clientWidth &&\n lastSize.height === body.clientHeight) {\n return;\n }\n lastSize = {\n width: body.clientWidth,\n height: body.clientHeight,\n };\n this.relayoutDecorations();\n });\n });\n observer.observe(body);\n }, false);\n }\n registerTemplates(templates) {\n let stylesheet = \"\";\n for (const [id, template] of templates) {\n this.styles.set(id, template);\n if (template.stylesheet) {\n stylesheet += template.stylesheet + \"\\n\";\n }\n }\n if (stylesheet) {\n const styleElement = document.createElement(\"style\");\n styleElement.innerHTML = stylesheet;\n document.getElementsByTagName(\"head\")[0].appendChild(styleElement);\n }\n }\n addDecoration(decoration, groupName) {\n console.log(`addDecoration ${decoration.id} ${groupName}`);\n const group = this.getGroup(groupName);\n group.add(decoration);\n }\n removeDecoration(id, groupName) {\n console.log(`removeDecoration ${id} ${groupName}`);\n const group = this.getGroup(groupName);\n group.remove(id);\n }\n relayoutDecorations() {\n console.log(\"relayoutDecorations\");\n for (const group of this.groups.values()) {\n group.relayout();\n }\n }\n getGroup(name) {\n let group = this.groups.get(name);\n if (!group) {\n const id = \"readium-decoration-\" + this.lastGroupId++;\n group = new DecorationGroup(id, name, this.styles);\n this.groups.set(name, group);\n }\n return group;\n }\n /**\n * Handles click events on a Decoration.\n * Returns whether a decoration matched this event.\n */\n handleDecorationClickEvent(event) {\n if (this.groups.size === 0) {\n return null;\n }\n const findTarget = () => {\n for (const [group, groupContent] of this.groups) {\n for (const item of groupContent.items.reverse()) {\n if (!item.clickableElements) {\n continue;\n }\n for (const element of item.clickableElements) {\n const rect = domRectToRect(element.getBoundingClientRect());\n if (rectContainsPoint(rect, event.clientX, event.clientY, 1)) {\n return { group, item, element };\n }\n }\n }\n }\n };\n const target = findTarget();\n if (!target) {\n return null;\n }\n return {\n id: target.item.decoration.id,\n group: target.group,\n rect: domRectToRect(target.item.range.getBoundingClientRect()),\n event: event,\n };\n }\n}\nclass DecorationGroup {\n constructor(id, name, styles) {\n this.items = [];\n this.lastItemId = 0;\n this.container = null;\n this.groupId = id;\n this.groupName = name;\n this.styles = styles;\n }\n add(decoration) {\n const id = this.groupId + \"-\" + this.lastItemId++;\n const range = rangeFromDecorationTarget(decoration.cssSelector, decoration.textQuote);\n if (!range) {\n log(\"Can't locate DOM range for decoration\", decoration);\n return;\n }\n const item = {\n id,\n decoration,\n range,\n container: null,\n clickableElements: null,\n };\n this.items.push(item);\n this.layout(item);\n }\n remove(id) {\n const index = this.items.findIndex((it) => it.decoration.id === id);\n if (index === -1) {\n return;\n }\n const item = this.items[index];\n this.items.splice(index, 1);\n item.clickableElements = null;\n if (item.container) {\n item.container.remove();\n item.container = null;\n }\n }\n relayout() {\n this.clearContainer();\n for (const item of this.items) {\n this.layout(item);\n }\n }\n /**\n * Returns the group container element, after making sure it exists.\n */\n requireContainer() {\n if (!this.container) {\n this.container = document.createElement(\"div\");\n this.container.id = this.groupId;\n this.container.dataset.group = this.groupName;\n this.container.style.pointerEvents = \"none\";\n document.body.append(this.container);\n }\n return this.container;\n }\n /**\n * Removes the group container.\n */\n clearContainer() {\n if (this.container) {\n this.container.remove();\n this.container = null;\n }\n }\n /**\n * Layouts a single Decoration item.\n */\n layout(item) {\n const groupContainer = this.requireContainer();\n const unsafeStyle = this.styles.get(item.decoration.style);\n if (!unsafeStyle) {\n console.log(`Unknown decoration style: ${item.decoration.style}`);\n return;\n }\n const style = unsafeStyle;\n const itemContainer = document.createElement(\"div\");\n itemContainer.id = item.id;\n itemContainer.dataset.style = item.decoration.style;\n itemContainer.style.pointerEvents = \"none\";\n const documentWritingMode = getDocumentWritingMode();\n const isVertical = documentWritingMode === \"vertical-rl\" ||\n documentWritingMode === \"vertical-lr\";\n const zoom = groupContainer.currentCSSZoom;\n const scrollingElement = document.scrollingElement;\n const xOffset = scrollingElement.scrollLeft / zoom;\n const yOffset = scrollingElement.scrollTop / zoom;\n const viewportWidth = isVertical ? window.innerHeight : window.innerWidth;\n const viewportHeight = isVertical ? window.innerWidth : window.innerHeight;\n const columnCount = parseInt(getComputedStyle(document.documentElement).getPropertyValue(\"column-count\")) || 1;\n const pageSize = (isVertical ? viewportHeight : viewportWidth) / columnCount;\n function positionElement(element, rect, boundingRect, writingMode) {\n element.style.position = \"absolute\";\n const isVerticalRL = writingMode === \"vertical-rl\";\n const isVerticalLR = writingMode === \"vertical-lr\";\n if (isVerticalRL || isVerticalLR) {\n if (style.width === \"wrap\") {\n element.style.width = `${rect.width}px`;\n element.style.height = `${rect.height}px`;\n if (isVerticalRL) {\n element.style.right = `${-rect.right - xOffset + scrollingElement.clientWidth}px`;\n }\n else {\n // vertical-lr\n element.style.left = `${rect.left + xOffset}px`;\n }\n element.style.top = `${rect.top + yOffset}px`;\n }\n else if (style.width === \"viewport\") {\n element.style.width = `${rect.height}px`;\n element.style.height = `${viewportWidth}px`;\n const top = Math.floor(rect.top / viewportWidth) * viewportWidth;\n if (isVerticalRL) {\n element.style.right = `${-rect.right - xOffset}px`;\n }\n else {\n // vertical-lr\n element.style.left = `${rect.left + xOffset}px`;\n }\n element.style.top = `${top + yOffset}px`;\n }\n else if (style.width === \"bounds\") {\n element.style.width = `${boundingRect.height}px`;\n element.style.height = `${viewportWidth}px`;\n if (isVerticalRL) {\n element.style.right = `${-boundingRect.right - xOffset + scrollingElement.clientWidth}px`;\n }\n else {\n // vertical-lr\n element.style.left = `${boundingRect.left + xOffset}px`;\n }\n element.style.top = `${boundingRect.top + yOffset}px`;\n }\n else if (style.width === \"page\") {\n element.style.width = `${rect.height}px`;\n element.style.height = `${pageSize}px`;\n const top = Math.floor(rect.top / pageSize) * pageSize;\n if (isVerticalRL) {\n element.style.right = `${-rect.right - xOffset + scrollingElement.clientWidth}px`;\n }\n else {\n // vertical-lr\n element.style.left = `${rect.left + xOffset}px`;\n }\n element.style.top = `${top + yOffset}px`;\n }\n }\n else {\n if (style.width === \"wrap\") {\n element.style.width = `${rect.width}px`;\n element.style.height = `${rect.height}px`;\n element.style.left = `${rect.left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n }\n else if (style.width === \"viewport\") {\n element.style.width = `${viewportWidth}px`;\n element.style.height = `${rect.height}px`;\n const left = Math.floor(rect.left / viewportWidth) * viewportWidth;\n element.style.left = `${left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n }\n else if (style.width === \"bounds\") {\n element.style.width = `${boundingRect.width}px`;\n element.style.height = `${rect.height}px`;\n element.style.left = `${boundingRect.left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n }\n else if (style.width === \"page\") {\n element.style.width = `${pageSize}px`;\n element.style.height = `${rect.height}px`;\n const left = Math.floor(rect.left / pageSize) * pageSize;\n element.style.left = `${left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n }\n }\n }\n const rawBoundingRect = item.range.getBoundingClientRect();\n const boundingRect = dezoomDomRect(rawBoundingRect, zoom);\n let elementTemplate;\n try {\n const template = document.createElement(\"template\");\n template.innerHTML = item.decoration.element.trim();\n elementTemplate = template.content.firstElementChild;\n }\n catch (error) {\n let message;\n if (\"message\" in error) {\n message = error.message;\n }\n else {\n message = null;\n }\n console.log(`Invalid decoration element \"${item.decoration.element}\": ${message}`);\n return;\n }\n if (style.layout === \"boxes\") {\n const doNotMergeHorizontallyAlignedRects = !documentWritingMode.startsWith(\"vertical\");\n const startElement = getContainingElement(item.range.startContainer);\n // Decorated text may have a different writingMode from document body\n const decoratorWritingMode = getComputedStyle(startElement).writingMode;\n const clientRects = getClientRectsNoOverlap(item.range, doNotMergeHorizontallyAlignedRects)\n .map((rect) => {\n return dezoomRect(rect, zoom);\n })\n .sort((r1, r2) => {\n if (r1.top !== r2.top)\n return r1.top - r2.top;\n if (decoratorWritingMode === \"vertical-rl\") {\n return r2.left - r1.left;\n }\n else if (decoratorWritingMode === \"vertical-lr\") {\n return r1.left - r2.left;\n }\n else {\n return r1.left - r2.left;\n }\n });\n for (const clientRect of clientRects) {\n const line = elementTemplate.cloneNode(true);\n line.style.pointerEvents = \"none\";\n line.dataset.writingMode = decoratorWritingMode;\n positionElement(line, clientRect, boundingRect, documentWritingMode);\n itemContainer.append(line);\n }\n }\n else if (style.layout === \"bounds\") {\n const bounds = elementTemplate.cloneNode(true);\n bounds.style.pointerEvents = \"none\";\n bounds.dataset.writingMode = documentWritingMode;\n positionElement(bounds, boundingRect, boundingRect, documentWritingMode);\n itemContainer.append(bounds);\n }\n groupContainer.append(itemContainer);\n item.container = itemContainer;\n item.clickableElements = Array.from(itemContainer.querySelectorAll(\"[data-activable='1']\"));\n if (item.clickableElements.length === 0) {\n item.clickableElements = Array.from(itemContainer.children);\n }\n }\n}\n/**\n * Returns the document body's writing mode.\n */\nfunction getDocumentWritingMode() {\n return getComputedStyle(document.body).writingMode;\n}\n/**\n * Returns the closest element ancestor of the given node.\n */\nfunction getContainingElement(node) {\n return node.nodeType === Node.ELEMENT_NODE ? node : node.parentElement;\n}\n/*\n * Compute DOM range from decoration target.\n */\nexport function rangeFromDecorationTarget(cssSelector, textQuote) {\n let root;\n if (cssSelector) {\n try {\n root = document.querySelector(cssSelector);\n }\n catch (e) {\n log(e);\n }\n }\n if (!root && !textQuote) {\n return null;\n }\n else if (!root) {\n root = document.body;\n }\n if (textQuote) {\n const anchor = new TextQuoteAnchor(root, textQuote.quotedText, {\n prefix: textQuote.textBefore,\n suffix: textQuote.textAfter,\n });\n return anchor.toRange();\n }\n else {\n const range = document.createRange();\n range.setStartBefore(root);\n range.setEndAfter(root);\n return range;\n }\n}\n","export class GesturesDetector {\n constructor(window, listener, decorationManager) {\n this.window = window;\n this.listener = listener;\n this.decorationManager = decorationManager;\n document.addEventListener(\"click\", (event) => {\n this.onClick(event);\n }, false);\n }\n onClick(event) {\n if (event.defaultPrevented) {\n return;\n }\n const selection = this.window.getSelection();\n if (selection && selection.type == \"Range\") {\n // There's an on-going selection, the tap will dismiss it so we don't forward it.\n // selection.type might be None (collapsed) or Caret with a collapsed range\n // when there is not true selection.\n return;\n }\n let nearestElement;\n if (event.target instanceof HTMLElement) {\n nearestElement = this.nearestInteractiveElement(event.target);\n }\n else {\n nearestElement = null;\n }\n if (nearestElement) {\n if (nearestElement instanceof HTMLAnchorElement) {\n this.listener.onLinkActivated(nearestElement.href, nearestElement.outerHTML);\n event.stopPropagation();\n event.preventDefault();\n }\n else {\n return;\n }\n }\n let decorationActivatedEvent;\n if (this.decorationManager) {\n decorationActivatedEvent =\n this.decorationManager.handleDecorationClickEvent(event);\n }\n else {\n decorationActivatedEvent = null;\n }\n if (decorationActivatedEvent) {\n this.listener.onDecorationActivated(decorationActivatedEvent);\n }\n else {\n this.listener.onTap(event);\n }\n // event.stopPropagation()\n // event.preventDefault()\n }\n // See. https://github.com/JayPanoz/architecture/tree/touch-handling/misc/touch-handling\n nearestInteractiveElement(element) {\n if (element == null) {\n return null;\n }\n const interactiveTags = [\n \"a\",\n \"audio\",\n \"button\",\n \"canvas\",\n \"details\",\n \"input\",\n \"label\",\n \"option\",\n \"select\",\n \"submit\",\n \"textarea\",\n \"video\",\n ];\n if (interactiveTags.indexOf(element.nodeName.toLowerCase()) != -1) {\n return element;\n }\n // Checks whether the element is editable by the user.\n if (element.hasAttribute(\"contenteditable\") &&\n element.getAttribute(\"contenteditable\").toLowerCase() != \"false\") {\n return element;\n }\n // Checks parents recursively because the touch might be for example on an inside a .\n if (element.parentElement) {\n return this.nearestInteractiveElement(element.parentElement);\n }\n return null;\n }\n}\n","//\n// Copyright 2021 Readium Foundation. All rights reserved.\n// Use of this source code is governed by the BSD-style license\n// available in the top-level LICENSE file of the project.\n//\nimport { dezoomRect, domRectToRect } from \"../util/rect\";\nimport { log } from \"../util/log\";\nimport { TextRange } from \"../vendor/hypothesis/annotator/anchoring/text-range\";\n// Polyfill for Android API 26\nimport matchAll from \"string.prototype.matchall\";\nimport { rectToParentCoordinates } from \"./geometry\";\nmatchAll.shim();\nexport function selectionToParentCoordinates(selection, iframe) {\n const boundingRect = iframe.getBoundingClientRect();\n const shiftedRect = rectToParentCoordinates(selection.selectionRect, boundingRect);\n return {\n selectedText: selection === null || selection === void 0 ? void 0 : selection.selectedText,\n selectionRect: shiftedRect,\n textBefore: selection.textBefore,\n textAfter: selection.textAfter,\n };\n}\nexport class SelectionManager {\n constructor(window) {\n this.isSelecting = false;\n //, listener: SelectionListener) {\n this.window = window;\n /*this.listener = listener\n document.addEventListener(\n \"selectionchange\",\n () => {\n const selection = window.getSelection()!\n const collapsed = selection.isCollapsed\n \n if (collapsed && this.isSelecting) {\n this.isSelecting = false\n this.listener.onSelectionEnd()\n } else if (!collapsed && !this.isSelecting) {\n this.isSelecting = true\n this.listener.onSelectionStart()\n }\n },\n false\n )*/\n }\n clearSelection() {\n var _a;\n (_a = this.window.getSelection()) === null || _a === void 0 ? void 0 : _a.removeAllRanges();\n }\n getCurrentSelection() {\n const text = this.getCurrentSelectionText();\n if (!text) {\n return null;\n }\n const rect = this.getSelectionRect();\n return {\n selectedText: text.highlight,\n textBefore: text.before,\n textAfter: text.after,\n selectionRect: rect,\n };\n }\n getSelectionRect() {\n try {\n const selection = this.window.getSelection();\n const range = selection.getRangeAt(0);\n const zoom = this.window.document.body.currentCSSZoom;\n return dezoomRect(domRectToRect(range.getBoundingClientRect()), zoom);\n }\n catch (e) {\n log(e);\n throw e;\n //return null\n }\n }\n getCurrentSelectionText() {\n const selection = this.window.getSelection();\n if (selection.isCollapsed) {\n return undefined;\n }\n const highlight = selection.toString();\n const cleanHighlight = highlight\n .trim()\n .replace(/\\n/g, \" \")\n .replace(/\\s\\s+/g, \" \");\n if (cleanHighlight.length === 0) {\n return undefined;\n }\n if (!selection.anchorNode || !selection.focusNode) {\n return undefined;\n }\n const range = selection.rangeCount === 1\n ? selection.getRangeAt(0)\n : createOrderedRange(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);\n if (!range || range.collapsed) {\n log(\"$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!\");\n return undefined;\n }\n const text = document.body.textContent;\n const textRange = TextRange.fromRange(range).relativeTo(document.body);\n const start = textRange.start.offset;\n const end = textRange.end.offset;\n const snippetLength = 200;\n // Compute the text before the highlight, ignoring the first \"word\", which might be cut.\n let before = text.slice(Math.max(0, start - snippetLength), start);\n const firstWordStart = before.search(/\\P{L}\\p{L}/gu);\n if (firstWordStart !== -1) {\n before = before.slice(firstWordStart + 1);\n }\n // Compute the text after the highlight, ignoring the last \"word\", which might be cut.\n let after = text.slice(end, Math.min(text.length, end + snippetLength));\n const lastWordEnd = Array.from(after.matchAll(/\\p{L}\\P{L}/gu)).pop();\n if (lastWordEnd !== undefined && lastWordEnd.index > 1) {\n after = after.slice(0, lastWordEnd.index + 1);\n }\n return { highlight, before, after };\n }\n}\nfunction createOrderedRange(startNode, startOffset, endNode, endOffset) {\n const range = new Range();\n range.setStart(startNode, startOffset);\n range.setEnd(endNode, endOffset);\n if (!range.collapsed) {\n return range;\n }\n log(\">>> createOrderedRange COLLAPSED ... RANGE REVERSE?\");\n const rangeReverse = new Range();\n rangeReverse.setStart(endNode, endOffset);\n rangeReverse.setEnd(startNode, startOffset);\n if (!rangeReverse.collapsed) {\n log(\">>> createOrderedRange RANGE REVERSE OK.\");\n return range;\n }\n log(\">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!\");\n return undefined;\n}\n/*\nexport function convertRangeInfo(document: Document, rangeInfo) {\n const startElement = document.querySelector(\n rangeInfo.startContainerElementCssSelector\n );\n if (!startElement) {\n log(\"^^^ convertRangeInfo NO START ELEMENT CSS SELECTOR?!\");\n return undefined;\n }\n let startContainer = startElement;\n if (rangeInfo.startContainerChildTextNodeIndex >= 0) {\n if (\n rangeInfo.startContainerChildTextNodeIndex >=\n startElement.childNodes.length\n ) {\n log(\n \"^^^ convertRangeInfo rangeInfo.startContainerChildTextNodeIndex >= startElement.childNodes.length?!\"\n );\n return undefined;\n }\n startContainer =\n startElement.childNodes[rangeInfo.startContainerChildTextNodeIndex];\n if (startContainer.nodeType !== Node.TEXT_NODE) {\n log(\"^^^ convertRangeInfo startContainer.nodeType !== Node.TEXT_NODE?!\");\n return undefined;\n }\n }\n const endElement = document.querySelector(\n rangeInfo.endContainerElementCssSelector\n );\n if (!endElement) {\n log(\"^^^ convertRangeInfo NO END ELEMENT CSS SELECTOR?!\");\n return undefined;\n }\n let endContainer = endElement;\n if (rangeInfo.endContainerChildTextNodeIndex >= 0) {\n if (\n rangeInfo.endContainerChildTextNodeIndex >= endElement.childNodes.length\n ) {\n log(\n \"^^^ convertRangeInfo rangeInfo.endContainerChildTextNodeIndex >= endElement.childNodes.length?!\"\n );\n return undefined;\n }\n endContainer =\n endElement.childNodes[rangeInfo.endContainerChildTextNodeIndex];\n if (endContainer.nodeType !== Node.TEXT_NODE) {\n log(\"^^^ convertRangeInfo endContainer.nodeType !== Node.TEXT_NODE?!\");\n return undefined;\n }\n }\n return createOrderedRange(\n startContainer,\n rangeInfo.startOffset,\n endContainer,\n rangeInfo.endOffset\n );\n}\n\nexport function location2RangeInfo(location) {\n const locations = location.locations;\n const domRange = locations.domRange;\n const start = domRange.start;\n const end = domRange.end;\n\n return {\n endContainerChildTextNodeIndex: end.textNodeIndex,\n endContainerElementCssSelector: end.cssSelector,\n endOffset: end.offset,\n startContainerChildTextNodeIndex: start.textNodeIndex,\n startContainerElementCssSelector: start.cssSelector,\n startOffset: start.offset,\n };\n}\n*/\n","import { DecorationWrapperParentSide } from \"../fixed/decoration-wrapper\";\nexport class ReflowableDecorationsBridge {\n constructor(window, manager) {\n this.window = window;\n this.manager = manager;\n }\n registerTemplates(templates) {\n const templatesAsMap = parseTemplates(templates);\n this.manager.registerTemplates(templatesAsMap);\n }\n addDecoration(decoration, group) {\n const actualDecoration = parseDecoration(decoration);\n this.manager.addDecoration(actualDecoration, group);\n }\n removeDecoration(id, group) {\n this.manager.removeDecoration(id, group);\n }\n}\nexport class FixedSingleDecorationsBridge {\n constructor() {\n this.wrapper = new DecorationWrapperParentSide();\n }\n setMessagePort(messagePort) {\n this.wrapper.setMessagePort(messagePort);\n }\n registerTemplates(templates) {\n const actualTemplates = parseTemplates(templates);\n this.wrapper.registerTemplates(actualTemplates);\n }\n addDecoration(decoration, group) {\n const actualDecoration = parseDecoration(decoration);\n this.wrapper.addDecoration(actualDecoration, group);\n }\n removeDecoration(id, group) {\n this.wrapper.removeDecoration(id, group);\n }\n}\nexport class FixedDoubleDecorationsBridge {\n constructor() {\n this.leftWrapper = new DecorationWrapperParentSide();\n this.rightWrapper = new DecorationWrapperParentSide();\n }\n setLeftMessagePort(messagePort) {\n this.leftWrapper.setMessagePort(messagePort);\n }\n setRightMessagePort(messagePort) {\n this.rightWrapper.setMessagePort(messagePort);\n }\n registerTemplates(templates) {\n const actualTemplates = parseTemplates(templates);\n this.leftWrapper.registerTemplates(actualTemplates);\n this.rightWrapper.registerTemplates(actualTemplates);\n }\n addDecoration(decoration, iframe, group) {\n const actualDecoration = parseDecoration(decoration);\n switch (iframe) {\n case \"left\":\n this.leftWrapper.addDecoration(actualDecoration, group);\n break;\n case \"right\":\n this.rightWrapper.addDecoration(actualDecoration, group);\n break;\n default:\n throw Error(`Unknown iframe type: ${iframe}`);\n }\n }\n removeDecoration(id, group) {\n this.leftWrapper.removeDecoration(id, group);\n this.rightWrapper.removeDecoration(id, group);\n }\n}\nfunction parseTemplates(templates) {\n return new Map(Object.entries(JSON.parse(templates)));\n}\nfunction parseDecoration(decoration) {\n const jsonDecoration = JSON.parse(decoration);\n return jsonDecoration;\n}\n","export class ReflowableListenerAdapter {\n constructor(gesturesBridge) {\n this.gesturesBridge = gesturesBridge;\n }\n onTap(event) {\n const tapEvent = {\n x: (event.clientX - visualViewport.offsetLeft) * visualViewport.scale,\n y: (event.clientY - visualViewport.offsetTop) * visualViewport.scale,\n };\n const stringEvent = JSON.stringify(tapEvent);\n this.gesturesBridge.onTap(stringEvent);\n }\n onLinkActivated(href, outerHtml) {\n this.gesturesBridge.onLinkActivated(href, outerHtml);\n }\n onDecorationActivated(event) {\n const offset = {\n x: (event.event.clientX - visualViewport.offsetLeft) *\n visualViewport.scale,\n y: (event.event.clientY - visualViewport.offsetTop) *\n visualViewport.scale,\n };\n const stringOffset = JSON.stringify(offset);\n const stringRect = JSON.stringify(event.rect);\n this.gesturesBridge.onDecorationActivated(event.id, event.group, stringRect, stringOffset);\n }\n}\nexport class FixedListenerAdapter {\n constructor(window, gesturesApi, documentApi) {\n this.window = window;\n this.gesturesApi = gesturesApi;\n this.documentApi = documentApi;\n this.resizeObserverAdded = false;\n this.documentLoadedFired = false;\n }\n onTap(event) {\n this.gesturesApi.onTap(JSON.stringify(event.offset));\n }\n onLinkActivated(href, outerHtml) {\n this.gesturesApi.onLinkActivated(href, outerHtml);\n }\n onDecorationActivated(event) {\n const stringOffset = JSON.stringify(event.offset);\n const stringRect = JSON.stringify(event.rect);\n this.gesturesApi.onDecorationActivated(event.id, event.group, stringRect, stringOffset);\n }\n onLayout() {\n if (!this.resizeObserverAdded) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const observer = new ResizeObserver(() => {\n requestAnimationFrame(() => {\n const scrollingElement = this.window.document.scrollingElement;\n if (!this.documentLoadedFired &&\n (scrollingElement == null ||\n scrollingElement.scrollHeight > 0 ||\n scrollingElement.scrollWidth > 0)) {\n this.documentApi.onDocumentLoadedAndSized();\n this.documentLoadedFired = true;\n }\n else {\n this.documentApi.onDocumentResized();\n }\n });\n });\n observer.observe(this.window.document.body);\n }\n this.resizeObserverAdded = true;\n }\n}\n","import { selectionToParentCoordinates, } from \"../common/selection\";\nimport { SelectionWrapperParentSide } from \"../fixed/selection-wrapper\";\nexport class ReflowableSelectionBridge {\n constructor(window, manager) {\n this.window = window;\n this.manager = manager;\n }\n getCurrentSelection() {\n return this.manager.getCurrentSelection();\n }\n clearSelection() {\n this.manager.clearSelection();\n }\n}\nexport class FixedSingleSelectionBridge {\n constructor(listener) {\n this.listener = listener;\n const wrapperListener = {\n onSelectionAvailable: (requestId, selection) => {\n const selectionAsJson = JSON.stringify(selection);\n this.listener.onSelectionAvailable(requestId, selectionAsJson);\n },\n };\n this.wrapper = new SelectionWrapperParentSide(wrapperListener);\n }\n setMessagePort(messagePort) {\n this.wrapper.setMessagePort(messagePort);\n }\n requestSelection(requestId) {\n this.wrapper.requestSelection(requestId);\n }\n clearSelection() {\n this.wrapper.clearSelection();\n }\n}\nexport class FixedDoubleSelectionBridge {\n constructor(leftIframe, rightIframe, listener) {\n this.requestStates = new Map();\n this.isLeftInitialized = false;\n this.isRightInitialized = false;\n this.leftIframe = leftIframe;\n this.rightIframe = rightIframe;\n this.listener = listener;\n const leftWrapperListener = {\n onSelectionAvailable: (requestId, selection) => {\n if (selection) {\n const resolvedSelection = selectionToParentCoordinates(selection, this.leftIframe);\n this.onSelectionAvailable(requestId, \"left\", resolvedSelection);\n }\n else {\n this.onSelectionAvailable(requestId, \"left\", selection);\n }\n },\n };\n this.leftWrapper = new SelectionWrapperParentSide(leftWrapperListener);\n const rightWrapperListener = {\n onSelectionAvailable: (requestId, selection) => {\n if (selection) {\n const resolvedSelection = selectionToParentCoordinates(selection, this.rightIframe);\n this.onSelectionAvailable(requestId, \"right\", resolvedSelection);\n }\n else {\n this.onSelectionAvailable(requestId, \"right\", selection);\n }\n },\n };\n this.rightWrapper = new SelectionWrapperParentSide(rightWrapperListener);\n }\n setLeftMessagePort(messagePort) {\n this.leftWrapper.setMessagePort(messagePort);\n this.isLeftInitialized = true;\n }\n setRightMessagePort(messagePort) {\n this.rightWrapper.setMessagePort(messagePort);\n this.isRightInitialized = true;\n }\n requestSelection(requestId) {\n if (this.isLeftInitialized && this.isRightInitialized) {\n this.requestStates.set(requestId, \"pending\");\n this.leftWrapper.requestSelection(requestId);\n this.rightWrapper.requestSelection(requestId);\n }\n else if (this.isLeftInitialized) {\n this.requestStates.set(requestId, \"firstResponseWasNull\");\n this.leftWrapper.requestSelection(requestId);\n }\n else if (this.isRightInitialized) {\n this.requestStates.set(requestId, \"firstResponseWasNull\");\n this.rightWrapper.requestSelection(requestId);\n }\n else {\n this.requestStates.set(requestId, \"firstResponseWasNull\");\n this.onSelectionAvailable(requestId, \"left\", null);\n }\n }\n clearSelection() {\n this.leftWrapper.clearSelection();\n this.rightWrapper.clearSelection();\n }\n onSelectionAvailable(requestId, iframe, selection) {\n const requestState = this.requestStates.get(requestId);\n if (!requestState) {\n return;\n }\n if (!selection && requestState === \"pending\") {\n this.requestStates.set(requestId, \"firstResponseWasNull\");\n return;\n }\n this.requestStates.delete(requestId);\n const selectionAsJson = JSON.stringify(selection);\n this.listener.onSelectionAvailable(requestId, iframe, selectionAsJson);\n }\n}\n","export class CssBridge {\n constructor(document) {\n this.document = document;\n }\n setProperties(properties) {\n for (const [key, value] of properties) {\n this.setProperty(key, value);\n }\n }\n // For setting user setting.\n setProperty(key, value) {\n if (value === null || value === \"\") {\n this.removeProperty(key);\n }\n else {\n const root = document.documentElement;\n // The `!important` annotation is added with `setProperty()` because if it's part of the\n // `value`, it will be ignored by the Web View.\n root.style.setProperty(key, value, \"important\");\n }\n }\n // For removing user setting.\n removeProperty(key) {\n const root = document.documentElement;\n root.style.removeProperty(key);\n }\n}\n","//\n// Copyright 2024 Readium Foundation. All rights reserved.\n// Use of this source code is governed by the BSD-style license\n// available in the top-level LICENSE file of the project.\n//\nimport { ReflowableInitializationBridge as ReflowableInitializer, } from \"./bridge/reflowable-initialization-bridge\";\nimport { appendVirtualColumnIfNeeded } from \"./util/columns\";\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nwindow.addEventListener(\"load\", (event) => {\n let documentLoadedFired = false;\n const observer = new ResizeObserver(() => {\n let colCountFixed = false;\n requestAnimationFrame(() => {\n const scrollingElement = window.document.scrollingElement;\n const scrollingElementEmpty = scrollingElement == null ||\n (scrollingElement.scrollHeight == 0 &&\n scrollingElement.scrollWidth == 0);\n if (!documentLoadedFired && scrollingElementEmpty) {\n // Document is not sized yet\n return;\n }\n if (!colCountFixed && !scrollingElementEmpty) {\n const colChanged = appendVirtualColumnIfNeeded(window);\n colCountFixed = true;\n if (colChanged) {\n // Column number has changed, wait for next resize callback.\n return;\n }\n }\n colCountFixed = false;\n if (!documentLoadedFired) {\n window.documentState.onDocumentLoadedAndSized();\n documentLoadedFired = true;\n }\n else {\n window.documentState.onDocumentResized();\n }\n });\n });\n observer.observe(document.body);\n});\nnew ReflowableInitializer(window, window.reflowableApiState);\n","/**\n * In paginated mode, the width of each resource must be a multiple of the viewport size\n * for proper snapping. This may not be automatically the case if the number of\n * columns in the resource is not a multiple of the number of columns displayed in the viewport.\n * To fix this, we insert a blank virtual column at the end of the resource.\n *\n * Returns if the column number has changed.\n */\nexport function appendVirtualColumnIfNeeded(wnd) {\n const colCountPerScreen = getColumnCountPerScreen(wnd);\n if (!colCountPerScreen) {\n // scroll mode\n return false;\n }\n const virtualCols = wnd.document.querySelectorAll(\"div[id^='readium-virtual-page']\");\n const virtualColsCount = virtualCols.length;\n // Remove first so that we don’t end up with an incorrect scrollWidth\n // Even when removing their width we risk having an incorrect scrollWidth\n // so removing them entirely is the most robust solution\n for (const virtualCol of virtualCols) {\n virtualCol.remove();\n }\n const documentWidth = wnd.document.scrollingElement.scrollWidth;\n const windowWidth = wnd.visualViewport.width;\n const totalColCount = Math.round((documentWidth / windowWidth) * colCountPerScreen);\n const lonelyColCount = totalColCount % colCountPerScreen;\n const needed = colCountPerScreen === 1 || lonelyColCount === 0\n ? 0\n : colCountPerScreen - lonelyColCount;\n if (needed > 0) {\n for (let i = 0; i < needed; i++) {\n const virtualCol = wnd.document.createElement(\"div\");\n virtualCol.setAttribute(\"id\", `readium-virtual-page-${i}`);\n virtualCol.dataset.readium = \"true\";\n virtualCol.style.breakBefore = \"column\";\n virtualCol.innerHTML = \"​\"; // zero-width space\n wnd.document.body.appendChild(virtualCol);\n }\n }\n return virtualColsCount != needed;\n}\nfunction getColumnCountPerScreen(wnd) {\n return parseInt(wnd\n .getComputedStyle(wnd.document.documentElement)\n .getPropertyValue(\"column-count\"));\n}\n","import { DecorationManager } from \"../common/decoration\";\nimport { GesturesDetector } from \"../common/gestures\";\nimport { SelectionManager } from \"../common/selection\";\nimport { ReflowableDecorationsBridge } from \"./all-decoration-bridge\";\nimport { ReflowableListenerAdapter } from \"./all-listener-bridge\";\nimport { ReflowableSelectionBridge } from \"./all-selection-bridge\";\nimport { CssBridge } from \"./reflowable-css-bridge\";\nexport class ReflowableInitializationBridge {\n constructor(window, listener) {\n this.window = window;\n this.listener = listener;\n this.setupViewport();\n this.initApis();\n }\n initApis() {\n const bridgeListener = new ReflowableListenerAdapter(window.gestures);\n const decorationManager = new DecorationManager(window);\n this.window.readiumcss = new CssBridge(window.document);\n this.listener.onCssApiAvailable();\n this.window.selection = new ReflowableSelectionBridge(window, new SelectionManager(window));\n this.listener.onSelectionApiAvailable();\n this.window.decorations = new ReflowableDecorationsBridge(window, decorationManager);\n this.listener.onDecorationApiAvailable();\n new GesturesDetector(window, bridgeListener, decorationManager);\n }\n // Setups the `viewport` meta tag to disable overview.\n setupViewport() {\n this.window.document.addEventListener(\"DOMContentLoaded\", () => {\n const meta = document.createElement(\"meta\");\n meta.setAttribute(\"name\", \"viewport\");\n meta.setAttribute(\"content\", \"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no\");\n this.window.document.head.appendChild(meta);\n });\n }\n}\n"],"names":["reverse","s","split","join","oneIfNotZero","n","advanceBlock","ctx","peq","b","hIn","pV","P","mV","M","hInIsNegative","eq","xV","xH","pH","mH","hOut","lastRowMask","findMatchEnds","text","pattern","maxErrors","length","Math","min","matches","w","bMax","ceil","Uint32Array","fill","emptyPeq","Map","asciiPeq","i","push","c","val","charCodeAt","has","charPeq","set","r","idx","y","max","score","j","charCode","get","carry","maxBlockScore","splice","start","end","errors","exports","patRev","map","m","minStart","slice","reduce","rm","findMatchStarts","GetIntrinsic","callBind","$indexOf","module","name","allowMissing","intrinsic","bind","$apply","$call","$reflectApply","call","$gOPD","$defineProperty","$max","value","e","originalFunction","func","arguments","configurable","applyBind","apply","hasPropertyDescriptors","$SyntaxError","$TypeError","gopd","obj","property","nonEnumerable","nonWritable","nonConfigurable","loose","desc","enumerable","writable","keys","hasSymbols","Symbol","toStr","Object","prototype","toString","concat","Array","defineDataProperty","supportsDescriptors","defineProperty","object","predicate","fn","defineProperties","predicates","props","getOwnPropertySymbols","hasToStringTag","toStringTag","overrideIfSet","force","iterator","isPrimitive","isCallable","isDate","isSymbol","input","exoticToPrim","hint","String","Number","toPrimitive","O","TypeError","GetMethod","valueOf","result","method","methodNames","ordinaryToPrimitive","that","target","this","bound","args","boundLength","boundArgs","Function","Empty","implementation","functionsHaveNames","gOPD","getOwnPropertyDescriptor","functionsHaveConfigurableNames","$bind","boundFunctionsHaveNames","undefined","SyntaxError","$Function","getEvalledConstructor","expressionSyntax","throwTypeError","ThrowTypeError","calleeThrows","gOPDthrows","hasProto","getProto","getPrototypeOf","x","__proto__","needsEval","TypedArray","Uint8Array","INTRINSICS","AggregateError","ArrayBuffer","Atomics","BigInt","BigInt64Array","BigUint64Array","Boolean","DataView","Date","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","Error","eval","EvalError","Float32Array","Float64Array","FinalizationRegistry","Int8Array","Int16Array","Int32Array","isFinite","isNaN","JSON","parseFloat","parseInt","Promise","Proxy","RangeError","ReferenceError","Reflect","RegExp","Set","SharedArrayBuffer","Uint8ClampedArray","Uint16Array","URIError","WeakMap","WeakRef","WeakSet","error","errorProto","doEval","gen","LEGACY_ALIASES","hasOwn","$concat","$spliceApply","$replace","replace","$strSlice","$exec","exec","rePropName","reEscapeChar","getBaseIntrinsic","alias","intrinsicName","parts","string","first","last","match","number","quote","subString","stringToPath","intrinsicBaseName","intrinsicRealName","skipFurtherCaching","isOwn","part","hasArrayLengthDefineBug","test","foo","$Object","origSymbol","hasSymbolSham","sym","symObj","getOwnPropertyNames","syms","propertyIsEnumerable","descriptor","hasOwnProperty","channel","SLOT","assert","slot","slots","V","freeze","badArrayLike","isCallableMarker","fnToStr","reflectApply","_","constructorRegex","isES6ClassFn","fnStr","tryFunctionObject","isIE68","isDDA","document","all","str","strClass","getDay","tryDateObject","isRegexMarker","badStringifier","callBound","throwRegexMarker","$toString","symToStr","symStringRegex","isSymbolObject","hasMap","mapSizeDescriptor","mapSize","mapForEach","forEach","hasSet","setSizeDescriptor","setSize","setForEach","weakMapHas","weakSetHas","weakRefDeref","deref","booleanValueOf","objectToString","functionToString","$match","$slice","$toUpperCase","toUpperCase","$toLowerCase","toLowerCase","$test","$join","$arrSlice","$floor","floor","bigIntValueOf","gOPS","symToString","hasShammedSymbols","isEnumerable","gPO","addNumericSeparator","num","Infinity","sepRegex","int","intStr","dec","utilInspect","inspectCustom","custom","inspectSymbol","wrapQuotes","defaultStyle","opts","quoteChar","quoteStyle","isArray","isRegExp","inspect_","options","depth","seen","maxStringLength","customInspect","indent","numericSeparator","inspectString","bigIntStr","maxDepth","baseIndent","base","prev","getIndent","indexOf","inspect","from","noIndent","newOpts","f","nameOf","arrObjKeys","symString","markBoxed","HTMLElement","nodeName","getAttribute","attrs","attributes","childNodes","xs","singleLineValues","indentedJoin","isError","cause","isMap","mapParts","key","collectionOf","isSet","setParts","isWeakMap","weakCollectionOf","isWeakSet","isWeakRef","isNumber","isBigInt","isBoolean","isString","ys","isPlainObject","constructor","protoTag","stringTag","tag","l","remaining","trailer","lowbyte","type","size","entries","lineJoiner","isArr","symMap","k","keysShim","isArgs","hasDontEnumBug","hasProtoEnumBug","dontEnums","equalsConstructorPrototype","o","ctor","excludedKeys","$applicationCache","$console","$external","$frame","$frameElement","$frames","$innerHeight","$innerWidth","$onmozfullscreenchange","$onmozfullscreenerror","$outerHeight","$outerWidth","$pageXOffset","$pageYOffset","$parent","$scrollLeft","$scrollTop","$scrollX","$scrollY","$self","$webkitIndexedDB","$webkitStorageInfo","$window","hasAutomationEqualityBug","window","isObject","isFunction","isArguments","theKeys","skipProto","skipConstructor","equalsConstructorPrototypeIfNotBuggy","origKeys","originalKeys","shim","keysWorksWithArguments","callee","setFunctionName","hasIndices","global","ignoreCase","multiline","dotAll","unicode","unicodeSets","sticky","define","getPolyfill","flagsBound","flags","calls","TypeErr","regex","polyfill","proto","isRegex","hasDescriptors","$WeakMap","$Map","$weakMapGet","$weakMapSet","$weakMapHas","$mapGet","$mapSet","$mapHas","listGetNode","list","curr","next","$wm","$m","$o","objects","node","listGet","listHas","listSet","Call","Get","IsRegExp","ToString","RequireObjectCoercible","flagsGetter","regexpMatchAllPolyfill","getMatcher","regexp","matcherPolyfill","matchAll","matcher","S","rx","boundMatchAll","regexpMatchAll","CreateRegExpStringIterator","SpeciesConstructor","ToLength","Type","OrigRegExp","supportsConstructingWithFlags","regexMatchAll","R","tmp","C","source","constructRegexWithFlags","lastIndex","fullUnicode","defineP","symbol","mvsIsWS","leftWhitespace","rightWhitespace","boundMethod","receiver","trim","CodePointAt","isInteger","MAX_SAFE_INTEGER","index","IsArray","F","argumentsList","isLeadingSurrogate","isTrailingSurrogate","UTF16SurrogatePairToCodePoint","$charAt","$charCodeAt","position","cp","firstIsLeading","firstIsTrailing","second","done","DefineOwnProperty","FromPropertyDescriptor","IsDataDescriptor","IsPropertyKey","SameValue","IteratorPrototype","AdvanceStringIndex","CreateIterResultObject","CreateMethodProperty","OrdinaryObjectCreate","RegExpExec","setToStringTag","RegExpStringIterator","thisIndex","nextIndex","isPropertyDescriptor","IsAccessorDescriptor","ToPropertyDescriptor","Desc","assertRecord","fromPropertyDescriptor","GetV","IsCallable","$construct","DefinePropertyOrThrow","isConstructorMarker","argument","err","hasRegExpMatcher","ToBoolean","$ObjectCreate","additionalInternalSlotsList","T","regexExec","$isNaN","noThrowOnStrictViolation","Throw","$species","IsConstructor","defaultConstructor","$Number","$RegExp","$parseInteger","regexTester","isBinary","isOctal","isInvalidHexLiteral","hasNonWS","$trim","StringToNumber","NaN","trimmed","ToNumber","truncate","$isFinite","ToIntegerOrInfinity","len","ToPrimitive","Obj","getter","setter","$String","ES5Type","$fromCharCode","lead","trail","optMessage","$isEnumerable","$Array","allowed","isData","IsAccessor","then","recordType","argumentName","array","callback","$abs","absValue","record","a","ES","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","__esModule","d","definition","prop","debug","log","console","dezoomRect","rect","zoomLevel","bottom","height","left","right","top","width","domRectToRect","getClientRectsNoOverlap","range","doNotMergeHorizontallyAlignedRects","clientRects","getClientRects","originalRects","rangeClientRect","newRects","replaceOverlapingRects","rects","tolerance","rectsToKeep","possiblyContainingRect","rectContains","delete","removeContainedRects","mergeTouchingRects","rect1","rect2","rectsLineUpVertically","almostEqual","rectsLineUpHorizontally","rectsTouchOrOverlap","filter","replacementClientRect","getBoundingRect","rectContainsPoint","toRemove","toAdd","subtractRects1","rectSubtract","subtractRects2","rectIntersected","maxLeft","minRight","maxTop","minBottom","rectIntersect","rectA","rectB","rectC","rectD","abs","TrimDirection","ResolveDirection","search","matchPos","exactMatches","textMatchScore","closestNonSpaceInString","baseOffset","direction","nextChar","Forwards","charAt","availableChars","availableNonWhitespaceChars","Backwards","substring","trimEnd","trimStart","offsetDelta","closestNonSpaceInRange","nodeIter","commonAncestorContainer","ownerDocument","createNodeIterator","NodeFilter","SHOW_TEXT","initialBoundaryNode","startContainer","endContainer","terminalBoundaryNode","currentNode","nextNode","previousNode","trimmedOffset","advance","nodeText","textContent","offset","nodeTextLength","_a","_b","nodeType","Node","ELEMENT_NODE","TEXT_NODE","previousSiblingsTextLength","sibling","previousSibling","resolveOffsets","element","offsets","nextOffset","shift","results","textNode","data","relativeTo","parent","contains","el","parentElement","resolve","tw","createTreeWalker","getRootNode","forwards","FORWARDS","fromCharOffset","fromPoint","textOffset","toRange","BACKWARDS","Range","setStart","setEnd","fromRange","startOffset","endOffset","fromOffsets","root","trimmedRange","cloneRange","startTrimmed","endTrimmed","trimmedOffsets","trimRange","TextPositionAnchor","textRange","fromSelector","selector","toSelector","TextQuoteAnchor","exact","context","prefix","suffix","toPositionAnchor","scoreMatch","quoteScore","prefixScore","suffixScore","posScore","quoteWeight","scoredMatches","sort","matchQuote","assign","DecorationManager","styles","groups","lastGroupId","addEventListener","body","lastSize","ResizeObserver","requestAnimationFrame","clientWidth","clientHeight","relayoutDecorations","observe","registerTemplates","templates","stylesheet","id","template","styleElement","createElement","innerHTML","getElementsByTagName","appendChild","addDecoration","decoration","groupName","getGroup","add","removeDecoration","remove","group","values","relayout","DecorationGroup","handleDecorationClickEvent","event","groupContent","item","items","clickableElements","getBoundingClientRect","clientX","clientY","findTarget","lastItemId","container","groupId","cssSelector","textQuote","querySelector","quotedText","textBefore","textAfter","createRange","setStartBefore","setEndAfter","rangeFromDecorationTarget","layout","findIndex","it","clearContainer","requireContainer","dataset","style","pointerEvents","append","groupContainer","unsafeStyle","itemContainer","documentWritingMode","getComputedStyle","writingMode","isVertical","zoom","currentCSSZoom","scrollingElement","xOffset","scrollLeft","yOffset","scrollTop","viewportWidth","innerHeight","innerWidth","viewportHeight","columnCount","documentElement","getPropertyValue","pageSize","positionElement","boundingRect","isVerticalRL","DOMRect","elementTemplate","content","firstElementChild","message","startsWith","startElement","decoratorWritingMode","r1","r2","clientRect","line","cloneNode","bounds","querySelectorAll","children","GesturesDetector","listener","decorationManager","onClick","defaultPrevented","selection","getSelection","nearestElement","decorationActivatedEvent","nearestInteractiveElement","HTMLAnchorElement","onLinkActivated","href","outerHTML","stopPropagation","preventDefault","onDecorationActivated","onTap","hasAttribute","SelectionManager","isSelecting","clearSelection","removeAllRanges","getCurrentSelection","getCurrentSelectionText","getSelectionRect","selectedText","highlight","before","after","selectionRect","getRangeAt","isCollapsed","anchorNode","focusNode","rangeCount","startNode","endNode","collapsed","rangeReverse","createOrderedRange","anchorOffset","focusOffset","firstWordStart","lastWordEnd","pop","ReflowableDecorationsBridge","manager","templatesAsMap","parse","parseTemplates","actualDecoration","parseDecoration","ReflowableListenerAdapter","gesturesBridge","tapEvent","visualViewport","offsetLeft","scale","offsetTop","stringEvent","stringify","outerHtml","stringOffset","stringRect","ReflowableSelectionBridge","CssBridge","setProperties","properties","setProperty","removeProperty","documentLoadedFired","colCountFixed","scrollingElementEmpty","scrollHeight","scrollWidth","colChanged","wnd","colCountPerScreen","getColumnCountPerScreen","virtualCols","virtualColsCount","virtualCol","documentWidth","windowWidth","lonelyColCount","round","needed","setAttribute","readium","breakBefore","appendVirtualColumnIfNeeded","documentState","onDocumentResized","onDocumentLoadedAndSized","setupViewport","initApis","bridgeListener","gestures","readiumcss","onCssApiAvailable","onSelectionApiAvailable","decorations","onDecorationApiAvailable","meta","head","reflowableApiState"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"reflowable-injectable-script.js","mappings":"mDAmCA,SAASA,EAAQC,GACb,OAAOA,EACFC,MAAM,IACNF,UACAG,KAAK,GACd,CAwCA,SAASC,EAAaC,GAClB,OAASA,GAAKA,IAAM,GAAM,CAC9B,CAaA,SAASC,EAAaC,EAAKC,EAAKC,EAAGC,GAC/B,IAAIC,EAAKJ,EAAIK,EAAEH,GACXI,EAAKN,EAAIO,EAAEL,GACXM,EAAgBL,IAAQ,GACxBM,EAAKR,EAAIC,GAAKM,EAEdE,EAAKD,EAAKH,EACVK,GAAQF,EAAKL,GAAMA,EAAMA,EAAMK,EAC/BG,EAAKN,IAAOK,EAAKP,GACjBS,EAAKT,EAAKO,EAEVG,EAAOjB,EAAae,EAAKZ,EAAIe,YAAYb,IACzCL,EAAagB,EAAKb,EAAIe,YAAYb,IAUtC,OARAU,IAAO,EACPC,IAAO,EAGPT,GAFAS,GAAML,KAEME,GADZE,GAAMf,EAAaM,GAAOK,IAE1BF,EAAKM,EAAKF,EACVV,EAAIK,EAAEH,GAAKE,EACXJ,EAAIO,EAAEL,GAAKI,EACJQ,CACX,CASA,SAASE,EAAcC,EAAMC,EAASC,GAClC,GAAuB,IAAnBD,EAAQE,OACR,MAAO,GAIXD,EAAYE,KAAKC,IAAIH,EAAWD,EAAQE,QACxC,IAAIG,EAAU,GAE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a,IAAInD,EAAU7hB,OAAOrK,UAC9CxI,KAAKqwB,SAASyH,oBACd93B,KAAK6S,OAAO2f,UAAY,IAAIiC,EAA0B5hB,OAAQ,IAAI+e,EAAiB/e,SACnF7S,KAAKqwB,SAAS0H,0BACd/3B,KAAK6S,OAAOmlB,YAAc,IAAI3E,EAA4BxgB,OAAQyd,GAClEtwB,KAAKqwB,SAAS4H,2BACd,IAAI7H,EAAiBvd,OAAQ6kB,EAAgBpH,GAC7C,IAAIe,EAAkBxe,OAAQ6kB,EAClC,CAEA,aAAAJ,GACIt3B,KAAK6S,OAAOrK,SAASohB,iBAAiB,oBAAoB,KACtD,MAAMsO,EAAO1vB,SAASmiB,cAAc,QACpCuN,EAAKnB,aAAa,OAAQ,YAC1BmB,EAAKnB,aAAa,UAAW,gGAC7B/2B,KAAK6S,OAAOrK,SAAS2vB,KAAKrN,YAAYoN,EAAK,GAEnD,GFIsBrlB,OAAQA,OAAOulB,mB","sources":["webpack://readium-js/./node_modules/.pnpm/approx-string-match@1.1.0/node_modules/approx-string-match/dist/index.js","webpack://readium-js/./node_modules/.pnpm/call-bind@1.0.2/node_modules/call-bind/callBound.js","webpack://readium-js/./node_modules/.pnpm/call-bind@1.0.2/node_modules/call-bind/index.js","webpack://readium-js/./node_modules/.pnpm/define-data-property@1.1.0/node_modules/define-data-property/index.js","webpack://readium-js/./node_modules/.pnpm/define-properties@1.2.1/node_modules/define-properties/index.js","webpack://readium-js/./node_modules/.pnpm/es-set-tostringtag@2.0.1/node_modules/es-set-tostringtag/index.js","webpack://readium-js/./node_modules/.pnpm/es-to-primitive@1.2.1/node_modules/es-to-primitive/es2015.js","webpack://readium-js/./node_modules/.pnpm/es-to-primitive@1.2.1/node_modules/es-to-primitive/helpers/isPrimitive.js","webpack://readium-js/./node_modules/.pnpm/function-bind@1.1.1/node_modules/function-bind/implementation.js","webpack://readium-js/./node_modules/.pnpm/function-bind@1.1.1/node_modules/function-bind/index.js","webpack://readium-js/./node_modules/.pnpm/functions-have-names@1.2.3/node_modules/functions-have-names/index.js","webpack://readium-js/./node_modules/.pnpm/get-intrinsic@1.2.1/node_modules/get-intrinsic/index.js","webpack://readium-js/./node_modules/.pnpm/gopd@1.0.1/node_modules/gopd/index.js","webpack://readium-js/./node_modules/.pnpm/has-property-descriptors@1.0.0/node_modules/has-property-descriptors/index.js","webpack://readium-js/./node_modules/.pnpm/has-proto@1.0.1/node_modules/has-proto/index.js","webpack://readium-js/./node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/index.js","webpack://readium-js/./node_modules/.pnpm/has-symbols@1.0.3/node_modules/has-symbols/shams.js","webpack://readium-js/./node_modules/.pnpm/has-tostringtag@1.0.0/node_modules/has-tostringtag/shams.js","webpack://readium-js/./node_modules/.pnpm/has@1.0.4/node_modules/has/src/index.js","webpack://readium-js/./node_modules/.pnpm/internal-slot@1.0.5/node_modules/internal-slot/index.js","webpack://readium-js/./node_modules/.pnpm/is-callable@1.2.7/node_modules/is-callable/index.js","webpack://readium-js/./node_modules/.pnpm/is-date-object@1.0.5/node_modules/is-date-object/index.js","webpack://readium-js/./node_modules/.pnpm/is-regex@1.1.4/node_modules/is-regex/index.js","webpack://readium-js/./node_modules/.pnpm/is-symbol@1.0.4/node_modules/is-symbol/index.js","webpack://readium-js/./node_modules/.pnpm/object-inspect@1.12.3/node_modules/object-inspect/index.js","webpack://readium-js/./node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/implementation.js","webpack://readium-js/./node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/index.js","webpack://readium-js/./node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/isArguments.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/implementation.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/index.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/polyfill.js","webpack://readium-js/./node_modules/.pnpm/regexp.prototype.flags@1.5.1/node_modules/regexp.prototype.flags/shim.js","webpack://readium-js/./node_modules/.pnpm/safe-regex-test@1.0.0/node_modules/safe-regex-test/index.js","webpack://readium-js/./node_modules/.pnpm/set-function-name@2.0.1/node_modules/set-function-name/index.js","webpack://readium-js/./node_modules/.pnpm/side-channel@1.0.4/node_modules/side-channel/index.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/implementation.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/index.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/polyfill-regexp-matchall.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/polyfill.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/regexp-matchall.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.matchall@4.0.10/node_modules/string.prototype.matchall/shim.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/implementation.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/index.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/polyfill.js","webpack://readium-js/./node_modules/.pnpm/string.prototype.trim@1.2.8/node_modules/string.prototype.trim/shim.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/AdvanceStringIndex.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Call.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CodePointAt.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CreateIterResultObject.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CreateMethodProperty.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/CreateRegExpStringIterator.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/DefinePropertyOrThrow.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/FromPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Get.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/GetMethod.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/GetV.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsAccessorDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsArray.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsCallable.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsConstructor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsDataDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsPropertyKey.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/IsRegExp.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/OrdinaryObjectCreate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/RegExpExec.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/RequireObjectCoercible.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/SameValue.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Set.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/SpeciesConstructor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/StringToNumber.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToBoolean.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToIntegerOrInfinity.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToLength.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToNumber.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToPrimitive.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/ToString.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/Type.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/UTF16SurrogatePairToCodePoint.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/floor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/2023/truncate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/5/CheckObjectCoercible.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/5/Type.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/GetIntrinsic.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/DefineOwnProperty.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/IsArray.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/assertRecord.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/forEach.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/fromPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isFinite.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isInteger.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isLeadingSurrogate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isMatchRecord.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isNaN.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isPrimitive.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isPropertyDescriptor.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/isTrailingSurrogate.js","webpack://readium-js/./node_modules/.pnpm/es-abstract@1.22.2/node_modules/es-abstract/helpers/maxSafeInteger.js","webpack://readium-js/webpack/bootstrap","webpack://readium-js/webpack/runtime/compat get default export","webpack://readium-js/webpack/runtime/define property getters","webpack://readium-js/webpack/runtime/hasOwnProperty shorthand","webpack://readium-js/./src/util/log.ts","webpack://readium-js/./src/util/rect.ts","webpack://readium-js/./src/vendor/hypothesis/annotator/anchoring/trim-range.ts","webpack://readium-js/./src/vendor/hypothesis/annotator/anchoring/text-range.ts","webpack://readium-js/./src/vendor/hypothesis/annotator/anchoring/match-quote.ts","webpack://readium-js/./src/vendor/hypothesis/annotator/anchoring/types.ts","webpack://readium-js/./src/common/decoration.ts","webpack://readium-js/./src/common/gestures.ts","webpack://readium-js/./src/common/selection.ts","webpack://readium-js/./src/bridge/all-decoration-bridge.ts","webpack://readium-js/./src/bridge/all-listener-bridge.ts","webpack://readium-js/./src/bridge/all-selection-bridge.ts","webpack://readium-js/./src/bridge/reflowable-css-bridge.ts","webpack://readium-js/./src/bridge/reflowable-move-bridge.ts","webpack://readium-js/./src/index-reflowable-injectable.ts","webpack://readium-js/./src/util/columns.ts","webpack://readium-js/./src/bridge/reflowable-initialization-bridge.ts"],"sourcesContent":["\"use strict\";\n/**\n * Implementation of Myers' online approximate string matching algorithm [1],\n * with additional optimizations suggested by [2].\n *\n * This has O((k/w) * n) complexity where `n` is the length of the text, `k` is\n * the maximum number of errors allowed (always <= the pattern length) and `w`\n * is the word size. Because JS only supports bitwise operations on 32 bit\n * integers, `w` is 32.\n *\n * As far as I am aware, there aren't any online algorithms which are\n * significantly better for a wide range of input parameters. The problem can be\n * solved faster using \"filter then verify\" approaches which first filter out\n * regions of the text that cannot match using a \"cheap\" check and then verify\n * the remaining potential matches. The verify step requires an algorithm such\n * as this one however.\n *\n * The algorithm's approach is essentially to optimize the classic dynamic\n * programming solution to the problem by computing columns of the matrix in\n * word-sized chunks (ie. dealing with 32 chars of the pattern at a time) and\n * avoiding calculating regions of the matrix where the minimum error count is\n * guaranteed to exceed the input threshold.\n *\n * The paper consists of two parts, the first describes the core algorithm for\n * matching patterns <= the size of a word (implemented by `advanceBlock` here).\n * The second uses the core algorithm as part of a larger block-based algorithm\n * to handle longer patterns.\n *\n * [1] G. Myers, “A Fast Bit-Vector Algorithm for Approximate String Matching\n * Based on Dynamic Programming,” vol. 46, no. 3, pp. 395–415, 1999.\n *\n * [2] Šošić, M. (2014). An simd dynamic programming c/c++ library (Doctoral\n * dissertation, Fakultet Elektrotehnike i računarstva, Sveučilište u Zagrebu).\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction reverse(s) {\n return s\n .split(\"\")\n .reverse()\n .join(\"\");\n}\n/**\n * Given the ends of approximate matches for `pattern` in `text`, find\n * the start of the matches.\n *\n * @param findEndFn - Function for finding the end of matches in\n * text.\n * @return Matches with the `start` property set.\n */\nfunction findMatchStarts(text, pattern, matches) {\n var patRev = reverse(pattern);\n return matches.map(function (m) {\n // Find start of each match by reversing the pattern and matching segment\n // of text and searching for an approx match with the same number of\n // errors.\n var minStart = Math.max(0, m.end - pattern.length - m.errors);\n var textRev = reverse(text.slice(minStart, m.end));\n // If there are multiple possible start points, choose the one that\n // maximizes the length of the match.\n var start = findMatchEnds(textRev, patRev, m.errors).reduce(function (min, rm) {\n if (m.end - rm.end < min) {\n return m.end - rm.end;\n }\n return min;\n }, m.end);\n return {\n start: start,\n end: m.end,\n errors: m.errors\n };\n });\n}\n/**\n * Return 1 if a number is non-zero or zero otherwise, without using\n * conditional operators.\n *\n * This should get inlined into `advanceBlock` below by the JIT.\n *\n * Adapted from https://stackoverflow.com/a/3912218/434243\n */\nfunction oneIfNotZero(n) {\n return ((n | -n) >> 31) & 1;\n}\n/**\n * Block calculation step of the algorithm.\n *\n * From Fig 8. on p. 408 of [1], additionally optimized to replace conditional\n * checks with bitwise operations as per Section 4.2.3 of [2].\n *\n * @param ctx - The pattern context object\n * @param peq - The `peq` array for the current character (`ctx.peq.get(ch)`)\n * @param b - The block level\n * @param hIn - Horizontal input delta ∈ {1,0,-1}\n * @return Horizontal output delta ∈ {1,0,-1}\n */\nfunction advanceBlock(ctx, peq, b, hIn) {\n var pV = ctx.P[b];\n var mV = ctx.M[b];\n var hInIsNegative = hIn >>> 31; // 1 if hIn < 0 or 0 otherwise.\n var eq = peq[b] | hInIsNegative;\n // Step 1: Compute horizontal deltas.\n var xV = eq | mV;\n var xH = (((eq & pV) + pV) ^ pV) | eq;\n var pH = mV | ~(xH | pV);\n var mH = pV & xH;\n // Step 2: Update score (value of last row of this block).\n var hOut = oneIfNotZero(pH & ctx.lastRowMask[b]) -\n oneIfNotZero(mH & ctx.lastRowMask[b]);\n // Step 3: Update vertical deltas for use when processing next char.\n pH <<= 1;\n mH <<= 1;\n mH |= hInIsNegative;\n pH |= oneIfNotZero(hIn) - hInIsNegative; // set pH[0] if hIn > 0\n pV = mH | ~(xV | pH);\n mV = pH & xV;\n ctx.P[b] = pV;\n ctx.M[b] = mV;\n return hOut;\n}\n/**\n * Find the ends and error counts for matches of `pattern` in `text`.\n *\n * Only the matches with the lowest error count are reported. Other matches\n * with error counts <= maxErrors are discarded.\n *\n * This is the block-based search algorithm from Fig. 9 on p.410 of [1].\n */\nfunction findMatchEnds(text, pattern, maxErrors) {\n if (pattern.length === 0) {\n return [];\n }\n // Clamp error count so we can rely on the `maxErrors` and `pattern.length`\n // rows being in the same block below.\n maxErrors = Math.min(maxErrors, pattern.length);\n var matches = [];\n // Word size.\n var w = 32;\n // Index of maximum block level.\n var bMax = Math.ceil(pattern.length / w) - 1;\n // Context used across block calculations.\n var ctx = {\n P: new Uint32Array(bMax + 1),\n M: new Uint32Array(bMax + 1),\n lastRowMask: new Uint32Array(bMax + 1)\n };\n ctx.lastRowMask.fill(1 << 31);\n ctx.lastRowMask[bMax] = 1 << (pattern.length - 1) % w;\n // Dummy \"peq\" array for chars in the text which do not occur in the pattern.\n var emptyPeq = new Uint32Array(bMax + 1);\n // Map of UTF-16 character code to bit vector indicating positions in the\n // pattern that equal that character.\n var peq = new Map();\n // Version of `peq` that only stores mappings for small characters. This\n // allows faster lookups when iterating through the text because a simple\n // array lookup can be done instead of a hash table lookup.\n var asciiPeq = [];\n for (var i = 0; i < 256; i++) {\n asciiPeq.push(emptyPeq);\n }\n // Calculate `ctx.peq` - a map of character values to bitmasks indicating\n // positions of that character within the pattern, where each bit represents\n // a position in the pattern.\n for (var c = 0; c < pattern.length; c += 1) {\n var val = pattern.charCodeAt(c);\n if (peq.has(val)) {\n // Duplicate char in pattern.\n continue;\n }\n var charPeq = new Uint32Array(bMax + 1);\n peq.set(val, charPeq);\n if (val < asciiPeq.length) {\n asciiPeq[val] = charPeq;\n }\n for (var b = 0; b <= bMax; b += 1) {\n charPeq[b] = 0;\n // Set all the bits where the pattern matches the current char (ch).\n // For indexes beyond the end of the pattern, always set the bit as if the\n // pattern contained a wildcard char in that position.\n for (var r = 0; r < w; r += 1) {\n var idx = b * w + r;\n if (idx >= pattern.length) {\n continue;\n }\n var match = pattern.charCodeAt(idx) === val;\n if (match) {\n charPeq[b] |= 1 << r;\n }\n }\n }\n }\n // Index of last-active block level in the column.\n var y = Math.max(0, Math.ceil(maxErrors / w) - 1);\n // Initialize maximum error count at bottom of each block.\n var score = new Uint32Array(bMax + 1);\n for (var b = 0; b <= y; b += 1) {\n score[b] = (b + 1) * w;\n }\n score[bMax] = pattern.length;\n // Initialize vertical deltas for each block.\n for (var b = 0; b <= y; b += 1) {\n ctx.P[b] = ~0;\n ctx.M[b] = 0;\n }\n // Process each char of the text, computing the error count for `w` chars of\n // the pattern at a time.\n for (var j = 0; j < text.length; j += 1) {\n // Lookup the bitmask representing the positions of the current char from\n // the text within the pattern.\n var charCode = text.charCodeAt(j);\n var charPeq = void 0;\n if (charCode < asciiPeq.length) {\n // Fast array lookup.\n charPeq = asciiPeq[charCode];\n }\n else {\n // Slower hash table lookup.\n charPeq = peq.get(charCode);\n if (typeof charPeq === \"undefined\") {\n charPeq = emptyPeq;\n }\n }\n // Calculate error count for blocks that we definitely have to process for\n // this column.\n var carry = 0;\n for (var b = 0; b <= y; b += 1) {\n carry = advanceBlock(ctx, charPeq, b, carry);\n score[b] += carry;\n }\n // Check if we also need to compute an additional block, or if we can reduce\n // the number of blocks processed for the next column.\n if (score[y] - carry <= maxErrors &&\n y < bMax &&\n (charPeq[y + 1] & 1 || carry < 0)) {\n // Error count for bottom block is under threshold, increase the number of\n // blocks processed for this column & next by 1.\n y += 1;\n ctx.P[y] = ~0;\n ctx.M[y] = 0;\n var maxBlockScore = y === bMax ? pattern.length % w : w;\n score[y] =\n score[y - 1] +\n maxBlockScore -\n carry +\n advanceBlock(ctx, charPeq, y, carry);\n }\n else {\n // Error count for bottom block exceeds threshold, reduce the number of\n // blocks processed for the next column.\n while (y > 0 && score[y] >= maxErrors + w) {\n y -= 1;\n }\n }\n // If error count is under threshold, report a match.\n if (y === bMax && score[y] <= maxErrors) {\n if (score[y] < maxErrors) {\n // Discard any earlier, worse matches.\n matches.splice(0, matches.length);\n }\n matches.push({\n start: -1,\n end: j + 1,\n errors: score[y]\n });\n // Because `search` only reports the matches with the lowest error count,\n // we can \"ratchet down\" the max error threshold whenever a match is\n // encountered and thereby save a small amount of work for the remainder\n // of the text.\n maxErrors = score[y];\n }\n }\n return matches;\n}\n/**\n * Search for matches for `pattern` in `text` allowing up to `maxErrors` errors.\n *\n * Returns the start, and end positions and error counts for each lowest-cost\n * match. Only the \"best\" matches are returned.\n */\nfunction search(text, pattern, maxErrors) {\n var matches = findMatchEnds(text, pattern, maxErrors);\n return findMatchStarts(text, pattern, matches);\n}\nexports.default = search;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBind = require('./');\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\nvar $max = GetIntrinsic('%Math.max%');\n\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = null;\n\t}\n}\n\nmodule.exports = function callBind(originalFunction) {\n\tvar func = $reflectApply(bind, $call, arguments);\n\tif ($gOPD && $defineProperty) {\n\t\tvar desc = $gOPD(func, 'length');\n\t\tif (desc.configurable) {\n\t\t\t// original length, plus the receiver, minus any additional arguments (after the receiver)\n\t\t\t$defineProperty(\n\t\t\t\tfunc,\n\t\t\t\t'length',\n\t\t\t\t{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }\n\t\t\t);\n\t\t}\n\t}\n\treturn func;\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","'use strict';\n\nvar hasPropertyDescriptors = require('has-property-descriptors')();\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = hasPropertyDescriptors && GetIntrinsic('%Object.defineProperty%', true);\n\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar gopd = require('gopd');\n\n/** @type {(obj: Record, property: PropertyKey, value: unknown, nonEnumerable?: boolean | null, nonWritable?: boolean | null, nonConfigurable?: boolean | null, loose?: boolean) => void} */\nmodule.exports = function defineDataProperty(\n\tobj,\n\tproperty,\n\tvalue\n) {\n\tif (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n\t\tthrow new $TypeError('`obj` must be an object or a function`');\n\t}\n\tif (typeof property !== 'string' && typeof property !== 'symbol') {\n\t\tthrow new $TypeError('`property` must be a string or a symbol`');\n\t}\n\tif (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {\n\t\tthrow new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {\n\t\tthrow new $TypeError('`nonWritable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {\n\t\tthrow new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 6 && typeof arguments[6] !== 'boolean') {\n\t\tthrow new $TypeError('`loose`, if provided, must be a boolean');\n\t}\n\n\tvar nonEnumerable = arguments.length > 3 ? arguments[3] : null;\n\tvar nonWritable = arguments.length > 4 ? arguments[4] : null;\n\tvar nonConfigurable = arguments.length > 5 ? arguments[5] : null;\n\tvar loose = arguments.length > 6 ? arguments[6] : false;\n\n\t/* @type {false | TypedPropertyDescriptor} */\n\tvar desc = !!gopd && gopd(obj, property);\n\n\tif ($defineProperty) {\n\t\t$defineProperty(obj, property, {\n\t\t\tconfigurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,\n\t\t\tenumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,\n\t\t\tvalue: value,\n\t\t\twritable: nonWritable === null && desc ? desc.writable : !nonWritable\n\t\t});\n\t} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {\n\t\t// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable\n\t\tobj[property] = value; // eslint-disable-line no-param-reassign\n\t} else {\n\t\tthrow new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');\n\t}\n};\n","'use strict';\n\nvar keys = require('object-keys');\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';\n\nvar toStr = Object.prototype.toString;\nvar concat = Array.prototype.concat;\nvar defineDataProperty = require('define-data-property');\n\nvar isFunction = function (fn) {\n\treturn typeof fn === 'function' && toStr.call(fn) === '[object Function]';\n};\n\nvar supportsDescriptors = require('has-property-descriptors')();\n\nvar defineProperty = function (object, name, value, predicate) {\n\tif (name in object) {\n\t\tif (predicate === true) {\n\t\t\tif (object[name] === value) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (!isFunction(predicate) || !predicate()) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif (supportsDescriptors) {\n\t\tdefineDataProperty(object, name, value, true);\n\t} else {\n\t\tdefineDataProperty(object, name, value);\n\t}\n};\n\nvar defineProperties = function (object, map) {\n\tvar predicates = arguments.length > 2 ? arguments[2] : {};\n\tvar props = keys(map);\n\tif (hasSymbols) {\n\t\tprops = concat.call(props, Object.getOwnPropertySymbols(map));\n\t}\n\tfor (var i = 0; i < props.length; i += 1) {\n\t\tdefineProperty(object, props[i], map[props[i]], predicates[props[i]]);\n\t}\n};\n\ndefineProperties.supportsDescriptors = !!supportsDescriptors;\n\nmodule.exports = defineProperties;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar has = require('has');\n\nvar toStringTag = hasToStringTag ? Symbol.toStringTag : null;\n\nmodule.exports = function setToStringTag(object, value) {\n\tvar overrideIfSet = arguments.length > 2 && arguments[2] && arguments[2].force;\n\tif (toStringTag && (overrideIfSet || !has(object, toStringTag))) {\n\t\tif ($defineProperty) {\n\t\t\t$defineProperty(object, toStringTag, {\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: false,\n\t\t\t\tvalue: value,\n\t\t\t\twritable: false\n\t\t\t});\n\t\t} else {\n\t\t\tobject[toStringTag] = value; // eslint-disable-line no-param-reassign\n\t\t}\n\t}\n};\n","'use strict';\n\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';\n\nvar isPrimitive = require('./helpers/isPrimitive');\nvar isCallable = require('is-callable');\nvar isDate = require('is-date-object');\nvar isSymbol = require('is-symbol');\n\nvar ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) {\n\tif (typeof O === 'undefined' || O === null) {\n\t\tthrow new TypeError('Cannot call method on ' + O);\n\t}\n\tif (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) {\n\t\tthrow new TypeError('hint must be \"string\" or \"number\"');\n\t}\n\tvar methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString'];\n\tvar method, result, i;\n\tfor (i = 0; i < methodNames.length; ++i) {\n\t\tmethod = O[methodNames[i]];\n\t\tif (isCallable(method)) {\n\t\t\tresult = method.call(O);\n\t\t\tif (isPrimitive(result)) {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t}\n\t}\n\tthrow new TypeError('No default value');\n};\n\nvar GetMethod = function GetMethod(O, P) {\n\tvar func = O[P];\n\tif (func !== null && typeof func !== 'undefined') {\n\t\tif (!isCallable(func)) {\n\t\t\tthrow new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function');\n\t\t}\n\t\treturn func;\n\t}\n\treturn void 0;\n};\n\n// http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive\nmodule.exports = function ToPrimitive(input) {\n\tif (isPrimitive(input)) {\n\t\treturn input;\n\t}\n\tvar hint = 'default';\n\tif (arguments.length > 1) {\n\t\tif (arguments[1] === String) {\n\t\t\thint = 'string';\n\t\t} else if (arguments[1] === Number) {\n\t\t\thint = 'number';\n\t\t}\n\t}\n\n\tvar exoticToPrim;\n\tif (hasSymbols) {\n\t\tif (Symbol.toPrimitive) {\n\t\t\texoticToPrim = GetMethod(input, Symbol.toPrimitive);\n\t\t} else if (isSymbol(input)) {\n\t\t\texoticToPrim = Symbol.prototype.valueOf;\n\t\t}\n\t}\n\tif (typeof exoticToPrim !== 'undefined') {\n\t\tvar result = exoticToPrim.call(input, hint);\n\t\tif (isPrimitive(result)) {\n\t\t\treturn result;\n\t\t}\n\t\tthrow new TypeError('unable to convert exotic object to primitive');\n\t}\n\tif (hint === 'default' && (isDate(input) || isSymbol(input))) {\n\t\thint = 'string';\n\t}\n\treturn ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint);\n};\n","'use strict';\n\nmodule.exports = function isPrimitive(value) {\n\treturn value === null || (typeof value !== 'function' && typeof value !== 'object');\n};\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slice.call(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n args.concat(slice.call(arguments))\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n } else {\n return target.apply(\n that,\n args.concat(slice.call(arguments))\n );\n }\n };\n\n var boundLength = Math.max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs.push('$' + i);\n }\n\n bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\nvar functionsHaveNames = function functionsHaveNames() {\n\treturn typeof function f() {}.name === 'string';\n};\n\nvar gOPD = Object.getOwnPropertyDescriptor;\nif (gOPD) {\n\ttry {\n\t\tgOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\tgOPD = null;\n\t}\n}\n\nfunctionsHaveNames.functionsHaveConfigurableNames = function functionsHaveConfigurableNames() {\n\tif (!functionsHaveNames() || !gOPD) {\n\t\treturn false;\n\t}\n\tvar desc = gOPD(function () {}, 'name');\n\treturn !!desc && !!desc.configurable;\n};\n\nvar $bind = Function.prototype.bind;\n\nfunctionsHaveNames.boundFunctionsHaveNames = function boundFunctionsHaveNames() {\n\treturn functionsHaveNames() && typeof $bind === 'function' && function f() {}.bind().name !== '';\n};\n\nmodule.exports = functionsHaveNames;\n","'use strict';\n\nvar undefined;\n\nvar $SyntaxError = SyntaxError;\nvar $Function = Function;\nvar $TypeError = TypeError;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\nif ($gOPD) {\n\ttry {\n\t\t$gOPD({}, '');\n\t} catch (e) {\n\t\t$gOPD = null; // this is IE 8, which has a broken gOPD\n\t}\n}\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\nvar hasProto = require('has-proto')();\n\nvar getProto = Object.getPrototypeOf || (\n\thasProto\n\t\t? function (x) { return x.__proto__; } // eslint-disable-line no-proto\n\t\t: null\n);\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,\n\t'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': EvalError,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': Object,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': RangeError,\n\t'%ReferenceError%': ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nif (getProto) {\n\ttry {\n\t\tnull.error; // eslint-disable-line no-unused-expressions\n\t} catch (e) {\n\t\t// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n\t\tvar errorProto = getProto(getProto(e));\n\t\tINTRINSICS['%Error.prototype%'] = errorProto;\n\t}\n}\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen && getProto) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('has');\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\nvar $exec = bind.call(Function.call, RegExp.prototype.exec);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tif ($exec(/^%?[^%]*%?$/, name) === null) {\n\t\tthrow new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');\n\t}\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\n\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasPropertyDescriptors = function hasPropertyDescriptors() {\n\tif ($defineProperty) {\n\t\ttry {\n\t\t\t$defineProperty({}, 'a', { value: 1 });\n\t\t\treturn true;\n\t\t} catch (e) {\n\t\t\t// IE 8 has a broken defineProperty\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn false;\n};\n\nhasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {\n\t// node v0.6 has a bug where array lengths can be Set but not Defined\n\tif (!hasPropertyDescriptors()) {\n\t\treturn null;\n\t}\n\ttry {\n\t\treturn $defineProperty([], 'length', { value: 1 }).length !== 1;\n\t} catch (e) {\n\t\t// In Firefox 4-22, defining length on an array throws an exception.\n\t\treturn true;\n\t}\n};\n\nmodule.exports = hasPropertyDescriptors;\n","'use strict';\n\nvar test = {\n\tfoo: {}\n};\n\nvar $Object = Object;\n\nmodule.exports = function hasProto() {\n\treturn { __proto__: test }.foo === test.foo && !({ __proto__: null } instanceof $Object);\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar hasSymbols = require('has-symbols/shams');\n\nmodule.exports = function hasToStringTagShams() {\n\treturn hasSymbols() && !!Symbol.toStringTag;\n};\n","'use strict';\n\nvar hasOwnProperty = {}.hasOwnProperty;\nvar call = Function.prototype.call;\n\nmodule.exports = call.bind ? call.bind(hasOwnProperty) : function (O, P) {\n return call.call(hasOwnProperty, O, P);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar has = require('has');\nvar channel = require('side-channel')();\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar SLOT = {\n\tassert: function (O, slot) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tchannel.assert(O);\n\t\tif (!SLOT.has(O, slot)) {\n\t\t\tthrow new $TypeError('`' + slot + '` is not present on `O`');\n\t\t}\n\t},\n\tget: function (O, slot) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tvar slots = channel.get(O);\n\t\treturn slots && slots['$' + slot];\n\t},\n\thas: function (O, slot) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tvar slots = channel.get(O);\n\t\treturn !!slots && has(slots, '$' + slot);\n\t},\n\tset: function (O, slot, V) {\n\t\tif (!O || (typeof O !== 'object' && typeof O !== 'function')) {\n\t\t\tthrow new $TypeError('`O` is not an object');\n\t\t}\n\t\tif (typeof slot !== 'string') {\n\t\t\tthrow new $TypeError('`slot` must be a string');\n\t\t}\n\t\tvar slots = channel.get(O);\n\t\tif (!slots) {\n\t\t\tslots = {};\n\t\t\tchannel.set(O, slots);\n\t\t}\n\t\tslots['$' + slot] = V;\n\t}\n};\n\nif (Object.freeze) {\n\tObject.freeze(SLOT);\n}\n\nmodule.exports = SLOT;\n","'use strict';\n\nvar fnToStr = Function.prototype.toString;\nvar reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;\nvar badArrayLike;\nvar isCallableMarker;\nif (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {\n\ttry {\n\t\tbadArrayLike = Object.defineProperty({}, 'length', {\n\t\t\tget: function () {\n\t\t\t\tthrow isCallableMarker;\n\t\t\t}\n\t\t});\n\t\tisCallableMarker = {};\n\t\t// eslint-disable-next-line no-throw-literal\n\t\treflectApply(function () { throw 42; }, null, badArrayLike);\n\t} catch (_) {\n\t\tif (_ !== isCallableMarker) {\n\t\t\treflectApply = null;\n\t\t}\n\t}\n} else {\n\treflectApply = null;\n}\n\nvar constructorRegex = /^\\s*class\\b/;\nvar isES6ClassFn = function isES6ClassFunction(value) {\n\ttry {\n\t\tvar fnStr = fnToStr.call(value);\n\t\treturn constructorRegex.test(fnStr);\n\t} catch (e) {\n\t\treturn false; // not a function\n\t}\n};\n\nvar tryFunctionObject = function tryFunctionToStr(value) {\n\ttry {\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tfnToStr.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\nvar toStr = Object.prototype.toString;\nvar objectClass = '[object Object]';\nvar fnClass = '[object Function]';\nvar genClass = '[object GeneratorFunction]';\nvar ddaClass = '[object HTMLAllCollection]'; // IE 11\nvar ddaClass2 = '[object HTML document.all class]';\nvar ddaClass3 = '[object HTMLCollection]'; // IE 9-10\nvar hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag`\n\nvar isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing\n\nvar isDDA = function isDocumentDotAll() { return false; };\nif (typeof document === 'object') {\n\t// Firefox 3 canonicalizes DDA to undefined when it's not accessed directly\n\tvar all = document.all;\n\tif (toStr.call(all) === toStr.call(document.all)) {\n\t\tisDDA = function isDocumentDotAll(value) {\n\t\t\t/* globals document: false */\n\t\t\t// in IE 6-8, typeof document.all is \"object\" and it's truthy\n\t\t\tif ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) {\n\t\t\t\ttry {\n\t\t\t\t\tvar str = toStr.call(value);\n\t\t\t\t\treturn (\n\t\t\t\t\t\tstr === ddaClass\n\t\t\t\t\t\t|| str === ddaClass2\n\t\t\t\t\t\t|| str === ddaClass3 // opera 12.16\n\t\t\t\t\t\t|| str === objectClass // IE 6-8\n\t\t\t\t\t) && value('') == null; // eslint-disable-line eqeqeq\n\t\t\t\t} catch (e) { /**/ }\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\t}\n}\n\nmodule.exports = reflectApply\n\t? function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\ttry {\n\t\t\treflectApply(value, null, badArrayLike);\n\t\t} catch (e) {\n\t\t\tif (e !== isCallableMarker) { return false; }\n\t\t}\n\t\treturn !isES6ClassFn(value) && tryFunctionObject(value);\n\t}\n\t: function isCallable(value) {\n\t\tif (isDDA(value)) { return true; }\n\t\tif (!value) { return false; }\n\t\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\t\tif (hasToStringTag) { return tryFunctionObject(value); }\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tvar strClass = toStr.call(value);\n\t\tif (strClass !== fnClass && strClass !== genClass && !(/^\\[object HTML/).test(strClass)) { return false; }\n\t\treturn tryFunctionObject(value);\n\t};\n","'use strict';\n\nvar getDay = Date.prototype.getDay;\nvar tryDateObject = function tryDateGetDayCall(value) {\n\ttry {\n\t\tgetDay.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\n\nvar toStr = Object.prototype.toString;\nvar dateClass = '[object Date]';\nvar hasToStringTag = require('has-tostringtag/shams')();\n\nmodule.exports = function isDateObject(value) {\n\tif (typeof value !== 'object' || value === null) {\n\t\treturn false;\n\t}\n\treturn hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass;\n};\n","'use strict';\n\nvar callBound = require('call-bind/callBound');\nvar hasToStringTag = require('has-tostringtag/shams')();\nvar has;\nvar $exec;\nvar isRegexMarker;\nvar badStringifier;\n\nif (hasToStringTag) {\n\thas = callBound('Object.prototype.hasOwnProperty');\n\t$exec = callBound('RegExp.prototype.exec');\n\tisRegexMarker = {};\n\n\tvar throwRegexMarker = function () {\n\t\tthrow isRegexMarker;\n\t};\n\tbadStringifier = {\n\t\ttoString: throwRegexMarker,\n\t\tvalueOf: throwRegexMarker\n\t};\n\n\tif (typeof Symbol.toPrimitive === 'symbol') {\n\t\tbadStringifier[Symbol.toPrimitive] = throwRegexMarker;\n\t}\n}\n\nvar $toString = callBound('Object.prototype.toString');\nvar gOPD = Object.getOwnPropertyDescriptor;\nvar regexClass = '[object RegExp]';\n\nmodule.exports = hasToStringTag\n\t// eslint-disable-next-line consistent-return\n\t? function isRegex(value) {\n\t\tif (!value || typeof value !== 'object') {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar descriptor = gOPD(value, 'lastIndex');\n\t\tvar hasLastIndexDataProperty = descriptor && has(descriptor, 'value');\n\t\tif (!hasLastIndexDataProperty) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttry {\n\t\t\t$exec(value, badStringifier);\n\t\t} catch (e) {\n\t\t\treturn e === isRegexMarker;\n\t\t}\n\t}\n\t: function isRegex(value) {\n\t\t// In older browsers, typeof regex incorrectly returns 'function'\n\t\tif (!value || (typeof value !== 'object' && typeof value !== 'function')) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $toString(value) === regexClass;\n\t};\n","'use strict';\n\nvar toStr = Object.prototype.toString;\nvar hasSymbols = require('has-symbols')();\n\nif (hasSymbols) {\n\tvar symToStr = Symbol.prototype.toString;\n\tvar symStringRegex = /^Symbol\\(.*\\)$/;\n\tvar isSymbolObject = function isRealSymbolObject(value) {\n\t\tif (typeof value.valueOf() !== 'symbol') {\n\t\t\treturn false;\n\t\t}\n\t\treturn symStringRegex.test(symToStr.call(value));\n\t};\n\n\tmodule.exports = function isSymbol(value) {\n\t\tif (typeof value === 'symbol') {\n\t\t\treturn true;\n\t\t}\n\t\tif (toStr.call(value) !== '[object Symbol]') {\n\t\t\treturn false;\n\t\t}\n\t\ttry {\n\t\t\treturn isSymbolObject(value);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n} else {\n\n\tmodule.exports = function isSymbol(value) {\n\t\t// this environment does not support Symbols.\n\t\treturn false && value;\n\t};\n}\n","var hasMap = typeof Map === 'function' && Map.prototype;\nvar mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;\nvar mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;\nvar mapForEach = hasMap && Map.prototype.forEach;\nvar hasSet = typeof Set === 'function' && Set.prototype;\nvar setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;\nvar setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;\nvar setForEach = hasSet && Set.prototype.forEach;\nvar hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;\nvar weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;\nvar hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;\nvar weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;\nvar hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;\nvar weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;\nvar booleanValueOf = Boolean.prototype.valueOf;\nvar objectToString = Object.prototype.toString;\nvar functionToString = Function.prototype.toString;\nvar $match = String.prototype.match;\nvar $slice = String.prototype.slice;\nvar $replace = String.prototype.replace;\nvar $toUpperCase = String.prototype.toUpperCase;\nvar $toLowerCase = String.prototype.toLowerCase;\nvar $test = RegExp.prototype.test;\nvar $concat = Array.prototype.concat;\nvar $join = Array.prototype.join;\nvar $arrSlice = Array.prototype.slice;\nvar $floor = Math.floor;\nvar bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;\nvar gOPS = Object.getOwnPropertySymbols;\nvar symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;\nvar hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';\n// ie, `has-tostringtag/shams\nvar toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')\n ? Symbol.toStringTag\n : null;\nvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\nvar gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (\n [].__proto__ === Array.prototype // eslint-disable-line no-proto\n ? function (O) {\n return O.__proto__; // eslint-disable-line no-proto\n }\n : null\n);\n\nfunction addNumericSeparator(num, str) {\n if (\n num === Infinity\n || num === -Infinity\n || num !== num\n || (num && num > -1000 && num < 1000)\n || $test.call(/e/, str)\n ) {\n return str;\n }\n var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;\n if (typeof num === 'number') {\n var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)\n if (int !== num) {\n var intStr = String(int);\n var dec = $slice.call(str, intStr.length + 1);\n return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');\n }\n }\n return $replace.call(str, sepRegex, '$&_');\n}\n\nvar utilInspect = require('./util.inspect');\nvar inspectCustom = utilInspect.custom;\nvar inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;\n\nmodule.exports = function inspect_(obj, options, depth, seen) {\n var opts = options || {};\n\n if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {\n throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');\n }\n if (\n has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'\n ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity\n : opts.maxStringLength !== null\n )\n ) {\n throw new TypeError('option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`');\n }\n var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;\n if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {\n throw new TypeError('option \"customInspect\", if provided, must be `true`, `false`, or `\\'symbol\\'`');\n }\n\n if (\n has(opts, 'indent')\n && opts.indent !== null\n && opts.indent !== '\\t'\n && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)\n ) {\n throw new TypeError('option \"indent\" must be \"\\\\t\", an integer > 0, or `null`');\n }\n if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {\n throw new TypeError('option \"numericSeparator\", if provided, must be `true` or `false`');\n }\n var numericSeparator = opts.numericSeparator;\n\n if (typeof obj === 'undefined') {\n return 'undefined';\n }\n if (obj === null) {\n return 'null';\n }\n if (typeof obj === 'boolean') {\n return obj ? 'true' : 'false';\n }\n\n if (typeof obj === 'string') {\n return inspectString(obj, opts);\n }\n if (typeof obj === 'number') {\n if (obj === 0) {\n return Infinity / obj > 0 ? '0' : '-0';\n }\n var str = String(obj);\n return numericSeparator ? addNumericSeparator(obj, str) : str;\n }\n if (typeof obj === 'bigint') {\n var bigIntStr = String(obj) + 'n';\n return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;\n }\n\n var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;\n if (typeof depth === 'undefined') { depth = 0; }\n if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {\n return isArray(obj) ? '[Array]' : '[Object]';\n }\n\n var indent = getIndent(opts, depth);\n\n if (typeof seen === 'undefined') {\n seen = [];\n } else if (indexOf(seen, obj) >= 0) {\n return '[Circular]';\n }\n\n function inspect(value, from, noIndent) {\n if (from) {\n seen = $arrSlice.call(seen);\n seen.push(from);\n }\n if (noIndent) {\n var newOpts = {\n depth: opts.depth\n };\n if (has(opts, 'quoteStyle')) {\n newOpts.quoteStyle = opts.quoteStyle;\n }\n return inspect_(value, newOpts, depth + 1, seen);\n }\n return inspect_(value, opts, depth + 1, seen);\n }\n\n if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable\n var name = nameOf(obj);\n var keys = arrObjKeys(obj, inspect);\n return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');\n }\n if (isSymbol(obj)) {\n var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\\(.*\\))_[^)]*$/, '$1') : symToString.call(obj);\n return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;\n }\n if (isElement(obj)) {\n var s = '<' + $toLowerCase.call(String(obj.nodeName));\n var attrs = obj.attributes || [];\n for (var i = 0; i < attrs.length; i++) {\n s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);\n }\n s += '>';\n if (obj.childNodes && obj.childNodes.length) { s += '...'; }\n s += '';\n return s;\n }\n if (isArray(obj)) {\n if (obj.length === 0) { return '[]'; }\n var xs = arrObjKeys(obj, inspect);\n if (indent && !singleLineValues(xs)) {\n return '[' + indentedJoin(xs, indent) + ']';\n }\n return '[ ' + $join.call(xs, ', ') + ' ]';\n }\n if (isError(obj)) {\n var parts = arrObjKeys(obj, inspect);\n if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {\n return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';\n }\n if (parts.length === 0) { return '[' + String(obj) + ']'; }\n return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';\n }\n if (typeof obj === 'object' && customInspect) {\n if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {\n return utilInspect(obj, { depth: maxDepth - depth });\n } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {\n return obj.inspect();\n }\n }\n if (isMap(obj)) {\n var mapParts = [];\n if (mapForEach) {\n mapForEach.call(obj, function (value, key) {\n mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));\n });\n }\n return collectionOf('Map', mapSize.call(obj), mapParts, indent);\n }\n if (isSet(obj)) {\n var setParts = [];\n if (setForEach) {\n setForEach.call(obj, function (value) {\n setParts.push(inspect(value, obj));\n });\n }\n return collectionOf('Set', setSize.call(obj), setParts, indent);\n }\n if (isWeakMap(obj)) {\n return weakCollectionOf('WeakMap');\n }\n if (isWeakSet(obj)) {\n return weakCollectionOf('WeakSet');\n }\n if (isWeakRef(obj)) {\n return weakCollectionOf('WeakRef');\n }\n if (isNumber(obj)) {\n return markBoxed(inspect(Number(obj)));\n }\n if (isBigInt(obj)) {\n return markBoxed(inspect(bigIntValueOf.call(obj)));\n }\n if (isBoolean(obj)) {\n return markBoxed(booleanValueOf.call(obj));\n }\n if (isString(obj)) {\n return markBoxed(inspect(String(obj)));\n }\n if (!isDate(obj) && !isRegExp(obj)) {\n var ys = arrObjKeys(obj, inspect);\n var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;\n var protoTag = obj instanceof Object ? '' : 'null prototype';\n var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';\n var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';\n var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');\n if (ys.length === 0) { return tag + '{}'; }\n if (indent) {\n return tag + '{' + indentedJoin(ys, indent) + '}';\n }\n return tag + '{ ' + $join.call(ys, ', ') + ' }';\n }\n return String(obj);\n};\n\nfunction wrapQuotes(s, defaultStyle, opts) {\n var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '\"' : \"'\";\n return quoteChar + s + quoteChar;\n}\n\nfunction quote(s) {\n return $replace.call(String(s), /\"/g, '"');\n}\n\nfunction isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\n\n// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives\nfunction isSymbol(obj) {\n if (hasShammedSymbols) {\n return obj && typeof obj === 'object' && obj instanceof Symbol;\n }\n if (typeof obj === 'symbol') {\n return true;\n }\n if (!obj || typeof obj !== 'object' || !symToString) {\n return false;\n }\n try {\n symToString.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isBigInt(obj) {\n if (!obj || typeof obj !== 'object' || !bigIntValueOf) {\n return false;\n }\n try {\n bigIntValueOf.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };\nfunction has(obj, key) {\n return hasOwn.call(obj, key);\n}\n\nfunction toStr(obj) {\n return objectToString.call(obj);\n}\n\nfunction nameOf(f) {\n if (f.name) { return f.name; }\n var m = $match.call(functionToString.call(f), /^function\\s*([\\w$]+)/);\n if (m) { return m[1]; }\n return null;\n}\n\nfunction indexOf(xs, x) {\n if (xs.indexOf) { return xs.indexOf(x); }\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) { return i; }\n }\n return -1;\n}\n\nfunction isMap(x) {\n if (!mapSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n mapSize.call(x);\n try {\n setSize.call(x);\n } catch (s) {\n return true;\n }\n return x instanceof Map; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakMap(x) {\n if (!weakMapHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakMapHas.call(x, weakMapHas);\n try {\n weakSetHas.call(x, weakSetHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakMap; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakRef(x) {\n if (!weakRefDeref || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakRefDeref.call(x);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isSet(x) {\n if (!setSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n setSize.call(x);\n try {\n mapSize.call(x);\n } catch (m) {\n return true;\n }\n return x instanceof Set; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakSet(x) {\n if (!weakSetHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakSetHas.call(x, weakSetHas);\n try {\n weakMapHas.call(x, weakMapHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakSet; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isElement(x) {\n if (!x || typeof x !== 'object') { return false; }\n if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {\n return true;\n }\n return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';\n}\n\nfunction inspectString(str, opts) {\n if (str.length > opts.maxStringLength) {\n var remaining = str.length - opts.maxStringLength;\n var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');\n return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;\n }\n // eslint-disable-next-line no-control-regex\n var s = $replace.call($replace.call(str, /(['\\\\])/g, '\\\\$1'), /[\\x00-\\x1f]/g, lowbyte);\n return wrapQuotes(s, 'single', opts);\n}\n\nfunction lowbyte(c) {\n var n = c.charCodeAt(0);\n var x = {\n 8: 'b',\n 9: 't',\n 10: 'n',\n 12: 'f',\n 13: 'r'\n }[n];\n if (x) { return '\\\\' + x; }\n return '\\\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));\n}\n\nfunction markBoxed(str) {\n return 'Object(' + str + ')';\n}\n\nfunction weakCollectionOf(type) {\n return type + ' { ? }';\n}\n\nfunction collectionOf(type, size, entries, indent) {\n var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');\n return type + ' (' + size + ') {' + joinedEntries + '}';\n}\n\nfunction singleLineValues(xs) {\n for (var i = 0; i < xs.length; i++) {\n if (indexOf(xs[i], '\\n') >= 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction getIndent(opts, depth) {\n var baseIndent;\n if (opts.indent === '\\t') {\n baseIndent = '\\t';\n } else if (typeof opts.indent === 'number' && opts.indent > 0) {\n baseIndent = $join.call(Array(opts.indent + 1), ' ');\n } else {\n return null;\n }\n return {\n base: baseIndent,\n prev: $join.call(Array(depth + 1), baseIndent)\n };\n}\n\nfunction indentedJoin(xs, indent) {\n if (xs.length === 0) { return ''; }\n var lineJoiner = '\\n' + indent.prev + indent.base;\n return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\\n' + indent.prev;\n}\n\nfunction arrObjKeys(obj, inspect) {\n var isArr = isArray(obj);\n var xs = [];\n if (isArr) {\n xs.length = obj.length;\n for (var i = 0; i < obj.length; i++) {\n xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';\n }\n }\n var syms = typeof gOPS === 'function' ? gOPS(obj) : [];\n var symMap;\n if (hasShammedSymbols) {\n symMap = {};\n for (var k = 0; k < syms.length; k++) {\n symMap['$' + syms[k]] = syms[k];\n }\n }\n\n for (var key in obj) { // eslint-disable-line no-restricted-syntax\n if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {\n // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section\n continue; // eslint-disable-line no-restricted-syntax, no-continue\n } else if ($test.call(/[^\\w$]/, key)) {\n xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));\n } else {\n xs.push(key + ': ' + inspect(obj[key], obj));\n }\n }\n if (typeof gOPS === 'function') {\n for (var j = 0; j < syms.length; j++) {\n if (isEnumerable.call(obj, syms[j])) {\n xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));\n }\n }\n }\n return xs;\n}\n","'use strict';\n\nvar keysShim;\nif (!Object.keys) {\n\t// modified from https://github.com/es-shims/es5-shim\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar toStr = Object.prototype.toString;\n\tvar isArgs = require('./isArguments'); // eslint-disable-line global-require\n\tvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\tvar hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');\n\tvar hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');\n\tvar dontEnums = [\n\t\t'toString',\n\t\t'toLocaleString',\n\t\t'valueOf',\n\t\t'hasOwnProperty',\n\t\t'isPrototypeOf',\n\t\t'propertyIsEnumerable',\n\t\t'constructor'\n\t];\n\tvar equalsConstructorPrototype = function (o) {\n\t\tvar ctor = o.constructor;\n\t\treturn ctor && ctor.prototype === o;\n\t};\n\tvar excludedKeys = {\n\t\t$applicationCache: true,\n\t\t$console: true,\n\t\t$external: true,\n\t\t$frame: true,\n\t\t$frameElement: true,\n\t\t$frames: true,\n\t\t$innerHeight: true,\n\t\t$innerWidth: true,\n\t\t$onmozfullscreenchange: true,\n\t\t$onmozfullscreenerror: true,\n\t\t$outerHeight: true,\n\t\t$outerWidth: true,\n\t\t$pageXOffset: true,\n\t\t$pageYOffset: true,\n\t\t$parent: true,\n\t\t$scrollLeft: true,\n\t\t$scrollTop: true,\n\t\t$scrollX: true,\n\t\t$scrollY: true,\n\t\t$self: true,\n\t\t$webkitIndexedDB: true,\n\t\t$webkitStorageInfo: true,\n\t\t$window: true\n\t};\n\tvar hasAutomationEqualityBug = (function () {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined') { return false; }\n\t\tfor (var k in window) {\n\t\t\ttry {\n\t\t\t\tif (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tequalsConstructorPrototype(window[k]);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}());\n\tvar equalsConstructorPrototypeIfNotBuggy = function (o) {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined' || !hasAutomationEqualityBug) {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t}\n\t\ttry {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tkeysShim = function keys(object) {\n\t\tvar isObject = object !== null && typeof object === 'object';\n\t\tvar isFunction = toStr.call(object) === '[object Function]';\n\t\tvar isArguments = isArgs(object);\n\t\tvar isString = isObject && toStr.call(object) === '[object String]';\n\t\tvar theKeys = [];\n\n\t\tif (!isObject && !isFunction && !isArguments) {\n\t\t\tthrow new TypeError('Object.keys called on a non-object');\n\t\t}\n\n\t\tvar skipProto = hasProtoEnumBug && isFunction;\n\t\tif (isString && object.length > 0 && !has.call(object, 0)) {\n\t\t\tfor (var i = 0; i < object.length; ++i) {\n\t\t\t\ttheKeys.push(String(i));\n\t\t\t}\n\t\t}\n\n\t\tif (isArguments && object.length > 0) {\n\t\t\tfor (var j = 0; j < object.length; ++j) {\n\t\t\t\ttheKeys.push(String(j));\n\t\t\t}\n\t\t} else {\n\t\t\tfor (var name in object) {\n\t\t\t\tif (!(skipProto && name === 'prototype') && has.call(object, name)) {\n\t\t\t\t\ttheKeys.push(String(name));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (hasDontEnumBug) {\n\t\t\tvar skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);\n\n\t\t\tfor (var k = 0; k < dontEnums.length; ++k) {\n\t\t\t\tif (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {\n\t\t\t\t\ttheKeys.push(dontEnums[k]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn theKeys;\n\t};\n}\nmodule.exports = keysShim;\n","'use strict';\n\nvar slice = Array.prototype.slice;\nvar isArgs = require('./isArguments');\n\nvar origKeys = Object.keys;\nvar keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');\n\nvar originalKeys = Object.keys;\n\nkeysShim.shim = function shimObjectKeys() {\n\tif (Object.keys) {\n\t\tvar keysWorksWithArguments = (function () {\n\t\t\t// Safari 5.0 bug\n\t\t\tvar args = Object.keys(arguments);\n\t\t\treturn args && args.length === arguments.length;\n\t\t}(1, 2));\n\t\tif (!keysWorksWithArguments) {\n\t\t\tObject.keys = function keys(object) { // eslint-disable-line func-name-matching\n\t\t\t\tif (isArgs(object)) {\n\t\t\t\t\treturn originalKeys(slice.call(object));\n\t\t\t\t}\n\t\t\t\treturn originalKeys(object);\n\t\t\t};\n\t\t}\n\t} else {\n\t\tObject.keys = keysShim;\n\t}\n\treturn Object.keys || keysShim;\n};\n\nmodule.exports = keysShim;\n","'use strict';\n\nvar toStr = Object.prototype.toString;\n\nmodule.exports = function isArguments(value) {\n\tvar str = toStr.call(value);\n\tvar isArgs = str === '[object Arguments]';\n\tif (!isArgs) {\n\t\tisArgs = str !== '[object Array]' &&\n\t\t\tvalue !== null &&\n\t\t\ttypeof value === 'object' &&\n\t\t\ttypeof value.length === 'number' &&\n\t\t\tvalue.length >= 0 &&\n\t\t\ttoStr.call(value.callee) === '[object Function]';\n\t}\n\treturn isArgs;\n};\n","'use strict';\n\nvar setFunctionName = require('set-function-name');\n\nvar $Object = Object;\nvar $TypeError = TypeError;\n\nmodule.exports = setFunctionName(function flags() {\n\tif (this != null && this !== $Object(this)) {\n\t\tthrow new $TypeError('RegExp.prototype.flags getter called on non-object');\n\t}\n\tvar result = '';\n\tif (this.hasIndices) {\n\t\tresult += 'd';\n\t}\n\tif (this.global) {\n\t\tresult += 'g';\n\t}\n\tif (this.ignoreCase) {\n\t\tresult += 'i';\n\t}\n\tif (this.multiline) {\n\t\tresult += 'm';\n\t}\n\tif (this.dotAll) {\n\t\tresult += 's';\n\t}\n\tif (this.unicode) {\n\t\tresult += 'u';\n\t}\n\tif (this.unicodeSets) {\n\t\tresult += 'v';\n\t}\n\tif (this.sticky) {\n\t\tresult += 'y';\n\t}\n\treturn result;\n}, 'get flags', true);\n\n","'use strict';\n\nvar define = require('define-properties');\nvar callBind = require('call-bind');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar flagsBound = callBind(getPolyfill());\n\ndefine(flagsBound, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = flagsBound;\n","'use strict';\n\nvar implementation = require('./implementation');\n\nvar supportsDescriptors = require('define-properties').supportsDescriptors;\nvar $gOPD = Object.getOwnPropertyDescriptor;\n\nmodule.exports = function getPolyfill() {\n\tif (supportsDescriptors && (/a/mig).flags === 'gim') {\n\t\tvar descriptor = $gOPD(RegExp.prototype, 'flags');\n\t\tif (\n\t\t\tdescriptor\n\t\t\t&& typeof descriptor.get === 'function'\n\t\t\t&& typeof RegExp.prototype.dotAll === 'boolean'\n\t\t\t&& typeof RegExp.prototype.hasIndices === 'boolean'\n\t\t) {\n\t\t\t/* eslint getter-return: 0 */\n\t\t\tvar calls = '';\n\t\t\tvar o = {};\n\t\t\tObject.defineProperty(o, 'hasIndices', {\n\t\t\t\tget: function () {\n\t\t\t\t\tcalls += 'd';\n\t\t\t\t}\n\t\t\t});\n\t\t\tObject.defineProperty(o, 'sticky', {\n\t\t\t\tget: function () {\n\t\t\t\t\tcalls += 'y';\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (calls === 'dy') {\n\t\t\t\treturn descriptor.get;\n\t\t\t}\n\t\t}\n\t}\n\treturn implementation;\n};\n","'use strict';\n\nvar supportsDescriptors = require('define-properties').supportsDescriptors;\nvar getPolyfill = require('./polyfill');\nvar gOPD = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar TypeErr = TypeError;\nvar getProto = Object.getPrototypeOf;\nvar regex = /a/;\n\nmodule.exports = function shimFlags() {\n\tif (!supportsDescriptors || !getProto) {\n\t\tthrow new TypeErr('RegExp.prototype.flags requires a true ES5 environment that supports property descriptors');\n\t}\n\tvar polyfill = getPolyfill();\n\tvar proto = getProto(regex);\n\tvar descriptor = gOPD(proto, 'flags');\n\tif (!descriptor || descriptor.get !== polyfill) {\n\t\tdefineProperty(proto, 'flags', {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tget: polyfill\n\t\t});\n\t}\n\treturn polyfill;\n};\n","'use strict';\n\nvar callBound = require('call-bind/callBound');\nvar GetIntrinsic = require('get-intrinsic');\nvar isRegex = require('is-regex');\n\nvar $exec = callBound('RegExp.prototype.exec');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nmodule.exports = function regexTester(regex) {\n\tif (!isRegex(regex)) {\n\t\tthrow new $TypeError('`regex` must be a RegExp');\n\t}\n\treturn function test(s) {\n\t\treturn $exec(regex, s) !== null;\n\t};\n};\n","'use strict';\n\nvar define = require('define-data-property');\nvar hasDescriptors = require('has-property-descriptors')();\nvar functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames();\n\nvar $TypeError = TypeError;\n\nmodule.exports = function setFunctionName(fn, name) {\n\tif (typeof fn !== 'function') {\n\t\tthrow new $TypeError('`fn` is not a function');\n\t}\n\tvar loose = arguments.length > 2 && !!arguments[2];\n\tif (!loose || functionsHaveConfigurableNames) {\n\t\tif (hasDescriptors) {\n\t\t\tdefine(fn, 'name', name, true, true);\n\t\t} else {\n\t\t\tdefine(fn, 'name', name);\n\t\t}\n\t}\n\treturn fn;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bind/callBound');\nvar inspect = require('object-inspect');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $WeakMap = GetIntrinsic('%WeakMap%', true);\nvar $Map = GetIntrinsic('%Map%', true);\n\nvar $weakMapGet = callBound('WeakMap.prototype.get', true);\nvar $weakMapSet = callBound('WeakMap.prototype.set', true);\nvar $weakMapHas = callBound('WeakMap.prototype.has', true);\nvar $mapGet = callBound('Map.prototype.get', true);\nvar $mapSet = callBound('Map.prototype.set', true);\nvar $mapHas = callBound('Map.prototype.has', true);\n\n/*\n * This function traverses the list returning the node corresponding to the\n * given key.\n *\n * That node is also moved to the head of the list, so that if it's accessed\n * again we don't need to traverse the whole list. By doing so, all the recently\n * used nodes can be accessed relatively quickly.\n */\nvar listGetNode = function (list, key) { // eslint-disable-line consistent-return\n\tfor (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {\n\t\tif (curr.key === key) {\n\t\t\tprev.next = curr.next;\n\t\t\tcurr.next = list.next;\n\t\t\tlist.next = curr; // eslint-disable-line no-param-reassign\n\t\t\treturn curr;\n\t\t}\n\t}\n};\n\nvar listGet = function (objects, key) {\n\tvar node = listGetNode(objects, key);\n\treturn node && node.value;\n};\nvar listSet = function (objects, key, value) {\n\tvar node = listGetNode(objects, key);\n\tif (node) {\n\t\tnode.value = value;\n\t} else {\n\t\t// Prepend the new node to the beginning of the list\n\t\tobjects.next = { // eslint-disable-line no-param-reassign\n\t\t\tkey: key,\n\t\t\tnext: objects.next,\n\t\t\tvalue: value\n\t\t};\n\t}\n};\nvar listHas = function (objects, key) {\n\treturn !!listGetNode(objects, key);\n};\n\nmodule.exports = function getSideChannel() {\n\tvar $wm;\n\tvar $m;\n\tvar $o;\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\tget: function (key) { // eslint-disable-line consistent-return\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapGet($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapGet($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listGet($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\thas: function (key) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapHas($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapHas($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listHas($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif (!$wm) {\n\t\t\t\t\t$wm = new $WeakMap();\n\t\t\t\t}\n\t\t\t\t$weakMapSet($wm, key, value);\n\t\t\t} else if ($Map) {\n\t\t\t\tif (!$m) {\n\t\t\t\t\t$m = new $Map();\n\t\t\t\t}\n\t\t\t\t$mapSet($m, key, value);\n\t\t\t} else {\n\t\t\t\tif (!$o) {\n\t\t\t\t\t/*\n\t\t\t\t\t * Initialize the linked list as an empty node, so that we don't have\n\t\t\t\t\t * to special-case handling of the first node: we can always refer to\n\t\t\t\t\t * it as (previous node).next, instead of something like (list).head\n\t\t\t\t\t */\n\t\t\t\t\t$o = { key: {}, next: null };\n\t\t\t\t}\n\t\t\t\tlistSet($o, key, value);\n\t\t\t}\n\t\t}\n\t};\n\treturn channel;\n};\n","'use strict';\n\nvar Call = require('es-abstract/2023/Call');\nvar Get = require('es-abstract/2023/Get');\nvar GetMethod = require('es-abstract/2023/GetMethod');\nvar IsRegExp = require('es-abstract/2023/IsRegExp');\nvar ToString = require('es-abstract/2023/ToString');\nvar RequireObjectCoercible = require('es-abstract/2023/RequireObjectCoercible');\nvar callBound = require('call-bind/callBound');\nvar hasSymbols = require('has-symbols')();\nvar flagsGetter = require('regexp.prototype.flags');\n\nvar $indexOf = callBound('String.prototype.indexOf');\n\nvar regexpMatchAllPolyfill = require('./polyfill-regexp-matchall');\n\nvar getMatcher = function getMatcher(regexp) { // eslint-disable-line consistent-return\n\tvar matcherPolyfill = regexpMatchAllPolyfill();\n\tif (hasSymbols && typeof Symbol.matchAll === 'symbol') {\n\t\tvar matcher = GetMethod(regexp, Symbol.matchAll);\n\t\tif (matcher === RegExp.prototype[Symbol.matchAll] && matcher !== matcherPolyfill) {\n\t\t\treturn matcherPolyfill;\n\t\t}\n\t\treturn matcher;\n\t}\n\t// fallback for pre-Symbol.matchAll environments\n\tif (IsRegExp(regexp)) {\n\t\treturn matcherPolyfill;\n\t}\n};\n\nmodule.exports = function matchAll(regexp) {\n\tvar O = RequireObjectCoercible(this);\n\n\tif (typeof regexp !== 'undefined' && regexp !== null) {\n\t\tvar isRegExp = IsRegExp(regexp);\n\t\tif (isRegExp) {\n\t\t\t// workaround for older engines that lack RegExp.prototype.flags\n\t\t\tvar flags = 'flags' in regexp ? Get(regexp, 'flags') : flagsGetter(regexp);\n\t\t\tRequireObjectCoercible(flags);\n\t\t\tif ($indexOf(ToString(flags), 'g') < 0) {\n\t\t\t\tthrow new TypeError('matchAll requires a global regular expression');\n\t\t\t}\n\t\t}\n\n\t\tvar matcher = getMatcher(regexp);\n\t\tif (typeof matcher !== 'undefined') {\n\t\t\treturn Call(matcher, regexp, [O]);\n\t\t}\n\t}\n\n\tvar S = ToString(O);\n\t// var rx = RegExpCreate(regexp, 'g');\n\tvar rx = new RegExp(regexp, 'g');\n\treturn Call(getMatcher(rx), rx, [S]);\n};\n","'use strict';\n\nvar callBind = require('call-bind');\nvar define = require('define-properties');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar boundMatchAll = callBind(implementation);\n\ndefine(boundMatchAll, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = boundMatchAll;\n","'use strict';\n\nvar hasSymbols = require('has-symbols')();\nvar regexpMatchAll = require('./regexp-matchall');\n\nmodule.exports = function getRegExpMatchAllPolyfill() {\n\tif (!hasSymbols || typeof Symbol.matchAll !== 'symbol' || typeof RegExp.prototype[Symbol.matchAll] !== 'function') {\n\t\treturn regexpMatchAll;\n\t}\n\treturn RegExp.prototype[Symbol.matchAll];\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = function getPolyfill() {\n\tif (String.prototype.matchAll) {\n\t\ttry {\n\t\t\t''.matchAll(RegExp.prototype);\n\t\t} catch (e) {\n\t\t\treturn String.prototype.matchAll;\n\t\t}\n\t}\n\treturn implementation;\n};\n","'use strict';\n\n// var Construct = require('es-abstract/2023/Construct');\nvar CreateRegExpStringIterator = require('es-abstract/2023/CreateRegExpStringIterator');\nvar Get = require('es-abstract/2023/Get');\nvar Set = require('es-abstract/2023/Set');\nvar SpeciesConstructor = require('es-abstract/2023/SpeciesConstructor');\nvar ToLength = require('es-abstract/2023/ToLength');\nvar ToString = require('es-abstract/2023/ToString');\nvar Type = require('es-abstract/2023/Type');\nvar flagsGetter = require('regexp.prototype.flags');\nvar setFunctionName = require('set-function-name');\nvar callBound = require('call-bind/callBound');\n\nvar $indexOf = callBound('String.prototype.indexOf');\n\nvar OrigRegExp = RegExp;\n\nvar supportsConstructingWithFlags = 'flags' in RegExp.prototype;\n\nvar constructRegexWithFlags = function constructRegex(C, R) {\n\tvar matcher;\n\t// workaround for older engines that lack RegExp.prototype.flags\n\tvar flags = 'flags' in R ? Get(R, 'flags') : ToString(flagsGetter(R));\n\tif (supportsConstructingWithFlags && typeof flags === 'string') {\n\t\tmatcher = new C(R, flags);\n\t} else if (C === OrigRegExp) {\n\t\t// workaround for older engines that can not construct a RegExp with flags\n\t\tmatcher = new C(R.source, flags);\n\t} else {\n\t\tmatcher = new C(R, flags);\n\t}\n\treturn { flags: flags, matcher: matcher };\n};\n\nvar regexMatchAll = setFunctionName(function SymbolMatchAll(string) {\n\tvar R = this;\n\tif (Type(R) !== 'Object') {\n\t\tthrow new TypeError('\"this\" value must be an Object');\n\t}\n\tvar S = ToString(string);\n\tvar C = SpeciesConstructor(R, OrigRegExp);\n\n\tvar tmp = constructRegexWithFlags(C, R);\n\t// var flags = ToString(Get(R, 'flags'));\n\tvar flags = tmp.flags;\n\t// var matcher = Construct(C, [R, flags]);\n\tvar matcher = tmp.matcher;\n\n\tvar lastIndex = ToLength(Get(R, 'lastIndex'));\n\tSet(matcher, 'lastIndex', lastIndex, true);\n\tvar global = $indexOf(flags, 'g') > -1;\n\tvar fullUnicode = $indexOf(flags, 'u') > -1;\n\treturn CreateRegExpStringIterator(matcher, S, global, fullUnicode);\n}, '[Symbol.matchAll]', true);\n\nmodule.exports = regexMatchAll;\n","'use strict';\n\nvar define = require('define-properties');\nvar hasSymbols = require('has-symbols')();\nvar getPolyfill = require('./polyfill');\nvar regexpMatchAllPolyfill = require('./polyfill-regexp-matchall');\n\nvar defineP = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nmodule.exports = function shimMatchAll() {\n\tvar polyfill = getPolyfill();\n\tdefine(\n\t\tString.prototype,\n\t\t{ matchAll: polyfill },\n\t\t{ matchAll: function () { return String.prototype.matchAll !== polyfill; } }\n\t);\n\tif (hasSymbols) {\n\t\t// eslint-disable-next-line no-restricted-properties\n\t\tvar symbol = Symbol.matchAll || (Symbol['for'] ? Symbol['for']('Symbol.matchAll') : Symbol('Symbol.matchAll'));\n\t\tdefine(\n\t\t\tSymbol,\n\t\t\t{ matchAll: symbol },\n\t\t\t{ matchAll: function () { return Symbol.matchAll !== symbol; } }\n\t\t);\n\n\t\tif (defineP && gOPD) {\n\t\t\tvar desc = gOPD(Symbol, symbol);\n\t\t\tif (!desc || desc.configurable) {\n\t\t\t\tdefineP(Symbol, symbol, {\n\t\t\t\t\tconfigurable: false,\n\t\t\t\t\tenumerable: false,\n\t\t\t\t\tvalue: symbol,\n\t\t\t\t\twritable: false\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tvar regexpMatchAll = regexpMatchAllPolyfill();\n\t\tvar func = {};\n\t\tfunc[symbol] = regexpMatchAll;\n\t\tvar predicate = {};\n\t\tpredicate[symbol] = function () {\n\t\t\treturn RegExp.prototype[symbol] !== regexpMatchAll;\n\t\t};\n\t\tdefine(RegExp.prototype, func, predicate);\n\t}\n\treturn polyfill;\n};\n","'use strict';\n\nvar RequireObjectCoercible = require('es-abstract/2023/RequireObjectCoercible');\nvar ToString = require('es-abstract/2023/ToString');\nvar callBound = require('call-bind/callBound');\nvar $replace = callBound('String.prototype.replace');\n\nvar mvsIsWS = (/^\\s$/).test('\\u180E');\n/* eslint-disable no-control-regex */\nvar leftWhitespace = mvsIsWS\n\t? /^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+/\n\t: /^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+/;\nvar rightWhitespace = mvsIsWS\n\t? /[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+$/\n\t: /[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+$/;\n/* eslint-enable no-control-regex */\n\nmodule.exports = function trim() {\n\tvar S = ToString(RequireObjectCoercible(this));\n\treturn $replace($replace(S, leftWhitespace, ''), rightWhitespace, '');\n};\n","'use strict';\n\nvar callBind = require('call-bind');\nvar define = require('define-properties');\nvar RequireObjectCoercible = require('es-abstract/2023/RequireObjectCoercible');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar bound = callBind(getPolyfill());\nvar boundMethod = function trim(receiver) {\n\tRequireObjectCoercible(receiver);\n\treturn bound(receiver);\n};\n\ndefine(boundMethod, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = boundMethod;\n","'use strict';\n\nvar implementation = require('./implementation');\n\nvar zeroWidthSpace = '\\u200b';\nvar mongolianVowelSeparator = '\\u180E';\n\nmodule.exports = function getPolyfill() {\n\tif (\n\t\tString.prototype.trim\n\t\t&& zeroWidthSpace.trim() === zeroWidthSpace\n\t\t&& mongolianVowelSeparator.trim() === mongolianVowelSeparator\n\t\t&& ('_' + mongolianVowelSeparator).trim() === ('_' + mongolianVowelSeparator)\n\t\t&& (mongolianVowelSeparator + '_').trim() === (mongolianVowelSeparator + '_')\n\t) {\n\t\treturn String.prototype.trim;\n\t}\n\treturn implementation;\n};\n","'use strict';\n\nvar define = require('define-properties');\nvar getPolyfill = require('./polyfill');\n\nmodule.exports = function shimStringTrim() {\n\tvar polyfill = getPolyfill();\n\tdefine(String.prototype, { trim: polyfill }, {\n\t\ttrim: function testTrim() {\n\t\t\treturn String.prototype.trim !== polyfill;\n\t\t}\n\t});\n\treturn polyfill;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar CodePointAt = require('./CodePointAt');\nvar Type = require('./Type');\n\nvar isInteger = require('../helpers/isInteger');\nvar MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// https://262.ecma-international.org/12.0/#sec-advancestringindex\n\nmodule.exports = function AdvanceStringIndex(S, index, unicode) {\n\tif (Type(S) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `S` must be a String');\n\t}\n\tif (!isInteger(index) || index < 0 || index > MAX_SAFE_INTEGER) {\n\t\tthrow new $TypeError('Assertion failed: `length` must be an integer >= 0 and <= 2**53');\n\t}\n\tif (Type(unicode) !== 'Boolean') {\n\t\tthrow new $TypeError('Assertion failed: `unicode` must be a Boolean');\n\t}\n\tif (!unicode) {\n\t\treturn index + 1;\n\t}\n\tvar length = S.length;\n\tif ((index + 1) >= length) {\n\t\treturn index + 1;\n\t}\n\tvar cp = CodePointAt(S, index);\n\treturn index + cp['[[CodeUnitCount]]'];\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bind/callBound');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar IsArray = require('./IsArray');\n\nvar $apply = GetIntrinsic('%Reflect.apply%', true) || callBound('Function.prototype.apply');\n\n// https://262.ecma-international.org/6.0/#sec-call\n\nmodule.exports = function Call(F, V) {\n\tvar argumentsList = arguments.length > 2 ? arguments[2] : [];\n\tif (!IsArray(argumentsList)) {\n\t\tthrow new $TypeError('Assertion failed: optional `argumentsList`, if provided, must be a List');\n\t}\n\treturn $apply(F, V, argumentsList);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar callBound = require('call-bind/callBound');\nvar isLeadingSurrogate = require('../helpers/isLeadingSurrogate');\nvar isTrailingSurrogate = require('../helpers/isTrailingSurrogate');\n\nvar Type = require('./Type');\nvar UTF16SurrogatePairToCodePoint = require('./UTF16SurrogatePairToCodePoint');\n\nvar $charAt = callBound('String.prototype.charAt');\nvar $charCodeAt = callBound('String.prototype.charCodeAt');\n\n// https://262.ecma-international.org/12.0/#sec-codepointat\n\nmodule.exports = function CodePointAt(string, position) {\n\tif (Type(string) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `string` must be a String');\n\t}\n\tvar size = string.length;\n\tif (position < 0 || position >= size) {\n\t\tthrow new $TypeError('Assertion failed: `position` must be >= 0, and < the length of `string`');\n\t}\n\tvar first = $charCodeAt(string, position);\n\tvar cp = $charAt(string, position);\n\tvar firstIsLeading = isLeadingSurrogate(first);\n\tvar firstIsTrailing = isTrailingSurrogate(first);\n\tif (!firstIsLeading && !firstIsTrailing) {\n\t\treturn {\n\t\t\t'[[CodePoint]]': cp,\n\t\t\t'[[CodeUnitCount]]': 1,\n\t\t\t'[[IsUnpairedSurrogate]]': false\n\t\t};\n\t}\n\tif (firstIsTrailing || (position + 1 === size)) {\n\t\treturn {\n\t\t\t'[[CodePoint]]': cp,\n\t\t\t'[[CodeUnitCount]]': 1,\n\t\t\t'[[IsUnpairedSurrogate]]': true\n\t\t};\n\t}\n\tvar second = $charCodeAt(string, position + 1);\n\tif (!isTrailingSurrogate(second)) {\n\t\treturn {\n\t\t\t'[[CodePoint]]': cp,\n\t\t\t'[[CodeUnitCount]]': 1,\n\t\t\t'[[IsUnpairedSurrogate]]': true\n\t\t};\n\t}\n\n\treturn {\n\t\t'[[CodePoint]]': UTF16SurrogatePairToCodePoint(first, second),\n\t\t'[[CodeUnitCount]]': 2,\n\t\t'[[IsUnpairedSurrogate]]': false\n\t};\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-createiterresultobject\n\nmodule.exports = function CreateIterResultObject(value, done) {\n\tif (Type(done) !== 'Boolean') {\n\t\tthrow new $TypeError('Assertion failed: Type(done) is not Boolean');\n\t}\n\treturn {\n\t\tvalue: value,\n\t\tdone: done\n\t};\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar DefineOwnProperty = require('../helpers/DefineOwnProperty');\n\nvar FromPropertyDescriptor = require('./FromPropertyDescriptor');\nvar IsDataDescriptor = require('./IsDataDescriptor');\nvar IsPropertyKey = require('./IsPropertyKey');\nvar SameValue = require('./SameValue');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-createmethodproperty\n\nmodule.exports = function CreateMethodProperty(O, P, V) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true');\n\t}\n\n\tvar newDesc = {\n\t\t'[[Configurable]]': true,\n\t\t'[[Enumerable]]': false,\n\t\t'[[Value]]': V,\n\t\t'[[Writable]]': true\n\t};\n\treturn DefineOwnProperty(\n\t\tIsDataDescriptor,\n\t\tSameValue,\n\t\tFromPropertyDescriptor,\n\t\tO,\n\t\tP,\n\t\tnewDesc\n\t);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar hasSymbols = require('has-symbols')();\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar IteratorPrototype = GetIntrinsic('%IteratorPrototype%', true);\n\nvar AdvanceStringIndex = require('./AdvanceStringIndex');\nvar CreateIterResultObject = require('./CreateIterResultObject');\nvar CreateMethodProperty = require('./CreateMethodProperty');\nvar Get = require('./Get');\nvar OrdinaryObjectCreate = require('./OrdinaryObjectCreate');\nvar RegExpExec = require('./RegExpExec');\nvar Set = require('./Set');\nvar ToLength = require('./ToLength');\nvar ToString = require('./ToString');\nvar Type = require('./Type');\n\nvar SLOT = require('internal-slot');\nvar setToStringTag = require('es-set-tostringtag');\n\nvar RegExpStringIterator = function RegExpStringIterator(R, S, global, fullUnicode) {\n\tif (Type(S) !== 'String') {\n\t\tthrow new $TypeError('`S` must be a string');\n\t}\n\tif (Type(global) !== 'Boolean') {\n\t\tthrow new $TypeError('`global` must be a boolean');\n\t}\n\tif (Type(fullUnicode) !== 'Boolean') {\n\t\tthrow new $TypeError('`fullUnicode` must be a boolean');\n\t}\n\tSLOT.set(this, '[[IteratingRegExp]]', R);\n\tSLOT.set(this, '[[IteratedString]]', S);\n\tSLOT.set(this, '[[Global]]', global);\n\tSLOT.set(this, '[[Unicode]]', fullUnicode);\n\tSLOT.set(this, '[[Done]]', false);\n};\n\nif (IteratorPrototype) {\n\tRegExpStringIterator.prototype = OrdinaryObjectCreate(IteratorPrototype);\n}\n\nvar RegExpStringIteratorNext = function next() {\n\tvar O = this; // eslint-disable-line no-invalid-this\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('receiver must be an object');\n\t}\n\tif (\n\t\t!(O instanceof RegExpStringIterator)\n\t\t|| !SLOT.has(O, '[[IteratingRegExp]]')\n\t\t|| !SLOT.has(O, '[[IteratedString]]')\n\t\t|| !SLOT.has(O, '[[Global]]')\n\t\t|| !SLOT.has(O, '[[Unicode]]')\n\t\t|| !SLOT.has(O, '[[Done]]')\n\t) {\n\t\tthrow new $TypeError('\"this\" value must be a RegExpStringIterator instance');\n\t}\n\tif (SLOT.get(O, '[[Done]]')) {\n\t\treturn CreateIterResultObject(undefined, true);\n\t}\n\tvar R = SLOT.get(O, '[[IteratingRegExp]]');\n\tvar S = SLOT.get(O, '[[IteratedString]]');\n\tvar global = SLOT.get(O, '[[Global]]');\n\tvar fullUnicode = SLOT.get(O, '[[Unicode]]');\n\tvar match = RegExpExec(R, S);\n\tif (match === null) {\n\t\tSLOT.set(O, '[[Done]]', true);\n\t\treturn CreateIterResultObject(undefined, true);\n\t}\n\tif (global) {\n\t\tvar matchStr = ToString(Get(match, '0'));\n\t\tif (matchStr === '') {\n\t\t\tvar thisIndex = ToLength(Get(R, 'lastIndex'));\n\t\t\tvar nextIndex = AdvanceStringIndex(S, thisIndex, fullUnicode);\n\t\t\tSet(R, 'lastIndex', nextIndex, true);\n\t\t}\n\t\treturn CreateIterResultObject(match, false);\n\t}\n\tSLOT.set(O, '[[Done]]', true);\n\treturn CreateIterResultObject(match, false);\n};\nCreateMethodProperty(RegExpStringIterator.prototype, 'next', RegExpStringIteratorNext);\n\nif (hasSymbols) {\n\tsetToStringTag(RegExpStringIterator.prototype, 'RegExp String Iterator');\n\n\tif (Symbol.iterator && typeof RegExpStringIterator.prototype[Symbol.iterator] !== 'function') {\n\t\tvar iteratorFn = function SymbolIterator() {\n\t\t\treturn this;\n\t\t};\n\t\tCreateMethodProperty(RegExpStringIterator.prototype, Symbol.iterator, iteratorFn);\n\t}\n}\n\n// https://262.ecma-international.org/11.0/#sec-createregexpstringiterator\nmodule.exports = function CreateRegExpStringIterator(R, S, global, fullUnicode) {\n\t// assert R.global === global && R.unicode === fullUnicode?\n\treturn new RegExpStringIterator(R, S, global, fullUnicode);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar isPropertyDescriptor = require('../helpers/isPropertyDescriptor');\nvar DefineOwnProperty = require('../helpers/DefineOwnProperty');\n\nvar FromPropertyDescriptor = require('./FromPropertyDescriptor');\nvar IsAccessorDescriptor = require('./IsAccessorDescriptor');\nvar IsDataDescriptor = require('./IsDataDescriptor');\nvar IsPropertyKey = require('./IsPropertyKey');\nvar SameValue = require('./SameValue');\nvar ToPropertyDescriptor = require('./ToPropertyDescriptor');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-definepropertyorthrow\n\nmodule.exports = function DefinePropertyOrThrow(O, P, desc) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true');\n\t}\n\n\tvar Desc = isPropertyDescriptor({\n\t\tType: Type,\n\t\tIsDataDescriptor: IsDataDescriptor,\n\t\tIsAccessorDescriptor: IsAccessorDescriptor\n\t}, desc) ? desc : ToPropertyDescriptor(desc);\n\tif (!isPropertyDescriptor({\n\t\tType: Type,\n\t\tIsDataDescriptor: IsDataDescriptor,\n\t\tIsAccessorDescriptor: IsAccessorDescriptor\n\t}, Desc)) {\n\t\tthrow new $TypeError('Assertion failed: Desc is not a valid Property Descriptor');\n\t}\n\n\treturn DefineOwnProperty(\n\t\tIsDataDescriptor,\n\t\tSameValue,\n\t\tFromPropertyDescriptor,\n\t\tO,\n\t\tP,\n\t\tDesc\n\t);\n};\n","'use strict';\n\nvar assertRecord = require('../helpers/assertRecord');\nvar fromPropertyDescriptor = require('../helpers/fromPropertyDescriptor');\n\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-frompropertydescriptor\n\nmodule.exports = function FromPropertyDescriptor(Desc) {\n\tif (typeof Desc !== 'undefined') {\n\t\tassertRecord(Type, 'Property Descriptor', 'Desc', Desc);\n\t}\n\n\treturn fromPropertyDescriptor(Desc);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar inspect = require('object-inspect');\n\nvar IsPropertyKey = require('./IsPropertyKey');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-get-o-p\n\nmodule.exports = function Get(O, P) {\n\t// 7.3.1.1\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\t// 7.3.1.2\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P));\n\t}\n\t// 7.3.1.3\n\treturn O[P];\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar GetV = require('./GetV');\nvar IsCallable = require('./IsCallable');\nvar IsPropertyKey = require('./IsPropertyKey');\n\nvar inspect = require('object-inspect');\n\n// https://262.ecma-international.org/6.0/#sec-getmethod\n\nmodule.exports = function GetMethod(O, P) {\n\t// 7.3.9.1\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true');\n\t}\n\n\t// 7.3.9.2\n\tvar func = GetV(O, P);\n\n\t// 7.3.9.4\n\tif (func == null) {\n\t\treturn void 0;\n\t}\n\n\t// 7.3.9.5\n\tif (!IsCallable(func)) {\n\t\tthrow new $TypeError(inspect(P) + ' is not a function: ' + inspect(func));\n\t}\n\n\t// 7.3.9.6\n\treturn func;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar inspect = require('object-inspect');\n\nvar IsPropertyKey = require('./IsPropertyKey');\n// var ToObject = require('./ToObject');\n\n// https://262.ecma-international.org/6.0/#sec-getv\n\nmodule.exports = function GetV(V, P) {\n\t// 7.3.2.1\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P));\n\t}\n\n\t// 7.3.2.2-3\n\t// var O = ToObject(V);\n\n\t// 7.3.2.4\n\treturn V[P];\n};\n","'use strict';\n\nvar has = require('has');\n\nvar Type = require('./Type');\n\nvar assertRecord = require('../helpers/assertRecord');\n\n// https://262.ecma-international.org/5.1/#sec-8.10.1\n\nmodule.exports = function IsAccessorDescriptor(Desc) {\n\tif (typeof Desc === 'undefined') {\n\t\treturn false;\n\t}\n\n\tassertRecord(Type, 'Property Descriptor', 'Desc', Desc);\n\n\tif (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n","'use strict';\n\n// https://262.ecma-international.org/6.0/#sec-isarray\nmodule.exports = require('../helpers/IsArray');\n","'use strict';\n\n// http://262.ecma-international.org/5.1/#sec-9.11\n\nmodule.exports = require('is-callable');\n","'use strict';\n\nvar GetIntrinsic = require('../GetIntrinsic.js');\n\nvar $construct = GetIntrinsic('%Reflect.construct%', true);\n\nvar DefinePropertyOrThrow = require('./DefinePropertyOrThrow');\ntry {\n\tDefinePropertyOrThrow({}, '', { '[[Get]]': function () {} });\n} catch (e) {\n\t// Accessor properties aren't supported\n\tDefinePropertyOrThrow = null;\n}\n\n// https://262.ecma-international.org/6.0/#sec-isconstructor\n\nif (DefinePropertyOrThrow && $construct) {\n\tvar isConstructorMarker = {};\n\tvar badArrayLike = {};\n\tDefinePropertyOrThrow(badArrayLike, 'length', {\n\t\t'[[Get]]': function () {\n\t\t\tthrow isConstructorMarker;\n\t\t},\n\t\t'[[Enumerable]]': true\n\t});\n\n\tmodule.exports = function IsConstructor(argument) {\n\t\ttry {\n\t\t\t// `Reflect.construct` invokes `IsConstructor(target)` before `Get(args, 'length')`:\n\t\t\t$construct(argument, badArrayLike);\n\t\t} catch (err) {\n\t\t\treturn err === isConstructorMarker;\n\t\t}\n\t};\n} else {\n\tmodule.exports = function IsConstructor(argument) {\n\t\t// unfortunately there's no way to truly check this without try/catch `new argument` in old environments\n\t\treturn typeof argument === 'function' && !!argument.prototype;\n\t};\n}\n","'use strict';\n\nvar has = require('has');\n\nvar Type = require('./Type');\n\nvar assertRecord = require('../helpers/assertRecord');\n\n// https://262.ecma-international.org/5.1/#sec-8.10.2\n\nmodule.exports = function IsDataDescriptor(Desc) {\n\tif (typeof Desc === 'undefined') {\n\t\treturn false;\n\t}\n\n\tassertRecord(Type, 'Property Descriptor', 'Desc', Desc);\n\n\tif (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) {\n\t\treturn false;\n\t}\n\n\treturn true;\n};\n","'use strict';\n\n// https://262.ecma-international.org/6.0/#sec-ispropertykey\n\nmodule.exports = function IsPropertyKey(argument) {\n\treturn typeof argument === 'string' || typeof argument === 'symbol';\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $match = GetIntrinsic('%Symbol.match%', true);\n\nvar hasRegExpMatcher = require('is-regex');\n\nvar ToBoolean = require('./ToBoolean');\n\n// https://262.ecma-international.org/6.0/#sec-isregexp\n\nmodule.exports = function IsRegExp(argument) {\n\tif (!argument || typeof argument !== 'object') {\n\t\treturn false;\n\t}\n\tif ($match) {\n\t\tvar isRegExp = argument[$match];\n\t\tif (typeof isRegExp !== 'undefined') {\n\t\t\treturn ToBoolean(isRegExp);\n\t\t}\n\t}\n\treturn hasRegExpMatcher(argument);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $ObjectCreate = GetIntrinsic('%Object.create%', true);\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\n\nvar IsArray = require('./IsArray');\nvar Type = require('./Type');\n\nvar forEach = require('../helpers/forEach');\n\nvar SLOT = require('internal-slot');\n\nvar hasProto = require('has-proto')();\n\n// https://262.ecma-international.org/11.0/#sec-objectcreate\n\nmodule.exports = function OrdinaryObjectCreate(proto) {\n\tif (proto !== null && Type(proto) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: `proto` must be null or an object');\n\t}\n\tvar additionalInternalSlotsList = arguments.length < 2 ? [] : arguments[1];\n\tif (!IsArray(additionalInternalSlotsList)) {\n\t\tthrow new $TypeError('Assertion failed: `additionalInternalSlotsList` must be an Array');\n\t}\n\n\t// var internalSlotsList = ['[[Prototype]]', '[[Extensible]]']; // step 1\n\t// internalSlotsList.push(...additionalInternalSlotsList); // step 2\n\t// var O = MakeBasicObject(internalSlotsList); // step 3\n\t// setProto(O, proto); // step 4\n\t// return O; // step 5\n\n\tvar O;\n\tif ($ObjectCreate) {\n\t\tO = $ObjectCreate(proto);\n\t} else if (hasProto) {\n\t\tO = { __proto__: proto };\n\t} else {\n\t\tif (proto === null) {\n\t\t\tthrow new $SyntaxError('native Object.create support is required to create null objects');\n\t\t}\n\t\tvar T = function T() {};\n\t\tT.prototype = proto;\n\t\tO = new T();\n\t}\n\n\tif (additionalInternalSlotsList.length > 0) {\n\t\tforEach(additionalInternalSlotsList, function (slot) {\n\t\t\tSLOT.set(O, slot, void undefined);\n\t\t});\n\t}\n\n\treturn O;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar regexExec = require('call-bind/callBound')('RegExp.prototype.exec');\n\nvar Call = require('./Call');\nvar Get = require('./Get');\nvar IsCallable = require('./IsCallable');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-regexpexec\n\nmodule.exports = function RegExpExec(R, S) {\n\tif (Type(R) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: `R` must be an Object');\n\t}\n\tif (Type(S) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `S` must be a String');\n\t}\n\tvar exec = Get(R, 'exec');\n\tif (IsCallable(exec)) {\n\t\tvar result = Call(exec, R, [S]);\n\t\tif (result === null || Type(result) === 'Object') {\n\t\t\treturn result;\n\t\t}\n\t\tthrow new $TypeError('\"exec\" method must return `null` or an Object');\n\t}\n\treturn regexExec(R, S);\n};\n","'use strict';\n\nmodule.exports = require('../5/CheckObjectCoercible');\n","'use strict';\n\nvar $isNaN = require('../helpers/isNaN');\n\n// http://262.ecma-international.org/5.1/#sec-9.12\n\nmodule.exports = function SameValue(x, y) {\n\tif (x === y) { // 0 === -0, but they are not identical.\n\t\tif (x === 0) { return 1 / x === 1 / y; }\n\t\treturn true;\n\t}\n\treturn $isNaN(x) && $isNaN(y);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar IsPropertyKey = require('./IsPropertyKey');\nvar SameValue = require('./SameValue');\nvar Type = require('./Type');\n\n// IE 9 does not throw in strict mode when writability/configurability/extensibility is violated\nvar noThrowOnStrictViolation = (function () {\n\ttry {\n\t\tdelete [].length;\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n}());\n\n// https://262.ecma-international.org/6.0/#sec-set-o-p-v-throw\n\nmodule.exports = function Set(O, P, V, Throw) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: `O` must be an Object');\n\t}\n\tif (!IsPropertyKey(P)) {\n\t\tthrow new $TypeError('Assertion failed: `P` must be a Property Key');\n\t}\n\tif (Type(Throw) !== 'Boolean') {\n\t\tthrow new $TypeError('Assertion failed: `Throw` must be a Boolean');\n\t}\n\tif (Throw) {\n\t\tO[P] = V; // eslint-disable-line no-param-reassign\n\t\tif (noThrowOnStrictViolation && !SameValue(O[P], V)) {\n\t\t\tthrow new $TypeError('Attempted to assign to readonly property.');\n\t\t}\n\t\treturn true;\n\t}\n\ttry {\n\t\tO[P] = V; // eslint-disable-line no-param-reassign\n\t\treturn noThrowOnStrictViolation ? SameValue(O[P], V) : true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $species = GetIntrinsic('%Symbol.species%', true);\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar IsConstructor = require('./IsConstructor');\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/6.0/#sec-speciesconstructor\n\nmodule.exports = function SpeciesConstructor(O, defaultConstructor) {\n\tif (Type(O) !== 'Object') {\n\t\tthrow new $TypeError('Assertion failed: Type(O) is not Object');\n\t}\n\tvar C = O.constructor;\n\tif (typeof C === 'undefined') {\n\t\treturn defaultConstructor;\n\t}\n\tif (Type(C) !== 'Object') {\n\t\tthrow new $TypeError('O.constructor is not an Object');\n\t}\n\tvar S = $species ? C[$species] : void 0;\n\tif (S == null) {\n\t\treturn defaultConstructor;\n\t}\n\tif (IsConstructor(S)) {\n\t\treturn S;\n\t}\n\tthrow new $TypeError('no constructor found');\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $Number = GetIntrinsic('%Number%');\nvar $RegExp = GetIntrinsic('%RegExp%');\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $parseInteger = GetIntrinsic('%parseInt%');\n\nvar callBound = require('call-bind/callBound');\nvar regexTester = require('safe-regex-test');\n\nvar $strSlice = callBound('String.prototype.slice');\nvar isBinary = regexTester(/^0b[01]+$/i);\nvar isOctal = regexTester(/^0o[0-7]+$/i);\nvar isInvalidHexLiteral = regexTester(/^[-+]0x[0-9a-f]+$/i);\nvar nonWS = ['\\u0085', '\\u200b', '\\ufffe'].join('');\nvar nonWSregex = new $RegExp('[' + nonWS + ']', 'g');\nvar hasNonWS = regexTester(nonWSregex);\n\nvar $trim = require('string.prototype.trim');\n\nvar Type = require('./Type');\n\n// https://262.ecma-international.org/13.0/#sec-stringtonumber\n\nmodule.exports = function StringToNumber(argument) {\n\tif (Type(argument) !== 'String') {\n\t\tthrow new $TypeError('Assertion failed: `argument` is not a String');\n\t}\n\tif (isBinary(argument)) {\n\t\treturn $Number($parseInteger($strSlice(argument, 2), 2));\n\t}\n\tif (isOctal(argument)) {\n\t\treturn $Number($parseInteger($strSlice(argument, 2), 8));\n\t}\n\tif (hasNonWS(argument) || isInvalidHexLiteral(argument)) {\n\t\treturn NaN;\n\t}\n\tvar trimmed = $trim(argument);\n\tif (trimmed !== argument) {\n\t\treturn StringToNumber(trimmed);\n\t}\n\treturn $Number(argument);\n};\n","'use strict';\n\n// http://262.ecma-international.org/5.1/#sec-9.2\n\nmodule.exports = function ToBoolean(value) { return !!value; };\n","'use strict';\n\nvar ToNumber = require('./ToNumber');\nvar truncate = require('./truncate');\n\nvar $isNaN = require('../helpers/isNaN');\nvar $isFinite = require('../helpers/isFinite');\n\n// https://262.ecma-international.org/14.0/#sec-tointegerorinfinity\n\nmodule.exports = function ToIntegerOrInfinity(value) {\n\tvar number = ToNumber(value);\n\tif ($isNaN(number) || number === 0) { return 0; }\n\tif (!$isFinite(number)) { return number; }\n\treturn truncate(number);\n};\n","'use strict';\n\nvar MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');\n\nvar ToIntegerOrInfinity = require('./ToIntegerOrInfinity');\n\nmodule.exports = function ToLength(argument) {\n\tvar len = ToIntegerOrInfinity(argument);\n\tif (len <= 0) { return 0; } // includes converting -0 to +0\n\tif (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; }\n\treturn len;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $Number = GetIntrinsic('%Number%');\nvar isPrimitive = require('../helpers/isPrimitive');\n\nvar ToPrimitive = require('./ToPrimitive');\nvar StringToNumber = require('./StringToNumber');\n\n// https://262.ecma-international.org/13.0/#sec-tonumber\n\nmodule.exports = function ToNumber(argument) {\n\tvar value = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number);\n\tif (typeof value === 'symbol') {\n\t\tthrow new $TypeError('Cannot convert a Symbol value to a number');\n\t}\n\tif (typeof value === 'bigint') {\n\t\tthrow new $TypeError('Conversion from \\'BigInt\\' to \\'number\\' is not allowed.');\n\t}\n\tif (typeof value === 'string') {\n\t\treturn StringToNumber(value);\n\t}\n\treturn $Number(value);\n};\n","'use strict';\n\nvar toPrimitive = require('es-to-primitive/es2015');\n\n// https://262.ecma-international.org/6.0/#sec-toprimitive\n\nmodule.exports = function ToPrimitive(input) {\n\tif (arguments.length > 1) {\n\t\treturn toPrimitive(input, arguments[1]);\n\t}\n\treturn toPrimitive(input);\n};\n","'use strict';\n\nvar has = require('has');\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nvar Type = require('./Type');\nvar ToBoolean = require('./ToBoolean');\nvar IsCallable = require('./IsCallable');\n\n// https://262.ecma-international.org/5.1/#sec-8.10.5\n\nmodule.exports = function ToPropertyDescriptor(Obj) {\n\tif (Type(Obj) !== 'Object') {\n\t\tthrow new $TypeError('ToPropertyDescriptor requires an object');\n\t}\n\n\tvar desc = {};\n\tif (has(Obj, 'enumerable')) {\n\t\tdesc['[[Enumerable]]'] = ToBoolean(Obj.enumerable);\n\t}\n\tif (has(Obj, 'configurable')) {\n\t\tdesc['[[Configurable]]'] = ToBoolean(Obj.configurable);\n\t}\n\tif (has(Obj, 'value')) {\n\t\tdesc['[[Value]]'] = Obj.value;\n\t}\n\tif (has(Obj, 'writable')) {\n\t\tdesc['[[Writable]]'] = ToBoolean(Obj.writable);\n\t}\n\tif (has(Obj, 'get')) {\n\t\tvar getter = Obj.get;\n\t\tif (typeof getter !== 'undefined' && !IsCallable(getter)) {\n\t\t\tthrow new $TypeError('getter must be a function');\n\t\t}\n\t\tdesc['[[Get]]'] = getter;\n\t}\n\tif (has(Obj, 'set')) {\n\t\tvar setter = Obj.set;\n\t\tif (typeof setter !== 'undefined' && !IsCallable(setter)) {\n\t\t\tthrow new $TypeError('setter must be a function');\n\t\t}\n\t\tdesc['[[Set]]'] = setter;\n\t}\n\n\tif ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) {\n\t\tthrow new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');\n\t}\n\treturn desc;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $String = GetIntrinsic('%String%');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// https://262.ecma-international.org/6.0/#sec-tostring\n\nmodule.exports = function ToString(argument) {\n\tif (typeof argument === 'symbol') {\n\t\tthrow new $TypeError('Cannot convert a Symbol value to a string');\n\t}\n\treturn $String(argument);\n};\n","'use strict';\n\nvar ES5Type = require('../5/Type');\n\n// https://262.ecma-international.org/11.0/#sec-ecmascript-data-types-and-values\n\nmodule.exports = function Type(x) {\n\tif (typeof x === 'symbol') {\n\t\treturn 'Symbol';\n\t}\n\tif (typeof x === 'bigint') {\n\t\treturn 'BigInt';\n\t}\n\treturn ES5Type(x);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $fromCharCode = GetIntrinsic('%String.fromCharCode%');\n\nvar isLeadingSurrogate = require('../helpers/isLeadingSurrogate');\nvar isTrailingSurrogate = require('../helpers/isTrailingSurrogate');\n\n// https://tc39.es/ecma262/2020/#sec-utf16decodesurrogatepair\n\nmodule.exports = function UTF16SurrogatePairToCodePoint(lead, trail) {\n\tif (!isLeadingSurrogate(lead) || !isTrailingSurrogate(trail)) {\n\t\tthrow new $TypeError('Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code');\n\t}\n\t// var cp = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;\n\treturn $fromCharCode(lead) + $fromCharCode(trail);\n};\n","'use strict';\n\nvar Type = require('./Type');\n\n// var modulo = require('./modulo');\nvar $floor = Math.floor;\n\n// http://262.ecma-international.org/11.0/#eqn-floor\n\nmodule.exports = function floor(x) {\n\t// return x - modulo(x, 1);\n\tif (Type(x) === 'BigInt') {\n\t\treturn x;\n\t}\n\treturn $floor(x);\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar floor = require('./floor');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// https://262.ecma-international.org/14.0/#eqn-truncate\n\nmodule.exports = function truncate(x) {\n\tif (typeof x !== 'number' && typeof x !== 'bigint') {\n\t\tthrow new $TypeError('argument must be a Number or a BigInt');\n\t}\n\tvar result = x < 0 ? -floor(-x) : floor(x);\n\treturn result === 0 ? 0 : result; // in the spec, these are math values, so we filter out -0 here\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\n\n// http://262.ecma-international.org/5.1/#sec-9.10\n\nmodule.exports = function CheckObjectCoercible(value, optMessage) {\n\tif (value == null) {\n\t\tthrow new $TypeError(optMessage || ('Cannot call method on ' + value));\n\t}\n\treturn value;\n};\n","'use strict';\n\n// https://262.ecma-international.org/5.1/#sec-8\n\nmodule.exports = function Type(x) {\n\tif (x === null) {\n\t\treturn 'Null';\n\t}\n\tif (typeof x === 'undefined') {\n\t\treturn 'Undefined';\n\t}\n\tif (typeof x === 'function' || typeof x === 'object') {\n\t\treturn 'Object';\n\t}\n\tif (typeof x === 'number') {\n\t\treturn 'Number';\n\t}\n\tif (typeof x === 'boolean') {\n\t\treturn 'Boolean';\n\t}\n\tif (typeof x === 'string') {\n\t\treturn 'String';\n\t}\n};\n","'use strict';\n\n// TODO: remove, semver-major\n\nmodule.exports = require('get-intrinsic');\n","'use strict';\n\nvar hasPropertyDescriptors = require('has-property-descriptors');\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $defineProperty = hasPropertyDescriptors() && GetIntrinsic('%Object.defineProperty%', true);\n\nvar hasArrayLengthDefineBug = hasPropertyDescriptors.hasArrayLengthDefineBug();\n\n// eslint-disable-next-line global-require\nvar isArray = hasArrayLengthDefineBug && require('../helpers/IsArray');\n\nvar callBound = require('call-bind/callBound');\n\nvar $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');\n\n// eslint-disable-next-line max-params\nmodule.exports = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) {\n\tif (!$defineProperty) {\n\t\tif (!IsDataDescriptor(desc)) {\n\t\t\t// ES3 does not support getters/setters\n\t\t\treturn false;\n\t\t}\n\t\tif (!desc['[[Configurable]]'] || !desc['[[Writable]]']) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// fallback for ES3\n\t\tif (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) {\n\t\t\t// a non-enumerable existing property\n\t\t\treturn false;\n\t\t}\n\n\t\t// property does not exist at all, or exists but is enumerable\n\t\tvar V = desc['[[Value]]'];\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tO[P] = V; // will use [[Define]]\n\t\treturn SameValue(O[P], V);\n\t}\n\tif (\n\t\thasArrayLengthDefineBug\n\t\t&& P === 'length'\n\t\t&& '[[Value]]' in desc\n\t\t&& isArray(O)\n\t\t&& O.length !== desc['[[Value]]']\n\t) {\n\t\t// eslint-disable-next-line no-param-reassign\n\t\tO.length = desc['[[Value]]'];\n\t\treturn O.length === desc['[[Value]]'];\n\t}\n\n\t$defineProperty(O, P, FromPropertyDescriptor(desc));\n\treturn true;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $Array = GetIntrinsic('%Array%');\n\n// eslint-disable-next-line global-require\nvar toStr = !$Array.isArray && require('call-bind/callBound')('Object.prototype.toString');\n\nmodule.exports = $Array.isArray || function IsArray(argument) {\n\treturn toStr(argument) === '[object Array]';\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\n\nvar has = require('has');\nvar isInteger = require('./isInteger');\n\nvar isMatchRecord = require('./isMatchRecord');\n\nvar predicates = {\n\t// https://262.ecma-international.org/6.0/#sec-property-descriptor-specification-type\n\t'Property Descriptor': function isPropertyDescriptor(Desc) {\n\t\tvar allowed = {\n\t\t\t'[[Configurable]]': true,\n\t\t\t'[[Enumerable]]': true,\n\t\t\t'[[Get]]': true,\n\t\t\t'[[Set]]': true,\n\t\t\t'[[Value]]': true,\n\t\t\t'[[Writable]]': true\n\t\t};\n\n\t\tif (!Desc) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (var key in Desc) { // eslint-disable-line\n\t\t\tif (has(Desc, key) && !allowed[key]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tvar isData = has(Desc, '[[Value]]');\n\t\tvar IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]');\n\t\tif (isData && IsAccessor) {\n\t\t\tthrow new $TypeError('Property Descriptors may not be both accessor and data descriptors');\n\t\t}\n\t\treturn true;\n\t},\n\t// https://262.ecma-international.org/13.0/#sec-match-records\n\t'Match Record': isMatchRecord,\n\t'Iterator Record': function isIteratorRecord(value) {\n\t\treturn has(value, '[[Iterator]]') && has(value, '[[NextMethod]]') && has(value, '[[Done]]');\n\t},\n\t'PromiseCapability Record': function isPromiseCapabilityRecord(value) {\n\t\treturn !!value\n\t\t\t&& has(value, '[[Resolve]]')\n\t\t\t&& typeof value['[[Resolve]]'] === 'function'\n\t\t\t&& has(value, '[[Reject]]')\n\t\t\t&& typeof value['[[Reject]]'] === 'function'\n\t\t\t&& has(value, '[[Promise]]')\n\t\t\t&& value['[[Promise]]']\n\t\t\t&& typeof value['[[Promise]]'].then === 'function';\n\t},\n\t'AsyncGeneratorRequest Record': function isAsyncGeneratorRequestRecord(value) {\n\t\treturn !!value\n\t\t\t&& has(value, '[[Completion]]') // TODO: confirm is a completion record\n\t\t\t&& has(value, '[[Capability]]')\n\t\t\t&& predicates['PromiseCapability Record'](value['[[Capability]]']);\n\t},\n\t'RegExp Record': function isRegExpRecord(value) {\n\t\treturn value\n\t\t\t&& has(value, '[[IgnoreCase]]')\n\t\t\t&& typeof value['[[IgnoreCase]]'] === 'boolean'\n\t\t\t&& has(value, '[[Multiline]]')\n\t\t\t&& typeof value['[[Multiline]]'] === 'boolean'\n\t\t\t&& has(value, '[[DotAll]]')\n\t\t\t&& typeof value['[[DotAll]]'] === 'boolean'\n\t\t\t&& has(value, '[[Unicode]]')\n\t\t\t&& typeof value['[[Unicode]]'] === 'boolean'\n\t\t\t&& has(value, '[[CapturingGroupsCount]]')\n\t\t\t&& typeof value['[[CapturingGroupsCount]]'] === 'number'\n\t\t\t&& isInteger(value['[[CapturingGroupsCount]]'])\n\t\t\t&& value['[[CapturingGroupsCount]]'] >= 0;\n\t}\n};\n\nmodule.exports = function assertRecord(Type, recordType, argumentName, value) {\n\tvar predicate = predicates[recordType];\n\tif (typeof predicate !== 'function') {\n\t\tthrow new $SyntaxError('unknown record type: ' + recordType);\n\t}\n\tif (Type(value) !== 'Object' || !predicate(value)) {\n\t\tthrow new $TypeError(argumentName + ' must be a ' + recordType);\n\t}\n};\n","'use strict';\n\nmodule.exports = function forEach(array, callback) {\n\tfor (var i = 0; i < array.length; i += 1) {\n\t\tcallback(array[i], i, array); // eslint-disable-line callback-return\n\t}\n};\n","'use strict';\n\nmodule.exports = function fromPropertyDescriptor(Desc) {\n\tif (typeof Desc === 'undefined') {\n\t\treturn Desc;\n\t}\n\tvar obj = {};\n\tif ('[[Value]]' in Desc) {\n\t\tobj.value = Desc['[[Value]]'];\n\t}\n\tif ('[[Writable]]' in Desc) {\n\t\tobj.writable = !!Desc['[[Writable]]'];\n\t}\n\tif ('[[Get]]' in Desc) {\n\t\tobj.get = Desc['[[Get]]'];\n\t}\n\tif ('[[Set]]' in Desc) {\n\t\tobj.set = Desc['[[Set]]'];\n\t}\n\tif ('[[Enumerable]]' in Desc) {\n\t\tobj.enumerable = !!Desc['[[Enumerable]]'];\n\t}\n\tif ('[[Configurable]]' in Desc) {\n\t\tobj.configurable = !!Desc['[[Configurable]]'];\n\t}\n\treturn obj;\n};\n","'use strict';\n\nvar $isNaN = require('./isNaN');\n\nmodule.exports = function (x) { return (typeof x === 'number' || typeof x === 'bigint') && !$isNaN(x) && x !== Infinity && x !== -Infinity; };\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $abs = GetIntrinsic('%Math.abs%');\nvar $floor = GetIntrinsic('%Math.floor%');\n\nvar $isNaN = require('./isNaN');\nvar $isFinite = require('./isFinite');\n\nmodule.exports = function isInteger(argument) {\n\tif (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {\n\t\treturn false;\n\t}\n\tvar absValue = $abs(argument);\n\treturn $floor(absValue) === absValue;\n};\n\n","'use strict';\n\nmodule.exports = function isLeadingSurrogate(charCode) {\n\treturn typeof charCode === 'number' && charCode >= 0xD800 && charCode <= 0xDBFF;\n};\n","'use strict';\n\nvar has = require('has');\n\n// https://262.ecma-international.org/13.0/#sec-match-records\n\nmodule.exports = function isMatchRecord(record) {\n\treturn (\n\t\thas(record, '[[StartIndex]]')\n && has(record, '[[EndIndex]]')\n && record['[[StartIndex]]'] >= 0\n && record['[[EndIndex]]'] >= record['[[StartIndex]]']\n && String(parseInt(record['[[StartIndex]]'], 10)) === String(record['[[StartIndex]]'])\n && String(parseInt(record['[[EndIndex]]'], 10)) === String(record['[[EndIndex]]'])\n\t);\n};\n","'use strict';\n\nmodule.exports = Number.isNaN || function isNaN(a) {\n\treturn a !== a;\n};\n","'use strict';\n\nmodule.exports = function isPrimitive(value) {\n\treturn value === null || (typeof value !== 'function' && typeof value !== 'object');\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar has = require('has');\nvar $TypeError = GetIntrinsic('%TypeError%');\n\nmodule.exports = function IsPropertyDescriptor(ES, Desc) {\n\tif (ES.Type(Desc) !== 'Object') {\n\t\treturn false;\n\t}\n\tvar allowed = {\n\t\t'[[Configurable]]': true,\n\t\t'[[Enumerable]]': true,\n\t\t'[[Get]]': true,\n\t\t'[[Set]]': true,\n\t\t'[[Value]]': true,\n\t\t'[[Writable]]': true\n\t};\n\n\tfor (var key in Desc) { // eslint-disable-line no-restricted-syntax\n\t\tif (has(Desc, key) && !allowed[key]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tif (ES.IsDataDescriptor(Desc) && ES.IsAccessorDescriptor(Desc)) {\n\t\tthrow new $TypeError('Property Descriptors may not be both accessor and data descriptors');\n\t}\n\treturn true;\n};\n","'use strict';\n\nmodule.exports = function isTrailingSurrogate(charCode) {\n\treturn typeof charCode === 'number' && charCode >= 0xDC00 && charCode <= 0xDFFF;\n};\n","'use strict';\n\nmodule.exports = Number.MAX_SAFE_INTEGER || 9007199254740991; // Math.pow(2, 53) - 1;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","const debug = false;\nexport function log(...args) {\n if (debug) {\n console.log(...args);\n }\n}\n","//\n// Copyright 2021 Readium Foundation. All rights reserved.\n// Use of this source code is governed by the BSD-style license\n// available in the top-level LICENSE file of the project.\n//\nimport { log } from \"./log\";\n/**\n * Transforms a DOMRect into the zoomed coordinate system.\n *\n * See https://issues.chromium.org/issues/40391865#comment9\n */\nexport function dezoomDomRect(rect, zoomLevel) {\n return new DOMRect(rect.x / zoomLevel, rect.y / zoomLevel, rect.width / zoomLevel, rect.height / zoomLevel);\n}\n/**\n * Transforms a rect into the zoomed coordinate system.\n *\n * See https://issues.chromium.org/issues/40391865#comment9\n */\nexport function dezoomRect(rect, zoomLevel) {\n return {\n bottom: rect.bottom / zoomLevel,\n height: rect.height / zoomLevel,\n left: rect.left / zoomLevel,\n right: rect.right / zoomLevel,\n top: rect.top / zoomLevel,\n width: rect.width / zoomLevel,\n };\n}\nexport function domRectToRect(rect) {\n return {\n width: rect.width,\n height: rect.height,\n left: rect.left,\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n };\n}\nexport function getClientRectsNoOverlap(range, doNotMergeHorizontallyAlignedRects) {\n const clientRects = range.getClientRects();\n const tolerance = 1;\n const originalRects = [];\n for (const rangeClientRect of clientRects) {\n originalRects.push({\n bottom: rangeClientRect.bottom,\n height: rangeClientRect.height,\n left: rangeClientRect.left,\n right: rangeClientRect.right,\n top: rangeClientRect.top,\n width: rangeClientRect.width,\n });\n }\n const mergedRects = mergeTouchingRects(originalRects, tolerance, doNotMergeHorizontallyAlignedRects);\n const noContainedRects = removeContainedRects(mergedRects, tolerance);\n const newRects = replaceOverlapingRects(noContainedRects);\n const minArea = 2 * 2;\n for (let j = newRects.length - 1; j >= 0; j--) {\n const rect = newRects[j];\n const bigEnough = rect.width * rect.height > minArea;\n if (!bigEnough) {\n if (newRects.length > 1) {\n log(\"CLIENT RECT: remove small\");\n newRects.splice(j, 1);\n }\n else {\n log(\"CLIENT RECT: remove small, but keep otherwise empty!\");\n break;\n }\n }\n }\n log(`CLIENT RECT: reduced ${originalRects.length} --> ${newRects.length}`);\n return newRects;\n}\nfunction mergeTouchingRects(rects, tolerance, doNotMergeHorizontallyAlignedRects) {\n for (let i = 0; i < rects.length; i++) {\n for (let j = i + 1; j < rects.length; j++) {\n const rect1 = rects[i];\n const rect2 = rects[j];\n if (rect1 === rect2) {\n log(\"mergeTouchingRects rect1 === rect2 ??!\");\n continue;\n }\n const rectsLineUpVertically = almostEqual(rect1.top, rect2.top, tolerance) &&\n almostEqual(rect1.bottom, rect2.bottom, tolerance);\n const rectsLineUpHorizontally = almostEqual(rect1.left, rect2.left, tolerance) &&\n almostEqual(rect1.right, rect2.right, tolerance);\n const horizontalAllowed = !doNotMergeHorizontallyAlignedRects;\n const aligned = (rectsLineUpHorizontally && horizontalAllowed) ||\n (rectsLineUpVertically && !rectsLineUpHorizontally);\n const canMerge = aligned && rectsTouchOrOverlap(rect1, rect2, tolerance);\n if (canMerge) {\n log(`CLIENT RECT: merging two into one, VERTICAL: ${rectsLineUpVertically} HORIZONTAL: ${rectsLineUpHorizontally} (${doNotMergeHorizontallyAlignedRects})`);\n const newRects = rects.filter((rect) => {\n return rect !== rect1 && rect !== rect2;\n });\n const replacementClientRect = getBoundingRect(rect1, rect2);\n newRects.push(replacementClientRect);\n return mergeTouchingRects(newRects, tolerance, doNotMergeHorizontallyAlignedRects);\n }\n }\n }\n return rects;\n}\nfunction getBoundingRect(rect1, rect2) {\n const left = Math.min(rect1.left, rect2.left);\n const right = Math.max(rect1.right, rect2.right);\n const top = Math.min(rect1.top, rect2.top);\n const bottom = Math.max(rect1.bottom, rect2.bottom);\n return {\n bottom,\n height: bottom - top,\n left,\n right,\n top,\n width: right - left,\n };\n}\nfunction removeContainedRects(rects, tolerance) {\n const rectsToKeep = new Set(rects);\n for (const rect of rects) {\n const bigEnough = rect.width > 1 && rect.height > 1;\n if (!bigEnough) {\n log(\"CLIENT RECT: remove tiny\");\n rectsToKeep.delete(rect);\n continue;\n }\n for (const possiblyContainingRect of rects) {\n if (rect === possiblyContainingRect) {\n continue;\n }\n if (!rectsToKeep.has(possiblyContainingRect)) {\n continue;\n }\n if (rectContains(possiblyContainingRect, rect, tolerance)) {\n log(\"CLIENT RECT: remove contained\");\n rectsToKeep.delete(rect);\n break;\n }\n }\n }\n return Array.from(rectsToKeep);\n}\nfunction rectContains(rect1, rect2, tolerance) {\n return (rectContainsPoint(rect1, rect2.left, rect2.top, tolerance) &&\n rectContainsPoint(rect1, rect2.right, rect2.top, tolerance) &&\n rectContainsPoint(rect1, rect2.left, rect2.bottom, tolerance) &&\n rectContainsPoint(rect1, rect2.right, rect2.bottom, tolerance));\n}\nexport function rectContainsPoint(rect, x, y, tolerance) {\n return ((rect.left < x || almostEqual(rect.left, x, tolerance)) &&\n (rect.right > x || almostEqual(rect.right, x, tolerance)) &&\n (rect.top < y || almostEqual(rect.top, y, tolerance)) &&\n (rect.bottom > y || almostEqual(rect.bottom, y, tolerance)));\n}\nfunction replaceOverlapingRects(rects) {\n for (let i = 0; i < rects.length; i++) {\n for (let j = i + 1; j < rects.length; j++) {\n const rect1 = rects[i];\n const rect2 = rects[j];\n if (rect1 === rect2) {\n log(\"replaceOverlapingRects rect1 === rect2 ??!\");\n continue;\n }\n if (rectsTouchOrOverlap(rect1, rect2, -1)) {\n let toAdd = [];\n let toRemove;\n const subtractRects1 = rectSubtract(rect1, rect2);\n if (subtractRects1.length === 1) {\n toAdd = subtractRects1;\n toRemove = rect1;\n }\n else {\n const subtractRects2 = rectSubtract(rect2, rect1);\n if (subtractRects1.length < subtractRects2.length) {\n toAdd = subtractRects1;\n toRemove = rect1;\n }\n else {\n toAdd = subtractRects2;\n toRemove = rect2;\n }\n }\n log(`CLIENT RECT: overlap, cut one rect into ${toAdd.length}`);\n const newRects = rects.filter((rect) => {\n return rect !== toRemove;\n });\n Array.prototype.push.apply(newRects, toAdd);\n return replaceOverlapingRects(newRects);\n }\n }\n }\n return rects;\n}\nfunction rectSubtract(rect1, rect2) {\n const rectIntersected = rectIntersect(rect2, rect1);\n if (rectIntersected.height === 0 || rectIntersected.width === 0) {\n return [rect1];\n }\n const rects = [];\n {\n const rectA = {\n bottom: rect1.bottom,\n height: 0,\n left: rect1.left,\n right: rectIntersected.left,\n top: rect1.top,\n width: 0,\n };\n rectA.width = rectA.right - rectA.left;\n rectA.height = rectA.bottom - rectA.top;\n if (rectA.height !== 0 && rectA.width !== 0) {\n rects.push(rectA);\n }\n }\n {\n const rectB = {\n bottom: rectIntersected.top,\n height: 0,\n left: rectIntersected.left,\n right: rectIntersected.right,\n top: rect1.top,\n width: 0,\n };\n rectB.width = rectB.right - rectB.left;\n rectB.height = rectB.bottom - rectB.top;\n if (rectB.height !== 0 && rectB.width !== 0) {\n rects.push(rectB);\n }\n }\n {\n const rectC = {\n bottom: rect1.bottom,\n height: 0,\n left: rectIntersected.left,\n right: rectIntersected.right,\n top: rectIntersected.bottom,\n width: 0,\n };\n rectC.width = rectC.right - rectC.left;\n rectC.height = rectC.bottom - rectC.top;\n if (rectC.height !== 0 && rectC.width !== 0) {\n rects.push(rectC);\n }\n }\n {\n const rectD = {\n bottom: rect1.bottom,\n height: 0,\n left: rectIntersected.right,\n right: rect1.right,\n top: rect1.top,\n width: 0,\n };\n rectD.width = rectD.right - rectD.left;\n rectD.height = rectD.bottom - rectD.top;\n if (rectD.height !== 0 && rectD.width !== 0) {\n rects.push(rectD);\n }\n }\n return rects;\n}\nfunction rectIntersect(rect1, rect2) {\n const maxLeft = Math.max(rect1.left, rect2.left);\n const minRight = Math.min(rect1.right, rect2.right);\n const maxTop = Math.max(rect1.top, rect2.top);\n const minBottom = Math.min(rect1.bottom, rect2.bottom);\n return {\n bottom: minBottom,\n height: Math.max(0, minBottom - maxTop),\n left: maxLeft,\n right: minRight,\n top: maxTop,\n width: Math.max(0, minRight - maxLeft),\n };\n}\nfunction rectsTouchOrOverlap(rect1, rect2, tolerance) {\n return ((rect1.left < rect2.right ||\n (tolerance >= 0 && almostEqual(rect1.left, rect2.right, tolerance))) &&\n (rect2.left < rect1.right ||\n (tolerance >= 0 && almostEqual(rect2.left, rect1.right, tolerance))) &&\n (rect1.top < rect2.bottom ||\n (tolerance >= 0 && almostEqual(rect1.top, rect2.bottom, tolerance))) &&\n (rect2.top < rect1.bottom ||\n (tolerance >= 0 && almostEqual(rect2.top, rect1.bottom, tolerance))));\n}\nfunction almostEqual(a, b, tolerance) {\n return Math.abs(a - b) <= tolerance;\n}\n","/**\n * From which direction to evaluate strings or nodes: from the start of a string\n * or range seeking Forwards, or from the end seeking Backwards.\n */\nvar TrimDirection;\n(function (TrimDirection) {\n TrimDirection[TrimDirection[\"Forwards\"] = 1] = \"Forwards\";\n TrimDirection[TrimDirection[\"Backwards\"] = 2] = \"Backwards\";\n})(TrimDirection || (TrimDirection = {}));\n/**\n * Return the offset of the nearest non-whitespace character to `baseOffset`\n * within the string `text`, looking in the `direction` indicated. Return -1 if\n * no non-whitespace character exists between `baseOffset` (inclusive) and the\n * terminus of the string (start or end depending on `direction`).\n */\nfunction closestNonSpaceInString(text, baseOffset, direction) {\n const nextChar = direction === TrimDirection.Forwards ? baseOffset : baseOffset - 1;\n if (text.charAt(nextChar).trim() !== \"\") {\n // baseOffset is already valid: it points at a non-whitespace character\n return baseOffset;\n }\n let availableChars;\n let availableNonWhitespaceChars;\n if (direction === TrimDirection.Backwards) {\n availableChars = text.substring(0, baseOffset);\n availableNonWhitespaceChars = availableChars.trimEnd();\n }\n else {\n availableChars = text.substring(baseOffset);\n availableNonWhitespaceChars = availableChars.trimStart();\n }\n if (!availableNonWhitespaceChars.length) {\n return -1;\n }\n const offsetDelta = availableChars.length - availableNonWhitespaceChars.length;\n return direction === TrimDirection.Backwards\n ? baseOffset - offsetDelta\n : baseOffset + offsetDelta;\n}\n/**\n * Calculate a new Range start position (TrimDirection.Forwards) or end position\n * (Backwards) for `range` that represents the nearest non-whitespace character,\n * moving into the `range` away from the relevant initial boundary node towards\n * the terminating boundary node.\n *\n * @throws {RangeError} If no text node with non-whitespace characters found\n */\nfunction closestNonSpaceInRange(range, direction) {\n const nodeIter = range.commonAncestorContainer.ownerDocument.createNodeIterator(range.commonAncestorContainer, NodeFilter.SHOW_TEXT);\n const initialBoundaryNode = direction === TrimDirection.Forwards\n ? range.startContainer\n : range.endContainer;\n const terminalBoundaryNode = direction === TrimDirection.Forwards\n ? range.endContainer\n : range.startContainer;\n let currentNode = nodeIter.nextNode();\n // Advance the NodeIterator to the `initialBoundaryNode`\n while (currentNode && currentNode !== initialBoundaryNode) {\n currentNode = nodeIter.nextNode();\n }\n if (direction === TrimDirection.Backwards) {\n // Reverse the NodeIterator direction. This will return the same node\n // as the previous `nextNode()` call (initial boundary node).\n currentNode = nodeIter.previousNode();\n }\n let trimmedOffset = -1;\n const advance = () => {\n currentNode =\n direction === TrimDirection.Forwards\n ? nodeIter.nextNode()\n : nodeIter.previousNode();\n if (currentNode) {\n const nodeText = currentNode.textContent;\n const baseOffset = direction === TrimDirection.Forwards ? 0 : nodeText.length;\n trimmedOffset = closestNonSpaceInString(nodeText, baseOffset, direction);\n }\n };\n while (currentNode &&\n trimmedOffset === -1 &&\n currentNode !== terminalBoundaryNode) {\n advance();\n }\n if (currentNode && trimmedOffset >= 0) {\n return { node: currentNode, offset: trimmedOffset };\n }\n /* istanbul ignore next */\n throw new RangeError(\"No text nodes with non-whitespace text found in range\");\n}\n/**\n * Return a new DOM Range that adjusts the start and end positions of `range` as\n * needed such that:\n *\n * - `startContainer` and `endContainer` text nodes both contain at least one\n * non-whitespace character within the Range's text content\n * - `startOffset` and `endOffset` both reference non-whitespace characters,\n * with `startOffset` immediately before the first non-whitespace character\n * and `endOffset` immediately after the last\n *\n * Whitespace characters are those that are removed by `String.prototype.trim()`\n *\n * @param range - A DOM Range that whose `startContainer` and `endContainer` are\n * both text nodes, and which contains at least one non-whitespace character.\n * @throws {RangeError}\n */\nexport function trimRange(range) {\n if (!range.toString().trim().length) {\n throw new RangeError(\"Range contains no non-whitespace text\");\n }\n if (range.startContainer.nodeType !== Node.TEXT_NODE) {\n throw new RangeError(\"Range startContainer is not a text node\");\n }\n if (range.endContainer.nodeType !== Node.TEXT_NODE) {\n throw new RangeError(\"Range endContainer is not a text node\");\n }\n const trimmedRange = range.cloneRange();\n let startTrimmed = false;\n let endTrimmed = false;\n const trimmedOffsets = {\n start: closestNonSpaceInString(range.startContainer.textContent, range.startOffset, TrimDirection.Forwards),\n end: closestNonSpaceInString(range.endContainer.textContent, range.endOffset, TrimDirection.Backwards),\n };\n if (trimmedOffsets.start >= 0) {\n trimmedRange.setStart(range.startContainer, trimmedOffsets.start);\n startTrimmed = true;\n }\n // Note: An offset of 0 is invalid for an end offset, as no text in the\n // node would be included in the range.\n if (trimmedOffsets.end > 0) {\n trimmedRange.setEnd(range.endContainer, trimmedOffsets.end);\n endTrimmed = true;\n }\n if (startTrimmed && endTrimmed) {\n return trimmedRange;\n }\n if (!startTrimmed) {\n // There are no (non-whitespace) characters between `startOffset` and the\n // end of the `startContainer` node.\n const { node, offset } = closestNonSpaceInRange(trimmedRange, TrimDirection.Forwards);\n if (node && offset >= 0) {\n trimmedRange.setStart(node, offset);\n }\n }\n if (!endTrimmed) {\n // There are no (non-whitespace) characters between the start of the Range's\n // `endContainer` text content and the `endOffset`.\n const { node, offset } = closestNonSpaceInRange(trimmedRange, TrimDirection.Backwards);\n if (node && offset > 0) {\n trimmedRange.setEnd(node, offset);\n }\n }\n return trimmedRange;\n}\n","import { trimRange } from \"./trim-range\";\n/**\n * Return the combined length of text nodes contained in `node`.\n */\nfunction nodeTextLength(node) {\n var _a, _b;\n switch (node.nodeType) {\n case Node.ELEMENT_NODE:\n case Node.TEXT_NODE:\n // nb. `textContent` excludes text in comments and processing instructions\n // when called on a parent element, so we don't need to subtract that here.\n return (_b = (_a = node.textContent) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;\n default:\n return 0;\n }\n}\n/**\n * Return the total length of the text of all previous siblings of `node`.\n */\nfunction previousSiblingsTextLength(node) {\n let sibling = node.previousSibling;\n let length = 0;\n while (sibling) {\n length += nodeTextLength(sibling);\n sibling = sibling.previousSibling;\n }\n return length;\n}\n/**\n * Resolve one or more character offsets within an element to (text node,\n * position) pairs.\n *\n * @param element\n * @param offsets - Offsets, which must be sorted in ascending order\n * @throws {RangeError}\n */\nfunction resolveOffsets(element, ...offsets) {\n let nextOffset = offsets.shift();\n const nodeIter = element.ownerDocument.createNodeIterator(element, NodeFilter.SHOW_TEXT);\n const results = [];\n let currentNode = nodeIter.nextNode();\n let textNode;\n let length = 0;\n // Find the text node containing the `nextOffset`th character from the start\n // of `element`.\n while (nextOffset !== undefined && currentNode) {\n textNode = currentNode;\n if (length + textNode.data.length > nextOffset) {\n results.push({ node: textNode, offset: nextOffset - length });\n nextOffset = offsets.shift();\n }\n else {\n currentNode = nodeIter.nextNode();\n length += textNode.data.length;\n }\n }\n // Boundary case.\n while (nextOffset !== undefined && textNode && length === nextOffset) {\n results.push({ node: textNode, offset: textNode.data.length });\n nextOffset = offsets.shift();\n }\n if (nextOffset !== undefined) {\n throw new RangeError(\"Offset exceeds text length\");\n }\n return results;\n}\n/**\n * When resolving a TextPosition, specifies the direction to search for the\n * nearest text node if `offset` is `0` and the element has no text.\n */\nexport var ResolveDirection;\n(function (ResolveDirection) {\n ResolveDirection[ResolveDirection[\"FORWARDS\"] = 1] = \"FORWARDS\";\n ResolveDirection[ResolveDirection[\"BACKWARDS\"] = 2] = \"BACKWARDS\";\n})(ResolveDirection || (ResolveDirection = {}));\n/**\n * Represents an offset within the text content of an element.\n *\n * This position can be resolved to a specific descendant node in the current\n * DOM subtree of the element using the `resolve` method.\n */\nexport class TextPosition {\n constructor(element, offset) {\n if (offset < 0) {\n throw new Error(\"Offset is invalid\");\n }\n /** Element that `offset` is relative to. */\n this.element = element;\n /** Character offset from the start of the element's `textContent`. */\n this.offset = offset;\n }\n /**\n * Return a copy of this position with offset relative to a given ancestor\n * element.\n *\n * @param parent - Ancestor of `this.element`\n */\n relativeTo(parent) {\n if (!parent.contains(this.element)) {\n throw new Error(\"Parent is not an ancestor of current element\");\n }\n let el = this.element;\n let offset = this.offset;\n while (el !== parent) {\n offset += previousSiblingsTextLength(el);\n el = el.parentElement;\n }\n return new TextPosition(el, offset);\n }\n /**\n * Resolve the position to a specific text node and offset within that node.\n *\n * Throws if `this.offset` exceeds the length of the element's text. In the\n * case where the element has no text and `this.offset` is 0, the `direction`\n * option determines what happens.\n *\n * Offsets at the boundary between two nodes are resolved to the start of the\n * node that begins at the boundary.\n *\n * @param options.direction - Specifies in which direction to search for the\n * nearest text node if `this.offset` is `0` and\n * `this.element` has no text. If not specified an\n * error is thrown.\n *\n * @throws {RangeError}\n */\n resolve(options = {}) {\n try {\n return resolveOffsets(this.element, this.offset)[0];\n }\n catch (err) {\n if (this.offset === 0 && options.direction !== undefined) {\n const tw = document.createTreeWalker(this.element.getRootNode(), NodeFilter.SHOW_TEXT);\n tw.currentNode = this.element;\n const forwards = options.direction === ResolveDirection.FORWARDS;\n const text = forwards\n ? tw.nextNode()\n : tw.previousNode();\n if (!text) {\n throw err;\n }\n return { node: text, offset: forwards ? 0 : text.data.length };\n }\n else {\n throw err;\n }\n }\n }\n /**\n * Construct a `TextPosition` that refers to the `offset`th character within\n * `node`.\n */\n static fromCharOffset(node, offset) {\n switch (node.nodeType) {\n case Node.TEXT_NODE:\n return TextPosition.fromPoint(node, offset);\n case Node.ELEMENT_NODE:\n return new TextPosition(node, offset);\n default:\n throw new Error(\"Node is not an element or text node\");\n }\n }\n /**\n * Construct a `TextPosition` representing the range start or end point (node, offset).\n *\n * @param node\n * @param offset - Offset within the node\n */\n static fromPoint(node, offset) {\n switch (node.nodeType) {\n case Node.TEXT_NODE: {\n if (offset < 0 || offset > node.data.length) {\n throw new Error(\"Text node offset is out of range\");\n }\n if (!node.parentElement) {\n throw new Error(\"Text node has no parent\");\n }\n // Get the offset from the start of the parent element.\n const textOffset = previousSiblingsTextLength(node) + offset;\n return new TextPosition(node.parentElement, textOffset);\n }\n case Node.ELEMENT_NODE: {\n if (offset < 0 || offset > node.childNodes.length) {\n throw new Error(\"Child node offset is out of range\");\n }\n // Get the text length before the `offset`th child of element.\n let textOffset = 0;\n for (let i = 0; i < offset; i++) {\n textOffset += nodeTextLength(node.childNodes[i]);\n }\n return new TextPosition(node, textOffset);\n }\n default:\n throw new Error(\"Point is not in an element or text node\");\n }\n }\n}\n/**\n * Represents a region of a document as a (start, end) pair of `TextPosition` points.\n *\n * Representing a range in this way allows for changes in the DOM content of the\n * range which don't affect its text content, without affecting the text content\n * of the range itself.\n */\nexport class TextRange {\n constructor(start, end) {\n this.start = start;\n this.end = end;\n }\n /**\n * Create a new TextRange whose `start` and `end` are computed relative to\n * `element`. `element` must be an ancestor of both `start.element` and\n * `end.element`.\n */\n relativeTo(element) {\n return new TextRange(this.start.relativeTo(element), this.end.relativeTo(element));\n }\n /**\n * Resolve this TextRange to a (DOM) Range.\n *\n * The resulting DOM Range will always start and end in a `Text` node.\n * Hence `TextRange.fromRange(range).toRange()` can be used to \"shrink\" a\n * range to the text it contains.\n *\n * May throw if the `start` or `end` positions cannot be resolved to a range.\n */\n toRange() {\n let start;\n let end;\n if (this.start.element === this.end.element &&\n this.start.offset <= this.end.offset) {\n // Fast path for start and end points in same element.\n [start, end] = resolveOffsets(this.start.element, this.start.offset, this.end.offset);\n }\n else {\n start = this.start.resolve({\n direction: ResolveDirection.FORWARDS,\n });\n end = this.end.resolve({ direction: ResolveDirection.BACKWARDS });\n }\n const range = new Range();\n range.setStart(start.node, start.offset);\n range.setEnd(end.node, end.offset);\n return range;\n }\n /**\n * Create a TextRange from a (DOM) Range\n */\n static fromRange(range) {\n const start = TextPosition.fromPoint(range.startContainer, range.startOffset);\n const end = TextPosition.fromPoint(range.endContainer, range.endOffset);\n return new TextRange(start, end);\n }\n /**\n * Create a TextRange representing the `start`th to `end`th characters in\n * `root`\n */\n static fromOffsets(root, start, end) {\n return new TextRange(new TextPosition(root, start), new TextPosition(root, end));\n }\n /**\n * Return a new Range representing `range` trimmed of any leading or trailing\n * whitespace\n */\n static trimmedRange(range) {\n return trimRange(TextRange.fromRange(range).toRange());\n }\n}\n","import approxSearch from \"approx-string-match\";\n/**\n * Find the best approximate matches for `str` in `text` allowing up to\n * `maxErrors` errors.\n */\nfunction search(text, str, maxErrors) {\n // Do a fast search for exact matches. The `approx-string-match` library\n // doesn't currently incorporate this optimization itself.\n let matchPos = 0;\n const exactMatches = [];\n while (matchPos !== -1) {\n matchPos = text.indexOf(str, matchPos);\n if (matchPos !== -1) {\n exactMatches.push({\n start: matchPos,\n end: matchPos + str.length,\n errors: 0,\n });\n matchPos += 1;\n }\n }\n if (exactMatches.length > 0) {\n return exactMatches;\n }\n // If there are no exact matches, do a more expensive search for matches\n // with errors.\n return approxSearch(text, str, maxErrors);\n}\n/**\n * Compute a score between 0 and 1.0 for the similarity between `text` and `str`.\n */\nfunction textMatchScore(text, str) {\n // `search` will return no matches if either the text or pattern is empty,\n // otherwise it will return at least one match if the max allowed error count\n // is at least `str.length`.\n if (str.length === 0 || text.length === 0) {\n return 0.0;\n }\n const matches = search(text, str, str.length);\n // prettier-ignore\n return 1 - (matches[0].errors / str.length);\n}\n/**\n * Find the best approximate match for `quote` in `text`.\n *\n * @param text - Document text to search\n * @param quote - String to find within `text`\n * @param context - Context in which the quote originally appeared. This is\n * used to choose the best match.\n * @return `null` if no match exceeding the minimum quality threshold was found.\n */\nexport function matchQuote(text, quote, context = {}) {\n if (quote.length === 0) {\n return null;\n }\n // Choose the maximum number of errors to allow for the initial search.\n // This choice involves a tradeoff between:\n //\n // - Recall (proportion of \"good\" matches found)\n // - Precision (proportion of matches found which are \"good\")\n // - Cost of the initial search and of processing the candidate matches [1]\n //\n // [1] Specifically, the expected-time complexity of the initial search is\n // `O((maxErrors / 32) * text.length)`. See `approx-string-match` docs.\n const maxErrors = Math.min(256, quote.length / 2);\n // Find the closest matches for `quote` in `text` based on edit distance.\n const matches = search(text, quote, maxErrors);\n if (matches.length === 0) {\n return null;\n }\n /**\n * Compute a score between 0 and 1.0 for a match candidate.\n */\n const scoreMatch = (match) => {\n const quoteWeight = 50; // Similarity of matched text to quote.\n const prefixWeight = 20; // Similarity of text before matched text to `context.prefix`.\n const suffixWeight = 20; // Similarity of text after matched text to `context.suffix`.\n const posWeight = 2; // Proximity to expected location. Used as a tie-breaker.\n const quoteScore = 1 - match.errors / quote.length;\n const prefixScore = context.prefix\n ? textMatchScore(text.slice(Math.max(0, match.start - context.prefix.length), match.start), context.prefix)\n : 1.0;\n const suffixScore = context.suffix\n ? textMatchScore(text.slice(match.end, match.end + context.suffix.length), context.suffix)\n : 1.0;\n let posScore = 1.0;\n if (typeof context.hint === \"number\") {\n const offset = Math.abs(match.start - context.hint);\n posScore = 1.0 - offset / text.length;\n }\n const rawScore = quoteWeight * quoteScore +\n prefixWeight * prefixScore +\n suffixWeight * suffixScore +\n posWeight * posScore;\n const maxScore = quoteWeight + prefixWeight + suffixWeight + posWeight;\n const normalizedScore = rawScore / maxScore;\n return normalizedScore;\n };\n // Rank matches based on similarity of actual and expected surrounding text\n // and actual/expected offset in the document text.\n const scoredMatches = matches.map((m) => ({\n start: m.start,\n end: m.end,\n score: scoreMatch(m),\n }));\n // Choose match with the highest score.\n scoredMatches.sort((a, b) => b.score - a.score);\n return scoredMatches[0];\n}\n","import { matchQuote } from \"./match-quote\";\nimport { TextRange, TextPosition } from \"./text-range\";\nimport { nodeFromXPath, xpathFromNode } from \"./xpath\";\n/**\n * Converts between `RangeSelector` selectors and `Range` objects.\n */\nexport class RangeAnchor {\n /**\n * @param root - A root element from which to anchor.\n * @param range - A range describing the anchor.\n */\n constructor(root, range) {\n this.root = root;\n this.range = range;\n }\n /**\n * @param root - A root element from which to anchor.\n * @param range - A range describing the anchor.\n */\n static fromRange(root, range) {\n return new RangeAnchor(root, range);\n }\n /**\n * Create an anchor from a serialized `RangeSelector` selector.\n *\n * @param root - A root element from which to anchor.\n */\n static fromSelector(root, selector) {\n const startContainer = nodeFromXPath(selector.startContainer, root);\n if (!startContainer) {\n throw new Error(\"Failed to resolve startContainer XPath\");\n }\n const endContainer = nodeFromXPath(selector.endContainer, root);\n if (!endContainer) {\n throw new Error(\"Failed to resolve endContainer XPath\");\n }\n const startPos = TextPosition.fromCharOffset(startContainer, selector.startOffset);\n const endPos = TextPosition.fromCharOffset(endContainer, selector.endOffset);\n const range = new TextRange(startPos, endPos).toRange();\n return new RangeAnchor(root, range);\n }\n toRange() {\n return this.range;\n }\n toSelector() {\n // \"Shrink\" the range so that it tightly wraps its text. This ensures more\n // predictable output for a given text selection.\n const normalizedRange = TextRange.fromRange(this.range).toRange();\n const textRange = TextRange.fromRange(normalizedRange);\n const startContainer = xpathFromNode(textRange.start.element, this.root);\n const endContainer = xpathFromNode(textRange.end.element, this.root);\n return {\n type: \"RangeSelector\",\n startContainer,\n startOffset: textRange.start.offset,\n endContainer,\n endOffset: textRange.end.offset,\n };\n }\n}\n/**\n * Converts between `TextPositionSelector` selectors and `Range` objects.\n */\nexport class TextPositionAnchor {\n constructor(root, start, end) {\n this.root = root;\n this.start = start;\n this.end = end;\n }\n static fromRange(root, range) {\n const textRange = TextRange.fromRange(range).relativeTo(root);\n return new TextPositionAnchor(root, textRange.start.offset, textRange.end.offset);\n }\n static fromSelector(root, selector) {\n return new TextPositionAnchor(root, selector.start, selector.end);\n }\n toSelector() {\n return {\n type: \"TextPositionSelector\",\n start: this.start,\n end: this.end,\n };\n }\n toRange() {\n return TextRange.fromOffsets(this.root, this.start, this.end).toRange();\n }\n}\n/**\n * Converts between `TextQuoteSelector` selectors and `Range` objects.\n */\nexport class TextQuoteAnchor {\n /**\n * @param root - A root element from which to anchor.\n */\n constructor(root, exact, context = {}) {\n this.root = root;\n this.exact = exact;\n this.context = context;\n }\n /**\n * Create a `TextQuoteAnchor` from a range.\n *\n * Will throw if `range` does not contain any text nodes.\n */\n static fromRange(root, range) {\n const text = root.textContent;\n const textRange = TextRange.fromRange(range).relativeTo(root);\n const start = textRange.start.offset;\n const end = textRange.end.offset;\n // Number of characters around the quote to capture as context. We currently\n // always use a fixed amount, but it would be better if this code was aware\n // of logical boundaries in the document (paragraph, article etc.) to avoid\n // capturing text unrelated to the quote.\n //\n // In regular prose the ideal content would often be the surrounding sentence.\n // This is a natural unit of meaning which enables displaying quotes in\n // context even when the document is not available. We could use `Intl.Segmenter`\n // for this when available.\n const contextLen = 32;\n return new TextQuoteAnchor(root, text.slice(start, end), {\n prefix: text.slice(Math.max(0, start - contextLen), start),\n suffix: text.slice(end, Math.min(text.length, end + contextLen)),\n });\n }\n static fromSelector(root, selector) {\n const { prefix, suffix } = selector;\n return new TextQuoteAnchor(root, selector.exact, { prefix, suffix });\n }\n toSelector() {\n return {\n type: \"TextQuoteSelector\",\n exact: this.exact,\n prefix: this.context.prefix,\n suffix: this.context.suffix,\n };\n }\n toRange(options = {}) {\n return this.toPositionAnchor(options).toRange();\n }\n toPositionAnchor(options = {}) {\n const text = this.root.textContent;\n const match = matchQuote(text, this.exact, Object.assign(Object.assign({}, this.context), { hint: options.hint }));\n if (!match) {\n throw new Error(\"Quote not found\");\n }\n return new TextPositionAnchor(this.root, match.start, match.end);\n }\n}\n/**\n * Parse a string containing a time offset in seconds, since the start of some\n * media, into a float.\n */\nfunction parseMediaTime(timeStr) {\n const val = parseFloat(timeStr);\n if (!Number.isFinite(val) || val < 0) {\n return null;\n }\n return val;\n}\n/** Implementation of {@link Array.prototype.findLastIndex} */\nfunction findLastIndex(ary, pred) {\n for (let i = ary.length - 1; i >= 0; i--) {\n if (pred(ary[i])) {\n return i;\n }\n }\n return -1;\n}\nfunction closestElement(node) {\n return node instanceof Element ? node : node.parentElement;\n}\n/**\n * Get the media time range associated with an element or pair of elements,\n * from `data-time-{start, end}` attributes on them.\n */\nfunction getMediaTimeRange(start, end = start) {\n var _a, _b;\n const startTime = parseMediaTime((_a = start === null || start === void 0 ? void 0 : start.getAttribute(\"data-time-start\")) !== null && _a !== void 0 ? _a : \"\");\n const endTime = parseMediaTime((_b = end === null || end === void 0 ? void 0 : end.getAttribute(\"data-time-end\")) !== null && _b !== void 0 ? _b : \"\");\n if (typeof startTime !== \"number\" ||\n typeof endTime !== \"number\" ||\n endTime < startTime) {\n return null;\n }\n return [startTime, endTime];\n}\nexport class MediaTimeAnchor {\n constructor(root, start, end) {\n this.root = root;\n this.start = start;\n this.end = end;\n }\n /**\n * Return a {@link MediaTimeAnchor} that represents a range, or `null` if\n * no time range information is present on elements in the range.\n */\n static fromRange(root, range) {\n var _a, _b;\n const start = (_a = closestElement(range.startContainer)) === null || _a === void 0 ? void 0 : _a.closest(\"[data-time-start]\");\n const end = (_b = closestElement(range.endContainer)) === null || _b === void 0 ? void 0 : _b.closest(\"[data-time-end]\");\n const timeRange = getMediaTimeRange(start, end);\n if (!timeRange) {\n return null;\n }\n const [startTime, endTime] = timeRange;\n return new MediaTimeAnchor(root, startTime, endTime);\n }\n /**\n * Convert this anchor to a DOM range.\n *\n * This returned range will start from the beginning of the element whose\n * associated time range includes `start` and continue to the end of the\n * element whose associated time range includes `end`.\n */\n toRange() {\n const segments = [...this.root.querySelectorAll(\"[data-time-start]\")]\n .map((element) => {\n const timeRange = getMediaTimeRange(element);\n if (!timeRange) {\n return null;\n }\n const [start, end] = timeRange;\n return { element, start, end };\n })\n .filter((s) => s !== null);\n segments.sort((a, b) => a.start - b.start);\n const startIdx = findLastIndex(segments, (s) => s.start <= this.start && s.end >= this.start);\n if (startIdx === -1) {\n throw new Error(\"Start segment not found\");\n }\n const endIdx = startIdx +\n segments\n .slice(startIdx)\n .findIndex((s) => s.start <= this.end && s.end >= this.end);\n if (endIdx === -1) {\n throw new Error(\"End segment not found\");\n }\n const range = new Range();\n range.setStart(segments[startIdx].element, 0);\n const endEl = segments[endIdx].element;\n range.setEnd(endEl, endEl.childNodes.length);\n return range;\n }\n static fromSelector(root, selector) {\n const { start, end } = selector;\n return new MediaTimeAnchor(root, start, end);\n }\n toSelector() {\n return {\n type: \"MediaTimeSelector\",\n start: this.start,\n end: this.end,\n };\n }\n}\n","import { log } from \"../util/log\";\nimport { getClientRectsNoOverlap, dezoomDomRect, dezoomRect, rectContainsPoint, domRectToRect, } from \"../util/rect\";\nimport { TextQuoteAnchor } from \"../vendor/hypothesis/annotator/anchoring/types\";\nexport class DecorationManager {\n constructor(window) {\n this.styles = new Map();\n this.groups = new Map();\n this.lastGroupId = 0;\n this.window = window;\n // Relayout all the decorations when the document body is resized.\n window.addEventListener(\"load\", () => {\n const body = window.document.body;\n let lastSize = { width: 0, height: 0 };\n const observer = new ResizeObserver(() => {\n requestAnimationFrame(() => {\n if (lastSize.width === body.clientWidth &&\n lastSize.height === body.clientHeight) {\n return;\n }\n lastSize = {\n width: body.clientWidth,\n height: body.clientHeight,\n };\n this.relayoutDecorations();\n });\n });\n observer.observe(body);\n }, false);\n }\n registerTemplates(templates) {\n let stylesheet = \"\";\n for (const [id, template] of templates) {\n this.styles.set(id, template);\n if (template.stylesheet) {\n stylesheet += template.stylesheet + \"\\n\";\n }\n }\n if (stylesheet) {\n const styleElement = document.createElement(\"style\");\n styleElement.innerHTML = stylesheet;\n document.getElementsByTagName(\"head\")[0].appendChild(styleElement);\n }\n }\n addDecoration(decoration, groupName) {\n console.log(`addDecoration ${decoration.id} ${groupName}`);\n const group = this.getGroup(groupName);\n group.add(decoration);\n }\n removeDecoration(id, groupName) {\n console.log(`removeDecoration ${id} ${groupName}`);\n const group = this.getGroup(groupName);\n group.remove(id);\n }\n relayoutDecorations() {\n console.log(\"relayoutDecorations\");\n for (const group of this.groups.values()) {\n group.relayout();\n }\n }\n getGroup(name) {\n let group = this.groups.get(name);\n if (!group) {\n const id = \"readium-decoration-\" + this.lastGroupId++;\n group = new DecorationGroup(id, name, this.styles);\n this.groups.set(name, group);\n }\n return group;\n }\n /**\n * Handles click events on a Decoration.\n * Returns whether a decoration matched this event.\n */\n handleDecorationClickEvent(event) {\n if (this.groups.size === 0) {\n return null;\n }\n const findTarget = () => {\n for (const [group, groupContent] of this.groups) {\n for (const item of groupContent.items.reverse()) {\n if (!item.clickableElements) {\n continue;\n }\n for (const element of item.clickableElements) {\n const rect = domRectToRect(element.getBoundingClientRect());\n if (rectContainsPoint(rect, event.clientX, event.clientY, 1)) {\n return { group, item, element };\n }\n }\n }\n }\n };\n const target = findTarget();\n if (!target) {\n return null;\n }\n return {\n id: target.item.decoration.id,\n group: target.group,\n rect: domRectToRect(target.item.range.getBoundingClientRect()),\n event: event,\n };\n }\n}\nclass DecorationGroup {\n constructor(id, name, styles) {\n this.items = [];\n this.lastItemId = 0;\n this.container = null;\n this.groupId = id;\n this.groupName = name;\n this.styles = styles;\n }\n add(decoration) {\n const id = this.groupId + \"-\" + this.lastItemId++;\n const range = rangeFromDecorationTarget(decoration.cssSelector, decoration.textQuote);\n log(`range ${range}`);\n if (!range) {\n log(\"Can't locate DOM range for decoration\", decoration);\n return;\n }\n const item = {\n id,\n decoration,\n range,\n container: null,\n clickableElements: null,\n };\n this.items.push(item);\n this.layout(item);\n }\n remove(id) {\n const index = this.items.findIndex((it) => it.decoration.id === id);\n if (index === -1) {\n return;\n }\n const item = this.items[index];\n this.items.splice(index, 1);\n item.clickableElements = null;\n if (item.container) {\n item.container.remove();\n item.container = null;\n }\n }\n relayout() {\n this.clearContainer();\n for (const item of this.items) {\n this.layout(item);\n }\n }\n /**\n * Returns the group container element, after making sure it exists.\n */\n requireContainer() {\n if (!this.container) {\n this.container = document.createElement(\"div\");\n this.container.id = this.groupId;\n this.container.dataset.group = this.groupName;\n this.container.style.pointerEvents = \"none\";\n document.body.append(this.container);\n }\n return this.container;\n }\n /**\n * Removes the group container.\n */\n clearContainer() {\n if (this.container) {\n this.container.remove();\n this.container = null;\n }\n }\n /**\n * Layouts a single Decoration item.\n */\n layout(item) {\n log(`layout ${item}`);\n const groupContainer = this.requireContainer();\n const unsafeStyle = this.styles.get(item.decoration.style);\n if (!unsafeStyle) {\n console.log(`Unknown decoration style: ${item.decoration.style}`);\n return;\n }\n const style = unsafeStyle;\n const itemContainer = document.createElement(\"div\");\n itemContainer.id = item.id;\n itemContainer.dataset.style = item.decoration.style;\n itemContainer.style.pointerEvents = \"none\";\n const documentWritingMode = getDocumentWritingMode();\n const isVertical = documentWritingMode === \"vertical-rl\" ||\n documentWritingMode === \"vertical-lr\";\n const zoom = groupContainer.currentCSSZoom;\n const scrollingElement = document.scrollingElement;\n const xOffset = scrollingElement.scrollLeft / zoom;\n const yOffset = scrollingElement.scrollTop / zoom;\n const viewportWidth = isVertical ? window.innerHeight : window.innerWidth;\n const viewportHeight = isVertical ? window.innerWidth : window.innerHeight;\n const columnCount = parseInt(getComputedStyle(document.documentElement).getPropertyValue(\"column-count\")) || 1;\n const pageSize = (isVertical ? viewportHeight : viewportWidth) / columnCount;\n function positionElement(element, rect, boundingRect, writingMode) {\n element.style.position = \"absolute\";\n const isVerticalRL = writingMode === \"vertical-rl\";\n const isVerticalLR = writingMode === \"vertical-lr\";\n if (isVerticalRL || isVerticalLR) {\n if (style.width === \"wrap\") {\n element.style.width = `${rect.width}px`;\n element.style.height = `${rect.height}px`;\n if (isVerticalRL) {\n element.style.right = `${-rect.right - xOffset + scrollingElement.clientWidth}px`;\n }\n else {\n // vertical-lr\n element.style.left = `${rect.left + xOffset}px`;\n }\n element.style.top = `${rect.top + yOffset}px`;\n }\n else if (style.width === \"viewport\") {\n element.style.width = `${rect.height}px`;\n element.style.height = `${viewportWidth}px`;\n const top = Math.floor(rect.top / viewportWidth) * viewportWidth;\n if (isVerticalRL) {\n element.style.right = `${-rect.right - xOffset}px`;\n }\n else {\n // vertical-lr\n element.style.left = `${rect.left + xOffset}px`;\n }\n element.style.top = `${top + yOffset}px`;\n }\n else if (style.width === \"bounds\") {\n element.style.width = `${boundingRect.height}px`;\n element.style.height = `${viewportWidth}px`;\n if (isVerticalRL) {\n element.style.right = `${-boundingRect.right - xOffset + scrollingElement.clientWidth}px`;\n }\n else {\n // vertical-lr\n element.style.left = `${boundingRect.left + xOffset}px`;\n }\n element.style.top = `${boundingRect.top + yOffset}px`;\n }\n else if (style.width === \"page\") {\n element.style.width = `${rect.height}px`;\n element.style.height = `${pageSize}px`;\n const top = Math.floor(rect.top / pageSize) * pageSize;\n if (isVerticalRL) {\n element.style.right = `${-rect.right - xOffset + scrollingElement.clientWidth}px`;\n }\n else {\n // vertical-lr\n element.style.left = `${rect.left + xOffset}px`;\n }\n element.style.top = `${top + yOffset}px`;\n }\n }\n else {\n if (style.width === \"wrap\") {\n element.style.width = `${rect.width}px`;\n element.style.height = `${rect.height}px`;\n element.style.left = `${rect.left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n }\n else if (style.width === \"viewport\") {\n element.style.width = `${viewportWidth}px`;\n element.style.height = `${rect.height}px`;\n const left = Math.floor(rect.left / viewportWidth) * viewportWidth;\n element.style.left = `${left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n }\n else if (style.width === \"bounds\") {\n element.style.width = `${boundingRect.width}px`;\n element.style.height = `${rect.height}px`;\n element.style.left = `${boundingRect.left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n }\n else if (style.width === \"page\") {\n element.style.width = `${pageSize}px`;\n element.style.height = `${rect.height}px`;\n const left = Math.floor(rect.left / pageSize) * pageSize;\n element.style.left = `${left + xOffset}px`;\n element.style.top = `${rect.top + yOffset}px`;\n }\n }\n }\n const rawBoundingRect = item.range.getBoundingClientRect();\n const boundingRect = dezoomDomRect(rawBoundingRect, zoom);\n let elementTemplate;\n try {\n const template = document.createElement(\"template\");\n template.innerHTML = item.decoration.element.trim();\n elementTemplate = template.content.firstElementChild;\n }\n catch (error) {\n let message;\n if (\"message\" in error) {\n message = error.message;\n }\n else {\n message = null;\n }\n console.log(`Invalid decoration element \"${item.decoration.element}\": ${message}`);\n return;\n }\n if (style.layout === \"boxes\") {\n const doNotMergeHorizontallyAlignedRects = !documentWritingMode.startsWith(\"vertical\");\n const startElement = getContainingElement(item.range.startContainer);\n // Decorated text may have a different writingMode from document body\n const decoratorWritingMode = getComputedStyle(startElement).writingMode;\n const clientRects = getClientRectsNoOverlap(item.range, doNotMergeHorizontallyAlignedRects)\n .map((rect) => {\n return dezoomRect(rect, zoom);\n })\n .sort((r1, r2) => {\n if (r1.top !== r2.top)\n return r1.top - r2.top;\n if (decoratorWritingMode === \"vertical-rl\") {\n return r2.left - r1.left;\n }\n else if (decoratorWritingMode === \"vertical-lr\") {\n return r1.left - r2.left;\n }\n else {\n return r1.left - r2.left;\n }\n });\n for (const clientRect of clientRects) {\n const line = elementTemplate.cloneNode(true);\n line.style.pointerEvents = \"none\";\n line.dataset.writingMode = decoratorWritingMode;\n positionElement(line, clientRect, boundingRect, documentWritingMode);\n itemContainer.append(line);\n }\n }\n else if (style.layout === \"bounds\") {\n const bounds = elementTemplate.cloneNode(true);\n bounds.style.pointerEvents = \"none\";\n bounds.dataset.writingMode = documentWritingMode;\n positionElement(bounds, boundingRect, boundingRect, documentWritingMode);\n itemContainer.append(bounds);\n }\n groupContainer.append(itemContainer);\n item.container = itemContainer;\n item.clickableElements = Array.from(itemContainer.querySelectorAll(\"[data-activable='1']\"));\n if (item.clickableElements.length === 0) {\n item.clickableElements = Array.from(itemContainer.children);\n }\n }\n}\n/**\n * Returns the document body's writing mode.\n */\nfunction getDocumentWritingMode() {\n return getComputedStyle(document.body).writingMode;\n}\n/**\n * Returns the closest element ancestor of the given node.\n */\nfunction getContainingElement(node) {\n return node.nodeType === Node.ELEMENT_NODE ? node : node.parentElement;\n}\n/*\n * Compute DOM range from decoration target.\n */\nexport function rangeFromDecorationTarget(cssSelector, textQuote) {\n let root;\n if (cssSelector) {\n try {\n root = document.querySelector(cssSelector);\n }\n catch (e) {\n log(e);\n }\n }\n if (!root && !textQuote) {\n return null;\n }\n else if (!root) {\n root = document.body;\n }\n if (textQuote) {\n const anchor = new TextQuoteAnchor(root, textQuote.quotedText, {\n prefix: textQuote.textBefore,\n suffix: textQuote.textAfter,\n });\n try {\n return anchor.toRange();\n }\n catch (e) {\n log(e);\n return null;\n }\n }\n else {\n const range = document.createRange();\n range.setStartBefore(root);\n range.setEndAfter(root);\n return range;\n }\n}\n","export class GesturesDetector {\n constructor(window, listener, decorationManager) {\n this.window = window;\n this.listener = listener;\n this.decorationManager = decorationManager;\n document.addEventListener(\"click\", (event) => {\n this.onClick(event);\n }, false);\n }\n onClick(event) {\n if (event.defaultPrevented) {\n return;\n }\n let nearestElement;\n if (event.target instanceof HTMLElement) {\n nearestElement = this.nearestInteractiveElement(event.target);\n }\n else {\n nearestElement = null;\n }\n if (nearestElement) {\n if (nearestElement instanceof HTMLAnchorElement) {\n this.listener.onLinkActivated(nearestElement.href, nearestElement.outerHTML);\n event.stopPropagation();\n event.preventDefault();\n }\n return;\n }\n let decorationActivatedEvent;\n if (this.decorationManager) {\n decorationActivatedEvent =\n this.decorationManager.handleDecorationClickEvent(event);\n }\n else {\n decorationActivatedEvent = null;\n }\n if (decorationActivatedEvent) {\n this.listener.onDecorationActivated(decorationActivatedEvent);\n }\n else {\n this.listener.onTap(event);\n }\n // event.stopPropagation()\n // event.preventDefault()\n }\n // See. https://github.com/JayPanoz/architecture/tree/touch-handling/misc/touch-handling\n nearestInteractiveElement(element) {\n if (element == null) {\n return null;\n }\n const interactiveTags = [\n \"a\",\n \"audio\",\n \"button\",\n \"canvas\",\n \"details\",\n \"input\",\n \"label\",\n \"option\",\n \"select\",\n \"submit\",\n \"textarea\",\n \"video\",\n ];\n if (interactiveTags.indexOf(element.nodeName.toLowerCase()) != -1) {\n return element;\n }\n // Checks whether the element is editable by the user.\n if (element.hasAttribute(\"contenteditable\") &&\n element.getAttribute(\"contenteditable\").toLowerCase() != \"false\") {\n return element;\n }\n // Checks parents recursively because the touch might be for example on an inside a .\n if (element.parentElement) {\n return this.nearestInteractiveElement(element.parentElement);\n }\n return null;\n }\n}\n","//\n// Copyright 2021 Readium Foundation. All rights reserved.\n// Use of this source code is governed by the BSD-style license\n// available in the top-level LICENSE file of the project.\n//\nimport { dezoomRect, domRectToRect } from \"../util/rect\";\nimport { log } from \"../util/log\";\nimport { TextRange } from \"../vendor/hypothesis/annotator/anchoring/text-range\";\n// Polyfill for Android API 26\nimport matchAll from \"string.prototype.matchall\";\nimport { rectToParentCoordinates } from \"./geometry\";\nmatchAll.shim();\nexport class SelectionReporter {\n constructor(window, listener) {\n this.isSelecting = false;\n document.addEventListener(\"selectionchange\", \n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n (event) => {\n var _a;\n const collapsed = (_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.isCollapsed;\n if (collapsed && this.isSelecting) {\n this.isSelecting = false;\n listener.onSelectionEnd();\n }\n else if (!collapsed && !this.isSelecting) {\n this.isSelecting = true;\n listener.onSelectionStart();\n }\n }, false);\n }\n}\nexport function selectionToParentCoordinates(selection, iframe) {\n const boundingRect = iframe.getBoundingClientRect();\n const shiftedRect = rectToParentCoordinates(selection.selectionRect, boundingRect);\n return {\n selectedText: selection === null || selection === void 0 ? void 0 : selection.selectedText,\n selectionRect: shiftedRect,\n textBefore: selection.textBefore,\n textAfter: selection.textAfter,\n };\n}\nexport class SelectionManager {\n constructor(window) {\n this.isSelecting = false;\n //, listener: SelectionListener) {\n this.window = window;\n /*this.listener = listener\n document.addEventListener(\n \"selectionchange\",\n () => {\n const selection = window.getSelection()!\n const collapsed = selection.isCollapsed\n \n if (collapsed && this.isSelecting) {\n this.isSelecting = false\n this.listener.onSelectionEnd()\n } else if (!collapsed && !this.isSelecting) {\n this.isSelecting = true\n this.listener.onSelectionStart()\n }\n },\n false\n )*/\n }\n clearSelection() {\n var _a;\n (_a = this.window.getSelection()) === null || _a === void 0 ? void 0 : _a.removeAllRanges();\n }\n getCurrentSelection() {\n const text = this.getCurrentSelectionText();\n if (!text) {\n return null;\n }\n const rect = this.getSelectionRect();\n return {\n selectedText: text.highlight,\n textBefore: text.before,\n textAfter: text.after,\n selectionRect: rect,\n };\n }\n getSelectionRect() {\n try {\n const selection = this.window.getSelection();\n const range = selection.getRangeAt(0);\n const zoom = this.window.document.body.currentCSSZoom;\n return dezoomRect(domRectToRect(range.getBoundingClientRect()), zoom);\n }\n catch (e) {\n log(e);\n throw e;\n //return null\n }\n }\n getCurrentSelectionText() {\n const selection = this.window.getSelection();\n if (selection.isCollapsed) {\n return undefined;\n }\n const highlight = selection.toString();\n const cleanHighlight = highlight\n .trim()\n .replace(/\\n/g, \" \")\n .replace(/\\s\\s+/g, \" \");\n if (cleanHighlight.length === 0) {\n return undefined;\n }\n if (!selection.anchorNode || !selection.focusNode) {\n return undefined;\n }\n const range = selection.rangeCount === 1\n ? selection.getRangeAt(0)\n : createOrderedRange(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);\n if (!range || range.collapsed) {\n log(\"$$$$$$$$$$$$$$$$$ CANNOT GET NON-COLLAPSED SELECTION RANGE?!\");\n return undefined;\n }\n const text = document.body.textContent;\n const textRange = TextRange.fromRange(range).relativeTo(document.body);\n const start = textRange.start.offset;\n const end = textRange.end.offset;\n const snippetLength = 200;\n // Compute the text before the highlight, ignoring the first \"word\", which might be cut.\n let before = text.slice(Math.max(0, start - snippetLength), start);\n const firstWordStart = before.search(/\\P{L}\\p{L}/gu);\n if (firstWordStart !== -1) {\n before = before.slice(firstWordStart + 1);\n }\n // Compute the text after the highlight, ignoring the last \"word\", which might be cut.\n let after = text.slice(end, Math.min(text.length, end + snippetLength));\n const lastWordEnd = Array.from(after.matchAll(/\\p{L}\\P{L}/gu)).pop();\n if (lastWordEnd !== undefined && lastWordEnd.index > 1) {\n after = after.slice(0, lastWordEnd.index + 1);\n }\n return { highlight, before, after };\n }\n}\nfunction createOrderedRange(startNode, startOffset, endNode, endOffset) {\n const range = new Range();\n range.setStart(startNode, startOffset);\n range.setEnd(endNode, endOffset);\n if (!range.collapsed) {\n return range;\n }\n log(\">>> createOrderedRange COLLAPSED ... RANGE REVERSE?\");\n const rangeReverse = new Range();\n rangeReverse.setStart(endNode, endOffset);\n rangeReverse.setEnd(startNode, startOffset);\n if (!rangeReverse.collapsed) {\n log(\">>> createOrderedRange RANGE REVERSE OK.\");\n return range;\n }\n log(\">>> createOrderedRange RANGE REVERSE ALSO COLLAPSED?!\");\n return undefined;\n}\n/*\nexport function convertRangeInfo(document: Document, rangeInfo) {\n const startElement = document.querySelector(\n rangeInfo.startContainerElementCssSelector\n );\n if (!startElement) {\n log(\"^^^ convertRangeInfo NO START ELEMENT CSS SELECTOR?!\");\n return undefined;\n }\n let startContainer = startElement;\n if (rangeInfo.startContainerChildTextNodeIndex >= 0) {\n if (\n rangeInfo.startContainerChildTextNodeIndex >=\n startElement.childNodes.length\n ) {\n log(\n \"^^^ convertRangeInfo rangeInfo.startContainerChildTextNodeIndex >= startElement.childNodes.length?!\"\n );\n return undefined;\n }\n startContainer =\n startElement.childNodes[rangeInfo.startContainerChildTextNodeIndex];\n if (startContainer.nodeType !== Node.TEXT_NODE) {\n log(\"^^^ convertRangeInfo startContainer.nodeType !== Node.TEXT_NODE?!\");\n return undefined;\n }\n }\n const endElement = document.querySelector(\n rangeInfo.endContainerElementCssSelector\n );\n if (!endElement) {\n log(\"^^^ convertRangeInfo NO END ELEMENT CSS SELECTOR?!\");\n return undefined;\n }\n let endContainer = endElement;\n if (rangeInfo.endContainerChildTextNodeIndex >= 0) {\n if (\n rangeInfo.endContainerChildTextNodeIndex >= endElement.childNodes.length\n ) {\n log(\n \"^^^ convertRangeInfo rangeInfo.endContainerChildTextNodeIndex >= endElement.childNodes.length?!\"\n );\n return undefined;\n }\n endContainer =\n endElement.childNodes[rangeInfo.endContainerChildTextNodeIndex];\n if (endContainer.nodeType !== Node.TEXT_NODE) {\n log(\"^^^ convertRangeInfo endContainer.nodeType !== Node.TEXT_NODE?!\");\n return undefined;\n }\n }\n return createOrderedRange(\n startContainer,\n rangeInfo.startOffset,\n endContainer,\n rangeInfo.endOffset\n );\n}\n\nexport function location2RangeInfo(location) {\n const locations = location.locations;\n const domRange = locations.domRange;\n const start = domRange.start;\n const end = domRange.end;\n\n return {\n endContainerChildTextNodeIndex: end.textNodeIndex,\n endContainerElementCssSelector: end.cssSelector,\n endOffset: end.offset,\n startContainerChildTextNodeIndex: start.textNodeIndex,\n startContainerElementCssSelector: start.cssSelector,\n startOffset: start.offset,\n };\n}\n*/\n","import { DecorationWrapperParentSide } from \"../fixed/decoration-wrapper\";\nexport class ReflowableDecorationsBridge {\n constructor(window, manager) {\n this.window = window;\n this.manager = manager;\n }\n registerTemplates(templates) {\n const templatesAsMap = parseTemplates(templates);\n this.manager.registerTemplates(templatesAsMap);\n }\n addDecoration(decoration, group) {\n const actualDecoration = parseDecoration(decoration);\n this.manager.addDecoration(actualDecoration, group);\n }\n removeDecoration(id, group) {\n this.manager.removeDecoration(id, group);\n }\n}\nexport class FixedSingleDecorationsBridge {\n constructor() {\n this.wrapper = new DecorationWrapperParentSide();\n }\n setMessagePort(messagePort) {\n this.wrapper.setMessagePort(messagePort);\n }\n registerTemplates(templates) {\n const actualTemplates = parseTemplates(templates);\n this.wrapper.registerTemplates(actualTemplates);\n }\n addDecoration(decoration, group) {\n const actualDecoration = parseDecoration(decoration);\n this.wrapper.addDecoration(actualDecoration, group);\n }\n removeDecoration(id, group) {\n this.wrapper.removeDecoration(id, group);\n }\n}\nexport class FixedDoubleDecorationsBridge {\n constructor() {\n this.leftWrapper = new DecorationWrapperParentSide();\n this.rightWrapper = new DecorationWrapperParentSide();\n }\n setLeftMessagePort(messagePort) {\n this.leftWrapper.setMessagePort(messagePort);\n }\n setRightMessagePort(messagePort) {\n this.rightWrapper.setMessagePort(messagePort);\n }\n registerTemplates(templates) {\n const actualTemplates = parseTemplates(templates);\n this.leftWrapper.registerTemplates(actualTemplates);\n this.rightWrapper.registerTemplates(actualTemplates);\n }\n addDecoration(decoration, iframe, group) {\n const actualDecoration = parseDecoration(decoration);\n switch (iframe) {\n case \"left\":\n this.leftWrapper.addDecoration(actualDecoration, group);\n break;\n case \"right\":\n this.rightWrapper.addDecoration(actualDecoration, group);\n break;\n default:\n throw Error(`Unknown iframe type: ${iframe}`);\n }\n }\n removeDecoration(id, group) {\n this.leftWrapper.removeDecoration(id, group);\n this.rightWrapper.removeDecoration(id, group);\n }\n}\nfunction parseTemplates(templates) {\n return new Map(Object.entries(JSON.parse(templates)));\n}\nfunction parseDecoration(decoration) {\n const jsonDecoration = JSON.parse(decoration);\n return jsonDecoration;\n}\n","export class ReflowableListenerAdapter {\n constructor(gesturesBridge, selectionListenerBridge) {\n this.gesturesBridge = gesturesBridge;\n this.selectionListenerBridge = selectionListenerBridge;\n }\n onTap(event) {\n const tapEvent = {\n x: (event.clientX - visualViewport.offsetLeft) * visualViewport.scale,\n y: (event.clientY - visualViewport.offsetTop) * visualViewport.scale,\n };\n const stringEvent = JSON.stringify(tapEvent);\n this.gesturesBridge.onTap(stringEvent);\n }\n onLinkActivated(href, outerHtml) {\n this.gesturesBridge.onLinkActivated(href, outerHtml);\n }\n onDecorationActivated(event) {\n const offset = {\n x: (event.event.clientX - visualViewport.offsetLeft) *\n visualViewport.scale,\n y: (event.event.clientY - visualViewport.offsetTop) *\n visualViewport.scale,\n };\n const stringOffset = JSON.stringify(offset);\n const stringRect = JSON.stringify(event.rect);\n this.gesturesBridge.onDecorationActivated(event.id, event.group, stringRect, stringOffset);\n }\n onSelectionStart() {\n this.selectionListenerBridge.onSelectionStart();\n }\n onSelectionEnd() {\n this.selectionListenerBridge.onSelectionEnd();\n }\n}\nexport class FixedListenerAdapter {\n constructor(window, gesturesApi, documentApi) {\n this.window = window;\n this.gesturesApi = gesturesApi;\n this.documentApi = documentApi;\n this.resizeObserverAdded = false;\n this.documentLoadedFired = false;\n }\n onTap(event) {\n this.gesturesApi.onTap(JSON.stringify(event.offset));\n }\n onLinkActivated(href, outerHtml) {\n this.gesturesApi.onLinkActivated(href, outerHtml);\n }\n onDecorationActivated(event) {\n const stringOffset = JSON.stringify(event.offset);\n const stringRect = JSON.stringify(event.rect);\n this.gesturesApi.onDecorationActivated(event.id, event.group, stringRect, stringOffset);\n }\n onLayout() {\n if (!this.resizeObserverAdded) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const observer = new ResizeObserver(() => {\n requestAnimationFrame(() => {\n const scrollingElement = this.window.document.scrollingElement;\n if (!this.documentLoadedFired &&\n (scrollingElement == null ||\n scrollingElement.scrollHeight > 0 ||\n scrollingElement.scrollWidth > 0)) {\n this.documentApi.onDocumentLoadedAndSized();\n this.documentLoadedFired = true;\n }\n else {\n this.documentApi.onDocumentResized();\n }\n });\n });\n observer.observe(this.window.document.body);\n }\n this.resizeObserverAdded = true;\n }\n}\n","import { selectionToParentCoordinates, } from \"../common/selection\";\nimport { SelectionWrapperParentSide } from \"../fixed/selection-wrapper\";\nexport class ReflowableSelectionBridge {\n constructor(window, manager) {\n this.window = window;\n this.manager = manager;\n }\n getCurrentSelection() {\n return this.manager.getCurrentSelection();\n }\n clearSelection() {\n this.manager.clearSelection();\n }\n}\nexport class FixedSingleSelectionBridge {\n constructor(iframe, listener) {\n this.iframe = iframe;\n this.listener = listener;\n const wrapperListener = {\n onSelectionAvailable: (requestId, selection) => {\n let adjustedSelection;\n if (selection) {\n adjustedSelection = selectionToParentCoordinates(selection, this.iframe);\n }\n else {\n adjustedSelection = selection;\n }\n const selectionAsJson = JSON.stringify(adjustedSelection);\n this.listener.onSelectionAvailable(requestId, selectionAsJson);\n },\n };\n this.wrapper = new SelectionWrapperParentSide(wrapperListener);\n }\n setMessagePort(messagePort) {\n this.wrapper.setMessagePort(messagePort);\n }\n requestSelection(requestId) {\n this.wrapper.requestSelection(requestId);\n }\n clearSelection() {\n this.wrapper.clearSelection();\n }\n}\nexport class FixedDoubleSelectionBridge {\n constructor(leftIframe, rightIframe, listener) {\n this.requestStates = new Map();\n this.isLeftInitialized = false;\n this.isRightInitialized = false;\n this.leftIframe = leftIframe;\n this.rightIframe = rightIframe;\n this.listener = listener;\n const leftWrapperListener = {\n onSelectionAvailable: (requestId, selection) => {\n if (selection) {\n const resolvedSelection = selectionToParentCoordinates(selection, this.leftIframe);\n this.onSelectionAvailable(requestId, \"left\", resolvedSelection);\n }\n else {\n this.onSelectionAvailable(requestId, \"left\", selection);\n }\n },\n };\n this.leftWrapper = new SelectionWrapperParentSide(leftWrapperListener);\n const rightWrapperListener = {\n onSelectionAvailable: (requestId, selection) => {\n if (selection) {\n const resolvedSelection = selectionToParentCoordinates(selection, this.rightIframe);\n this.onSelectionAvailable(requestId, \"right\", resolvedSelection);\n }\n else {\n this.onSelectionAvailable(requestId, \"right\", selection);\n }\n },\n };\n this.rightWrapper = new SelectionWrapperParentSide(rightWrapperListener);\n }\n setLeftMessagePort(messagePort) {\n this.leftWrapper.setMessagePort(messagePort);\n this.isLeftInitialized = true;\n }\n setRightMessagePort(messagePort) {\n this.rightWrapper.setMessagePort(messagePort);\n this.isRightInitialized = true;\n }\n requestSelection(requestId) {\n if (this.isLeftInitialized && this.isRightInitialized) {\n this.requestStates.set(requestId, \"pending\");\n this.leftWrapper.requestSelection(requestId);\n this.rightWrapper.requestSelection(requestId);\n }\n else if (this.isLeftInitialized) {\n this.requestStates.set(requestId, \"firstResponseWasNull\");\n this.leftWrapper.requestSelection(requestId);\n }\n else if (this.isRightInitialized) {\n this.requestStates.set(requestId, \"firstResponseWasNull\");\n this.rightWrapper.requestSelection(requestId);\n }\n else {\n this.requestStates.set(requestId, \"firstResponseWasNull\");\n this.onSelectionAvailable(requestId, \"left\", null);\n }\n }\n clearSelection() {\n this.leftWrapper.clearSelection();\n this.rightWrapper.clearSelection();\n }\n onSelectionAvailable(requestId, iframe, selection) {\n const requestState = this.requestStates.get(requestId);\n if (!requestState) {\n return;\n }\n if (!selection && requestState === \"pending\") {\n this.requestStates.set(requestId, \"firstResponseWasNull\");\n return;\n }\n this.requestStates.delete(requestId);\n const selectionAsJson = JSON.stringify(selection);\n this.listener.onSelectionAvailable(requestId, iframe, selectionAsJson);\n }\n}\n","export class CssBridge {\n constructor(document) {\n this.document = document;\n }\n setProperties(properties) {\n for (const [key, value] of properties) {\n this.setProperty(key, value);\n }\n }\n // For setting user setting.\n setProperty(key, value) {\n if (value === null || value === \"\") {\n this.removeProperty(key);\n }\n else {\n const root = document.documentElement;\n // The `!important` annotation is added with `setProperty()` because if it's part of the\n // `value`, it will be ignored by the Web View.\n root.style.setProperty(key, value, \"important\");\n }\n }\n // For removing user setting.\n removeProperty(key) {\n const root = document.documentElement;\n root.style.removeProperty(key);\n }\n}\n","import { TextQuoteAnchor } from \"../vendor/hypothesis/annotator/anchoring/types\";\nimport { log } from \"../util/log\";\nexport class ReflowableMoveBridge {\n constructor(document) {\n this.document = document;\n }\n getOffsetForLocation(location, vertical) {\n var _a, _b;\n const actualLocation = parseLocation(location);\n if (actualLocation.textAfter || actualLocation.textBefore) {\n return this.getOffsetForTextAnchor((_a = actualLocation.textBefore) !== null && _a !== void 0 ? _a : \"\", (_b = actualLocation.textAfter) !== null && _b !== void 0 ? _b : \"\", vertical);\n }\n if (actualLocation.cssSelector) {\n return this.getOffsetForCssSelector(actualLocation.cssSelector, vertical);\n }\n if (actualLocation.htmlId) {\n return this.getOffsetForHtmlId(actualLocation.htmlId, vertical);\n }\n return null;\n }\n getOffsetForTextAnchor(textBefore, textAfter, vertical) {\n const root = this.document.body;\n const anchor = new TextQuoteAnchor(root, \"\", {\n prefix: textBefore,\n suffix: textAfter,\n });\n try {\n const range = anchor.toRange();\n return this.getOffsetForRect(range.getBoundingClientRect(), vertical);\n }\n catch (e) {\n log(e);\n return null;\n }\n }\n getOffsetForCssSelector(cssSelector, vertical) {\n let element;\n try {\n element = this.document.querySelector(cssSelector);\n }\n catch (e) {\n log(e);\n }\n if (!element) {\n return null;\n }\n return this.getOffsetForElement(element, vertical);\n }\n getOffsetForHtmlId(htmlId, vertical) {\n const element = this.document.getElementById(htmlId);\n if (!element) {\n return null;\n }\n return this.getOffsetForElement(element, vertical);\n }\n getOffsetForElement(element, vertical) {\n const rect = element.getBoundingClientRect();\n return this.getOffsetForRect(rect, vertical);\n }\n getOffsetForRect(rect, vertical) {\n if (vertical) {\n return rect.top + window.scrollY;\n }\n else {\n const offset = rect.left + window.scrollX;\n return offset;\n }\n }\n}\nfunction parseLocation(location) {\n const jsonLocation = JSON.parse(location);\n return jsonLocation;\n}\n","//\n// Copyright 2024 Readium Foundation. All rights reserved.\n// Use of this source code is governed by the BSD-style license\n// available in the top-level LICENSE file of the project.\n//\nimport { ReflowableInitializationBridge as ReflowableInitializer, } from \"./bridge/reflowable-initialization-bridge\";\nimport { appendVirtualColumnIfNeeded } from \"./util/columns\";\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nwindow.addEventListener(\"load\", (event) => {\n let documentLoadedFired = false;\n const observer = new ResizeObserver(() => {\n let colCountFixed = false;\n requestAnimationFrame(() => {\n const scrollingElement = window.document.scrollingElement;\n const scrollingElementEmpty = scrollingElement == null ||\n (scrollingElement.scrollHeight == 0 &&\n scrollingElement.scrollWidth == 0);\n if (!documentLoadedFired && scrollingElementEmpty) {\n // Document is not sized yet\n return;\n }\n if (!colCountFixed && !scrollingElementEmpty) {\n const colChanged = appendVirtualColumnIfNeeded(window);\n colCountFixed = true;\n if (colChanged) {\n // Column number has changed, wait for next resize callback.\n return;\n }\n }\n colCountFixed = false;\n if (!documentLoadedFired) {\n window.documentState.onDocumentLoadedAndSized();\n documentLoadedFired = true;\n }\n else {\n window.documentState.onDocumentResized();\n }\n });\n });\n observer.observe(document.body);\n});\nnew ReflowableInitializer(window, window.reflowableApiState);\n","/**\n * In paginated mode, the width of each resource must be a multiple of the viewport size\n * for proper snapping. This may not be automatically the case if the number of\n * columns in the resource is not a multiple of the number of columns displayed in the viewport.\n * To fix this, we insert a blank virtual column at the end of the resource.\n *\n * Returns if the column number has changed.\n */\nexport function appendVirtualColumnIfNeeded(wnd) {\n const colCountPerScreen = getColumnCountPerScreen(wnd);\n if (!colCountPerScreen) {\n // scroll mode\n return false;\n }\n const virtualCols = wnd.document.querySelectorAll(\"div[id^='readium-virtual-page']\");\n const virtualColsCount = virtualCols.length;\n // Remove first so that we don’t end up with an incorrect scrollWidth\n // Even when removing their width we risk having an incorrect scrollWidth\n // so removing them entirely is the most robust solution\n for (const virtualCol of virtualCols) {\n virtualCol.remove();\n }\n const documentWidth = wnd.document.scrollingElement.scrollWidth;\n const windowWidth = wnd.visualViewport.width;\n const totalColCount = Math.round((documentWidth / windowWidth) * colCountPerScreen);\n const lonelyColCount = totalColCount % colCountPerScreen;\n const needed = colCountPerScreen === 1 || lonelyColCount === 0\n ? 0\n : colCountPerScreen - lonelyColCount;\n if (needed > 0) {\n for (let i = 0; i < needed; i++) {\n const virtualCol = wnd.document.createElement(\"div\");\n virtualCol.setAttribute(\"id\", `readium-virtual-page-${i}`);\n virtualCol.dataset.readium = \"true\";\n virtualCol.style.breakBefore = \"column\";\n virtualCol.innerHTML = \"​\"; // zero-width space\n wnd.document.body.appendChild(virtualCol);\n }\n }\n return virtualColsCount != needed;\n}\nfunction getColumnCountPerScreen(wnd) {\n return parseInt(wnd\n .getComputedStyle(wnd.document.documentElement)\n .getPropertyValue(\"column-count\"));\n}\n","import { DecorationManager } from \"../common/decoration\";\nimport { GesturesDetector } from \"../common/gestures\";\nimport { SelectionManager, SelectionReporter } from \"../common/selection\";\nimport { ReflowableDecorationsBridge } from \"./all-decoration-bridge\";\nimport { ReflowableListenerAdapter } from \"./all-listener-bridge\";\nimport { ReflowableSelectionBridge } from \"./all-selection-bridge\";\nimport { CssBridge } from \"./reflowable-css-bridge\";\nimport { ReflowableMoveBridge } from \"./reflowable-move-bridge\";\nexport class ReflowableInitializationBridge {\n constructor(window, listener) {\n this.window = window;\n this.listener = listener;\n this.setupViewport();\n this.initApis();\n }\n initApis() {\n this.window.move = new ReflowableMoveBridge(this.window.document);\n this.listener.onMoveApiAvailable();\n const bridgeListener = new ReflowableListenerAdapter(window.gestures, window.selectionListener);\n const decorationManager = new DecorationManager(window);\n this.window.readiumcss = new CssBridge(window.document);\n this.listener.onCssApiAvailable();\n this.window.selection = new ReflowableSelectionBridge(window, new SelectionManager(window));\n this.listener.onSelectionApiAvailable();\n this.window.decorations = new ReflowableDecorationsBridge(window, decorationManager);\n this.listener.onDecorationApiAvailable();\n new GesturesDetector(window, bridgeListener, decorationManager);\n new SelectionReporter(window, bridgeListener);\n }\n // Setups the `viewport` meta tag to disable overview.\n setupViewport() {\n this.window.document.addEventListener(\"DOMContentLoaded\", () => {\n const meta = document.createElement(\"meta\");\n meta.setAttribute(\"name\", \"viewport\");\n meta.setAttribute(\"content\", \"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no\");\n this.window.document.head.appendChild(meta);\n });\n }\n}\n"],"names":["reverse","s","split","join","oneIfNotZero","n","advanceBlock","ctx","peq","b","hIn","pV","P","mV","M","hInIsNegative","eq","xV","xH","pH","mH","hOut","lastRowMask","findMatchEnds","text","pattern","maxErrors","length","Math","min","matches","w","bMax","ceil","Uint32Array","fill","emptyPeq","Map","asciiPeq","i","push","c","val","charCodeAt","has","charPeq","set","r","idx","y","max","score","j","charCode","get","carry","maxBlockScore","splice","start","end","errors","exports","patRev","map","m","minStart","slice","reduce","rm","findMatchStarts","GetIntrinsic","callBind","$indexOf","module","name","allowMissing","intrinsic","bind","$apply","$call","$reflectApply","call","$gOPD","$defineProperty","$max","value","e","originalFunction","func","arguments","configurable","applyBind","apply","hasPropertyDescriptors","$SyntaxError","$TypeError","gopd","obj","property","nonEnumerable","nonWritable","nonConfigurable","loose","desc","enumerable","writable","keys","hasSymbols","Symbol","toStr","Object","prototype","toString","concat","Array","defineDataProperty","supportsDescriptors","defineProperty","object","predicate","fn","defineProperties","predicates","props","getOwnPropertySymbols","hasToStringTag","toStringTag","overrideIfSet","force","iterator","isPrimitive","isCallable","isDate","isSymbol","input","exoticToPrim","hint","String","Number","toPrimitive","O","TypeError","GetMethod","valueOf","result","method","methodNames","ordinaryToPrimitive","that","target","this","bound","args","boundLength","boundArgs","Function","Empty","implementation","functionsHaveNames","gOPD","getOwnPropertyDescriptor","functionsHaveConfigurableNames","$bind","boundFunctionsHaveNames","undefined","SyntaxError","$Function","getEvalledConstructor","expressionSyntax","throwTypeError","ThrowTypeError","calleeThrows","gOPDthrows","hasProto","getProto","getPrototypeOf","x","__proto__","needsEval","TypedArray","Uint8Array","INTRINSICS","AggregateError","ArrayBuffer","Atomics","BigInt","BigInt64Array","BigUint64Array","Boolean","DataView","Date","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","Error","eval","EvalError","Float32Array","Float64Array","FinalizationRegistry","Int8Array","Int16Array","Int32Array","isFinite","isNaN","JSON","parseFloat","parseInt","Promise","Proxy","RangeError","ReferenceError","Reflect","RegExp","Set","SharedArrayBuffer","Uint8ClampedArray","Uint16Array","URIError","WeakMap","WeakRef","WeakSet","error","errorProto","doEval","gen","LEGACY_ALIASES","hasOwn","$concat","$spliceApply","$replace","replace","$strSlice","$exec","exec","rePropName","reEscapeChar","getBaseIntrinsic","alias","intrinsicName","parts","string","first","last","match","number","quote","subString","stringToPath","intrinsicBaseName","intrinsicRealName","skipFurtherCaching","isOwn","part","hasArrayLengthDefineBug","test","foo","$Object","origSymbol","hasSymbolSham","sym","symObj","getOwnPropertyNames","syms","propertyIsEnumerable","descriptor","hasOwnProperty","channel","SLOT","assert","slot","slots","V","freeze","badArrayLike","isCallableMarker","fnToStr","reflectApply","_","constructorRegex","isES6ClassFn","fnStr","tryFunctionObject","isIE68","isDDA","document","all","str","strClass","getDay","tryDateObject","isRegexMarker","badStringifier","callBound","throwRegexMarker","$toString","symToStr","symStringRegex","isSymbolObject","hasMap","mapSizeDescriptor","mapSize","mapForEach","forEach","hasSet","setSizeDescriptor","setSize","setForEach","weakMapHas","weakSetHas","weakRefDeref","deref","booleanValueOf","objectToString","functionToString","$match","$slice","$toUpperCase","toUpperCase","$toLowerCase","toLowerCase","$test","$join","$arrSlice","$floor","floor","bigIntValueOf","gOPS","symToString","hasShammedSymbols","isEnumerable","gPO","addNumericSeparator","num","Infinity","sepRegex","int","intStr","dec","utilInspect","inspectCustom","custom","inspectSymbol","wrapQuotes","defaultStyle","opts","quoteChar","quoteStyle","isArray","isRegExp","inspect_","options","depth","seen","maxStringLength","customInspect","indent","numericSeparator","inspectString","bigIntStr","maxDepth","baseIndent","base","prev","getIndent","indexOf","inspect","from","noIndent","newOpts","f","nameOf","arrObjKeys","symString","markBoxed","HTMLElement","nodeName","getAttribute","attrs","attributes","childNodes","xs","singleLineValues","indentedJoin","isError","cause","isMap","mapParts","key","collectionOf","isSet","setParts","isWeakMap","weakCollectionOf","isWeakSet","isWeakRef","isNumber","isBigInt","isBoolean","isString","ys","isPlainObject","constructor","protoTag","stringTag","tag","l","remaining","trailer","lowbyte","type","size","entries","lineJoiner","isArr","symMap","k","keysShim","isArgs","hasDontEnumBug","hasProtoEnumBug","dontEnums","equalsConstructorPrototype","o","ctor","excludedKeys","$applicationCache","$console","$external","$frame","$frameElement","$frames","$innerHeight","$innerWidth","$onmozfullscreenchange","$onmozfullscreenerror","$outerHeight","$outerWidth","$pageXOffset","$pageYOffset","$parent","$scrollLeft","$scrollTop","$scrollX","$scrollY","$self","$webkitIndexedDB","$webkitStorageInfo","$window","hasAutomationEqualityBug","window","isObject","isFunction","isArguments","theKeys","skipProto","skipConstructor","equalsConstructorPrototypeIfNotBuggy","origKeys","originalKeys","shim","keysWorksWithArguments","callee","setFunctionName","hasIndices","global","ignoreCase","multiline","dotAll","unicode","unicodeSets","sticky","define","getPolyfill","flagsBound","flags","calls","TypeErr","regex","polyfill","proto","isRegex","hasDescriptors","$WeakMap","$Map","$weakMapGet","$weakMapSet","$weakMapHas","$mapGet","$mapSet","$mapHas","listGetNode","list","curr","next","$wm","$m","$o","objects","node","listGet","listHas","listSet","Call","Get","IsRegExp","ToString","RequireObjectCoercible","flagsGetter","regexpMatchAllPolyfill","getMatcher","regexp","matcherPolyfill","matchAll","matcher","S","rx","boundMatchAll","regexpMatchAll","CreateRegExpStringIterator","SpeciesConstructor","ToLength","Type","OrigRegExp","supportsConstructingWithFlags","regexMatchAll","R","tmp","C","source","constructRegexWithFlags","lastIndex","fullUnicode","defineP","symbol","mvsIsWS","leftWhitespace","rightWhitespace","boundMethod","receiver","trim","CodePointAt","isInteger","MAX_SAFE_INTEGER","index","IsArray","F","argumentsList","isLeadingSurrogate","isTrailingSurrogate","UTF16SurrogatePairToCodePoint","$charAt","$charCodeAt","position","cp","firstIsLeading","firstIsTrailing","second","done","DefineOwnProperty","FromPropertyDescriptor","IsDataDescriptor","IsPropertyKey","SameValue","IteratorPrototype","AdvanceStringIndex","CreateIterResultObject","CreateMethodProperty","OrdinaryObjectCreate","RegExpExec","setToStringTag","RegExpStringIterator","thisIndex","nextIndex","isPropertyDescriptor","IsAccessorDescriptor","ToPropertyDescriptor","Desc","assertRecord","fromPropertyDescriptor","GetV","IsCallable","$construct","DefinePropertyOrThrow","isConstructorMarker","argument","err","hasRegExpMatcher","ToBoolean","$ObjectCreate","additionalInternalSlotsList","T","regexExec","$isNaN","noThrowOnStrictViolation","Throw","$species","IsConstructor","defaultConstructor","$Number","$RegExp","$parseInteger","regexTester","isBinary","isOctal","isInvalidHexLiteral","hasNonWS","$trim","StringToNumber","NaN","trimmed","ToNumber","truncate","$isFinite","ToIntegerOrInfinity","len","ToPrimitive","Obj","getter","setter","$String","ES5Type","$fromCharCode","lead","trail","optMessage","$isEnumerable","$Array","allowed","isData","IsAccessor","then","recordType","argumentName","array","callback","$abs","absValue","record","a","ES","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","__esModule","d","definition","prop","debug","log","console","dezoomRect","rect","zoomLevel","bottom","height","left","right","top","width","domRectToRect","getClientRectsNoOverlap","range","doNotMergeHorizontallyAlignedRects","clientRects","getClientRects","originalRects","rangeClientRect","newRects","replaceOverlapingRects","rects","tolerance","rectsToKeep","possiblyContainingRect","rectContains","delete","removeContainedRects","mergeTouchingRects","rect1","rect2","rectsLineUpVertically","almostEqual","rectsLineUpHorizontally","rectsTouchOrOverlap","filter","replacementClientRect","getBoundingRect","rectContainsPoint","toRemove","toAdd","subtractRects1","rectSubtract","subtractRects2","rectIntersected","maxLeft","minRight","maxTop","minBottom","rectIntersect","rectA","rectB","rectC","rectD","abs","TrimDirection","ResolveDirection","search","matchPos","exactMatches","textMatchScore","closestNonSpaceInString","baseOffset","direction","nextChar","Forwards","charAt","availableChars","availableNonWhitespaceChars","Backwards","substring","trimEnd","trimStart","offsetDelta","closestNonSpaceInRange","nodeIter","commonAncestorContainer","ownerDocument","createNodeIterator","NodeFilter","SHOW_TEXT","initialBoundaryNode","startContainer","endContainer","terminalBoundaryNode","currentNode","nextNode","previousNode","trimmedOffset","advance","nodeText","textContent","offset","nodeTextLength","_a","_b","nodeType","Node","ELEMENT_NODE","TEXT_NODE","previousSiblingsTextLength","sibling","previousSibling","resolveOffsets","element","offsets","nextOffset","shift","results","textNode","data","relativeTo","parent","contains","el","parentElement","resolve","tw","createTreeWalker","getRootNode","forwards","FORWARDS","fromCharOffset","fromPoint","textOffset","toRange","BACKWARDS","Range","setStart","setEnd","fromRange","startOffset","endOffset","fromOffsets","root","trimmedRange","cloneRange","startTrimmed","endTrimmed","trimmedOffsets","trimRange","TextPositionAnchor","textRange","fromSelector","selector","toSelector","TextQuoteAnchor","exact","context","prefix","suffix","toPositionAnchor","scoreMatch","quoteScore","prefixScore","suffixScore","posScore","quoteWeight","scoredMatches","sort","matchQuote","assign","DecorationManager","styles","groups","lastGroupId","addEventListener","body","lastSize","ResizeObserver","requestAnimationFrame","clientWidth","clientHeight","relayoutDecorations","observe","registerTemplates","templates","stylesheet","id","template","styleElement","createElement","innerHTML","getElementsByTagName","appendChild","addDecoration","decoration","groupName","getGroup","add","removeDecoration","remove","group","values","relayout","DecorationGroup","handleDecorationClickEvent","event","groupContent","item","items","clickableElements","getBoundingClientRect","clientX","clientY","findTarget","lastItemId","container","groupId","cssSelector","textQuote","querySelector","createRange","setStartBefore","setEndAfter","anchor","quotedText","textBefore","textAfter","rangeFromDecorationTarget","layout","findIndex","it","clearContainer","requireContainer","dataset","style","pointerEvents","append","groupContainer","unsafeStyle","itemContainer","documentWritingMode","getComputedStyle","writingMode","isVertical","zoom","currentCSSZoom","scrollingElement","xOffset","scrollLeft","yOffset","scrollTop","viewportWidth","innerHeight","innerWidth","viewportHeight","columnCount","documentElement","getPropertyValue","pageSize","positionElement","boundingRect","isVerticalRL","DOMRect","elementTemplate","content","firstElementChild","message","startsWith","startElement","decoratorWritingMode","r1","r2","clientRect","line","cloneNode","bounds","querySelectorAll","children","GesturesDetector","listener","decorationManager","onClick","defaultPrevented","nearestElement","decorationActivatedEvent","nearestInteractiveElement","HTMLAnchorElement","onLinkActivated","href","outerHTML","stopPropagation","preventDefault","onDecorationActivated","onTap","hasAttribute","SelectionReporter","isSelecting","collapsed","getSelection","isCollapsed","onSelectionEnd","onSelectionStart","SelectionManager","clearSelection","removeAllRanges","getCurrentSelection","getCurrentSelectionText","getSelectionRect","selectedText","highlight","before","after","selectionRect","getRangeAt","selection","anchorNode","focusNode","rangeCount","startNode","endNode","rangeReverse","createOrderedRange","anchorOffset","focusOffset","firstWordStart","lastWordEnd","pop","ReflowableDecorationsBridge","manager","templatesAsMap","parse","parseTemplates","actualDecoration","parseDecoration","ReflowableListenerAdapter","gesturesBridge","selectionListenerBridge","tapEvent","visualViewport","offsetLeft","scale","offsetTop","stringEvent","stringify","outerHtml","stringOffset","stringRect","ReflowableSelectionBridge","CssBridge","setProperties","properties","setProperty","removeProperty","ReflowableMoveBridge","getOffsetForLocation","location","vertical","actualLocation","parseLocation","getOffsetForTextAnchor","getOffsetForCssSelector","htmlId","getOffsetForHtmlId","getOffsetForRect","getOffsetForElement","getElementById","scrollY","scrollX","documentLoadedFired","colCountFixed","scrollingElementEmpty","scrollHeight","scrollWidth","colChanged","wnd","colCountPerScreen","getColumnCountPerScreen","virtualCols","virtualColsCount","virtualCol","documentWidth","windowWidth","lonelyColCount","round","needed","setAttribute","readium","breakBefore","appendVirtualColumnIfNeeded","documentState","onDocumentResized","onDocumentLoadedAndSized","setupViewport","initApis","move","onMoveApiAvailable","bridgeListener","gestures","selectionListener","readiumcss","onCssApiAvailable","onSelectionApiAvailable","decorations","onDecorationApiAvailable","meta","head","reflowableApiState"],"sourceRoot":""} \ No newline at end of file diff --git a/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/pager/ConsumingNestedScrollConnection.kt b/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/pager/ConsumingNestedScrollConnection.kt new file mode 100644 index 0000000000..cd6dff50c7 --- /dev/null +++ b/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/pager/ConsumingNestedScrollConnection.kt @@ -0,0 +1,38 @@ +/* + * Copyright 2026 Readium Foundation. All rights reserved. + * Use of this source code is governed by the BSD-style license + * available in the top-level LICENSE file of the project. + */ + +package org.readium.navigator.web.internals.pager + +import androidx.compose.ui.geometry.Offset +import androidx.compose.ui.input.nestedscroll.NestedScrollConnection +import androidx.compose.ui.input.nestedscroll.NestedScrollSource +import androidx.compose.ui.unit.Velocity + +internal object ConsumingNestedScrollConnection : NestedScrollConnection { + + override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset { + return available + } + + override suspend fun onPreFling(available: Velocity): Velocity { + return available + } + + override fun onPostScroll( + consumed: Offset, + available: Offset, + source: NestedScrollSource, + ): Offset { + return available + } + + override suspend fun onPostFling( + consumed: Velocity, + available: Velocity, + ): Velocity { + return available + } +} diff --git a/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/pager/RenditionPager.kt b/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/pager/RenditionPager.kt index 38cc56090d..bada0eebe1 100644 --- a/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/pager/RenditionPager.kt +++ b/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/pager/RenditionPager.kt @@ -16,6 +16,7 @@ import androidx.compose.foundation.pager.VerticalPager import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.input.nestedscroll.NestedScrollConnection +import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.platform.LocalLayoutDirection import androidx.compose.ui.unit.LayoutDirection import org.readium.navigator.web.internals.gestures.Fling2DBehavior @@ -42,6 +43,11 @@ public fun RenditionPager( reverseDirection = orientation == Orientation.Vertical || LocalLayoutDirection.current == LayoutDirection.Ltr ) + .nestedScroll( + // Consume everything passed by children into the standard nested scroll chain + // before the pager gets it in the prescroll phase because we bypass it. + connection = ConsumingNestedScrollConnection + ) // Disable built-in pager behavior as it is not suitable. val pageNestedScrollConnection = NullNestedScrollConnection diff --git a/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/util/Padding.kt b/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/util/Padding.kt index 5c51c71472..7d5583c0df 100644 --- a/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/util/Padding.kt +++ b/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/util/Padding.kt @@ -6,16 +6,23 @@ package org.readium.navigator.web.internals.util +import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.absolutePadding +import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.platform.LocalLayoutDirection +import androidx.compose.ui.unit.Density import androidx.compose.ui.unit.Dp +import androidx.compose.ui.unit.LayoutDirection import androidx.compose.ui.unit.dp +import kotlin.math.max public data class AbsolutePaddingValues( - val top: Dp, - val right: Dp, - val bottom: Dp, - val left: Dp, + val top: Dp = 0.dp, + val right: Dp = 0.dp, + val bottom: Dp = 0.dp, + val left: Dp = 0.dp, ) { public constructor(vertical: Dp = 0.dp, horizontal: Dp = 0.dp) : this(top = vertical, right = horizontal, bottom = vertical, left = horizontal) @@ -35,3 +42,48 @@ public fun Modifier.absolutePadding(paddingValues: AbsolutePaddingValues): Modif bottom = paddingValues.bottom, left = paddingValues.left ) + +@Composable +public fun WindowInsets.asAbsolutePaddingValues(): AbsolutePaddingValues { + val density = LocalDensity.current + val layoutDirection = LocalLayoutDirection.current + val top = with(density) { getTop(density).toDp() } + val right = with(density) { getRight(density, layoutDirection).toDp() } + val bottom = with(density) { getBottom(density).toDp() } + val left = with(density) { getLeft(density, layoutDirection).toDp() } + return AbsolutePaddingValues(top = top, right = right, bottom = bottom, left = left) +} + +public fun WindowInsets.symmetric(): WindowInsets = + SymmetricWindowsInsets(this) + +private class SymmetricWindowsInsets( + private val baseWindowsInsets: WindowInsets, +) : WindowInsets { + + override fun getLeft( + density: Density, + layoutDirection: LayoutDirection, + ): Int { + val left = baseWindowsInsets.getLeft(density, layoutDirection) + val right = baseWindowsInsets.getRight(density, layoutDirection) + return max(left, right) + } + + override fun getTop(density: Density): Int { + val top = baseWindowsInsets.getTop(density) + val bottom = baseWindowsInsets.getBottom(density) + return max(top, bottom) + } + + override fun getRight( + density: Density, + layoutDirection: LayoutDirection, + ): Int { + return getLeft(density, layoutDirection) + } + + override fun getBottom(density: Density): Int { + return getTop(density) + } +} diff --git a/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/webapi/ReflowableApiState.kt b/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/webapi/ReflowableApiState.kt index 82793a9913..1c47ba2914 100644 --- a/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/webapi/ReflowableApiState.kt +++ b/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/webapi/ReflowableApiState.kt @@ -16,6 +16,7 @@ public class DelegatingReflowableApiStateListener( private val onCssApiAvailableDelegate: () -> Unit, private val onSelectionApiAvailableDelegate: () -> Unit, private val onDecorationApiAvailableDelegate: () -> Unit, + private val onMoveApiAvailableDelegate: () -> Unit, ) : ReflowableApiStateListener { override fun onCssApiAvailable() { @@ -29,6 +30,10 @@ public class DelegatingReflowableApiStateListener( override fun onDecorationApiAvailable() { this.onDecorationApiAvailableDelegate() } + + override fun onMoveApiAvailable() { + this.onMoveApiAvailableDelegate() + } } public interface ReflowableApiStateListener { @@ -38,6 +43,8 @@ public interface ReflowableApiStateListener { public fun onSelectionApiAvailable() public fun onDecorationApiAvailable() + + public fun onMoveApiAvailable() } public class ReflowableApiStateApi( @@ -72,4 +79,11 @@ public class ReflowableApiStateApi( listener.onDecorationApiAvailable() } } + + @android.webkit.JavascriptInterface + public fun onMoveApiAvailable() { + coroutineScope.launch { + listener.onMoveApiAvailable() + } + } } diff --git a/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/webapi/ReflowableMoveApi.kt b/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/webapi/ReflowableMoveApi.kt new file mode 100644 index 0000000000..9908affe41 --- /dev/null +++ b/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/webapi/ReflowableMoveApi.kt @@ -0,0 +1,69 @@ +/* + * Copyright 2025 Readium Foundation. All rights reserved. + * Use of this source code is governed by the BSD-style license + * available in the top-level LICENSE file of the project. + */ + +@file:OptIn(ExperimentalReadiumApi::class) + +package org.readium.navigator.web.internals.webapi + +import android.webkit.WebView +import androidx.compose.foundation.gestures.Orientation +import kotlin.math.roundToInt +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext +import kotlinx.serialization.Serializable +import kotlinx.serialization.json.Json +import org.readium.navigator.common.CssSelector +import org.readium.navigator.common.HtmlId +import org.readium.navigator.common.Progression +import org.readium.navigator.common.TextAnchor +import org.readium.navigator.web.internals.webview.evaluateJavaScriptSuspend +import org.readium.r2.shared.ExperimentalReadiumApi + +public class ReflowableMoveApi( + private val webView: WebView, +) { + + public suspend fun getOffsetForLocation( + progression: Progression? = null, + htmlId: HtmlId? = null, + cssSelector: CssSelector? = null, + textAnchor: TextAnchor? = null, + orientation: Orientation, + ): Int? = + withContext(Dispatchers.Main) { + getOffsetForLocationUnsafe(progression, htmlId, cssSelector, textAnchor, orientation) + } + + private suspend fun getOffsetForLocationUnsafe( + progression: Progression?, + htmlId: HtmlId?, + cssSelector: CssSelector? = null, + textAnchor: TextAnchor? = null, + orientation: Orientation, + ): Int? { + val jsonLocation = JsonLocation( + progression = progression?.value, + htmlId = htmlId?.value, + cssSelector = cssSelector?.value, + textBefore = textAnchor?.textBefore, + textAfter = textAnchor?.textAfter + ) + val locationAsLiteral = Json.encodeToString(jsonLocation).toJavaScriptLiteral() + val vertical = orientation == Orientation.Vertical + val script = "move.getOffsetForLocation($locationAsLiteral, $vertical)" + val result = webView.evaluateJavaScriptSuspend(script) + return result.toDoubleOrNull()?.roundToInt() + } +} + +@Serializable +private data class JsonLocation( + val progression: Double?, + val htmlId: String?, + val cssSelector: String?, + val textBefore: String?, + val textAfter: String?, +) diff --git a/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/webapi/SelectionListenerApi.kt b/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/webapi/SelectionListenerApi.kt new file mode 100644 index 0000000000..14b68138e5 --- /dev/null +++ b/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/webapi/SelectionListenerApi.kt @@ -0,0 +1,59 @@ +/* + * Copyright 2025 Readium Foundation. All rights reserved. + * Use of this source code is governed by the BSD-style license + * available in the top-level LICENSE file of the project. + */ + +package org.readium.navigator.web.internals.webapi + +import android.webkit.WebView +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.MainScope +import kotlinx.coroutines.launch + +public interface SelectionListener { + + public fun onSelectionStart() + + public fun onSelectionEnd() +} + +public class DelegatingSelectionListener( + private val onSelectionStartDelegate: () -> Unit, + private val onSelectionEndDelegate: () -> Unit, +) : SelectionListener { + + override fun onSelectionStart() { + onSelectionStartDelegate() + } + + override fun onSelectionEnd() { + onSelectionEndDelegate() + } +} + +public class SelectionListenerApi( + webView: WebView, + public var listener: SelectionListener? = null, +) { + private val coroutineScope: CoroutineScope = + MainScope() + + init { + webView.addJavascriptInterface(this, "selectionListener") + } + + @android.webkit.JavascriptInterface + public fun onSelectionStart() { + coroutineScope.launch { + listener?.onSelectionStart() + } + } + + @android.webkit.JavascriptInterface + public fun onSelectionEnd() { + coroutineScope.launch { + listener?.onSelectionEnd() + } + } +} diff --git a/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/webview/ComposableWebView.kt b/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/webview/ComposableWebView.kt index 999b297617..e5dad4ff1c 100644 --- a/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/webview/ComposableWebView.kt +++ b/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/webview/ComposableWebView.kt @@ -13,10 +13,8 @@ import android.webkit.WebChromeClient import android.webkit.WebView import android.webkit.WebViewClient import android.widget.FrameLayout -import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.BoxWithConstraints import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.lazy.LazyRow import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.Stable @@ -25,7 +23,6 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.runtime.snapshotFlow -import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.viewinterop.AndroidView @@ -118,25 +115,16 @@ public fun WebView( height ) - LazyRow( - horizontalArrangement = Arrangement.Center, - verticalAlignment = Alignment.CenterVertically, - userScrollEnabled = false, - modifier = Modifier.fillMaxSize() - ) { - item { - WebView( - state, - factory, - layoutParams, - Modifier.fillParentMaxSize(), - onCreated, - onDispose, - client, - chromeClient, - ) - } - } + WebView( + state, + factory, + layoutParams, + Modifier.fillMaxSize(), + onCreated, + onDispose, + client, + chromeClient, + ) } } diff --git a/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/webview/RelaxedWebView.kt b/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/webview/RelaxedWebView.kt index 243125509a..b561c4144a 100644 --- a/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/webview/RelaxedWebView.kt +++ b/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/webview/RelaxedWebView.kt @@ -9,6 +9,7 @@ package org.readium.navigator.web.internals.webview import android.content.Context import android.graphics.Rect import android.view.ActionMode +import android.view.Menu import android.view.View import android.webkit.WebView @@ -55,7 +56,9 @@ public class RelaxedWebView(context: Context) : WebView(context) { private var actionModeCallback: ActionMode.Callback? = null - public fun setCustomSelectionActionModeCallback(callback: ActionMode.Callback?) { + public fun setCustomSelectionActionModeCallback( + callback: ActionMode.Callback?, + ) { actionModeCallback = callback } @@ -67,23 +70,40 @@ public class RelaxedWebView(context: Context) : WebView(context) { nextLayoutListener = {} } - override fun startActionMode(callback: ActionMode.Callback?): ActionMode? { - val customCallback = actionModeCallback - ?: return super.startActionMode(callback) + private var hasActionMode: Boolean = false - val parent = parent ?: return null - return parent.startActionModeForChild(this, customCallback) + override fun onOverScrolled(scrollX: Int, scrollY: Int, clampedX: Boolean, clampedY: Boolean) { + // Workaround addressing a bug in the Android WebView where the viewport is scrolled while + // dragging the text selection handles. + // See https://github.com/readium/kotlin-toolkit/issues/325 + if (hasActionMode) { + return + } + + super.onOverScrolled(scrollX, scrollY, clampedX, clampedY) } - override fun startActionMode(callback: ActionMode.Callback?, type: Int): ActionMode? { - val customCallback = actionModeCallback - ?: return super.startActionMode(callback, type) + override fun startActionMode(callback: ActionMode.Callback): ActionMode? { + return startActionMode(callback, ActionMode.TYPE_PRIMARY) + } + + override fun startActionMode(callback: ActionMode.Callback, type: Int): ActionMode? { + val decoratedCallback = CallbackDecorator( + callback = actionModeCallback ?: callback, + onCreateActionModeCallback = { hasActionMode = true }, + onDestroyActionModeCallback = { hasActionMode = false } + ) - val parent = parent ?: return null val wrapper = Callback2Wrapper( - customCallback, + decoratedCallback, callback2 = callback as? ActionMode.Callback2 ) + + if (actionModeCallback == null) { + return super.startActionMode(wrapper, type) + } + + val parent = parent ?: return null return parent.startActionModeForChild(this, wrapper, type) } } @@ -97,3 +117,31 @@ private class Callback2Wrapper( callback2?.onGetContentRect(mode, view, outRect) ?: super.onGetContentRect(mode, view, outRect) } + +private class CallbackDecorator( + private val callback: ActionMode.Callback, + private val onCreateActionModeCallback: () -> Unit, + private val onDestroyActionModeCallback: () -> Unit, +) : ActionMode.Callback by callback { + + override fun onCreateActionMode(mode: ActionMode?, menu: Menu?): Boolean { + onCreateActionModeCallback() + return callback.onCreateActionMode(mode, menu) + } + + override fun onDestroyActionMode(mode: ActionMode?) { + callback.onDestroyActionMode(mode) + onDestroyActionModeCallback() + } +} + +/** + * Best effort to delay the execution of a block until the Webview + * has received data up-to-date at the moment when the call occurs or newer. + */ +public fun RelaxedWebView.invokeOnWebViewUpToDate(block: WebView.() -> Unit) { + requestLayout() + setNextLayoutListener { + invokeOnReadyToBeDrawn(block) + } +} diff --git a/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/webview/WebViewScrollController.kt b/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/webview/WebViewScrollController.kt index dc6120215a..fab0da2be9 100644 --- a/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/webview/WebViewScrollController.kt +++ b/readium/navigators/web/internals/src/main/kotlin/org/readium/navigator/web/internals/webview/WebViewScrollController.kt @@ -12,9 +12,11 @@ import androidx.compose.ui.unit.LayoutDirection import androidx.compose.ui.util.fastCoerceAtLeast import androidx.compose.ui.util.fastCoerceAtMost import androidx.compose.ui.util.fastRoundToInt +import kotlin.math.ceil import kotlin.math.roundToInt import org.readium.navigator.web.internals.gestures.DefaultScrollable2DState import org.readium.navigator.web.internals.gestures.Scrollable2DState +import org.readium.r2.shared.ExperimentalReadiumApi public class WebViewScrollController( private val webView: RelaxedWebView, @@ -32,16 +34,16 @@ public class WebViewScrollController( get() = webView.maxScrollY public val canMoveLeft: Boolean - get() = webView.scrollX > webView.width / 2 == true + get() = webView.scrollX > webView.width / 2 public val canMoveRight: Boolean - get() = webView.maxScrollX - webView.scrollX > webView.width / 2 == true + get() = webView.maxScrollX - webView.scrollX > webView.width / 2 public val canMoveTop: Boolean - get() = webView.scrollY > webView.width / 2 == true + get() = webView.scrollY > webView.height / 2 public val canMoveBottom: Boolean - get() = webView.maxScrollY - webView.scrollY > webView.width / 2 == true + get() = webView.maxScrollY - webView.scrollY > webView.height / 2 public fun moveLeft() { webView.scrollBy(-webView.width, 0) @@ -52,11 +54,11 @@ public class WebViewScrollController( } public fun moveTop() { - webView.scrollBy(0, -webView.width) + webView.scrollBy(0, -webView.height) } public fun moveBottom() { - webView.scrollBy(0, webView.width) + webView.scrollBy(0, webView.height) } public fun scrollBy(delta: Offset): Offset { @@ -94,8 +96,11 @@ public class WebViewScrollController( } } - public fun progression(orientation: Orientation, direction: LayoutDirection): Double? = - webView.progression(orientation, direction).takeIf { it.isFinite() } + public fun startProgression(orientation: Orientation, direction: LayoutDirection): Double? = + webView.startProgression(orientation, direction).takeIf { it.isFinite() } + + public fun endProgression(orientation: Orientation, direction: LayoutDirection): Double? = + webView.endProgression(orientation, direction).takeIf { it.isFinite() } public fun moveToProgression( progression: Double, @@ -111,20 +116,39 @@ public class WebViewScrollController( orientation = orientation, direction = direction ) + if (snap) { - when (orientation) { - Orientation.Vertical -> { - val offset = webView.scrollY % webView.height - webView.scrollBy(0, -offset) - } - Orientation.Horizontal -> { - val offset = webView.scrollX % webView.width - webView.scrollBy(-offset, 0) - } + snap(orientation) + } + } + + public fun snap(orientation: Orientation) { + when (orientation) { + Orientation.Vertical -> { + val offset = webView.scrollY % webView.height + webView.scrollBy(0, -offset) + } + Orientation.Horizontal -> { + val offset = webView.scrollX % webView.width + webView.scrollBy(-offset, 0) } } } + public fun moveToOffset( + offset: Int, + snap: Boolean, + orientation: Orientation, + ) { + webView.scrollToOffset( + offset = offset, + orientation = orientation + ) + if (snap) { + snap(orientation) + } + } + public fun moveForward(orientation: Orientation, direction: LayoutDirection): Unit = when (orientation) { Orientation.Vertical -> moveBottom() @@ -167,29 +191,60 @@ private fun RelaxedWebView.scrollToProgression( orientation: Orientation, direction: LayoutDirection, ) { + val docHeight = maxScrollY + height + val docWidth = maxScrollX + width + when (orientation) { Orientation.Vertical -> { - scrollTo(scrollX, progression.roundToInt() * maxScrollY) + scrollTo(scrollX, ceil((progression * docHeight)).roundToInt()) } Orientation.Horizontal -> when (direction) { LayoutDirection.Ltr -> { - scrollTo(progression.roundToInt() * maxScrollX, scrollY) + scrollTo(ceil(progression * docWidth).roundToInt(), scrollY) } LayoutDirection.Rtl -> { - scrollTo((1 - progression).roundToInt() * maxScrollX, scrollY) + scrollTo((ceil((1 - progression) * docWidth)).roundToInt(), scrollY) } } } } -private fun RelaxedWebView.progression( +private fun RelaxedWebView.scrollToOffset( + offset: Int, + orientation: Orientation, +) { + when (orientation) { + Orientation.Vertical -> { + scrollTo(scrollX, offset) + } + Orientation.Horizontal -> { + scrollTo(offset, scrollY) + } + } +} + +@OptIn(ExperimentalReadiumApi::class) +private fun RelaxedWebView.startProgression( orientation: Orientation, direction: LayoutDirection, ) = when (orientation) { - Orientation.Vertical -> scrollY / maxScrollY.toDouble() + Orientation.Vertical -> scrollY / (maxScrollY + height).toDouble() Orientation.Horizontal -> when (direction) { - LayoutDirection.Ltr -> scrollX / maxScrollX.toDouble() - LayoutDirection.Rtl -> 1 - scrollX / maxScrollX.toDouble() + LayoutDirection.Ltr -> scrollX / (maxScrollX + width).toDouble() + LayoutDirection.Rtl -> 1 - scrollX / (maxScrollX + width).toDouble() + } +} + +private fun RelaxedWebView.endProgression( + orientation: Orientation, + direction: LayoutDirection, +): Double { + return when (orientation) { + Orientation.Vertical -> (scrollY + height) / (maxScrollY + height).toDouble() + Orientation.Horizontal -> when (direction) { + LayoutDirection.Ltr -> (scrollX + width) / (maxScrollX + width).toDouble() + LayoutDirection.Rtl -> 1 - (scrollX + width) / (maxScrollX + width).toDouble() + } } } diff --git a/readium/navigators/web/reflowable/build.gradle.kts b/readium/navigators/web/reflowable/build.gradle.kts index bb74f066d5..a0e6d61d46 100644 --- a/readium/navigators/web/reflowable/build.gradle.kts +++ b/readium/navigators/web/reflowable/build.gradle.kts @@ -23,13 +23,13 @@ dependencies { api(project(":readium:readium-navigator")) api(project(":readium:navigators:readium-navigator-common")) api(project(":readium:navigators:web:readium-navigator-web-common")) + implementation(project(":readium:navigators:web:readium-navigator-web-internals")) - implementation(libs.kotlinx.serialization.json) - implementation(libs.kotlinx.collections.immutable) - implementation(libs.bundles.compose) + api(libs.androidx.compose.foundation) + + implementation(libs.androidx.core) implementation(libs.timber) - implementation(libs.kotlinx.coroutines.android) implementation(libs.androidx.webkit) implementation(libs.jsoup) } diff --git a/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/ReflowableWebLocations.kt b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/ReflowableWebLocations.kt index 4afbd2c6cb..5291c1aa44 100644 --- a/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/ReflowableWebLocations.kt +++ b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/ReflowableWebLocations.kt @@ -14,12 +14,18 @@ import org.readium.navigator.common.Decoration import org.readium.navigator.common.DecorationLocation import org.readium.navigator.common.ExportableLocation import org.readium.navigator.common.GoLocation +import org.readium.navigator.common.HtmlId import org.readium.navigator.common.Location +import org.readium.navigator.common.Position +import org.readium.navigator.common.PositionLocation import org.readium.navigator.common.Progression import org.readium.navigator.common.ProgressionLocation import org.readium.navigator.common.SelectionLocation +import org.readium.navigator.common.TextAnchor +import org.readium.navigator.common.TextAnchorLocation import org.readium.navigator.common.TextQuote import org.readium.navigator.common.TextQuoteLocation +import org.readium.navigator.common.toTextAnchor import org.readium.r2.shared.ExperimentalReadiumApi import org.readium.r2.shared.InternalReadiumApi import org.readium.r2.shared.extensions.addPrefix @@ -34,20 +40,24 @@ import org.readium.r2.shared.util.mediatype.MediaType public data class ReflowableWebGoLocation( override val href: Url, val progression: Progression? = null, - // val cssSelector: String? = null, - // val textBefore: String? = null, - // val textAfter: String? = null, - // val position: Int? = null + val htmlId: HtmlId? = null, + val cssSelector: CssSelector? = null, + val textAnchor: TextAnchor? = null, ) : GoLocation { public constructor(location: Location) : this( href = location.href, - progression = (location as? ProgressionLocation)?.progression + progression = (location as? ProgressionLocation)?.progression, + cssSelector = (location as? CssSelectorLocation)?.cssSelector, + textAnchor = (location as? TextAnchorLocation)?.textAnchor + ?: (location as? TextQuoteLocation)?.textQuote?.toTextAnchor() ) public constructor(locator: Locator) : this( href = locator.href, - progression = locator.locations.progression?.let { Progression(it) } + progression = locator.locations.progression?.let { Progression(it) }, + cssSelector = locator.locations.cssSelector?.let { CssSelector(it) }, + textAnchor = locator.text.toTextAnchor() ) } @@ -111,14 +121,14 @@ public sealed interface ReflowableWebDecorationLocation : DecorationLocation { internal data class ReflowableWebDecorationCssSelectorLocation( override val href: Url, - val cssSelector: CssSelector, -) : ReflowableWebDecorationLocation + override val cssSelector: CssSelector, +) : ReflowableWebDecorationLocation, CssSelectorLocation internal data class ReflowableWebDecorationTextQuoteLocation( override val href: Url, - val textQuote: TextQuote, + override val textQuote: TextQuote, val cssSelector: CssSelector?, -) : ReflowableWebDecorationLocation +) : ReflowableWebDecorationLocation, TextQuoteLocation @ExperimentalReadiumApi @ConsistentCopyVisibility @@ -126,13 +136,19 @@ public data class ReflowableWebLocation internal constructor( override val href: Url, private val mediaType: MediaType?, override val progression: Progression, -) : ExportableLocation, ProgressionLocation { + override val position: Position, + val totalProgression: Progression, +) : ExportableLocation, ProgressionLocation, PositionLocation { override fun toLocator(): Locator = Locator( href = href, mediaType = mediaType ?: MediaType.XHTML, - locations = Locations(progression = progression.value) + locations = Locations( + progression = progression.value, + position = position.value, + totalProgression = totalProgression.value + ) ) } diff --git a/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/ReflowableWebPublication.kt b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/ReflowableWebPublication.kt index 06e9486c6a..e01b29e580 100644 --- a/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/ReflowableWebPublication.kt +++ b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/ReflowableWebPublication.kt @@ -4,8 +4,14 @@ * available in the top-level LICENSE file of the project. */ +@file:OptIn(ExperimentalReadiumApi::class) + package org.readium.navigator.web.reflowable +import kotlin.math.floor +import org.readium.navigator.common.Position +import org.readium.navigator.common.Progression +import org.readium.r2.shared.ExperimentalReadiumApi import org.readium.r2.shared.util.Url import org.readium.r2.shared.util.data.Container import org.readium.r2.shared.util.mediatype.MediaType @@ -23,6 +29,7 @@ internal class ReflowableWebPublication( data class ReadingOrder( val items: List, + val positionNumbers: List, ) { val size: Int get() = items.size @@ -36,10 +43,37 @@ internal class ReflowableWebPublication( private val allItems = readingOrder.items + otherResources + private val startPositions = buildList { + var position = 1 + for (item in readingOrder.positionNumbers) { + add(position) + position += item + } + } + + private val totalPositionCount = readingOrder.positionNumbers.sum() + val mediaTypes = allItems .mapNotNull { item -> item.mediaType?.let { item.href to it } } .associate { it } fun itemWithHref(href: Url): Item? = allItems.firstOrNull { it.href == href } + + fun positionForProgression(href: Url, progression: Progression): Position { + val index = readingOrder.indexOfHref(href)!! + return positionForProgression(index, progression) + } + + fun positionForProgression(index: Int, progression: Progression): Position { + val itemPositionNumber = readingOrder.positionNumbers[index] + val localPosition = floor(progression.value * itemPositionNumber).toInt() + // If progression == 1.0, don't go for the next resource. + .coerceAtMost(itemPositionNumber - 1) + return Position(startPositions[index] + localPosition)!! + } + + fun totalProgressionForPosition(position: Position): Progression { + return Progression((position.value - 1) / totalPositionCount.toDouble())!! + } } diff --git a/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/ReflowableWebRendition.kt b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/ReflowableWebRendition.kt index 3594ebb98b..05cc956d78 100644 --- a/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/ReflowableWebRendition.kt +++ b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/ReflowableWebRendition.kt @@ -4,37 +4,32 @@ * available in the top-level LICENSE file of the project. */ +@file:OptIn(ExperimentalReadiumApi::class) + package org.readium.navigator.web.reflowable import android.annotation.SuppressLint import android.content.res.Configuration import android.view.ActionMode -import androidx.compose.foundation.background import androidx.compose.foundation.gestures.ScrollableDefaults -import androidx.compose.foundation.gestures.detectTapGestures import androidx.compose.foundation.layout.BoxWithConstraints import androidx.compose.foundation.layout.WindowInsets +import androidx.compose.foundation.layout.WindowInsetsSides import androidx.compose.foundation.layout.displayCutout import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.windowInsetsPadding +import androidx.compose.foundation.layout.only +import androidx.compose.foundation.layout.union import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.LaunchedEffect -import androidx.compose.runtime.derivedStateOf -import androidx.compose.runtime.remember import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.runtime.snapshotFlow import androidx.compose.ui.Modifier -import androidx.compose.ui.geometry.Offset import androidx.compose.ui.graphics.Color -import androidx.compose.ui.input.pointer.pointerInput import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.platform.LocalLayoutDirection -import androidx.compose.ui.unit.Density -import androidx.compose.ui.unit.DpOffset import androidx.compose.ui.unit.DpSize -import androidx.compose.ui.unit.dp import kotlinx.collections.immutable.toImmutableMap import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach @@ -43,7 +38,6 @@ import org.readium.navigator.common.DecorationListener import org.readium.navigator.common.HyperlinkListener import org.readium.navigator.common.InputListener import org.readium.navigator.common.TapContext -import org.readium.navigator.common.TapEvent import org.readium.navigator.common.defaultDecorationListener import org.readium.navigator.common.defaultHyperlinkListener import org.readium.navigator.common.defaultInputListener @@ -53,8 +47,11 @@ import org.readium.navigator.web.internals.pager.pagingFlingBehavior import org.readium.navigator.web.internals.server.WebViewServer import org.readium.navigator.web.internals.util.AbsolutePaddingValues import org.readium.navigator.web.internals.util.HyperlinkProcessor +import org.readium.navigator.web.internals.util.asAbsolutePaddingValues import org.readium.navigator.web.internals.util.rememberUpdatedRef +import org.readium.navigator.web.internals.util.symmetric import org.readium.navigator.web.internals.util.toLayoutDirection +import org.readium.navigator.web.reflowable.layout.LayoutConstants import org.readium.navigator.web.reflowable.resource.ReflowablePagingLayoutInfo import org.readium.navigator.web.reflowable.resource.ReflowableResource import org.readium.r2.shared.ExperimentalReadiumApi @@ -79,8 +76,17 @@ public fun ReflowableWebRendition( decorationListener: DecorationListener = defaultDecorationListener(state.controller), textSelectionActionModeCallback: ActionMode.Callback? = null, ) { + val overflowNow = state.layoutDelegate.overflow.value + val layoutDirection = - state.layoutDelegate.overflow.value.readingProgression.toLayoutDirection() + overflowNow.readingProgression.toLayoutDirection() + + val layoutOrientation = + overflowNow.orientation + + val settingsNow = state.layoutDelegate.settings + + val injectorNow = state.layoutDelegate.readiumCssInjector CompositionLocalProvider(LocalLayoutDirection provides layoutDirection) { BoxWithConstraints( @@ -91,23 +97,29 @@ public fun ReflowableWebRendition( state.layoutDelegate.viewportSize = viewportSize.value + state.layoutDelegate.safeDrawing = windowInsets.asAbsolutePaddingValues() + state.layoutDelegate.fontScale = LocalDensity.current.fontScale val coroutineScope = rememberCoroutineScope() - val resourcePadding = - if (state.layoutDelegate.overflow.value.scroll) { + val resourcePadding = when (overflowNow.scroll) { + true -> AbsolutePaddingValues() - } else { - when (LocalConfiguration.current.orientation) { - Configuration.ORIENTATION_LANDSCAPE -> - AbsolutePaddingValues(vertical = 20.dp) - else -> - AbsolutePaddingValues(vertical = 40.dp) + false -> { + val margins = when (LocalConfiguration.current.orientation) { + Configuration.ORIENTATION_LANDSCAPE -> LayoutConstants.pageVerticalMarginsLandscape + else -> LayoutConstants.pageVerticalMarginsPortrait } + windowInsets + .only(WindowInsetsSides.Vertical) + .union(WindowInsets(top = margins, bottom = margins)) + .symmetric() + .asAbsolutePaddingValues() } + } - val flingBehavior = if (state.layoutDelegate.overflow.value.scroll) { + val flingBehavior = if (overflowNow.scroll) { ScrollableDefaults.flingBehavior() } else { pagingFlingBehavior( @@ -118,55 +130,29 @@ public fun ReflowableWebRendition( direction = layoutDirection ) ) - }.toFling2DBehavior(state.layoutDelegate.orientation) - - val backgroundColor = Color(state.layoutDelegate.settings.backgroundColor.int) - - val currentPageState = remember(state) { derivedStateOf { state.pagerState.currentPage } } - - fun currentLocation(): ReflowableWebLocation { - val currentItem = state.publication.readingOrder.items[currentPageState.value] - return ReflowableWebLocation( - href = currentItem.href, - mediaType = currentItem.mediaType, - progression = state.resourceStates[currentPageState.value].progression - ) - } + }.toFling2DBehavior(layoutOrientation) - if (state.controller == null) { - // Initialize controller. In the future, that should require access to a ready WebView. - state.initController(location = currentLocation()) - } + val backgroundColor = Color(settingsNow.backgroundColor.int) - LaunchedEffect(state) { + LaunchedEffect(state.pagerState) { snapshotFlow { state.pagerState.currentPage }.onEach { - state.updateLocation(currentLocation()) + state.updateLocation() }.launchIn(this) } RenditionPager( - modifier = Modifier - // Apply background on padding - .background(backgroundColor) - // Detect taps on padding - .pointerInput(Unit) { - detectTapGestures( - onTap = { onTapOnPadding(it, viewportSize.value, inputListener) } - ) - } - .windowInsetsPadding(windowInsets), state = state.pagerState, scrollState = state.scrollState, flingBehavior = flingBehavior, beyondViewportPageCount = 3, - orientation = state.layoutDelegate.orientation, + orientation = layoutOrientation, ) { index -> val href = state.publication.readingOrder.items[index].href val decorations = state.decorationDelegate.decorations - .mapValues { it.value.filter { it.location.href == href } } + .mapValues { groupDecorations -> groupDecorations.value.filter { it.location.href == href } } .toImmutableMap() ReflowableResource( @@ -176,9 +162,9 @@ public fun ReflowableWebRendition( backgroundColor = backgroundColor, padding = resourcePadding, layoutDirection = layoutDirection, - scroll = state.layoutDelegate.settings.scroll, - orientation = state.layoutDelegate.orientation, - readiumCssInjector = state.layoutDelegate.readiumCssInjector, + scroll = overflowNow.scroll, + orientation = layoutOrientation, + readiumCssInjector = injectorNow, decorationTemplates = state.decorationDelegate.decorationTemplates, decorations = decorations, actionModeCallback = textSelectionActionModeCallback, @@ -199,40 +185,19 @@ public fun ReflowableWebRendition( onDecorationActivated = { event -> decorationListener.onDecorationActivated(event) }, - onProgressionChange = { - if (index == currentPageState.value) { - val item = state.publication.readingOrder[index] - val newLocation = ReflowableWebLocation( - href = item.href, - mediaType = item.mediaType, - progression = it - ) - state.updateLocation(newLocation) - } + onLocationChange = { + state.updateLocation() }, onDocumentResized = { state.scrollState.onDocumentResized(index) - } + state.updateLocation() + }, ) } } } } -@OptIn(ExperimentalReadiumApi::class) -private fun (Density).onTapOnPadding( - offset: Offset, - viewportSize: DpSize, - listener: InputListener, -) { - if (offset.x >= 0 && offset.y >= 0) { - val offset = DpOffset(x = offset.x.toDp(), y = offset.y.toDp()) - val event = TapEvent(offset) - listener.onTap(event, TapContext(viewportSize)) - } -} - -@OptIn(ExperimentalReadiumApi::class) private suspend fun HyperlinkProcessor.onLinkActivated( url: Url, outerHtml: String, diff --git a/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/ReflowableWebRenditionFactory.kt b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/ReflowableWebRenditionFactory.kt index 92ddee32b5..40ef20bb01 100644 --- a/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/ReflowableWebRenditionFactory.kt +++ b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/ReflowableWebRenditionFactory.kt @@ -17,7 +17,9 @@ import org.readium.r2.shared.publication.Link import org.readium.r2.shared.publication.Publication import org.readium.r2.shared.publication.epub.EpubLayout import org.readium.r2.shared.publication.presentation.presentation +import org.readium.r2.shared.publication.services.PositionsService import org.readium.r2.shared.publication.services.isProtected +import org.readium.r2.shared.publication.services.isRestricted import org.readium.r2.shared.util.Try /** @@ -31,6 +33,7 @@ import org.readium.r2.shared.util.Try public class ReflowableWebRenditionFactory private constructor( private val application: Application, private val publication: Publication, + private val positionsService: PositionsService, private val configuration: ReflowableWebConfiguration, ) { @@ -51,9 +54,17 @@ public class ReflowableWebRenditionFactory private constructor( return null } + if (publication.isRestricted) { + return null + } + + val positionsService = publication.findService(PositionsService::class) + ?: return null + return ReflowableWebRenditionFactory( application, publication, + positionsService, configuration ) } @@ -69,22 +80,24 @@ public class ReflowableWebRenditionFactory private constructor( ) : Error("Could not create a rendition state.", cause) } - @Suppress("RedundantSuspendModifier") public suspend fun createRenditionState( initialSettings: ReflowableWebSettings, initialLocation: ReflowableWebGoLocation? = null, readingOrder: List = publication.readingOrder, + positionsService: PositionsService = this.positionsService, ): Try { - // TODO: support font family declarations and reading system properties // TODO: enable apps not to disable selection when publication is protected - val readingOrderItems = readingOrder.map { + val readingOrderItems = readingOrder.mapIndexed { index, link -> ReflowableWebPublication.Item( - href = it.url(), - mediaType = it.mediaType + href = link.url(), + mediaType = link.mediaType, ) } + val positionNumbers = positionsService.positionsByReadingOrder() + .map { it.size } + val resourceItems = (publication.readingOrder - readingOrder + publication.resources).map { ReflowableWebPublication.Item( href = it.url(), @@ -93,7 +106,7 @@ public class ReflowableWebRenditionFactory private constructor( } val renditionPublication = ReflowableWebPublication( - readingOrder = ReflowableWebPublication.ReadingOrder(readingOrderItems), + readingOrder = ReflowableWebPublication.ReadingOrder(readingOrderItems, positionNumbers), otherResources = resourceItems, container = publication.container ) diff --git a/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/ReflowableWebRenditionState.kt b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/ReflowableWebRenditionState.kt index f008bb4a08..918b3b64b2 100644 --- a/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/ReflowableWebRenditionState.kt +++ b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/ReflowableWebRenditionState.kt @@ -9,6 +9,8 @@ package org.readium.navigator.web.reflowable import android.app.Application +import androidx.compose.foundation.MutatePriority +import androidx.compose.foundation.MutatorMutex import androidx.compose.foundation.gestures.Orientation import androidx.compose.foundation.pager.PagerState import androidx.compose.runtime.MutableState @@ -21,12 +23,16 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.setValue import androidx.compose.runtime.snapshots.SnapshotStateMap import androidx.compose.ui.unit.DpSize -import androidx.compose.ui.unit.dp import kotlinx.collections.immutable.PersistentList import kotlinx.collections.immutable.PersistentMap import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.persistentMapOf +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.coroutineScope +import kotlinx.coroutines.suspendCancellableCoroutine +import kotlinx.coroutines.withContext import org.readium.navigator.common.DecorationController +import org.readium.navigator.common.HtmlId import org.readium.navigator.common.NavigationController import org.readium.navigator.common.Overflow import org.readium.navigator.common.OverflowController @@ -43,20 +49,24 @@ import org.readium.navigator.web.internals.pager.RenditionScrollState import org.readium.navigator.web.internals.server.WebViewClient import org.readium.navigator.web.internals.server.WebViewServer import org.readium.navigator.web.internals.server.WebViewServer.Companion.assetsBaseHref +import org.readium.navigator.web.internals.util.AbsolutePaddingValues import org.readium.navigator.web.internals.util.HyperlinkProcessor import org.readium.navigator.web.internals.util.toLayoutDirection import org.readium.navigator.web.internals.util.toOrientation import org.readium.navigator.web.internals.webapi.ReflowableSelectionApi import org.readium.navigator.web.internals.webview.WebViewScrollController -import org.readium.navigator.web.reflowable.css.PaginatedLayoutResolver import org.readium.navigator.web.reflowable.css.ReadiumCssInjector import org.readium.navigator.web.reflowable.css.RsProperties import org.readium.navigator.web.reflowable.css.UserProperties import org.readium.navigator.web.reflowable.css.withLayout import org.readium.navigator.web.reflowable.css.withSettings import org.readium.navigator.web.reflowable.injection.injectHtmlReflowable +import org.readium.navigator.web.reflowable.layout.LayoutConstants +import org.readium.navigator.web.reflowable.layout.LayoutResolver import org.readium.navigator.web.reflowable.preferences.ReflowableWebSettings +import org.readium.navigator.web.reflowable.resource.ReflowableResourceLocation import org.readium.navigator.web.reflowable.resource.ReflowableResourceState +import org.readium.navigator.web.reflowable.resource.ReflowableWebViewport import org.readium.r2.navigator.preferences.Axis import org.readium.r2.navigator.preferences.FontFamily import org.readium.r2.shared.ExperimentalReadiumApi @@ -70,7 +80,7 @@ import org.readium.r2.shared.util.resource.Resource * State holder for the rendition of a reflowable Web publication. * * You can interact with it mainly through its [controller] witch will be available as soon - * as the first composition has completed. + * as the first layout has completed. */ @ExperimentalReadiumApi @Stable @@ -88,23 +98,31 @@ public class ReflowableWebRenditionState internal constructor( override val controller: ReflowableWebRenditionController? by controllerState - private val initialResource = publication.readingOrder - .indexOfHref(initialLocation.href) - ?: 0 + private val indexedInitialLocation: IndexedGoLocation = initialLocation + .let { location -> + publication.readingOrder.indexOfHref(location.href) + ?.let { IndexedGoLocation(it, location) } + ?: IndexedGoLocation(0, ReflowableWebGoLocation(href = publication.readingOrder[0].href)) + } + + internal val pagerState: PagerState = + PagerState( + currentPage = indexedInitialLocation.index, + pageCount = { publication.readingOrder.size } + ) internal val resourceStates: List = - publication.readingOrder.items.mapIndexed { index, item -> - val progression = when { - index < initialResource -> 1.0 - index > initialResource -> 0.0 - else -> initialLocation.progression?.value ?: 0.0 + publication.getResourceLocations( + destinationIndex = indexedInitialLocation.index, + destinationLocation = indexedInitialLocation.location.toResourceLocation() + ).zip(publication.readingOrder.items) + .mapIndexed { index, (location, item) -> + ReflowableResourceState( + index = index, + href = item.href, + initialLocation = location + ) } - ReflowableResourceState( - index = index, - href = item.href, - progression = Progression(progression)!! - ) - } private val fontFamilyDeclarations: List = buildList { @@ -127,12 +145,6 @@ public class ReflowableWebRenditionState internal constructor( initialSettings ) - internal val pagerState: PagerState = - PagerState( - currentPage = initialResource, - pageCount = { publication.readingOrder.size } - ) - internal val scrollState: RenditionScrollState = RenditionScrollState( pagerState = pagerState, @@ -177,16 +189,69 @@ public class ReflowableWebRenditionState internal constructor( WebViewClient(webViewServer) } - private lateinit var navigationDelegate: ReflowableNavigationDelegate + internal lateinit var navigationDelegate: ReflowableNavigationDelegate + + internal fun updateLocation() { + val location = computeLocation() ?: return + val viewport = computeViewport() ?: return + if (!::navigationDelegate.isInitialized) { + initController(location, viewport) + } else { + navigationDelegate.updateLocation(location, viewport) + } + } + + private fun computeLocation(): ReflowableWebLocation? { + val currentIndex = pagerState.currentPage + val currentItem = publication.readingOrder.items[currentIndex] + val progression = resourceStates[currentIndex].progressionRange?.start ?: return null + val position = publication.positionForProgression(currentIndex, progression) + return ReflowableWebLocation( + href = currentItem.href, + mediaType = currentItem.mediaType, + progression = progression, + position = position, + totalProgression = publication.totalProgressionForPosition(position) + ) + } + + private fun computeViewport(): ReflowableWebViewport? { + val indexedVisibleItems = pagerState.layoutInfo.visiblePagesInfo + .map { it.index to publication.readingOrder[it.index] } + + check(indexedVisibleItems.isNotEmpty()) + + val progressions = indexedVisibleItems + .mapNotNull { (index, _) -> resourceStates[index].progressionRange } + + // Have all visible items already set a progressionRange? + if (progressions.size != indexedVisibleItems.size) { + return null + } + + val startPosition = publication + .positionForProgression(indexedVisibleItems.first().first, progressions.first().start) - internal fun initController(location: ReflowableWebLocation) { + val endPosition = publication + .positionForProgression(indexedVisibleItems.last().first, progressions.last().endInclusive) + + return ReflowableWebViewport( + readingOrder = indexedVisibleItems.map { it.second.href }, + progressions = indexedVisibleItems.zip(progressions) + .associate { (indexedItem, progression) -> indexedItem.second.href to progression }, + positions = startPosition..endPosition + ) + } + + internal fun initController(location: ReflowableWebLocation, viewport: ReflowableWebViewport) { navigationDelegate = ReflowableNavigationDelegate( - publication.readingOrder, + publication, resourceStates, pagerState, layoutDelegate.overflow, - location + location, + viewport ) controllerState.value = ReflowableWebRenditionController( @@ -195,18 +260,13 @@ public class ReflowableWebRenditionState internal constructor( decorationDelegate, selectionDelegate ) - updateLocation(location) - } - - internal fun updateLocation(location: ReflowableWebLocation) { - navigationDelegate.updateLocation(location) } } @ExperimentalReadiumApi @Stable public class ReflowableWebRenditionController internal constructor( - navigationDelegate: ReflowableNavigationDelegate, + internal val navigationDelegate: ReflowableNavigationDelegate, layoutDelegate: ReflowableLayoutDelegate, decorationDelegate: ReflowableDecorationDelegate, selectionDelegate: ReflowableSelectionDelegate, @@ -214,7 +274,11 @@ public class ReflowableWebRenditionController internal constructor( OverflowController by navigationDelegate, SettingsController by layoutDelegate, DecorationController by decorationDelegate, - SelectionController by selectionDelegate + SelectionController by selectionDelegate { + + public val viewport: ReflowableWebViewport get() = + navigationDelegate.viewport +} @OptIn(ExperimentalReadiumApi::class, InternalReadiumApi::class) internal class ReflowableLayoutDelegate( @@ -222,16 +286,18 @@ internal class ReflowableLayoutDelegate( initialSettings: ReflowableWebSettings, ) : SettingsController { - private val paginatedLayoutResolver = - PaginatedLayoutResolver( - baseMinMargins = 15.dp, - baseMinLineLength = 200.dp, - baseOptimalLineLength = 400.dp, - baseMaxLineLength = 600.dp + private val layoutResolver = + LayoutResolver( + baseMinMargins = LayoutConstants.baseMinMargins, + baseMinLineLength = LayoutConstants.baseMinLineLength, + baseOptimalLineLength = LayoutConstants.baseOptimalLineLength, + baseMaxLineLength = LayoutConstants.baseMaxLineLength ) internal var viewportSize: DpSize? by mutableStateOf(null) + internal var safeDrawing: AbsolutePaddingValues? by mutableStateOf(null) + internal var fontScale: Float? by mutableStateOf(null) override var settings: ReflowableWebSettings by mutableStateOf(initialSettings) @@ -257,74 +323,120 @@ internal class ReflowableLayoutDelegate( ).withSettings( settings = settings, ).let { injector -> - if (viewportSize == null || fontScale == null || settings.scroll) { + if (viewportSize == null || safeDrawing == null || fontScale == null) { injector } else { injector.withLayout( - paginatedLayoutResolver.layout( + fontSize = settings.fontSize, + verticalText = settings.verticalText, + safeDrawing = safeDrawing!!, + layout = layoutResolver.layout( settings = settings, systemFontScale = fontScale!!, - viewportWidth = viewportSize!!.width + viewportSize = viewportSize!!, + safeDrawing = safeDrawing!! ) ) } } } - - internal val orientation: Orientation get() = - overflow.value.axis.toOrientation() } +internal val Overflow.orientation: Orientation get() = + axis.toOrientation() + @OptIn(ExperimentalReadiumApi::class, InternalReadiumApi::class) internal class ReflowableNavigationDelegate( - private val readingOrder: ReflowableWebPublication.ReadingOrder, + private val publication: ReflowableWebPublication, private val resourceStates: List, private val pagerState: PagerState, overflowState: State, initialLocation: ReflowableWebLocation, + initialViewport: ReflowableWebViewport, ) : NavigationController, OverflowController { + private val navigatorMutex: MutatorMutex = + MutatorMutex() + private val locationMutable: MutableState = mutableStateOf(initialLocation) - internal fun updateLocation(location: ReflowableWebLocation) { - val index = checkNotNull(readingOrder.indexOfHref(location.href)) - resourceStates[index].progression = location.progression + private val viewportMutable: MutableState = + mutableStateOf(initialViewport) + + fun updateLocation(location: ReflowableWebLocation, viewport: ReflowableWebViewport) { locationMutable.value = location + viewportMutable.value = viewport } override val overflow: Overflow by overflowState override val location: ReflowableWebLocation by locationMutable + val viewport: ReflowableWebViewport by viewportMutable + override suspend fun goTo(url: Url) { val location = ReflowableWebGoLocation( - href = url.removeFragment() - // TODO: use fragment + href = url.removeFragment(), + htmlId = url.fragment?.let { HtmlId(it) } ) goTo(location) } - override suspend fun goTo(location: ReflowableWebGoLocation) { - val resourceIndex = readingOrder.indexOfHref(location.href) ?: return - pagerState.scrollToPage(resourceIndex) - location.progression?.let { // FIXME: goTo returns before the move has completed. - resourceStates[resourceIndex].progression = it - // If the scrollController is not available yet, progression will be applied - // when it becomes available. - resourceStates[resourceIndex].scrollController.value?.moveToProgression(it) - } - } - override suspend fun goTo(location: ReflowableWebLocation) { goTo(ReflowableWebGoLocation(location.href, location.progression)) } + override suspend fun goTo(location: ReflowableWebGoLocation) { + coroutineScope { + navigatorMutex.mutateWith( + receiver = this, + priority = MutatePriority.UserInput + ) { + withContext(Dispatchers.Main) { + val destIndex = publication.readingOrder.indexOfHref(location.href) + ?: return@withContext + + val destLocation = location.toResourceLocation() + val resourceLocations = publication.getResourceLocations(destIndex, destLocation) + + fun cleanUp() { + resourceStates.zip(resourceLocations) + .forEach { (state, location) -> + state.cancelPendingLocation(location) + } + } + + try { + pagerState.scrollToPage(destIndex) + + suspendCancellableCoroutine { continuation -> + continuation.invokeOnCancellation { + cleanUp() + } + resourceStates.zip(resourceLocations) + .forEach { (state, location) -> + state.go( + location = location, + continuation = continuation.takeIf { state === resourceStates[destIndex] } + ) + } + } + } catch (e: Exception) { // Mainly for CancellationException + cleanUp() + throw e + } + } + } + } + } + // This information is not available when the WebView has not yet been composed or laid out. // We assume that the best UI behavior would be to have a possible forward button disabled // and return false when we can't tell. + // FIXME: should probably be observable. override val canMoveForward: Boolean - get() = pagerState.currentPage < readingOrder.items.size - 1 || run { + get() = pagerState.currentPage < publication.readingOrder.items.size - 1 || run { val currentResourceState = resourceStates[pagerState.currentPage] val scrollController = currentResourceState.scrollController.value ?: return false return scrollController.canMoveForward() @@ -338,22 +450,32 @@ internal class ReflowableNavigationDelegate( } override suspend fun moveForward() { - val currentResourceState = resourceStates[pagerState.currentPage] - val scrollController = currentResourceState.scrollController.value ?: return - if (scrollController.canMoveForward()) { - scrollController.moveForward() - } else if (pagerState.currentPage < readingOrder.items.size - 1) { - pagerState.scrollToPage(pagerState.currentPage + 1) + coroutineScope { + navigatorMutex.tryMutate { + val currentResourceState = resourceStates[pagerState.currentPage] + val scrollController = + currentResourceState.scrollController.value ?: return@tryMutate + if (scrollController.canMoveForward()) { + scrollController.moveForward() + } else if (pagerState.currentPage < publication.readingOrder.items.size - 1) { + pagerState.scrollToPage(pagerState.currentPage + 1) + } + } } } override suspend fun moveBackward() { - val currentResourceState = resourceStates[pagerState.currentPage] - val scrollController = currentResourceState.scrollController.value ?: return - if (scrollController.canMoveBackward()) { - scrollController.moveBackward() - } else if (pagerState.currentPage > 0) { - pagerState.scrollToPage(pagerState.currentPage - 1) + coroutineScope { + navigatorMutex.tryMutate { + val currentResourceState = resourceStates[pagerState.currentPage] + val scrollController = + currentResourceState.scrollController.value ?: return@tryMutate + if (scrollController.canMoveBackward()) { + scrollController.moveBackward() + } else if (pagerState.currentPage > 0) { + pagerState.scrollToPage(pagerState.currentPage - 1) + } + } } } @@ -379,15 +501,6 @@ internal class ReflowableNavigationDelegate( orientation = overflow.axis.toOrientation(), direction = overflow.readingProgression.toLayoutDirection() ) - - private fun WebViewScrollController.moveToProgression(progression: Progression) { - moveToProgression( - progression = progression.value, - snap = !overflow.scroll, - orientation = overflow.axis.toOrientation(), - direction = overflow.readingProgression.toLayoutDirection() - ) - } } internal class ReflowableDecorationDelegate( @@ -395,7 +508,7 @@ internal class ReflowableDecorationDelegate( ) : DecorationController { override var decorations: PersistentMap> by - mutableStateOf(persistentMapOf>()) + mutableStateOf(persistentMapOf()) } internal class ReflowableSelectionDelegate( @@ -437,3 +550,30 @@ internal class ReflowableSelectionDelegate( } } } + +private data class IndexedGoLocation( + val index: Int, + val location: ReflowableWebGoLocation, +) + +private fun ReflowableWebGoLocation.toResourceLocation() = + textAnchor?.let { ReflowableResourceLocation.TextAnchor(it) } + ?: cssSelector?.let { ReflowableResourceLocation.CssSelector(it) } + ?: htmlId?.let { ReflowableResourceLocation.HtmlId(it) } + ?: ReflowableResourceLocation.Progression(progression ?: Progression(0.0)!!) + +private fun ReflowableWebPublication.getResourceLocations( + destinationIndex: Int, + destinationLocation: ReflowableResourceLocation, +): List { + return readingOrder.items.mapIndexed { index, _ -> + when { + index < destinationIndex -> + ReflowableResourceLocation.Progression(Progression(1.0)!!) + index > destinationIndex -> + ReflowableResourceLocation.Progression(Progression(0.0)!!) + else -> + destinationLocation + } + } +} diff --git a/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/css/ReadiumCssInjector.kt b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/css/ReadiumCssInjector.kt index b98dc134d4..595b2e3f79 100644 --- a/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/css/ReadiumCssInjector.kt +++ b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/css/ReadiumCssInjector.kt @@ -15,8 +15,10 @@ import org.jsoup.nodes.Element import org.readium.navigator.web.common.FontFaceDeclaration import org.readium.navigator.web.common.FontFamilyDeclaration import org.readium.navigator.web.common.FontWeight +import org.readium.navigator.web.internals.util.AbsolutePaddingValues import org.readium.navigator.web.reflowable.css.Color as CssColor import org.readium.navigator.web.reflowable.css.TextAlign as CssTextAlign +import org.readium.navigator.web.reflowable.layout.Layout import org.readium.navigator.web.reflowable.preferences.ReflowableWebSettings import org.readium.r2.navigator.preferences.Color import org.readium.r2.navigator.preferences.FontFamily @@ -335,7 +337,6 @@ internal fun ReadiumCssInjector.withSettings(settings: ReflowableWebSettings): R copy( layout = ReadiumCssLayout.from(settings), rsProperties = rsProperties.copy( - pageGutter = Length.Px(20.0 * minMargins), textColor = textColor.toCss(), backgroundColor = backgroundColor.toCss(), linkColor = linkColor.toCss(), @@ -343,17 +344,15 @@ internal fun ReadiumCssInjector.withSettings(settings: ReflowableWebSettings): R ), userProperties = userProperties.copy( view = when (scroll) { - false -> View.PAGED + false -> if (verticalText) View.SCROLL else View.PAGED true -> View.SCROLL }, - colCount = columnCount, darkenImages = imageFilter == ImageFilter.DARKEN, invertImages = imageFilter == ImageFilter.INVERT, textColor = textColor.toCss().takeIf { overridePublisherColors }, backgroundColor = backgroundColor.toCss().takeIf { overridePublisherColors }, linkColor = linkColor.toCss().takeIf { overridePublisherColors }, visitedLinkColor = visitedColor.toCss().takeIf { overridePublisherColors }, - fontOverride = true, // we don't need this guard, fontFamily = fontFamily?.toCss(), fontSize = Length.Percent(fontSize), fontWeight = fontWeight?.let { (FontWeight.NORMAL.value * it).toInt().coerceIn(1, 1000) }, @@ -387,14 +386,34 @@ internal fun ReadiumCssInjector.withSettings(settings: ReflowableWebSettings): R } } +// CSS zoom multiplies the px line value by +// the zoom factor so we need to do the reverse thing. +// If we don't, line length decreases with fontSize. internal fun ReadiumCssInjector.withLayout( - viewportLayout: PaginatedLayout, -): ReadiumCssInjector = copy( - rsProperties = rsProperties.copy( - pageGutter = Length.Px(viewportLayout.pageGutter.value.toDouble()) - ), - userProperties = userProperties.copy( - colCount = viewportLayout.colCount, - lineLength = viewportLayout.lineLength?.let { Length.Px(it.value.toDouble()) } - ) -) + fontSize: Double, + verticalText: Boolean, + safeDrawing: AbsolutePaddingValues, + layout: Layout, +): ReadiumCssInjector = + copy( + userProperties = userProperties.copy( + colCount = layout.colCount, + lineLength = Length.Px(layout.lineLength.value.toDouble() / fontSize) + ) + ).run { + if (verticalText) { + copy( + rsProperties = rsProperties.copy( + scrollPaddingLeft = Length.Px(safeDrawing.left.value.toDouble() / fontSize), + scrollPaddingRight = Length.Px(safeDrawing.right.value.toDouble() / fontSize) + ) + ) + } else { + copy( + rsProperties = rsProperties.copy( + scrollPaddingTop = Length.Px(safeDrawing.top.value.toDouble() / fontSize), + scrollPaddingBottom = Length.Px(safeDrawing.bottom.value.toDouble() / fontSize), + ) + ) + } + } diff --git a/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/css/ReadiumCssProperties.kt b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/css/ReadiumCssProperties.kt index 497937347d..f4a3bf37d9 100644 --- a/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/css/ReadiumCssProperties.kt +++ b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/css/ReadiumCssProperties.kt @@ -9,7 +9,6 @@ package org.readium.navigator.web.reflowable.css import androidx.annotation.ColorInt -import java.text.NumberFormat import java.util.* import kotlin.collections.iterator import org.readium.r2.shared.ExperimentalReadiumApi @@ -51,7 +50,6 @@ internal interface ReadiumCssProperties : Cssable { * variable. * @param linkColor The color for links. * @param visitedLinkColor The color for visited links. - * @param fontOverride This flag is required to change the font-family user setting. * @param fontFamily The typeface (font-family) the user wants to read with. It impacts body, p, * li, div, dt, dd and phrasing elements which don’t have a lang or xml:lang attribute. To reset, * remove the required flag. Requires: fontOverride @@ -172,6 +170,10 @@ internal data class UserProperties( * @param colGap The gap between columns. You must account for this gap when scrolling. * @param pageGutter The horizontal page margins. * @param disableVerticalPagination If pagination should be disabled with vertical text. + * @param scrollPaddingTop Padding amount to insert at the top of resources in scroll mode. + * @param scrollPaddingBottom Padding amount to insert at the bottom of resources in scroll mode. + * @param scrollPaddingLeft Padding amount to insert at the left of resources in scroll mode. + * @param scrollPaddingRight Padding amount to insert at the right of resources in scroll mode. * @param flowSpacing The default vertical margins for HTML5 flow content e.g. pre, figure, * blockquote, etc. * @param paraSpacing The default vertical margins for paragraphs. @@ -222,6 +224,12 @@ internal data class RsProperties( val pageGutter: Length.Px? = null, val disableVerticalPagination: Boolean? = null, + // Scroll padding + val scrollPaddingTop: Length? = null, + val scrollPaddingBottom: Length? = null, + val scrollPaddingLeft: Length? = null, + val scrollPaddingRight: Length? = null, + // Vertical rhythm val flowSpacing: Length? = null, val paraSpacing: Length? = null, @@ -269,13 +277,21 @@ internal data class RsProperties( ) : ReadiumCssProperties { override fun toCssProperties(): Map = buildMap { + check(pageGutter == null) + // Pagination putCss("--RS__colWidth", colWidth) putCss("--RS__colCount", colCount) putCss("--RS__colGap", colGap) - putCss("--RS__pageGutter", pageGutter) + // putCss("--RS__pageGutter", pageGutter) // pageGutter conflicts with scrollPaddingX properties putCss("--RS__disablePagination", flag("noVerticalPagination", disableVerticalPagination)) + // Scroll padding + putCss("--RS__scrollPaddingTop", scrollPaddingTop) + putCss("--RS__scrollPaddingBottom", scrollPaddingBottom) + putCss("--RS__scrollPaddingLeft", scrollPaddingLeft) + putCss("--RS__scrollPaddingRight", scrollPaddingRight) + // Vertical rhythm putCss("--RS__flowSpacing", flowSpacing) putCss("--RS__paraSpacing", paraSpacing) @@ -562,7 +578,4 @@ private fun String.toCss(): String = * Converts a [Double] to a string literal with the given [unit]. */ private fun Double.toCss(unit: String): String = - NumberFormat.getNumberInstance(Locale.ROOT).run { - maximumFractionDigits = 2 - format(this@toCss) - } + unit + String.format(Locale.ROOT, "%e%s", this, unit) diff --git a/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/layout/LayoutConstants.kt b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/layout/LayoutConstants.kt new file mode 100644 index 0000000000..e721828c64 --- /dev/null +++ b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/layout/LayoutConstants.kt @@ -0,0 +1,19 @@ +/* + * Copyright 2026 Readium Foundation. All rights reserved. + * Use of this source code is governed by the BSD-style license + * available in the top-level LICENSE file of the project. + */ + +package org.readium.navigator.web.reflowable.layout + +import androidx.compose.ui.unit.dp + +internal object LayoutConstants { + + val pageVerticalMarginsLandscape = 20.dp + val pageVerticalMarginsPortrait = 70.dp + val baseMinMargins = 30.dp + val baseMinLineLength = 440.dp + val baseOptimalLineLength = 640.dp + val baseMaxLineLength = 740.dp +} diff --git a/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/css/PaginatedLayout.kt b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/layout/LayoutResolver.kt similarity index 54% rename from readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/css/PaginatedLayout.kt rename to readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/layout/LayoutResolver.kt index 63d1b21432..429a4057b4 100644 --- a/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/css/PaginatedLayout.kt +++ b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/layout/LayoutResolver.kt @@ -6,70 +6,122 @@ @file:OptIn(ExperimentalReadiumApi::class) -package org.readium.navigator.web.reflowable.css +package org.readium.navigator.web.reflowable.layout import androidx.compose.ui.unit.Dp +import androidx.compose.ui.unit.DpSize +import androidx.compose.ui.unit.coerceAtLeast import androidx.compose.ui.unit.coerceAtMost +import androidx.compose.ui.unit.max import kotlin.math.floor import kotlin.math.roundToInt +import org.readium.navigator.web.internals.util.AbsolutePaddingValues import org.readium.navigator.web.reflowable.preferences.ReflowableWebSettings import org.readium.r2.shared.ExperimentalReadiumApi -internal data class PaginatedLayout( +internal data class Layout( val colCount: Int, - val lineLength: Dp?, - val pageGutter: Dp, + val lineLength: Dp, ) -internal class PaginatedLayoutResolver( +internal class LayoutResolver( private val baseMinMargins: Dp, private val baseOptimalLineLength: Dp, private val baseMinLineLength: Dp, private val baseMaxLineLength: Dp, ) { - fun layout( settings: ReflowableWebSettings, systemFontScale: Float, - viewportWidth: Dp, - ): PaginatedLayout { - val fontScale = systemFontScale * settings.fontSize.toFloat() - val minPageGutter = - baseMinMargins * settings.minMargins.toFloat() + viewportSize: DpSize, + safeDrawing: AbsolutePaddingValues, + ): Layout { val optimalLineLength = - baseOptimalLineLength * settings.optimalLineLength.toFloat() * fontScale + baseOptimalLineLength * settings.optimalLineLength.toFloat() * systemFontScale val minLineLength = - settings.minimalLineLength?.let { baseMinLineLength * it.toFloat() * fontScale } + settings.minimalLineLength?.let { baseMinLineLength * it.toFloat() * systemFontScale } val maxLineLength = - settings.maximalLineLength?.let { baseMaxLineLength * it.toFloat() * fontScale } + settings.maximalLineLength?.let { baseMaxLineLength * it.toFloat() * systemFontScale } + val minMargins = + baseMinMargins * settings.minMargins.toFloat() * systemFontScale + + val minMarginsWithInsets = when (settings.verticalText) { + true -> minMargins.coerceAtLeast(max(safeDrawing.top, safeDrawing.bottom)) + false -> minMargins.coerceAtLeast(max(safeDrawing.left, safeDrawing.right)) + } + + return when (settings.scroll) { + true -> + scrolledLayout( + viewportSize = if (settings.verticalText) viewportSize.height else viewportSize.width, + minimalMargins = minMarginsWithInsets, + maximalLineLength = maxLineLength + ) + false -> + paginatedLayout( + viewportWidth = viewportSize.width, + requestedColCount = settings.columnCount, + minimalMargins = minMarginsWithInsets, + optimalLineLength = optimalLineLength, + maximalLineLength = maxLineLength, + minimalLineLength = minLineLength + ) + } + } + + private fun scrolledLayout( + viewportSize: Dp, + minimalMargins: Dp, + maximalLineLength: Dp?, + ): Layout { + val minMargins = minimalMargins.coerceAtMost(viewportSize) + + val availableSize = viewportSize - minMargins * 2 + + val maximalLineLength = maximalLineLength?.coerceAtLeast(minMargins * 2) + + val lineLength = availableSize.coerceAtMost(maximalLineLength ?: availableSize) + + return Layout( + colCount = 1, + lineLength = lineLength + ) + } - return when (val colCount = settings.columnCount) { + private fun paginatedLayout( + viewportWidth: Dp, + requestedColCount: Int?, + minimalMargins: Dp, + optimalLineLength: Dp, + maximalLineLength: Dp?, + minimalLineLength: Dp?, + ): Layout { + return when (requestedColCount) { null -> - layoutAuto( - minimalPageGutter = minPageGutter, + paginatedLayoutAuto( + minimalPageGutter = minimalMargins, viewportWidth = viewportWidth, optimalLineLength = optimalLineLength, - maximalLineLength = maxLineLength, + maximalLineLength = maximalLineLength, ) - else -> - layoutNColumns( - colCount = colCount, - minimalPageGutter = minPageGutter, + paginatedLayoutNColumns( + colCount = requestedColCount, + minimalMargins = minimalMargins, viewportWidth = viewportWidth, - maximalLineLength = maxLineLength, - minimalLineLength = minLineLength, + maximalLineLength = maximalLineLength, + minimalLineLength = minimalLineLength, ) } } - private fun layoutAuto( + private fun paginatedLayoutAuto( minimalPageGutter: Dp, optimalLineLength: Dp, viewportWidth: Dp, maximalLineLength: Dp?, - ): PaginatedLayout { + ): Layout { /* * marginWidth = 2 * pageGutter * colCount * colCount = (viewportWidth - marginWidth) / optimalLineLength @@ -94,25 +146,21 @@ internal class PaginatedLayoutResolver( .let { it.coerceAtMost(maximalLineLength ?: it) } .coerceAtMost((viewportWidth - minMarginWidth) / colCount) - val finalMarginWidth = (viewportWidth - lineLength * colCount) - - val pageGutter = finalMarginWidth / colCount / 2 - - return PaginatedLayout(colCount, lineLength, pageGutter) + return Layout(colCount, lineLength) } - private fun layoutNColumns( + private fun paginatedLayoutNColumns( colCount: Int, - minimalPageGutter: Dp, + minimalMargins: Dp, viewportWidth: Dp, minimalLineLength: Dp?, maximalLineLength: Dp?, - ): PaginatedLayout { - val minPageGutter = minimalPageGutter.coerceAtMost(viewportWidth) + ): Layout { + val minPageGutter = minimalMargins.coerceAtMost(viewportWidth) val actualAvailableWidth = viewportWidth - minPageGutter * 2 * colCount - val minimalLineLength = minimalLineLength?.coerceAtMost(viewportWidth - minPageGutter * 2) + val minimalLineLength = minimalLineLength?.coerceAtMost(actualAvailableWidth) val maximalLineLength = maximalLineLength?.coerceAtLeast(minPageGutter * 2) @@ -120,26 +168,22 @@ internal class PaginatedLayoutResolver( return when { minimalLineLength != null && lineLength < minimalLineLength -> - layoutNColumns( + paginatedLayoutNColumns( colCount = colCount - 1, - minimalPageGutter = minPageGutter, + minimalMargins = minPageGutter, viewportWidth = viewportWidth, minimalLineLength = minimalLineLength, maximalLineLength = maximalLineLength ) maximalLineLength != null && lineLength > maximalLineLength -> - layoutNColumns( - colCount = colCount + 1, - minimalPageGutter = minPageGutter, - viewportWidth = viewportWidth, - minimalLineLength = minimalLineLength, - maximalLineLength = maximalLineLength, + Layout( + colCount = colCount, + lineLength = maximalLineLength, ) else -> - PaginatedLayout( + Layout( colCount = colCount, lineLength = lineLength, - pageGutter = minPageGutter, ) } } diff --git a/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/preferences/ReflowableWebPreferencesEditor.kt b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/preferences/ReflowableWebPreferencesEditor.kt index e66b0b4d20..90082e1ec4 100644 --- a/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/preferences/ReflowableWebPreferencesEditor.kt +++ b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/preferences/ReflowableWebPreferencesEditor.kt @@ -466,7 +466,7 @@ public class ReflowableWebPreferencesEditor internal constructor( private fun ReflowableWebPreferences.toState(): State { val settings = settingsResolver.settings(this) - val readiumCssLayout = ReadiumCssLayout.Companion.from(settings) + val readiumCssLayout = ReadiumCssLayout.from(settings) return State( preferences = this, diff --git a/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/resource/ReflowableResource.kt b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/resource/ReflowableResource.kt index cdc9a4f3c8..4189b5b3a8 100644 --- a/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/resource/ReflowableResource.kt +++ b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/resource/ReflowableResource.kt @@ -26,15 +26,16 @@ import androidx.compose.runtime.setValue import androidx.compose.runtime.snapshotFlow import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.unit.DpOffset import androidx.compose.ui.unit.LayoutDirection +import androidx.compose.ui.unit.dp import androidx.compose.ui.zIndex import kotlinx.collections.immutable.ImmutableMap import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import org.readium.navigator.common.DecorationChange import org.readium.navigator.common.DecorationListener -import org.readium.navigator.common.Progression import org.readium.navigator.common.TapEvent import org.readium.navigator.common.changesByHref import org.readium.navigator.web.common.WebDecorationTemplate @@ -49,15 +50,19 @@ import org.readium.navigator.web.internals.webapi.Decoration import org.readium.navigator.web.internals.webapi.DelegatingDocumentApiListener import org.readium.navigator.web.internals.webapi.DelegatingGesturesListener import org.readium.navigator.web.internals.webapi.DelegatingReflowableApiStateListener +import org.readium.navigator.web.internals.webapi.DelegatingSelectionListener import org.readium.navigator.web.internals.webapi.DocumentStateApi import org.readium.navigator.web.internals.webapi.GesturesApi import org.readium.navigator.web.internals.webapi.ReadiumCssApi import org.readium.navigator.web.internals.webapi.ReflowableApiStateApi import org.readium.navigator.web.internals.webapi.ReflowableDecorationApi +import org.readium.navigator.web.internals.webapi.ReflowableMoveApi import org.readium.navigator.web.internals.webapi.ReflowableSelectionApi +import org.readium.navigator.web.internals.webapi.SelectionListenerApi import org.readium.navigator.web.internals.webview.RelaxedWebView import org.readium.navigator.web.internals.webview.WebView import org.readium.navigator.web.internals.webview.WebViewScrollController +import org.readium.navigator.web.internals.webview.invokeOnWebViewUpToDate import org.readium.navigator.web.internals.webview.rememberWebViewState import org.readium.navigator.web.reflowable.ReflowableWebDecoration import org.readium.navigator.web.reflowable.ReflowableWebDecorationCssSelectorLocation @@ -88,7 +93,7 @@ internal fun ReflowableResource( onTap: (TapEvent) -> Unit, onLinkActivated: (Url, String) -> Unit, onDecorationActivated: (DecorationListener.OnActivatedEvent) -> Unit, - onProgressionChange: (Progression) -> Unit, + onLocationChange: () -> Unit, onDocumentResized: () -> Unit, ) { Box( @@ -107,10 +112,15 @@ internal fun ReflowableResource( mutableStateOf(null) } + var selectionListenerApi by remember(webViewState.webView) { + mutableStateOf(null) + } + LaunchedEffect(webViewState.webView) { webViewState.webView?.let { webView -> gesturesApi = GesturesApi(webView) documentStateApi = DocumentStateApi(webView) + selectionListenerApi = SelectionListenerApi(webView) } } @@ -126,6 +136,10 @@ internal fun ReflowableResource( mutableStateOf(null) } + var moveApi by remember(webViewState.webView) { + mutableStateOf(null) + } + val decorations = remember(webViewState.webView) { mutableStateOf(decorations) } .apply { value = decorations } @@ -148,6 +162,9 @@ internal fun ReflowableResource( }, onDecorationApiAvailableDelegate = { decorationApi = ReflowableDecorationApi(webView, decorationTemplates) + }, + onMoveApiAvailableDelegate = { + moveApi = ReflowableMoveApi(webView) } ) ReflowableApiStateApi(webView, listener) @@ -167,28 +184,61 @@ internal fun ReflowableResource( documentStateApi.listener = DelegatingDocumentApiListener( onDocumentLoadedAndSizedDelegate = { Timber.d("resource ${resourceState.index} onDocumentLoadedAndResized") - webView.requestLayout() - webView.setNextLayoutListener { + webView.invokeOnWebViewUpToDate { val scrollController = WebViewScrollController(webView) - scrollController.moveToProgression( - progression = resourceState.progression.value, - snap = !scroll, - orientation = orientation, - direction = layoutDirection - ) resourceState.scrollController.value = scrollController Timber.d("resource ${resourceState.index} ready to scroll") + + when (val pending = resourceState.pendingLocation) { + is ReflowableResourceLocation.HtmlId, + is ReflowableResourceLocation.CssSelector, + is ReflowableResourceLocation.TextAnchor, + -> { + // Wait for the MoveApi + } + is ReflowableResourceLocation.Progression -> { + scrollController.moveToProgression( + progression = pending.value.value, + snap = !scroll, + orientation = orientation, + direction = layoutDirection + ) + resourceState.acknowledgePendingLocation( + location = pending, + orientation = orientation, + direction = layoutDirection + ) + onLocationChange() + } + null -> { + scrollController.moveToProgression( + progression = resourceState.currentProgression!!.value, + snap = !scroll, + orientation = orientation, + direction = layoutDirection + ) + + resourceState.updateProgression( + orientation = orientation, + direction = layoutDirection + ) + onLocationChange() + } + } + webView.setOnScrollChangeListener { view, scrollX, scrollY, oldScrollX, oldScrollY -> - scrollController.progression( - orientation, - layoutDirection - )?.let { onProgressionChange(Progression(it)!!) } + resourceState.updateProgression(orientation, layoutDirection) + onLocationChange() } showPlaceholder.value = false } }, onDocumentResizedDelegate = { Timber.d("resource ${resourceState.index} onDocumentResized") + resourceState.updateProgression( + orientation = orientation, + direction = layoutDirection + ) onDocumentResized.invoke() } ) @@ -196,29 +246,105 @@ internal fun ReflowableResource( } } - LaunchedEffect(gesturesApi, onTap, onLinkActivated, padding) { + val density = LocalDensity.current + + LaunchedEffect(moveApi, resourceState.scrollController.value) { + moveApi?.let { moveApi -> + resourceState.scrollController.value?.let { scrollController -> + snapshotFlow { + resourceState.pendingLocation + }.onEach { pendingLocation -> + pendingLocation?.let { + when (pendingLocation) { + is ReflowableResourceLocation.Progression -> { + scrollController.moveToProgression( + progression = pendingLocation.value.value, + snap = !scroll, + orientation = orientation, + direction = layoutDirection + ) + } + else -> { + val offset = when (pendingLocation) { + is ReflowableResourceLocation.CssSelector -> { + moveApi.getOffsetForLocation( + progression = null, + cssSelector = pendingLocation.value, + orientation = orientation + ) + } + is ReflowableResourceLocation.TextAnchor -> { + moveApi.getOffsetForLocation( + progression = null, + textAnchor = pendingLocation.value, + orientation = orientation + ) + } + is ReflowableResourceLocation.HtmlId -> { + moveApi.getOffsetForLocation( + progression = null, + htmlId = pendingLocation.value, + orientation = orientation + ) + } + } + offset?.let { offset -> + scrollController.moveToOffset( + offset = with(density) { offset.dp.roundToPx() }, + snap = !scroll, + orientation = orientation, + ) + } + } + } + resourceState.acknowledgePendingLocation( + location = pendingLocation, + orientation = orientation, + direction = layoutDirection + ) + onLocationChange() + } + }.launchIn(this) + } + } + } + + LaunchedEffect(gesturesApi, selectionListenerApi, onTap, onLinkActivated, padding) { gesturesApi?.let { gesturesApi -> - gesturesApi.listener = DelegatingGesturesListener( - onTapDelegate = { offset -> - val shiftedOffset = offset + paddingShift - onTap(TapEvent(shiftedOffset)) - }, - onLinkActivatedDelegate = { href, outerHtml -> - onLinkActivated(publicationBaseUrl.relativize(href), outerHtml) - }, - onDecorationActivatedDelegate = { id, group, rect, offset -> - val decoration = decorations.value[group]?.firstOrNull { it.id.value == id } - ?: return@DelegatingGesturesListener - - val event = DecorationListener.OnActivatedEvent( - decoration = decoration, - group = group, - rect = rect.shift(paddingShift), - offset = offset + paddingShift - ) - onDecorationActivated(event) - } - ) + selectionListenerApi?.let { selectionListenerApi -> + var isSelecting = false + selectionListenerApi.listener = DelegatingSelectionListener( + onSelectionStartDelegate = { isSelecting = true }, + onSelectionEndDelegate = { isSelecting = false } + ) + + gesturesApi.listener = DelegatingGesturesListener( + onTapDelegate = { offset -> + // There's an on-going selection, the tap will dismiss it so we don't forward it. + if (isSelecting) { + return@DelegatingGesturesListener + } + + val shiftedOffset = offset + paddingShift + onTap(TapEvent(shiftedOffset)) + }, + onLinkActivatedDelegate = { href, outerHtml -> + onLinkActivated(publicationBaseUrl.relativize(href), outerHtml) + }, + onDecorationActivatedDelegate = { id, group, rect, offset -> + val decoration = decorations.value[group]?.firstOrNull { it.id.value == id } + ?: return@DelegatingGesturesListener + + val event = DecorationListener.OnActivatedEvent( + decoration = decoration, + group = group, + rect = rect.shift(paddingShift), + offset = offset + paddingShift + ) + onDecorationActivated(event) + } + ) + } } } @@ -227,9 +353,11 @@ internal fun ReflowableResource( var lastDecorations = emptyMap>() snapshotFlow { decorations.value } .onEach { - for ((group, decos) in it.entries) { + val oldAndUpdatesGroups = it.keys + lastDecorations.keys + for (group in oldAndUpdatesGroups) { + val updatedInGroup = it[group].orEmpty() val lastInGroup = lastDecorations[group].orEmpty() - for ((_, changes) in lastInGroup.changesByHref(decos)) { + for ((_, changes) in lastInGroup.changesByHref(updatedInGroup)) { for (change in changes) { when (change) { is DecorationChange.Added -> { @@ -276,7 +404,9 @@ internal fun ReflowableResource( } LaunchedEffect(webViewState.webView, actionModeCallback) { - webViewState.webView?.setCustomSelectionActionModeCallback(actionModeCallback) + webViewState.webView?.setCustomSelectionActionModeCallback( + callback = actionModeCallback + ) } val orientationRef by rememberUpdatedRef(orientation) @@ -286,6 +416,7 @@ internal fun ReflowableResource( WebView( modifier = Modifier .fillMaxSize() + .background(backgroundColor) .absolutePadding(padding), state = webViewState, factory = { RelaxedWebView(it) }, @@ -302,13 +433,10 @@ internal fun ReflowableResource( webview.setLayerType(View.LAYER_TYPE_HARDWARE, null) // Prevents vertical scrolling towards blank space. // See https://github.com/readium/readium-css/issues/158 - webview.setOnTouchListener(object : View.OnTouchListener { - @SuppressLint("ClickableViewAccessibility") - override fun onTouch(view: View, event: MotionEvent): Boolean { - return orientationRef == Orientation.Horizontal && - event.action == MotionEvent.ACTION_MOVE - } - }) + webview.setOnTouchListener { view, event -> + orientationRef == Orientation.Horizontal && + event.action == MotionEvent.ACTION_MOVE + } }, onDispose = { resourceState.scrollController.value = null diff --git a/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/resource/ReflowableResourceState.kt b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/resource/ReflowableResourceState.kt index 4ded8af3d7..d32aec669c 100644 --- a/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/resource/ReflowableResourceState.kt +++ b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/resource/ReflowableResourceState.kt @@ -4,24 +4,134 @@ * available in the top-level LICENSE file of the project. */ +@file:OptIn(ExperimentalReadiumApi::class) + package org.readium.navigator.web.reflowable.resource +import androidx.compose.foundation.gestures.Orientation import androidx.compose.runtime.MutableState import androidx.compose.runtime.Stable +import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.setValue +import androidx.compose.ui.unit.LayoutDirection +import kotlin.coroutines.Continuation +import kotlin.coroutines.resume import org.readium.navigator.common.Progression import org.readium.navigator.web.internals.pager.PageScrollState import org.readium.navigator.web.internals.webview.WebViewScrollController import org.readium.r2.shared.ExperimentalReadiumApi import org.readium.r2.shared.util.Url +import timber.log.Timber -@OptIn(ExperimentalReadiumApi::class) @Stable internal class ReflowableResourceState( val index: Int, val href: Url, - var progression: Progression, + initialLocation: ReflowableResourceLocation, ) : PageScrollState { - override val scrollController: MutableState = mutableStateOf(null) + private var pendingGoMutable by mutableStateOf(PendingGo(initialLocation)) + + private var lastComputedProgressionRange: ClosedRange? = null + + val pendingLocation: ReflowableResourceLocation? get() = + pendingGoMutable?.location + + val progressionRange: ClosedRange? get() = + lastComputedProgressionRange + + /** This progression will be used on resource initialization if there is no pending go. */ + var currentProgression: Progression? = + (initialLocation as? ReflowableResourceLocation.Progression)?.value ?: Progression(0.0)!! + + fun go(location: ReflowableResourceLocation, continuation: Continuation?) { + pendingGoMutable = PendingGo(location, continuation) + } + + fun cancelPendingLocation( + location: ReflowableResourceLocation, + ) { + pendingGoMutable?.let { pendingGoMutable -> + if (pendingGoMutable.location == location) { + this.pendingGoMutable = null + pendingGoMutable.continuation?.resume(Unit) + } + } + } + + fun acknowledgePendingLocation( + location: ReflowableResourceLocation, + orientation: Orientation, + direction: LayoutDirection, + ) { + val pendingGoNow = pendingGoMutable + if (location != pendingGoNow?.location) { + return + } + pendingGoMutable = if (updateProgression(orientation, direction)) { + null + } else { + pendingGoNow.copy(continuation = null) + } + + // Resume the call even in case of failed progression update because it's not + // clear when the progression will be updated again. + pendingGoNow.continuation?.resume(Unit) + } + + fun updateProgression( + orientation: Orientation, + direction: LayoutDirection, + ): Boolean { + val scrollController = scrollController.value ?: return false + + // Do not trust computed progressions to be between 0 and 1. + // Sometimes scrollX is far higher than maxScrollX. + + val startProgression = scrollController.startProgression( + orientation = orientation, + direction = direction + )?.let { Progression(it) } + ?: return false + + val endProgression = scrollController.endProgression( + orientation = orientation, + direction = direction + )?.let { Progression(it) } ?: return false + + Timber.d("updateProgression $startProgression $endProgression") + + lastComputedProgressionRange = startProgression..endProgression + currentProgression = startProgression + + return true + } + + override val scrollController: MutableState = + mutableStateOf(null) +} + +internal sealed interface ReflowableResourceLocation { + + data class Progression( + val value: org.readium.navigator.common.Progression, + ) : ReflowableResourceLocation + + data class HtmlId( + val value: org.readium.navigator.common.HtmlId, + ) : ReflowableResourceLocation + + data class CssSelector( + val value: org.readium.navigator.common.CssSelector, + ) : ReflowableResourceLocation + + data class TextAnchor( + val value: org.readium.navigator.common.TextAnchor, + ) : ReflowableResourceLocation } + +internal data class PendingGo( + val location: ReflowableResourceLocation, + val continuation: Continuation? = null, +) diff --git a/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/resource/ReflowableWebViewport.kt b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/resource/ReflowableWebViewport.kt new file mode 100644 index 0000000000..21e4edde6b --- /dev/null +++ b/readium/navigators/web/reflowable/src/main/kotlin/org/readium/navigator/web/reflowable/resource/ReflowableWebViewport.kt @@ -0,0 +1,32 @@ +/* + * Copyright 2025 Readium Foundation. All rights reserved. + * Use of this source code is governed by the BSD-style license + * available in the top-level LICENSE file of the project. + */ + +package org.readium.navigator.web.reflowable.resource + +import org.readium.navigator.common.Position +import org.readium.navigator.common.Progression +import org.readium.r2.shared.ExperimentalReadiumApi +import org.readium.r2.shared.util.Url + +/** Information about the visible portion of the publication. */ +@ExperimentalReadiumApi +public data class ReflowableWebViewport( + + /** + * Range of visible reading order resources. + */ + public val readingOrder: List, + + /** + * Range of visible scroll progressions for each visible reading order resource. + */ + public val progressions: Map>, + + /** + * Range of visible positions. + */ + public val positions: ClosedRange, +)